<?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/category/it/operative-system/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>Emacs selected command, config and practice</title>
		<link>http://howto.isgoodness.com/2010/08/emacs-selected-command-config-and-practice/</link>
		<comments>http://howto.isgoodness.com/2010/08/emacs-selected-command-config-and-practice/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 21:09:26 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=470</guid>
		<description><![CDATA[This is a collection of things I found usefull regarding emacs. It will grow &#8230; .emacs Add those bellow in the file ~/.emacs ;; do not make backup files (setq make-backup-files nil) ;; php syntax color (load &#8220;php-mode&#8221;) (add-to-list &#8216;auto-mode-alist &#8216;(&#8220;\\.php[34]?\\&#8217;\\&#124;\\.phtml\\&#8217;&#8221; . php-mode)) X forwarding with ssh ssh -X your.ssh.domain.com ~$emacs somefile will start an [...]]]></description>
			<content:encoded><![CDATA[<p>This is a collection of things I found usefull regarding emacs. It will grow &#8230;</p>
<p><strong>.emacs</strong><br />
Add those bellow in the file ~/.emacs<br />
;; do not make backup files<br />
(setq make-backup-files nil)</p>
<p>;; php syntax color<br />
(load &#8220;php-mode&#8221;)<br />
(add-to-list &#8216;auto-mode-alist<br />
     	     &#8216;(&#8220;\\.php[34]?\\&#8217;\\|\\.phtml\\&#8217;&#8221; . php-mode))</p>
<p><strong>X forwarding with ssh</strong><br />
ssh -X your.ssh.domain.com<br />
~$emacs somefile<br />
will start an gui emacs on your local computer. You can also set ForwardX11 to yes for enable X forwarding. This property can be found at /etc/ssh/ssh_config</p>
]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2010/08/emacs-selected-command-config-and-practice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limit access with firewall ufw</title>
		<link>http://howto.isgoodness.com/2010/02/limit-access-with-firewall-ufw/</link>
		<comments>http://howto.isgoodness.com/2010/02/limit-access-with-firewall-ufw/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 08:35:24 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[limit access]]></category>
		<category><![CDATA[ufw]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=408</guid>
		<description><![CDATA[Here is some links on how you can reject requests using firewall ufw. http://manpages.ubuntu.com/manpages/jaunty/en/man8/ufw.8.html http://www.ubuntu-unleashed.com/2008/05/howto-take-use-setup-and-advantage-of.html]]></description>
			<content:encoded><![CDATA[<p>Here is some links on how you can reject requests using firewall ufw.</p>
<p>http://manpages.ubuntu.com/manpages/jaunty/en/man8/ufw.8.html</p>
<p>http://www.ubuntu-unleashed.com/2008/05/howto-take-use-setup-and-advantage-of.html</p>
]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2010/02/limit-access-with-firewall-ufw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deny requests from specific ips, configured in virtual host</title>
		<link>http://howto.isgoodness.com/2009/12/deny-requests-from-specific-ips-configured-in-virtual-host/</link>
		<comments>http://howto.isgoodness.com/2009/12/deny-requests-from-specific-ips-configured-in-virtual-host/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 20:32:40 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[proxy abuse]]></category>
		<category><![CDATA[virtual host]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=382</guid>
		<description><![CDATA[Bad thing has hapened to me this holliday. The server has been attacked from serveral ips or more precis they used my server as proxy for attacking other targets. Lucky for me that my server is not configured for this kind of attacks. However, they kept request my server and I wanted that apache would [...]]]></description>
			<content:encoded><![CDATA[<p>Bad thing has hapened to me this holliday. The server has been attacked from serveral ips or more precis they used my server as proxy for attacking other targets. Lucky for me that my server is not configured for this kind of attacks. However, they kept request my server and I wanted that apache would deny all requests from those ips. This one is really tricky. I have configured for denying all except some ips, such as local, but never configured for denying some ips and allow the rest. I started reading apache docs and tried to understand. The result is as following:</p>

<div class="wp_syntax"><div class="code"><pre class="init" style="font-family:monospace;">NameVirtualHost xxx.xxx.xxx:80
&lt;VirtualHost xxx.xxx.xxx:80&gt;
        ServerName example.com
&nbsp;
        DocumentRoot /path/to/doc/root
        &lt;Directory /path/to/doc/root/&gt;
                Options Indexes MultiViews FollowSymLinks
                Order Deny,Allow
                Deny from xx.xxx.xxx.xxx
                Deny from xxx.xxx.xxx.xxx
                Deny from ...
                # ips that not matched deny list will be permitted
        &lt;/Directory&gt;
...
&lt;/VirtualHost&gt;</pre></div></div>

<p>Be aware that you can not use &#8220;Allow from all&#8221; in the end since apache deny a request only if it does not match an allow condition. So we have a deny list to match against. Ips that are not matched ips in this list will be permitted.</p>
<p>It says that there are no good way to protect against this kind of attacks. I hope that I can get in touch with those ip-owners and hopefully they can help me.</p>
<p>Some good pages</p>
<p>http://wiki.apache.org/httpd/ProxyAbuse</p>
<p>http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html</p>
]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/12/deny-requests-from-specific-ips-configured-in-virtual-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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 set default OS in boot.ini</title>
		<link>http://howto.isgoodness.com/2009/11/how-to-set-default-os-in-boot-ini/</link>
		<comments>http://howto.isgoodness.com/2009/11/how-to-set-default-os-in-boot-ini/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 10:31:42 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[os]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=335</guid>
		<description><![CDATA[This is a boot setup for Microsoft Windows XP Professional and Ubuntu (wubi) where we have Windows XP as default and will be preselected on start of computer. This content can be found in c:\boot.ini (be aware this is a hidden system file). &#91;boot loader&#93; timeout=15 default=multi&#40;0&#41;disk&#40;0&#41;rdisk&#40;0&#41;partition&#40;1&#41;\WINDOWS &#160; &#91;operating systems&#93; multi&#40;0&#41;disk&#40;0&#41;rdisk&#40;0&#41;partition&#40;1&#41;\WINDOWS=&#34;Microsoft Windows XP Professional&#34; /fastdetect [...]]]></description>
			<content:encoded><![CDATA[<p>This is a boot setup for Microsoft Windows XP Professional and Ubuntu (<a href="http://en.wikipedia.org/wiki/Wubi_%28Ubuntu_installer%29" target="_blank">wubi</a>) where we have Windows XP as default and will be preselected on start of computer. This content can be found in c:\boot.ini (be aware this is a hidden system file).</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>boot loader<span style="">&#93;</span></span>
<span style="color: #000099;">timeout</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">15</span>
<span style="color: #000099;">default</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">multi<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>disk<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>rdisk<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>partition<span style="">&#40;</span><span style="">1</span><span style="">&#41;</span>\WINDOWS</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>operating systems<span style="">&#93;</span></span>
multi<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>disk<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>rdisk<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>partition<span style="">&#40;</span><span style="">1</span><span style="">&#41;</span>\WINDOWS<span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;Microsoft Windows XP Professional&quot;</span> /fastdetect /NoExecute<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">OptIn</span>
c:\wubildr.mbr<span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;Ubuntu&quot;</span></pre></div></div>

<p>If we wish to start with Ubuntu instead we change default operative system as following</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>boot loader<span style="">&#93;</span></span>
<span style="color: #000099;">timeout</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">15</span>
<span style="color: #000099;">default</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">c:\wubildr.mbr</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>operating systems<span style="">&#93;</span></span>
multi<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>disk<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>rdisk<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>partition<span style="">&#40;</span><span style="">1</span><span style="">&#41;</span>\WINDOWS<span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;Microsoft Windows XP Professional&quot;</span> /fastdetect /NoExecute<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">OptIn</span>
c:\wubildr.mbr<span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;Ubuntu&quot;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/11/how-to-set-default-os-in-boot-ini/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 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>

