Wednesday, February 24, 2010

search & replace string from terminal

I want to search & replace string in 10MB of text file. The Gedit spend 20 - 30 minutes to finish this task but I can finish in 2 second by this command

cat source_file.txt | sed 's/searchstring/replacestring/g' > output.txt

pretty cool!

Tuesday, January 26, 2010

Bill Davenhall: Your health depends on where you live

จาก TedTalk เป็นอีกไอเดียที่ดีเหมือนกัน

Monday, January 25, 2010

run php as cron job at Webfaction.com

short command for run php script as cron job


* * * * * /usr/local/bin/phphome $HOME/path/to/php_script.php > $HOME/path/to/output.log 2>&1


pretty simple.

Tuesday, January 19, 2010

DEVRadio #21 ระวังบัตรเครดิตนะพี่ โดย อ.นิรุธ อำนวยศิลป์

สมัครสมาชิกรายการของอาจารย์นิรุธไว้ที่ Youtube เห็นว่าตอนนี้เป็นประโยชน์ต่อวงกว้าง เลยเอามาแปะไว้ที่บล๊อกด้วย

คร่าวๆ ก็ควรระวังการใช้งานบัตรเครดิตในที่ต่างๆ เพราะถ้ามีข้อมูลบนบัตรครบ เช่น หมายเลขบัตร ๑๖ ตัว และหมายเลขหลังบัตร ก็สามารถทำธุรกรรมผ่านทางอินเตอร์เนตได้แล้ว

ระวังะตกเป็นเหยื่อไม่รู้ตัว



นอกจากกลัวห้ามใจตัวเองไม่อยู่แล้ว เรื่องความปลอดภัยเป็นอีกเหตุผล ที่ผมไม่ยอมทำบัตรเครดิตให้ตัวเองซักที