Sunday, July 30, 2006

sim: set snmp location

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1025761

Tuesday, July 18, 2006

procmail msql

http://pank.org/blog/archives/000882.html

http://mt.freebsd.org.hk/archives/000029.html

Monday, July 17, 2006

php mail2db

#!/usr/local/bin/php -q

$fd = fopen("php://stdin","r");
while (!feof($fd)) {
$data = fgets($fd, 4096);

if ( eregi("^From:",$data) ) {

$email = eregi_replace( "From: ", "", $data);
$email = str_replace ("\n", "", "$email");
}

if ( eregi("^Subject:",$data) ) {

$subject = eregi_replace( "Subject: ", "", $data);
$subject = str_replace ("\n", "", "$subject");
}

if ( eregi("^Reply-To:",$data) ) {

$replyto = eregi_replace( "Reply-To: ", "", $data);
$replyto = str_replace ("\n", "", "$replyto");
}

if ( eregi("^To:",$data) ) {

$autoresponder = eregi_replace( "To: ", "", $data);
$autoresponder = eregi_replace( "<", "", $autoresponder); $autoresponder = eregi_replace( ">", "", $autoresponder);
$autoresponders = strstr($autoresponder, "@");
$id = str_replace ("$autoresponders", "", "$autoresponder");
}

$testdata = "$testdata$data";

}

fclose ($fd);

$body = strstr ($testdata, "\n\n");

Sunday, July 09, 2006

二孔插座的火線與地線

一般家庭的電源插座為二孔,且有可能插座上的標示是錯的,
一般水線的洞比較大,火線的洞比較小,
但因為施工單位有時不會注意施工品質而亂放

不知道是火線還是地線,去買驗電筆來測
使用方式:手碰驗點筆"最末端的金屬",
前端插入插座內驗電筆會發光表示那個是火線(有電),
另一個則是地線了~~