<?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>Howtos &#187; Linux</title>
	<atom:link href="http://howto.isgoodness.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://howto.isgoodness.com</link>
	<description>Stuffs that are worth to mention and worth to know</description>
	<lastBuildDate>Sun, 27 Feb 2011 16:19:32 +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>How to get/kill process in ubuntu</title>
		<link>http://howto.isgoodness.com/2009/11/how-to-getkill-process-in-ubuntu/</link>
		<comments>http://howto.isgoodness.com/2009/11/how-to-getkill-process-in-ubuntu/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 15:19:10 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[kill]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=369</guid>
		<description><![CDATA[For example if process name is php, you can get a list of jobs by using the command bellow ps aux &#124; grep php Result root 7749 0.0 0.1 3236 796 pts/2 S+ 16:09 0:00 grep php root 19292 1.8 5.6 90624 28528 ? S 01:36 16:09 php test.php To kill a process you can [...]]]></description>
			<content:encoded><![CDATA[<p>For example if process name is php, you can get a list of jobs by using the command bellow</p>

<div class="wp_syntax"><div class="code"><pre class="cmd" style="font-family:monospace;">ps aux | grep php</pre></div></div>

<p>Result</p>

<div class="wp_syntax"><div class="code"><pre class="cmd" style="font-family:monospace;">root      7749  0.0  0.1   3236   796 pts/2    S+   16:09   0:00 grep php
root     19292  1.8  5.6  90624 28528 ?        S    01:36  16:09 php test.php</pre></div></div>

<p>To kill a process you can use kill with a specific pid, for instance 19292  above</p>

<div class="wp_syntax"><div class="code"><pre class="cmd" style="font-family:monospace;">kill 19292</pre></div></div>

<p>And kill all php process</p>

<div class="wp_syntax"><div class="code"><pre class="cmd" style="font-family:monospace;">killall -9 php</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/11/how-to-getkill-process-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Howto enable ssl and create self-signed ssl certificate</title>
		<link>http://howto.isgoodness.com/2009/11/howto-enable-ssl-and-create-self-signed-ssl-certificate/</link>
		<comments>http://howto.isgoodness.com/2009/11/howto-enable-ssl-and-create-self-signed-ssl-certificate/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 14:51:18 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=345</guid>
		<description><![CDATA[Enable ssl In my case it was simple. I just ran this line a2enmod ssl Generate self-signed ssl certificate Solution: http://www.akadia.com/services/ssh_test_certificate.html Just follow instruction carefully. Make sure that i step 2 you need to enter a correct &#8220;Common Name&#8221;, ie your domain. Step 5 and 6 also different for different distributions and installation &#8230; Summary [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Enable ssl</strong><br />
In my case it was simple. I just ran this line</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">a2enmod ssl</pre></div></div>

<p><strong>Generate self-signed ssl certificate</strong><br />
Solution: http://www.akadia.com/services/ssh_test_certificate.html</p>
<p>Just follow instruction carefully. Make sure that i step 2 you need to enter a correct &#8220;Common Name&#8221;, ie your domain. Step 5 and 6 also different for different distributions and installation &#8230;</p>
<p>Summary in case link above is not available anymore:<br />
Step 1: Generate a Private Key</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">openssl genrsa -des3 -out server.key <span style="">1024</span></pre></div></div>

<p>Step 2: Generate a CSR (Certificate Signing Request)</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">openssl req -new -key server.key -out server.csr</pre></div></div>

<p>Step 3: Remove Passphrase from Key</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">cp server.key server.key.org
openssl rsa -in server.key.org -out server.key</pre></div></div>

<p>Step 4: Generating a Self-Signed Certificate</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">openssl x509 -req -days <span style="">365</span> -in server.csr -signkey server.key -out server.crt</pre></div></div>

<p>Step 5: Installing the Private Key and Certificate<br />
  (or the location you want to store)</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">cp server.crt /usr/local/apache/conf/ssl.crt
cp server.key /usr/local/apache/conf/ssl.key</pre></div></div>

<p>Step 6: Configuring SSL Enabled Virtual Hosts</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">SSLEngine on
SSLCertificateFile /usr/local/apache/conf/ssl.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl.key
SetEnvIf User-Agent <span style="color: #933;">&quot;.*MSIE.*&quot;</span> nokeepalive ssl-unclean-shutdown</pre></div></div>

<p>Step 7: Restart Apache and Test</p>
<p><strong>New problem:</strong><br />
ssl_error_ssl2_disabled<br />
Solution in ssl.conf:<br />
# enable only secure protocols: SSLv3 and TLSv1, but not SSLv2<br />
## disabled this one<br />
#SSLProtocol all -SSLv2<br />
## use this instead<br />
SSLProtocol all</p>
<p>See also <a href="http://httpd.apache.org/docs/2.0/ssl/ssl_howto.html" target="_blank">http://httpd.apache.org/docs/2.0/ssl/ssl_howto.html</a></p>
<p><strong>New problem:</strong><br />
sec_error_untrusted_issuer due to self-signed SSL Certificate<br />
But it is no problem for me since this is for my own usage and test&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/11/howto-enable-ssl-and-create-self-signed-ssl-certificate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install a .deb file</title>
		<link>http://howto.isgoodness.com/2009/11/how-to-install-a-deb-file/</link>
		<comments>http://howto.isgoodness.com/2009/11/how-to-install-a-deb-file/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 19:34:02 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[deb]]></category>
		<category><![CDATA[dpkg]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=246</guid>
		<description><![CDATA[To install package called package.deb type the following command (make sure that all dependencies are installed) sudo dpkg -i /path/to/folder/package.deb]]></description>
			<content:encoded><![CDATA[<p>To install package called package.deb type the following command (make sure that all dependencies are installed)</p>

<div class="wp_syntax"><div class="code"><pre class="cmd" style="font-family:monospace;">sudo dpkg -i /path/to/folder/package.deb</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/11/how-to-install-a-deb-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get svn revision in ant using svn or svnversion</title>
		<link>http://howto.isgoodness.com/2009/10/how-to-get-svn-revision-in-ant-using-svn-or-svnversion/</link>
		<comments>http://howto.isgoodness.com/2009/10/how-to-get-svn-revision-in-ant-using-svn-or-svnversion/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 19:00:07 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Ant]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[revision]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=12</guid>
		<description><![CDATA[This article is aimed to you whom use svn in linux environment. If you are using windows and Tortoise this post may be more interesting. Here are two ways to get revision number when you build your project. The first one is a complete method to get this number and the second one will give [...]]]></description>
			<content:encoded><![CDATA[<p>This article is aimed to you whom use svn in linux environment. If you are using windows and Tortoise this <a href="http://howto.isgoodness.com/2009/10/how-to-get-revision-using-tortoise-in-ant/">post</a> may be more interesting.</p>
<p>Here are two ways to get revision number when you build your project. The first one is a complete method to get this number and the second one will give you this number including a trailing if there is (<a href="http://svnbook.red-bean.com/en/1.1/re57.html" target="_blank">see</a>). In both examples I try to get the current revision number of Zend Framework &#8230;</p>
<p>Using svn<br />
In this case we use &#8220;svn info&#8221; and put the data into xml file svninfo.xml. After that we load in the data using xmlproperty and select the revision number. Your target would look like this</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;get-revision&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;svn&quot;</span> <span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;svninfo.xml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;info --xml Zend&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xmlproperty</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;svninfo.xml&quot;</span> <span style="color: #000066;">collapseattributes</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;svn.revision&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${info.entry.revision}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${svn.revision}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>And after running this target you get an output as bellow and the echo statement should give you 17746</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;info<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry</span> <span style="color: #000066;">kind</span>=<span style="color: #ff0000;">&quot;dir&quot;</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;Zend&quot;</span> <span style="color: #000066;">revision</span>=<span style="color: #ff0000;">&quot;17746&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			http://framework.zend.com/svn/...
			...framework/standard/trunk/library/Zend
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;root<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://framework.zend.com/svn/framework<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/root<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uuid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>****<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/uuid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wc-info<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;schedule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>normal<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/schedule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;depth<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>infinity<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/depth<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wc-info<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;commit</span> <span style="color: #000066;">revision</span>=<span style="color: #ff0000;">&quot;17740&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>****<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2009-08-22T02:53:32.295192Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/commit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/info<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Using svnversion<br />
This case is really simple and you don&#8217;t need an output file. However, the result may contain none numeric character and you need to convert it if you do need an integer. The easiest way is to parse this as an int in your application before you start using it. In this example the echo statement should print out something like 17746M</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;get-version&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">outputproperty</span>=<span style="color: #ff0000;">&quot;svn.revision&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;svnversion&quot;</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;Zend&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${svn.revision}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/10/how-to-get-svn-revision-in-ant-using-svn-or-svnversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to run php script via putty or command line</title>
		<link>http://howto.isgoodness.com/2009/10/how-to-run-php-script-via-putty-or-command-line/</link>
		<comments>http://howto.isgoodness.com/2009/10/how-to-run-php-script-via-putty-or-command-line/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 21:02:51 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=117</guid>
		<description><![CDATA[If you need to run a php script in Linux environment via putty or other clients and want to close client without terminating the running process of php script you may need to do as bellow. The keyword is nohup &#8230; nohup php policyserver.php &#62; /dev/null 2&#62;&#38;1 &#38;]]></description>
			<content:encoded><![CDATA[<p>If you need to run a php script in Linux environment via putty or other clients and want to close client without terminating the running process of php script you may need to do as bellow. The keyword is <a href="http://en.wikipedia.org/wiki/Nohup" target="_blank">nohup </a> &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nohup</span> php policyserver.php <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/10/how-to-run-php-script-via-putty-or-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

