Posts

Showing posts with the label linux

UBoot with iMX6 - Part 1

Image
UBoot On iMX6 - Part 1 This tutorial series just including u-boot, no kernel and image will be mentioned. Platform iMX6 customized board Sabre SD platform LPDDR2 bases RS232 output Both Windows and Ubuntu PC is needed. Introduction What is u-boot? For me, I'll consider it as a BIOS or boot loader in short. For detial you can see the ref. below: Ref :  https://en.wikipedia.org/wiki/Das_U-Boot In this tutorial I'll focus on how uboot setup the controller and drive DRAM up for used. With minimum devices, only processer, DRAM and output / control with RS232, we can bootup the board and load OS with very simple hardware. If you wondering the setting of other devices like PCIe, USB .etc. you can work on those after  you finished or understand this series. Cuz this are the minimum requirement of a system, after this series you can understand tutorial like THIS rapidly. (Chinese) Create a u-boot image Ok! Let's start it! To b...

Can't find pip3 ? Here is it!

Image
Haven't update new stuff for a long time! Here comes some annoying stuff of Python3! PIP3 installed incorrectly Some times, after installed python3 manually, you some how installed it with sudo apt-get install python3-pip again. And you might get the issue like... Command «pip3» was not found, maybe you wanted to say: The command «pip» from the package «python-pip» (universe) pip3: command not found Don't be afraid! Just do what normal people come up with at the first -- Reinstall it! XD This might work in Ubuntu base linux. sudo apt-get remove python3-pip sudo apt-get install python3-pip If you are in CentOS or something try: sudo dnf reinstall python3-pip In Ubuntu using python3-pip doesn't work, I already did it~ Ok, now you can run upgrade, cuz default pip3 is version 8.0.1 sudo pip3 install --upgrade pip And... you'll found your pip DEAD, if u are as lucky as I did. Q__Q PIP3 not work while PIP3.5 did This is what u might get from pip3...

Install chrome on CentOS

Image
When installing CentOS7, This might be one of application everybody probably wanna installed. Google Chrome! Just few step, you can install it! 1. Add google repo to your yum. $ vim /etc/yum.repos.d/google.repo or $ nano /etc/yum.repos.d/google.repo Add content:  we are CentOS so...use "rpm" instead. [google64] name=Google - x86_64 baseurl=http://dl.google.com/linux/ rpm /stable/x86_64 enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub And install! $ sudo yum install google-chrome-stable Now you can have chrome ! THE END                    provide

PXE server (Preboot Execution Environment)

