此處將只留桌面操作相關設定。
Desktop
-
- Lubuntu 無痛上手!(安裝Lubuntu二)
$ sudo apt-get install fcitx fcitx-chenwing fbterm fcitx-frontend-fbterm $ gpasswd -a user viedo $ chmod u+s /usr/bin/fbterm $ vim ~/.fbtermrc font-names=ubuntu mono font-size=20 input-method=fcitx-fbterm
常用工具
虛擬機器
$ virsh --connect qemu:///system $ list --all $ start vm1 $ apr -n $ ssh name@vm_ip
Server
編譯內核
- 安裝套件。
$ sudo apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev \ linux-source qt3-dev-tools libqt3-mt-dev libncurses5 libncurses5-dev fakeroot build-essential \ crash kexec-tools makedumpfile kernel-wedge kernel-package
- 下載內核。
$ wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.17.tar.bz2 $ tar -xjvf linux-3.2.17.tar.bz2; cd linux-3.2.17/
- 複製舊有系統設定檔,並設定、編譯和安裝內核。
$ cp -vi /boot/config-`uname -r` .config # 以現有設定檔為基礎。若下載的內核有新的選項,會出現提示字元。 $ make oldconfig # 精簡內核,透過 lsmod 得知目前有用到的驅動,只留下這些驅動。視訊鏡頭等週邊需要開啟,避免重編內核之後無法使用。 $ make localmodconfig # 設定內核。 $ make menuconfig # 編譯好的內核: arch/x86_64/boot/bzImage $ make -j # 安裝模組 $ sudo make modules_install # 安裝內核 $ sudo make install
- 修改 grub 從預設內核開機。
$ sudo update-grub # 從上到下,由 0 開始數,選出自己想要的預設內核。 # 'Ubuntu, with Linux 3.2.0-23-generic' 和 'Ubuntu, with Linux 3.2.0-23-generic (recovery mode)' 算一個,計數為 2。 # 建議指定名字,例如: # GRUB_DEFAULT='Ubuntu, with Linux 3.2.17-chipsee' $ grep menuentry /boot/grub/grub.cfg menuentry 'Ubuntu, with Linux 3.2.17-chipsee' --class ubuntu --class gnu-linux --class gnu --class os { menuentry 'Ubuntu, with Linux 3.2.17-chipsee (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { menuentry 'Ubuntu, with Linux 3.2.0-23-generic' --class ubuntu --class gnu-linux --class gnu --class os { menuentry 'Ubuntu, with Linux 3.2.0-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { menuentry "Memory test (memtest86+)" { menuentry "Memory test (memtest86+, serial console 115200)" { $ sudo vi /etc/default/grub # 使修改的設定生效。 $ sudo update-grub
網路
- 設定 IP。
$ vi /etc/network/interfaces auto eth0 iface eth0 inet static address 140.109.23.106 netmask 255.255.255.0 gateway 140.109.23.242 $ sudo ifup eth0 $ vi /etc/hosts 140.109.22.163 itanium.iis.sinica.edu.tw itanium # 暫時解法 $ ifconfig -a | grep eth $ sudo ifconfig eth0 140.109.23.106 netmask 255.255.255.0 $ ifconfig eth0 $ sudo route add default gw 140.109.23.242 eth0 $ route -n $ vi /etc/resolv.conf search iis.sinica.edu.tw nameserver 140.109.1.10 nameserver 140.109.20.250
- 設定 NIS。
$ sudo apt-get update $ sudo apt-get install portmap nis $ sudo vi /etc/defaultdomain iis.sinica.edu.tw $ sudo vi /etc/passwd +:::::: $ sudo vi /etc/group +::: $ sudo vi /etc/shadow +:::::::: $ sudo vi /etc/yp.conf ypserver itanium's ip # sudo /etc/init.d/nis restart # sudo /etc/init.d/ypbind restart $ service ypbind restart
-
- Debian 的 preinst, postinst, prerm, 和 postrm 脚本
# /var/lib/dpkg/info/nis.postinst $ sudo apt-get soource --compile nis $ sudo dpkg -i nis_3.17-31_armel.deb
-
- 設定 NFS。
$ sudo apt-get install rpcbind nfs-common $ sudo vi /etc/hosts.deny rpcbind : ALL $ sudo vi /etc/hosts.allow rpcbind : NFS server IP address $ sudo apt-get install autofs $ sudo vi /etc/auto.master # 掛載點,不要建 /nfs_home 這個目錄。autofs 會自己建。 /nfs_home /etc/auto.home $ showmount -e nfs_server_ip /nfs_home arm2 $ sudo vi /etc/auto.home * nfs_server:/nfs_home/& $ sudo service autofs start # 爆力做法 $ vi /etc/fstab nfs_server:/nfs_home /nfs_home nfs rsize=8192,wsize=8192,timeo=14,intr
- 設定供開發板使用的伺服器。
$ apt-get install tftpd $ mkdir -p /srv/tftp $ chmod 777 /srv/tftp $ /etc/init.d/openbsd-inetd restart
- 安裝連線至開發版的 minicom。
$ apt-get install minicom # http://www.cyberciti.biz/faq/find-out-linux-serial-ports-with-setserial/ # http://deanpan-photo.blogspot.com/2011/01/ubuntulinux-uart-consoleterminal.html $ minicom -s
設定時區
$ sudo tzselect 依選項選擇你在的時區 $ sudo cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime 更換時區檔 $ sudo ntpdate time.stdtime.gov.tw 對時,其它台灣的 Time Server 請參考 國家時間與頻率標準實驗室 的說明 $ sudo hwclock -w 將時間寫入 BIOS $ sudo crontab -e @daily /usr/sbin/ntpdate time.stdtime.gov.tw > /dev/null 將對時寫進 crontab 每天做一次
套件
$ apt-cache search minicom $ apt-get $ aptitude $ dpkg -L <pkkg_name>
其它
在安裝後,切出 swap 空間。
# 救急用。 $ sudo dd if=/dev/zero of=/SWAP.img bs=1M count=128 $ sudo losetup /dev/loop7 /SWAP.img $ sudo mkswap /dev/loop7 $ sudo swapon /dev/loop7 # 確認 swap 已開啟。 $ cat /proc/swaps
清出硬盤空間。
$ sudo apt-get clean $ sudo apt-get autoremove
Trouble Shooting
- 使用iconv转换文本编码为UTF-8
$ iconv -f GBK -t utf-8 -o file.tmp Game.of.Thrones.S03E08.720p.HDTV.x264-EVOLVE.chs.srt $ mv file.tmp Game.of.Thrones.S03E08.720p.HDTV.x264-EVOLVE.chs.srt