<?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>aBinaryMind &#187; Tips</title>
	<atom:link href="http://www.abinarymind.com/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abinarymind.com</link>
	<description>Some thoughts, some info, some rants</description>
	<lastBuildDate>Wed, 30 Jun 2010 15:36:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Automatic virtual host with Apache</title>
		<link>http://www.abinarymind.com/2009/10/automatic-virtual-host-with-apache/</link>
		<comments>http://www.abinarymind.com/2009/10/automatic-virtual-host-with-apache/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 04:35:02 +0000</pubDate>
		<dc:creator>lexhung</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[virtualhost]]></category>

		<guid isPermaLink="false">http://www.abinarymind.com/?p=95</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>When developing with CakePHP, we can setup Apache to automatically redirect a domain to a specific CakePHP application.</p>
<p>We can set computer&#8217;s aliases using <a href="http://en.wikipedia.org/wiki/Hosts_file">hosts file</a>. Apache will automatically map aliases to different DocumentRoot:</p>
<p><strong>app1.mybox.com</strong> -&gt; /var/www/cakephp/<strong>app1.mybox.com</strong>/webroot<br />
<strong>app2.somewhere.com</strong> -&gt; /var/www/cakephp/<strong>app2.somewhere.com</strong>/webroot</p>
<p><strong>Step 1:</strong> Enable the mod_vhost_alias:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo a2enmod vhost_alias</div></div>
<p><strong>Step 2:</strong> Replace the DocumentRoot statement in <em>default</em> virtualhost configuration file with two lines:</p>
<div class="codecolorer-container apache default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00007f;">UseCanonicalName</span> &nbsp; &nbsp;<span style="color: #0000ff;">Off</span><br />
<span style="color: #00007f;">VirtualDocumentRoot</span> /var/www/cakephp/%0/webroot</div></div>
<p>(If you use a different virtualhost, make sure that you&#8217;re editing the right configuration file)</p>
<p><strong>Step 3:</strong> However, the mod_rewrite doesn&#8217;t play nice with mod_vhost_alias. We need to edit the .htaccess file in {APP}/webroot folder.</p>
<div class="codecolorer-container apache default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">On</span><br />
&nbsp; &nbsp; <span style="color: #00007f;">RewriteBase</span> / &nbsp; <span style="color: #adadad; font-style: italic;"># &lt;&lt; Add this line</span><br />
&nbsp; &nbsp; <span style="color: #00007f;">RewriteCond</span> %{REQUEST_FILENAME} !-d</div></div>
<p><strong>Step 4:</strong> Restart Apache.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo service apache2 restart</div></div>
<p>Below is my default virtual host configuration for your reference:</p>
<div class="codecolorer-container apache default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">80</span>&gt;<br />
&nbsp; &nbsp; <span style="color: #00007f;">ServerAdmin</span> webmaster@localhost<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00007f;">UseCanonicalName</span> <span style="color: #0000ff;">Off</span><br />
&nbsp; &nbsp; <span style="color: #00007f;">VirtualDocumentRoot</span> /var/www/cakephp/%0/webroot<br />
<br />
&nbsp; &nbsp; &lt;<span style="color: #000000; font-weight:bold;">Directory</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00007f;">Options</span> <span style="color: #0000ff;">FollowSymLinks</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">All</span><br />
&nbsp; &nbsp; &lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;<br />
<br />
&nbsp; &nbsp; <span style="color: #00007f;">ErrorLog</span> /var/log/apache2/error.log<br />
<br />
&nbsp; &nbsp; <span style="color: #adadad; font-style: italic;"># Possible values include: debug, info, notice, warn, error, crit,</span><br />
&nbsp; &nbsp; <span style="color: #adadad; font-style: italic;"># alert, emerg.</span><br />
&nbsp; &nbsp; <span style="color: #00007f;">LogLevel</span> warn<br />
<br />
&nbsp; &nbsp; <span style="color: #00007f;">CustomLog</span> /var/log/apache2/access.log combined<br />
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.abinarymind.com/2009/10/automatic-virtual-host-with-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to prevent a package from being updated in Ubuntu</title>
		<link>http://www.abinarymind.com/2009/06/how-to-prevent-a-package-from-being-updated-in-ubuntu/</link>
		<comments>http://www.abinarymind.com/2009/06/how-to-prevent-a-package-from-being-updated-in-ubuntu/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 00:04:52 +0000</pubDate>
		<dc:creator>lexhung</dc:creator>
				<category><![CDATA[Bookmarks]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.abinarymind.com/?p=46</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>If you want to update all the packages other than one package in your Ubuntu system follow this procedure</p>
<p>There are three ways of holding back packages, with dpkg, aptitude or with dselect.</p>
<p>Using dpkg</p>
<p>Put a package on hold</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo echo “package hold” | dpkg --set-selections</div></div>
<p>Example</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo echo “apache2 hold” | dpkg --set-selections</div></div>
<p>Remove the hold</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo echo “package install” | dpkg --set-selections</div></div>
<p>Example</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo echo “apache2 install” | dpkg --set-selections</div></div>
<p>Knowing the status of your packages</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo dpkg --set-selections</div></div>
<p>Using aptitude</p>
<p>With aptitude, you can hold a package using</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo aptitude hold package_name</div></div>
<p>Example</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo aptitude hold apache2</div></div>
<p>and remove the hold with</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo aptitude unhold package_name</div></div>
<p>Example</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo aptitude unhold apache2</div></div>
<p>Using dselect</p>
<p>With dselect, you just have to enter the [S]elect screen, find the package you wish to hold in its present state, and press the `=’ key (or `H’). The changes will go live immediately after you exit the [S]elect screen.</p>
<p>via <a href="http://www.ubuntugeek.com/how-to-prevent-a-package-from-being-updated-in-ubuntu.html">How to prevent a package from being updated in Ubuntu | Ubuntu Geek</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abinarymind.com/2009/06/how-to-prevent-a-package-from-being-updated-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Viết blog bằng Google Docs</title>
		<link>http://www.abinarymind.com/2009/06/viet-blog-bang-google-docs/</link>
		<comments>http://www.abinarymind.com/2009/06/viet-blog-bang-google-docs/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 13:49:55 +0000</pubDate>
		<dc:creator>lexhung</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Application]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[google docs]]></category>
		<category><![CDATA[web application]]></category>

		<guid isPermaLink="false">http://wwww.abinarymind.com/?p=4</guid>
		<description><![CDATA[Google Docs cung cấp khả năng gửi bài lên nhiều hệ thống quản trị nội dung khác nhau sử dụng giao thức XMLRPC. Cách cấu hình dịch vụ này khá đơn giản -- tuy nhiên không phải lúc nào cũng làm việc tốt, đặc biệt khi bạn sử dụng một server của riêng mình (phải chấp nhận thôi, free stuff mà :D).]]></description>
			<content:encoded><![CDATA[<p>[Bài này tôi viết đã lâu.  Cách làm này không thực sự giúp ích được nhiều.]</p>
<p>Trước đây tôi vẫn thường soạn thảo các bài viết trực tiếp bằng HTML <img style="margin: 0pt; width: 24px; height: 18px;" src="http://docs.google.com/File?id=ddh6zvrc_108g5sc8cd2" alt="" />hoặc sử dụng một <a id="ayau" title="Drupal TinyMCE Module" href="http://drupal.org/project/tinymce">richtext editor</a> được nhúng sẵn trong Drupal. Tuy nhiên việc cắm thêm richtext editor khá bất tiện vì việc thêm module này làm trang web nặng lên đáng kể, cấu hình để chèn hình ảnh rất rối rắm, đó là chưa kể đến cả đống lỗi Javascripts có thể xuất hiện bất kỳ lúc nào. Vậy thì tại sao chúng ta lại phải sử dụng cách đó trong khi có sẵn một món &#8220;hàng hiệu&#8221; rất tốt.</p>
<p>Đó chính là <a id="ch-9" title="Google Docs" href="http://docs.google.com">Google Docs</a>.</p>
<p>Google Docs cung cấp khả năng gửi bài lên nhiều hệ thống quản trị nội dung khác nhau sử dụng giao thức <a id="ha_8" title="XMLRPC Home page" href="http://www.xmlrpc.com/">XMLRPC</a>. Cách cấu hình dịch vụ này khá đơn giản &#8212; tuy nhiên không phải lúc nào cũng làm việc tốt, đặc biệt khi bạn sử dụng một server của riêng mình (phải chấp nhận thôi, free stuff mà <img src='http://www.abinarymind.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ).</p>
<p>Việc đầu tiên bạn cần làm là mở <a id="ch-9" title="Google Docs" href="http://docs.google.com">Google Docs</a>, tạo một tài liệu mới, soạn nội dung. Sau đó chọn Publish.</p>
<div id="qj-k" style="text-align: left;"><a rel="lightbox-gdocs" href="http://docs.google.com/File?id=ddh6zvrc_110f2grzvsr" target="_blank"><img class="figure_border" title="Soạn thảo bằng Google Docs" src="http://docs.google.com/File?id=ddh6zvrc_110f2grzvsr" alt="Soạn thảo bằng GDocs" width="425" height="250" /></a></div>
<p>GDocs sẽ đưa ra form để bạn xuất bản tài liệu. Bạn có thể xuất bản tài liệu dưới một địa chỉ web (được sinh ra bởi GDocs) để người khác có thể xem hoặc gửi lên blog của mình.</p>
<div id="cu7:" style="text-align: left;"><img class="figure_border" title="Publish document" src="http://docs.google.com/File?id=ddh6zvrc_111cdtgqzd7" alt="" width="426" height="307" /></div>
<p>Nếu bạn chưa thiết đặt các thông số để gửi lên blog thì khi bạn click vào nút &#8220;Post to blog&#8221; hoặc link &#8220;set your blog site settings&#8221; cửa sổ cấu hình blog sẽ mở ra.</p>
<div id="vwcz" style="text-align: left;">
<div id="m-r0" style="text-align: left;"><a title="Publish settings" rel="lightbox-gdocs" href="http://docs.google.com/File?id=ddh6zvrc_113cfmq2dd6" target="_blank"><img class="figure_border" title="Publish settings" src="http://docs.google.com/File?id=ddh6zvrc_113cfmq2dd6" alt="" width="425" height="321" /></a></div>
</div>
<p>Chọn nhà cung cấp dịch vụ của bạn, gõ username/password. Nhấn nút &#8220;Test&#8221; để kiểm tra. Nhấn OK. Rất tiếc Google Docs không hỗ trợ Yahoo! 360 &#8212; nhà cung cấp blog phổ biến nhất VN. Nhưng tôi nghĩ, lỗi nằm ở phía Yahoo khi cung cấp dịch vụ Y!360 với chất lượng rất chi là <a id="ujvv" title="Những hạn chế của Y!360" href="http://www1.thanhnien.com.vn/CNTT/2007/10/15/212467.tno">beta</a> và không cung cấp API XMLRPC.</p>
<p>Click &#8220;Post to blog&#8221; để gửi bài của bạn lên blog. Một khi bài của bạn đã được gửi đi, bạn có thể cập nhật hoặc xóa bài viết đó trên blog của mình thông qua trang Publish.</p>
<div id="ite5" style="text-align: left;"><img class="figure_border" style="width: 371px; height: 162px;" title="Xuất bản tài liệu" src="http://docs.google.com/File?id=ddh6zvrc_114gwwrkccd" alt="Xuất bản tài liệu" width="371" height="162" /></div>
<p>Nếu như bạn sử dụng một hệ thống quản trị nội dung khác, không được cung cấp bởi các nhà cung cấp được hỗ trợ thì bạn có thể chọn option &#8220;My own server/custom&#8221;. Dưới đây là các thông số để tôi cấu hình trang Sandb0x.net. Bạn có thể tham khảo thông số để cấu hình các hệ quản trị nội dung khác tại <a id="bh3o" title="Bảng thông số để cấu hình các hệ quản trị nội dung khác">đây</a>.</p>
<div class="wp-caption alignnone" style="width: 435px"><a title="Thông tin đăng nhập" rel="lightbox-gdocs" href="http://docs.google.com/File?id=ddh6zvrc_112dj6hv9hf" target="_blank"><img class="figure_border" title="Authentication information" src="http://docs.google.com/File?id=ddh6zvrc_112dj6hv9hf" alt="" width="425" height="326" /></a><p class="wp-caption-text">Thông tin đăng nhập</p></div>
<p>Tuy nhiên, khi cấu hình với Drupal thì tôi phát hiện ra rằng sử dụng MovableType API (như trong bảng thông số ở trên) sẽ khiến Google Docs gửi/cập nhật bài viết của tôi không chính xác. Cụ thể là phần title sẽ chứa nội dung, còn phần nội dung thì không có gì. Sau vài thử nghiệm thì tôi thấy Google Docs sẽ làm việc tốt với Drupal thông qua MetaWeblog API.</p>
<p>Tóm lại, Google Docs sẽ đem lại cho bạn những lợi ích:</p>
<ul>
<li> Cung cấp cho bạn một editor hoàn chỉnh và cực kỳ ổn định.</li>
<li> Bạn luôn có một bản copy các hình ảnh/tài liệu của mình được lưu trữ trên     hệt thống máy chủ của Google &#8212; Một trong những hệ thống dữ liệu lớn nhất và     an toàn nhất.</li>
<li> Bạn có thể xuất tài liệu ra nhiều định dạng khác nhau : Word, PDF, HTML,     OpenOffice &#8230;</li>
<li> Bạn không phải bận tâm với việc lưu lại tài liệu trong trường hợp bị rớt     mạng, mất điện, browser crash &#8230; vì Google Docs sẽ tự động lưu lại những     thay đổi của bạn sau một khoảng thời gian nhất định.</li>
</ul>
<p>Really cool, isn&#8217;t it? <img src="http://docs.google.com/File?id=ddh6zvrc_115dmqj6w3q" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.abinarymind.com/2009/06/viet-blog-bang-google-docs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
