<?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://my.diary.in.th</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 04 Jan 2012 14:27:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<copyright>2006-2007 </copyright>
	<managingEditor>wachira@gmail.com (My.diary.in.th)</managingEditor>
	<webMaster>wachira@gmail.com (My.diary.in.th)</webMaster>
	<ttl>1440</ttl>
	<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://my.diary.in.th</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle />
	<itunes:summary>Just another WordPress weblog</itunes:summary>
	<itunes:keywords />
	<itunes:category text="Society &amp; Culture" />
	<itunes:author>My.diary.in.th</itunes:author>
	<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" />
		<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>วิธีติดตั้ง Smarty 3.1.7 กับ CodeIgniter 2.1.0</title>
		<link>http://feedproxy.google.com/~r/Mydiaryinth/~3/Rh2iPU8Prsc/1392</link>
		<comments>http://my.diary.in.th/archives/1392#comments</comments>
		<pubDate>Wed, 04 Jan 2012 14:27:26 +0000</pubDate>
		<dc:creator>W.p.</dc:creator>
				<category><![CDATA[เรื่องน่าสนใจ]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[Smarty]]></category>

		<guid isPermaLink="false">http://my.diary.in.th/?p=1392</guid>
		<description><![CDATA[<p>ผมหาทางติดตั้ง  Smarty 3.1.7 เพื่อให้ใช้งานได้กับ CodeIgniter 2.1.0  ได้  โดยมีขั้นดังนี้</p> <a title="Dowload CodeIgniter" href="http://codeigniter.com/download.php">ดาวน์โหลด</a>และ<a title="CodeIgniter Installation Instructions" href="http://codeigniter.com/user_guide/installation/index.html">ติดตั้ง</a> CodeIgniter ตามปกติ การติดตั้ง Smarty จะดำเนินการโดยใช้ <a title="Smarty templating integration for Codeigniter 2.0+" href="https://github.com/Vheissu/Ci-Smarty">Ci-Smarty</a>  ที่พัฒนาขึ้นโดยคุณ Dwayne Charrington   ให้<a href="https://github.com/Vheissu/Ci-Smarty">ดาวน์โหลด</a>และติดตั้งลงใน CodeIgniter ในข้อ 1.  แล้วให้ทำการทดสอบว่าสามารถใช้งาน Smarty ได้จริง เนื่องจากในขณะที่เขียนบทความนี้ Smarty ที่ิติดตั้งใน Ci-Smarty เป็นเวอร์ชัน 3.1.1 เราจึงต้องมีการแก้ไขปรับแก้ไฟล์  โดยโครงสร้างไฟล์ของ Ci-Smarty มีดังภาพข้างล่างนี้<br /> <a href="http://my.diary.in.th/wp-content/uploads/2012/01/Ci-Smarty.png"></a> เราต้องปรับแก้ 3 [...]]]></description>
			<content:encoded><![CDATA[<p>ผมหาทางติดตั้ง  Smarty 3.1.7 เพื่อให้ใช้งานได้กับ CodeIgniter 2.1.0  ได้  โดยมีขั้นดังนี้</p>
<ol>
<li><a title="Dowload CodeIgniter" href="http://codeigniter.com/download.php">ดาวน์โหลด</a>และ<a title="CodeIgniter Installation Instructions" href="http://codeigniter.com/user_guide/installation/index.html">ติดตั้ง</a> CodeIgniter ตามปกติ</li>
<li>การติดตั้ง Smarty จะดำเนินการโดยใช้ <a title="Smarty templating integration for Codeigniter 2.0+" href="https://github.com/Vheissu/Ci-Smarty">Ci-Smarty</a>  ที่พัฒนาขึ้นโดยคุณ Dwayne Charrington   ให้<a href="https://github.com/Vheissu/Ci-Smarty">ดาวน์โหลด</a>และติดตั้งลงใน CodeIgniter ในข้อ 1.  แล้วให้ทำการทดสอบว่าสามารถใช้งาน Smarty ได้จริง</li>
<li>เนื่องจากในขณะที่เขียนบทความนี้ Smarty ที่ิติดตั้งใน Ci-Smarty เป็นเวอร์ชัน 3.1.1 เราจึงต้องมีการแก้ไขปรับแก้ไฟล์  โดยโครงสร้างไฟล์ของ Ci-Smarty มีดังภาพข้างล่างนี้<br />
<a href="http://my.diary.in.th/wp-content/uploads/2012/01/Ci-Smarty.png"><img class="aligncenter size-full wp-image-1400" title="Ci-Smarty" src="http://my.diary.in.th/wp-content/uploads/2012/01/Ci-Smarty.png" alt="" width="349" height="407" /></a></li>
<li>เราต้องปรับแก้ 3 ส่วน ตามที่ลูกศรชี้ไว้</li>
</ol>
<ul>
<li>ส่วนที่ 1 แก้ไขไฟล์ smarty.php ในไดเรกทอรี config  โดยให้แก้ตัวแปร $config['cache_status'] ให้มีค่าเป็น TRUE จากเดิมที่เป็น 1 เนื่องจากในไฟล์ libraries/Smarty.php ตรวจสอบค่า $config['cache_status'] ว่าเป็น TRUE หรือไม่
<pre class="brush: php; gutter: false">$config[&#039;cache_status&#039;] = TRUE;</pre>
<p>และให้เพิ่ม 2 บรรทัดต่อไปนี้ที่ท้ายไฟล์  เพื่อจะได้เป็นการบังคับให้ให้มีการ compile template ทุกครั้งในระหว่างที่เรากำลังพัฒนาโปรแกรม   และเมื่อจะนำไปใช้งานจริงก็ควรกำหนดค่าให้เป็น FALSE ทั้ง 2 ตัวแปร</p>
<pre class="brush: php; gutter: false">$config[&#039;compile_check&#039;] = TRUE; 
$config[&#039;force_compile&#039;] = TRUE;</pre>
</li>
</ul>
<ul>
<li>ส่วนที่ 2 แก้ไขไฟล์ Smarty.net ในไดเรอกทอรี libraries  โดยให้เพิ่ม 2 คำสั่งต่อไปนี้ใต้บรรทัดที่มี $this-&gt;template_ext เพื่อนำค่าจากการแก้ไขส่วนที่ 1 มาใช้งาน
<pre class="brush: php; gutter: false">$this-&gt;compile_check = config_item(&#039;compile_check&#039;);
$this-&gt;force_compile = config_item(&#039;force_compile&#039;);</pre>
<p>หลังจากนั้นให้ทำการ comment ในคำสั่งส่วนที่จะทำการเพิ่ม helper ต่างๆ ​ โดยใส่เครื่องหมาย /* และ */ ครอบเอาไว้  สาเหตุที่ต้อง comment ไว้ก็เพราะเมื่อเรา upgrade Smarty เป็น 3.1.7 แล้ว คำสั่งในส่วนนี้จะทำให้เกิด error  (หากอยากทราบว่าเป็นอย่างไรก็ปล่อยไว้ได้)</p>
<pre class="brush: php; gutter: false">/*
 // Add all helpers to plugins_dir
 $helpers = glob(APPPATH . &#039;helpers/&#039;, GLOB_ONLYDIR | GLOB_MARK);
foreach ($helpers as $helper)
 {
 $this-&gt;plugins_dir[] = $helper;
 }
 */</pre>
</li>
<li>ส่วนที่ 3 ให้ทำการ<a title="Download Smarty 3.1.7" href="http://www.smarty.net/files/Smarty-3.1.7.zip">ดาวน์โหลด Smarty 3.1.7</a>  แล้วแตกไฟล์และคัดลอกเอาไฟล์และไดเรกทอรีภายใต้ libs มาทับของเดิมใน third_party/Smarty/ ทั้งหมด</li>
</ul>
<p>ขอขอบคุณ คุณ Dwayne Charrington ที่ได้พัฒนา Ci-Smarty ไว้ครับ  ขั้นตอนข้างบนนี้จะไม่จำเป็นเมื่อ Ci-Smarty มีการ update ครับ  และผมไม่รับประกันความเสี่ยงที่เกิดขึ้น รวมทั้งปัญหาที่ตามมาใดๆ ทั้งสิ้นครับ!</p>
<p>Happy Coding Year! <img src='http://my.diary.in.th/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
<img src="http://my.diary.in.th/7c0ab7b1/d155e05f/FeedBurner/1.0 (http://www.FeedBurner.com).gif" /><img src="http://my.diary.in.th/?ak_action=api_record_view&id=1392&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mydiaryinth?a=Rh2iPU8Prsc:82hhVVWXd94: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/Rh2iPU8Prsc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://my.diary.in.th/archives/1392/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://my.diary.in.th/archives/1392</feedburner:origLink></item>
		<item>
		<title>วิธีทำให้ mod_rewrite ทำงานบน Mac OS X Lion</title>
		<link>http://feedproxy.google.com/~r/Mydiaryinth/~3/izYYIipRhIU/1383</link>
		<comments>http://my.diary.in.th/archives/1383#comments</comments>
		<pubDate>Tue, 03 Jan 2012 19:15:17 +0000</pubDate>
		<dc:creator>W.p.</dc:creator>
				<category><![CDATA[เรื่องน่าสนใจ]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://my.diary.in.th/?p=1383</guid>
		<description><![CDATA[<p>หากใช้งาน Apache ที่มากับ Mac OS X แล้วเกิดปัญหา mod_rewrite ไม่ทำงาน  ให้แก้ไขที่ไฟล์ /etc/apache2/users/username.conf  (แทนที่ username ด้วย username จริงๆ ที่ใช้งานในระบบ)  ให้แก้ไข ที่ AllowOverride None ให้เป็น AllowOverride All ดังตัวอย่างข้างล่าง</p> &#60;Directory &#34;/Users/username/Sites/&#34;&#62; Options Indexes MultiViews AllowOverride All Order allow,deny Allow from All &#60;/Directory&#62;]]></description>
			<content:encoded><![CDATA[<p>หากใช้งาน Apache ที่มากับ Mac OS X แล้วเกิดปัญหา mod_rewrite ไม่ทำงาน  ให้แก้ไขที่ไฟล์ /etc/apache2/users/username.conf  (แทนที่ username ด้วย username จริงๆ ที่ใช้งานในระบบ)  ให้แก้ไข ที่ AllowOverride None ให้เป็น AllowOverride All ดังตัวอย่างข้างล่าง</p>
<pre class="brush: text; gutter: true">&lt;Directory &quot;/Users/username/Sites/&quot;&gt;
     Options Indexes MultiViews
     AllowOverride All
     Order allow,deny
     Allow from All
&lt;/Directory&gt;</pre>
<img src="http://my.diary.in.th/7c0ab7b1/d155e05f/FeedBurner/1.0 (http://www.FeedBurner.com).gif" /><img src="http://my.diary.in.th/?ak_action=api_record_view&id=1383&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mydiaryinth?a=izYYIipRhIU:1Vo5RgaHNew: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/izYYIipRhIU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://my.diary.in.th/archives/1383/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://my.diary.in.th/archives/1383</feedburner:origLink></item>
		<item>
		<title>เปลี่ยนชื่อ blog ใน wordpress</title>
		<link>http://feedproxy.google.com/~r/Mydiaryinth/~3/puo1npvpSig/1363</link>
		<comments>http://my.diary.in.th/archives/1363#comments</comments>
		<pubDate>Sun, 11 Dec 2011 14:13:16 +0000</pubDate>
		<dc:creator>W.p.</dc:creator>
				<category><![CDATA[เรื่องน่าสนใจ]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://my.diary.in.th/?p=1363</guid>
		<description><![CDATA[<p>ผมเปลี่ยนชื่อจาก http://www.diary.in.th/my เป็น http://my.diary.in.th</p> <p>ขั้นตอนการดำเนินการก็ไม่ยาก  เพราะอยู่ใน account เดียวกันแค่สร้าง subdomain เพิ่ม และก็อปปี้ข้อมูลจากไดเรกทอรีเดิมไปที่ใหม่</p> <p>WordPress ก็ได้ทำเว็บไซต์เกี่ยวกับเรื่องนี้ไว้ด้วย  สามารถทำตามได้เลย</p> <a href="http://codex.wordpress.org/Moving_WordPress" target="_blank">http://codex.wordpress.org/Moving_WordPress</a> <a href="http://codex.wordpress.org/Changing_The_Site_URL" target="_blank">http://codex.wordpress.org/Changing_The_Site_URL</a> <p>หลังจากย้ายข้อมูลเสร็จก็ใช้ <a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html" target="_blank">Apache mod rewrite</a>  จัดการให้ลิ้งก์เดิมถูกส่งต่อไปลิ้งใหม่  เช่น http://www.diary.in.th/archives/572 จะถูกส่งต่อไปที่ http://my.diary.in.th/archives/572 โดยอัตโนมัติ</p> <p>ผมเขียนคำสั่งต่อไปนี้ในไฟล์ .htaccess</p> RewriteEngine On Redirect 301 /my http://my.diary.in.th Redirect 301 /archives http://my.diary.in.th/archives]]></description>
			<content:encoded><![CDATA[<p>ผมเปลี่ยนชื่อจาก http://www.diary.in.th/my เป็น http://my.diary.in.th</p>
<p>ขั้นตอนการดำเนินการก็ไม่ยาก  เพราะอยู่ใน account เดียวกันแค่สร้าง subdomain เพิ่ม และก็อปปี้ข้อมูลจากไดเรกทอรีเดิมไปที่ใหม่</p>
<p>WordPress ก็ได้ทำเว็บไซต์เกี่ยวกับเรื่องนี้ไว้ด้วย  สามารถทำตามได้เลย</p>
<ul>
<li><a href="http://codex.wordpress.org/Moving_WordPress" target="_blank">http://codex.wordpress.org/Moving_WordPress</a></li>
<li><a href="http://codex.wordpress.org/Changing_The_Site_URL" target="_blank">http://codex.wordpress.org/Changing_The_Site_URL</a></li>
</ul>
<p>หลังจากย้ายข้อมูลเสร็จก็ใช้ <a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html" target="_blank">Apache mod rewrite</a>  จัดการให้ลิ้งก์เดิมถูกส่งต่อไปลิ้งใหม่  เช่น http://www.diary.in.th/archives/572 จะถูกส่งต่อไปที่ http://my.diary.in.th/archives/572 โดยอัตโนมัติ</p>
<p>ผมเขียนคำสั่งต่อไปนี้ในไฟล์ .htaccess</p>
<pre class="brush: text; gutter: true">RewriteEngine On
Redirect 301 /my http://my.diary.in.th
Redirect 301 /archives http://my.diary.in.th/archives</pre>
<img src="http://my.diary.in.th/7c0ab7b1/d155e05f/FeedBurner/1.0 (http://www.FeedBurner.com).gif" /><img src="http://my.diary.in.th/?ak_action=api_record_view&id=1363&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mydiaryinth?a=puo1npvpSig:tTGa97_b_Pk: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/puo1npvpSig" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://my.diary.in.th/archives/1363/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://my.diary.in.th/archives/1363</feedburner:origLink></item>
		<item>
		<title>วิธีการติดตั้ง git, gitosis บน CentOS 5</title>
		<link>http://feedproxy.google.com/~r/Mydiaryinth/~3/wHAHhEo_PX8/572</link>
		<comments>http://my.diary.in.th/archives/572#comments</comments>
		<pubDate>Fri, 09 Dec 2011 18:40:03 +0000</pubDate>
		<dc:creator>W.p.</dc:creator>
				<category><![CDATA[เรื่องน่าสนใจ]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://my.diary.in.th/my/?p=572</guid>
		<description><![CDATA[<p>&#8220;Git is a free &#38; open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.&#8221; &#8211; http://git-scm.com</p> <p>&#8220;Gitosis is a tool which provides access control and remote management for hosted <a title="Git" href="https://wiki.archlinux.org/index.php/Git">Git</a> repositories. It allows for fine-grained management of read and write access over SSH, without [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;Git is a free &amp; open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.&#8221; &#8211; http://git-scm.com</p>
<p>&#8220;Gitosis is a tool which provides access control and remote management for hosted <a title="Git" href="https://wiki.archlinux.org/index.php/Git">Git</a> repositories. It allows for fine-grained management of read and write access over SSH, without requiring that the users have local system accounts on the server.&#8221;  - https://wiki.archlinux.org/index.php/Gitosis</p></blockquote>
<p>ในการติดตั้ง git และ gitosis บน CentOS 5 นี้จะใช้ package จาก EPEL(Extra Packages for Enterprise Linux) ดังนั้นจะต้องทำการติดตั้ง EPEL ก่อน  โดยดูวิธีการติดตั้งได้ที่นี่ <a href="http://fedoraproject.org/wiki/EPEL/FAQ#howtouse" target="_blank">http://fedoraproject.org/wiki/EPEL/FAQ#howtouse</a>  เช่น</p>
<pre class="brush: bash; gutter: false"># su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm'</pre>
<p>หลังจากนั้นติดตั้ง git และ gitosis ด้วยคำสั่ง</p>
<pre class="brush: bash; gutter: false"># yum install git gitosis</pre>
<p>gitosis จะสร้าง user ชื่อ gitosis ดังนี้</p>
<pre class="brush: bash; gutter: false">-sh-3.2$ finger gitosis
Login: gitosis        			Name: git repository hosting
Directory: /var/lib/gitosis         	Shell: /bin/sh
Never logged in.
No mail.
No Plan.</pre>
<p>และจะสร้างไดเรกทอรีขึ้นมา 2 อันคือ gitosis และ repositories</p>
<p>gitosis จะควบคุมการเข้าถึง repositories  ต่างๆ ผ่านทาง repository  พิเศษที่ชื่อว่า gitosis-admin ซึ่งจะอยู่ที่  /var/lib/gitosis/repositories</p>
<p>ทั้งนี้การที่จะติดต่อไปยังเซิร์ฟเวอร์จากเครื่องของเราจะต้องทำผ่านทาง SSH  จึงจำเป็นต้องสร้าง public SSH key ที่เครื่องของเราเองก่อน ด้วยคำสั่งต่อไปนี้</p>
<pre class="brush: bash; gutter: false">$ ssh-keygen -t rsa</pre>
<p>เมื่อได้ไฟล์ id_rsa.pub  ซึ่งจะอยู่ที่ $HOME/.ssh/ มาแล้ว ก็ให้คัดลอกไฟล์นี้ไปไว้ในเซิร์ฟเวอร์   จากนั้นให้ทำการเพิ่ม public SSH key ของเราเข้าไปใน gitosis ด้วยคำสั่ง</p>
<pre class="brush: bash; gutter: false"># su - gitosis
$ gitosis-init &lt; /tmp/id_rsa.pub</pre>
<p>จากนั้นที่เครื่องของเรา  ให้ใช้คำสั่งต่อไปนี้เพื่อ clone gitosis-admin มาไว้ที่เครื่องเรา</p>
<pre class="brush: bash; gutter: false">$ git clone gitosis@HOSTNAME.COM:gitosis-admin.git</pre>
<p>เมื่อตรวจสอบดู gitosis-admin ที่ clone มาจะพบข้อมูลดังนี้</p>
<pre class="brush: bash; gutter: false">$ cd gitosis-admin/
$ ls -l
total 8
-rw-r--r--  1 wachira  staff  154 Dec  9 23:48 gitosis.conf
drwxr-xr-x  3 wachira  staff  102 Dec  9 23:48 keydir</pre>
<p>ไฟล์ gitosis.conf จะใช้สำหรับในการควบคุมสิทธิ์การเข้าถึง repositories ต่างๆ ของผู้ใช้  โดยมีรูปแบบเช่น</p>
<pre class="brush: text; gutter: false">$ cat gitosis.conf
[gitosis]

[group gitosis-admin]
writable = gitosis-admin
members = wachira@hostname 

[group myteam]
writable = citest
members = wachira@hostname someone</pre>
<p>โดยเมื่อเราต้องการเพิ่มผู้ใช้งานก็จะต้องแก้ไขไฟล์นี้  พร้อมๆ กับต้องเพิ่ม public SSH key ของผู้ใช้ใหม่ไว้ในไดเรกทอรี keyring ด้วย</p>
<p>วิธีการสร้าง repository ใหม่  เช่น citest สามารถทำได้ดังนี้</p>
<pre class="brush: bash; gutter: false">$ mkdir citest
$ cd citest
$ git init
$ git remote add origin gitosis@HOSTNAME.COM:citest.git</pre>
<p>หลังจากนั้นเมื่อเราทำการ commit ไฟล์ต่างๆ ที่เครื่องเราเรียบร้อยแล้วให้ใช้คำสั่ง</p>
<pre class="brush: bash; gutter: false">$ git push origin master:refs/heads/master</pre>
<p>คำสั่งนี้จะทำให้เซิร์ฟเวอร์สร้าง citest repository ที่ /var/lib/gitosis/repositories</p>
<p>กรณีที่  SSH server ไม่ได้ใช้ port 22 ซึ่งเป็นพอร์ตมาตรฐาน  ให้ทำการแก้ไขไฟล์ ~/.ssh/config  โดยเพิ่มคำสั่งดังนี้</p>
<pre class="brush: text; gutter: false">Host *hostname.com
     Port 1234</pre>
<h4>อ้างอิง:</h4>
<ol>
<li><a href="http://www.lunix.com.au/blog/install-gitosis-on-centos5/" target="_blank">Howto: Install git, gitosis &amp; gitweb on CentOS 5</a></li>
<li><a href="http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way" target="_blank">Hosting Git repositories, The Easy (and Secure) Way</a></li>
<li><a href="http://www.contentwithstyle.co.uk/content/4-ssh-config-tips-for-faster-remote-working/" target="_blank">4 ssh config tips for faster remote working</a></li>
</ol>
<p>&nbsp;</p>
<img src="http://my.diary.in.th/7c0ab7b1/d155e05f/FeedBurner/1.0 (http://www.FeedBurner.com).gif" /><img src="http://my.diary.in.th/?ak_action=api_record_view&id=572&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mydiaryinth?a=wHAHhEo_PX8:hif367mJK6A: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/wHAHhEo_PX8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://my.diary.in.th/archives/572/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://my.diary.in.th/archives/572</feedburner:origLink></item>
		<item>
		<title>การกำหนดให้ MySQL ใช้ utf-8 เป็นค่า default</title>
		<link>http://feedproxy.google.com/~r/Mydiaryinth/~3/_z9zS5YOoVo/569</link>
		<comments>http://my.diary.in.th/archives/569#comments</comments>
		<pubDate>Sun, 03 Jul 2011 05:50:41 +0000</pubDate>
		<dc:creator>W.p.</dc:creator>
				<category><![CDATA[เรื่องน่าสนใจ]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://my.diary.in.th/my/?p=569</guid>
		<description><![CDATA[<p>การกำหนดให้ MySQL ใช้ utf-8 เป็นค่า default สามารถทำได้โดยการแก้ไข /etc/my.cnf ดังนี้</p> [client] default-character-set=utf8 [mysql] default-character-set=utf8 [mysqld] default-character-set = utf8 collation-server = utf8_unicode_ci init-connect='SET NAMES utf8' character-set-server = utf8]]></description>
			<content:encoded><![CDATA[<p>การกำหนดให้ MySQL ใช้ utf-8 เป็นค่า default สามารถทำได้โดยการแก้ไข /etc/my.cnf ดังนี้</p>
<pre class="brush: text; gutter: false">[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
default-character-set = utf8
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8</pre>
<img src="http://my.diary.in.th/7c0ab7b1/d155e05f/FeedBurner/1.0 (http://www.FeedBurner.com).gif" /><img src="http://my.diary.in.th/?ak_action=api_record_view&id=569&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mydiaryinth?a=_z9zS5YOoVo:e2UB8zyBNzk: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/_z9zS5YOoVo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://my.diary.in.th/archives/569/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://my.diary.in.th/archives/569</feedburner:origLink></item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 2/19 queries in 0.008 seconds using memcached
Object Caching 692/727 objects using memcached

Served from: my.diary.in.th @ 2012-02-10 17:07:54 -->

