<?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>Just My Life &#187; Programming</title>
	<atom:link href="http://imrgill.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://imrgill.com</link>
	<description>I&#039;m mrGilL, I&#039;m Newbie Admin</description>
	<lastBuildDate>Fri, 18 May 2012 06:47:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>คลอดละครับ script auto login truewifi 3.0 หมดปัญหา pc/7eleven</title>
		<link>http://imrgill.com/2011/11/27/script-truewifi-auto-login-v3-0.html</link>
		<comments>http://imrgill.com/2011/11/27/script-truewifi-auto-login-v3-0.html#comments</comments>
		<pubDate>Sun, 27 Nov 2011 02:36:23 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[auto]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[google chrome]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[truewifi]]></category>
		<category><![CDATA[user script]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=676</guid>
		<description><![CDATA[การติดตั้งเหมือนเดิมครับ อ่านได้ที่ Script ต่อ True Wi-Fi อัตโนมัติ(Truewifi Auto Login V2.04) เวอร์ชันนี้ออกมาเพื่อแก้ปัญหา URL สำหรับบางพื้นที่ที่เปลี่ยนหน้า Login เป็น pc/7eleven โดยเฉพาะ change log : 1. ตัวแปร username ที่สามารถใส่ username@domain ได้โดยเลยที่ไม่ต้องระบุเป็นตัวเลข (ขอบคุณท่าน Warun Kietduriyakul แห่ง jomyut.net สำหรับ script ตรงส่วนนี้) 2. ผู้ใช้ต้องกำหนดค่า VLAN และ MAC เอง วิธีง่ายๆ ก็เอาค่านี้มาจาก URL Redirect นั้นแหละครับตรง "VLAN=851&#038;MAC=00:21:65:aa:f0:aa" มาใส่เป็นตัวแปร จากตัวอย่าง ให้ใส่เป็น var vlan = "851"; และ var [...]]]></description>
			<content:encoded><![CDATA[<p>การติดตั้งเหมือนเดิมครับ อ่านได้ที่ <a href="http://imrgill.com/2009/12/18/script-truewifi-auto-login-v2-04.html" target="_blank">Script ต่อ True Wi-Fi อัตโนมัติ(Truewifi Auto Login V2.04)</a></p>
<p>เวอร์ชันนี้ออกมาเพื่อแก้ปัญหา URL สำหรับบางพื้นที่ที่เปลี่ยนหน้า Login เป็น pc/7eleven โดยเฉพาะ</p>
<p>change log :</p>
<pre>
<div class="codesnip-container" >1. ตัวแปร username ที่สามารถใส่ username@domain ได้โดยเลยที่ไม่ต้องระบุเป็นตัวเลข (ขอบคุณท่าน Warun Kietduriyakul แห่ง jomyut.net สำหรับ script ตรงส่วนนี้)
2. ผู้ใช้ต้องกำหนดค่า VLAN และ MAC เอง วิธีง่ายๆ ก็เอาค่านี้มาจาก URL Redirect นั้นแหละครับตรง "VLAN=851&#038;MAC=00:21:65:aa:f0:aa" มาใส่เป็นตัวแปร จากตัวอย่าง ให้ใส่เป็น
   var vlan = "851"; และ
   var mac = "00:21:65:aa:f0:aa";
3. เนื่องด้วยมีผู้ใช้ script นี้รายงานมาว่า Truewifi ได้มีการเปลี่ยน URL สำหรับ Login ในบางพื้นที่เป็น "portal.trueinternet.co.th/wifiauthen/pc/7eleven/wi-fi_login.php" ผมจึงแก้ script ตรงส่วนนี้ให้แล้วโดยเพิ่ม if ให้ตรวจสอบ URL ว่าเป็นแบบเก่าหรือแบบใหม่นี้</div>
</pre>
<p>เอาไปลองใช้กันดูครับ</p>
<p><strong>ดาวน์โหลด : <a href="http://www.ziddu.com/download/17765869/auto_truewifi_3.1.user.zip.html" rel="nofollow"  target="_blank">auto_truewifi_3.1.user.js.zip</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/11/27/script-truewifi-auto-login-v3-0.html/feed/</wfw:commentRss>
		<slash:comments>54</slash:comments>
		</item>
		<item>
		<title>WP Warning หลัง Upgrade เป็นเวอร์ชัน 3.0</title>
		<link>http://imrgill.com/2010/06/22/wp-warning-in-function-php.html</link>
		<comments>http://imrgill.com/2010/06/22/wp-warning-in-function-php.html#comments</comments>
		<pubDate>Tue, 22 Jun 2010 02:08:51 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=577</guid>
		<description><![CDATA[เมื่อวานผม upgrade version ของ wordpress ครับหลังลงก็ไม่ได้เช็คอะไรมากมาย upgrade เสร็จเข้าเว็บได้ก็ไม่สนใจละ จนมาถึงวันนี้เพิ่งสังเกตเห็นว่ามี warning เหมือนข้างล่างเลยมานั่งแก้ bug เล่น Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/imrgill/:/tmp:/usr/local/lib/php/) in /home/imrgill/domains/imrgill.com/public_html/wp-includes/functions.php on line 2037 Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/imrgill/:/tmp:/usr/local/lib/php/) in /home/imrgill/domains/imrgill.com/public_html/wp-includes/functions.php on line 2028 Warning: is_dir() [...]]]></description>
			<content:encoded><![CDATA[<p>เมื่อวานผม upgrade version ของ wordpress ครับหลังลงก็ไม่ได้เช็คอะไรมากมาย upgrade เสร็จเข้าเว็บได้ก็ไม่สนใจละ จนมาถึงวันนี้เพิ่งสังเกตเห็นว่ามี warning เหมือนข้างล่างเลยมานั่งแก้ bug เล่น</p>
<pre>
<div class="codesnip-container" >Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/imrgill/:/tmp:/usr/local/lib/php/) in /home/imrgill/domains/imrgill.com/public_html/wp-includes/functions.php  on line 2037

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/imrgill/:/tmp:/usr/local/lib/php/) in /home/imrgill/domains/imrgill.com/public_html/wp-includes/functions.php on line 2028

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/imrgill/:/tmp:/usr/local/lib/php/) in /home/imrgill/domains/imrgill.com/public_html/wp-includes/functions.php on line 2037</div>
</pre>
<p>ิวิธีแก้ก็ไม่ยากครับไปแก้ไขไฟล์ /wp-includes/functions.php แล้วไปที่บรรทัด 2028 และ 2037 อย่างที่มันบอกแล้วก็ไปใส่เครื่องหมาย &#8220;@&#8221; ไว้หน้า function file_exist แล้วก็ is_dir ที่อยู่ในวงเล็บ if ก็เป็นอันหายจากอาการ warning ครับ</p>
<pre>
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw1">if</span> <span class="br0">&#40;</span> <span class="sy0">@</span><a href="http://www.php.net/file_exists" rel="nofollow" ><span class="kw3">file_exists</span></a><span class="br0">&#40;</span> <span class="re0">$target</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="sy0">@</span><a href="http://www.php.net/is_dir" rel="nofollow" ><span class="kw3">is_dir</span></a><span class="br0">&#40;</span> <span class="re0">$target</span> <span class="br0">&#41;</span><span class="sy0">;</span>

