<?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>Fri, 03 Feb 2012 18:43:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Tracking down the biggest folders</title>
		<link>http://www.ezlinuxadmin.com/2011/08/tracking-down-the-biggest-folders/</link>
		<comments>http://www.ezlinuxadmin.com/2011/08/tracking-down-the-biggest-folders/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 19:17:00 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Cpanel and WHM]]></category>
		<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Linux Security]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[finding a folder]]></category>
		<category><![CDATA[folder size]]></category>
		<category><![CDATA[folder size search]]></category>
		<category><![CDATA[list folder size]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=540</guid>
		<description><![CDATA[du -ax --max-depth 1 /var/cpanel &#124; sort -n &#124; tail This is a great command to simply find what folders are the biggest in a directory. You can replace the /var/cpanel with any folder and it will list everything in there and how big they are in order. Once you find the big folder then [...]]]></description>
			<content:encoded><![CDATA[<pre>du -ax --max-depth 1 /var/cpanel | sort -n | tail</pre>
<p>This is a great command to simply find what folders are the biggest in a directory. You can replace the /var/cpanel with any folder and it will list everything in there and how big they are in order.</p>
<p>Once you find the big folder then search inside of that to find the biggest folder in there and so on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2011/08/tracking-down-the-biggest-folders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cleaning up /var</title>
		<link>http://www.ezlinuxadmin.com/2011/08/cleaning-up-var/</link>
		<comments>http://www.ezlinuxadmin.com/2011/08/cleaning-up-var/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 18:53:38 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Cpanel and WHM]]></category>
		<category><![CDATA[Linux Operating Systems]]></category>
		<category><![CDATA[Linux Security]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[cleaning var partition]]></category>
		<category><![CDATA[moving data]]></category>
		<category><![CDATA[symlink]]></category>
		<category><![CDATA[var full]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=537</guid>
		<description><![CDATA[Cpanel and linux leaves a lot of log files in /var After several years these can add up, especially in the cpanel/bandwidth folder. So a couple quick folder moves and symlinks can clean things up. This is assuming you have a /backup partition and some room in it. Moving the log folder mv /var/log /backup/ [...]]]></description>
			<content:encoded><![CDATA[<p>Cpanel and linux leaves a lot of log files in /var<br />
After several years these can add up, especially in the cpanel/bandwidth folder. So a couple quick folder moves and symlinks can clean things up. This is assuming you have a /backup partition and some room in it.</p>
<p><strong>Moving the log folder</strong></p>
<p>mv /var/log /backup/<br />
ln -s /backup/log /var/log</p>
<p><strong>Moving the cpanel bandwidth folder</strong></p>
<p>mv /var/cpanel/bandwidth /backup/<br />
ln -s /backup/bandwidth /var/cpanel/bandwidth</p>
<p>Also just removing some of the log files in the log folder can help you for a quick fix.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2011/08/cleaning-up-var/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clearing Your DNS Cache</title>
		<link>http://www.ezlinuxadmin.com/2011/07/clearing-your-dns-cache/</link>
		<comments>http://www.ezlinuxadmin.com/2011/07/clearing-your-dns-cache/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 19:16:32 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Cpanel and WHM]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=533</guid>
		<description><![CDATA[Clearing Your DNS Cache Your DNS cache stores the locations (IP addresses) of pages you have recently viewed. If the location of the page changes before the entry in your DNS cache is updated, you will be unable to access the page. If you are encountering a high number of HTML 404 error codes, you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ezlinuxadmin.com/wp-content/uploads/2011/07/dns.gif"><img class="alignnone size-full wp-image-534" title="dns" src="http://www.ezlinuxadmin.com/wp-content/uploads/2011/07/dns.gif" alt="" width="328" height="204" /></a></p>
<p>Clearing Your DNS Cache</p>
<p>Your DNS cache stores the locations (IP addresses) of pages you have recently viewed. If the location of the page changes before the entry in your DNS cache is updated, you will be unable to access the page.</p>
<p>If you are encountering a high number of HTML 404 error codes, you may need to flush your DNS cache. Once you clear your DNS cache, your computer will query nameservers for the new DNS information you require.</p>
<p>For more information about the HTML 404 error code, please visit the HTML 404 wikipedia article.</p>
<p>The methods detailed below allow you to remove old and inaccurate DNS information that may result in 404 errors.</p>
<p>Windows® XP, 2000, or Vista®</p>
<p>Open the Start menu.<br />
Go to Run.<br />
If you do not see the Run command in Vista, search for &#8220;run&#8221; in the Search bar.<br />
In the Run text box, type: ipconfig /flushdns<br />
Press Enter or Return, and your cache will be flushed.</p>
<p>MacOS®</p>
<p>Go to Applications.<br />
Go to Utilities.<br />
Open the Terminal application.<br />
Type: dscacheutil -flushcache<br />
Press Enter or Return, and your cache will be flushed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2011/07/clearing-your-dns-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>3</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 &#8216;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; [...]]]></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 &#8216;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 &#8216;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 [...]]]></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>
	</channel>
</rss>

