<?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>Think Your Mind</title>
	<atom:link href="http://karyleong.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://karyleong.net</link>
	<description>Think of what to write on it now! Knowledge is accumulated bit by bit.</description>
	<lastBuildDate>Thu, 02 Feb 2012 09:33:03 +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>How to run mysql query in shell script</title>
		<link>http://karyleong.net/?p=144</link>
		<comments>http://karyleong.net/?p=144#comments</comments>
		<pubDate>Thu, 02 Feb 2012 09:27:33 +0000</pubDate>
		<dc:creator>kary</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://karyleong.net/?p=144</guid>
		<description><![CDATA[Following script can select data from MySQL and save to CSV. $mysql_bin -u xxx -pxxx dbname]]></description>
			<content:encoded><![CDATA[<p>Following script can select data from MySQL and save to CSV.</p>
<p><code>$mysql_bin -u xxx -pxxx dbname << EOFMYSQL<br />
SELECT *<br />
	INTO OUTFILE '/tmp/result.csv'<br />
	FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'<br />
	ESCAPED BY ‘\\’<br />
	LINES TERMINATED BY '\n'<br />
	FROM table;<br />
EOFMYSQL</code></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fkaryleong.net%2F%3Fp%3D144&amp;title=How%20to%20run%20mysql%20query%20in%20shell%20script" id="wpa2a_2"><img src="http://karyleong.net/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://karyleong.net/?feed=rss2&#038;p=144</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH tunneling for proxy</title>
		<link>http://karyleong.net/?p=134</link>
		<comments>http://karyleong.net/?p=134#comments</comments>
		<pubDate>Tue, 01 Nov 2011 08:14:13 +0000</pubDate>
		<dc:creator>kary</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://karyleong.net/?p=134</guid>
		<description><![CDATA[ssh -f user@personal-server.com -L 2000:personal-server.com:25 -N The -f tells ssh to go into the background just before it executes the command. This is followed by the username and server you are logging into. The -L 2000:personal-server.com:25 is in the form of -L local-port:host:remote-port. Finally the -N instructs OpenSSH to not execute a command on the [...]]]></description>
			<content:encoded><![CDATA[<p>ssh -f user@personal-server.com -L 2000:personal-server.com:25 -N</p>
<p>The -f tells ssh to go into the background just before it executes the command. This is followed by the username and server you are logging into. The -L 2000:personal-server.com:25 is in the form of -L local-port:host:remote-port. Finally the -N instructs OpenSSH to not execute a command on the remote system.</p>
<p>This essentially forwards the local port 2000 to port 25 on personal-server.com over, with nice benefit of being encrypted. I then simply point my E-mail client to use localhost:2000 as the SMTP server and we&#8217;re off to the races.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fkaryleong.net%2F%3Fp%3D134&amp;title=SSH%20tunneling%20for%20proxy" id="wpa2a_4"><img src="http://karyleong.net/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://karyleong.net/?feed=rss2&#038;p=134</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Self Sign Multiple Domain Cert</title>
		<link>http://karyleong.net/?p=135</link>
		<comments>http://karyleong.net/?p=135#comments</comments>
		<pubDate>Tue, 27 Sep 2011 02:06:21 +0000</pubDate>
		<dc:creator>kary</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://karyleong.net/?p=135</guid>
		<description><![CDATA[1. create the CA cert openssl genrsa -des3 -out ca.key 4096 openssl req -new -x509 -days 365 -key ca.key -out ca.crt 2. create client req csr openssl genrsa -des3 -out server.key 2048 *edit the openssl.conf uncomment &#8220;req_extensions = v3_req&#8221; in [ v3_req ] add subjectAltName = @alt_names add the end of the file [ alt_names ] [...]]]></description>
			<content:encoded><![CDATA[<p>1. create the CA cert</p>
<p>openssl genrsa -des3 -out ca.key 4096<br />
openssl req -new -x509 -days 365 -key ca.key -out ca.crt</p>
<p>2. create client req csr</p>
<p>openssl genrsa -des3 -out server.key 2048</p>
<p>*edit the openssl.conf</p>
<blockquote><p>uncomment &#8220;req_extensions = v3_req&#8221;</p>
<p>in [ v3_req ] add</p>
<p>subjectAltName = @alt_names</p>
<p>add the end of the file</p>
<pre>[ alt_names ]
DNS.1 = test.domain.com
DNS.2 = www1.domain.com</pre>
</blockquote>
<p>openssl req -new -key server.key -out server.csr</p>
<p>*create a config file &#8220;server.conf&#8221;</p>
<blockquote><p>subjectAltName = @alt_names</p>
<p><span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">[ alt_names ]</span></p>
<pre>DNS.1 = test.domain.com
DNS.2 = www1.domain.com</pre>
</blockquote>
<pre>openssl x509 -req -days 365 -in server.csr -CA ca.crt  -CAkey ca.key -set_serial 01 -extfile server.conf -out server.crt</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fkaryleong.net%2F%3Fp%3D135&amp;title=Self%20Sign%20Multiple%20Domain%20Cert" id="wpa2a_6"><img src="http://karyleong.net/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://karyleong.net/?feed=rss2&#038;p=135</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony 2 can&#8217;t not write cache files</title>
		<link>http://karyleong.net/?p=132</link>
		<comments>http://karyleong.net/?p=132#comments</comments>
		<pubDate>Mon, 26 Sep 2011 01:18:32 +0000</pubDate>
		<dc:creator>kary</dc:creator>
				<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://karyleong.net/?p=132</guid>
		<description><![CDATA[1. Using ACL on a system that supports chmod +a Many systems allow you to use the &#8220;chmod +a&#8221; command. Try this first, and if you get an error &#8211; try the next method: rm -rf app/cache/* rm -rf app/logs/* sudo chmod +a &#8221;www-data allow delete,write,append,file_inherit,directory_inherit&#8221; app/cache app/logs sudo chmod +a &#8221;yourname allow delete,write,append,file_inherit,directory_inherit&#8221; app/cache app/logs 2. Using Acl on a system that does not support chmod [...]]]></description>
			<content:encoded><![CDATA[<h3>1. Using ACL on a system that supports chmod +a</h3>
<p>Many systems allow you to use the &#8220;chmod +a&#8221; command. Try this first, and if you get an error &#8211; try the next method:</p>
<div>
<div>
<div>
<div>
<div>rm -rf app/cache/*<br />
rm -rf app/logs/*</p>
<p>sudo chmod +a &#8221;www-data allow delete,write,append,file_inherit,directory_inherit&#8221; app/cache app/logs<br />
sudo chmod +a &#8221;yourname allow delete,write,append,file_inherit,directory_inherit&#8221; app/cache app/logs</p></div>
</div>
</div>
</div>
</div>
<h3>2. Using Acl on a system that does not support chmod +a</h3>
<p>Some systems don&#8217;t support &#8220;chmod +a&#8221;, but do support another utility called &#8220;setfacl&#8221;. You may need to <a href="https://help.ubuntu.com/community/FilePermissions#ACLs">enable ACL support</a> on your partition and install &#8220;setfacl &#8220;before using it (as is the case with Ubuntu), like so:</p>
<div>
<div>
<div>
<div>
<div>sudo setfacl -R -m u:www-data:rwx -m u:yourname:rwx app/cache app/logs<br />
sudo setfacl -dR -m u:www-data:rwx -m u:yourname:rwx app/cache app/logs</div>
</div>
</div>
</div>
</div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fkaryleong.net%2F%3Fp%3D132&amp;title=Symfony%202%20can%26%238217%3Bt%20not%20write%20cache%20files" id="wpa2a_8"><img src="http://karyleong.net/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://karyleong.net/?feed=rss2&#038;p=132</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git notes</title>
		<link>http://karyleong.net/?p=128</link>
		<comments>http://karyleong.net/?p=128#comments</comments>
		<pubDate>Thu, 01 Sep 2011 10:23:34 +0000</pubDate>
		<dc:creator>kary</dc:creator>
				<category><![CDATA[GIT]]></category>

		<guid isPermaLink="false">http://karyleong.net/?p=128</guid>
		<description><![CDATA[delete branch remotely to delete local/remote branch "newfeature": local: git branch -d newfeature remote: git push origin :newfeature export changed file of last commit to tar: git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT HEAD &#124; xargs tar czvf last_commit.tar.gz export changed file between two commit git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT tag1 tag2 &#124; xargs tar [...]]]></description>
			<content:encoded><![CDATA[<pre>delete branch remotely

to delete local/remote branch "newfeature":

local:
git branch -d newfeature

remote:
git push origin :newfeature

export changed file of last commit to tar:
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT HEAD | xargs tar czvf last_commit.tar.gz

export changed file between two commit
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT tag1 tag2 | xargs tar czvf last_commit.tar.gz 

last commit deleted files
git diff-tree -r --no-commit-id --name-only --diff-filter=D HEAD</pre>
<p>&nbsp;</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fkaryleong.net%2F%3Fp%3D128&amp;title=Git%20notes" id="wpa2a_10"><img src="http://karyleong.net/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://karyleong.net/?feed=rss2&#038;p=128</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git tar and gzip last commit diff</title>
		<link>http://karyleong.net/?p=125</link>
		<comments>http://karyleong.net/?p=125#comments</comments>
		<pubDate>Mon, 25 Jul 2011 03:38:06 +0000</pubDate>
		<dc:creator>kary</dc:creator>
				<category><![CDATA[GIT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://karyleong.net/?p=125</guid>
		<description><![CDATA[git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT HEAD &#124; xargs tar czvf last_commit.tar.gz]]></description>
			<content:encoded><![CDATA[<p><code>git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT HEAD | xargs tar czvf last_commit.tar.gz</code></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fkaryleong.net%2F%3Fp%3D125&amp;title=Git%20tar%20and%20gzip%20last%20commit%20diff" id="wpa2a_12"><img src="http://karyleong.net/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://karyleong.net/?feed=rss2&#038;p=125</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony 2.0 requirement (ICU 4+ &amp; php-intl)</title>
		<link>http://karyleong.net/?p=121</link>
		<comments>http://karyleong.net/?p=121#comments</comments>
		<pubDate>Wed, 06 Jul 2011 13:34:49 +0000</pubDate>
		<dc:creator>kary</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[icu]]></category>
		<category><![CDATA[intl]]></category>

		<guid isPermaLink="false">http://karyleong.net/?p=121</guid>
		<description><![CDATA[download latest ICU source using default config command compile the ICU to /usr/local recompile php 5.3.x with &#8216;&#8211;enable-intl&#8217; \ &#8216;&#8211;with-icu-dir=/usr/local&#8217; restart apache]]></description>
			<content:encoded><![CDATA[<ol>
<li>download latest ICU source</li>
<li>using default config command compile the ICU to /usr/local</li>
<li>recompile php 5.3.x with<br />
<em> &#8216;&#8211;enable-intl&#8217; \<br />
&#8216;&#8211;with-icu-dir=/usr/local&#8217;</em></li>
<li><em>restart apache</em></li>
</ol>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fkaryleong.net%2F%3Fp%3D121&amp;title=Symfony%202.0%20requirement%20%28ICU%204%2B%20%26%23038%3B%20php-intl%29" id="wpa2a_14"><img src="http://karyleong.net/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://karyleong.net/?feed=rss2&#038;p=121</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import CSV to MySQL</title>
		<link>http://karyleong.net/?p=119</link>
		<comments>http://karyleong.net/?p=119#comments</comments>
		<pubDate>Tue, 22 Mar 2011 10:55:28 +0000</pubDate>
		<dc:creator>kary</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://karyleong.net/?p=119</guid>
		<description><![CDATA[shell> mysqlimport [options] db_name textfile1 [textfile2 ...]]]></description>
			<content:encoded><![CDATA[<p><code>shell> mysqlimport [options] db_name textfile1 [textfile2 ...]</code></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fkaryleong.net%2F%3Fp%3D119&amp;title=Import%20CSV%20to%20MySQL" id="wpa2a_16"><img src="http://karyleong.net/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://karyleong.net/?feed=rss2&#038;p=119</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Linux Information</title>
		<link>http://karyleong.net/?p=116</link>
		<comments>http://karyleong.net/?p=116#comments</comments>
		<pubDate>Wed, 09 Mar 2011 04:38:08 +0000</pubDate>
		<dc:creator>kary</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://karyleong.net/?p=116</guid>
		<description><![CDATA[dmidecode Show server information]]></description>
			<content:encoded><![CDATA[<p><code>dmidecode</code><br />
Show server information</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fkaryleong.net%2F%3Fp%3D116&amp;title=Get%20Linux%20Information" id="wpa2a_18"><img src="http://karyleong.net/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://karyleong.net/?feed=rss2&#038;p=116</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add MySQL to service</title>
		<link>http://karyleong.net/?p=112</link>
		<comments>http://karyleong.net/?p=112#comments</comments>
		<pubDate>Wed, 05 Jan 2011 08:26:00 +0000</pubDate>
		<dc:creator>kary</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://karyleong.net/?p=112</guid>
		<description><![CDATA[How to configure MySQL Set the MySQL service to start on boot chkconfig &#8211;levels 235 mysqld on Start the MySQL service service mysqld start]]></description>
			<content:encoded><![CDATA[<p>How to configure MySQL<br />
Set the MySQL service to start on boot<br />
chkconfig &#8211;levels 235 mysqld on<br />
Start the MySQL service<br />
service mysqld start</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fkaryleong.net%2F%3Fp%3D112&amp;title=Add%20MySQL%20to%20service" id="wpa2a_20"><img src="http://karyleong.net/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://karyleong.net/?feed=rss2&#038;p=112</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

