12/31/2009

如何檢視Linux系統distribution版本

cat /etc/*release
cat /etc/issue

12/30/2009

[Ruby] string format

"%.3f" % (1.0/7) # "0.143"
"%5.1f" % 345.6789 # "345.7"

"%05d" % 123 # "00123"
"%-5s" % "ID" # "ID "
"%04x" % 0xfc14 # "fc14"

"%6.2f, %05d" % [345.6789,123] # "345.68, 00123"
"%-5s: %04x" % ["ID", 0xfc14] # "ID : fc14"

12/28/2009

vi 復原跟做

in command mode, use u key to undo and Ctr-r key to redo.

[FUN]chrome 可以開幾個tab 呢?



a lot of tabs.

12/18/2009

[指令] WC - 印出文件 行數 字數 byte數

指令: wc
參數:
-c, --bytes               印出位元數
-m, --chars              印出字數 印出該文件有幾個字
-l, --lines                 印出該文件有幾行   
-L, --max-line-length 印出該文件最長的那行有幾字
-w, --words              印出單字數目
This is just a note to prevent me forgot it. :P

12/14/2009

[問題] switch 裡面放switch 時 default: 的問題

error: ‘default’ label in scope of identifier with variably modified type not containing enclosing switch statement

to be solved...

12/07/2009

解決在OS X 使用terminal遠端使用screen無法backspace的情況

In terminal program, choose preferences -> advanced;
select "Delete sends Ctrl+H"
done!

12/05/2009

About unistd.h

在unix-like的系統內, unistd.h所定義的介面大多由一些system call的函式所組成, 像是fork, pipe 以及一需 基本IO
(read, write, open, close) 等等