<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>KomsitR.net</title>
	<atom:link href="http://komsitr.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://komsitr.net</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 22 Apr 2010 03:41:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Sort product by newest in Magento (with out hacked!)</title>
		<link>http://komsitr.net/?p=70</link>
		<comments>http://komsitr.net/?p=70#comments</comments>
		<pubDate>Wed, 21 Apr 2010 20:50:36 +0000</pubDate>
		<dc:creator>KomsitR</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://komsitr.net/?p=70</guid>
		<description><![CDATA[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&#8217;t make sense. So&#8230; I googled it for finding the solution but almost of them are hacking the Magento&#8217;s core code. This will cause my website some [...]]]></description>
			<content:encoded><![CDATA[<p>After adding a few products in my Magento 1.4.0.1 site, <strong>I have found that the latest added product will go to the last of the product list</strong>. That doesn&#8217;t make sense. So&#8230; I googled it for finding the solution but almost of them are hacking the Magento&#8217;s core code. This will cause my website some problems when upgrade Magento in the future.</p>
<p>The right solution is try to config Magento using layout files.<br />
<span id="more-70"></span>In this case, product ordering, you have to open <strong>&#8220;catalog.xml&#8221;</strong> in the layout folder. Then in the following code block, you just add the red line in order to change the default sorting direction to descending.</p>
<p style="text-align: left;"><span style="color: #0000ff;">&lt;block type=&#8221;catalog/product_list_toolbar&#8221; name=&#8221;product_list_toolbar&#8221; template=&#8221;catalog/product/list/toolbar.phtml&#8221;&gt;<br />
&lt;block type=&#8221;page/html_pager&#8221; name=&#8221;product_list_toolbar_pager&#8221;/&gt;<br />
</span><strong><span style="font-weight: normal; "><span style="color: #0000ff;"> <span style="color: #339966;">&lt;!&#8211; The following code shows how to set your own pager increments &#8211;&gt;<br />
&lt;!&#8211; &#8230;. &#8211;&gt;</span><br />
</span><strong><span style="color: #0000ff;"><span style="color: #ff0000;">&lt;action method=&#8221;setDefaultDirection&#8221;&gt;&lt;dir&gt;desc&lt;/dir&gt;&lt;/action&gt;</span><br />
</span><span style="font-weight: normal;"><span style="color: #0000ff;">&lt;/block&gt;</span></span></strong></span></strong></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;block type=&#8221;catalog/product_list_toolbar&#8221; name=&#8221;product_list_toolbar&#8221; template=&#8221;catalog/product/list/toolbar.phtml&#8221;&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;block type=&#8221;page/html_pager&#8221; name=&#8221;product_list_toolbar_pager&#8221;/&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;!&#8211; The following code shows how to set your own pager increments &#8211;&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;!&#8211;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;action method=&#8221;setDefaultListPerPage&#8221;&gt;&lt;limit&gt;4&lt;/limit&gt;&lt;/action&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;action method=&#8221;setDefaultGridPerPage&#8221;&gt;&lt;limit&gt;9&lt;/limit&gt;&lt;/action&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;action method=&#8221;addPagerLimit&#8221;&gt;&lt;mode&gt;list&lt;/mode&gt;&lt;limit&gt;2&lt;/limit&gt;&lt;/action&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;action method=&#8221;addPagerLimit&#8221;&gt;&lt;mode&gt;list&lt;/mode&gt;&lt;limit&gt;4&lt;/limit&gt;&lt;/action&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;action method=&#8221;addPagerLimit&#8221;&gt;&lt;mode&gt;list&lt;/mode&gt;&lt;limit&gt;6&lt;/limit&gt;&lt;/action&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;action method=&#8221;addPagerLimit&#8221;&gt;&lt;mode&gt;list&lt;/mode&gt;&lt;limit&gt;8&lt;/limit&gt;&lt;/action&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;action method=&#8221;addPagerLimit&#8221; translate=&#8221;label&#8221;&gt;&lt;mode&gt;list&lt;/mode&gt;&lt;limit&gt;all&lt;/limit&gt;&lt;label&gt;All&lt;/label&gt;&lt;/action&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8211;&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;action method=&#8221;setDefaultDirection&#8221;&gt;&lt;field&gt;desc&lt;/field&gt;&lt;/action&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 12px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;/block&gt;</div>
<p>After that upload this file to your server.  However, don&#8217;t forget to clear Magento&#8217;s cache unless you will see the result.</p>
<p><span style="text-decoration: underline;">Note:</span></p>
<p>You may change method attribute&#8217;s value to an another one. This value is the name of methods of class <strong>Mage_Catalog_Block_Product_List_Toolbar</strong> [<a href="http://docs.magentocommerce.com/Mage_Catalog/Mage_Catalog_Block_Product_List_Toolbar.html" target="_blank">click here for the complete API document</a>]. And also you can change the value of dir block (&lt;dir&gt;&#8230;&lt;/dir&gt;) which is the argument name and its value of the method</p>
<p><span style="text-decoration: underline;">Reference:</span><br />
CK Rock @ comment #59 of <a href="http://www.magentocommerce.com/boards/viewthread/1176/P45/" target="_blank">this thread</a></p>
]]></content:encoded>
			<wfw:commentRss>http://komsitr.net/?feed=rss2&amp;p=70</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>FPDF VS TCPDF</title>
		<link>http://komsitr.net/?p=48</link>
		<comments>http://komsitr.net/?p=48#comments</comments>
		<pubDate>Mon, 15 Mar 2010 10:34:18 +0000</pubDate>
		<dc:creator>KomsitR</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[FPDF]]></category>
		<category><![CDATA[TCPDF]]></category>

		<guid isPermaLink="false">http://komsitr.net/?p=48</guid>
		<description><![CDATA[ช่วงนี้มีโปรเจคที่ต้องทำให้ PHP สร้างเอกสาร PDF ออกมา เลยทำให้ต้องมานั่งคิดว่าจะใช้ Library ตัวไหนดี ครั้นจะใช้ PDF Module ของ PHP เองก็ดูจะยากไปหน่อย เลยลอง Google ดูไปเจอที่ฮิตๆกันอยู่ 2 ตัวคือ FPDF และ TCPDF เปรียบเทียบง่ายสุดก่อน อยากรู้ว่าอันไหนดังกว่ากัน ก็ลองใช้ Google Trends ทดสอบดู [คลิก] ได้ผลตามรูปด้านล่าง FPDF vs TCPDF by Google Trends จากกราฟ FPDF คือเส้นสีฟ้า และ TCPDF คือเส้นสีแดง ซึ่งเห็นได้ชัดว่า FPDF มันดังกว่ามาก ก็ลองเข้าไปดูเว็บมันซักหน่อย [คลิก] พบว่ามันออกจะดูโบราณนิด แล้วพอไปดูหน้าดาวน์โหลดของ FPDF ก็พบว่าเวอร์ชั่นล่าสุดคือ 1.6  ออกมาตั้งแต่เดือน 8 ปี 2008 สรุปว่าดูโดยรวมแล้วยังไม่ค่อยชอบใจเท่าไหร่ [...]]]></description>
			<content:encoded><![CDATA[<p>ช่วงนี้มีโปรเจคที่ต้องทำให้ PHP สร้างเอกสาร PDF ออกมา เลยทำให้ต้องมานั่งคิดว่าจะใช้ Library ตัวไหนดี</p>
<p>ครั้นจะใช้ PDF Module ของ PHP เองก็ดูจะยากไปหน่อย เลยลอง Google ดูไปเจอที่ฮิตๆกันอยู่ 2 ตัวคือ</p>
<p style="text-align: center; font-size: 20px"><strong><span style="color: #0066ff;">FPDF</span> และ <span style="color: #cc0000;">TCPDF</span></strong></p>
<p>เปรียบเทียบง่ายสุดก่อน อยากรู้ว่าอันไหนดังกว่ากัน ก็ลองใช้ Google Trends ทดสอบดู [<a href="http://www.google.com/trends?q=fpdf,+tcpdf&amp;ctab=0&amp;geo=all&amp;date=all&amp;sort=1" target="_blank">คลิก</a>] ได้ผลตามรูปด้านล่าง</p>
<p style="text-align: center;">
<div style="text-align: center;">
<dl id="attachment_49" style="display: block; margin-left: auto; margin-right: auto; text-align: center; background-color: #f3f3f3; padding-top: 4px; margin-top: 10px; margin-bottom: 10px; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; width: 310px; border: 1px solid #dddddd;">
<dt><img style="padding: 0px; margin: 0px; border: 0px none initial;" title="FPDF vs TCPDF by Google Trends" src="http://komsitr.net/wp-content/uploads/2010/03/viz-300x134.png" alt="FPDF vs TCPDF by Google Trends" width="300" height="134" /></dt>
<dd style="font-size: 11px; line-height: 17px; padding-top: 0px; padding-right: 4px; padding-bottom: 5px; padding-left: 4px; margin: 0px;">FPDF vs TCPDF by Google Trends</dd>
</dl>
</div>
<p><span id="more-48"></span></p>
<p>จากกราฟ <span style="color: #0066ff;">FPDF คือเส้นสีฟ้า</span> และ <span style="color: #cc0000;">TCPDF คือเส้นสีแดง</span> ซึ่งเห็นได้ชัดว่า <strong>FPDF </strong>มันดังกว่ามาก ก็ลองเข้าไปดูเว็บมันซักหน่อย [<a href="http://www.fpdf.org/" target="_blank">คลิก</a>] พบว่ามันออกจะดูโบราณนิด แล้วพอไปดูหน้าดาวน์โหลดของ FPDF ก็พบว่าเวอร์ชั่นล่าสุดคือ 1.6  ออกมาตั้งแต่เดือน 8 ปี 2008 <strong>สรุปว่าดูโดยรวมแล้วยังไม่ค่อยชอบใจเท่าไหร่ แต่เก็บไว้คิดหน่อยละกัน มันดังดี</strong></p>
<p>ทีนี้มาลองดูฝั่ง <strong>TCPDF </strong>บ้าง [<a href="http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf" target="_blank">คลิก</a>] ในเว็บไม่ค่อยพูดถึงประวัติซักเท่าไหร่ แต่ก็ไปเจอของ Wikipedia [<a href="http://en.wikipedia.org/wiki/TCPDF" target="_blank">คลิก</a>] เขียนไว้ว่า TCPDF พัฒนาต่อจาก FPDF แล้วปัจจุบันก็ยังเป็นโปรเจคที่ Active อยู่ด้วย อีกทั้งถูกใช้ใน CMS ดังๆหลายตัว เช่น Joomla, Drupal และอื่นๆ อ่านดูก็เริ่มน่าสนใจขึ้นมาแล้ว พอไปดูตรง Example เจอทีเด็ดที่ต้องการ! นั่นคือ</p>
<p style="text-align: center; font-size: 20px"><strong>สามารถสร้าง PDF จาก Tag HTML ได้</strong></p>
<p style="text-align: left;">ทำให้การสร้างตารางที่ซับซ้อน และการจัด Format เอกสารทำได้ง่ายขึ้นล้านนนนนนนนเท่า! <strong>เลยตัดสินใจว่าฝากอนาคตไว้กับ TCPDF เนี่ยแหละ</strong></p>
<p style="text-align: left;">ทีนี้มันยังมีอีก 1 ประเด็น คือ ความสามารถในการรองรับภาษาไทย แต่ก็ไม่มีปัญหาเพราะทั้ง FPDF และ TCPDF ประกาศกร้าวว่า Support ภาษาไทยแน่นอน เท่าที่เช็คดูใน TCPDF ก็มี Font ภาษาไทยมาให้แล้ว แต่ยังไม่ค่อยโดนใจ [<a href="http://www.tecnick.com/pagefiles/tcpdf/example_008.pdf" target="_blank">ดูตัวอย่าง Font คลิก</a>] ถ้าใครต้องการ Font อื่นๆ นอกเหนือจากนี้ก็ต้องไปทำ Font เอง ซึ่งขั้นตอนก็ไม่ซับซ้อนมากนักเพราะมี Manual ให้อย่างละเอียด [<a href="http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf_fonts" target="_blank">คลิก</a>]</p>
<p style="text-align: left;">สุดท้ายก็เลยไปลองทำ Font เองว่าจะใช้ภาษาไทยได้จริงอย่างที่โฆษณาไว้หรือเปล่า โดยทำออกมา 3 font ที่ชอบคือ</p>
<ol>
<li>AngsanaUPC</li>
<li>CordiaUPC</li>
<li>TH Sarabun PSK (ฟอนต์ฟรีจาก SIPA)</li>
</ol>
<p>ดาวน์โหลดกันไปใช้เล่นๆได้สำหรับคนที่ขี้เกียจทำเอง [<a rel="attachment wp-att-64" href="http://komsitr.net/?attachment_id=64">คลิก</a>] แล้วก็มี Demo เอกสารที่ทดลองใช้ Font ที่สร้างขึ้นมาให้ดู [<a rel="attachment wp-att-55" href="http://komsitr.net/?attachment_id=55">ทดสอบภาษาไทยกับ TCPDF</a>]</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://komsitr.net/?feed=rss2&amp;p=48</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Config DHCP in FreeBSD</title>
		<link>http://komsitr.net/?p=33</link>
		<comments>http://komsitr.net/?p=33#comments</comments>
		<pubDate>Mon, 07 Dec 2009 14:14:46 +0000</pubDate>
		<dc:creator>KomsitR</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[CP]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://komsitr.net/?p=33</guid>
		<description><![CDATA[ได้ยินว่าหลายๆคน ไม่สามารถทำให้ FreeBSD ติดต่อออกไปยัง Internet ได้ นั่นเป็นเพราะตอน Install ไม่ได้ config ค่า Network ให้ถูกต้อง (กด Next แหลก) ซึ่งสามารถแก้ไขได้ดังนี้ สั่ง ifconfig เพื่อดูว่าเรามี Network Interface อะไรอยู่บ้างในเครื่องของเรา ดังในภาพจะเห็นว่ามีอยู่ 3 interface คือ em0, plip0 และ lo0 แก้ไขไฟล์ /etc/rc.conf โดยใช้คำสั่ง vi หรือ ee ก็ได้ อย่างเครื่องผม Interface ที่จะออก Internet คือ em0 ดังนั้น ให้เติมคำสั่งนี้ลงไป ifconfig_em0=&#8221;DHCP&#8221; ถ้าเห็นมีคำสั่งนี้อยู่แล้วแต่ value ไม่ตรงก็แก้ให้เป็น DHCP ซึ่งหมายถึงในคอมพิวเตอร์ไปรับแจก IP มาเอง จากนั้น [...]]]></description>
			<content:encoded><![CDATA[<p>ได้ยินว่าหลายๆคน ไม่สามารถทำให้ FreeBSD ติดต่อออกไปยัง Internet ได้</p>
<p>นั่นเป็นเพราะตอน Install ไม่ได้ config ค่า Network ให้ถูกต้อง (กด Next แหลก) ซึ่งสามารถแก้ไขได้ดังนี้</p>
<p><span id="more-33"></span></p>
<ol>
<li>สั่ง ifconfig เพื่อดูว่าเรามี Network Interface อะไรอยู่บ้างในเครื่องของเรา
<div id="attachment_35" class="wp-caption aligncenter" style="width: 310px"><a href="http://komsitr.net/wp-content/uploads/2009/12/FreeBSD-2009-12-07-21-01-52.png"><img class="size-medium wp-image-35" title="FreeBSD-2009-12-07-21-01-52" src="http://komsitr.net/wp-content/uploads/2009/12/FreeBSD-2009-12-07-21-01-52-300x166.png" alt="ifconfig" width="300" height="166" /></a><p class="wp-caption-text">ifconfig</p></div>
<p>ดังในภาพจะเห็นว่ามีอยู่ 3 interface คือ em0, plip0 และ lo0</li>
<li>แก้ไขไฟล์ /etc/rc.conf โดยใช้คำสั่ง vi หรือ ee ก็ได้
<div id="attachment_36" class="wp-caption aligncenter" style="width: 310px"><a href="http://komsitr.net/wp-content/uploads/2009/12/FreeBSD-2009-12-07-21-06-54.png"><img class="size-medium wp-image-36" title="FreeBSD-2009-12-07-21-06-54" src="http://komsitr.net/wp-content/uploads/2009/12/FreeBSD-2009-12-07-21-06-54-300x166.png" alt="/etc/rc.conf" width="300" height="166" /></a><p class="wp-caption-text">/etc/rc.conf</p></div>
<p>อย่างเครื่องผม Interface ที่จะออก Internet คือ em0 ดังนั้น ให้เติมคำสั่งนี้ลงไป<br />
<strong>ifconfig_em0=&#8221;DHCP&#8221;</strong><br />
ถ้าเห็นมีคำสั่งนี้อยู่แล้วแต่ value ไม่ตรงก็แก้ให้เป็น DHCP ซึ่งหมายถึงในคอมพิวเตอร์ไปรับแจก IP มาเอง<br />
จากนั้น save file ดังกล่าวแล้วออกมาที่ shell prompt</li>
<li>สั่งคำสั่ง restart network interface กับ rounting เครื่อง เพื่อให้ค่าที่เราแก้ไปมีผล<br />
<strong>/etc/rc.d/netif restart<br />
/etc/rc.d/routing restart</strong><br />
&#8211; thank to <a title="Teerapap.net" href="http://www.teerapap.net" target="_blank">@teerapap</a><br />
ถ้าทำทุกอย่างถูกต้องหลัง restart เสร็จแล้ว สั่ง ifconfig อีกครั้ง<br />
จะเห็นคำว่า UP อยู่ตรงบริเวณ interface ที่เราแก้ไป ในที่นี้คือ em0</li>
<li>ลอง ping komsitr.net ดูก็จะพบว่าต่อเน็ตได้แล้วครับ
<p><div id="attachment_38" class="wp-caption aligncenter" style="width: 310px"><a href="http://komsitr.net/wp-content/uploads/2009/12/FreeBSD-2009-12-07-21-13-57.png"><img class="size-medium wp-image-38" title="FreeBSD-2009-12-07-21-13-57" src="http://komsitr.net/wp-content/uploads/2009/12/FreeBSD-2009-12-07-21-13-57-300x166.png" alt="ping komsitr.net" width="300" height="166" /></a><p class="wp-caption-text">ping komsitr.net</p></div></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://komsitr.net/?feed=rss2&amp;p=33</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Working with DTrace</title>
		<link>http://komsitr.net/?p=18</link>
		<comments>http://komsitr.net/?p=18#comments</comments>
		<pubDate>Mon, 07 Dec 2009 09:13:47 +0000</pubDate>
		<dc:creator>KomsitR</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[CP]]></category>
		<category><![CDATA[DTrace]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://komsitr.net/?p=18</guid>
		<description><![CDATA[การบ้านครั้งที่ 2 สำหรับวิชา UNIX คือให้ฝึกใช้คำสั่ง DTrace เป็นโปรแกรมที่เอาไว้วัด Performance ต่างๆของเครื่อง ว่าไปก็คล้ายๆโปรแกรม Intel VTune Performance Analyze และโปรแกรม Intel Thread Profiler ตามการบ้านให้หาข้อมูลเหล่านี้ provider/probe hooks scripting predicates DIF aggregation DTrace client DTrace ioctl Enabling DTrace สำหรับขั้นตอนการ Enable DTrace ใน FreeBSD ก็มีดังนี้ Compile kernel ใหม่เพื่อใส่ option เพื่อ support DTrace กันก่อน สมมติว่าเครื่องเป็น CPU แบบ i386 ให้เข้าไปที่ /usr/src/sys/i386/conf/ ถ้าเข้าไปแล้วพบว่าไม่ีมีี directory ดังกล่าว หรือว่าไม่มี [...]]]></description>
			<content:encoded><![CDATA[<p>การบ้านครั้งที่ 2 สำหรับวิชา UNIX คือให้ฝึกใช้คำสั่ง DTrace เป็นโปรแกรมที่เอาไว้วัด Performance ต่างๆของเครื่อง</p>
<p>ว่าไปก็คล้ายๆโปรแกรม Intel VTune Performance Analyze และโปรแกรม Intel Thread Profiler</p>
<p>ตามการบ้านให้หาข้อมูลเหล่านี้</p>
<ul>
<li>provider/probe</li>
<li>hooks</li>
<li>scripting</li>
<li>predicates</li>
<li>DIF</li>
<li>aggregation</li>
<li>DTrace client</li>
<li>DTrace ioctl</li>
</ul>
<p><span id="more-18"></span></p>
<h2>Enabling DTrace</h2>
<p>สำหรับขั้นตอนการ Enable DTrace ใน FreeBSD ก็มีดังนี้</p>
<ul>
<li>Compile kernel ใหม่เพื่อใส่ option เพื่อ support DTrace กันก่อน
<ul>
<li>สมมติว่าเครื่องเป็น CPU แบบ i386 ให้เข้าไปที่ /usr/src/sys/i386/conf/<br />
ถ้าเข้าไปแล้วพบว่าไม่ีมีี directory ดังกล่าว หรือว่าไม่มี source ของ kernel ให้ทำตามนี้<br />
<a href="http://www.freebsd.org/doc/en/books/handbook/kernelconfig-building.html" target="_blank">http://www.freebsd.org/doc/en/books/handbook/kernelconfig-building.html</a></li>
<li>แก้ไฟล์ GENERIC (หรือ copy ออกมาเป็นอีกไฟล์ก็ได้) โดยทำตามนี้<br />
<a href="http://www.freebsd.org/doc/en/books/handbook/dtrace-enable.html" target="_blank">http://www.freebsd.org/doc/en/books/handbook/dtrace-enable.html</a></li>
<li>ถ้า copy ไฟล์ GENERIC ออกมาแก้ หรือแก้ไฟล์ config อื่นๆ<br />
ตอน compile kernel ต้องสั่ง<br />
<strong>make WITH_CTF=1 kernel KERNCONF=<em>#FILENAME</em></strong></li>
<li>Compile เสร็จแล้วก็ restart</li>
<li><span style="color: #ff0000;">ปัญหาที่พบ </span>
<ul>
<li><span style="color: #ff0000;">HDD ไม่พอ ควรเหลือพื้นที่เกิน 3GB ขึ้นไป ไม่แน่ใจว่าใน /usr หรือใน /boot</span></li>
<li><span style="color: #ff0000;">ตอน copy source ไฟล์จาก /cdrom เนื่องจากแผ่นที่ใช้เป็น รุ่น 8.0 RC2 (รึเปล่า) ทำให้มันไม่ได้เก็บ src ไว้ที่ /cdrom แต่ต้อง browse เข้าไปอีกใน folder ชื่อ <strong>8.0-RC2</strong> ก่อน จึงได้คำสั่งเป็น<br />
</span><span style="color: #ff0000;">cat /cdrom/<strong>8.0-RC2</strong>/src/ssys.[a-d]* | tar -xzvf -</span><strong><span style="color: #ff0000;"><br />
</span></strong><span style="color: #ff0000;">cat /cdrom/<strong>8.0-RC2</strong>/src/sbase.[a-d]* | tar -xzvf -</span></li>
</ul>
</li>
<li>ข้อควรระวัง
<ul>
<li>Backup kernel เก่าไว้ก่อน โดย <span style="color: #339966;">rename /boot/kernel.old เป็นชื่ออื่นเช่น /boot/kernel.good</span> เป็นต้น<br />
ถ้าเกิดมีปัญหาจะได้กลับมา Boot ด้วย kernel เก่าได้</li>
</ul>
</li>
</ul>
</li>
<li style="text-align: left;">ถ้า Kernel ใหม่ที่ สร้างมาไม่มีปัญหาใดๆ ก็ทำตามนี้ต่อเลย <a href="http://www.freebsd.org/doc/en/books/handbook/dtrace-using.html" target="_blank">http://www.freebsd.org/doc/en/books/handbook/dtrace-using.html</a></li>
</ul>
<h2>DTrace D Language Resources</h2>
<p>ในการบ้านต้องมีการแสดง feature ต่างๆของ DTrace ด้วย นั่นหมายถึงการเขียนโปรแกรมด้วยภาษา D Language ซึ่งสามารถศึกษาได้จากแหล่งเหล่านี้</p>
<ul>
<li>Learning DTrace Part 1<br />
<a href="http://www.laurustech.com/Learning%20DTrace_Part1.pdf" target="_blank">http://www.laurustech.com/Learning%20DTrace_Part1.pdf</a></li>
<li>Learning DTrace Part 2: Scripts and the D Language<br />
<a href="http://www.laurustech.com/Learning%20DTrace_Part2.pdf" target="_blank">http://www.laurustech.com/Learning%20DTrace_Part2.pdf</a></li>
<li>Learning DTrace Part 3: Advanced Scripting and Aggregations<br />
<a href="http://www.laurustech.com/Learning DTrace_Part3.pdf" target="_blank">http://www.laurustech.com/Learning DTrace_Part3.pdf</a></li>
<li>Learning DTrace Part 4: Solving Everyday Problems<br />
<a href="http://www.laurustech.com/Learning%20DTrace_Part4.pdf" target="_blank">http://www.laurustech.com/Learning%20DTrace_Part4.pdf</a></li>
<li>Learning DTrace Part 5: Completing the Picture<br />
<a href="http://www.laurustech.com/Learning%20DTrace_Part5.pdf" target="_blank">http://www.laurustech.com/Learning%20DTrace_Part5.pdf</a></li>
<li>DTrace Quick Reference Guide<br />
<a href="http://developers.sun.com/solaris/articles/dtrace_quickref/dtrace_quickref.html" target="_blank">http://developers.sun.com/solaris/articles/dtrace_quickref/dtrace_quickref.html</a></li>
</ul>
<p>สำหรับตัวอย่างการสร้าง Partition ใหม่ใน FreeBSD และตัวอย่างของแต่ละหัวข้อในการบ้านจะยกไว้ Blog หน้าละกัน</p>
]]></content:encoded>
			<wfw:commentRss>http://komsitr.net/?feed=rss2&amp;p=18</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>UNIX System Administration Proficiency Test</title>
		<link>http://komsitr.net/?p=4</link>
		<comments>http://komsitr.net/?p=4#comments</comments>
		<pubDate>Tue, 01 Dec 2009 09:27:35 +0000</pubDate>
		<dc:creator>KomsitR</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[CP]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://komsitr.net/?p=4</guid>
		<description><![CDATA[ในวิชา UNIX/Linux for Enterprise Environment มีสอบการใช้งาน 20 คำสั่งของ UNIX โดยใช้ FreeBSD เป็นตัวสอบ โจทย์ 20 ก็มีดังนี้ แสดงและอธิบายถึงขนาดของ swap partition อธิบายว่าทำไมจึงต้องแบ่ง Disk เป็น partition แสดงถึง System specific และ Site-wide configuration แสดงข้อแตกต่างหรือความสัมพันธ์ระหว่าง /usr/local/etc/* กับ /usr/local/etc/rc.d/* และ /etc/rc.d/* แสดงและอธิบายความหมายของแต่ละ Field ใน /etc/crontab file แสดงการ install NDIS (Network Driver Interface Specification) โดยผ่าน NDISulator แสดงการทำ Multiple IP Address (Virtual host) /etc/hosts ใช้ทำอะไร [...]]]></description>
			<content:encoded><![CDATA[<p>ในวิชา UNIX/Linux for Enterprise Environment มีสอบการใช้งาน 20 คำสั่งของ UNIX โดยใช้ FreeBSD เป็นตัวสอบ โจทย์ 20 ก็มีดังนี้</p>
<ol>
<li>แสดงและอธิบายถึงขนาดของ swap partition</li>
<li>อธิบายว่าทำไมจึงต้องแบ่ง Disk เป็น partition</li>
<li>แสดงถึง System specific และ Site-wide configuration</li>
<li>แสดงข้อแตกต่างหรือความสัมพันธ์ระหว่าง /usr/local/etc/* กับ /usr/local/etc/rc.d/* และ /etc/rc.d/*</li>
<li>แสดงและอธิบายความหมายของแต่ละ Field ใน /etc/crontab file</li>
<li>แสดงการ install NDIS (Network Driver Interface Specification) โดยผ่าน NDISulator</li>
<li>แสดงการทำ Multiple IP Address (Virtual host)</li>
<li>/etc/hosts ใช้ทำอะไร เมื่อมี /etc/resolv.conf แล้วทำไมยังต้องใช้อีก</li>
<li>แสดงการ tune จำนวน process ให้เป็น 10,000 โดยใช้ sysctl(8)</li>
<li>อธิบายถึง Soft update ในการ tune ระบบแฟ้ม โดยใช้คำสั่ง tunefs(8)</li>
<li>แสดงการใช้ netstat(1) และอธิบาย field ต่างๆ</li>
<li>Bootstrap คืออะไร เกี่ยวข้องกับ BIOS และ MBR อย่างไร</li>
<li>Boot flag –s ใช้ทำอะไร หมายถึงอะไร</li>
<li>shutdown ต่างจาก halt command อย่างไร</li>
<li>แสดงการใช้ chpass(1)</li>
<li>แสดงการใช้ md5(1) ในการทำ file integrity check</li>
<li>อธิบายถึงความสัมพันธ์ระหว่าง DOS attack (Denial of Service) กับการจำกัด Server fork</li>
<li>อธิบายและแสดงถึงวิธีหาว่าระบบใช้วิธีการใด (DES/MD5/Blowfish) ในการ Encrypt password</li>
<li>แสดงการใช้และสถานะของ USB device</li>
<li>แสดงการใช้ file system snapshots – mksnap_ffs(8)</li>
</ol>
<p>พอทำเสร็จก็คิดว่าเป็นอะไรที่น่าจะจดเก็บไว้ เลยทำเป็น PDF มาให้โหลด</p>
<p><a href="http://komsitr.net/wp-content/uploads/2009/12/UNIX-System-Admin-Pro-Test.pdf">ดาวน์โหลดไฟล์ UNIX System Administration Proficiency Test ที่นี่</a></p>
]]></content:encoded>
			<wfw:commentRss>http://komsitr.net/?feed=rss2&amp;p=4</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
