<?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, Programming, Telephony, Asterisk, Apache, Tips &#38; Tricks &#187; Linux</title>
	<atom:link href="http://shahidz.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://shahidz.com</link>
	<description>Passionate About Technology</description>
	<lastBuildDate>Sun, 10 Jan 2010 17:38:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>moving mysql data directory</title>
		<link>http://shahidz.com/moving-mysql-data-directory/</link>
		<comments>http://shahidz.com/moving-mysql-data-directory/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 17:38:11 +0000</pubDate>
		<dc:creator>Shahid</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[Securities]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://shahidz.com/?p=104</guid>
		<description><![CDATA[In some cases you have to change the default MySql data directory, for doing this you have to follow some steps. Here I will explain each steps one by one.

Stop MySql server using following command.
$ sudo /etc/init.d/mysql stop
Copy the existing data directory (which is located in /var/lib/mysql) using following command.
$ sudo cp -R -p /var/lib/mysql /path/to/new/datadir
Edit [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://shahidz.com/wp-content/uploads/2010/01/logo-mysql-300x218.jpg"><img class="alignleft size-full wp-image-117" title="logo-mysql-300x218" src="http://shahidz.com/wp-content/uploads/2010/01/logo-mysql-300x218.jpg" alt="" width="300" height="218" /></a>In some cases you have to change the default MySql data directory, for doing this you have to follow some steps. Here I will explain each steps one by one.</p>
<ol>
<li>Stop MySql server using following command.</li>
<pre>$ sudo /etc/init.d/mysql stop</pre>
<li>Copy the existing data directory (which is located in <em>/var/lib/mysql</em>) using following command.</li>
<pre>$ sudo cp -R -p /var/lib/mysql /path/to/new/datadir</pre>
<li>Edit the MySQL configuration file with your favorite text editor.</li>
<pre>$ sudo vim /etc/mysql/my.cnf</pre>
<li>Find the entry for <em>datadir</em>, change the path to the new data directory.</li>
<li>Some Linux distributions uses some security software called <strong>AppArmor </strong>that specifies the areas of your filesystem applications are allowed to access. Unless you modify the AppArmor profile for MySQL, you&#8217;ll never be able to restart MySQL with the new datadir location. So edit the file <em>/etc/apparmor.d/usr.sbin.mysqld</em> using your favorite editor.</li>
<pre>$ sudo vim /etc/apparmor.d/usr.sbin.mysqld</pre>
<li>Duplicate the lines beginning with <em>/var/lib/mysql</em> and replace duplicated strings with /<em>new_datadir.</em></li>
<pre><em>/var/lib/mysql/ r,
/var/lib/mysql/** rwk,
/var/log/mysql/ r,
/var/log/mysql/* rw,
#
/path/to/new/datadir r,
/path/to/new/datadir** rwk,
/path/to/new/datadir r,
/path/to/new/datadir* rw,</em></pre>
<li>Restart the AppArmor profiles with the following command.</li>
<pre>$ sudo /etc/init.d/apparmor restart</pre>
<li>Restart the MySql server with the following command.</li>
<pre>$ sudo /etc/init.d/mysql start</pre>
</ol>
<p>MySQL should now start without any errors and your data will be stored in the new location.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fshahidz.com%2Fmoving-mysql-data-directory%2F&amp;linkname=moving%20mysql%20data%20directory"><img src="http://shahidz.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://shahidz.com/moving-mysql-data-directory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>dmidecode &#8211; DMI table decoder</title>
		<link>http://shahidz.com/dmidecode-dmi-table-decoder/</link>
		<comments>http://shahidz.com/dmidecode-dmi-table-decoder/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 09:41:35 +0000</pubDate>
		<dc:creator>Shahid</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://shahidz.com/?p=95</guid>
		<description><![CDATA[
dmidecode  is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. Thanks to this table, you can  retrieve  this information without having to probe for [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-96" title="ecsgf7050mmv20-002" src="http://shahidz.com/wp-content/uploads/2009/10/ecsgf7050mmv20-002-300x185.jpg" alt="ecsgf7050mmv20-002" width="300" height="185" /></p>
<p>dmidecode  is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. Thanks to this table, you can  retrieve  this information without having to probe for the actual hardware.  While this is a good point in terms of report speed and safeness, this also makes the presented information possibly unreliable.</p>
<p>The DMI table doesn’t only describe what the system is currently made of, it also can report the possible evolutions (such as the fastest supported CPU or the maximal amount of memory supported).</p>
<p>SMBIOS  stands  for  System Management BIOS, while DMI stands for Desktop Management Interface. Both standards are tightly related and developed by the DMTF (Desktop Management Task Force).</p>
<p>As you run it, dmidecode will try to locate the DMI table. If it succeeds, it will then parse this table and display a list of  records  like  this one:</p>
<pre>
<div>DMI TYPES</div>
<div>       The SMBIOS specification defines the following DMI types:</div>
<div></div>
<div>       Type   Information</div>
<div>       ----------------------------------------</div>

          0   BIOS
          1   System
          2   Base Board
          3   Chassis
          4   Processor
          5   Memory Controller
          6   Memory Module
          7   Cache
          8   Port Connector
          9   System Slots
         10   On Board Devices
         11   OEM Strings
         12   System Configuration Options
         13   BIOS Language
         14   Group Associations
         15   System Event Log
         16   Physical Memory Array
         17   Memory Device
         18   32-bit Memory Error
         19   Memory Array Mapped Address
         20   Memory Device Mapped Address
         21   Built-in Pointing Device
         22   Portable Battery
         23   System Reset
         24   Hardware Security
         25   System Power Controls
         26   Voltage Probe
         27   Cooling Device
         28   Temperature Probe
         29   Electrical Current Probe
         30   Out-of-band Remote Access
         31   Boot Integrity Services
         32   System Boot
         33   64-bit Memory Error
         34   Management Device
         35   Management Device Component
         36   Management Device Threshold Data
         37   Memory Channel
         38   IPMI Device
         39   Power Supply</pre>
<p>Additionally,  type 126 is used for disabled entries and type 127 is an end-of-table marker. Types 128 to 255 are for OEM-specific data.  dmidecode will display these entries by default, but it can only decode them when the vendors have contributed documentation or code for them.<br />
Keywords can be used instead of type numbers with &#8211;type.  Each keyword is equivalent to a list of type numbers:</p>
<pre>Keyword     Types
       ------------------------------
       bios        0, 13
       system      1, 12, 15, 23, 32
       baseboard   2, 10
       chassis     3
       processor   4
       memory      5, 6, 16, 17
       cache       7
       connector   8
       slot        9
</pre>
<div>Usage :</div>
<div>dmidecode &#8211;type 0 &#8211;type 13 or dmidecode &#8211;type BIOS</div>
<p>To get physical memory details, use the following commainds.</p>
<pre>$ sudo dmidecode -t 16
# dmidecode 2.9
SMBIOS 2.4 present.

Handle 0x000F, DMI type 16, 15 bytes
Physical Memory Array
	Location: System Board Or Motherboard
	Use: System Memory
	Error Correction Type: None
	Maximum Capacity: 4 GB
	Error Information Handle: Not Provided
	Number Of Devices: 2</pre>
<div>To get memory details, use the following commainds.</div>
<pre>$ sudo dmidecode -t 17
# dmidecode 2.9
SMBIOS 2.4 present.

Handle 0x0010, DMI type 17, 27 bytes
Memory Device
	Array Handle: 0x000F
	Error Information Handle: No Error
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 1024 MB
	Form Factor: SODIMM
	Set: 1
	Locator: M1
	Bank Locator: Bank 0
	Type: DDR2
	Type Detail: Synchronous
	Speed: 667 MHz (1.5 ns)
	Manufacturer: Mfg 0
	Serial Number: 1234-B0
	Asset Tag: Not Specified
	Part Number: SODIMM000

Handle 0x0011, DMI type 17, 27 bytes
Memory Device
	Array Handle: 0x000F
	Error Information Handle: No Error
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 2048 MB
	Form Factor: SODIMM
	Set: 1
	Locator: M2
	Bank Locator: Bank 1
	Type: DDR2
	Type Detail: Synchronous
	Speed: 667 MHz (1.5 ns)
	Manufacturer: Mfg 1
	Serial Number: 1234-B1
	Asset Tag: Not Specified
	Part Number: SODIMM001</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fshahidz.com%2Fdmidecode-dmi-table-decoder%2F&amp;linkname=dmidecode%20%26%238211%3B%20DMI%20table%20decoder"><img src="http://shahidz.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://shahidz.com/dmidecode-dmi-table-decoder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How A Microsoft Veteran Learned To Love Linux And Why It Matters</title>
		<link>http://shahidz.com/how-a-microsoft-veteran-learned-to-love-linux-and-why-it-matters/</link>
		<comments>http://shahidz.com/how-a-microsoft-veteran-learned-to-love-linux-and-why-it-matters/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 10:52:52 +0000</pubDate>
		<dc:creator>Shahid</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Keith Curtis]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://shahidz.com/?p=88</guid>
		<description><![CDATA[Great Article
&#8220;After The Software Wars&#8221;, is a new book in which former Microsoft employee Keith Curtis explores the worlds of proprietary and free software. Quoting from the article:
While I came to not be all that thrilled with Fedora itself, I was floored merely by the installation process. It contained a graphical installer that ran all [...]]]></description>
			<content:encoded><![CDATA[<p>Great Article</p>
<p>&#8220;After The Software Wars&#8221;, is a new book in which former Microsoft employee Keith Curtis explores the worlds of proprietary and free software. Quoting from the article:</p>
<p>While I came to not be all that thrilled with Fedora itself, I was floored merely by the installation process. It contained a graphical installer that ran all the way to completion, it resized my NTFS partition &#8212; which I considered a minor miracle, setup dual boot, and actually did boot, and let me surf the Web. I didn&#8217;t have a clue what to do next, but the mere fact that this all worked told me more about the potential of Linux than anything I had read so far. You cannot, by accident, build an airplane that actually flies.</p>
<p>Read More : <a title="How A Microsoft Veteran Learned To Love Linux And Why It Matters" href="http://www.techflash.com/How_a_Microsoft_veteran_learned_to_love_Linux_and_why_it_matters_48542167.html" target="_blank">How A Microsoft Veteran Learned To Love Linux And Why It Matters</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fshahidz.com%2Fhow-a-microsoft-veteran-learned-to-love-linux-and-why-it-matters%2F&amp;linkname=How%20A%20Microsoft%20Veteran%20Learned%20To%20Love%20Linux%20And%20Why%20It%20Matters"><img src="http://shahidz.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://shahidz.com/how-a-microsoft-veteran-learned-to-love-linux-and-why-it-matters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autocompletion in Terminal is not working</title>
		<link>http://shahidz.com/autocompletion-in-terminal-is-not-working/</link>
		<comments>http://shahidz.com/autocompletion-in-terminal-is-not-working/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 06:59:23 +0000</pubDate>
		<dc:creator>Shahid</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[teminal]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://shahidz.com/?p=84</guid>
		<description><![CDATA[One of the most helpful feature I find in linux boxes is it autocomplete fasility. This feature will make our job more easier. But in some servers or VPS this option is desabled by default or relevent packages for autocomplete where not installed. To enable autocomplete we need to two things.
1. Install the package &#8220;bash-completion&#8221;
$ [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most helpful feature I find in linux boxes is it autocomplete fasility. This feature will make our job more easier. But in some servers or VPS this option is desabled by default or relevent packages for autocomplete where not installed. To enable autocomplete we need to two things.</p>
<p>1. Install the package &#8220;<strong>bash-completion</strong>&#8221;</p>
<pre>$ sudo apt-get install bash-completion</pre>
<p>2. Add the following lines to the file ~/.bashrc or /etc/bash.bashrc</p>
<pre>if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fshahidz.com%2Fautocompletion-in-terminal-is-not-working%2F&amp;linkname=Autocompletion%20in%20Terminal%20is%20not%20working"><img src="http://shahidz.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://shahidz.com/autocompletion-in-terminal-is-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eucalyptus in Ubuntu Jaunty</title>
		<link>http://shahidz.com/eucalyptus-in-ubuntu-jaunty/</link>
		<comments>http://shahidz.com/eucalyptus-in-ubuntu-jaunty/#comments</comments>
		<pubDate>Fri, 01 May 2009 12:18:52 +0000</pubDate>
		<dc:creator>Shahid</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[elastic]]></category>
		<category><![CDATA[eucalyptus]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[S3]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://shahidz.com/?p=79</guid>
		<description><![CDATA[The Ubuntu 9.04 Server Edition beta includes Eucalyptus, an open source software infrastructure for implementing “cloud computing” on clusters, such as Amazon’s EC2 (Elastic Compute Cloud). Eucalyptus is provided as a technology preview to allow users “to experiment with cloud computing”.
EUCALYPTUS &#8212; Elastic Utility Computing Architecture for Linking Your Programs To Useful Systems &#8212; is [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">The Ubuntu 9.04 Server Edition beta includes Eucalyptus, an open source software infrastructure for implementing “cloud computing” on clusters, such as Amazon’s EC2 (Elastic Compute Cloud). Eucalyptus is provided as a technology preview to allow users “to experiment with cloud computing”.</p>
<p style="text-align: justify;"><strong>EUCALYPTUS</strong> &#8212; <strong>Elastic Utility Computing Architecture for Linking Your Programs To Useful Systems</strong> &#8212; is an open-source software infrastructure for implementing Elastic/Utility/Cloud computing using computing clusters and/or workstation farms.  The current interface to EUCALYPTUS is interface-compatible with Amazon.com&#8217;s EC2 (arguably the most commercially successful Cloud computing service), but the infrastructure is designed to be modified and extended so that multiple client-side interfaces can be supported.  In addition, EUCALYPTUS is implemented using commonly-available Linux tools and basic web service technology making it easy to install and maintain. For more information click <a href="http://open.eucalyptus.com/wiki/EucalyptusOverview" target="_blank">here</a>.</p>
<p style="text-align: justify;">Get the User Guide from this link <a href="http://http://open.eucalyptus.com/wiki/EucalyptusUserGuide_v1.4" target="_blank">http://open.eucalyptus.com/wiki/EucalyptusUserGuide_v1.4</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fshahidz.com%2Feucalyptus-in-ubuntu-jaunty%2F&amp;linkname=Eucalyptus%20in%20Ubuntu%20Jaunty"><img src="http://shahidz.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://shahidz.com/eucalyptus-in-ubuntu-jaunty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Date Command Option</title>
		<link>http://shahidz.com/linux-date-command-option/</link>
		<comments>http://shahidz.com/linux-date-command-option/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 05:59:13 +0000</pubDate>
		<dc:creator>Shahid</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[option]]></category>

		<guid isPermaLink="false">http://shahidz.com/?p=77</guid>
		<description><![CDATA[Date command options.
Date command to get the current date.
$ date=$(date +%Y-%m-%d)
$ echo $date
Date command to get yesterday&#8217;s date.
$ date=$(date --date=yesterday +%Y-%m-%d)
$ echo $date
Date command to get tomorrow&#8217;s date.
$ date=$(date --date=tomorrow +%Y-%m-%d)
$ echo $date
]]></description>
			<content:encoded><![CDATA[<p><strong>Date command options.</strong></p>
<p>Date command to get the current date.</p>
<pre>$ date=$(date +%Y-%m-%d)
$ echo $date</pre>
<p>Date command to get yesterday&#8217;s date.</p>
<pre>$ date=$(date --date=yesterday +%Y-%m-%d)
$ echo $date</pre>
<p>Date command to get tomorrow&#8217;s date.</p>
<pre>$ date=$(date --date=tomorrow +%Y-%m-%d)
$ echo $date</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fshahidz.com%2Flinux-date-command-option%2F&amp;linkname=Linux%20Date%20Command%20Option"><img src="http://shahidz.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://shahidz.com/linux-date-command-option/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bad Customer service from Lenovo for their Laptops</title>
		<link>http://shahidz.com/bad-customer-service-from-lenovo-for-their-laptops/</link>
		<comments>http://shahidz.com/bad-customer-service-from-lenovo-for-their-laptops/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 07:46:41 +0000</pubDate>
		<dc:creator>Shahid</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[lenovo]]></category>
		<category><![CDATA[service]]></category>

		<guid isPermaLink="false">http://shahidz.com/bad-customer-service-from-lenovo-for-their-laptops/</guid>
		<description><![CDATA[This is a true story of one of my friend
&#8220;This a true story of mine. I brought a Lenovo 3000N200 series laptop one year back, exactly 21’st Feb 2008 from Dubai Shopping festival for Rs 35, 000. I was very satisfied with their product initially, as it is cost effective with good performance. But after [...]]]></description>
			<content:encoded><![CDATA[<p>This is a true story of one of my friend</p>
<p><span id="konasapn0">&#8220;This a true story of mine. I brought a Lenovo 3000N200 series <a href="http://www.shahidz.com/tag/laptop" id="KonaLink1" class="kLink" style="text-decoration: underline ! important; position: static" target="_blank"><span style="font-weight: 400; font-size: 12px; position: static; color: #000000"><span class="kLink" style="font-weight: 400; font-size: 12px; position: static; font-family: Verdana,Arial,Helvetica,sans-serif; color: #000000">laptop</span></span></a> one year back, exactly 21’st Feb 2008 from Dubai Shopping festival for Rs 35, 000. I was very satisfied with their product initially, as it is cost effective with good performance. But after 3 months of working my laptop charger burnt out. I called up the customer care (18004252666) asking for the replacement and they said because it is burnt, they can’t replace it. For me, living without laptop and internet is worst thing in my life&#8221; </span></p>
<p><a href="http://www.iamatechie.com/lenovo-service-problems/" target="_blank">Read the complete story from the authors blog</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fshahidz.com%2Fbad-customer-service-from-lenovo-for-their-laptops%2F&amp;linkname=Bad%20Customer%20service%20from%20Lenovo%20for%20their%20Laptops"><img src="http://shahidz.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://shahidz.com/bad-customer-service-from-lenovo-for-their-laptops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eAccelerator</title>
		<link>http://shahidz.com/eaccelerator/</link>
		<comments>http://shahidz.com/eaccelerator/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 07:45:04 +0000</pubDate>
		<dc:creator>Shahid</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[accelerator]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[eAccelerator]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[optimizer]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[speed]]></category>

		<guid isPermaLink="false">http://shahidz.com/eaccelerator/</guid>
		<description><![CDATA[
eAccelerator is a free open-source PHP accelerator, optimizer, and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://shahidz.com/wp-content/uploads/2009/01/eaccelerator.png" alt="eAccelerator" /></p>
<p><a href="http://www.eaccelerator.net" title="www.eaccelerator.net" target="_blank">eAccelerator</a> is a free open-source PHP accelerator, optimizer, and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.</p>
<p>eAccelerator stores compiled PHP scripts in shared memory and executes code directly from it. It creates locks only for a short time, while searching for a compiled PHP script in the cache, so one script can be executed simultaneously by several engines. Files that can&#8217;t fit in shared memory are cached on disk only.</p>
<p><strong>Installing From Source</strong></p>
<p>unpack it by ::</p>
<pre>$ sudo tar -xjvf eaccelerator-0.9.5.3.tar.bz2
$ cd eaccelerator-0.9.5.3/</pre>
<p>Linux User Read README file</p>
<p>Windows User Read README.win32</p>
<p>Compile and install it with ::</p>
<pre>./configure
make
sudo make install
make test</pre>
<p>Add the below line to php.ini file</p>
<pre>extension=eaccelerator.so</pre>
<p>Check phpinfo()  and conform the module eAccelerator is loaded</p>
<p><img src="http://shahidz.com/wp-content/uploads/2009/01/screenshot.png" alt="phpinfo" /></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fshahidz.com%2Feaccelerator%2F&amp;linkname=eAccelerator"><img src="http://shahidz.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://shahidz.com/eaccelerator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell Script To Monit Swap Usage</title>
		<link>http://shahidz.com/shell-script-to-monit-swap-usage/</link>
		<comments>http://shahidz.com/shell-script-to-monit-swap-usage/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 17:44:59 +0000</pubDate>
		<dc:creator>Shahid</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[cron. swap]]></category>
		<category><![CDATA[monit]]></category>
		<category><![CDATA[swap-usage]]></category>
		<category><![CDATA[system admin]]></category>

		<guid isPermaLink="false">http://shahidz.com/shell-script-to-monit-swap-usage/</guid>
		<description><![CDATA[Some time our system started to use more swap area even 100% of swap area and the system crashes. So for a System Admin it would be very helpful when they get informed if the system started to use more swap usage so that system admin can manage the server before crashing. So I wrote [...]]]></description>
			<content:encoded><![CDATA[<p>Some time our system started to use more swap area even 100% of swap area and the system crashes. So for a System Admin it would be very helpful when they get informed if the system started to use more swap usage so that system admin can manage the server before crashing. So I wrote a shell script which will Alert by send mail if the system started to use more that 70% of swap area.</p>
<pre>$ vim swap-usage.sh</pre>
<pre>#!/bin/sh
free -m | grep Swap | while read output;
do
  swap=$(echo $output | awk '{print $2}' )
  used=$(echo $output | awk '{ print $3 }' )
  freed=$(echo $output | awk '{ print $4 }' )
  echo "Swap : $swap"
  echo "Used : $used"
  echo "Free : $freed"
  usep=`expr $used \* 100 / $swap`
  echo $usep
  if [ $usep -ge 70 ]; then
    echo "Swap Usage Alert Total Swap: \"$swap\" Used: \"$used ($usep%)\" Free:
\"$freed\" on $(hostname) as on $(date)" |
     mail -s "Alert: Swap Usage space $usep%" mail1@example.com,mail2@example.com
  fi
done</pre>
<p>This script will send mails to the specified mails, if the system started to use more than 70% of  swap area. For continuously check the swap usage we need to set a cronjob for executing this script. So that the system should monit the swap usage by executing this script.</p>
<p>Edit the corntab file.</p>
<pre>$ sudo crontab -e</pre>
<p>Set the cronjob to to execute the script in every 15 Mints.</p>
<pre>*/15 * * * * ~/scripts/swap-usage.sh</pre>
<p>Restart the Cron</p>
<pre>$ sudo /etc/init.d/cron restart</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fshahidz.com%2Fshell-script-to-monit-swap-usage%2F&amp;linkname=Shell%20Script%20To%20Monit%20Swap%20Usage"><img src="http://shahidz.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://shahidz.com/shell-script-to-monit-swap-usage/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Configuring Iptables on system startup</title>
		<link>http://shahidz.com/configuring-iptables-on-system-startup/</link>
		<comments>http://shahidz.com/configuring-iptables-on-system-startup/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 08:59:41 +0000</pubDate>
		<dc:creator>Shahid</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[Iptables]]></category>
		<category><![CDATA[start]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[stop]]></category>

		<guid isPermaLink="false">http://shahidz.com/configuring-iptables-on-system-startup/</guid>
		<description><![CDATA[In Ubuntu we don&#8217;t have a mechanism to start or stop iptables or we don&#8217;t have a mechanism to restore iptables after restarting the system. Now we will see how to create a script for start and stop iptables also to make the script to start on system startup.
1. Create a Firewall script
 vim /etc/set_iptables.bash
echo 1 [...]]]></description>
			<content:encoded><![CDATA[<p>In Ubuntu we don&#8217;t have a mechanism to start or stop <a href="http://shahidz.com/tag/iptables/" title="Iptables" target="_blank">iptables</a> or we don&#8217;t have a mechanism to restore <a href="http://shahidz.com/tag/iptables/" target="_blank">iptables</a> after restarting the system. Now we will see how to create a script for start and stop iptables also to make the script to start on system startup.</p>
<p>1. Create a Firewall script</p>
<pre> vim /etc/set_iptables.bash</pre>
<pre>echo 1 &gt; /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.10 --dport 555 -j DNAT --to 192.168.0.12:22
iptables -A FORWARD -p tcp -i eth0 -d 192.168.0.12 --dport 22 -j ACCEPT</pre>
<p>2. Change the file permission mod</p>
<pre>sudo chmod o+x /etc/set_iptables.bash</pre>
<p>3. Create a start.stop script</p>
<pre>vim /etc/init.d/iptables</pre>
<pre>#!/bin/bash

RETVAL=0

# To start the firewall
start() {
  echo -n "Iptables rules creation: "
  /etc/set_iptables.bash
  RETVAL=0
}

# To stop the firewall
stop() {
  echo -n "Removing all iptables rules: "
  /sbin/iptables -F
  RETVAL=0
}

case $1 in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    ;;
  status)
    /sbin/iptables -L
    /sbin/iptables -t nat -L
    RETVAL=0
    ;;
  *)
    echo "Usage: iptables {start|stop|restart|status}"
    RETVAL=1
esac
exit</pre>
<p>4. Change the file permission mod</p>
<pre>sudo chmod o+x /etc/init.d/iptables</pre>
<p>5. The final step is to make your script running on each boot of your computer:</p>
<pre>sudo update-rc.d iptables defaults</pre>
<p>Now you can use these commands to start/stop/restart/status your iptables.</p>
<pre>sudo /etc/init.d/iptables start
sudo /etc/init.d/iptables stop
sudo /etc/init.d/iptables restart
sudo /etc/init.d/iptables status</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fshahidz.com%2Fconfiguring-iptables-on-system-startup%2F&amp;linkname=Configuring%20Iptables%20on%20system%20startup"><img src="http://shahidz.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://shahidz.com/configuring-iptables-on-system-startup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
