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.