Sort product by newest in Magento (with out hacked!)

April 22nd, 2010

After adding a few products in my Magento 1.4.0.1 site, I have found that the latest added product will go to the last of the product list. That doesn’t make sense. So… I googled it for finding the solution but almost of them are hacking the Magento’s core code. This will cause my website some problems when upgrade Magento in the future.

The right solution is try to config Magento using layout files.
Read the rest of this entry »

FPDF VS TCPDF

March 15th, 2010

ช่วงนี้มีโปรเจคที่ต้องทำให้ PHP สร้างเอกสาร PDF ออกมา เลยทำให้ต้องมานั่งคิดว่าจะใช้ Library ตัวไหนดี

ครั้นจะใช้ PDF Module ของ PHP เองก็ดูจะยากไปหน่อย เลยลอง Google ดูไปเจอที่ฮิตๆกันอยู่ 2 ตัวคือ

FPDF และ TCPDF

เปรียบเทียบง่ายสุดก่อน อยากรู้ว่าอันไหนดังกว่ากัน ก็ลองใช้ Google Trends ทดสอบดู [คลิก] ได้ผลตามรูปด้านล่าง

FPDF vs TCPDF by Google Trends
FPDF vs TCPDF by Google Trends

Read the rest of this entry »

Config DHCP in FreeBSD

December 7th, 2009

ได้ยินว่าหลายๆคน ไม่สามารถทำให้ FreeBSD ติดต่อออกไปยัง Internet ได้

นั่นเป็นเพราะตอน Install ไม่ได้ config ค่า Network ให้ถูกต้อง (กด Next แหลก) ซึ่งสามารถแก้ไขได้ดังนี้

Read the rest of this entry »

Working with DTrace

December 7th, 2009

การบ้านครั้งที่ 2 สำหรับวิชา UNIX คือให้ฝึกใช้คำสั่ง DTrace เป็นโปรแกรมที่เอาไว้วัด Performance ต่างๆของเครื่อง

ว่าไปก็คล้ายๆโปรแกรม Intel VTune Performance Analyze และโปรแกรม Intel Thread Profiler

ตามการบ้านให้หาข้อมูลเหล่านี้

  • provider/probe
  • hooks
  • scripting
  • predicates
  • DIF
  • aggregation
  • DTrace client
  • DTrace ioctl

Read the rest of this entry »

UNIX System Administration Proficiency Test

December 1st, 2009

ในวิชา UNIX/Linux for Enterprise Environment มีสอบการใช้งาน 20 คำสั่งของ UNIX โดยใช้ FreeBSD เป็นตัวสอบ โจทย์ 20 ก็มีดังนี้

  1. แสดงและอธิบายถึงขนาดของ swap partition
  2. อธิบายว่าทำไมจึงต้องแบ่ง Disk เป็น partition
  3. แสดงถึง System specific และ Site-wide configuration
  4. แสดงข้อแตกต่างหรือความสัมพันธ์ระหว่าง /usr/local/etc/* กับ /usr/local/etc/rc.d/* และ /etc/rc.d/*
  5. แสดงและอธิบายความหมายของแต่ละ Field ใน /etc/crontab file
  6. แสดงการ install NDIS (Network Driver Interface Specification) โดยผ่าน NDISulator
  7. แสดงการทำ Multiple IP Address (Virtual host)
  8. /etc/hosts ใช้ทำอะไร เมื่อมี /etc/resolv.conf แล้วทำไมยังต้องใช้อีก
  9. แสดงการ tune จำนวน process ให้เป็น 10,000 โดยใช้ sysctl(8)
  10. อธิบายถึง Soft update ในการ tune ระบบแฟ้ม โดยใช้คำสั่ง tunefs(8)
  11. แสดงการใช้ netstat(1) และอธิบาย field ต่างๆ
  12. Bootstrap คืออะไร เกี่ยวข้องกับ BIOS และ MBR อย่างไร
  13. Boot flag –s ใช้ทำอะไร หมายถึงอะไร
  14. shutdown ต่างจาก halt command อย่างไร
  15. แสดงการใช้ chpass(1)
  16. แสดงการใช้ md5(1) ในการทำ file integrity check
  17. อธิบายถึงความสัมพันธ์ระหว่าง DOS attack (Denial of Service) กับการจำกัด Server fork
  18. อธิบายและแสดงถึงวิธีหาว่าระบบใช้วิธีการใด (DES/MD5/Blowfish) ในการ Encrypt password
  19. แสดงการใช้และสถานะของ USB device
  20. แสดงการใช้ file system snapshots – mksnap_ffs(8)

พอทำเสร็จก็คิดว่าเป็นอะไรที่น่าจะจดเก็บไว้ เลยทำเป็น PDF มาให้โหลด

ดาวน์โหลดไฟล์ UNIX System Administration Proficiency Test ที่นี่