<?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>EZ Linux Admin &#187; Cheat Sheets</title>
	<atom:link href="http://www.ezlinuxadmin.com/category/cheat-sheets/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ezlinuxadmin.com</link>
	<description>Making Linux Easier</description>
	<lastBuildDate>Tue, 29 Jun 2010 19:37:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Path to date</title>
		<link>http://www.ezlinuxadmin.com/2010/05/path-to-date/</link>
		<comments>http://www.ezlinuxadmin.com/2010/05/path-to-date/#comments</comments>
		<pubDate>Tue, 25 May 2010 03:22:09 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Linux Operating Systems]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[path to date]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=474</guid>
		<description><![CDATA[The server path to date can very for different servers, you will need to run this command to find it:
which date
For most servers it is:
/bin/date
This is the same for perl and php
]]></description>
			<content:encoded><![CDATA[<p>The server path to date can very for different servers, you will need to run this command to find it:</p>
<blockquote><p>which date</p></blockquote>
<p>For most servers it is:</p>
<blockquote><p>/bin/date</p></blockquote>
<p>This is the same for perl and php</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2010/05/path-to-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fsck</title>
		<link>http://www.ezlinuxadmin.com/2010/04/fsck/</link>
		<comments>http://www.ezlinuxadmin.com/2010/04/fsck/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 02:01:27 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[disk error]]></category>
		<category><![CDATA[FSCK]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=466</guid>
		<description><![CDATA[fsck -a
Will automatically fix errors.
]]></description>
			<content:encoded><![CDATA[<blockquote><p>fsck -a</p></blockquote>
<p>Will automatically fix errors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2010/04/fsck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When asking about a networking issue, get these details from the server</title>
		<link>http://www.ezlinuxadmin.com/2010/04/asking-networking-issue-server/</link>
		<comments>http://www.ezlinuxadmin.com/2010/04/asking-networking-issue-server/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 20:14:04 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[lan]]></category>
		<category><![CDATA[networking issue]]></category>
		<category><![CDATA[nic]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=460</guid>
		<description><![CDATA[Kernal version
uname -a 
Nic / Lan driver version
dmesg &#124; grep r8169
Internet controller
lspci -nn &#124; grep Ethernet
Details on etho nic card
sudo ethtool eth0
Module size
lsmod &#124; grep r8169
Module versions
cat /proc/modules &#124; grep r8169
Don&#8217;t worry all these commands are safe and just for reporting.



]]></description>
			<content:encoded><![CDATA[<p>Kernal version</p>
<blockquote><p><span><span style="font-family: Courier New;">uname -a </span></span></p></blockquote>
<p>Nic / Lan driver version</p>
<blockquote><p><span><span style="font-family: Courier New;">dmesg | grep r8169</span></span></p></blockquote>
<p>Internet controller</p>
<blockquote><p><span><span style="font-family: Courier New;">lspci -nn | grep Ethernet</span></span></p></blockquote>
<p>Details on etho nic card</p>
<blockquote><p><span><span style="font-family: Courier New;">sudo ethtool eth0</span></span></p></blockquote>
<p>Module size</p>
<blockquote><p><span><span style="font-family: Courier New;">lsmod | grep r8169</span></span></p></blockquote>
<p>Module versions</p>
<blockquote><p><span><span style="font-family: Courier New;">cat /proc/modules | grep r8169</span></span></p></blockquote>
<p><span><span style="font-family: Courier New;"><strong>Don&#8217;t worry all these commands are safe and just for reporting.</strong><br />
</span></span></p>
<p><span><span style="font-family: Courier New;"><br />
</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2010/04/asking-networking-issue-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mod_cband the new Mod_Bandwidth</title>
		<link>http://www.ezlinuxadmin.com/2010/03/mod_cband-the-new-mod_bandwidth/</link>
		<comments>http://www.ezlinuxadmin.com/2010/03/mod_cband-the-new-mod_bandwidth/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 02:52:12 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Cpanel and WHM]]></category>
		<category><![CDATA[Linux Security]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[limit server bandwidth]]></category>
		<category><![CDATA[mod_bandwidth]]></category>
		<category><![CDATA[mod_cband]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=453</guid>
		<description><![CDATA[I spent hours trying to get mod_bandwidth to work simply because I have used it for years. But now with Apache 2.0 times have changed and there is a better option for Linux and it&#8217;s free. The new mod to regulate bandwidth and more is called Mod_cband I&#8217;m not sure what cband means but I [...]]]></description>
			<content:encoded><![CDATA[<p>I spent hours trying to get mod_bandwidth to work simply because I have used it for years. But now with Apache 2.0 times have changed and there is a better option for Linux and it&#8217;s free. The new mod to regulate bandwidth and more is called Mod_cband I&#8217;m not sure what cband means but I can guess channel bandwidth.</p>
<p>Here is how to get it set up with Cantos 5.3 easily.</p>
<p>I wanted to host for my brother the latest WoW patch, but at a hefty 450 MB, I didn’t want to blow all my bandwidth on it either. I am setting a limit for the download at 2.5 TB of bandwidth, and limiting it to 5mbs at 10 connections a second. My hardware is RHEL 4 running on a P4 with Plesk 8. In the guide to follow, you’ll see a few steps that wouldn’t be needed on a non-plesk system. To setup bandwidth limiting for the host, we need to be able to compile a new apache module against our system, and then install and configure it.</p>
<p>Step 1: The prereqs</p>
<p>First I needed to setup a yum repository for FC4. This can be accomplished by issuing an RPM command:</p>
<p>rpm -ivh http://rpm.livna.org/livna-release-4.rpm</p>
<p>Now that you can access the RPM packages, we need to install http-devel using yum:</p>
<p>yum install httpd-devel</p>
<p>If all went well, we can now extract, compile, and install mod_cband for apache:</p>
<p>cd /tmp<br />
wget http://cband.linux.pl/download/mod-cband-0.9.7.4.tgz<br />
tar xzvf mod-cband-0.9.7.4.tgz<br />
cd mod-cband-0.9.7.4<br />
./configure<br />
make<br />
make install</p>
<p>If all went well, restart apache with the new module (you can check httpd.conf to make sure the module is going to be loaded):</p>
<p>/etc/init.d/httpd restart</p>
<p>Step 2: Configuration</p>
<p>Here’s where the Plesk part gets annoying. We can’t just edit our vhosts file, because plesk writes over it all the time. Instead, we edit a /home/httpd/vhosts/*/subdomains/*/conf/vhost.conf file. Mine looks like this:</p>
<p>CBandScoreboard /var/www/scoreboard<br />
CBandPeriod 4W<br />
CBandDefaultExceededCode 509<br />
CBandLimit 2500G<br />
CBandSpeed 5000 5 10<br />
CBandRemoteSpeed 1600 3 1<br />
&lt;Location /cband-status&gt;<br />
SetHandler cband-status<br />
&lt;/Location&gt;<br />
&lt;Location /cband-status-me&gt;<br />
SetHandler cband-status-me<br />
&lt;/Location&gt;</p>
<p>What does this mean? (1) Use /var/www/scoreboard to log usage and limits (2) Reset the limit count every 4 weeks (3) Throw a 509 error when the limits are exceeded (4) Allow 2.5TB per period (5) Allow 5mbs with 5 requests a second and 10 connections at a time oeverall (6) Allow 1.6mbs with 3 requests a second and 1 connections at a time per client (7) Allow us to access a page at /cband-status to view the status.</p>
<p>You’ll also need to issue commands to make the scoreboard directory, and to allow apache to own it:</p>
<p>mkdir /var/www/scoreboard<br />
chown apache:apache /var/www/scoreboard</p>
<p>Finally, Plesk requires you to inform it of your work:</p>
<p>/usr/local/psa/admin/sbin/websrvmng -u &#8211;vhost-name=yourdomain.com</p>
<p>If you restart Apache now, everything should work!</p>
<p>/etc/init.d/httpd restart</p>
<p>Step 3: An Example</p>
<p>You can take a peek at my status page right now if you’d like. It looks a bit like this:</p>
<p><a href="http://www.ezlinuxadmin.com/wp-content/uploads/2010/03/cband-panel.jpg"><img class="alignnone size-full wp-image-454" title="cband-panel" src="http://www.ezlinuxadmin.com/wp-content/uploads/2010/03/cband-panel.jpg" alt="" width="450" height="209" /></a></p>
<p>A quick note, I simply just added:</p>
<blockquote><p>CBandPeriod 4W<br />
CBandLimit 10000G<br />
CBandSpeed 12000 40 80<br />
CBandRemoteSpeed 6400 12 4</p></blockquote>
<p>Now this set the limit to about 12 megs (MPS) a second which is a lot, but this customer is paying $250 a month to cover it. Most websites should max at about 5 MPS. I left out the other options because I didn&#8217;t need them and it&#8217;s less load on the server without them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2010/03/mod_cband-the-new-mod_bandwidth/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to do a search and replace over multiple files</title>
		<link>http://www.ezlinuxadmin.com/2010/03/how-to-do-a-search-and-replace-over-multiple-files/</link>
		<comments>http://www.ezlinuxadmin.com/2010/03/how-to-do-a-search-and-replace-over-multiple-files/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 03:51:46 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[search and replace]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=439</guid>
		<description><![CDATA[You could also use find and sed, but I find that this little line of perl works nicely.
perl -pi -w -e &#8217;s/search/replace/g;&#8217; *.php
-e means execute the following line of code.
-i means edit in-place
-w write warnings
-p loop
Example I had the following style sheet in a section:
&#60;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;../includes/style.css&#8221;&#62;
and I wanted the following instead:
&#60;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>You could also use find and sed, but I find that this little line of perl works nicely.<br />
perl -pi -w -e &#8217;s/search/replace/g;&#8217; *.php</p>
<p>-e means execute the following line of code.<br />
-i means edit in-place<br />
-w write warnings<br />
-p loop</p>
<p>Example I had the following style sheet in a section:<br />
&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;../includes/style.css&#8221;&gt;</p>
<p>and I wanted the following instead:<br />
&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;admin.css&#8221;&gt;</p>
<p>As each expression is a regular expression you&#8217;ve got to escape the special characters such as forward slash and .<br />
\.\.\/includes\/style\.css</p>
<p>So the final line of code ends up as<br />
perl -pi -w -e &#8217;s/\.\.\/includes\/style\.css/admin\.css/g;&#8217; *.php</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2010/03/how-to-do-a-search-and-replace-over-multiple-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calm down rsync if it overloads your IO memory or CPU</title>
		<link>http://www.ezlinuxadmin.com/2010/03/rsync-overloads-io-memory-cpu/</link>
		<comments>http://www.ezlinuxadmin.com/2010/03/rsync-overloads-io-memory-cpu/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 11:57:14 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Linux Security]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[limit io]]></category>
		<category><![CDATA[limit rsync]]></category>
		<category><![CDATA[rsync io]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=430</guid>
		<description><![CDATA[The trick is to limit I/O bandwidth for rsync.
The &#8211;bwlimit option limit I/O bandwidth. You need to set bandwidth using KBytes per second. For example, limit I/O bandwidth to 10000KB/s (9.7MB/s), enter:
rsync &#8211;delete &#8211;numeric-ids &#8211;relative &#8211;delete-excluded &#8211;bwlimit=10000 /path/to/source /path/to/dest/?
10 megs a second is plenty of speed and will keep the server running smoothly when your [...]]]></description>
			<content:encoded><![CDATA[<p>The trick is to limit I/O bandwidth for rsync.</p>
<p>The &#8211;bwlimit option limit I/O bandwidth. You need to set bandwidth using KBytes per second. For example, limit I/O bandwidth to 10000KB/s (9.7MB/s), enter:</p>
<blockquote><p>rsync &#8211;delete &#8211;numeric-ids &#8211;relative &#8211;delete-excluded &#8211;bwlimit=10000 /path/to/source /path/to/dest/?</p></blockquote>
<p>10 megs a second is plenty of speed and will keep the server running smoothly when your grabbing allot of files off of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2010/03/rsync-overloads-io-memory-cpu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Default MYSQL port</title>
		<link>http://www.ezlinuxadmin.com/2010/02/default-mysql-port/</link>
		<comments>http://www.ezlinuxadmin.com/2010/02/default-mysql-port/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 20:48:58 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Linux Security]]></category>
		<category><![CDATA[Ports]]></category>
		<category><![CDATA[default mysql port]]></category>
		<category><![CDATA[mysql port]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=419</guid>
		<description><![CDATA[The default MYSQL port is:
3306
]]></description>
			<content:encoded><![CDATA[<p>The default MYSQL port is:</p>
<blockquote><p>3306</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2010/02/default-mysql-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show All Running Processes in Linux</title>
		<link>http://www.ezlinuxadmin.com/2010/01/show-all-running-processes-in-linux/</link>
		<comments>http://www.ezlinuxadmin.com/2010/01/show-all-running-processes-in-linux/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 04:53:57 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[process linux]]></category>
		<category><![CDATA[ps]]></category>
		<category><![CDATA[show all process]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=382</guid>
		<description><![CDATA[To see every process type:
ps -A
To see every process except what&#8217;s running from root type:
ps -U root -u root -N
]]></description>
			<content:encoded><![CDATA[<p>To see every process type:</p>
<blockquote><p>ps -A</p></blockquote>
<p>To see every process except what&#8217;s running from root type:</p>
<blockquote><p>ps -U root -u root -N</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2010/01/show-all-running-processes-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change root or user password on a Linux server</title>
		<link>http://www.ezlinuxadmin.com/2010/01/change-root-or-user-password-on-a-linux-server/</link>
		<comments>http://www.ezlinuxadmin.com/2010/01/change-root-or-user-password-on-a-linux-server/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 18:26:24 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Linux Security]]></category>
		<category><![CDATA[change root user password linux]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=372</guid>
		<description><![CDATA[Simple when logged in with the user type:
passwd
Then enter the new password twice to save it.
To change the root password on a Linux server you have to be logged in as root.
]]></description>
			<content:encoded><![CDATA[<p>Simple when logged in with the user type:</p>
<blockquote><p>passwd</p></blockquote>
<p>Then enter the new password twice to save it.</p>
<p>To change the root password on a Linux server you have to be logged in as root.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2010/01/change-root-or-user-password-on-a-linux-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to reduce or free space in /usr partition</title>
		<link>http://www.ezlinuxadmin.com/2010/01/reduce-free-space-usr-partition/</link>
		<comments>http://www.ezlinuxadmin.com/2010/01/reduce-free-space-usr-partition/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 19:39:02 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[free /usr space]]></category>
		<category><![CDATA[reduce /usr space]]></category>
		<category><![CDATA[remove /usr files]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=368</guid>
		<description><![CDATA[1. Restart the httpd service. This might free a little space some times.
2. Check for apache logs like error_log, access_log , suexec_log in /usr/local/apache/logs . These can either be cleared off or if you need the logs then you can take a zipped copy and keep it aside.
3. Same can be done for the files [...]]]></description>
			<content:encoded><![CDATA[<p>1. Restart the httpd service. This might free a little space some times.</p>
<p>2. Check for apache logs like error_log, access_log , suexec_log in /usr/local/apache/logs . These can either be cleared off or if you need the logs then you can take a zipped copy and keep it aside.</p>
<p>3. Same can be done for the files in cPanel logs (/usr/local/cpanel/logs) as well .</p>
<p>4. Domlogs – Get into the /usr/local/apache/domlogs/ directory. Run the following command :-</p>
<p># ls -al -SR | head -10 —&gt; It will list 10 files in the decreasing order according to their size</p>
<p>If the domlog file is too large for a domain then it is possible that awstats is not running . Check whether cpanellogd is running on the server using pstree . If not, restart it .<br />
Else, it is possible that awstats for only that particular domain is not updating. Get into the directory /usr/local/cpanel/base and check if any file as ‘awstats.domainname.com.conf’ exists. If yes , delete that file.</p>
<p>Now, run /scripts/runweblogs for that user. It will update the awstats and automatically clear the domlogs file thereafter. Do not delete the domlogs file itself.</p>
<p>5. Remove old and unwanted backups of ‘apache’ that might have been taken long ago. Also, check for any other duplicate folders that can be removed safely.</p>
<p>6. Remove core files, if any . Normally, some core files (like core.1234) might be present in /usr/local/cpanel/whostmgr/docroot . Check for these and remove them.</p>
<p>7. Restart your server, the quota might be off for that partition and reboot will correct it. Keep in mind if there is a harddrive error this can leave the server offline while the system or admin tuns a FSDK.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2010/01/reduce-free-space-usr-partition/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
