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 เห็นว่าตอนนี้เป็นประโยชน์ต่อวงกว้าง เลยเอามาแปะไว้ที่บล๊อกด้วย

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

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



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

Wednesday, January 13, 2010

Use Gmail smtp for send email in Magento

I building website using Magento, so many time I need to test email sending but I got some problem because my environment is Windows.
Windows not false just not good ebough for this point.

So I need to modified Magento core file to use Gmail smtp for sending email.

Just follow this instruction.

Open and modified /app/code/core/Mage/Core/Model/Email/Template.php

in function function send($email, $name=null, array $variables = array())

replace


try {
$mail->send(); // Zend_Mail warning..
$this->_mail = null;
}


with


$config = array(
'ssl' => 'ssl',
'port' => 465,
'auth' => 'login',
'username' => 'youtgmailusername@gmail.com',
'password' => 'youtgmailpassword'
);

$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
try {
$mail->send($transport);
}


Have a nice day.

Sunday, December 27, 2009

สมัครทวิตเตอร์กันตั้งแต่เมื่อไหร่

หลายคนที่เล่นทวิตเตอร์ ส่วนใหญ่มักจะจำไม่ได้ว่าตัวเองสมัครทวิตเตอร์ไว้เมื่อไหร่

อยากรู้ก็ไม่ยาก เค้ามี API ให้ดึงอยู่แล้ว แต่ต้องมี Firefox ไว้อ่าน XML นะ

เปิด Firefox ขึ้นมาแล้วเรียกแบบนี้

  • http://twitter.com/users/xxx.xml 

โดยเปลี่ยน xxx เป็นยูสเซอร์เนมของทวิตเตอร์ที่เราต้องการดู ถึงแม้ว่าเค้าจะ protected ไว้ก็ดูได้นะ

แล้วหน้าตามันก็จะออกมาประมาณนี้ แล้วมองหาข้อมูลที่อยู่ระหว่าง <created_at> </created_at>

twitter_created_at

ทีนี้ก็จะได้ไม่ต้องไล่ถามกันทีละคน ซึ่งบางคนก็อยากเท่ ด้วยการสมอ้างว่าเล่นทวิตเตอร์มานาน สิ่งนี้จะเป็นคำตอบที่ชัดเจนที่สุด