PXE server (Preboot Execution Environment) Combine DHCP service as well as tftp service. Provide ip address through client MAC address, and send boot image for boot up. Condition NIC (Network interface card) have to support PXE function. DHCP and TFTP services are needed. DHCP Ubuntu Install : sudo apt-get install -y isc-dhcp-server Set NIC : vim /etc/default/isc-dhcp-server INTERFACES=<Interface Name> Set Config: sudo vim /etc/dhcp/dhcpd.conf CentOS7 Install : sudo yum install -y dhcp Set NIC : vim /etc/sysconfig/dhcpd DHCPDARGS=<Interface Name> Set Config : vim /etc/dhcp/dhcpd.conf DHCP config (Ubuntu & CentOS) ignore client-updates; default-lease-time 600; max-lease-time 7200; option routers 192.168.1.254; option broadcast-address 192.168.1.255; allow booting; allow bootp; subnet 192.168.1.0 netmask 255.255.255.0 {          ...

NFS setup on Ubuntu (include fstab)

Image
Hi all, Past of month, I was too busy to write new blog, though I learn a lot of new things from work. During working, my customer asked me to build up the NFS (net file system) for them, so that they can fetch the file between computers by internal network. When It comes to NFS, you might think about SAMBA server, which can be mounted with CIFS. SAMBA is a service compatible with linux and window operating system. Since I just need to make linux OS computer connected, that is no need to build up a SAMBA server on my server PC. So let's start, First of all You have to install the nfs-server and nfs-common on server and client side. you can also check if the service is installed or not by : $ dpkg -l | grep nfs-kernel-server if not,  install the service on server and client : Server : # apt-get install nfs-kernel-server Client: # apt-get install nfs-common Now we can go through the step 2 -- setting up server. Server :     create the setting ...

Python : read / write file

Image
Hi guys, Yeah~ as you see on the top of this article, I start to learn python now! hah So... I gonna record some usage and some tutorial here about python. Okay~ Let's go! Python is good at text and data operating, so... the first thing before you parsing or do some modified to the file, you have to .... open and read / write the file!! open / close the file: file = open("filename", "type") file.close() As to type we can have : r : read w : write r+ : read/write a : append Read method :  To read all content in the file you can use... print file.read() Read line by line print file.readline() Write method : file.write("aaaa") file.write(str(123) + "\n") Open file and make it close automatically : with open("filename", "w") as file: file.write("Yes!!") Yeah~~ this is the first step ! Let's continue!                                       ...

Add a user to a group

Image
Hello, recently I'm too busy to write the blog, sorry about that. Today I gonna tried to add my user to the group. Since I using the Samba server, I set some file can be accessed by specific people. So... let's start. First of all, if you use groups , you will get something like this edwinlai@edwinlai:~$ groups edwinlai adm cdrom sudo dip plugdev lpadmin sambashare  To create a new group : edwinlai@edwinlai:~$ sudo groupadd my_group Now we want to add a user into the group! Also, you can add user to multiple group at once. edwinlai@edwinlai:~$ usermod -a -G group user edwinlai@edwinlai:~$ usermod -a -G group1,group2,group3 user And if you know what is primary group , we can change use's primary group by this command: edwinlai@edwinlai:~$ usermod -g group user Now you can use groups to see the groups include the user edwinlai@edwinlai:~$ groups user Finally, we want to create a new user and add it to the group we want. edwinlai@edwinlai:~$ usera...

Setting up git SSH key on ubuntu

Image
Yeah~~ Long time no see guys~ These day I was porting code from one computer to others by git. If you are familiar with it please don't be too serious, I'm just new of it. The problem is that typing user name and the password wasted me lots of time. Hence, I try not to use http but ssh link to the gitlab. (At least I don't need to type the username!! Especially it's an e-mail !) So ... the tutorial  to make ssh work on ubuntu to gitlab is below. 1. Generate a SSH key for ur computer. ssh-keygen -t rsa -C "yourmail@mail.com" -b 4096 2. Copy the ras key to clip board , you can copy by urself or apt-get install xclip tool to do it. xclip -sel clip < ~/.ssh/id_rsa.pub 3. And then you just have to add the key to the git setting.      If you used gitlab as I do you can go setting --> Deploy key 4. Then you Named the key and paste the key to the text edit , AND! check the "write access allowed" below!   5. After saved yo...

Spotify on linux

Image
Yeah Everybody, yup! you see the different logo here! That's Spotify~! Today I gonna talk about a easy topic. That is, how to install the Spotify in Linux~! Actually there is already a tutorial on there official site, but I still wanna record it. # 1. Add the Spotify repository signing key to be able to verify downloaded packages sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886 # 2. Add the Spotify repository echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list # 3. Update list of available packages sudo apt-get update # 4. Install Spotify sudo apt-get install spotify-client Um....ok, I just copy it, XD. see you next time~                                     provide

Custom Command

Image
Hi guys~! Today I got some issue on Ubuntu16.04. Although the Ubuntu is linux base, in ubuntu, we can't use root to login. Or u have to spend time to figure it out. So, the issue I met is that I tried to link serial port by some IDE, such as Qt, but the ttyUSB or ttyS0 ports are set as 550 permission. To use the port correctly u have to use root or sudo, but u can't run the Qt as root directly like Windows, in which u just right clicked and run as Administrator. Things u have to do is : cd /urpath/Qt/Tolls/QtCreator/bin sudo ./qtcreator So... the things I gonna teach u is ... how to write a custom command ~~ LOL, Sorry for tell a long story before the tutorial ahh. First of all, write the command u wanna use in txt or .sh whatever u want command : cd /urpath/Qt/Tolls/QtCreator/bin sudo ./qtcreator A common way to handle this is to use /bin directory, mkdir ~/bin put ur script in the folder mv yourfile ~/bin make sure u can execute it chmo...

Multiboot CentOS & Ubuntu

Image
Hi everybody, these day I tried to install multi os from on my desktop for work. However, the multi boot with Ubuntu and CentoOS will reach to the grub and grub2 conflicted problem. After few days studying and expirement, I finally figure out the way to fix the  conflict. Okay, now let's start. First of all you have to separate your disk to 2 partition, you might not try to install CentOS at first cause it Ubuntu won't detect the exist of the CentOS. Besides, I tried... many time and many ways. It will never make it to fix the Ubuntu grub to boot up the CentOS. So, Install Ubuntu first, I used Ubuntu 16.04 LTS Then install CentOS7 Now you might see the menu of CentOS's grub with centos and ubuntu in the list. However you will receive "can't find command linux & initrd" when you choose Ubuntu. That's because the centos used linuxefi and initrdefi for boot up. You can saw the command by press "E", and you will understand wh...

Linux Proxy setting

Image
Most of company have proxy server and have to route through it for access internet. Though the browser and the system can set proxy by UI, yum and apt need addition setting from the config file. Since CentOS and Ubuntu are both used wildly, I record the step for seeting up proxy config file for future used. Ubuntu 16.16 create a apt.conf file Acquire::http::proxy "http://proxy:port/"; Acquire::https::proxy "https://proxy:port/"; Acquire::ftp::proxy "ftp://proxy:port/"; Acquire::socks::proxy "socks://proxy:port/"; and put it in to the /etc/apt CentOS 7 modified /etc/yum.conf proxy=http://proxy:port and... Done~! This is the very simple tutorial for general situation. If u need more complex setting please google it. Thanks~