&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Attempting to create the directory may clutter up our display.</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span> <span class="sy0">@</span><a href="http://www.php.net/mkdir" rel="nofollow" ><span class="kw3">mkdir</span></a><span class="br0">&#40;</span> <span class="re0">$target</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$stat</span> <span class="sy0">=</span> <span class="sy0">@</span><a href="http://www.php.net/stat" rel="nofollow" ><span class="kw3">stat</span></a><span class="br0">&#40;</span> <a href="http://www.php.net/dirname" rel="nofollow" ><span class="kw3">dirname</span></a><span class="br0">&#40;</span> <span class="re0">$target</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$dir_perms</span> <span class="sy0">=</span> <span class="re0">$stat</span><span class="br0">&#91;</span><span class="st_h">'mode'</span><span class="br0">&#93;</span> <span class="sy0">&amp;</span> <span class="nu8">0007777</span><span class="sy0">;</span> &nbsp;<span class="co1">// Get the permission bits.</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">@</span><a href="http://www.php.net/chmod" rel="nofollow" ><span class="kw3">chmod</span></a><span class="br0">&#40;</span> <span class="re0">$target</span><span class="sy0">,</span> <span class="re0">$dir_perms</span> <span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw4">true</span><span class="sy0">;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">elseif</span> <span class="br0">&#40;</span> <span class="sy0">@</span><a href="http://www.php.net/is_dir" rel="nofollow" ><span class="kw3">is_dir</span></a><span class="br0">&#40;</span> <a href="http://www.php.net/dirname" rel="nofollow" ><span class="kw3">dirname</span></a><span class="br0">&#40;</span> <span class="re0">$target</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw4">false</span><span class="sy0">;</span> 

