Work Note

Linux下面簡單的 rename 大量檔案的技巧
rename -v 's/Target/ReplaceBy/g' files

Makefile Note
當發生makefile會問題時 建議用 vim 編輯
使用 :set list 看看是不是有插入空白字元

Makefile Rule
The first explict rule in the Makefile would be the default rule,
So do not write any rule before all: for being sure everything all right,
But we can insert any implie rule before all: for easying our make work.

Ubuntu 硬碟Utility
palimpsest 可檢測硬碟

Pusleaudio 選擇下一塊音效卡的 script

# Pulse Audio Sound Card Switcher v1.0 2010-01-13
# Switch default sound card in pulseaudio to next one presented in system. Actual audio streams will not be forwarded.
totalsc=$(pacmd “list-sinks” | grep card: | wc -l) # total of sound cards: $totalsc
if [ $totalsc -le 1 ]; then echo “Nothing to switch, system have only one sound card.” ; exit ; fi # Check if is present more then one sound card.
scindex=$(pacmd list-sinks | awk ‘$1 == “*” && $2 == “index:” {print $3}’) # index of default sound card: $scindex
nextsc=$(( (scindex+1)%$totalsc )) # index of next sound card: $nextsc
pacmd “set-default-sink $nextsc” > /dev/null # switch default sound card to next one
# CC BY - creative commons
# Thanks God for help :) and guys lhunath, geirha, Tramp and others from irc #bash on