發表文章

目前顯示的是 4月, 2012的文章

Unix scripts (sed & bash for)

圖片
今天工作上有個小任務, 一個目錄裡有47張圖, 巧合的是他們只有兩種解析度, 分別是480x84及480x720. 需要把它們分別放到兩個目錄裡. 大概記錄一下怎麼做的, 不然永遠記不得... 用file取得檔案的解析度, 先不要480x84的. file *.png | grep -v "x 84" | sed 's/\(.*\):.*/\1/' > list 再在bash cmdline寫一行的script for i in `cat list`; do `mv $i 720`; done 再把剩下的搬去84目錄下. mv *.png 84 收工

How to use FTP over TLS?

Filezilla Site Manager->New Site->Encryption->Require explicit FTP over TLS. lftp lftp id@ip set ftp:ssl-protect-data true get filename

Revamp my blog

圖片
My blog template didn't change for a while. Blogger has added many new features and I chose my template before that. So that template wasn't too flexible. Now I changed to use another template, removed most of the Ads and add SyntaxHighlighter 3.x. Now the web site would look neater.