<?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>vibol.hou &#187; Snippets</title>
	<atom:link href="http://vibol.hou.cc/category/snippets/feed" rel="self" type="application/rss+xml" />
	<link>http://vibol.hou.cc</link>
	<description>seize the code</description>
	<lastBuildDate>Tue, 06 Sep 2011 09:25:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Uninstalling MacPorts</title>
		<link>http://vibol.hou.cc/uninstalling-macports</link>
		<comments>http://vibol.hou.cc/uninstalling-macports#comments</comments>
		<pubDate>Sat, 19 Sep 2009 23:07:44 +0000</pubDate>
		<dc:creator>vibol</dc:creator>
				<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://vibolhou.com/?p=185</guid>
		<description><![CDATA[<p>Having upgraded to Snow Leopard, I wanted to wipe out my MacPorts installation and start clean. I&#8217;ve had tons of stuff installed and updated from the past (three versions of each port, in fact). Here&#8217;s how to uninstall MacPorts.</p> <p>The first step is to uninstall all the installed ports:</p> 1<br />sudo port -f uninstall installed [...]]]></description>
			<content:encoded><![CDATA[<p>Having upgraded to Snow Leopard, I wanted to wipe out my MacPorts installation and start clean. I&#8217;ve had tons of stuff installed and updated from the past (three versions of each port, in fact). Here&#8217;s how to uninstall MacPorts.</p>
<p>The first step is to uninstall all the installed ports:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo port -f uninstall installed</div></td></tr></tbody></table></div>
<p>Then remove any trace files lingering about:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo rm -rf /opt/local \<br />
/Applications/MacPorts \<br />
/Applications/DarwinPorts \<br />
/Library/Tcl/macports1.0 \<br />
/Library/Tcl/darwinports1.0 \<br />
/Library/LaunchDaemons/org.macports.* \<br />
/Library/StartupItems/DarwinPortsStartup \<br />
/Library/Receipts/MacPorts*.pkg \<br />
/Library/Receipts/DarwinPorts*.pkg \<br />
~/.macports</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://vibol.hou.cc/uninstalling-macports/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three steps to uninstalling MySQL on Mac OS X</title>
		<link>http://vibol.hou.cc/three-steps-to-uninstalling-mysql-on-mac-os-x</link>
		<comments>http://vibol.hou.cc/three-steps-to-uninstalling-mysql-on-mac-os-x#comments</comments>
		<pubDate>Sat, 19 Sep 2009 23:04:55 +0000</pubDate>
		<dc:creator>vibol</dc:creator>
				<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://vibolhou.com/?p=187</guid>
		<description><![CDATA[<p>Here are three simple steps to uninstall the MySQL installation provided by MySQL.com. You should take care with these commands since a typo can obliterate portions of your OS, requiring a reinstall. If you&#8217;re comfortable with shell commands and understand what&#8217;s being done, here are the commands:</p> 1<br />2<br />3<br />sudo rm -rf &#34;/usr/local/mysql*&#34;<br /> [...]]]></description>
			<content:encoded><![CDATA[<p>Here are three simple steps to uninstall the MySQL installation provided by MySQL.com. You should take care with these commands since a typo can obliterate portions of your OS, requiring a reinstall. If you&#8217;re comfortable with shell commands and understand what&#8217;s being done, here are the commands:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo rm -rf &quot;/usr/local/mysql*&quot;<br />
sudo rm -rf &quot;/Library/StartupItems/MySQLCOM/&quot;<br />
Go to System Preferences... &gt; ctrl-click the MySQL icon and remove it.</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://vibol.hou.cc/three-steps-to-uninstalling-mysql-on-mac-os-x/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to find total file size in Linux</title>
		<link>http://vibol.hou.cc/how-to-find-total-file-size-in-linux</link>
		<comments>http://vibol.hou.cc/how-to-find-total-file-size-in-linux#comments</comments>
		<pubDate>Mon, 07 Sep 2009 19:04:23 +0000</pubDate>
		<dc:creator>vibol</dc:creator>
				<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://vibolhou.com/?p=129</guid>
		<description><![CDATA[<p>DOS sums up the sizes of all the files it lists when using the dir command, but Linux ls does not. Here&#8217;s an awk script that will calculate that information.</p> 1<br />ls -la [filenames] &#124; awk '{ sum += $4 } END { print sum }' <p>An easier command (thanks <a href="http://crazytoon.com/">Sunny</a>):</p> 1<br />du -hs [...]]]></description>
			<content:encoded><![CDATA[<p>DOS sums up the sizes of all the files it lists when using the dir command, but Linux ls does not. Here&#8217;s an awk script that will calculate that information.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ls -la [filenames] | awk '{ sum += $4 } END { print sum }'</div></td></tr></tbody></table></div>
<p>An easier command (thanks <a href="http://crazytoon.com/">Sunny</a>):</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">du -hs * --total</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://vibol.hou.cc/how-to-find-total-file-size-in-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mass renaming files in Linux</title>
		<link>http://vibol.hou.cc/mass-renaming-files-in-linux</link>
		<comments>http://vibol.hou.cc/mass-renaming-files-in-linux#comments</comments>
		<pubDate>Thu, 13 Sep 2007 00:35:39 +0000</pubDate>
		<dc:creator>vibol</dc:creator>
				<category><![CDATA[Fleeting Thoughts]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://vibol.hou.cc/2007/09/12/mass-renaming-files-in-linux/</guid>
		<description><![CDATA[1<br />ls -d *.ext &#124; sed 's/\(.*\).ext$/mv &#34;&#38;amp;&#34; &#34;\1.newext&#34;/' &#124; sh <p>Explanation here: <a href="http://6v8.gamboni.org/Mass-renaming-with-linux-shell.html">Mass renaming with Linux shell</a></p>]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container text dawn spip_code" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ls -d *.ext | sed 's/\(.*\).ext$/mv &quot;&amp;amp;&quot; &quot;\1.newext&quot;/' | sh</div></td></tr></tbody></table></div>
<p>Explanation here: <a href="http://6v8.gamboni.org/Mass-renaming-with-linux-shell.html">Mass renaming with Linux shell</a></p>
]]></content:encoded>
			<wfw:commentRss>http://vibol.hou.cc/mass-renaming-files-in-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code folding in VIM 6.0+</title>
		<link>http://vibol.hou.cc/code-folding-in-vim-60</link>
		<comments>http://vibol.hou.cc/code-folding-in-vim-60#comments</comments>
		<pubDate>Thu, 16 Nov 2006 20:44:00 +0000</pubDate>
		<dc:creator>vibol</dc:creator>
				<category><![CDATA[Fleeting Thoughts]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://vibol.hou.cc/2006/11/16/code-folding-in-vim-60/</guid>
		<description><![CDATA[<p>Here&#8217;s a neat little feature I&#8217;ve just been introduced to. After coding in VIM for so many years, one might think I&#8217;d know these things, but as it turns out, there&#8217;s a lot of features in VIM I&#8217;m not using. This one, however, will likely be a time-saver. There are a number of different code [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a neat little feature I&#8217;ve just been introduced to. After coding in VIM for so many years, one might think I&#8217;d know these things, but as it turns out, there&#8217;s a lot of features in VIM I&#8217;m not using. This one, however, will likely be a time-saver. There are a number of different code folding methods available in VIM (:help folding). I use the marker method by including this in my .vimrc file:</p>
<blockquote><p>set foldmethod=marker</p></blockquote>
<p>I can then use the following commands from command mode (not colon mode):</p>
<ul>
<li>At the beginning of a function fragment, you can type &#8216;zfap&#8217; to create a fold; this should add some {{{ }}} tags around your code in the comment of choice for the language you&#8217;re coding in.</li>
<li>You can type &#8216;zo&#8217; to open a fold, or I can just hit the right arrow key on the folded code marker.</li>
<li>You can type &#8216;zc&#8217; to close a fold.</li>
<li>You can type &#8216;zr&#8217; to open all folds.</li>
<li>You can type &#8216;zm&#8217; to close all folds.</li>
</ul>
<p>More commands are available in :help folding.</p>
]]></content:encoded>
			<wfw:commentRss>http://vibol.hou.cc/code-folding-in-vim-60/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Forcing an SSL Redirect in Apache</title>
		<link>http://vibol.hou.cc/forcing-an-ssl-redirect-in-apache</link>
		<comments>http://vibol.hou.cc/forcing-an-ssl-redirect-in-apache#comments</comments>
		<pubDate>Tue, 14 Nov 2006 09:09:23 +0000</pubDate>
		<dc:creator>vibol</dc:creator>
				<category><![CDATA[Fleeting Thoughts]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://vibol.hou.cc/2006/11/14/forcing-an-ssl-redirect-in-apache/</guid>
		<description><![CDATA[<p>If you&#8217;ve ever needed to ensure that users are accessing a folder using SSL, you can use the following mod_rewrite snippet to achieve this:</p> <p>RewriteEngine On<br /> RewriteCond %{HTTPS} off<br /> RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}</p>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever needed to ensure that users are accessing a folder using SSL, you can use the following mod_rewrite snippet to achieve this:</p>
<blockquote><p>RewriteEngine On<br />
RewriteCond %{HTTPS} off<br />
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://vibol.hou.cc/forcing-an-ssl-redirect-in-apache/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ExternalInterface, Internet Explorer and Callbacks</title>
		<link>http://vibol.hou.cc/externalinterface-internet-explorer-and-callbacks</link>
		<comments>http://vibol.hou.cc/externalinterface-internet-explorer-and-callbacks#comments</comments>
		<pubDate>Wed, 16 Aug 2006 22:48:42 +0000</pubDate>
		<dc:creator>vibol</dc:creator>
				<category><![CDATA[Fleeting Thoughts]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://v.hou.cc/2006/08/16/externalinterface-internet-explorer-and-callbacks/</guid>
		<description><![CDATA[<p>Whatever you do, don&#8217;t create callbacks named &#8216;stop&#8217; or &#8216;play&#8217; via:</p> <p>ExternalInterface.addCallback(&#8220;play&#8221;, null, thisFunc);<br /> ExternalInterface.addCallback(&#8220;stop&#8221;, null, thatFunc);</p> <p>Internet Explorer will choke a most horrible script execution error. Having a broken Internet Explorer script debugger didn&#8217;t help much either. Firefox showed no problems with this terminology.</p>]]></description>
			<content:encoded><![CDATA[<p>Whatever you do, don&#8217;t create callbacks named &#8216;stop&#8217; or &#8216;play&#8217; via:</p>
<blockquote><p>ExternalInterface.addCallback(&#8220;play&#8221;, null, thisFunc);<br />
ExternalInterface.addCallback(&#8220;stop&#8221;, null, thatFunc);</p></blockquote>
<p>Internet Explorer will choke a most horrible script execution error. Having a broken Internet Explorer script debugger didn&#8217;t help much either. Firefox showed no problems with this terminology.</p>
]]></content:encoded>
			<wfw:commentRss>http://vibol.hou.cc/externalinterface-internet-explorer-and-callbacks/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rebuild RRDTool when upgrading cPanel&#8217;s Perl</title>
		<link>http://vibol.hou.cc/rebuild-rrdtool-when-upgrading-cpanels-perl</link>
		<comments>http://vibol.hou.cc/rebuild-rrdtool-when-upgrading-cpanels-perl#comments</comments>
		<pubDate>Sat, 10 Jun 2006 22:30:01 +0000</pubDate>
		<dc:creator>vibol</dc:creator>
				<category><![CDATA[Fleeting Thoughts]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://vibol.hou.cc/2006/06/10/rebuild-rrdtool-when-upgrading-cpanels-perl/</guid>
		<description><![CDATA[<p>If you&#8217;ve upgraded Perl in cPanel, you need to make sure you&#8217;ve got an up-to-date build of rrdtool or stats will not run properly on the server. To do this, run:</p> <p>/scripts/rrdtoolinstall</p> <p>If there is no output, you will have to manual edit the file and comment out the version comparison to force the rebuild. [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve upgraded Perl in cPanel, you need to make sure you&#8217;ve got an up-to-date build of rrdtool or stats will not run properly on the server. To do this, run:</p>
<blockquote><p>/scripts/rrdtoolinstall</p></blockquote>
<p>If there is no output, you will have to manual edit the file and comment out the version comparison to force the rebuild.  You have a bad build if the following error occurs when running /scripts/runstatsonce:</p>
<blockquote><p>root@system [~]# /scripts/runstatsonce<br />
This script requires cPanel 6.4.2 Build 11+<br />
/usr/bin/perl: relocation error: /usr/local/cpanel/3rdparty/lib/perl/auto/RRDs/RRDs.so: undefined symbol: Perl_Gthr_key_ptr<br />
/usr/bin/perl: relocation error: /usr/local/cpanel/3rdparty/lib/perl/auto/RRDs/RRDs.so: undefined symbol: Perl_Gthr_key_ptr</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://vibol.hou.cc/rebuild-rrdtool-when-upgrading-cpanels-perl/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

