<?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>Linux Certification &#187; Linux How to</title>
	<atom:link href="http://lpilinux.com/LDAP%20Protocol/linux-how-to/feed" rel="self" type="application/rss+xml" />
	<link>http://lpilinux.com</link>
	<description>LPI Certification - What, Why, and How</description>
	<lastBuildDate>Thu, 01 Sep 2011 13:53:33 +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 backup MySQL Database to a Text File</title>
		<link>http://lpilinux.com/how-to-backup-mysql-database-to-a-text-file.html</link>
		<comments>http://lpilinux.com/how-to-backup-mysql-database-to-a-text-file.html#comments</comments>
		<pubDate>Sun, 21 Nov 2010 22:11:40 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-backup-mysql-database-to-a-text-file.html</guid>
		<description><![CDATA[We will use the mysqldump utility included with mysql to dump the contents of the database to a text file that can be easily re-imported. SYNTAX: mysqldump -h localhost -u root -pmypassword databasename &#62; dumpfile.sql EXAMPLE: mysqldump -h localhost -u &#8230; <a href="http://lpilinux.com/how-to-backup-mysql-database-to-a-text-file.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-backup-mysql-database-to-a-text-file.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-backup-mysql-database-to-a-text-file.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We will use the <a href="http://www.ucertify.com/exams/Oracle/CX-310-812.html">mysqldump</a> utility included with mysql to dump the contents of the database to a text file that can be easily re-imported.</p>
<p>SYNTAX:</p>
<p><strong> mysqldump -h localhost -u root -pmypassword databasename &gt; dumpfile.sql</strong></p>
<p>EXAMPLE:</p>
<p><strong> mysqldump -h localhost -u root -p2Uad7as9 database01 &gt; dumpfile.sql</strong></p>
<p>This will give you a text file containing all the commands required to recreate the database.This Article is taken from</p>
<div style="background: #E3E4FA;">
<ul>
<li> Pass <a href="http://www.ucertify.com/exams/LPI/117-302.html">117-302 Certification</a></li>
<li>Download Free Practice For<a href="http://www.ucertify.com/download/117-302.html"> 117-302 </a> Exam</li>
</ul>
</div>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-backup-mysql-database-to-a-text-file.html&amp;title=How%20to%20backup%20MySQL%20Database%20to%20a%20Text%20File"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-backup-mysql-database-to-a-text-file.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to configure IPTables Firewall</title>
		<link>http://lpilinux.com/how-to-configure-iptables-firewall.html</link>
		<comments>http://lpilinux.com/how-to-configure-iptables-firewall.html#comments</comments>
		<pubDate>Sun, 21 Nov 2010 11:39:46 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-configure-iptables-firewall.html</guid>
		<description><![CDATA[This script is about to build a firewall in Linux OS by using iptables, the user only needs to follow and answer the simple and easy steps and the script will generate the user specified iptables rule in its original &#8230; <a href="http://lpilinux.com/how-to-configure-iptables-firewall.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-configure-iptables-firewall.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-configure-iptables-firewall.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>This script is about to build a firewall in Linux OS by using iptables, the user only needs to follow and answer the simple and easy steps and the script will generate the user specified iptables rule in its original form.</p>
<p>I HAVE TESTED THE SCRIPT ON PCLINUXOS, FEDORA-9, DREAM_LINUX, UBUNTU-8.</p>
<p>This is my iptables Version 1.0 (USMAN AKRAM &#8211; Lucky)</p>
<p>About iptables:</p>
<p>Network security is a primary consideration in any decision to host a website as the threats are becoming more widespread and persistent every day. One means of providing additional protection is to invest in a firewall. Though prices are always falling, in some cases you may be able to create a comparable unit using the Linux iptables package on an existing server for little or no additional expenditure.</p>
<p>Originally, the most popular firewall/NAT package running on Linux was ipchains, but it had a number of shortcomings. To rectify this, the Netfilter organization decided to create a product called iptables.</p>
<p> <img src='http://lpilinux.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  !!!The Script is Totally User Friendly!!! <img src='http://lpilinux.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Starting of the Script</p>
<p>A Menu will appear like this:</p>
<p>*****Main Menu*****<br />
1. Check Iptables Package<br />
2. Iptables Services<br />
3. Build Your Firewall with Iptables<br />
4. Exit</p>
<p>1. Check Iptables Package</p>
<p>Now let the user select the option 1. Check iptable Package from the menu by pressing &#8220;1&#8243; from the keyboard.</p>
<p>Now the script confirms that the user must be Root, and we know that the UID of Root is zero ( 0 ). So first I have to compare the UID of the current user with zero ( 0 ), if the UID doesn&#8217;t match with the UID of root then it will display the following message:</p>
<p>****You must be the root user to run this script!****<br />
and if the UID matches with root&#8217;s UID then it displays the following message and runs the script:</p>
<p>***Identity Verified_You are the Root***</p>
<p>We can check the UID of the current user by typing the following command in the terminal:</p>
<p>echo $UID</p>
<p>If the identity of the user is verified as root, then the script will check the iptables package in the Linux OS by using the following command.</p>
<p>rpm -q iptables</p>
<p>*****Main Menu*****<br />
1. Check Iptables Package<br />
2. Iptables Services<br />
3. Build Your Firewall with Iptables<br />
4. Exit</p>
<p>Now if the user selects the option 2. Iptables Services then the checkstatus function will be called. In this function there are some options for the user:</p>
<p>*****Note: Save your Iptables before stop/Restart the iptables Services*****<br />
1. Save the iptables<br />
2. Status of Iptables<br />
3. Start iptables Services<br />
4. Stop iptables Services<br />
5. Restart iptable Services<br />
6. Flush iptables (**Use Carefully_it will remove all the rules from iptables**)<br />
7. Go back to Main Menu</p>
<p>If the user selects 1. Save the iptables the iptables rules will be saved in the Linux OS by using the following command:</p>
<p>/etc/init.d/iptables save</p>
<p>If the user selects 2. Status of iptables the current status of iptables will be displayed, using the following command:</p>
<p>/etc/init.d/iptables status</p>
<p>Chain INPUT (policy ACCEPT)<br />
target prot opt source destination<br />
REJECT tcp &#8212; 192.168.1.45 172.16.4.8 reject-with icmp-port-unreachable<br />
ACCEPT tcp &#8212; 192.168.1.1 192.168.1.25<br />
LOG icmp &#8212; anywhere anywhere LOG level warning</p>
<p>Chain FORWARD (policy ACCEPT)<br />
target prot opt source destination</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target prot opt source destination<br />
DROP udp &#8212; 192.168.6.3 10.6.3.7<br />
Click here to find out more!</p>
<p>If the user selects 3. Start iptables Services then iptables will be started, using the following command:</p>
<p>/etc/init.d/iptables start</p>
<p>If the user selects 4. Stop iptables Services then iptables will be stopped, using the following command:</p>
<p>/etc/init.d/iptables stop</p>
<p>If the user selects 5. Restart iptable Services then iptables will be restarted, using the following command, it will load the saved iptables rules:</p>
<p>/etc/init.d/iptables restart</p>
<p>If the user selects 6. Flush iptables then iptables will be flushed, (**use Carefully_it will remove all the rules from iptables**), using the following command, it will flush the saved iptables rules:</p>
<p>iptables -F</p>
<p>To go back to the Main Menu the user must select option 7. Go back to Main Menu.</p>
<p>*****Main Menu*****<br />
1. Check Iptables Package<br />
2. Iptables Services<br />
3. Build Your Firewall with Iptables<br />
4. Exit</p>
<p>Option 3. Build your Firewall with Iptables is the heart of this script, by using this option users can create the firewall with iptables using simple steps, when a user selects the option 3. Build your Firewall with Iptables then the script will ask the user to create the firewall.</p>
<p>Using Which Chain of Filter Table?<br />
1. INPUT<br />
2. OUTPUT<br />
3. Forward&#8221;</p>
<p>The above menu will ask the user to select the chain where he/she wants to put the rule.</p>
<p>Now the script will ask the user to get the IP information from the Source side&#8230;</p>
<p>1. Firewall using Single Source IP<br />
2. Firewall using Source Subnet<br />
3. Firewall using for All Source Networks</p>
<p>Then the above menu ask the user the above three question, if the user selects the option 1. Firewall using Single Source IP then the script will ask the user to enter the IP address.</p>
<p>If the user selects option 2. Firewall using Source Subnet then the script will ask the user to enter the subnet in the form of &#8220;192.168.1.0/24&#8243;.</p>
<p>If the user selects option 3. Firewall using for All Source Networks then the script will put 0/0 in the variable named &#8220;ip_source&#8221; in the script.</p>
<p>Now the script will ask the user to get the IP information from the Destination side&#8230;</p>
<p>1. Firewall using Single Destination IP<br />
2. Firewall using Destination Subnet<br />
3. Firewall using for All Destination Networks</p>
<p>Then the above menu asks the user the above three questions, if the user selects option 1. Firewall using Single Destination IP then the script will ask the user to enter the IP address.</p>
<p>If the user selects option 2. Firewall using Destination Subnet then the script will ask the user to enter the subnet in the form of &#8220;192.168.1.0/24&#8243;</p>
<p>If the user selects option 3. Firewall using for All Destination Networks then the script will put 0/0 in the variable named &#8220;ip_dest&#8221; in the script.</p>
<p>Now the script asks the user to select the PROTOCOL:</p>
<p>1. Block All Traffic of TCP<br />
2. Block Specific TCP Service<br />
3. Block Specific Port<br />
4. Using no Protocol</p>
<p>Now from the above displayed menu if the user selects 1. Block All Traffic of TCP then the script will block all the TCP Traffic.</p>
<p>If the user selects 2. Block Specific TCP Service, now the script will ask the user to enter the TCP Service of his/her choice (e.g ICMP).</p>
<p>Note: the TCP Service name should be in CAPITAL LETTERS!!!</p>
<p>If the user selects 3. Block Specific Port the script will ask the user to enter the PORT number.</p>
<p>Now the script prompts the user What to do with the Above Created Rule?</p>
<p>What to do with Rule?<br />
1. Accept the Packet<br />
2. Reject the Packet<br />
3. Drop the Packet<br />
4. Create Log</p>
<p>If the user selects 1. Accept the Packet then the packet will be accepted.</p>
<p>If the user selects 2. Reject the Packet then the packet will be rejected.</p>
<p>If the user selects 3. Drop the Packet then the packet will be dropped.</p>
<p>If the user selects 4. Create Log then only the log will be created.</p>
<p>Now the following message will be shown to the user:</p>
<p>Press Enter key to Generate the Complete Rule!!!</p>
<p>When the user presses the Enter key then the script generates the original rule with the correct syntax and displays it to the user, in my case:</p>
<p>The Generated Rule is<br />
iptables -A INPUT -s 192.168.0.0/24 -d 172.16.0.0/16 -p TCP -j ACCEPT</p>
<p>Now the script shows the following message to the user:</p>
<p>Do you want to Enter the Above rule to the IPTABLES? Yes=1 , No=2</p>
<p>If the above rule is correct then the user presses 1 for Yes and adds the rule to iptables<br />
otherwise 2 for No and the script will return to let the user edit the rule.This Article is taken from<a href="http://www.howtoforge.com/bash-script-for-configuring-iptables-firewall">howtoforge.com</a> </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-configure-iptables-firewall.html&amp;title=How%20to%20configure%20IPTables%20Firewall"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-configure-iptables-firewall.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install Lighttpd with PHP5 and MySQL on OpenSUSE 11.3</title>
		<link>http://lpilinux.com/how-to-install-lighttpd-with-php5-and-mysql-on-opensuse-11-3.html</link>
		<comments>http://lpilinux.com/how-to-install-lighttpd-with-php5-and-mysql-on-opensuse-11-3.html#comments</comments>
		<pubDate>Sun, 21 Nov 2010 11:17:42 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-install-lighttpd-with-php5-and-mysql-on-opensuse-11-3.html</guid>
		<description><![CDATA[Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on an OpenSUSE 11.3 server with PHP5 support (through FastCGI) and MySQL support. I do not issue any guarantee that &#8230; <a href="http://lpilinux.com/how-to-install-lighttpd-with-php5-and-mysql-on-opensuse-11-3.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-lighttpd-with-php5-and-mysql-on-opensuse-11-3.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-lighttpd-with-php5-and-mysql-on-opensuse-11-3.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on an OpenSUSE 11.3 server with PHP5 support (through FastCGI) and MySQL support.</p>
<p>I do not issue any guarantee that this will work for you!</p>
<p>1 Preliminary Note</p>
<p>In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100. These settings might differ for you, so you have to replace them where appropriate.</p>
<p>2 Installing MySQL 5</p>
<p>First we install MySQL 5 like this:</p>
<p>yast2 -i mysql mysql-client mysql-community-server</p>
<p>Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:</p>
<p>chkconfig &#8211;add mysql<br />
/etc/init.d/mysql start</p>
<p>To secure the MySQL installation, run:</p>
<p>mysql_secure_installation</p>
<p>Now you will be asked several questions:</p>
<p>server1:~ # mysql_secure_installation</p>
<p>NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL<br />
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!</p>
<p>In order to log into MySQL to secure it, we&#8217;ll need the current<br />
password for the root user.  If you&#8217;ve just installed MySQL, and<br />
you haven&#8217;t set the root password yet, the password will be blank,<br />
so you should just press enter here.</p>
<p>Enter current password for root (enter for none): < -- ENTER<br />
OK, successfully used password, moving on...</p>
<p>Setting the root password ensures that nobody can log into the MySQL<br />
root user without the proper authorisation.</p>
<p>Set root password? [Y/n] <-- Y<br />
New password: <-- fill in your desired MySQL root password<br />
Re-enter new password: <-- confirm that password<br />
Password updated successfully!<br />
Reloading privilege tables..<br />
 ... Success!</p>
<p>By default, a MySQL installation has an anonymous user, allowing anyone<br />
to log into MySQL without having to have a user account created for<br />
them.  This is intended only for testing, and to make the installation<br />
go a bit smoother.  You should remove them before moving into a<br />
production environment.</p>
<p>Remove anonymous users? [Y/n] <-- Y<br />
 ... Success!</p>
<p>Normally, root should only be allowed to connect from 'localhost'.  This<br />
ensures that someone cannot guess at the root password from the network.</p>
<p>Disallow root login remotely? [Y/n] <-- Y<br />
 ... Success!</p>
<p>By default, MySQL comes with a database named 'test' that anyone can<br />
access.  This is also intended only for testing, and should be removed<br />
before moving into a production environment.</p>
<p>Remove test database and access to it? [Y/n] <-- Y<br />
 - Dropping test database...<br />
 ... Success!<br />
 - Removing privileges on test database...<br />
 ... Success!</p>
<p>Reloading the privilege tables will ensure that all changes made so far<br />
will take effect immediately.</p>
<p>Reload privilege tables now? [Y/n] <-- Y<br />
 ... Success!</p>
<p>Cleaning up...</p>
<p>All done!  If you've completed all of the above steps, your MySQL<br />
installation should now be secure.</p>
<p>Thanks for using MySQL!</p>
<p>server1:~ #<br />
This Article is taken from<a href="http://www.howtoforge.com/installing-lighttpd-with-php5-and-mysql-support-on-opensuse-11.3">howtoforge.com </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-lighttpd-with-php5-and-mysql-on-opensuse-11-3.html&amp;title=How%20to%20install%20Lighttpd%20with%20PHP5%20and%20MySQL%20on%20OpenSUSE%2011.3"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-install-lighttpd-with-php5-and-mysql-on-opensuse-11-3.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change SSH Banner in Ubantu</title>
		<link>http://lpilinux.com/how-to-change-ssh-banner-in-ubantu.html</link>
		<comments>http://lpilinux.com/how-to-change-ssh-banner-in-ubantu.html#comments</comments>
		<pubDate>Sun, 21 Nov 2010 11:12:01 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-change-ssh-banner-in-ubantu.html</guid>
		<description><![CDATA[Every time I connect to my Ubuntu development server through my ssh client, I receive the same message and Iâ€™m getting tired of seeing it, so I decided to change the message to something else. Hereâ€™s the message that I &#8230; <a href="http://lpilinux.com/how-to-change-ssh-banner-in-ubantu.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-change-ssh-banner-in-ubantu.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-change-ssh-banner-in-ubantu.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Every time I connect to my Ubuntu development server through my ssh client, I receive the same message and Iâ€™m getting tired of seeing it, so I decided to change the message to something else.</p>
<p>Hereâ€™s the message that I get every time:</p>
<p>    Linux superfast 2.6.20-16-generic #2 SMP Thu Jun 7 19:00:28 UTC 2007 x86_64</p>
<p>    The programs included with the Ubuntu system are free software;<br />
    the exact distribution terms for each program are described in the<br />
    individual files in /usr/share/doc/*/copyright.</p>
<p>    Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by<br />
    applicable law.</p>
<p>    Last login: Mon Aug 13 01:05:46 2007 from ipaddress removed</p>
<p>    geek@superfast:~$</p>
<p>Changing this message requires editing two different files. The first three sections can be modified by editing the following file:</p>
<p>    /etc/motd</p>
<p>This file contains the linux build number as well as the Ubuntu warranty message. I donâ€™t find this particularly useful, so I removed all of it and replaced it with my own message.</p>
<p>To disable the last login message (which I donâ€™t recommend doing), you will need to edit the following file in sudo mode:</p>
<p>    /etc/ssh/sshd_config</p>
<p>Find this line in the file and change the yes to no as shown:</p>
<p>    PrintLastLog no</p>
<p>Now when you login, youâ€™ll get a blank prompt, although I wouldnâ€™t necessarily recommend it because itâ€™s useful to see the last login to the system for security reasons. This is my prompt now:</p>
<p>    This is a superfast system. Please max out the cpu accordingly.</p>
<p>    Last login: Mon Aug 13 01:24:14 2007 from ipaddress removed<br />
    geek@superfast:~$This Article is taken from </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-change-ssh-banner-in-ubantu.html&amp;title=How%20to%20change%20SSH%20Banner%20in%20Ubantu"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-change-ssh-banner-in-ubantu.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to genrate Random Password from Commandline</title>
		<link>http://lpilinux.com/how-to-genrate-random-password-from-commandline.html</link>
		<comments>http://lpilinux.com/how-to-genrate-random-password-from-commandline.html#comments</comments>
		<pubDate>Sun, 21 Nov 2010 11:05:04 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-genrate-random-password-from-commandline.html</guid>
		<description><![CDATA[One of the great things about Linux is that you can do the same thing hundreds of different waysâ€”even something as simple as generating a random password can be accomplished with dozens of different commands. Hereâ€™s 10 ways you can &#8230; <a href="http://lpilinux.com/how-to-genrate-random-password-from-commandline.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-genrate-random-password-from-commandline.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-genrate-random-password-from-commandline.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>One of the great things about Linux is that you can do the same thing hundreds of different waysâ€”even something as simple as generating a random password can be accomplished with dozens of different commands. Hereâ€™s 10 ways you can do it.</p>
<p>We gathered all of these commands from Command-Line Fu and tested them out on our own Linux PC to make sure they work. You should be able to use at least some of these on Windows with Cygwin installed, though we didnâ€™t test all of themâ€”the last one definitely works though.<br />
Generate a Random Password</p>
<p>For any of these random password commands, you can either modify them to output a different password length, or you can just use the first x characters of the generated password if you donâ€™t want such a long password. Hopefully youâ€™re using a password manager like LastPass anyway so you donâ€™t need to memorize them.</p>
<p>This method uses SHA to hash the date, runs through base64, and then outputs the top 32 characters.</p>
<p>    date +%s | sha256sum | base64 | head -c 32 ; echo</p>
<p>This method used the built-in /dev/urandom feature, and filters out only characters that you would normally use in a password. Then it outputs the top 32.</p>
<p>    < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;</p>
<p>This one uses opensslâ€™s rand function, which may not be installed on your system. Good thing thereâ€™s lots of other examples, right?</p>
<p>    openssl rand -base64 32</p>
<p>This one works a lot like the other urandom one, but just does the work in reverse. Bash is very powerful!</p>
<p>    tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1</p>
<p>Hereâ€™s another example that filters using the strings command, which outputs printable strings from a file, which in this case is the urandom feature.</p>
<p>    strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo</p>
<p>Hereâ€™s an even simpler version of the urandom one.</p>
<p>    < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6</p>
<p>This one manages to use the very useful dd command.</p>
<p>    dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev</p>
<p>You can even create a random left-hand password, which would let you type your password with one hand.</p>
<p>    howtogeek.com </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-genrate-random-password-from-commandline.html&amp;title=How%20to%20genrate%20Random%20Password%20from%20Commandline"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-genrate-random-password-from-commandline.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to disable ProFTP in Linux</title>
		<link>http://lpilinux.com/how-to-disable-proftp-in-linux.html</link>
		<comments>http://lpilinux.com/how-to-disable-proftp-in-linux.html#comments</comments>
		<pubDate>Sun, 21 Nov 2010 07:20:32 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-disable-proftp-in-linux.html</guid>
		<description><![CDATA[First, look in your /etc/xinetd.d/ directory and see if thereâ€™s a file named psa_ftp in there. If not, you might have to make this change in your /etc/xinetd.conf file. Open up the file as root, and look for the following &#8230; <a href="http://lpilinux.com/how-to-disable-proftp-in-linux.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-disable-proftp-in-linux.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-disable-proftp-in-linux.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>First, look in your /etc/xinetd.d/ directory and see if thereâ€™s a file named psa_ftp in there. If not, you might have to make this change in your /etc/xinetd.conf file.</p>
<p>Open up the file as root, and look for the following section:</p>
<p>    service ftp<br />
    {<br />
            disable         = yes<br />
            socket_type     = stream<br />
            protocol        = tcp<br />
            wait            = no<br />
            user            = root<br />
            instances       = UNLIMITED<br />
            server          = /usr/sbin/in.proftpd<br />
            server_args     = -c /etc/proftpd.conf<br />
    }</p>
<p>Change the disable = no line to disable = yes as shown above.</p>
<p>Run the following command to restart xinetd</p>
<p>    /etc/init.d/xinetd restart This Article is taken from </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-disable-proftp-in-linux.html&amp;title=How%20to%20disable%20ProFTP%20in%20Linux"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-disable-proftp-in-linux.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Install Nginx with PHP5 and MySQL on CentOS 5.5</title>
		<link>http://lpilinux.com/how-to-install-nginx-with-php5-and-mysql-on-centos-5-5.html</link>
		<comments>http://lpilinux.com/how-to-install-nginx-with-php5-and-mysql-on-centos-5-5.html#comments</comments>
		<pubDate>Sat, 02 Oct 2010 11:14:27 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-install-nginx-with-php5-and-mysql-on-centos-5-5.html</guid>
		<description><![CDATA[Nginx (pronounced &#8220;engine x&#8221;) is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on a CentOS 5.5 server with &#8230; <a href="http://lpilinux.com/how-to-install-nginx-with-php5-and-mysql-on-centos-5-5.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-nginx-with-php5-and-mysql-on-centos-5-5.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-nginx-with-php5-and-mysql-on-centos-5-5.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Nginx (pronounced &#8220;engine x&#8221;) is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on a CentOS 5.5 server with PHP5 support (through FastCGI) and MySQL support.</p>
<p>I do not issue any guarantee that this will work for you!</p>
<p>1 Preliminary Note</p>
<p>In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100. These settings might differ for you, so you have to replace them where appropriate.</p>
<p>2 Installing MySQL 5</p>
<p>First we install MySQL 5 like this:</p>
<p>yum install mysql mysql-server</p>
<p>Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:</p>
<p>chkconfig &#8211;levels 235 mysqld on<br />
/etc/init.d/mysqld start</p>
<p>Now check that networking is enabled. Run</p>
<p>netstat -tap | grep mysql</p>
<p>It should show something like this:</p>
<p>[root@server1 ~]# netstat -tap | grep mysql<br />
tcp        0      0 *:mysql                     *:*                         LISTEN      2388/mysqld<br />
[root@server1 ~]#</p>
<p>If it does not, edit /etc/my.cnf and comment out the option skip-networking:</p>
<p>vi /etc/my.cnf</p>
<p>[...]<br />
#skip-networking<br />
[...]</p>
<p>and restart your MySQL server:</p>
<p>/etc/init.d/mysqld restart</p>
<p>Run</p>
<p>mysql_secure_installation</p>
<p>to set a password for the user root (otherwise anybody can access your MySQL database!):</p>
<p>[root@server1 ~]# mysql_secure_installation</p>
<p>NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL<br />
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!</p>
<p>In order to log into MySQL to secure it, we&#8217;ll need the current<br />
password for the root user.  If you&#8217;ve just installed MySQL, and<br />
you haven&#8217;t set the root password yet, the password will be blank,<br />
so you should just press enter here.</p>
<p>Enter current password for root (enter for none): < -- ENTER<br />
OK, successfully used password, moving on...</p>
<p>Setting the root password ensures that nobody can log into the MySQL<br />
root user without the proper authorisation.</p>
<p>Set root password? [Y/n] <-- ENTER<br />
New password: <-- yourrootsqlpassword<br />
Re-enter new password: <-- yourrootsqlpassword<br />
Password updated successfully!<br />
Reloading privilege tables..<br />
 ... Success!</p>
<p>By default, a MySQL installation has an anonymous user, allowing anyone<br />
to log into MySQL without having to have a user account created for<br />
them.  This is intended only for testing, and to make the installation<br />
go a bit smoother.  You should remove them before moving into a<br />
production environment.</p>
<p>Remove anonymous users? [Y/n] <-- ENTER<br />
 ... Success!</p>
<p>Normally, root should only be allowed to connect from 'localhost'.  This<br />
ensures that someone cannot guess at the root password from the network.</p>
<p>Disallow root login remotely? [Y/n] <-- ENTER<br />
 ... Success!</p>
<p>By default, MySQL comes with a database named 'test' that anyone can<br />
access.  This is also intended only for testing, and should be removed<br />
before moving into a production environment.</p>
<p>Remove test database and access to it? [Y/n] <-- ENTER<br />
 - Dropping test database...<br />
 ... Success!<br />
 - Removing privileges on test database...<br />
 ... Success!</p>
<p>Reloading the privilege tables will ensure that all changes made so far<br />
will take effect immediately.</p>
<p>Reload privilege tables now? [Y/n] <-- ENTER<br />
 ... Success!</p>
<p>Cleaning up...</p>
<p>All done!  If you've completed all of the above steps, your MySQL<br />
installation should now be secure.</p>
<p>Thanks for using MySQL!This Article is taken from<a href="http://www.howtoforge.com/installing-nginx-with-php5-and-mysql-support-on-centos-5.5">howtoforge.com </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-nginx-with-php5-and-mysql-on-centos-5-5.html&amp;title=How%20to%20Install%20Nginx%20with%20PHP5%20and%20MySQL%20on%20CentOS%205.5"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-install-nginx-with-php5-and-mysql-on-centos-5-5.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Crop Multiple images in the same manner</title>
		<link>http://lpilinux.com/how-to-crop-multiple-images-in-the-same-manner.html</link>
		<comments>http://lpilinux.com/how-to-crop-multiple-images-in-the-same-manner.html#comments</comments>
		<pubDate>Mon, 24 May 2010 02:44:25 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/?p=507</guid>
		<description><![CDATA[Sometimes you&#8217;ll want to crop the same area from multiple images (think of taking the contents of the same window from a load of screenshots). Of course, you could fire up your favourite image editor to select and crop over &#8230; <a href="http://lpilinux.com/how-to-crop-multiple-images-in-the-same-manner.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-crop-multiple-images-in-the-same-manner.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-crop-multiple-images-in-the-same-manner.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Sometimes you&#8217;ll want to crop the same area from multiple images (think of taking the contents of the same window from a load of screenshots). Of course, you could fire up your favourite image editor to select and crop over and over, but, as usual, there is a better way. This short tutorial describes an efficient way to do this for a theoretically infinite amount of images.</p>
<p>Difficulty: Basic &#8211; Medium</p>
<p>Note: I strongly recommend making a backup of the images you&#8217;re using for this tutorial before messing with them. Some actions in this tutorial will overwrite the image files, so if you make a mistake you may lose valuable data.</p>
<p>This tutorial assumes basic Linux knowledge, like starting a program, opening a terminal and working with a terminal.</p>
<p>The tools we&#8217;ll be using are GIMP and mogrify (from the ImageMagick suite), so make sure that you have them installed. We&#8217;ll use GIMP to graphically select the area to be cropped and the mogrify tool to automate the cropping, saving us a lot of work. Let&#8217;s start with the selecting:<br />
Getting the right cropping values using GIMP</p>
<p>In 5 steps:<br />
Where to find the cropping values<br />
1. Open up GIMP.<br />
2. Open one of the images in GIMP.<br />
3. Using the Rectangle Select Tool (hotkey &#8220;R&#8221;), select the area you want to be cropped.<br />
4. Note the X, Y, Width and Height values GIMP gives you (have a look at the picture, you can find them in the GIMP main window).<br />
5. Close GIMP (or leave it open if you plan to use it again soon).</p>
<p>We now have the values we need to tell the mogrify utility what to crop. Let&#8217;s go on and write a line that&#8217;ll execute mogrify in such a way that it&#8217;ll crop all our images!<br />
Cropping the images</p>
<p>Now we&#8217;ll start working in the terminal. Open up your favourite one and cd to the directory where the images are located. Note that I strongly recommend having only the images that are to be cropped in the directory, nothing more. It saves you a lot of trouble. Well then, let&#8217;s start with the mogrify command. The syntax for cropping is as follows:</p>
<p>    [rechosen@localhost ~]$ mogrify -crop {Width}x{Height}+{X}+{Y} image.png</p>
<p>Now don&#8217;t be scared, the {Width}, {Height} and so on simply are the places where you should put the values you got from GIMP! Note that I use a png file as an example, while mogrify is able to handle over 100 image file types. You don&#8217;t have to use png files with it. Anyway, if I&#8217;d fill in the values from the screenshot, the mogrify command would look like this:</p>
<p>    [rechosen@localhost ~]$ mogrify -crop 643&#215;393+7+83 image.png</p>
<p>The logic behind this system is the following: crop an area of 643 by 393 pixels, starting at 7 pixels from the left and 83 pixels from the top of the image. Got it? Ok then. The above command would overwrite image.png with a cropped version. But this still manipulates just a single image. The easiest way to make mogrify modify all images is just this:</p>
<p>    [rechosen@localhost ~]$ mogrify -crop 643&#215;393+7+83 *.png</p>
<p>The asterisk makes bash fill in all png files in the current directory, and mogrify will handle them all happily. After a (hopefully short) wait, all the images will have been cropped. If you want to crop images of an other format, just change &#8220;*.png&#8221; to, for example, &#8220;*.jpg&#8221; or &#8220;*.gif&#8221;.</p>
<p>You might want to give the cropped images other names, so that the original images will not be overwritten and it will be clear which images have been cropped and which haven&#8217;t. This is more complex, but hey, we&#8217;re working on Linux! Everything is possible if you take the time to write it.<br />
Renaming the cropped images</p>
<p>In order to give the cropped images other names, we&#8217;ll use a bash loop. This time, we&#8217;ll use the convert utility. It is from the same family as mogrify, but it makes it easier for us to output to an other filename. I won&#8217;t explain the whole loop, as most of it is bash knowledge, but I will tell you which things you can/should alter to get the right results. There are loops for two cases, just pick the one of which you like the file naming the most.</p>
<p>    * Case 1: You want the output files to be named like this: originalfile.png => cropped_originalfile.png (again, you can insert any of the over 100 supported image formats here, I just like png). The loop should be like this:</p>
<p>          [rechosen@localhost ~]$ for file in *.png; do convert -crop {Width}x{Height}+{X}+{Y} $file cropped_$file; done</p>
<p>      You should replace &#8220;png&#8221; with the extension you want (think of jpg, gif, png (of course) and so on), and the &#8220;{Width}&#8221;, &#8220;{Height}&#8221; etc with the values you got from GIMP. You may also replace &#8220;cropped_&#8221; with any prefix you like.<br />
    * Case 2: You want the output files to be named like this: originalfile.png => originalfile_cropped.png (or originalfile.jpg => originalfile_cropped.jpg, you name it). In that case, you should use the following loop:</p>
<p>          [rechosen@localhost ~]$ for file in *.png; do convert -crop {Width}x{Height}+{X}+{Y} $file ${file%.png}_cropped.png; done</p>
<p>      Again, replace &#8220;png&#8221; with the extension you want (watch it, there are 3 instances of it) and the &#8220;{Width}&#8221;, &#8220;{Height}&#8221; etc with the values you got from GIMP. You can also replace &#8220;_cropped&#8221; with any suffix you like.</p>
<p>      Note that you can, in this case, easily modify the output format: if you want to output the cropped images in jpg format, you can just replace the third instance of &#8220;png&#8221; with &#8220;jpg&#8221;, no matter what format your input files are. The convert utility will detect it and change the image format automatically.  </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-crop-multiple-images-in-the-same-manner.html&amp;title=How%20to%20Crop%20Multiple%20images%20in%20the%20same%20manner"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-crop-multiple-images-in-the-same-manner.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BOFH Scripts</title>
		<link>http://lpilinux.com/bofh-scripts-2.html</link>
		<comments>http://lpilinux.com/bofh-scripts-2.html#comments</comments>
		<pubDate>Sun, 23 May 2010 10:44:14 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/bofh-scripts-2.html</guid>
		<description><![CDATA[After not writing for a little while (I call it writers block, you can call it lazy) I decided to do what any Linux Geek would do. I searched two different distributions software repositories for excuses. Fedora and Debian had &#8230; <a href="http://lpilinux.com/bofh-scripts-2.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fbofh-scripts-2.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fbofh-scripts-2.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>After not writing for a little while (I call it writers block, you can call it lazy) I decided to do what any Linux Geek would do. I searched two different distributions software repositories for excuses. Fedora and Debian had quite different but interesting outputs.</p>
<p>Fedoraâ€™s came up with QLandkarte GT which is a GPS tool that replaces .</p>
<p>    QLandkarte GT is the ultimate outdoor aficionadoâ€™s tool for GPS maps in GeoTiff format as well as Garminâ€™s img vector map format. Additional it is the PC side frontend to QLandkarte M, a moving map application for mobile devices. And it fills the gap Garmin leaves in refusing to support Linux. QLandkarte GT is the proof that writing portable applications for Unix, Windows and </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fbofh-scripts-2.html&amp;title=BOFH%20Scripts"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/bofh-scripts-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BOFH Scripts</title>
		<link>http://lpilinux.com/bofh-scripts.html</link>
		<comments>http://lpilinux.com/bofh-scripts.html#comments</comments>
		<pubDate>Sun, 23 May 2010 10:44:11 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/bofh-scripts.html</guid>
		<description><![CDATA[After not writing for a little while (I call it writers block, you can call it lazy) I decided to do what any Linux Geek would do. I searched two different distributions software repositories for excuses. Fedora and Debian had &#8230; <a href="http://lpilinux.com/bofh-scripts.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fbofh-scripts.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fbofh-scripts.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>After not writing for a little while (I call it writers block, you can call it lazy) I decided to do what any Linux Geek would do. I searched two different distributions software repositories for excuses. Fedora and Debian had quite different but interesting outputs.</p>
<p>Fedoraâ€™s came up with QLandkarte GT which is a GPS tool that replaces .</p>
<p>    QLandkarte GT is the ultimate outdoor aficionadoâ€™s tool for GPS maps in GeoTiff format as well as Garminâ€™s img vector map format. Additional it is the PC side frontend to QLandkarte M, a moving map application for mobile devices. And it fills the gap Garmin leaves in refusing to support Linux. QLandkarte GT is the proof that writing portable applications for Unix, Windows and </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fbofh-scripts.html&amp;title=BOFH%20Scripts"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/bofh-scripts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Install Adobe AIR in Ubantu?</title>
		<link>http://lpilinux.com/how-to-install-adobe-air-in-ubantu.html</link>
		<comments>http://lpilinux.com/how-to-install-adobe-air-in-ubantu.html#comments</comments>
		<pubDate>Tue, 27 Apr 2010 09:59:24 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-install-adobe-air-in-ubantu.html</guid>
		<description><![CDATA[1. Download the BIN file from the below location. (~ 13 MB) 2. Save the file in Home Folder i.e. Places ==> Home Folder 3. Run the below mentioned code on terminal chmod +x AdobeAIRInstaller.bin 4. Now run another command &#8230; <a href="http://lpilinux.com/how-to-install-adobe-air-in-ubantu.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-adobe-air-in-ubantu.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-adobe-air-in-ubantu.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>1. Download the BIN file from the below location. (~ 13 MB)</p>
<p>2. Save the file in Home Folder i.e. Places ==> Home Folder</p>
<p>3. Run the below mentioned code on terminal</p>
<p>chmod +x AdobeAIRInstaller.bin</p>
<p>4. Now run another command as well:</p>
<p>sudo ./AdobeAIRInstaller.bin</p>
<p>5. Now complete the installation of the AIR application.</p>
<p>Download Adobe AIR for Linux (Select Linux and Click on Download) </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-adobe-air-in-ubantu.html&amp;title=How%20to%20Install%20Adobe%20AIR%20in%20Ubantu%3F"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-install-adobe-air-in-ubantu.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Determine the Source of Shell Input?</title>
		<link>http://lpilinux.com/how-to-determine-the-source-of-shell-input.html</link>
		<comments>http://lpilinux.com/how-to-determine-the-source-of-shell-input.html#comments</comments>
		<pubDate>Sat, 10 Apr 2010 07:08:18 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-determine-the-source-of-shell-input.html</guid>
		<description><![CDATA[After a bit of pondering I came up with two solutions: the stat command and using information from the proc file system. The first solution uses the stat command to determine what type of file is connected to standard input. &#8230; <a href="http://lpilinux.com/how-to-determine-the-source-of-shell-input.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-determine-the-source-of-shell-input.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-determine-the-source-of-shell-input.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>After a bit of pondering I came up with two solutions: the stat command and using information from the proc file system.</p>
<p>The first solution uses the stat command to determine what type of file is connected to standard input. First we find out what is connected to standard input:</p>
<p>stdin=&#8221;$(ls -l /dev/fd/0)&#8221;<br />
stdin=&#8221;${stdin/*-> /}&#8221;</p>
<p>The file /dev/fd/0 is the standard input, which is a symbolic link. So we use ls to get the file it&#8217;s linked to. Then we remove everything that matches *-> from the front of the value, that leaves us with the linked to file.</p>
<p>Now we use stat to get the file type:</p>
<p>ftype=&#8221;$(stat &#8211;printf=%F $stdin)&#8221;</p>
<p>Then we just test the file type:</p>
<p>if   [[ "$ftype" == 'character special file' ]]; then<br />
    echo Terminal<br />
elif [[ "$ftype" == 'regular file' ]]; then<br />
    echo Pipe: $stdin<br />
else<br />
    echo Unknown: $stdin<br />
fi</p>
<p>We can test it via:</p>
<p>$ sh ckpipe.sh<br />
Terminal<br />
$ sh ckpipe.sh <ckpipe .sh<br />
Pipe: .../ckpipe/ckpipe.sh</p>
<p>The next solution I came up with involves using information from the proc file system. In the proc file system the files for each process appear in the directory /proc/PROCESS_ID/fd (for the current process the special directory /proc/self/fd can be used):</p>
<p>$ ls -la /proc/self/fd<br />
total 0<br />
dr-x------ 2 mitch users  0 2010-02-10 11:04 .<br />
dr-xr-xr-x 7 mitch users  0 2010-02-10 11:04 ..<br />
lrwx------ 1 mitch users 64 2010-02-10 11:04 0 -> /dev/pts/2<br />
lrwx&#8212;&#8212; 1 mitch users 64 2010-02-10 11:04 1 -> /dev/pts/2<br />
lrwx&#8212;&#8212; 1 mitch users 64 2010-02-10 11:04 2 -> /dev/pts/2<br />
lr-x&#8212;&#8212; 1 mitch users 64 2010-02-10 11:04 3 -> /proc/29328/fd</p>
<p>As before we need the name of file that is linked to, so we get that with:</p>
<p>stdin=&#8221;$(ls -l /proc/self/fd/0)&#8221;<br />
stdin=&#8221;${stdin/*-> /}&#8221;</p>
<p>From there we can just test to see if it&#8217;s linked to a /dev/pts file:</p>
<p>if [[ "$stdin" =~ ^/dev/pts/[0-9] ]]; then<br />
    echo Terminal<br />
else<br />
    echo Pipe: $stdin<br />
fi</p>
<p>We test this the same way:</p>
<p>$ sh ckpipe2.sh<br />
Terminal<br />
$ sh ckpipe2.sh <ckpipe2 .sh<br />
Pipe: .../ckpipe/ckpipe2.sh</ckpipe></ckpipe2></ckpipe> </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-determine-the-source-of-shell-input.html&amp;title=How%20to%20Determine%20the%20Source%20of%20Shell%20Input%3F"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-determine-the-source-of-shell-input.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Install VLC Media Player in Ubantu?</title>
		<link>http://lpilinux.com/how-to-install-vlc-media-player-in-ubantu.html</link>
		<comments>http://lpilinux.com/how-to-install-vlc-media-player-in-ubantu.html#comments</comments>
		<pubDate>Sat, 10 Apr 2010 06:37:54 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-install-vlc-media-player-in-ubantu.html</guid>
		<description><![CDATA[Graphical way Open Synaptic (System -> Administration -> Synaptic Package Manager). In Settings -> Repositories, make sure you have a &#8220;multiverse&#8221; repository activated. Search for vlc and install it. You should also install vlc-plugin-pulse, mozilla-plugin-vlc (and libdvdcss2). If you are &#8230; <a href="http://lpilinux.com/how-to-install-vlc-media-player-in-ubantu.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-vlc-media-player-in-ubantu.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-vlc-media-player-in-ubantu.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Graphical way</p>
<p>Open Synaptic (System -> Administration -> Synaptic Package Manager). In Settings -> Repositories, make sure you have a &#8220;multiverse&#8221; repository activated.</p>
<p>Search for vlc and install it. You should also install vlc-plugin-pulse, mozilla-plugin-vlc (and libdvdcss2).</p>
<p>If you are interrested in streaming or transcoding, you should also install libavcodec-extra-52.<br />
Command line way</p>
<p>You need to check that a &#8220;multiverse&#8221; mirror is listed in your /etc/apt/sources.list.</p>
<p>    % sudo apt-get update<br />
    % sudo apt-get install vlc vlc-plugin-pulse mozilla-plugin-vlc</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-vlc-media-player-in-ubantu.html&amp;title=How%20to%20Install%20VLC%20Media%20Player%20in%20Ubantu%3F"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-install-vlc-media-player-in-ubantu.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Instal Suhosin PHP 5 Protection Security Patch &#8211; Red Hat EL5 / CentOS EL5 Linux</title>
		<link>http://lpilinux.com/how-to-instal-suhosin-php-5-protection-security-patch-red-hat-el5-centos-el5-linux.html</link>
		<comments>http://lpilinux.com/how-to-instal-suhosin-php-5-protection-security-patch-red-hat-el5-centos-el5-linux.html#comments</comments>
		<pubDate>Sat, 10 Apr 2010 05:37:33 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-instal-suhosin-php-5-protection-security-patch-red-hat-el5-centos-el5-linux.html</guid>
		<description><![CDATA[Download latest version of Suhosin, enter: # cd /opt # wget http://download.suhosin.org/suhosin-0.9.27.tgz Make sure you have php-devel installed: # yum install php-devel Compile Suhosin under PHP 5 and RHEL / CentOS EL5 Linux Type the following commands: # tar -zxvf &#8230; <a href="http://lpilinux.com/how-to-instal-suhosin-php-5-protection-security-patch-red-hat-el5-centos-el5-linux.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-instal-suhosin-php-5-protection-security-patch-red-hat-el5-centos-el5-linux.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-instal-suhosin-php-5-protection-security-patch-red-hat-el5-centos-el5-linux.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Download latest version of Suhosin, enter:</p>
<p># cd /opt<br />
# wget http://download.suhosin.org/suhosin-0.9.27.tgz</p>
<p>Make sure you have php-devel installed:</p>
<p># yum install php-devel<br />
Compile Suhosin under PHP 5 and RHEL / CentOS EL5 Linux</p>
<p>Type the following commands:</p>
<p># tar -zxvf suhosin-0.9.27.tgz<br />
# cd suhosin-0.9.27<br />
# phpize<br />
#./configure<br />
# make<br />
# make install<br />
Configure Suhosin</p>
<p>Type the following command to create Suhosin configuration file:</p>
<p># echo &#8216;extension=suhosin.so&#8217; > /etc/php.d/suhosin.ini<br />
Restart web server</p>
<p>Type the following command to restart httpd:</p>
<p># service httpd restart</p>
<p>If you are using lighttpd, enter:</p>
<p># service lighttpd restart<br />
Verify Suhosin installation</p>
<p>Type the following command:</p>
<p>$ php -v</p>
<p>Sample output:</p>
<p>PHP 5.1.6 (cli) (built: Apr  7 2009 08:00:04)<br />
Copyright (c) 1997-2006 The PHP Group<br />
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies<br />
   with Suhosin v0.9.27, Copyright (c) 2007, by SektionEins Gmb</p>
<p>More information can be found at http://www.hardened-php.net/suhosin/ </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-instal-suhosin-php-5-protection-security-patch-red-hat-el5-centos-el5-linux.html&amp;title=How%20to%20Instal%20Suhosin%20PHP%205%20Protection%20Security%20Patch%20%26%238211%3B%20Red%20Hat%20EL5%20%2F%20CentOS%20EL5%20Linux"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-instal-suhosin-php-5-protection-security-patch-red-hat-el5-centos-el5-linux.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Install GRUB on the other Disk</title>
		<link>http://lpilinux.com/how-to-install-grub-on-the-other-disk.html</link>
		<comments>http://lpilinux.com/how-to-install-grub-on-the-other-disk.html#comments</comments>
		<pubDate>Sat, 10 Apr 2010 05:35:25 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux How to]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-install-grub-on-the-other-disk.html</guid>
		<description><![CDATA[After adding a new disk to your raid chain it&#8217;s a good idea to make it bootable as well by installing grub on MBR. When boot drive in your raid array becomes faulty all you&#8217;ve to do is to power &#8230; <a href="http://lpilinux.com/how-to-install-grub-on-the-other-disk.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-grub-on-the-other-disk.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-grub-on-the-other-disk.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>After adding a new disk to your raid chain it&#8217;s a good idea to make it bootable as well by installing grub on MBR. When boot drive in your raid array becomes faulty all you&#8217;ve to do is to power off your machine, substitute your faulty drive and boot your computer again. If you&#8217;ve properly set bios boot sequence to iterate between primary, secondary, &#8230; you can boot your raid array again, second or third HD makes the boot because you&#8217;ve installed grub on it, pretty easy and straightforward, this contributes to have a bulletproof system.</p>
<p>How to install grub on other disks ?</p>
<p>First enter grub console:</p>
<p>~# grub<br />
Probing devices to guess BIOS drives. This may take a long time.</p>
<p>GNU GRUB  version 0.97  (640K lower / 7168K upper memory)<br />
[ Minimal BASH-like line editing is supported.  For the first word, TAB<br />
   lists possible command completions.  Anywhere else TAB lists the possible<br />
   completions of a device/filename. ]<br />
grub> root (hd1,0)<br />
grub> setup (hd1)<br />
grub> quit</p>
<p>Where HD1 means second disk (grub starts counting from 0), HD2 means third disk and so on</p>
<p>If you&#8217;ve your boot partition inside a drive array as well it becomes easy to swap disks and replace them when faulty, here&#8217;s an example:</p>
<p>boba:~# fdisk -l /dev/sda<br />
Disk /dev/sda: 320.0 GB, 320072933376 bytes<br />
255 heads, 63 sectors/track, 38913 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
Disk identifier: 0x0003272d<br />
   Device Boot      Start         End      Blocks   Id  System<br />
/dev/sda1   *           1          12       96358+  fd  Linux raid autodetect<br />
/dev/sda2              13          73      489982+  fd  Linux raid autodetect<br />
/dev/sda3              74         681     4883760   fd  Linux raid autodetect<br />
/dev/sda4             682       38913   307098540   fd  Linux raid autodetect</p>
<p>take a look at my fstab:</p>
<p>boba:~# cat /etc/fstab<br />
# /etc/fstab: static file system information.<br />
#<br />
# <file system> <mount point>   <type><br />
<options>       <dump>
<pass>
proc            /proc           proc    defaults        0       0<br />
/dev/md2        /               ext3    errors=remount-ro 0       1<br />
/dev/md0        /boot           ext2    defaults        0       2<br />
/dev/mapper/storage-storage /home           xfs     defaults        0       2<br />
/dev/md1        none            swap    sw              0       0<br />
/dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0</p>
<p>As you can see my /dev/md0 is the boot partition, /dev/sda1 is a part of it, it doesn&#8217;t matter if you&#8217;re using RAID1,5,6,10,&#8230;</p>
<p>With this hint you can boot your machine again, even if your primary disk has gone </pass></dump></options></type></mount></file> </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flpilinux.com%2Fhow-to-install-grub-on-the-other-disk.html&amp;title=How%20to%20Install%20GRUB%20on%20the%20other%20Disk"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-install-grub-on-the-other-disk.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

