跳到主要內容

發表文章

目前顯示的是有「linux」標籤的文章

Use mutt receive email

如果要用mutt內建的pop/imap收信功能, 首先要檢查是否compile時有enable # mutt -v +USE_POP  +USE_IMAP 1. 執行mutt 2. 假設要連線到pop3 server:www.hibox.hinet.net 3. 按c 改變mail box 路徑 4. 輸入: pop://email-account@www.hibox.hinet.net  5. 若要使用imap, 則改變pop成imap即可imap ://email-account@www.hibox.hinet.net

a small and nice ini parser -- iniParser

Today I finished cross-compiling wvdial package. After I cross-compiling it, I found that it has some problem to load the wvdial.conf. And I also know that passing arguments to the wvdial is still working. Finally, I decide to modify the wvdial program to load the wvdial.conf by my own. I load the config file with iniParser and pass it to the cfg object. Now it works perfectly !! wvdial -- a utility that helps in making modem-based connections to the Internet wvdial site wvdial wiki iniParser home wvdial introduction  

ubuntu上mount lvm partition

ubuntu 9.10灌好後, 最先就是把之前灌fedora那個硬碟的資料copy回來. 由於fedora 9預設是用lvm的partition, 因此要安裝lvm2套件, 剩下的, 就是把lvm mount起來 # sudo apt-get install lvm2 # sudo vgscan # sudo vgchange -ay VolGroup00 # sudo lvs # sudo mount /dev/VolGroup00/LogVol00 /mnt Reference: http://www.linux-sxs.org/storage/fedora2ubuntu.html

將patch完後的code還原回來

patch -p0 -R < path/ your . patch

Get file's size in Hex

更新firmware前, 如果遇到比較陽春的bootloader, 有的還要自己手動輸入檔案大小 這時可以先將做出來的大小先算出, 再以script代入就可以了 ls -l FileName | awk '{print $5} ' |  echo " ibase = 10; obase = 16;$$" | bc

在Linux下用native2ascii轉成簡中unicode的方式

在JDK安裝目錄中BIN底下有一個轉碼工具native2ascii.exe 資源文件需要進行Unicode編碼,方法是使用這個jdk提供的工具來轉換native2ascii ascii到unicode方式: native2ascii 原檔名 轉換檔名 因為我用的是繁體中文的環境, 首先, 必需將自己的locale換成zh_CN export LC_ALL=zh_CN.utf8 然後再執行gnome-editor將翻譯成簡中的文字貼上 最後再執行native2ascii即可 範例 aaa.txt文件內容包括:中國 native2ascii aaa.txt bbb.txt 執行後變為: \u4e2d\u56fd aaa.txt文件內容包括: \u4e2d\u56fd native2ascii -reverse aaa.txt bbb.txt 執行後變為:中國

Initrd

現在的Fedora都有用到initrd來開機, 如果想研究看看裡面的機制, 可以將之解開來看看. cpio format mkdir temp ; cd temp cp /boot/initrd-2.6.14.2.img initrd-2.6.14.2.img.gz gunzip initrd-2.6.14.2.img.gz cpio -i --make-directories < initrd-2.6.14.2.img non-cpio format mkdir temp ; cd temp cp /boot/initrd.img.gz . gunzip initrd.img.gz mount -t ext -o loop initrd.img /mnt/initrd ls -la /mnt/initrd Tools mkinitrd; packagename -- mkinitrd References: http://www-128.ibm.com/developerworks/linux/library/l-initrd.html

Linux 下看硬體規格的工具

lshw is a small tool to extract detailed information on the hardware configuration of the machine. yum install -y lshw 有GUI版 yum install -y lshw-gui 其它相關工具: lspci, lsusb, and lshal