Monday, August 11, 2008

build source package in debian

just for memo
need build-essential fakeroot

$ apt-get build-dep package
$ fakeroot apt-get source -b package

then wait for compilation.

$ dpkg -i package

so happy not messing with tarball

 

Sunday, August 10, 2008

safari history search

Using the shortcut Command-? for searching help to search history is a very good hacking.

 

Wednesday, August 6, 2008

ls_color in bsd style

for xterm-color, set in .profile

alias ls="ls -G"
export LSCOLORS="ExFxCxDxBxEGEDABAGACAD"

make it more beautiful.

 

Sunday, August 3, 2008

set volume in max os x terminal

Costing my much time to search, It seems no command for setting volume in Leopard. When I used AppleScript to do this, I didn't know why the executable file cause some problem in screen. But Ruby's applescript gem do this good. I saved below content as /usr/bin/volume, and then I could use $ volume [1-7 as volume] to set Leopard's Volume from remote.

01 #!/usr/bin/env ruby
02
03 require 'rubygems'
04 require 'applescript'
05
06 AppleScript.execute("set volume #{ARGV[0]}")


update 2008/8/3

the way using applescript interpreter is $ osascript -e "set volume [1-7]"
or call in script by shebang.

01 #!/usr/bin/osascript
02
03 set volume [1-7]


 

Wednesday, July 30, 2008

basic gnuplot script

for plotting band data generated by mit photonics band

01 set title "band of te mode"
02 set term png
03 set output "te.png"
04
05 plot \
06 "te" using 2:7 title "band 1" with linespoints, \
07 "te" using 2:8 title "band 2" with linespoints, \
08 "te" using 2:9 title "band 3" with linespoints, \
09 "te" using 2:10 title "band 4" with linespoints, \
10 "te" using 2:11 title "band 5" with linespoints, \
11 "te" using 2:12 title "band 6" with linespoints, \
12 "te" using 2:13 title "band 7" with linespoints, \
13 "te" using 2:14 title "band 8" with linespoints


 

Tuesday, July 29, 2008

today's note


Simplicity is the ultimate sophistication.
-- Leonardo Da Vinci



 

Monday, July 28, 2008

ruby readline


loop do
line = Readline::readline("app shell> ")
if line
Readline::HISTORY.push line
puts line
else
puts
break
end
end


This is a the most basic usage.
I want to find a way could act as irssi :/

 

Friday, July 18, 2008

多愁善感 淌 一點點

青春歲月 落 一片片

彷彿存在母體操縱的世界

深深地難以自拔

於沒有方向的原點

燈火玲瓏處

憑欄人

獨倚

何是回首時

for A.L.


 

Monday, July 14, 2008

天守閣之徘

當王牌已然從天而降

剩下的也只剩下祈求上蒼

天守閣的銅牆鐵壁阿

且看我是否是那德川家康

夜月,燈火,今夜亦瘋狂

---謹致 A.L.(J)

 

Saturday, July 12, 2008

restful 與 form_for

不可以在 /news/new 的 view 裡面寫 form_for @news ~"~