Friday, February 29, 2008
colordiff and vim
Here mention a perl script package on Debian, colordiff. For highlighting output of diff just only pipe the output of diff to colordiff. For example, $ diff -rq /etc /var | colordiff | less -R or other similar commands as $svk diff | colordiff | less -R to get the highlighted. Otherwise we can use vim to got the same effect if syntax on has set in .vimrc. For example, $diff -rq /etc /var | vim -. Just only some difference between them. :p
Labels:
command usage,
linux,
unix,
vim
Wednesday, February 27, 2008
Blueprint CSS 0.6 problem on IE
the class name "container" in IE have a problem: not align itself at center. Someway to fix it is set its parent element a property: { text-align: center; } to fix the problem.
Sunday, February 24, 2008
CPAN mirror SOP
3 steps note for how to mirror CPAN for fast installation in organization:
First, using rsync mirror whole CPAN to local machine. Write rsync -avHP --delete rsync.nic.funet.fi::CPAN /var/www/CPAN >> /var/log/rsync.log 2>&1 into crontab for daily synchronization. This step supposes mirror site root is put at /var/www/CPAN.
Second, write apache VirtualHost as below.
Restart your apache and access cpan.yourdomain. you can see it.
Third, register your mirror site at mirrors.cpan.org if you want to become a official mirror site.
First, using rsync mirror whole CPAN to local machine. Write rsync -avHP --delete rsync.nic.funet.fi::CPAN /var/www/CPAN >> /var/log/rsync.log 2>&1 into crontab for daily synchronization. This step supposes mirror site root is put at /var/www/CPAN.
Second, write apache VirtualHost as below.
<VirtualHost *>
ServerName cpan.yourdomain
DocumentRoot /var/www/CPAN
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/CPAN/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/cpan-error.log
LogLevel warn
CustomLog /var/log/apache2/cpan-access.log combined
ServerSignature On
</VirtualHost>
Restart your apache and access cpan.yourdomain. you can see it.
Third, register your mirror site at mirrors.cpan.org if you want to become a official mirror site.
Saturday, February 23, 2008
Blueprint CSS 0.7.1 release
Quickly Note
There is many new feature in new release.New class name include alt, incr, quiet, small, large, showgrid...etc. Conversely, class name "column" is removed. Now div tag should be used as column. New directory structure come with new compressing ability through ruby script. Button's style move out from plugin and become an alone package put on download page
There is many new feature in new release.New class name include alt, incr, quiet, small, large, showgrid...etc. Conversely, class name "column" is removed. Now div tag should be used as column. New directory structure come with new compressing ability through ruby script. Button's style move out from plugin and become an alone package put on download page
browser debuger note
Note for memory...
Safari:
Safari include a build-in debug menu, but default is off. To enable debug menu, command "defaults write com.apple.Safari IncludeDebugMenu 1" in shell, restart Safari to load it.
Debug menu with a javascript console. use Firebug compatible function console.log and console.info can print some infomation in it
Regretfully, build-in javascript console is not with javascript shell. There is a nice alternative choice at here. drag the link named shell in this page to safari bookmark bar. Click the bookmark to got a javascript shell.
Firefox:
Firebug add-on is the better choice for looking DOM, CSS. It also with a nice build-in javascript shell.
Internet Explorer 7:
internet explorer developer toolbar is a new tool. It still in beta and only for IE7. Appearance looks like firebug, But without javascript shell and couldn't modify CSS in it. Any way, It shows some aurora for debugging javascript in IE. XD
More information in blog.gugod.org
Safari:
Safari include a build-in debug menu, but default is off. To enable debug menu, command "defaults write com.apple.Safari IncludeDebugMenu 1" in shell, restart Safari to load it.
Debug menu with a javascript console. use Firebug compatible function console.log and console.info can print some infomation in it
Regretfully, build-in javascript console is not with javascript shell. There is a nice alternative choice at here. drag the link named shell in this page to safari bookmark bar. Click the bookmark to got a javascript shell.
Firefox:
Firebug add-on is the better choice for looking DOM, CSS. It also with a nice build-in javascript shell.
Internet Explorer 7:
internet explorer developer toolbar is a new tool. It still in beta and only for IE7. Appearance looks like firebug, But without javascript shell and couldn't modify CSS in it. Any way, It shows some aurora for debugging javascript in IE. XD
More information in blog.gugod.org
Sunday, February 17, 2008
the end of winter recess
這個寒假比預期的廢了很多,預定的事項,想讀的書,沒一件做完的,再來,三月一日就是研究所考試了,看著別人即將踏入考場,自己摸著鼻子甸甸自己剩下不到一年的時間儲備,真是難以說話。雖然沒有完成預定的事項,不過練習 perl/ruby 之餘還是寫了些 bot,cwbbot 是個簡單的 ruby 天氣預報機器人,提供他 twitter 的帳號和密碼,丟進 crontab,就可以每天自動取得明日溫度。
Labels:
programming,
robot,
ruby,
tool
Saturday, February 16, 2008
perl 和 ruby 的 twitter shell
twitter 最近紅透半邊天,perl 和 ruby 都有了 twitter api,現在還有 twitter shell,perl 的 twitter shell 利用 cpan 下 install Twitter::Shell 就可以得到 /usr/local/bin/twittershell, 使用方式為新增一個 yaml,如: touch ~/.twittershell.yml , 裡面填入
ruby 版本內建在 twitter 這個 gem 內, sudo gem install twitter 就可以得到 /usr/bin/twitter,直接在 shell 下 twitter 就可以得到幫助。不過 ruby 版本對 unicode 沒有支援,無法顯示中文,嘗試在 twitter gem 內的 twitter.rb 加入
username: yourtwitteraccount在 shell 下 twittershell -c ~/.twittershell.yml 就進入該 shell, help 可以得到幫助。
password: yourtwitterpassword
ruby 版本內建在 twitter 這個 gem 內, sudo gem install twitter 就可以得到 /usr/bin/twitter,直接在 shell 下 twitter 就可以得到幫助。不過 ruby 版本對 unicode 沒有支援,無法顯示中文,嘗試在 twitter gem 內的 twitter.rb 加入
require 'jcode',不過沒有效果,作者也表示暫時不會加入 unicode 支援。
$KCODE = 'u'
Labels:
command usage,
perl,
ruby,
twitter
Friday, February 15, 2008
land mine in file name extension of ruby
和 perl 不同, ruby 的 third party module package, 也就是 gems, 副檔名和一般 script 都一樣是 ".rb", ruby 搜尋 module 的 path 似乎又包含了 ".", 所以如果使用的 script 檔名和 script 引用的 gems 內的檔名相同的話, 就會衝突 :/
Labels:
programming,
ruby
Sunday, February 10, 2008
vim tab 功能
Subscribe to:
Posts (Atom)