此處將只留桌面操作相關設定。
====== Desktop ======
* [[http://www.guokr.com/blog/749084/|使用fbterm等组件实现Linux终端下中文文本的显示和输入]]
* [[http://caishin.com/modules/tadnews/index.php?nsn=7| 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
===== 常用工具 =====
* [[VIM]]
* [[http://blog.longwin.com.tw/2009/11/linux-monitor-share-screen-2009/|Linux 文字模式 螢幕畫面共享 - 使用Screen]]
* tmux
* [[Irssi]]
* [[SSH Tunnel]]
===== 虛擬機器 =====
* [[http://www.howtoforge.com/virtualization-with-kvm-on-ubuntu-12.04-lts|Virtualization With KVM On Ubuntu 12.04 LTS]]
* [[https://help.ubuntu.com/community/KVM|Setting up a KVM-LVM based virtual machine host]]
* [[http://doc.ubuntu.com/ubuntu/serverguide/C/virtualization.html|Chapter 19. Virtualization]]
* [[https://help.ubuntu.com/community/KVM|KVM]]
* [[http://www.howtoforge.com/installing-kvm-guests-with-virt-install-on-ubuntu-12.04-lts-server|Installing KVM Guests With virt-install On Ubuntu 12.04 LTS Server]]
* [[http://www.howtoforge.com/kvm-guest-management-with-virt-manager-on-ubuntu-8.10|KVM Guest Management With Virt-Manager On Ubuntu 8.10]]
* [[http://www.howtogeek.com/117635/how-to-install-kvm-and-create-virtual-machines-on-ubuntu/|How to Install KVM and Create Virtual Machines on Ubuntu]]
* [[https://help.ubuntu.com/community/KVM/VirtManager|KVM/VirtManager]]
$ virsh --connect qemu:///system
$ list --all
$ start vm1
$ apr -n
$ ssh name@vm_ip
* [[http://unix.stackexchange.com/questions/33191/how-to-find-the-ip-address-of-a-kvm-virtual-machine-that-i-can-ssh-into-it|How to find the IP address of a KVM Virtual Machine, that I can SSH into it? ]]
* [[http://rwmj.wordpress.com/2010/10/26/tip-find-the-ip-address-of-a-virtual-machine/|Tip: Find the IP address of a virtual machine]]
====== 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
* [[https://help.ubuntu.com/community/Kernel/Compile|Kernel/Compile]]
* [[http://mitchtech.net/compile-linux-kernel-on-ubuntu-12-04-lts-detailed/|Compile Linux Kernel on Ubuntu 12.04 LTS (Detailed)]]
* [[http://zhyu.me/linux/compile-your-own-ubuntu-kernel.html|编译自己的Ubuntu内核]]
* [[http://askubuntu.com/questions/156700/how-to-set-default-boot-kernel-in-ubuntu-grub|How to set default boot kernel in Ubuntu / Grub?]]
* [[http://askubuntu.com/questions/82140/how-can-i-boot-with-an-older-kernel-version|How can I boot with an older kernel version?]]
* [[http://askubuntu.com/questions/196657/how-do-i-change-default-boot-kernel-if-i-set-it-wrong-to-memtest|How do I change default boot kernel if I set it wrong to memtest?]]
* [[http://askubuntu.com/questions/2793/how-do-i-to-remove-or-hide-old-kernel-versions-to-clean-up-the-boot-menu|How do I to remove or hide old kernel versions, to clean up the boot menu?]]
===== 網路 =====
- 設定 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
* [[http://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/|DNS in Ubuntu 12.04]]
* [[https://help.ubuntu.com/11.04/serverguide/C/network-configuration.html|Network Configuration]]
- 設定 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
* [[https://help.ubuntu.com/community/SettingUpNISHowTo|SettingUpNISHowTo]]
* [[http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=610618|nis: broken postinst: dpkg: version 'nis_3.17-18' has bad syntax: invalid character in version number]]
* [[http://jianjian.blog.51cto.com/35031/395468|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
* [[https://help.ubuntu.com/community/SettingUpNFSHowTo|SettingUpNFSHowTo]]
* [[http://linux.vbird.org/linux_server/0330nfs.php#nfsclient_autofs|十三章、檔案伺服器之一:NFS 伺服器]]
- 設定供開發板使用的伺服器。
$ apt-get install tftpd
$ mkdir -p /srv/tftp
$ chmod 777 /srv/tftp
$ /etc/init.d/openbsd-inetd restart
* [[http://softsmith.blogspot.com/2009/06/ubuntu-desktop-tftp-server.html]]
* [[http://adventuresinswitching.blogspot.com/2008/05/setup-multiple-ip-addresses-on-ubuntu.html]]
- 安裝連線至開發版的 [[wp>Minicom|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
* [[wp>Linaro]]
===== 設定時區 =====
$ 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 每天做一次
* [[http://philipatswarchy.wordpress.com/2007/03/19/ubuntu-change-time-zone/|[Ubuntu]Ubuntu 更改時區]]
===== 套件 =====
$ apt-cache search minicom
$ apt-get
$ aptitude
$ dpkg -L
* [[http://www.cyberciti.biz/faq/ubuntu-linux-how-do-i-install-deb-packages/|Ubuntu Linux: How do I install .deb packages?]]
* [[https://help.ubuntu.com/community/InstallingSoftware|InstallingSoftware]]
===== 其它 =====
在安裝後,切出 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
* [[https://help.ubuntu.com/community/SwapFaq|SwapFaq]]
* [[http://askubuntu.com/questions/33697/adding-swap-partition-after-system-installation|Adding swap partition after system installation]]
* [[http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/|Linux Add a Swap File – Howto]]
* [[http://www.linuxquestions.org/questions/linux-distributions-5/ubuntu-increase-swap-size-273172/|ubuntu - increase swap size]]
* [[http://www.linux.com/news/software/applications/8208-all-about-linux-swap-space|All about Linux swap space]]
清出硬盤空間。
$ sudo apt-get clean
$ sudo apt-get autoremove
* [[http://www.ubuntugeek.com/how-do-i-cleanup-ubuntu.html|How do I cleanup Ubuntu?]]
* [[http://blog.longwin.com.tw/2011/02/linux-free-hd-clean-2011/|Debian / Ubuntu Linux 空間釋放]]
* [[http://ubuntuforums.org/showthread.php?t=1190811|what replaces /etc/inittab?]]
====== Trouble Shooting ======
* [[http://askubuntu.com/questions/197459/read-only-file-system|Read-only file system]]
* [[http://blog.wu-boy.com/2008/05/linux%E7%AD%86%E8%A8%98-%E5%88%A9%E7%94%A8-mount-%E6%8C%87%E4%BB%A4%E8%A7%A3%E6%B1%BA-read-only-file-system-%E5%95%8F%E9%A1%8C/|[Linux筆記] 利用 mount 指令解決 Read-only file system 問題]]
* [[http://stackoverflow.com/questions/1174847/how-to-set-the-character-encoding-for-a-file-in-vim|How to set the character encoding for a file in VIM]]
* [[http://blog.sunbean.me/post/23851043573/use-iconv-to-convert-text-encoding-from-gbk-to-utf8|使用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
* [[http://www.maketecheasier.com/fixing-sudo-error-in-ubuntu/|Fixing “username is not in the sudoers file. This incident will be reported” Error In Ubuntu]]