<?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>A Coder's Life</title>
	<atom:link href="http://coder.kidsreturn.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://coder.kidsreturn.org</link>
	<description>A web developer's life</description>
	<lastBuildDate>Wed, 22 Feb 2012 05:38:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Page Scroller plugin</title>
		<link>http://coder.kidsreturn.org/2012/02/page-scroller-plugin/</link>
		<comments>http://coder.kidsreturn.org/2012/02/page-scroller-plugin/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 05:38:56 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=451</guid>
		<description><![CDATA[http://pagescroller.com/]]></description>
			<content:encoded><![CDATA[<p><a href="http://pagescroller.com/">http://pagescroller.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2012/02/page-scroller-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert MySQL content from one encoding to another</title>
		<link>http://coder.kidsreturn.org/2012/02/convert-mysql-content-from-one-encoding-to-another/</link>
		<comments>http://coder.kidsreturn.org/2012/02/convert-mysql-content-from-one-encoding-to-another/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 04:42:24 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=447</guid>
		<description><![CDATA[This is an example to convert from latin-1 to utf-8. I used this to convert the content of old wordpress mysql database to true utf-8 content.]]></description>
			<content:encoded><![CDATA[<p>This is an example to convert from latin-1 to utf-8. I used this to convert the content of old wordpress mysql database to true utf-8 content.</p>
<pre class="brush: bash; title: ; notranslate">
# Dump the old database in its original encoding (latin1 in this example)
mysqldump --default-character-set=latin1 SOURCE_DATABASE &gt; db.sql

# Replace sql code to reflect new encoding (utf8 in this example)
sed -e 's/SET NAMES latin1/SET NAMES utf8/g' -i db.sql
sed -e 's/CHARSET=latin1/CHARSET=utf8 COLLATE=utf8_unicode_ci/g' -i db.sql

# Import the db.sql into the database (which must be created with the correct new encoding)
mysql --default-character-set=utf8 -u root -p TARGET_DATABASE &lt; db.sql
</pre>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2012/02/convert-mysql-content-from-one-encoding-to-another/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Noty looks good</title>
		<link>http://coder.kidsreturn.org/2012/02/noty-looks-good/</link>
		<comments>http://coder.kidsreturn.org/2012/02/noty-looks-good/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 01:21:34 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=445</guid>
		<description><![CDATA[http://needim.github.com/noty/]]></description>
			<content:encoded><![CDATA[<p><a href="http://needim.github.com/noty/" target="_blank">http://needim.github.com/noty/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2012/02/noty-looks-good/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ACF is awesomeone</title>
		<link>http://coder.kidsreturn.org/2012/02/acf-is-awesomeone/</link>
		<comments>http://coder.kidsreturn.org/2012/02/acf-is-awesomeone/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 13:21:14 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=439</guid>
		<description><![CDATA[http://www.advancedcustomfields.com]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.advancedcustomfields.com">http://www.advancedcustomfields.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2012/02/acf-is-awesomeone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Permanently remove Mac&#8217;s &#8220;Downloaded from Internet&#8221; warning</title>
		<link>http://coder.kidsreturn.org/2012/01/permanently-remove-macs-downloaded-from-internet-warning/</link>
		<comments>http://coder.kidsreturn.org/2012/01/permanently-remove-macs-downloaded-from-internet-warning/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 15:35:21 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=436</guid>
		<description><![CDATA[Of course, you should know what you are doing.]]></description>
			<content:encoded><![CDATA[<pre class="brush: bash; title: ; notranslate">
defaults write com.apple.LaunchServices LSQuarantine -bool NO
</pre>
<p>Of course, you should know what you are doing.</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2012/01/permanently-remove-macs-downloaded-from-internet-warning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache VirtualDocumentRoot for wildcard virtualhosts</title>
		<link>http://coder.kidsreturn.org/2012/01/apache-virtualdocumentroot-for-wildcard-virtualhosts/</link>
		<comments>http://coder.kidsreturn.org/2012/01/apache-virtualdocumentroot-for-wildcard-virtualhosts/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 13:49:38 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=421</guid>
		<description><![CDATA[Now you might run into infinite redirect issue if use together with mod_rewrite. Add this line in the mod_rewrite .htaccess file for each folder under /mnt/projects to stop this. Update: The similar effect can be achieved via mod_rewrite. Put this into /etc/apache2/httpd.conf, or apache2.conf but it needs to be loaded first before virtualhost/conf.d. The point [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: bash; title: ; notranslate">
&lt;VirtualHost *:80&gt;
    UseCanonicalName Off
    VirtualDocumentRoot /mnt/projects/%1/public
    ServerName subdomains.starfall.local
    ServerAlias *.starfall.local
&lt;/VirtualHost&gt;

&lt;Directory /mnt/projects/*/public&gt;
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
&lt;/Directory&gt;
</pre>
<p>Now you might run into infinite redirect issue if use together with mod_rewrite. Add this line in the mod_rewrite .htaccess file for each folder under /mnt/projects to stop this.</p>
<pre class="brush: bash; title: ; notranslate">
RewriteBase /
</pre>
<p>Update:<br />
The similar effect can be achieved via mod_rewrite. Put this into /etc/apache2/httpd.conf,  or apache2.conf but it needs to be loaded first before virtualhost/conf.d. The point here is to let virtualhost config to override this wildcard.</p>
<pre class="brush: bash; title: ; notranslate">
&lt;VirtualHost *:80&gt;
    UseCanonicalName Off
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/icons/
    RewriteCond %{HTTP_HOST} ^(.*)\.starfall.local$
    RewriteRule ^/(.*)$ /mnt/projects/%1/public/$1
&lt;/VirtualHost&gt;
</pre>
<p>You may still need to add &#8220;RewriteBase /&#8221; in case of infinite redirect.</p>
<p>From what I tested this new method handles:<br />
- allow wildcard request to point to /mnt/projects/SUBDOMAIN_NAME/public<br />
- it doesn&#8217;t not interfere with subsequent rewrite rule usually present in .htaccess</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2012/01/apache-virtualdocumentroot-for-wildcard-virtualhosts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Achieve wildcard custom domain via Automatic Proxy Configuration</title>
		<link>http://coder.kidsreturn.org/2012/01/achieve-wildcard-custom-domain-via-automatic-proxy-configuration/</link>
		<comments>http://coder.kidsreturn.org/2012/01/achieve-wildcard-custom-domain-via-automatic-proxy-configuration/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 13:48:29 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=418</guid>
		<description><![CDATA[Update: This method seriously screws up apache server variables, namely, REQUEST_URI and DOCUMENT_ROOT. It is recommmended to only use this pac method when you know you don&#8217;t need correct REQUEST_URI and DOCUMENT_ROOT. This allows to point multiple wildcard domain names (canonical or not) to a particular ip or hostname. First create a Automatic Proxy Configuration [...]]]></description>
			<content:encoded><![CDATA[<p>Update: This method seriously screws up apache server variables, namely, REQUEST_URI and DOCUMENT_ROOT. It is recommmended to only use this pac method when you know you don&#8217;t need correct REQUEST_URI and DOCUMENT_ROOT.</p>
<p>This allows to point multiple wildcard domain names (canonical or not) to a particular ip or hostname.</p>
<p>First create a Automatic Proxy Configuration file say wildcard.pac, which is basically a javascript file:</p>
<pre class="brush: jscript; title: ; notranslate">
function FindProxyForURL(url, host)
{
    if (dnsDomainIs(host, &quot;.customhost.local&quot;)) {
        return &quot;PROXY customhost&quot;;
    }

    return &quot;DIRECT&quot;;
}
</pre>
<p>Note:<br />
&#8220;.customhost.local&#8221; is basically the pattern to detect<br />
The &#8220;customhost&#8221; in &#8220;return &#8220;PROXY customhost&#8221;;&#8221; is whatever solvable hostname you want, or it can be an ip.</p>
<p>You can use this to config multiple local fake domain names for development purpose, pointing them (e.g. project1.myhost.local, project2.myhost.local to an apache server at 192.168.1.2).</p>
<p>Now to load this pac file, each browser/os is slightly different.<br />
Safari/IE/Chrome: use system network setting, just find the Automatic Proxy Configuration and load the pac file just created.<br />
Firefox/Opera: use their own network config in Preferences</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2012/01/achieve-wildcard-custom-domain-via-automatic-proxy-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Config Mac OSX Lion&#8217;s Samba share</title>
		<link>http://coder.kidsreturn.org/2012/01/config-mac-osx-lions-samba-share/</link>
		<comments>http://coder.kidsreturn.org/2012/01/config-mac-osx-lions-samba-share/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 13:30:31 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=416</guid>
		<description><![CDATA[smb.conf no longer work. The actual configuration is stored at /System/Library/LaunchDaemons/com.apple.smbd.plist To make Lion&#8217;s samba share follow symbolic link, you need to modify &#8220;ProgramArguments&#8221; from: to:]]></description>
			<content:encoded><![CDATA[<p>smb.conf no longer work. The actual configuration is stored at /System/Library/LaunchDaemons/com.apple.smbd.plist</p>
<p>To make Lion&#8217;s samba share follow symbolic link, you need to modify &#8220;ProgramArguments&#8221;<br />
from:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
     &lt;string&gt;/usr/sbin/smbd&lt;/string&gt;
&lt;/array&gt;
&lt;/code&gt;
</pre>
<p>to:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
     &lt;string&gt;/usr/sbin/smbd&lt;/string&gt;
     &lt;string&gt;--no-symlinks&lt;/string&gt;
     &lt;string&gt;false&lt;/string&gt;
&lt;/array&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2012/01/config-mac-osx-lions-samba-share/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vimrc smart indent and tab with 4 spaces</title>
		<link>http://coder.kidsreturn.org/2012/01/vimrc-smart-indent-and-tab-with-4-spaces/</link>
		<comments>http://coder.kidsreturn.org/2012/01/vimrc-smart-indent-and-tab-with-4-spaces/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 10:41:34 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=407</guid>
		<description><![CDATA[set smartindent set tabstop=4 set shiftwidth=4 set expandtab ts=4 sw=4 ai]]></description>
			<content:encoded><![CDATA[<p>set smartindent<br />
set tabstop=4<br />
set shiftwidth=4<br />
set expandtab ts=4 sw=4 ai</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2012/01/vimrc-smart-indent-and-tab-with-4-spaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Push local git repo to a remote server</title>
		<link>http://coder.kidsreturn.org/2012/01/push-local-git-repo-to-a-remote-server/</link>
		<comments>http://coder.kidsreturn.org/2012/01/push-local-git-repo-to-a-remote-server/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 13:30:45 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=403</guid>
		<description><![CDATA[So this is how to put local repository onto a remote &#8220;central&#8221; version control repository: On remote server (note the &#8220;&#8211;bare&#8221; is important otherwise you won&#8217;t be able to push): On local, cd into the local repo directory first In future you can just clone:]]></description>
			<content:encoded><![CDATA[<p>So this is how to put local repository onto a remote &#8220;central&#8221; version control repository:</p>
<p>On remote server (note the &#8220;&#8211;bare&#8221; is important otherwise you won&#8217;t be able to push):</p>
<pre class="brush: bash; title: ; notranslate">
mkdir /home/vincent/projects/repo.git
cd /home/vincent/projects/repo.git/
git init --bare
</pre>
<p>On local, cd into the local repo directory first</p>
<pre class="brush: bash; title: ; notranslate">
git remote add origin ssh://username@remoteserver/home/vincent/projects/repo.git
git push origin master
</pre>
<p>In future you can just clone:</p>
<pre class="brush: bash; title: ; notranslate">
git clone ssh://username@remoteserver/home/vincent/projects/repo.git
</pre>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2012/01/push-local-git-repo-to-a-remote-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Performance Tips</title>
		<link>http://coder.kidsreturn.org/2011/12/jquery-performance-tips/</link>
		<comments>http://coder.kidsreturn.org/2011/12/jquery-performance-tips/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 01:28:54 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=396</guid>
		<description><![CDATA[http://dumitruglavan.com/jquery-performance-tips-cheat-sheet/ Some notes from reddit: #6 There is little to no performance difference between a cached selector and chaining. The ONLY difference would be shorter code (less bandwidth used?). #9 This is just plain wrong. DOM manipulation can be extremely fast if you know what you are doing. He uses this example The faster way [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://dumitruglavan.com/jquery-performance-tips-cheat-sheet/">http://dumitruglavan.com/jquery-performance-tips-cheat-sheet/</a></p>
<p>Some notes from reddit:</p>
<p>#6 There is little to no performance difference between a cached selector and chaining. The ONLY difference would be shorter code (less bandwidth used?).</p>
<p>#9 This is just plain wrong. DOM manipulation can be extremely fast if you know what you are doing. He uses this example</p>
<p>The faster way to do this would be</p>
<pre class="brush: jscript; title: ; notranslate">
frag = $('&lt;ul id=&quot;menu&quot;&gt;&lt;/ul&gt;');
listItem = $('&lt;li&gt;&lt;/li&gt;')
for (var i = 1; i &lt; 100; i++) {
  frag.append(listItem.clone().text(i));
}
$('#header').prepend(frag);
</pre>
<p>#14 Use jQueryâ€™s utility functions<br />
&#8220;.each(), for example, relies on anonymous function calls. This can be REALLY slow&#8221;</p>
<p>#15 not really much of a performance tip<br />
#16 is REALLY finicky and hard to profile.</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2011/12/jquery-performance-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git deploy script</title>
		<link>http://coder.kidsreturn.org/2011/11/git-deploy-script/</link>
		<comments>http://coder.kidsreturn.org/2011/11/git-deploy-script/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 03:52:33 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=389</guid>
		<description><![CDATA[The script grab new files (after &#8220;git add&#8221;) and modified files and copy them to a new directory &#8220;deploy&#8221;. Or, use this to create the deploy folder for commits done in the last 2 days: (the code may generate some error output saying certain files don&#8217;t exist, because it&#8217;s trying to copy the files you [...]]]></description>
			<content:encoded><![CDATA[<p>The script grab new files (after &#8220;git add&#8221;) and modified files and copy them to a new directory &#8220;deploy&#8221;.</p>
<pre class="brush: bash; title: ; notranslate">
git status | grep &quot;modified\|new file&quot; | awk '{print $3}' | while read file; do mkdir -p `dirname deploy/&quot;$file&quot;`; cp $file deploy/$file; done
</pre>
<p>Or, use this to create the deploy folder for commits done in the last 2 days: (the code may generate some error output saying certain files don&#8217;t exist, because it&#8217;s trying to copy the files you deleted in commits, they are harmless just too lazy to put check in)</p>
<pre class="brush: bash; title: ; notranslate">
git whatchanged --since &quot;2 days ago&quot; | grep ^: | awk '{print $6}' | sort | uniq -c | awk '{print $2}' | while read file; do mkdir -p `dirname deploy/&quot;$file&quot;`; cp $file deploy/$file; done
</pre>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2011/11/git-deploy-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two interesting jQuery plugins</title>
		<link>http://coder.kidsreturn.org/2011/11/two-interesting-jquery-plugins/</link>
		<comments>http://coder.kidsreturn.org/2011/11/two-interesting-jquery-plugins/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 00:33:39 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=385</guid>
		<description><![CDATA[jScrollPane ColorBox]]></description>
			<content:encoded><![CDATA[<p><a href="http://jscrollpane.kelvinluck.com/" target="_blank">jScrollPane</a></p>
<p><a href="http://jacklmoore.com/colorbox/" target="_blank">ColorBox</a></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2011/11/two-interesting-jquery-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Highcharts</title>
		<link>http://coder.kidsreturn.org/2011/11/highcharts/</link>
		<comments>http://coder.kidsreturn.org/2011/11/highcharts/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 03:04:53 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=380</guid>
		<description><![CDATA[http://www.highcharts.com/]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.highcharts.com/" target="_blank">http://www.highcharts.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2011/11/highcharts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to time machine</title>
		<link>http://coder.kidsreturn.org/2011/11/how-to-time-machine/</link>
		<comments>http://coder.kidsreturn.org/2011/11/how-to-time-machine/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 13:26:10 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=378</guid>
		<description><![CDATA[http://blog.interlinked.org/tutorials/rsync_time_machine.html]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.interlinked.org/tutorials/rsync_time_machine.html" target="_blank">http://blog.interlinked.org/tutorials/rsync_time_machine.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2011/11/how-to-time-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django production server</title>
		<link>http://coder.kidsreturn.org/2011/11/django-production-server/</link>
		<comments>http://coder.kidsreturn.org/2011/11/django-production-server/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 01:49:39 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=368</guid>
		<description><![CDATA[Install Virtualhost WSGI script]]></description>
			<content:encoded><![CDATA[<p>Install</p>
<pre class="brush: bash; title: ; notranslate">
sudo apt-get install python-django libapache2-mod-wsgi python-mysqldb python-setuptools
</pre>
<p>Virtualhost</p>
<pre class="brush: bash; title: ; notranslate">
&lt;VirtualHost *:80&gt;
ServerName tang.local
WSGIDaemonProcess snake display-name=%{GROUP}
WSGIProcessGroup snake
WSGIScriptAlias / /mnt/host/snake/apache/django.wsgi

Alias /static  /mnt/host/snake/static
&lt;/VirtualHost&gt;
</pre>
<p>WSGI script</p>
<pre class="brush: bash; title: ; notranslate">
import os
import sys
sys.path.append('/mnt/host')
sys.path.append('/mnt/host/snake')
os.environ['DJANGO_SETTINGS_MODULE'] = 'snake.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2011/11/django-production-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sftp upload with lftp/mirror</title>
		<link>http://coder.kidsreturn.org/2011/11/sftp-upload-with-lftpmirror/</link>
		<comments>http://coder.kidsreturn.org/2011/11/sftp-upload-with-lftpmirror/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 23:52:14 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=365</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: bash; title: ; notranslate">
lftp -c &quot;open -u USERNAME,PASSWORD sftp://REMOTE_HOST/PATH/TO/ ; mirror -R /LOCAL/PATH/TO/.&quot;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2011/11/sftp-upload-with-lftpmirror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate git change log</title>
		<link>http://coder.kidsreturn.org/2011/10/generate-git-change-log/</link>
		<comments>http://coder.kidsreturn.org/2011/10/generate-git-change-log/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 00:00:01 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=361</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: bash; title: ; notranslate">
git whatchanged --since &quot;2 month ago&quot; | grep ^: | awk '{print $6}' | sort | uniq -c | awk '{print $2}' &gt; change.log
</pre>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2011/10/generate-git-change-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mount samba share on Mac Lion</title>
		<link>http://coder.kidsreturn.org/2011/10/mount-samba-share-on-mac-lion/</link>
		<comments>http://coder.kidsreturn.org/2011/10/mount-samba-share-on-mac-lion/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 05:00:36 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=317</guid>
		<description><![CDATA[Note: only need sec=ntlmssp for Mac]]></description>
			<content:encoded><![CDATA[<pre class="brush: bash; title: ; notranslate">
mount.cifs //griffith/vincent/Projects /mnt/projects -o user=vincent,password=1234,nounix,noserverino,sec=ntlmssp,uid=33,gid=1001,file_mode=0664,dir_mode=0775
</pre>
<p>Note: only need sec=ntlmssp for Mac</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2011/10/mount-samba-share-on-mac-lion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>phpMyAdmin config.inc.php</title>
		<link>http://coder.kidsreturn.org/2011/10/phpmyadmin-config-inc-php/</link>
		<comments>http://coder.kidsreturn.org/2011/10/phpmyadmin-config-inc-php/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 09:48:33 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://coder.kidsreturn.org/?p=310</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: php; title: ; notranslate">
&lt;?php

// Load secret generated on postinst
include('/var/lib/phpmyadmin/blowfish_secret.inc.php');

// Load autoconf local config
include('/var/lib/phpmyadmin/config.inc.php');

$i = 0;
$i++;

if (is_readable('/etc/phpmyadmin/config-db.php')) {
    require('/etc/phpmyadmin/config-db.php');
} else {
    error_log('phpmyadmin: Failed to load /etc/phpmyadmin/config-db.php.'
        . ' Check group www-data has read access.');
}

if (!empty($dbname)) {
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    if (empty($dbserver)) $dbserver = 'localhost';
    $cfg['Servers'][$i]['host'] = $dbserver;

    if (!empty($dbport) || $dbserver != 'localhost') {
        $cfg['Servers'][$i]['connect_type'] = 'tcp';
        $cfg['Servers'][$i]['port'] = $dbport;
    }
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['controluser'] = $dbuser;
    $cfg['Servers'][$i]['controlpass'] = $dbpass;
    $cfg['Servers'][$i]['pmadb'] = $dbname;
    $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
    $cfg['Servers'][$i]['relation'] = 'pma_relation';
    $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
    $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
    $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
    $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
    $cfg['Servers'][$i]['history'] = 'pma_history';
    $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
    $cfg['Servers'][$i]['tracking'] = 'pma_tracking';
    $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
    $cfg['Servers'][$i]['hide_db'] = '^information_schema|mysql|phpmyadmin$';
    $cfg['Servers'][$i]['AllowNoPassword'] = true;
    $cfg['Servers'][$i]['CountTables'] = true;

    $i++;
}

$cfg['DefaultLang'] = 'en';
$cfg['DisplayDatabasesList'] = 1;
$cfg['ServerDefault'] = 1;
$cfg['GZipDump'] = false;
$cfg['BZipDump'] = false;
$cfg['AllowUserDropDatabase'] = true;
$cfg['AllowArbitraryServer'] = true;
$cfg['LoginCookieValidity'] = 60000;
$cfg['LeftFrameDBSeparator'] = '';
$cfg['LeftDisplayTableFilterMinimum'] = 100;
$cfg['UserprefsDisallow'] = array('LeftFrameDBSeparator');
$cfg['ShowPhpInfo'] = true;
$cfg['ShowAll'] = true;
$cfg['MaxRows'] = 100;
$cfg['Order'] = 'ASC';
$cfg['LimitChars'] = 30;
$cfg['PropertiesIconic'] = true;
$cfg['Import']['charset'] = 'utf-8';
$cfg['Import']['ods_col_names'] = true;
$cfg['Export']['quick_export_onserver'] = true;
$cfg['Export']['quick_export_onserver_overwrite'] = true;
$cfg['Export']['charset'] = 'utf-8';
$cfg['Export']['sql_include_comments'] = false;
$cfg['Export']['sql_drop_table'] = true;
$cfg['Export']['sql_utc_time'] = false;
$cfg['Export']['csv_columns'] = true;
$cfg['Export']['excel_columns'] = true;
$cfg['Export']['htmlword_columns'] = true;
$cfg['Export']['ods_columns'] = true;
$cfg['Export']['texytext_columns'] = true;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://coder.kidsreturn.org/2011/10/phpmyadmin-config-inc-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

