<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>My.diary.in.th</title>
	
	<link>http://www.diary.in.th/my</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 07 Jul 2010 16:23:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.4" -->
		<copyright>2006-2007 </copyright>
		<managingEditor>wachira@gmail.com (My.diary.in.th)</managingEditor>
		<webMaster>wachira@gmail.com (My.diary.in.th)</webMaster>
		<category>posts</category>
		<ttl>1440</ttl>
		<itunes:keywords />
		<itunes:subtitle />
		<itunes:summary>Just another WordPress weblog</itunes:summary>
		<itunes:author>My.diary.in.th</itunes:author>
		<itunes:category text="Society &amp; Culture" />
		<itunes:owner>
			<itunes:name>My.diary.in.th</itunes:name>
			<itunes:email>wachira@gmail.com</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://www.diary.in.th/my/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<image>
			<url>http://www.diary.in.th/my/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
			<title>My.diary.in.th</title>
			<link>http://www.diary.in.th/my</link>
			<width>144</width>
			<height>144</height>
		</image>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Mydiaryinth" /><feedburner:info uri="mydiaryinth" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>Mydiaryinth</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>[Varnish] วิธีบันทึก Client IP บนเครื่อง backend</title>
		<link>http://feedproxy.google.com/~r/Mydiaryinth/~3/hZ_jo5nLeDA/527</link>
		<comments>http://www.diary.in.th/my/archives/527#comments</comments>
		<pubDate>Wed, 07 Jul 2010 16:22:56 +0000</pubDate>
		<dc:creator>W.p.</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[เรื่องน่าสนใจ]]></category>

		<guid isPermaLink="false">http://www.diary.in.th/my/?p=527</guid>
		<description><![CDATA[เราสามารถทำการบันทึก Client IP ทีเครื่อง backend  แทนที่จะให้ปรากฎเป็น IP ของ varnish เช่น 127.0.0.1  สามารถทำได้โดยการ แก้ไขไฟล์ /etc/varnish/default.vcl sub vcl_recv { # Add a unique header containing the client address remove req.http.X-Forwarded-For; set req.http.X-Forwarded-For = client.ip; # [...] } และเพิ่มบรรทัดต่อไปนี้ในไฟล์ /etc/httpd/conf/httpd.conf LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %&#62;s %b \"%{Referer}i\" \"%{User-Agent}i\"" varnishcombined และใน VirtualHost directive ให้ใช้ CustomLog ดังตัวอย่างต่อไปนี้ &#60;VirtualHost [...]]]></description>
			<content:encoded><![CDATA[<p>เราสามารถทำการบันทึก Client IP ทีเครื่อง backend  แทนที่จะให้ปรากฎเป็น IP ของ varnish เช่น 127.0.0.1  สามารถทำได้โดยการ แก้ไขไฟล์ /etc/varnish/default.vcl</p>
<pre>sub vcl_recv {
  # Add a unique header containing the client address
  remove req.http.X-Forwarded-For;
  set    req.http.X-Forwarded-For = client.ip;
  # [...]
}</pre>
<p>และเพิ่มบรรทัดต่อไปนี้ในไฟล์  /etc/httpd/conf/httpd.conf</p>
<pre>LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" varnishcombined</pre>
<p>และใน VirtualHost directive ให้ใช้ CustomLog ดังตัวอย่างต่อไปนี้</p>
<pre>&lt;VirtualHost *:80&gt;
  ServerName www.example.com
  # [...]
  CustomLog /var/log/apache2/www.example.com/access.log varnishcombined
  # [...]
&lt;/VirtualHost&gt;</pre>
<p>ที่มา: http://varnish-cache.org/wiki/FAQ#HowcanIlogtheclientIPaddressonthebackend</p>
<img src="http://www.diary.in.th/my/6afd0619/4a7d5e56/FeedBurner/1.0 (http://www.FeedBurner.com).gif" /><img src="http://www.diary.in.th/my/?ak_action=api_record_view&id=527&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mydiaryinth?a=hZ_jo5nLeDA:Tg8EtByHhfY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mydiaryinth?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Mydiaryinth/~4/hZ_jo5nLeDA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.diary.in.th/my/archives/527/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.diary.in.th/my/archives/527</feedburner:origLink></item>
		<item>
		<title>แชร์ไดเรกทอรีระหว่าง Linux กับ Mac OS X</title>
		<link>http://feedproxy.google.com/~r/Mydiaryinth/~3/wY-85H7Mj48/515</link>
		<comments>http://www.diary.in.th/my/archives/515#comments</comments>
		<pubDate>Tue, 06 Jul 2010 13:22:52 +0000</pubDate>
		<dc:creator>W.p.</dc:creator>
				<category><![CDATA[เรื่องน่าสนใจ]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[samba]]></category>

		<guid isPermaLink="false">http://www.diary.in.th/my/?p=515</guid>
		<description><![CDATA[ผมติดตั้ง CentOS linux 5.5 ใน parallels virtual machine แล้วหาทางส่งไฟล์ระหว่างกัน วิธีการหนึ่งที่สามารถทำได้คือผ่าน samba ซึ่งมีขั้นตอนดังนี้ครับ ติดตั้ง samba ใน linux ด้วยคำสั่ง #yum install samba แก้ไขไฟล์ /etc/samba/smb.conf ให้มีเนื้อหาในส่วนของ [homes] เป็น [homes] comment = Home Directories browseable = yes writeable = yes read only = yes สั่งให้ samba ทำงานด้วยคำสั่ง #/etc/init.d/smb start กำหนด password ให้ user  โดย user นั้นจะต้องมีจริงในระบบ (local user) # [...]]]></description>
			<content:encoded><![CDATA[<p>ผมติดตั้ง CentOS linux 5.5 ใน parallels virtual machine  แล้วหาทางส่งไฟล์ระหว่างกัน  วิธีการหนึ่งที่สามารถทำได้คือผ่าน samba ซึ่งมีขั้นตอนดังนี้ครับ</p>
<ol>
<li>ติดตั้ง samba ใน linux ด้วยคำสั่ง<br />
#yum install samba</li>
<li>แก้ไขไฟล์ /etc/samba/smb.conf ให้มีเนื้อหาในส่วนของ [homes] เป็น
<pre>[homes]
comment = Home Directories
browseable = yes
writeable = yes
read only = yes</pre>
</li>
<li>สั่งให้ samba ทำงานด้วยคำสั่ง<br />
#/etc/init.d/smb start</li>
<li>กำหนด password ให้ user  โดย user นั้นจะต้องมีจริงในระบบ (local user)<br />
# smbpasswd -a username</li>
<li>ที่เครื่อง mac เปิด Finder เลือก Go และ Connect to Server</li>
<li>ป้อน smb://หมายเลข ip ของ linux เช่น<br />
smb://192.168.1.11</li>
</ol>
<p><a href="http://www.diary.in.th/my/wp-content/uploads/2010/07/finder-smb.png"><img class="size-full wp-image-517 alignleft" title="finder-smb" src="http://www.diary.in.th/my/wp-content/uploads/2010/07/finder-smb.png" alt="" width="454" height="246" /></a></p>
<img src="http://www.diary.in.th/my/6afd0619/4a7d5e56/FeedBurner/1.0 (http://www.FeedBurner.com).gif" /><img src="http://www.diary.in.th/my/?ak_action=api_record_view&id=515&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mydiaryinth?a=wY-85H7Mj48:hzP2IQ8jASU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mydiaryinth?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Mydiaryinth/~4/wY-85H7Mj48" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.diary.in.th/my/archives/515/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.diary.in.th/my/archives/515</feedburner:origLink></item>
		<item>
		<title>@font-face</title>
		<link>http://feedproxy.google.com/~r/Mydiaryinth/~3/3fLTclVC8qE/457</link>
		<comments>http://www.diary.in.th/my/archives/457#comments</comments>
		<pubDate>Sat, 19 Jun 2010 17:53:01 +0000</pubDate>
		<dc:creator>W.p.</dc:creator>
				<category><![CDATA[เรื่องน่าสนใจ]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[font]]></category>

		<guid isPermaLink="false">http://www.diary.in.th/my/?p=457</guid>
		<description><![CDATA[@font-face ใน CSS3 จะช่วยให้เราสามารถนำฟ้อนต์ที่เราต้องการไปใช้ในเว็บได้ อย่างไรก็ตามปัจจุบันบราวเซอร์แต่ละชนิดก็รองรับชนิดของฟ้อนต์แตกต่างกัน เช่น IE ต้องการเฉพาะ .eot (Embedded OpenType)  ในขณะที่ Safari, Firefox, Chrome และ Opera รองรับทั้ง .ttf  (TrueType Font ) และ .otf  (OpenType PS) โดยสามารถดูตาราง Browser Supprot for @font-face ได้ที่นี่ อย่างไรก็ตามวันที่ 8 เม.ย. 53 ที่ผ่านมา Microsoft, Mozilla และ Opera ได้ยื่นข้อเสนอมาตรฐานรูปแบบฟ้อนต์ที่ใช้บนเว็บ WOFF (Web Open Font Format) กับ  W3C    ซึ่งคงต้องรออีกพักหนึ่งกว่าที่จะกลายมาเป็นมาตรฐานที่ใช้กันได้ทั่วไป   ดังนั้นในเวลานี้เราก็คงต้องใช้รูปแบบฟ้อนต์ที่บราวเซอร์ในปัจจุบันใช้งานได้ไปก่อน รูปแบบของการเขียน @font-face [...]]]></description>
			<content:encoded><![CDATA[<p>@font-face ใน CSS3 จะช่วยให้เราสามารถนำฟ้อนต์ที่เราต้องการไปใช้ในเว็บได้  อย่างไรก็ตามปัจจุบันบราวเซอร์แต่ละชนิดก็รองรับชนิดของฟ้อนต์แตกต่างกัน เช่น IE ต้องการเฉพาะ .eot (Embedded OpenType)  ในขณะที่ Safari, Firefox, Chrome และ Opera รองรับทั้ง .ttf  (TrueType Font ) และ .otf  (OpenType PS) โดยสามารถดูตาราง Browser Supprot for @font-face ได้<a title="Browser Support for @font-face" href="http://www.evotech.net/blog/2010/01/font-face-browser-support-tutorial/" target="_blank">ที่นี่</a></p>
<p>อย่างไรก็ตามวันที่ 8 เม.ย. 53 ที่ผ่านมา Microsoft, Mozilla และ Opera ได้ยื่นข้อเสนอมาตรฐานรูปแบบฟ้อนต์ที่ใช้บนเว็บ WOFF (<a href="http://www.w3.org/Submission/2010/03/" target="_blank">Web Open Font Format</a>) กับ  W3C    ซึ่งคงต้องรออีกพักหนึ่งกว่าที่จะกลายมาเป็นมาตรฐานที่ใช้กันได้ทั่วไป   ดังนั้นในเวลานี้เราก็คงต้องใช้รูปแบบฟ้อนต์ที่บราวเซอร์ในปัจจุบันใช้งานได้ไปก่อน</p>
<p>รูปแบบของการเขียน @font-face มีดังนี้</p>
<pre class="brush: css; ">

@font-face {
  font-family: AnyFontName;   /* required */
  src: source;	              /* required */
  font-weight: weight;        /* optional */
  font-style: style;          /* optional */
}
</pre>
<p>ตัวอย่างรูปแบบการกำหนด source ของ font</p>
<pre class="brush: css; ">

@font-face {
     font-family: AnyFontName;
     src: url(&#039;../fonts/fontname1.eot&#039;);
     src: local(&#039;fontname2&#039;),
          url(&#039;../fonts/fontname3&#039;) format(&#039;opentype&#039;),
          url(&#039;../fonts/fontname4&#039;) format(&#039;svg&#039;);
}
</pre>
<p>จากตัวอย่างข้างต้น  เราสามารถตั้งชื่อ  font-family ได้ตามต้องการ  ซึ่งจะมีการเรียกใช้ชื่อฟ้อนต์ที่ตั้งไว้ดังนี้</p>
<pre class="brush: css; ">

h3 {
    font-family: AnyFontName, arial, helvetica, sans-serif;
}
</pre>
<p>ข้อความที่อยู่ระหว่าง &lt;h3&gt; และ &lt;/h3&gt; ก็จะถูกแสดงด้วยฟ้อนที่ชื่อ AnyFontName    แต่เนื่องจาก browser รองรับฟอนต์ได้ไม่เหมือนกัน โดยเฉพาะ IE จึงมีผู้ทำการทำสอบว่าจะเขียน @font-face ในรูปแบบใดจึงจะเหมาะสมที่สุด</p>
<p>Useful links:</p>
<p>http://snook.ca/archives/html_and_css/becoming-a-font-embedding-master</p>
<p>http://xmlgraphics.apache.org/batik/tools/font-converter.html</p>
<p>http://www.fontsquirrel.com/fontface/generator</p>
<p>http://code.google.com/p/ttf2eot/</p>
<p>http://webfonts.info/wiki/index.php?title=@font-face_browser_support</p>
<img src="http://www.diary.in.th/my/6afd0619/4a7d5e56/FeedBurner/1.0 (http://www.FeedBurner.com).gif" /><img src="http://www.diary.in.th/my/?ak_action=api_record_view&id=457&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mydiaryinth?a=3fLTclVC8qE:aU-_07CCPwU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mydiaryinth?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Mydiaryinth/~4/3fLTclVC8qE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.diary.in.th/my/archives/457/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.diary.in.th/my/archives/457</feedburner:origLink></item>
		<item>
		<title>MySQL: ย้ายข้อมูลระหว่างฐานข้อมูล</title>
		<link>http://feedproxy.google.com/~r/Mydiaryinth/~3/ECxyES-8HIY/508</link>
		<comments>http://www.diary.in.th/my/archives/508#comments</comments>
		<pubDate>Fri, 18 Jun 2010 08:56:03 +0000</pubDate>
		<dc:creator>W.p.</dc:creator>
				<category><![CDATA[เรื่องน่าสนใจ]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.diary.in.th/my/?p=508</guid>
		<description><![CDATA[วิธีการง่ายๆ ในการย้ายข้อมูลระหว่าง  database สามารถทำได้ดังนี้ สร้างฐานข้อมูลใหม่ เช่น  new_database ใช้คำสั่ง mysqldump ดังนี้ #mysqldump -uroot -p old_database &#124; mysql -uroot -p -D new_database]]></description>
			<content:encoded><![CDATA[<p>วิธีการง่ายๆ ในการย้ายข้อมูลระหว่าง  database สามารถทำได้ดังนี้</p>
<ol>
<li>สร้างฐานข้อมูลใหม่ เช่น  new_database</li>
<li>ใช้คำสั่ง mysqldump ดังนี้<br />
#mysqldump -uroot -p old_database | mysql -uroot -p -D new_database</li>
</ol>
<img src="http://www.diary.in.th/my/6afd0619/4a7d5e56/FeedBurner/1.0 (http://www.FeedBurner.com).gif" /><img src="http://www.diary.in.th/my/?ak_action=api_record_view&id=508&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mydiaryinth?a=ECxyES-8HIY:HwoL-FLijGQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mydiaryinth?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Mydiaryinth/~4/ECxyES-8HIY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.diary.in.th/my/archives/508/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.diary.in.th/my/archives/508</feedburner:origLink></item>
		<item>
		<title>สิ่งที่ควรทำหลังจาก upgrade MySQL server</title>
		<link>http://feedproxy.google.com/~r/Mydiaryinth/~3/VhjRGTXCzUs/505</link>
		<comments>http://www.diary.in.th/my/archives/505#comments</comments>
		<pubDate>Fri, 18 Jun 2010 08:46:41 +0000</pubDate>
		<dc:creator>W.p.</dc:creator>
				<category><![CDATA[เรื่องน่าสนใจ]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.diary.in.th/my/?p=505</guid>
		<description><![CDATA[หลังจากทำการ upgrade MySQL server ควรจะใช้คำสั่งต่อไปนี้ #mysql_upgrade -uroot -p และ #mysqlcheck -uadmin -p --auto-repair --check --optimize --all-databases เพื่อตรวจสอบว่ามีปัญหาระหว่างการ upgrade หรือไม่ เนื่องจากผมเจอปัญหาที่ดูเหมือนว่าฐานข้อมูลหายไป เมื่อตรวจสอบแล้วก็พบว่าฐานข้อมูลยังอยู่ แต่ถูกเติมข้างหน้าด้วย #mysql50# If you have databases or tables from a version of MySQL older than 5.1.6 that contain special characters and for which the underlying directory names or file names have not been updated [...]]]></description>
			<content:encoded><![CDATA[<p>หลังจากทำการ upgrade MySQL server ควรจะใช้คำสั่งต่อไปนี้<br />
#mysql_upgrade -uroot -p<br />
และ</p>
<pre>
#mysqlcheck -uadmin -p --auto-repair --check --optimize --all-databases
</pre>
<p>เพื่อตรวจสอบว่ามีปัญหาระหว่างการ upgrade หรือไม่  เนื่องจากผมเจอปัญหาที่ดูเหมือนว่าฐานข้อมูลหายไป  เมื่อตรวจสอบแล้วก็พบว่าฐานข้อมูลยังอยู่  แต่ถูกเติมข้างหน้าด้วย #mysql50#</p>
<blockquote><p>If you have databases or tables from a version of MySQL older than 5.1.6 that contain special characters and for which the underlying directory names or file names have not been updated to use the new encoding, the server displays their names with a prefix of #mysql50# in the output from INFORMATION_SCHEMA tables or SHOW statements.</p>
<p>ที่มา http://dev.mysql.com/doc/refman/5.1/en/identifier-mapping.html</p></blockquote>
<img src="http://www.diary.in.th/my/6afd0619/4a7d5e56/FeedBurner/1.0 (http://www.FeedBurner.com).gif" /><img src="http://www.diary.in.th/my/?ak_action=api_record_view&id=505&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mydiaryinth?a=VhjRGTXCzUs:SuPtfXHuX5Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mydiaryinth?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Mydiaryinth/~4/VhjRGTXCzUs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.diary.in.th/my/archives/505/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.diary.in.th/my/archives/505</feedburner:origLink></item>
	</channel>
</rss>
