<?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>nattster &#187; linux</title>
	<atom:link href="http://nattster.siamdev.net/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://nattster.siamdev.net</link>
	<description>ก็ชอบเขียนโปรแกรมอ่ะ...ผิดตรงไหน!?</description>
	<lastBuildDate>Tue, 01 Jun 2010 08:57:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	
<!-- Start Of Script Generated By WP-PostViews Plus -->
<script type='text/javascript' src='http://nattster.siamdev.net/wp-includes/js/jquery/jquery.js?ver=1.4.2'></script>
<script type="text/javascript">
/* <![CDATA[ */
/* ]]> */
</script>
<!-- End Of Script Generated By WP-PostViews Plus -->
	<item>
		<title>Getting a FTDI USB-to-Serial converter to work on Ubuntu 9.10</title>
		<link>http://nattster.siamdev.net/2010/02/getting-a-ftdi-usb-to-serial-converter-to-work-on-ubuntu-9-10/</link>
		<comments>http://nattster.siamdev.net/2010/02/getting-a-ftdi-usb-to-serial-converter-to-work-on-ubuntu-9-10/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 12:57:32 +0000</pubDate>
		<dc:creator>nattster</dc:creator>
				<category><![CDATA[คอมพิวเตอร์จ๋า]]></category>
		<category><![CDATA[ftdi]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[micropro]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://nattster.siamdev.net/?p=638</guid>
		<description><![CDATA[I bought a USB-to-Serial converter from ETTeam.com and test it with Ubuntu 9.10 (Karmic kernel 2.6.31-18-generic.) I&#8217;ve found that it doesn&#8217;t show as /dev/ttyUSB0 as other generic USB-to-Serial converter do. I&#8217;ve been googling for the solution for a while and found this bug report: ftdi serial driver broken in linux-image-2.6.31-14-generic (2.6.31-14.48) It said that the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.etteam.com/product/intf/et-usb-rs232-mini.jpg" width="200" align="left" style="padding: 5px;" /> I bought a USB-to-Serial converter from ETTeam.com and test it with Ubuntu 9.10 (Karmic kernel 2.6.31-18-generic.) I&#8217;ve found that it doesn&#8217;t show as /dev/ttyUSB0 as other generic USB-to-Serial converter do.<br />
<span id="more-638"></span><br />
I&#8217;ve been googling for the solution for a while and found this bug report: <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/460857">ftdi serial driver broken in linux-image-2.6.31-14-generic (2.6.31-14.48)</a><br />
It said that the fix is released with linux-kernel 2.6.32-13.18.</p>
<p>So I download a new 2.6.32 kernel package (.deb) from <a href="http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.32.8/">Ubuntu&#8217;s kernel-ppa</a>. I installed these package with a command:</p>

<div class="wp_syntax"><div class="code"><pre class="generic" style="font-family:monospace;">sudo dpkg -i *.deb</pre></div></div>

<p>Now, I can load a ftdi_sio (FTDI Serial Input/Output) driver with a modprobe command. But it doesn&#8217;t recognize my device yet. I ran a <strong>lsusb</strong> command and found that my converter has a different Product ID. (It might be customized by ETTeam.com)</p>

<div class="wp_syntax"><div class="code"><pre class="generic" style="font-family:monospace;">$ lsusb
Bus 005 Device 005: ID 0403:e2e6 Future Technology Devices International, Ltd</pre></div></div>

<p>(0403 = vendor ID, e2e6 = product ID)</p>
<p>To get it work, I have to run the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="generic" style="font-family:monospace;">$ sudo modprobe ftdi_sio vendor=0x0403 product=0xe2e6</pre></div></div>

<p>Then I replug the converter and it is shown as /dev/ttyUSB0 now!</p>
]]></content:encoded>
			<wfw:commentRss>http://nattster.siamdev.net/2010/02/getting-a-ftdi-usb-to-serial-converter-to-work-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OpenKiosk Extension : ตู้ประชาสัมพันธ์ง่ายๆ ด้วย Firefox</title>
		<link>http://nattster.siamdev.net/2009/10/openkiosk-firefox-extension/</link>
		<comments>http://nattster.siamdev.net/2009/10/openkiosk-firefox-extension/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 09:55:01 +0000</pubDate>
		<dc:creator>nattster</dc:creator>
				<category><![CDATA[คอมพิวเตอร์จ๋า]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[kiosk]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://nattster.siamdev.net/?p=578</guid>
		<description><![CDATA[ไปแข่ง linux (NLC10 &#8211; การแข่งขันระบบปฏิบัติการลินุกซ์แห่งประเทศไทย) มา เขามีโจทย์ให้เลือก 5 ข้อ กลุ่มผมเลือกทำข้อง่ายสุดคือ &#8220;เตรียมเครื่อง linux สำหรับเป็นตู้ Interactive Kiosk สำหรับสนามบินแห่งชาติ&#8221; (ขอเรียก Interactive Kiosk สั้นๆ ว่า Kiosk ละกันนะครับ) ถ้างงว่าตู้ Kiosk คืออะไร ให้นึกถึงจอ Touchscreen ใหญ่ๆ ตามห้างครับ ที่เราเข้าไปจิ้มๆ หาข้อมูลได้ว่าร้านกระเป๋าหลุยส์ติงต๊อง อยู่ชั้นไหนโซนไหน จะได้เดินไปซื้อได้ถูก เจ้าจอ Touchscreen ใหญ่ๆ นี่แหละครับเรียกว่าตู้ Kiosk หรือตู้ประชาสัมพันธ์ คุณสมบัติที่สำคัญของตู้ Kiosk คือ ดูเว็บ/ใช้โปรแกรมประชาสัมพันธ์ได้อย่างเดียว ไม่มีสามารถหลบไปเล่นเกมกู้ระเบิด (Minesweeper), ถอดไพ่ (Solitare) หรือใช้งานโปรแกรมอื่นๆ ทำยังไงให้คอมธรรมดา กลายเป็นตู้ Kiosk ติดตั้ง ระบบปฏิบัติการตามใจชอบ จะ [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_580" class="wp-caption alignleft" style="width: 268px"><a href="http://nattster.siamdev.net/wp-content/uploads/2009/10/army.mil-35841-2009-04-22-150416.resized.jpg" title="ตัวอย่างตู้ Kiosk ของ US Army" rel="lightbox[578]"><img src="http://nattster.siamdev.net/wp-content/uploads/2009/10/army.mil-35841-2009-04-22-150416.resized-258x300.jpg" alt="ตัวอย่างตู้ Kiosk ของ US Army (ภาพจาก http://www.army.mil)" title="ตัวอย่างตู้ Kiosk ของ US Army" width="258" height="300" class="size-medium wp-image-580" /></a><p class="wp-caption-text">ตัวอย่างตู้ Kiosk ของ US Army (ภาพจาก http://www.army.mil)</p></div>ไปแข่ง linux <a href="http://nlc10.opentle.org/">(NLC10 &#8211; การแข่งขันระบบปฏิบัติการลินุกซ์แห่งประเทศไทย)</a> มา เขามีโจทย์ให้เลือก 5 ข้อ กลุ่มผมเลือกทำข้อง่ายสุดคือ &#8220;เตรียมเครื่อง linux สำหรับเป็นตู้ <a href="http://en.wikipedia.org/wiki/Interactive_kiosk#Internet_Kiosk">Interactive Kiosk</a> สำหรับสนามบินแห่งชาติ&#8221; (ขอเรียก Interactive Kiosk สั้นๆ ว่า Kiosk ละกันนะครับ)</p>
<h4>ถ้างงว่าตู้ Kiosk คืออะไร</h4>
<p>ให้นึกถึงจอ Touchscreen ใหญ่ๆ ตามห้างครับ ที่เราเข้าไปจิ้มๆ หาข้อมูลได้ว่าร้านกระเป๋าหลุยส์ติงต๊อง อยู่ชั้นไหนโซนไหน จะได้เดินไปซื้อได้ถูก เจ้าจอ Touchscreen ใหญ่ๆ นี่แหละครับเรียกว่าตู้ Kiosk หรือตู้ประชาสัมพันธ์</p>
<h4>คุณสมบัติที่สำคัญของตู้ Kiosk คือ</h4>
<p>ดูเว็บ/ใช้โปรแกรมประชาสัมพันธ์ได้อย่างเดียว ไม่มีสามารถหลบไปเล่นเกมกู้ระเบิด (Minesweeper), ถอดไพ่ (Solitare) หรือใช้งานโปรแกรมอื่นๆ</p>
<h4>ทำยังไงให้คอมธรรมดา กลายเป็นตู้ Kiosk</h4>
<ol>
<li>ติดตั้ง ระบบปฏิบัติการตามใจชอบ จะ Windows หรือ Linux ก็ได้</li>
<li>ติดตั้ง Mozilla Firefox, jsLib และ OpenKiosk จากเว็บ <a href="https://mozdevgroup.com/clients/bm/">Brooklyn Museum Kiosk Client</a></li>
<li>เมื่อติดตั้งเสร็จแล้วให้ปิด firefox แล้วเปิดจาก Command line ดังนี้ (เพื่อเปิดใช้ Kiosk แบบเต็มจอ)

<div class="wp_syntax"><div class="code"><pre class="generic" style="font-family:monospace;">mozilla -kiosk</pre></div></div>

</li>
<li>นอกจากนี้เรายังสามารถตั้งค่า Firefox ด้วย OpenKiosk ได้อีกมากมาย อ่านรายละเอียดได้จาก <a href="https://mozdevgroup.com/clients/bm/">https://mozdevgroup.com/clients/bm/</a> ครับ</li>
</ol>
<p>ตอนแข่งผมก็นั่งแก้ GUI ของ firefox เอง (firefox มันใช้ XUL ทำ GUI ครับ แก้ไขได้อิสระมากๆ) แต่พอค้นดีๆ เจอ OpenKiosk แล้ว โฮกกกก&#8230;. รู้งี้โหลดมาใช้ตั้งนานแล้ว</p>
]]></content:encoded>
			<wfw:commentRss>http://nattster.siamdev.net/2009/10/openkiosk-firefox-extension/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ใส่ script ช่วยล็อกอินอัตโนมัติเวลาต่อเน็ต</title>
		<link>http://nattster.siamdev.net/2009/06/auto-login-script-hook/</link>
		<comments>http://nattster.siamdev.net/2009/06/auto-login-script-hook/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 16:41:57 +0000</pubDate>
		<dc:creator>nattster</dc:creator>
				<category><![CDATA[คอมพิวเตอร์จ๋า]]></category>
		<category><![CDATA[autologin]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nontri]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://nattster.siamdev.net/?p=339</guid>
		<description><![CDATA[ตั้งแต่ พรบ. คอมฯ ปี 50 ประกาศใช้ พวกเราผู้ใช้อินเตอร์เน็ตของหน่วยงานต่างๆ ก็คงจะคุ้นเคยกับหน้าจอ Login คล้ายๆ กับรูปทางซ้ายมือนี้ เรามาใส่ script ช่วยล็อกอินอัตโนมัติเวลาต่อ Wireless ติดกันดีกว่า (บล็อกนี้สำหรับผู้ใช้ Linux เท่านั้นครับ) &#8220;พอใช้ Script นี้เวลาเปิดเครื่องมา แล้วต่อ Wireless ติด มันก็ login ให้ทันทีครับ แล้วก็ login ซ้ำ เวลาต่อ Wireless อันใหม่ให้ด้วย!&#8221; &#8212; @nattster วิธีทำ 1. ที่ไดเร็กทอรี่ /etc/NetworkManager/dispatcher.d ให้สร้างไฟล์ 02autologin ครับ $ sudo gedit /etc/NetworkManager/dispatcher.d/02autologin 2. แปะโค้ดดังนี้ 1 2 3 4 5 6 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://nattster.siamdev.net/wp-content/uploads/2009/06/login1.png" title="หน้าจอ login แบบนี้" rel="lightbox[339]"><img src="http://nattster.siamdev.net/wp-content/uploads/2009/06/login1-150x150.png" alt="หน้าจอ login แบบนี้" title="หน้าจอ login แบบนี้" width="150" height="150" class="alignleft size-thumbnail wp-image-340" /></a> ตั้งแต่ พรบ. คอมฯ ปี 50 ประกาศใช้ พวกเราผู้ใช้อินเตอร์เน็ตของหน่วยงานต่างๆ ก็คงจะคุ้นเคยกับหน้าจอ Login คล้ายๆ กับรูปทางซ้ายมือนี้</p>
<p>เรามาใส่ script ช่วยล็อกอินอัตโนมัติเวลาต่อ Wireless ติดกันดีกว่า (บล็อกนี้สำหรับผู้ใช้ Linux เท่านั้นครับ)</p>
<blockquote><p>&#8220;พอใช้ Script นี้เวลาเปิดเครื่องมา แล้วต่อ Wireless ติด มันก็ login ให้ทันทีครับ แล้วก็ login ซ้ำ เวลาต่อ Wireless อันใหม่ให้ด้วย!&#8221; &#8212; @nattster</p></blockquote>
<p><span id="more-339"></span></p>
<h3>วิธีทำ</h3>
<p>1. ที่ไดเร็กทอรี่ /etc/NetworkManager/dispatcher.d ให้สร้างไฟล์ 02autologin ครับ</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gedit <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>NetworkManager<span style="color: #000000; font-weight: bold;">/</span>dispatcher.d<span style="color: #000000; font-weight: bold;">/</span>02autologin</pre></div></div>

<p>2. แปะโค้ดดังนี้</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #007800;">IF</span>=$<span style="color: #000000;">1</span>
<span style="color: #007800;">STATUS</span>=$<span style="color: #000000;">2</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$STATUS</span>&quot;</span> = <span style="color: #ff0000;">&quot;up&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$IF</span>&quot;</span> = <span style="color: #ff0000;">&quot;wlan0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>        <span style="color: #666666; font-style: italic;"># แก้ wlan0 เป็นชื่อการ์ด wireless หรือ lan ตามใจชอบ</span>
        <span style="color: #007800;">val</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>iwconfig <span style="color: #007800;">$IF</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">'ESSID:[^ ]*'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #007800;">essid</span>=<span style="color: #800000;">${val:7:$[${#val}</span>-<span style="color: #000000;">8</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$essid</span> <span style="color: #000000; font-weight: bold;">in</span>
        truewifi<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
            python <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>xxx<span style="color: #000000; font-weight: bold;">/</span>autologin1.py
            <span style="color: #000000; font-weight: bold;">;;</span>
        KUWIN<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
            python <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>xxx<span style="color: #000000; font-weight: bold;">/</span>autologin2.py
            <span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #000000; font-weight: bold;">esac</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>3. อย่าลืมแก้ <strong>wlan0</strong> ในบรรทัดที่ 5 เป็นชื่อการ์ด wireless หรือ lan ที่ต้องการให้ช่วย login อัตโนมัติด้วยนะครับ (เช่น eth0, eth1 เป็นต้น)<br />
4. Save และปิดไฟล์ แล้วเรียกคำสั่ง</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>NetworkManager<span style="color: #000000; font-weight: bold;">/</span>dispatcher.d<span style="color: #000000; font-weight: bold;">/</span>02autologin</pre></div></div>

<h3>Script นี้ทำไร?</h3>
<p>Script ข้างบน<strong>ยังทำงานไม่ได้</strong>นะครับ มันแค่ทำหน้าที่เช็คว่า <strong>&#8220;ถ้า wlan0 ถูกเชื่อมต่อกับ truewifi ให้รันสคริปต์ /home/xxx/autologin1.py ขึ้นทำงาน&#8221;</strong> เท่านั้นเองครับ</p>
<p>ถ้าจะให้มันทำงานได้จริงๆ ต้องไปหา(หรือเขียน) script autologin สำหรับอินเตอร์เน็ตแต่ละยี่ห้อนะครับ </p>
<p>ถ้าใช้เน็ตยี่ห้อเดียวกัน ติดต่อหลังไมค์ได้ครับ <img src='http://nattster.siamdev.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  (ตะโกนใส่ <a href="http://twitter.com/nattster">@nattster</a> ก็ได้ครับ)</p>
<p><em>หมายเหตุ: ทดลองบน Ubuntu 9.04 และใช้ Network Manager เป็นตัวจัดการ Wireless + LAN ครับ</em><br />
<strong>เพิ่มเติม: </strong> สำหรับคนใช้ ifconfig เป็นตัวจัดการเน็ตเวิร์ค (เช่น Ubuntu Server) สามารถใส่ script ไว้ที่ /etc/network/if-up.d/ ได้นะครับ ให้ผลลัพธ์เหมือนกัน</p>
]]></content:encoded>
			<wfw:commentRss>http://nattster.siamdev.net/2009/06/auto-login-script-hook/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ฟอนท์ Tahoma คมๆ บน Ubuntu</title>
		<link>http://nattster.siamdev.net/2009/06/sharp-font-on-ubuntu/</link>
		<comments>http://nattster.siamdev.net/2009/06/sharp-font-on-ubuntu/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 08:19:44 +0000</pubDate>
		<dc:creator>nattster</dc:creator>
				<category><![CDATA[คอมพิวเตอร์จ๋า]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://nattster.siamdev.net/?p=281</guid>
		<description><![CDATA[อธิบายลักษณะฟอนท์ด้วยภาพ: ผมรู้สึกว่า Anti-alias กับ Font-hinting บน Ubuntu ทำให้หน้าเว็บภาษาไทยอ่านยาก ผมก็เลยเอา tahoma.ttf จาก Windows Vista (แท้นะจ๊ะ) มาใส่ไว้ที่ ~/.fonts/  (~/ คือ home directory มีความหมายคือ /home/nattster/ นะครับ) แล้วก็สร้างไฟล์ ~/.fonts.conf ตามคำแนะนำเรื่องฟอนท์ใน wiki ของ Ubuntu แต่ใน wiki เขาเขียน config สำหรับ font ไว้หลายตัวมากผมเลยตัดๆ config ทิ้งจนได้ ไฟล์ .fonts.conf (ของผม) ใครลองเอาไปใช้ได้ผลลัพธ์อย่างไร เล่าให้ฟังกันบ้างนะครับ หมายเหตุ: ผมต้องการเปิด Hinting กับ Anti-alias ตามปกติ แค่อยากปิด 2 ความสามารถนี้เมื่อฟอนท์มันเล็กเท่านั้นครับ]]></description>
			<content:encoded><![CDATA[<p>อธิบายลักษณะฟอนท์ด้วยภาพ:</p>
<p><a href="http://nattster.siamdev.net/wp-content/uploads/2009/06/font_before_after.png"><a href="http://nattster.siamdev.net/wp-content/uploads/2009/06/font_before_after.png" title="ก่อนและหลังแก้ .fonts.conf" rel="lightbox[281]"><img class="aligncenter size-full wp-image-291" title="ก่อนและหลังแก้ .fonts.conf" src="http://nattster.siamdev.net/wp-content/uploads/2009/06/font_before_after.png" alt="ก่อนและหลังแก้ .fonts.conf" width="581" height="113" style="border:1px solid #000;" /></a></a></p>
<p>ผมรู้สึกว่า Anti-alias กับ Font-hinting บน Ubuntu ทำให้หน้าเว็บภาษาไทยอ่านยาก ผมก็เลยเอา tahoma.ttf จาก Windows Vista (แท้นะจ๊ะ) มาใส่ไว้ที่ ~/.fonts/  (~/ คือ home directory มีความหมายคือ /home/nattster/ นะครับ)</p>
<p>แล้วก็สร้างไฟล์ ~/.fonts.conf ตามคำแนะนำเรื่อง<a href="https://wiki.ubuntu.com/Fonts#Font%20settings">ฟอนท์ใน wiki ของ Ubuntu</a> แต่ใน wiki เขาเขียน config สำหรับ font ไว้หลายตัวมากผมเลยตัดๆ config ทิ้งจนได้ <a href="http://nattster.siamdev.net/wp-content/uploads/2009/06/fonts.conf">ไฟล์ .fonts.conf (ของผม)</a> ใครลองเอาไปใช้ได้ผลลัพธ์อย่างไร เล่าให้ฟังกันบ้างนะครับ <img src='http://nattster.siamdev.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>หมายเหตุ: ผมต้องการเปิด Hinting กับ Anti-alias ตามปกติ แค่อยากปิด 2 ความสามารถนี้เมื่อฟอนท์มันเล็กเท่านั้นครับ</p>
]]></content:encoded>
			<wfw:commentRss>http://nattster.siamdev.net/2009/06/sharp-font-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ใช้ man ดู Function Reference ภาษาซีใน ubuntu</title>
		<link>http://nattster.siamdev.net/2008/11/c-man-function-reference/</link>
		<comments>http://nattster.siamdev.net/2008/11/c-man-function-reference/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 07:08:54 +0000</pubDate>
		<dc:creator>nattster</dc:creator>
				<category><![CDATA[คอมพิวเตอร์จ๋า]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://nattster.siamdev.net/?p=119</guid>
		<description><![CDATA[คนใช้ linux (หรือ cygwin ก็ด่ะ) น่าจะรู้จักคำสั่ง man ที่เอาไว้ใช้ดู manual ของคำสั่งต่างๆ ใน linux ท่านผู้อ่าน รู้หรือไม่ว่า? เราสามารถใช้คำสั่ง $ man qsort เพื่อดูรายละเอียดของฟังก์ชัน qsort ได้ผลลัพธ์ตามนี้ (ทีนี้จะได้รู้และว่าต้อง include file ไหนและฟังก์ชันรับอาร์กิวเมนท์อะไรบ้าง) QSORT&#40;3&#41; Linux Programmer`s Manual QSORT&#40;3&#41; &#160; NAME qsort - sorts an array &#160; SYNOPSIS #include &#60;stdlib.h&#62; &#160; void qsort&#40;void *base, size_t nmemb, size_t size, int&#40;*compar&#41;&#40;const void *, const void *&#41;&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>คนใช้ linux (หรือ cygwin ก็ด่ะ) น่าจะรู้จักคำสั่ง man ที่เอาไว้ใช้ดู manual ของคำสั่งต่างๆ ใน linux<br />
ท่านผู้อ่าน รู้หรือไม่ว่า? เราสามารถใช้คำสั่ง</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">$ man qsort</pre></div></div>

<p>เพื่อดูรายละเอียดของฟังก์ชัน qsort ได้ผลลัพธ์ตามนี้ (ทีนี้จะได้รู้และว่าต้อง include file ไหนและฟังก์ชันรับอาร์กิวเมนท์อะไรบ้าง)</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">QSORT<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#41;</span>                   Linux Programmer`s Manual                  QSORT<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#41;</span>
&nbsp;
NAME
       qsort <span style="color: #339933;">-</span> sorts an array
&nbsp;
SYNOPSIS
       <span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
&nbsp;
       <span style="color: #993333;">void</span> qsort<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span> <span style="color: #339933;">*</span>base<span style="color: #339933;">,</span> size_t nmemb<span style="color: #339933;">,</span> size_t size<span style="color: #339933;">,</span>
                  <span style="color: #993333;">int</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>compar<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">const</span> <span style="color: #993333;">void</span> <span style="color: #339933;">*,</span> <span style="color: #993333;">const</span> <span style="color: #993333;">void</span> <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
DESCRIPTION
       The  qsort<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>  <span style="color: #000000; font-weight: bold;">function</span> sorts an array with nmemb elements of size size.
       <span style="color: #202020;">The</span> base argument points to the start of the array.</pre></div></div>

<p><strong>แต่!</strong> ก่อนที่จะทำแบบนี้ได้ต้องติดตั้งแพคเกจ <strong>manpages-dev</strong> ก่อนครับ สำหรับผู้ใช้ ubuntu/debian (ใช้ Synaptic ติดตั้ง หรือ sudo apt-get install manpages-dev ก็ได้ครับ) สำหรับคนใช้ดิสโทรอื่นต้องลองค้น google ดูครับ</p>
<p>ถ้าลอง man printf ดูจะเจอ manual ของคำสั่ง printf ของ linux แทนที่จะเป็น reference ของฟังก์ชัน printf ของภาษา C แทน</p>
<p>วิธีเปิด manual ของ printf (ฟังก์ชันภาษา C) ให้เรียกคำสั่ง</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">$ man <span style="color: #0000dd;">3</span> <span style="color: #000066;">printf</span></pre></div></div>

<p> แทน ซึ่งหมายความว่า เปิดดูคำสั่ง printf ใน section ที่ 3 ของ manual ครับ (manual มีทั้งหมด 7-8 section&#8230; เขาแบ่ง section ตามหัวข้อครับ <a href="http://en.wikipedia.org/wiki/Man_page">ดูรายละเอียดเพิ่มเติมที่นี่</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://nattster.siamdev.net/2008/11/c-man-function-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
