去除UTF-8 BOM
九月 9th, 2008 by Brightshine

Want to strip UTF-8 BOM(Byte Order Mark) from given files?

用sed一行搞定,秒殺

sed -e ’1s/^\xef\xbb\xbf//’ < bomfile > newfile

[轉錄]使用perl一次取代多個檔案內容
八月 24th, 2007 by Brightshine

marx’s IT experience看到的
常常會用到所以留個備忘

perl -pi -w -e ‘s/search/replace/g;’ *.php

-pi (-p 遞迴執行 -i[ext]複製讀取內容,處理後再覆蓋;如加上[ext],則原文件會備份到filename.ext)
-e (執行某些指令碼)
-w (列出 warning )

案例 取代 *php, *htm 內的
content="text/html; charset=big5″ 改為 content="text/html; charset=utf8″

可以下

perl -pi -w -e ‘s/content="text\/html; charset=big5″/content="text\/html; charset=utf8″/g;’ *.php(*.htm ,relative )

參考

百日未眠的小惡魔
九月 24th, 2006 by Brightshine

雖然說,百日未停機對很多server來說,是件輕而易舉的事
不過我這台用二手零件拼湊出來的小惡魔,倒是第一次撐了這麼久不休息
(看來新換上去的power及motherboard品質還不錯)

這個記錄會持續到第幾天呢?我很期待著

Vim tips也有RSS了
七月 12th, 2005 by Brightshine

http://www.vim.org/tips/index.php
以後閱讀就方便多了 :)

Firefox正體中文 on FreeBSD
五月 8th, 2005 by Brightshine

轉錄自:moztw.org

1 到 ftp.mozilla.org 下載 zh-TW.xpi 並且安裝
2 安裝 Locale Switcher
3重新啟動 Firefox,啟動後在選單的 [Tools] 中會多出一項 [Language],切換成 zh-TW
4 再重新啟動 Firefox,噹噹噹…介面變成中文的了。

回到舊世界? 真是有夠蠢的
三月 30th, 2005 by Brightshine

話說下午打算再挑戰一次XWindow
便開始將FreeBSD5.3裝在一號機上

一些.xxx的設定檔都直接套用二號機,做起來還滿快的
照著熟悉的步驟,cvsup、make world、make kernel
重開機後當場傻眼… 4.11 stable……
cvs tag忘了改……

天啊…我竟然蠢到做了downgrade…

swap不夠又沒硬碟的時候
三月 17th, 2005 by Brightshine

當初在裝這台機器的時候,swap只給128MB
大概是CPU只有pentium-200實在不夠吧
跑SpamAssassin常常會out of swap space
偏偏手邊又沒有多的硬碟可以加
今天看到一個方法,可以建立檔案當作swap
索性將分得太大的/usr/local分了512MB給swap

作法如下:
Read the rest of this entry »

TFTP Server 架設實務
六月 1st, 2004 by Brightshine

一般設定過 Router 的人都有經驗,由於僅提供行編輯器(如 dos 下的 debug 程式),因此在修改時十分不便,而 UNIX 內附 TFTP Server,可提供全螢幕編輯。所以我們便可以在 UNIX 底下,利用如 ee、vi 等文字編輯軟體編修好 Router 的設定,再下傳至 Router 即可。
Read the rest of this entry »

screen hotkey
六月 1st, 2004 by Brightshine

screen的hotkeys,開多個視窗時很好用
Read the rest of this entry »

熱騰騰剛出爐的ports軟體
六月 1st, 2004 by Brightshine

可以很方便的知道最近更新的ports

新鮮貨
http://www.freshports.org/

軟體分類
http://www.freshports.org/categories.php

Pages: 1 2 Next

»  Substance:WordPress   »  Style:Ahren Ahimsa