patch -p0 -R < path/ your . patch
發表文章
目前顯示的是 2009的文章
在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 執行後變為:中國
為了要測試重開機幾次會失敗, 寫了一個script來記算. 因為busybox的shell只提供了有限的功能, 不能像bash一樣宣告整數變數, 所以count的處理算比較麻煩. #!/bin/sh FILE = /etc/count timeout = 2 if [ ! -f $FILE ] ; then echo 0 > $FILE fi count = `cat $FILE ` #echo $count echo $ ( ( $count+ 1 ) ) > $FILE echo "================================================" echo "Success reboot times :" `cat $FILE ` echo "Ctrl+C to break" echo "================================================" # setup timeout old_tty_settings = `stty -g ` stty -icanon min 0 time ${timeout} 0 eval read $input stty " $old_tty_settings " echo "reboot" reboot
現在的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