&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</div>
</pre>
<p>สำหรับใครที่ใช้ plugin WP Super Cache หลังจากแก้ไขไฟล์ function.php แล้วก็อย่าลืมไปเคลียร์ cache ด้วยนะครับ</p>
<p>หวังว่าคงเป็นประโยชน์กับเพื่อนร่วมโลก WP</p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2010/06/22/wp-warning-in-function-php.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>เอาใจเด็กรามฯ ด้วย RU WiFi Auto Login Script</title>
		<link>http://imrgill.com/2010/02/28/ru-wifi-auto-login-script.html</link>
		<comments>http://imrgill.com/2010/02/28/ru-wifi-auto-login-script.html#comments</comments>
		<pubDate>Sat, 27 Feb 2010 17:31:06 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[ru]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[รามฯ]]></category>
		<category><![CDATA[สคริป]]></category>
		<category><![CDATA[เน็ต]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=558</guid>
		<description><![CDATA[เมื่อวานเข้าไปที่คณะในรามฯ ครับ ไปกินข้าวกับพวกพี่ๆ เจ้าหน้าที่ที่ซี้ๆ กัน กลับมาจากกินข้าวก็มานั่งเล่นที่ห้องเจ้าหน้าที่ ก็นั่งเล่นไปคุยกันไปเรื่อย จนมาคุยกันถึงเรื่องการ login เน็ตของที่รามฯ ก่อนที่จะเข้าอินเตอร์เน็ต ซึ่งผมมีไอเดียจะเขียนสคริปสำหรับล็อกอินเน็ตรามฯ ไว้นานแล้ว เพราะขี้เกียจมานั่งกรอกเลขรหัสบัตรประชาชน 13 หลักทุกครั้งที่จะใช้เน็ต ก็เลยนั่งเขียน script ตั้งแต่เที่ยง จนถึงเย็น ก็เอาตัว Script ต่อ True Wi-Fi อัตโนมัติ(Truewifi Auto Login V2.04) มาแก้ไขนิดหน่อย จนสุดท้ายมันก็ใช้งานได้ ก็เลยเอามาแจกจ่ายเด็กรามฯ ด้วยกันครับ ขั้นตอนการติดตั้งเหมือนกับ Script ต่อ True Wi-Fi อัตโนมัติ(Truewifi Auto Login V2.04) ทุกอย่างเลยครับคือ 1. เครื่องคุณต้องมี Mozilla Firefox ก่อนครับ โดยสามารถดาวน์โหลดได้ที่ http://www.mozilla.com/en-US/firefox/ เมื่อดาวน์โหลดมาแล้วก็ติดตั้งเลยครับใช้ Step Next and Next [...]]]></description>
			<content:encoded><![CDATA[<p>เมื่อวานเข้าไปที่คณะในรามฯ ครับ ไปกินข้าวกับพวกพี่ๆ เจ้าหน้าที่ที่ซี้ๆ กัน กลับมาจากกินข้าวก็มานั่งเล่นที่ห้องเจ้าหน้าที่ ก็นั่งเล่นไปคุยกันไปเรื่อย จนมาคุยกันถึงเรื่องการ login เน็ตของที่รามฯ ก่อนที่จะเข้าอินเตอร์เน็ต ซึ่งผมมีไอเดียจะเขียนสคริปสำหรับล็อกอินเน็ตรามฯ ไว้นานแล้ว เพราะขี้เกียจมานั่งกรอกเลขรหัสบัตรประชาชน 13 หลักทุกครั้งที่จะใช้เน็ต ก็เลยนั่งเขียน script ตั้งแต่เที่ยง จนถึงเย็น ก็เอาตัว <a href="../2009/12/18/script-truewifi-auto-login-v2-04.html" rel="nofollow"  target="_blank">Script ต่อ True Wi-Fi อัตโนมัติ(Truewifi Auto Login  V2.04)</a> มาแก้ไขนิดหน่อย จนสุดท้ายมันก็ใช้งานได้ ก็เลยเอามาแจกจ่ายเด็กรามฯ ด้วยกันครับ</p>
<p>ขั้นตอนการติดตั้งเหมือนกับ <a href="../2009/12/18/script-truewifi-auto-login-v2-04.html" rel="nofollow"  target="_blank">Script ต่อ True Wi-Fi อัตโนมัติ(Truewifi Auto Login  V2.04)</a> ทุกอย่างเลยครับคือ</p>
<p>1. เครื่องคุณต้องมี Mozilla Firefox ก่อนครับ โดยสามารถดาวน์โหลดได้ที่  <a href="http://www.mozilla.com/en-US/firefox/" rel="nofollow"  target="_blank">http://www.mozilla.com/en-US/firefox/</a> เมื่อดาวน์โหลดมาแล้วก็ติดตั้งเลยครับใช้ Step Next and Next</p>
<p>2. ติดตั้ง Addon ของ Firefox ที่ชื่อ <a href="https://addons.mozilla.org/en-US/firefox/addon/748" rel="nofollow"  target="_blank">Greasemonkey</a> &lt;&lt; คลิกลิงค์นี้ใน Firefox  เข้าหน้า Greasemonkey แล้วก็คลิกที่ปุ่ม Add to Firefox  เมื่อติดตั้งเสร็จแล้ว Firefox จะให้เรา Restart ตัวมันเองก็กด Restart  Firefox ไปครับ โปรแกรมจะ Restart  ตัวเองจากนั้นเมื่อมันเปิดขึ้นมาอีกครั้งเราจะเป็นรูปลิงน้อยที่มุมขวาล่าง  ของ Status bar ของ Firefox</p>
<p style="text-align: center;"><img class="aligncenter" src="http://learners.in.th/file/gillclub/greasemonkey.jpg" border="0" alt="" /></p>
<p style="text-align: center;">รูปไอคอนของ Greasemonkey ที่ Status bar  ของ Firefox</p>
<p><span id="more-558"></span>3. ดาวน์โหลดไฟล์ <a href="http://www.ziddu.com/download/8762482/ru_wifi_auto_login.zip.html" rel="nofollow"  target="_blank">ru_wifi_auto_login.zip</a> โหลดเสร็จแล้วแตกไฟล์ออกมา จะได้ไฟล์ ru_wifi_auto_login.user.js ให้ไปแก้ไข username กับ password</p>
<pre>
<div class="codesnip-container" >// username and password
var username="changeme"; // ใส่ username ของท่าน ลงไปแทน changeme
var password="changeme"; // ใส่ password ของท่าน ลงไปแทน changeme</div>
</pre>
<p>**แนะนำให้ใช้โปรแกรม wordpad, editplus, notepad++ ในการแก้ไขไฟล์นะครับ เพราะโปรแกรม notepad อาจมีปัญหากับการติดคำในไฟล์ script</p>
<p>4. แก้ไขเสร็จแล้วก็จับไฟล์สคริปลากใส่ใน Firefox เลยครับ หรือใครจับลากใส่ Firefox ไม่เป็นก็สามารถเลือกที่เมนู File &gt;&gt; Open File &gt;&gt; แล้วก็ Browse ไปหาไฟล์ Script ที่แก้ไขเสร็จแล้วก็ได้ครับ แล้วก็กด Open หรือ OK โปรแกรมถามให้เรา Install ก็เลือกกดที่ Install ได้เลยครับ</p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;"><a href="http://farm3.static.flickr.com/2777/4391760065_421432802e_o.png" rel="nofollow"  rel="lightbox[558]"><img class="aligncenter" src="http://farm3.static.flickr.com/2777/4391760065_421432802e_o.png" alt="" width="427" height="452" /></a></p>
<p style="text-align: left;">
<p style="text-align: left;">5. จากนั้นให้ทดลองเข้าเว็บไซต์อะไรก็ได้ (หาก Login อยู่ให้ Logout ออกก่อน โดยเข้าไปที่หน้า <a href="https://10.4.51.1/netaccess/constatus.html" rel="nofollow"  target="_blank">https://10.4.51.1/netaccess/constatus.html</a> แล้วคลิก Logout) โปรแกรมจะทำการ redirect หน้าเว็บของเราเข้าไปที่หน้าล็อกอินของรามฯ</p>
<p style="text-align: center;"><a href="http://farm5.static.flickr.com/4063/4392446678_afc2420dd5_o.png" rel="nofollow"  rel="lightbox[558]"><img class="aligncenter" src="http://farm5.static.flickr.com/4063/4392446678_6de7dce1b2.jpg" alt="" width="500" height="313" /></a>กดปุ่ม Log In Now ได้เลยครับ</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://farm3.static.flickr.com/2752/4392446684_a408885695_o.png" rel="nofollow"  rel="lightbox[558]"><img class="aligncenter" src="http://farm3.static.flickr.com/2752/4392446684_5066cc120d.jpg" alt="" width="500" height="313" /></a>สคริปจะทำการกรอก Username, Password และล็อกอินให้อัตโนมัติ</p>
<p style="text-align: left;"><span style="color: #ff0000;"><strong>คำเตือน</strong></span> : <span style="background-color: #ffff00;">ไม่ควรใช้สคริปนี้กับเครื่องคอมพิวเตอร์สาธารณะ   เพราะอาจทำให้ชื่อผู้ใช้งานของคุณรั่วไหลได้</span></p>
<p style="text-align: left;">หมายเหตุ : หากใครใช้ Firefox เป็นครั้งแรกแล้วเจอปัญหาดังรูปข้างล่าง</p>
<p style="text-align: center;"><a href="http://farm3.static.flickr.com/2694/4392683096_96365178cd_o.png" rel="nofollow"  rel="lightbox[558]"><img class="aligncenter" src="http://farm3.static.flickr.com/2694/4392683096_d88024ef0c.jpg" alt="" width="500" height="313" /></a>ให้คลิกเลือกที่ I Understand Risks จากนั้นกด Add Exceptions</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://farm3.static.flickr.com/2758/4392683100_b8c316d590_o.png" rel="nofollow"  rel="lightbox[558]"><img class="aligncenter" src="http://farm3.static.flickr.com/2758/4392683100_71fe89d92e.jpg" alt="" width="500" height="313" /></a>รอสักครู่ แล้วกด Confirm Security Exception ก็จะใช้งาน Firefox ได้ปกติ</p>
<p style="text-align: left;">จบ</p>
  
<div class="wp_license">
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img src="http://i.creativecommons.org/l/by-nc-sa/3.0//88x31.png" alt="Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported" class="alignleft" style="margin-top:4px;" />
</a>This work  is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported</a>.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2010/02/28/ru-wifi-auto-login-script.html/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>รวมเว็บออกแบบ Themes WordPress Online</title>
		<link>http://imrgill.com/2010/01/08/collect-online-wordpress-themes-generator.html</link>
		<comments>http://imrgill.com/2010/01/08/collect-online-wordpress-themes-generator.html#comments</comments>
		<pubDate>Fri, 08 Jan 2010 16:28:44 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=520</guid>
		<description><![CDATA[WordPress เป็นเว็บบล็อกยอดนิยม ซึ่งมี Themes และ Plugins ให้เราโหลดใช้งานได้เพียบ แต่การจะมี Themes เจ๋งๆ แบบไม่ซ้ำใครนั้นแทบจะเป็นไปไม่ได้เลยถ้าหากไม่ออกแบบเอง ซึ่งต้องมีความรู้ในเรื่อง HTML, XHTML, CSS, PHP หรือไม่ก็อาจใช้ Software สำหรับออกแบบงานพวกนี้โดยเฉพาะอย่างเช่นโปรแกรม Artisteer และแน่นอนครับโปรแกรมพวกนี้ก็ไม่ค่อยมีของฟรีให้เราใช้ วันนี้ผมเลยรวมเอาเว็บที่สร้าง Themes แบบออนไลน์(WordPress Themes Generator) มาฝาก http://www.yvoschaap.com/wpthemegen/ http://theme-generator.net/wordpress/ http://pixopoint.com/theme_generator/?generator=on http://templatr.cc/ ใครมีเว็บอื่นๆ แนะนำกันมาได้นะครับ]]></description>
			<content:encoded><![CDATA[<p>WordPress เป็นเว็บบล็อกยอดนิยม ซึ่งมี Themes และ Plugins ให้เราโหลดใช้งานได้เพียบ แต่การจะมี Themes เจ๋งๆ แบบไม่ซ้ำใครนั้นแทบจะเป็นไปไม่ได้เลยถ้าหากไม่ออกแบบเอง ซึ่งต้องมีความรู้ในเรื่อง HTML, XHTML, CSS, PHP หรือไม่ก็อาจใช้ Software สำหรับออกแบบงานพวกนี้โดยเฉพาะอย่างเช่นโปรแกรม <a href="http://www.artisteer.com/" rel="nofollow"  target="_blank">Artisteer</a> และแน่นอนครับโปรแกรมพวกนี้ก็ไม่ค่อยมีของฟรีให้เราใช้ วันนี้ผมเลยรวมเอาเว็บที่สร้าง Themes แบบออนไลน์(WordPress Themes Generator) มาฝาก</p>
<ul>
<li><a href="http://www.yvoschaap.com/wpthemegen/" rel="nofollow"  target="_blank">http://www.yvoschaap.com/wpthemegen/</a></li>
<li><a href="http://theme-generator.net/wordpress/" rel="nofollow" >http://theme-generator.net/wordpress/</a></li>
<li><a href="http://pixopoint.com/theme_generator/?generator=on" rel="nofollow"  target="_blank">http://pixopoint.com/theme_generator/?generator=on</a></li>
<li><a href="http://templatr.cc/" rel="nofollow"  target="_blank">http://templatr.cc/</a></li>
</ul>
<p>ใครมีเว็บอื่นๆ แนะนำกันมาได้นะครับ</p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2010/01/08/collect-online-wordpress-themes-generator.html/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tweeting แบบดิบๆ ผ่าน Linux Command Line</title>
		<link>http://imrgill.com/2009/12/30/tweeting-via-linux-command-line.html</link>
		<comments>http://imrgill.com/2009/12/30/tweeting-via-linux-command-line.html#comments</comments>
		<pubDate>Wed, 30 Dec 2009 14:58:04 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[tweet]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=515</guid>
		<description><![CDATA[เมื่อกี้เข้า linuxtoday.com ไปเจอทิปเด็ดๆ ใน junauza.com เรื่อง Follow Me: Tweeting from the Linux Command Line อ่านแล้วน่าสนใจดี และหลังจากลองแล้วก็ได้ผลครับเลยนำมาบอกต่อ ขั้นตอนเขามีอยู่ว่า 1. ติดตั้ง curl mrgill@mrgill-laptop:~$ sudo apt-get install curl 2. สร้างไฟล์ชื่อ twitter ไว้ใน /usr/bin/ ด้วย text editor ที่ชอบในตัวอย่างเขาใช้ gedit แต่ผมชอบ nano mrgill@mrgill-laptop:~$ sudo nano /usr/bin/twitter จากนั้นนำโค้ดด้านล่างไปวาง curl --basic --user "yourusername:yourpasswd" --data-ascii "status=`echo $@&#124;tr ' ' '+'`" "http://twitter.com/statuses/update.json" -o /dev/null; [...]]]></description>
			<content:encoded><![CDATA[<p>เมื่อกี้เข้า <a href="http://www.linuxtoday.com/" rel="nofollow" >linuxtoday.com</a> ไปเจอทิปเด็ดๆ ใน <a href="http://www.junauza.com/2009/12/most-popular-tips-and-tricks-of-2009.html" rel="nofollow" >junauza.com</a> เรื่อง <a href="http://www.junauza.com/2009/03/follow-me-twitting-from-linux-command.html" rel="nofollow" >Follow Me: Tweeting from the Linux Command Line</a> อ่านแล้วน่าสนใจดี และหลังจากลองแล้วก็ได้ผลครับเลยนำมาบอกต่อ</p>
<p>ขั้นตอนเขามีอยู่ว่า<br />
1. ติดตั้ง curl</p>
<pre>
<div class="codesnip-container" >mrgill@mrgill-laptop:~$ sudo apt-get install curl</div>
</pre>
<p>2. สร้างไฟล์ชื่อ twitter ไว้ใน /usr/bin/ ด้วย text editor ที่ชอบในตัวอย่างเขาใช้ gedit แต่ผมชอบ nano</p>
<pre>
<div class="codesnip-container" >mrgill@mrgill-laptop:~$ sudo nano /usr/bin/twitter</div>
</pre>
<p>จากนั้นนำโค้ดด้านล่างไปวาง</p>
<pre>
<div class="codesnip-container" >curl --basic --user <em>"yourusername:yourpasswd"</em> --data-ascii "status=`echo $@|tr ' ' '+'`" "http://twitter.com/statuses/update.json" -o /dev/null; echo Message Sent!</div>
</pre>
<p>*อย่าลืมเปลี่ยน yourusername กับ yourpasswd เป็นของ twitter ของคุณ (กด Ctrl + O เพื่อบันทึก และกด Ctrl + X เพื่อออก)</p>
<p>3. กำหนดสิทธิ์ให้ /usr/bin/twitter สามารถรันได้<br />
<span id="more-515"></span>
<pre>
<div class="codesnip-container" >mrgill@mrgill-laptop:~$ sudo chmod +x /usr/bin/twitter</div>
</pre>
<p>4. ทดลอง tweeting กันเลย โดยพิมพ์ twitter เว้นวรรค ข้อความของคุณ</p>
<pre>
<div class="codesnip-container" >mrgill@mrgill-laptop:~$ twitter test tweet from command lind</div>
</pre>
<p style="text-align: left;"><a href="http://www.flickr.com/photos/imrgill/4228553402/sizes/o/" rel="nofollow" ><img class="aligncenter" src="http://farm3.static.flickr.com/2491/4228553402_564196e4f9_o.png" alt="" width="595" height="410" /></a></p>
<p style="text-align: center;">ภาพตัวอย่างคำสั่ง twitter</p>
<p style="text-align: left;"><a href="http://www.flickr.com/photos/imrgill/4228553404/sizes/o/" rel="nofollow" ><img class="aligncenter" src="http://farm3.static.flickr.com/2621/4228553404_4715fffda5_o.png" alt="" width="566" height="380" /></a></p>
<p style="text-align: center;">tweet บน twitter.com</p>
<p style="text-align: left;">5. ขอให้สนุกกับการ tweet</p>
<p style="text-align: left;">
<p style="text-align: left;">แหล่งข้อมูล : <a href="http://www.junauza.com/2009/03/follow-me-twitting-from-linux-command.html" rel="nofollow"  target="_blank">http://www.junauza.com/2009/03/follow-me-twitting-from-linux-command.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2009/12/30/tweeting-via-linux-command-line.html/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Script ต่อ True Wi-Fi อัตโนมัติ(Truewifi Auto Login V2.04)</title>
		<link>http://imrgill.com/2009/12/18/script-truewifi-auto-login-v2-04.html</link>
		<comments>http://imrgill.com/2009/12/18/script-truewifi-auto-login-v2-04.html#comments</comments>
		<pubDate>Fri, 18 Dec 2009 04:48:14 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[90 นาที]]></category>
		<category><![CDATA[auto]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[logout]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[true]]></category>
		<category><![CDATA[truewifi]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=500</guid>
		<description><![CDATA[^ ใช้งาน script แล้วถูกใจช่วยกันกด like ให้กำลังใจคนพัฒนานิดนึงนะครับ ### UPDATE 27/Nov/2011 Version 3.0 ออกละครับ http://imrgill.com/2011/11/27/script-truewifi-auto-login-v3-0.html UPDATE 19/Nov/2011 เมื่อวานนี้หลายท่านคงเจอปัญหา Login ไม่ได้กันวิธีแก้เข้าไปแก้ไขตัวแปร var พวกที่เป็น url ให้เป็น http ธรรมดา(เอา s ออก) ก็จะใช้งานได้ตามปกติครับ ### หลายคนคงเคยใช้กันแล้วนะครับ สำหรับ version นี้ความสามารถก็ไม่มีอะไรเพิ่มครับ ผมแค่เปลี่ยน // @include * เป็น // @include http*://portal.trueinternet.co.th/* เพื่อลดภาระของ Firefox ที่จากเมื่อก่อนต้องทำงานบนทุกหน้าแล้วจึงไปเช็ค if ข้างในอีกที แต่ตอนนี้แค่เช็คว่าถ้าไม่ตรงกับ portal.trueinternet.co.th ก็จะไม่ทำงานแล้ว และแก้ไขหน่วยเวลาตรงตัวแปร tosec เป็น minutes โดยตอนนี้สามารถใส่เวลาเป็นหน่วยนาทีไปได้เลยครับ ตัวอย่าง หากต้องการให้สริปทำงานทุก [...]]]></description>
			<content:encoded><![CDATA[<p><strong>^</strong> <strong>ใช้งาน script แล้วถูกใจช่วยกันกด like ให้กำลังใจคนพัฒนานิดนึงนะครับ</strong></p>
<p>###</p>
<p><span style="text-decoration: underline;">UPDATE 27/Nov/2011</span> <strong>Version 3.0 ออกละครับ</strong> <a href="http://imrgill.com/2011/11/27/script-truewifi-auto-login-v3-0.html" target="_blank">http://imrgill.com/2011/11/27/script-truewifi-auto-login-v3-0.html</a><br />
<span style="text-decoration: underline;">UPDATE 19/Nov/2011</span> เมื่อวานนี้หลายท่านคงเจอปัญหา Login ไม่ได้กันวิธีแก้เข้าไปแก้ไขตัวแปร var พวกที่เป็น url ให้เป็น http ธรรมดา(เอา s ออก) ก็จะใช้งานได้ตามปกติครับ</p>
<p>###</p>
<p>หลายคนคงเคยใช้กันแล้วนะครับ สำหรับ version นี้ความสามารถก็ไม่มีอะไรเพิ่มครับ ผมแค่เปลี่ยน</p>
<pre>
<div class="codesnip-container" >// @include * เป็น
// @include http*://portal.trueinternet.co.th/*</div>
</pre>
<p>เพื่อลดภาระของ Firefox ที่จากเมื่อก่อนต้องทำงานบนทุกหน้าแล้วจึงไปเช็ค if ข้างในอีกที แต่ตอนนี้แค่เช็คว่าถ้าไม่ตรงกับ portal.trueinternet.co.th ก็จะไม่ทำงานแล้ว</p>
<p>และแก้ไขหน่วยเวลาตรงตัวแปร tosec เป็น minutes โดยตอนนี้สามารถใส่เวลาเป็นหน่วยนาทีไปได้เลยครับ ตัวอย่าง หากต้องการให้สริปทำงานทุก 85 นาทีก็ใส่เป็น 85 ไปได้เลย หากใครใช้ Green Bangkok ก็เปลี่ยนเป็น 55 ได้เลย</p>
<pre>
<div class="codesnip-container" ><del> // timer
var minutes = 85; //@truehisp ใส่เป็น 85 สำหรับ green bangkok @truewifi ใส่เป็น 55</del>
// timer
var minutes = 175; //@truehisp ใส่เป็น 175 ตอนนี้รู้สึกว่า @truehisp เค้าจะตัดทุก 180 นาที #แก้ไข 20/Nov/2011  </div>
</pre>
<p>แล้วก็ตัดตัวแปร onesec ออกแล้วไปกำหนดค่าใน function ตรงๆ เลย</p>
<p>สำหรับขั้นตอนการติดตั้งก็คล้ายกับตัวเดิมครับ คือ</p>
<p>1. เครื่องคุณต้องมี Mozilla Firefox ก่อนครับ โดยสามารถดาวน์โหลดได้ที่ <a href="http://www.mozilla.com/en-US/firefox/" rel="nofollow"  target="_blank">http://www.mozilla.com/en-US/firefox/</a> เมื่อดาวน์โหลดมาแล้วก็ติดตั้งเลยครับใช้ Step Next and Next</p>
<p>2. ติดตั้ง Addon ของ Firefox ที่ชื่อ <a href="https://addons.mozilla.org/en-US/firefox/addon/748" rel="nofollow"  target="_blank">Greasemonkey</a> &lt;&lt; คลิกลิงค์นี้ใน Firefox เข้าหน้า Greasemonkey แล้วก็คลิกที่ปุ่ม Add to Firefox เมื่อติดตั้งเสร็จแล้ว Firefox จะให้เรา Restart ตัวมันเองก็กด Restart Firefox ไปครับ โปรแกรมจะ Restart ตัวเองจากนั้นเมื่อมันเปิดขึ้นมาอีกครั้งเราจะเป็นรูปลิงน้อยที่มุมขวาล่าง ของ Status bar ของ Firefox</p>
<p style="text-align: center;"><img src="http://farm7.staticflickr.com/6043/6366671467_8ceff480f3_m.jpg" alt="" width="148" height="121" /></p>
<p style="text-align: center;">รูปไอคอนของ Greasemonkey ที่ Navigation toolbar ของ Firefox</p>
<p>3. ดาวน์โหลด <a href="http://www.ziddu.com/download/8656138/truewifi_auto_login_v2.04.zip.html" rel="nofollow"  target="_blank">truewifi_auto_login_v2.04.zip</a></p>
<p style="text-align: left;">แล้วแตกไฟล์ออกจะได้ไฟล์ truewifi_auto_login_v2.04.user.js จากนั้นคลิกขวาที่ไฟล์แล้วเลือก Edit ให้ทำการแก้ค่าต่าง ดังนี้</p>
<pre>
<div class="codesnip-container" >// user password and domain
var user="user"; // ใส่ username ของท่าน ลงไปแทนuser
var password="passwd"; // ใส่ password ของท่าน ลงไปแทน passwd
<del datetime="2011-10-21T02:46:46+00:00">var domainIndex= "3"; // ใส่ลำดับของ domain ลงไป เริ่มนับจาก 0 1 2 .... เช่น truewifi ใส่ 0 หรือถ้าเป็น truehisp ใส่เป็น 3 ครับ</del>
var domainIndex= "1"; // ใส่ลำดับของ domain ลงไป เริ่มนับจาก 0 1 2 .... เช่น truewifi ใส่ 0 หรือถ้าเป็น truehisp ใส่เป็น 1 ครับ แก้ไขวันที่ <strong>21/10/2554 ครับใครใช้ truehisp แก้ไขเป็น 1 นะครับ</strong>
// url
var redirect = "http://portal.trueinternet.co.th/wifiauthen/login.do?VLAN=851&amp;MAC=00:23:69:XX:XX:XX&amp;VERSION=V2";
// timer
var minutes = 175; //@truehisp ใส่เป็น 175</div>
</pre>
<p style="text-align: left;">หลายคนอาจสงสัยว่าค่าของ redirect เอามาจากไหน มีทิปมาแนะนำครับ วิธีที่ง่ายที่สุดก็คือเปิด firefox ขึ้นมาแล้วในช่อง Address ให้เรากรอกคำว่า portal จากนั้นโปรแกรมจะมี list รายการ history มาให้เลือกก็ให้เราเลือก</p>
<p style="text-align: left;">http://portal.trueinternet.co.th/wifiauthen/login.do?VLAN=851&amp;MAC=00:23:69:xx:xx:xx&amp;VERSION=V2</p>
<p style="text-align: left;">มาเลยครับ MAC=00:23:69:xx:xx:xx จะเป็น MAC ของเราอยู่แล้ว</p>
<p style="text-align: left;">สำหรับใครที่ยังไม่มี URL ดังกล่าวให้ลองใช้ firefox เรียกเว็บไซต์อะไรก่อนก็ได้ firefox จะ redirect ให้ไป URL ดังกล่าวให้เองแล้วก็ลองกรอกคำว่า portal ลงในช่อง Address อีกครั้งก็จะเห็น URL ดังกล่าว</p>
<p style="text-align: left;">เมื่อแก้ script เสร็จแล้วก็ save แล้วปิด notepad เลยครับ จากนั้นลากไฟล์ที่แก้ไขเสร็จแล้วใส่ Firefox เลยครับ มันจะถามให้ install ก็เลือก install เหมือนเคยครับ</p>
<p style="text-align: left;">4. คงมาถึงขึ้นตอนสุดท้ายกันแล้วครับ หลังจากติดตั้ง Truewifi Script แล้วก็มาดูวิธีการใช้งานกัน หากคุณ logon truewifi อยู่ก็ให้ logout ออกได้เลยครับโดยเรียก <a href="http://logout./" rel="nofollow"  target="_blank">http://logout./</a> จากนั้นสังเกตได้เลยว่า script จะทำการ login truewifi ให้คุณเอง หากคุณไม่ได้ logon truewifi อยู่ก็ให้ลองเข้าเว็บอะไรก็ได้ครับ หลังจากนั้นมันจะ redirect แล้ว script ก็จะทำการ login ให้คุณเอง</p>
<p style="text-align: left;">หลังจาก login ไว้ 1 ชม. 25 นาที (85 นาที) Script จะทำการ logout ให้คุณเองอัตโนมัติแล้วก็ login ให้คุณใหม่ทันที</p>
<p style="text-align: left;"><span style="background-color: #ffff00;"><span style="color: #ff0000;"><strong>แต่มีข้อแม้ว่าคุณจะต้องเปิดหน้าจอหลังจากที่ logon truewifi ทิ้งไว้</strong></span></span>นะครับซึ่งก็คือหน้า https://portal.trueinternet.co.th/wifiauthen/login_result.php ซึ่งจะมีข้อความแสดงว่า</p>
<p style="text-align: left;"><img src="http://portal.trueinternet.co.th/wifiauthen/images/t_successfully.gif" alt="" width="207" height="49" border="0" /></p>
<p>Welcome to Wi-Fi Internet</p>
<p>The Ultimate Wireless Services will be yours.</p>
<p><strong>Enjoy Surfing!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2009/12/18/script-truewifi-auto-login-v2-04.html/feed/</wfw:commentRss>
		<slash:comments>109</slash:comments>
		</item>
		<item>
		<title>Shell Script แจ้งเตือน SMS เมื่อ Hard Disk ใกล้เต็มแบบฟรีๆ</title>
		<link>http://imrgill.com/2009/12/13/shell-script-alert-sms-when-disk-small-left.html</link>
		<comments>http://imrgill.com/2009/12/13/shell-script-alert-sms-when-disk-small-left.html#comments</comments>
		<pubDate>Sat, 12 Dec 2009 21:29:19 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[google calendar]]></category>
		<category><![CDATA[hard disk]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[sms]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=473</guid>
		<description><![CDATA[สวัสดีครับต่อยอดจากเรื่อง Server Down รู้ได้ทันทีผ่าน SMS แถมฟรี ที่เขียนไว้วันก่อน วันนี้เอามาประยุกต์ให้ script เช็คสถานะของ hard disk ครับโดยให้ส่ง sms เตือนเมื่อมีการใช้งาน partition ใดๆ เกิน 90% มาดูตัว code ของ script กันครับ #!/bin/sh # Simple SHELL script for Linux and UNIX system monitoring with # df command # ------------------------------------------------------------------------- # Copyright (c) 2009 mrGilL # This script is licensed under GNU GPL version [...]]]></description>
			<content:encoded><![CDATA[<p>สวัสดีครับต่อยอดจากเรื่อง <a href="http://imrgill.com/2009/12/11/monitor-server-with-sms-alert-shell-script" target="_blank">Server Down รู้ได้ทันทีผ่าน SMS แถมฟรี</a> ที่เขียนไว้วันก่อน วันนี้เอามาประยุกต์ให้ script เช็คสถานะของ hard disk ครับโดยให้ส่ง sms เตือนเมื่อมีการใช้งาน partition ใดๆ เกิน 90%<br />
มาดูตัว code ของ script กันครับ </p>
<pre>
<div class="codesnip-container" >#!/bin/sh
# Simple SHELL script for Linux and UNIX system monitoring with
# df command
# -------------------------------------------------------------------------
# Copyright (c) 2009 mrGilL <http://imrgill.com>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# Setup SMS User below
# See URL for more info:
# http://imrgill.com/2009/12/13/monitor-server-with-sms-alert-shell-script/
# -------------------------------------------------------------------------

# Hard type (hdx,sdx,scx)
HDD_TYPE="sd"

# Partition lists
PLIST=`df -h | grep $HDD_TYPE | awk '{ print $1 }' | sed -e 's/\/dev\///g'`

# Setting SMS User (Gmail)
GCUSER="user@gmail.com"
GCPASSWD="gmail-passwd" 

for p in $PLIST
do
  disk=$(df -h | grep $p | awk '{ print $5 }' | sed -e 's/\%//g')
  pname=$(df -h | grep $p | awk '{ print $6 }')
  if [ $disk -ge 90 ]; then
    # disk less than 90%
    wget --force-html --recursive --no-check-certificate -nd --delete-after "https://imrgill.com/google_sms/gsms.php?username=$GCUSER&#038;password=$GCPASSWD&#038;title=$(hostname) partition $pname < 90%"
  fi
done</div>
</pre>
<p><strong>วิธีนำไปใช้</strong></p>
<p>1. แก้ไข HDD_TYPE เป็นประเภท hard disk ที่คุณใช้ ดูได้จากคำสั่ง fdisk -l หรือ df ผลลัพธ์ที่ได้จะประมาณ /dev/sda ตัวอย่างผมได้ sda ให้ใส่เป็น HDD_TYPE=&#8221;sd&#8221;</p>
<pre>
<div class="codesnip-container" >[mrgill@Webserver ~]$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2             59515556   1260296  55183232   3% /
/dev/sda8             11710104   2895576   8210084  27% /usr
/dev/sda7              1019208     37992    928608   4% /tmp
/dev/sda6            109109796   9092520  94385292   9% /var
/dev/sda5            287660612  11604092 261208448   5% /home
/dev/sda1               101086     33812     62055  36% /boot
tmpfs                   517284         0    517284   0% /dev/shm</div>
</pre>
<p>*เหตุผลที่ไม่ใส่ sda ไปตรงๆ เลยก็เพราะ กรณีมี hard disk หลายลูกเช่น sda, sdb ทำให้ script ไม่สามารถตรวจสอบ hard disk ที่เป็น sdb ได้</p>
<p>2. แก้ไข GCUSER และ GCPASSWD เป็น user gmail ของเรา</p>
<p>3. กำหนดสิทธิ์ให้สามารถรันได้</p>
<pre>
<div class="codesnip-container" >[root@Webserver ~]$ chmod +x <a href="http://imrgill.com/wp-content/uploads/2009/observman_disk.tar.bz2">observman_disk.sh</a></div>
</pre>
<p>4. นำ script ไปใส่ /etc/cron.daily/ เพื่อให้ script ทำงานทุกวัน</p>
<pre>
<div class="codesnip-container" >[root@Webserver ~]$ cp <a href="http://imrgill.com/wp-content/uploads/2009/observman_disk.tar.bz2">observman_disk.sh</a> /etc/cron.daily/</div>
</pre>
<p>หรือใครจะนำไปใส่ใน crontab ก็ไม่ว่ากัน</p>
<pre>
<div class="codesnip-container" >[root@Webserver ~]$ crontab -e</div>
</pre>
<pre>
<div class="codesnip-container" ># m h  dom mon dow   command
@daily /root/observman_disk.sh > /dev/null</div>
</pre>
<p>หวังว่าบทความนี้คงเป็นประโยชน์ต่อผู้อ่าน</p>
  
<div class="wp_license">
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/th/"><img src="http://i.creativecommons.org/l/by-nc-sa/3.0/th/88x31.png" alt="Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Thailand" class="alignleft" style="margin-top:4px;" />
</a>This work  is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/th/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Thailand</a>.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2009/12/13/shell-script-alert-sms-when-disk-small-left.html/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Server Down รู้ได้ทันทีผ่าน SMS แถมฟรีด้วย</title>
		<link>http://imrgill.com/2009/12/11/monitor-server-with-sms-alert-shell-script.html</link>
		<comments>http://imrgill.com/2009/12/11/monitor-server-with-sms-alert-shell-script.html#comments</comments>
		<pubDate>Fri, 11 Dec 2009 01:19:20 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[sms]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=438</guid>
		<description><![CDATA[&#8211; ีupdate status 06/03/2012 script ยังใช้งานได้ครับ &#8211; ก่อนอื่นขอหาวยาวๆ ก่อนกล่าวสวัสดีท่านผู้อ่านทุกท่าน  เมื่อคืนบ้าพลังอะไรไม่รู้อยากเขียน script ส่ง sms เตือนเมื่อ server down ที่จริงชาวบ้านเค้าก็ทำขายกันเยอะแยะ แต่หลังจากที่ผมได้ใช้ Google Calendar แล้วให้มันส่ง sms เตือนแถมฟรีอีก ก็เลยคิดอยากใช้ประโยชน์จากมันเพิ่มเติมก็ค้นๆ  Google อีกเช่นเคยครับ ไปเจอบทความใน ThaiAdmin เรื่อง google calendar sms ที่ท่าน smartsoft เขียนไว้ก็เลยลองโหลด Libraries Google Calendar SMS มาเล่นดูบ้าง ซึ่งเมื่อลองดูแล้วก็ถือว่าใช้งานง่ายทีเดียวเลยเอามาโมต่อ โดยให้ Shell Script เป็นตัว Submit form แทน ความสามารถของ Script 1. ส่ง sms แจ้งเตือนเมื่อ ping [...]]]></description>
			<content:encoded><![CDATA[<p>&#8211;<br />
ีupdate status 06/03/2012 script ยังใช้งานได้ครับ<br />
&#8211;<br />
ก่อนอื่นขอหาวยาวๆ ก่อนกล่าวสวัสดีท่านผู้อ่านทุกท่าน  เมื่อคืนบ้าพลังอะไรไม่รู้อยากเขียน script ส่ง sms เตือนเมื่อ server down ที่จริงชาวบ้านเค้าก็ทำขายกันเยอะแยะ แต่หลังจากที่ผมได้ใช้ Google Calendar แล้วให้มันส่ง sms เตือนแถมฟรีอีก ก็เลยคิดอยากใช้ประโยชน์จากมันเพิ่มเติมก็ค้นๆ  Google อีกเช่นเคยครับ ไปเจอบทความใน ThaiAdmin เรื่อง <a href="http://www.thaiadmin.org/board/index.php?topic=114285.0" rel="nofollow" >google calendar sms</a> ที่ท่าน <a href="http://www.thaiadmin.org/board/index.php?action=profile;u=25720" rel="nofollow" title="ดูรายละเอียดของ smartsoft" >smartsoft</a> เขียนไว้ก็เลยลองโหลด Libraries Google Calendar SMS มาเล่นดูบ้าง ซึ่งเมื่อลองดูแล้วก็ถือว่าใช้งานง่ายทีเดียวเลยเอามาโมต่อ โดยให้ Shell Script เป็นตัว Submit form แทน</p>
<p><strong>ความสามารถของ Script</strong></p>
<p>1. ส่ง sms แจ้งเตือนเมื่อ ping ไม่เจอ server<br />
2. เก็บ log ในตัว เพราะทุกครั้งที่มันส่ง sms มันจะไปเพิ่ม Event ใน Google Calendar ทำให้เราเข้าไปตรวจสอบย้อนหลังได้<br />
3. ไม่ต้องเสียเงินค่าส่ง SMS แม้แต่น้อย (พี่ Google เค้าใจดี)</p>
<p><strong>มาดูขั้นตอนการทำกัน</strong></p>
<p>ก่อนอื่นเราก็ต้องไป Verify เบอร์มือถือใน Google Calendar ก่อนครับ ขออนุญาตท่าน <a href="http://www.thaiadmin.org/board/index.php?action=profile;u=25720" rel="nofollow" title="ดูรายละเอียดของ smartsoft" >smartsoft</a> ทำรูปใหม่นะครับ<br />
1. ขั้นแรก ล็อกอินเข้า Google Calendar <a href="http://www.google.com/calendar" rel="nofollow"  target="_blank">http://www.google.com/calendar</a> ก็ใช้ User ของ Gmail นั้นแหละครับ<br />
ล็อกอินแล้วคลิกที่ Settings เพื่อไปปรับเมนูให้เป็นภาษาไทย (หากใครเป็นภาษาไทยอยู่แล้วข้ามไปขั้นตอนต่อไปได้เลย)</p>
<p><img class="aligncenter" src="http://farm3.static.flickr.com/2773/4175582724_515d2cfce5_o.png" alt="" width="519" height="148" /></p>
<p style="text-align: center;">คลิก Settings</p>
<p>2. เลือก Language ให้เป็น <strong>ภาษาไทย </strong>แล้วกด Save</p>
<p style="text-align: center;"><img class="aligncenter" src="http://farm3.static.flickr.com/2774/4175582728_de23bb83d4_o.png" alt="" width="469" height="243" /></p>
<p style="text-align: center;">เลือก ภาษาไทย</p>
<p style="text-align: left;"><span id="more-438"></span>3. กลับมาหน้าปฏิทินคลิกที่ <strong>การตั้งค่า</strong></p>
<p style="text-align: left;"><img class="aligncenter" src="http://farm3.static.flickr.com/2785/4175582742_55962360a8_o.png" alt="" width="219" height="286" /></p>
<p style="text-align: left;">4. คลิกที่ <strong>ตั้งค่าอุปกรณ์เคลื่อนที่</strong></p>
<p style="text-align: left;"><img class="aligncenter" src="http://farm3.static.flickr.com/2516/4175582744_767056a6b0_o.png" alt="" width="317" height="177" /></p>
<p style="text-align: left;">
<p style="text-align: left;">5. กรอกเบอร์โทรศัพท์มือถือของคุณลงไป จากนั้นกดปุ่ม <strong>ส่งรหัสยืนยัน</strong></p>
<p style="text-align: left;"><img class="aligncenter" src="http://farm3.static.flickr.com/2745/4175582748_14b2eb8d46_o.png" alt="" width="527" height="223" /></p>
<p style="text-align: left;">6. รอสักครู่ Google จะส่ง SMS รหัสยืนยันมาให้ เมื่อได้รับรหัสยืนยันแล้วนำมากรอกในช่อง <strong>รหัสยืนยัน</strong> จากนั้นคลิก <strong>สิ้นสุดการตั้งค่า</strong></p>
<p style="text-align: center;"><strong><img class="aligncenter" src="http://farm3.static.flickr.com/2627/4175582752_3328f279a2_o.png" alt="" width="527" height="223" /></strong>กรอกรหัสยืนยันลงไป</p>
<p style="text-align: center;"><img class="aligncenter" src="http://farm3.static.flickr.com/2699/4174864937_66e118528c_o.png" alt="" width="563" height="61" />สถานะจะเปลี่ยนเป็นสีเขียวหลังยืนยันหมายเลขโทรศัพท์สำเร็จแล้ว</p>
<p style="text-align: left;"><strong><br />
</strong></p>
<p style="text-align: left;">7. คลิกที่แท็บ <strong>ปฎิทิน</strong> แล้วคลิกที่ <strong>การแจ้ง</strong></p>
<p style="text-align: left;"><img class="aligncenter" src="http://farm3.static.flickr.com/2509/4175583670_089b0611af_o.png" alt="" width="490" height="241" /></p>
<p style="text-align: left;">8. เลือก <strong>การแจ้งเตือนกิจกรรม</strong> ให้เป็น SMS  แล้วกด <strong>บันทึก </strong>(** สำคัญมาก คุณต้องเลือกให้เป็น SMS เป็นอันดับแรก)<strong><br />
</strong></p>
<p style="text-align: center;"><a href="http://farm3.static.flickr.com/2802/4175583674_3a5c7533c3_o.png" rel="nofollow"  rel="lightbox[438]"><img class="aligncenter" src="http://farm3.static.flickr.com/2802/4175583674_3a5c7533c3_o.png" alt="" width="470" height="150" /></a></p>
<p>ตั้งเวลาตามใจชอบเลยครับ(ตรงนี้ไม่เกี่ยวกับ SMS Alert ใน Script ครับ)</p>
<p style="text-align: left;">เสร็จสิ้นสำหรับส่วนของ Google Calendar ครับต่อไปมาถึงตัว Shell Script กันบ้าง</p>
<p style="text-align: left;">ผมได้เอา Script ของ <span>Vivek Gite แห่ง </span><a href="http://cyberciti.biz" rel="nofollow"  target="_blank">cyberciti.biz</a> มาแก้ไขนิดหน่อยครับ ต้นฉบับอยู่ที่ <a href="http://bash.cyberciti.biz/monitoring/monitor-windows-linux-server-with-ping-script/" rel="nofollow"  target="_blank">http://bash.cyberciti.biz/monitoring/monitor-windows-linux-server-with-ping-script/</a></p>
<p>ผมตั้งชื่อ Shell Script ตัวนี้ว่า <a href="http://imrgill.com//wp-content/uploads/2009/observman.tar.bz2">observman.sh</a> &lt;&lt;กดดาวน์โหลด</p>
<pre>
<div class="codesnip-container" >#!/bin/bash
# Simple SHELL script for Linux and UNIX system monitoring with
# ping command
# -------------------------------------------------------------------------
# Copyright (c) 2006 nixCraft project
# This script is licensed under GNU GPL version 2.0 or above
# Modify by mrGilL
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
# Setup SMS User below
# See URL for more info:
# http://www.cyberciti.biz/tips/simple-linux-and-unix-system-monitoring-with-ping-command-and-scripts.html
# http://imrgill.com/2009/12/11/monitor-server-with-sms-alert-shell-script/
# -------------------------------------------------------------------------

# add ip / hostname separated by blank space
HOSTS="192.168.1.2 eng.ru.ac.th imrgill.com www.pca.co.th"

# no ping request
COUNT=5

# Set SMS Username (Google Calendar)
GCUSER="user@gmail.com"
GCPASSWD="gmail-passwd" 

for myHost in $HOSTS
do
  count=$(ping -c $COUNT $myHost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
  if [ $count -eq 0 ]; then
    # 100% failed
    wget --force-html --recursive --no-check-certificate -nd --delete-after "https://imrgill.com/google_sms/gsms.php?username=$GCUSER&amp;password=$GCPASSWD&amp;title=Server $myHost Down"
  fi
done</div>
</pre>
<p>ใส่ IP หรือชื่อ Host ของ Server ที่ต้องการ Monitor ลงไป หากมีหลายเครื่องให้คั่นด้วยเว้นวรรค</p>
<p>ต่อมาแก้ไข GCUSER และ GCPASSWD เป็นของท่าน(Gmail ของท่าน)</p>
<p>อย่าลืมกำหนดสิทธิ์ให้มันรันได้ด้วยนะครับ</p>
<pre>
<div class="codesnip-container" >root@mrgill-laptop:/root# chmod +x observman.sh</div>
</pre>
<p>สุดท้ายจับ Shell Script ของเราใส่ใน Crontab โดย</p>
<pre>
<div class="codesnip-container" >root@mrgill-laptop:~# crontab -e</div>
</pre>
<p>ผมตั้งให้มันเช็คทุก 15 นาทีครับ</p>
<pre>
<div class="codesnip-container" ># m h  dom mon dow   command
0-59/15 * * * * /root/observman.sh &gt; /dev/null</div>
</pre>
<p>ลองทดสอบง่ายๆ ดูครับ ใช้ไอพีเครื่องในวงแลนคุณก็ได้ จากนั้นไป disable การ์ดแลนหรือจะถอดสายแลนของเครื่องที่คุณต้องการ Monitor ก็ได้ รอประมาณ 2 นาทีจะมี SMS ส่งจาก Google มาหาคุณ</p>
<p style="text-align: left;"><strong>ภาพตัวอย่างหากแก้ไขถูกต้องครับ</strong></p>
<p style="text-align: center;"><img class="aligncenter" src="http://farm5.static.flickr.com/4025/4210341646_7a76249947_o.png" alt="" width="486" height="300" /><br />
จะมี event add เข้าไปใน google calendar</p>
<p style="text-align: center;"><img class="aligncenter" src="http://farm3.static.flickr.com/2554/4210341648_3b51cc4c89_o.jpg" alt="" width="640" height="480" /><br />
ภาพข้อความจาก google sms</p>
<p>*หมายเหตุ  : มีคนถามมาว่าทำไมต้องส่งข้อมูลผ่าน blog ผมด้วย ส่งเข้า Google เลยไม่ได้เหรอ คำตอบก็คือมันต้องมี API ติดต่อไปยัง Google Calendar ครับ ซึ่งผมได้ฝังไว้บน blog ของผมเอง และหากใครกังวลเรื่องความปลอดภัยผมเองก็มีไฟล์ API ให้โหลดเอาไว้ติดตั้งบน Server ตัวเองได้ครับซึ่งสามารถดาวน์โหลดได้จากที่นี่ <a href="http://imrgill.com/wp-content/uploads/2009/google_sms.tar.bz2">google_sms.tar.bz2</a> โหลดเสร็จแล้วก็เอาไปแตกไว้ใน wwwroot และอย่าลืมไปแก้ URL  ใน Shell Script ด้วยนะครับ</p>
<p>หวังว่าบทความนี้คงเป็นประโยชน์กับผู้อ่าน<br />
แหล่งข้อมูล : <a href="http://www.thaiadmin.org/board/index.php?topic=114285.0" rel="nofollow" >http://www.thaiadmin.org/board/index.php?topic=114285.0</a><br />
<a href="http://bash.cyberciti.biz/monitoring/monitor-windows-linux-server-with-ping-script/" rel="nofollow" >http://bash.cyberciti.biz/monitoring/monitor-windows-linux-server-with-ping-script/</a></p>
  
<div class="wp_license">
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/th/"><img src="http://i.creativecommons.org/l/by-nc-sa/3.0/th/88x31.png" alt="Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Thailand" class="alignleft" style="margin-top:4px;" />
</a>This work  is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/th/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Thailand</a>.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2009/12/11/monitor-server-with-sms-alert-shell-script.html/feed/</wfw:commentRss>
		<slash:comments>63</slash:comments>
		</item>
		<item>
		<title>ติดตั้ง NetBeans 6.8beta บน ubuntu 9.10</title>
		<link>http://imrgill.com/2009/10/25/how-to-install-netbeans-6-8beta-on-ubuntu-9-10.html</link>
		<comments>http://imrgill.com/2009/10/25/how-to-install-netbeans-6-8beta-on-ubuntu-9-10.html#comments</comments>
		<pubDate>Sat, 24 Oct 2009 19:13:33 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://imrgill.com/blog/?p=158</guid>
		<description><![CDATA[สวัสดีครับเมื่อวานผมลง NetBeans 6.8beta ผมเองก็ไม่ใช่ Programmer มืออาชีพอะไรหรอกครับ แต่บางทีก็มีแก้ Code โน้นนี่บ้างเป็นบางครั้ง ก็เลยอยากหาก IDE ติดเครื่องไว้บ้าง ก็เข้าไป download กันได้เลยที่ http://download.netbeans.org/netbeans/6.8/beta/ ผมโหลดแค่ตัว PHP มา ในการติดตั้ง NetBeans นั้นต้องการ Java Runtime ในการติดตั้ง ดังนั้นจึงต้องติดตั้ง jre ก่อนครับ ผมเลือก sun-java6-jre (ใครเขียน java ก็ติดตั้ง sun-java6-jdk ไปด้วยนะครับ) $sudo apt-get install sun-java6-jre หลังจากติดตั้ง jre เสร็จแล้วก็ติดตั้งกันได้เลยโดยไฟล์ที่ download มาจะเป็น .sh ซึ่งเป็น shell script โดยชื่อไฟล์อาจแตกต่างกันไปตาม package ที่เราเลือกนะครับ $sudo chmod +x netbeans-6.8beta-ml-php-linux.sh [...]]]></description>
			<content:encoded><![CDATA[<p>สวัสดีครับเมื่อวานผมลง NetBeans 6.8beta ผมเองก็ไม่ใช่ Programmer มืออาชีพอะไรหรอกครับ แต่บางทีก็มีแก้ Code โน้นนี่บ้างเป็นบางครั้ง ก็เลยอยากหาก IDE ติดเครื่องไว้บ้าง</p>
<p>ก็เข้าไป download กันได้เลยที่ <a href="http://download.netbeans.org/netbeans/6.8/beta/" rel="nofollow"  target="_blank">http://download.netbeans.org/netbeans/6.8/beta/</a> ผมโหลดแค่ตัว PHP มา</p>
<p>ในการติดตั้ง NetBeans นั้นต้องการ Java Runtime ในการติดตั้ง ดังนั้นจึงต้องติดตั้ง jre ก่อนครับ ผมเลือก sun-java6-jre (ใครเขียน java ก็ติดตั้ง sun-java6-jdk ไปด้วยนะครับ)</p>
<pre>
<div class="codesnip-container" >$sudo apt-get install sun-java6-jre</div>
</pre>
<p><!-- wp_ad_camp_2 --><br />
หลังจากติดตั้ง jre เสร็จแล้วก็ติดตั้งกันได้เลยโดยไฟล์ที่ download มาจะเป็น .sh ซึ่งเป็น shell script โดยชื่อไฟล์อาจแตกต่างกันไปตาม package ที่เราเลือกนะครับ</p>
<pre>
<div class="codesnip-container" >$sudo chmod +x netbeans-6.8beta-ml-php-linux.sh
$sudo ./netbeans-6.8beta-ml-php-linux.sh</div>
</pre>
<p>จะมีหน้า Wizard มาให้เรากด Next ไปเรื่อยๆ ก็ตั้งค่าตามต้องการได้เลยครับ</p>
<p>ติดตั้งเสร็จแล้วเรียกใช้ NetBeans ได้จากเมนู Applications &gt;&gt; Programming &gt;&gt; NetBeans IDE 6.8 Beta</p>
<p style="text-align: center;"><a href="http://imrgill.com/wp-content/uploads/2009/10/netbeans6.8beta.jpg" rel="lightbox[158]"><img class="size-medium wp-image-159 alignnone" style="border: 0pt none; margin: 0px;" title="netbeans6.8beta" src="http://imrgill.com/wp-content/uploads/2009/10/netbeans6.8beta-300x187.jpg" alt="netbeans6.8beta" /></a><br />
NetBeans 6.8 Beta</p>
<p style="text-align: right;"><span id="more-158"></span></p>
<p style="text-align: left;">
<p><!-- wp_ad_camp_1 --></p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2009/10/25/how-to-install-netbeans-6-8beta-on-ubuntu-9-10.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

