<?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>Making Life Simple &#187; linux</title>
	<atom:link href="http://www.lalitmehta.com/home/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lalitmehta.com/home</link>
	<description></description>
	<lastBuildDate>Tue, 09 Feb 2010 21:36:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Create self signing SSL Certificate</title>
		<link>http://www.lalitmehta.com/home/2009/07/10/create-self-signing-ssl-certificate/</link>
		<comments>http://www.lalitmehta.com/home/2009/07/10/create-self-signing-ssl-certificate/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 17:10:58 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=93</guid>
		<description><![CDATA[Generate server key openssl genrsa -des3 -out server.key 4096 Create certificate signing request openssl req -new -key server.key -out server.csr Sign the certificate signing request with the server key openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt Make the server key that does not need the password openssl rsa -in server.key -out [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>Generate server key<br />
<code>openssl genrsa -des3 -out server.key 4096</code></li>
<li>Create certificate signing request<br />
<code>openssl req -new -key server.key -out server.csr</code></li>
<li>Sign the certificate signing request with the server key<br />
<code>openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt</code></li>
<li>Make the server key that does not need the password<br />
<code>openssl rsa -in server.key -out server.key.insecure</code></li>
<li>Do some house cleaning<br />
<code>mv server.key server.key.secure<br />
mv server.key.insecure server.key</code></li>
<li>Use the following files in apache configuration<br />
<code>server.key<br />
server.crt</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2009/07/10/create-self-signing-ssl-certificate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Force SSL on apache</title>
		<link>http://www.lalitmehta.com/home/2009/07/10/force-ssl-on-apache/</link>
		<comments>http://www.lalitmehta.com/home/2009/07/10/force-ssl-on-apache/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 15:17:53 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=89</guid>
		<description><![CDATA[mod rewrite should be enabled on apache. Add the following to your apache config file. ######################################### #### XXX: BEGIN EDIT FOR MOD_REWRITE #### #### This is intended to force HTTPS #### #### for all inbound HTTP requests #### #### # This module (mod_rewrite) simply tells Apache2 that all connections to # port 80 need to [...]]]></description>
			<content:encoded><![CDATA[<p>mod rewrite should be enabled on apache. Add the following to your apache config file.<br />
<code><br />
#########################################<br />
#### XXX: BEGIN EDIT FOR MOD_REWRITE ####<br />
#### This is intended to force HTTPS ####<br />
#### for all inbound HTTP requests ####</p>
<p>####<br />
# This module (mod_rewrite) simply tells Apache2 that all connections to<br />
# port 80 need to go to port 443 – SSL – No exceptions<br />
####</p>
<p><IfModule !mod_rewrite.c><br />
LoadModule rewrite_module modules/mod_rewrite.so<br />
</IfModule><br />
<IfModule mod_rewrite.c><br />
RewriteEngine on</p>
<p>####<br />
# The line below sets the rewrite condition for mod_rewrite.so.<br />
# That is, if the server port does not equal 443, then this condition is true<br />
####</p>
<p>ReWriteCond %{SERVER_PORT} !^443$</p>
<p>####<br />
# The line below is the rule, it states that if above condition is true,<br />
# and the request can be any url, then redirect everything to https:// plus<br />
# the original url that was requested.<br />
####</p>
<p>RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]<br />
</IfModule></p>
<p>#### XXX: END EDIT FOR MOD_REWRITE ####<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2009/07/10/force-ssl-on-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Disable Hardware Beep Sound For Terminal</title>
		<link>http://www.lalitmehta.com/home/2009/07/08/linux-disable-turn-off-hardware-beep-sound-for-terminal/</link>
		<comments>http://www.lalitmehta.com/home/2009/07/08/linux-disable-turn-off-hardware-beep-sound-for-terminal/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 13:03:44 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=82</guid>
		<description><![CDATA[If you are using xterm, open ~/.xsession file $ cd $ vi .xession Append the following line: xset b off Save and close the file. If you are using bash shell, open ~/.inputrc file $ cd $ vi .inputrc Append following line: set bell-style none Save and close the file. If you want to turn [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li> If you are using xterm, open ~/.xsession file<br />
<code>$ cd<br />
$ vi .xession<br />
</code>Append the following line:<br />
<code>xset b off<br />
</code>Save and close the file.</li>
<li> If you are using bash shell, open ~/.inputrc file<br />
<code>$ cd<br />
$ vi .inputrc<br />
</code>Append following line:<br />
<code>set bell-style none<br />
</code>Save and close the file.</li>
<li> If you want to turn off beep for VIM text editor, open vim config file ~/.vimrc<br />
<code>$ cd<br />
$ vi .vimrc<br />
</code>Append following line<br />
<code>set vb<br />
</code>Save and close the file.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2009/07/08/linux-disable-turn-off-hardware-beep-sound-for-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove .svn folders</title>
		<link>http://www.lalitmehta.com/home/2009/07/08/remove-svn-folders/</link>
		<comments>http://www.lalitmehta.com/home/2009/07/08/remove-svn-folders/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 07:04:41 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=78</guid>
		<description><![CDATA[In order to clean up the SVN checkout, you can do #deletes all .svn files/folders find . -name ".svn" -exec rm -rf {} \; OR #deletes all .svn folders find . -name ".svn" -type d -exec rm -rf {} \;]]></description>
			<content:encoded><![CDATA[<p>In order to clean up the SVN checkout, you can do</p>
<p><code>#deletes all .svn files/folders<br />
find . -name ".svn" -exec rm -rf {} \;<br />
</code></p>
<p>OR</p>
<p><code>#deletes all .svn folders<br />
find . -name ".svn" -type d -exec rm -rf {} \;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2009/07/08/remove-svn-folders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delete all iptables rules</title>
		<link>http://www.lalitmehta.com/home/2008/02/05/delete-all-iptables-rules/</link>
		<comments>http://www.lalitmehta.com/home/2008/02/05/delete-all-iptables-rules/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 06:21:16 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/2008/02/05/delete-all-iptables-rules/</guid>
		<description><![CDATA[Enter the following to delete iptables completely # iptables -F # iptables -t nat -F # iptables -t mangle -F # iptables -X]]></description>
			<content:encoded><![CDATA[<p>Enter the following to delete iptables completely</p>
<p># iptables -F<br />
# iptables -t nat -F<br />
# iptables -t mangle -F<br />
# iptables -X</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2008/02/05/delete-all-iptables-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>java.net.SocketException: Too many open files</title>
		<link>http://www.lalitmehta.com/home/2008/01/18/javanetsocketexception-too-many-open-files/</link>
		<comments>http://www.lalitmehta.com/home/2008/01/18/javanetsocketexception-too-many-open-files/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 22:27:29 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/2008/01/18/javanetsocketexception-too-many-open-files/</guid>
		<description><![CDATA[For System Wide settings To see the settings for maximum open files for the OS level, use following command. cat /proc/sys/fs/file-max This should be a value from 36000 to 50000 or more. To increase the system wide maximum open files, as root edit the /etc/sysctl.conf and add the following to the end of the file. [...]]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: underline;">For System Wide settings</span><br />
To see the settings for maximum open files for the OS level, use following command.<br />
<em>cat /proc/sys/fs/file-max</em><br />
This should be a value from 36000 to 50000 or more. To increase the system wide maximum open files, as root edit the /etc/sysctl.conf and add the following to the end of the file.</p>
<p>Note: The following example will increase the maximum number of files to 49,500 on your currently running system and will persist after rebooting.</p>
<p>fs.file-max = 49500</p>
<p>Then issue the following command to activate this change to your live system.<br />
sysctl -p</p>
<p><span style="text-decoration: underline;">For user level setting</span></p>
<p>Also, you should update /etc/security/limits.conf for the user.</p>
<p>myuser hard nofile 2048<br />
myuser soft nofile 2048</p>
<p>Type this to see what it&#8217;s set at:</p>
<p>ulimit -a</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2008/01/18/javanetsocketexception-too-many-open-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Header files for linux (Fedora)</title>
		<link>http://www.lalitmehta.com/home/2006/11/12/header-files-for-linux-fedora-2/</link>
		<comments>http://www.lalitmehta.com/home/2006/11/12/header-files-for-linux-fedora-2/#comments</comments>
		<pubDate>Mon, 13 Nov 2006 07:50:24 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=17</guid>
		<description><![CDATA[Header files are provided with *-devel packages.]]></description>
			<content:encoded><![CDATA[<p>Header files are provided with *-devel packages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2006/11/12/header-files-for-linux-fedora-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Fedora Using a Network</title>
		<link>http://www.lalitmehta.com/home/2006/09/30/installing-fedora-using-a-network/</link>
		<comments>http://www.lalitmehta.com/home/2006/09/30/installing-fedora-using-a-network/#comments</comments>
		<pubDate>Sun, 01 Oct 2006 02:38:06 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=13</guid>
		<description><![CDATA[Fedora can be installed using a local network (or even over the Internet if you have broadband access). You will need access to a Web, FTP, or NFS server hosting the installation packages. To boot to a network install, use a network boot floppy, a bootable CD-ROM created using the boot.iso boot image, or the [...]]]></description>
			<content:encoded><![CDATA[<p>Fedora can be installed using a local network (or even over the Internet if you have broadband access). You will need access to a Web, FTP, or NFS server hosting the installation packages. To boot to a network install, use a network boot floppy, a bootable CD-ROM created using the boot.iso boot image, or the first Fedora Core CD-ROM included with this book. Boot your PC with the boot floppy or, if you use CD-ROM, type</p>
<p>linux askmethod</p>
<p>at the boot prompt. Follow the prompts, and you&#8217;ll then be asked to choose the type of network installation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2006/09/30/installing-fedora-using-a-network/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting Tomcat automatically after Linux boots.</title>
		<link>http://www.lalitmehta.com/home/2006/06/01/starting-tomcat-automatically-after-linux-boots/</link>
		<comments>http://www.lalitmehta.com/home/2006/06/01/starting-tomcat-automatically-after-linux-boots/#comments</comments>
		<pubDate>Fri, 02 Jun 2006 04:02:35 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=10</guid>
		<description><![CDATA[If Tomcat was not bundled as part of an operating system distribution, it won&#8217;t have the necessary file(s) to start automatically at system boot time. This describes the steps that should be taken to start Tomcat automatically after Linux boots. 1. Create a Tomcat user Create a group, named tomcat. Create a new non-privileged user [...]]]></description>
			<content:encoded><![CDATA[<p>If Tomcat was not bundled as part of an operating system distribution, it won&#8217;t have the necessary file(s) to start automatically at system boot time. This describes the steps that should be taken to start Tomcat automatically after Linux boots.</p>
<p>1. Create a Tomcat user<br />
Create a group, named tomcat. Create a new non-privileged user (e.g. tomcat)for Tomcat to run as. Ensure that tomcat belongs to the tomcat group. I prefer to keep this user account locked to prevent people trying to log in.</p>
<p>2. Change ownership of Tomcat files<br />
Recursivly change the ownership of the tomcat installation files and directories to the new non-priviliged user<br />
chown -R tomcat &lt;root of tomcat installation&gt;</p>
<p>For all users that need to write files to &lt;tomcat_home&gt;/webapps modify the group permissions to allow this write. eg:<br />
chmod 775 &lt;tomcat_home&gt;/webapps</p>
<p>Any tomcat users should then be added to the tomcat group, allowing them to deploy their files to the webapps directory.</p>
<p>3. Create the Tomcat start-up script:<br />
Create the file /etc/rc.d/init.d/tomcat</p>
<p>Insert the following contents, making sure that:</p>
<p>* JAVA_HOME references the root of the Java development kit directory<br />
* start_tomcat is assigned to the fully qualified path to &lt;tomcat_home&gt;/bin/startup.sh<br />
* stop_tomcat is assigned to the fully qualified path to &lt;tomcat_home)/bin/shutdown.sh</p>
<p>File Contents</p>
<p>#!/bin/sh<br />
#<br />
# Startup script for Tomcat</p>
<p>JAVA_HOME=/usr/java/j2sdk1.4.1_02<br />
export JAVA_HOME<br />
start_tomcat=/usr/local/jakarta-tomcat-4.1.18/bin/startup.sh<br />
stop_tomcat=/usr/local/jakarta-tomcat-4.1.18/bin/shutdown.sh</p>
<p>start() {<br />
echo -n &#8220;Starting tomcat: &#8221;<br />
su -c ${start_tomcat} &#8211; tomcat<br />
echo &#8220;done.&#8221;<br />
}<br />
stop() {<br />
echo -n &#8220;Shutting down tomcat: &#8221;<br />
${stop_tomcat}<br />
echo &#8220;done.&#8221;<br />
}</p>
<p># See how we were called<br />
case &#8220;$1&#8243; in<br />
start)<br />
start<br />
;;<br />
stop)<br />
stop<br />
;;<br />
restart)<br />
stop<br />
sleep 10<br />
start<br />
;;<br />
*)<br />
echo &#8220;Usage: $0 {start|stop|restart}&#8221;<br />
esac</p>
<p>exit 0</p>
<p>4. Test the Tomcat startup script<br />
Test the script by issuing:<br />
[root@localhost]# . /etc/rc.d/init.d/tomcat</p>
<p>Output should be similar to:<br />
Starting tomcat: Using CATALINA_BASE: /opt/tomcat<br />
Using CATALINA_HOME: /opt/tomcat<br />
Using CATALINA_TMPDIR: /opt/tomcat/temp<br />
Using JAVA_HOME: /opt/java<br />
done.</p>
<p>To ensure that tomcat has started try and connect to port 8080 (or whichever you configured Tomcat to use).</p>
<p>5. Link the script into the /etc/rc directories.</p>
<p>Link the script into the /etc/rc directories so that Tomcat is started and stopped when the operating system moves between runlevels. Refer to the file<br />
/etc/inittab for runlevels, but typically Tomcat will be linked in to start on runlevel 3 (Full multi user mode, no X) and runlevel 5 (full multi user with X11). See example below.<br />
[root@l54 rc.d]# cd /etc/rc.d/rc3.d<br />
[root@l54 rc.d]# ln -s ../init.d/tomcat S71tomcat<br />
[root@l54 rc.d]# ln -s ../init.d/tomcat K01tomcat<br />
[root@l54 rc.d]# cd ../rc5.d<br />
[root@l54 rc.d]# ln -s ../init.d/tomcat S71tomcat<br />
[root@l54 rc.d]# ln -s ../init.d/tomcat K01tomcat</p>
<p>NOTE: Which number you use will depend on your local configuration, but obviously Tomcat has to start after network services! Files with an uppercase S indicate daemons that will be started. The number indicates the order in which they are started: low numbers before high. The filenames starting with K indicate daemons that will be shutdown when leaving the runlevel. Typically we like to shut down Tomcat very early in this process.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2006/06/01/starting-tomcat-automatically-after-linux-boots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove ^M from text files in Linux</title>
		<link>http://www.lalitmehta.com/home/2006/02/12/remove-m-from-text-files-in-linux/</link>
		<comments>http://www.lalitmehta.com/home/2006/02/12/remove-m-from-text-files-in-linux/#comments</comments>
		<pubDate>Sun, 12 Feb 2006 08:20:30 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=6</guid>
		<description><![CDATA[Use sed -e &#8216;s/^M//g&#8217; file where ^M is the crtl-m character normally inserted by typing Ctrl-V Ctrl-M Alternatively, grab dos2unix from somewhere.]]></description>
			<content:encoded><![CDATA[<p>Use</p>
<p>sed -e &#8216;s/^M//g&#8217; file</p>
<p>where ^M is the crtl-m character</p>
<p>normally inserted by typing Ctrl-V Ctrl-M</p>
<p>Alternatively, grab dos2unix from somewhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2006/02/12/remove-m-from-text-files-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
