<?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>Server Sitters Tech Corner &#187; Linux</title>
	<atom:link href="http://serversitters.com/technical/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://serversitters.com/technical</link>
	<description>Outsourced Web Hosting Support</description>
	<lastBuildDate>Wed, 15 Dec 2010 12:03:48 +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>Restrict SSH access by IP</title>
		<link>http://serversitters.com/technical/linux/restrict-ssh-access-by-ip/</link>
		<comments>http://serversitters.com/technical/linux/restrict-ssh-access-by-ip/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 15:40:44 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://serversitters.com/technical/?p=165</guid>
		<description><![CDATA[The best way to restrict SSH access by IP is by using the server&#8217;s hosts.allow and hosts.deny file. First open the /etc/hosts.allow file and add the IP&#8217;s you would like to allow: Format &#8211; one IP per line: SSHD: $IP #Reason Example: SSHD: 1.1.1.1 #Client 1 The hosts.allow file will have to be updated in [...]]]></description>
			<content:encoded><![CDATA[<p>The best way to restrict SSH access by IP is by using the server&#8217;s hosts.allow and hosts.deny file.  First open the /etc/hosts.allow file and add the IP&#8217;s you would like to allow:<br />
Format &#8211; one IP per line:<br />
<code><br />
SSHD: $IP #Reason<br />
</code></p>
<p>Example:<br />
<code><br />
SSHD: 1.1.1.1 #Client 1<br />
</code><br />
The hosts.allow file will have to be updated in this format every time you decide to add a new IP.</p>
<p>Once you have whitelisted all of the allowed IP&#8217;s for SSH you must then edit the hosts.deny file.  Open the file /etc/hosts.deny and add the following line:<br />
<code><br />
sshd: ALL<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://serversitters.com/technical/linux/restrict-ssh-access-by-ip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux version</title>
		<link>http://serversitters.com/technical/linux/linux-version/</link>
		<comments>http://serversitters.com/technical/linux/linux-version/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 22:00:42 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://serversitters.com/technical/?p=157</guid>
		<description><![CDATA[Try logging into the server via SSH and then running: cat /etc/issue]]></description>
			<content:encoded><![CDATA[<p>Try logging into the server via SSH and then running:</p>
<p><code>cat /etc/issue</code></p>
]]></content:encoded>
			<wfw:commentRss>http://serversitters.com/technical/linux/linux-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux set hostname</title>
		<link>http://serversitters.com/technical/linux/linux-set-hostname/</link>
		<comments>http://serversitters.com/technical/linux/linux-set-hostname/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 21:56:35 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://serversitters.com/technical/?p=153</guid>
		<description><![CDATA[First login to the server via SSH. Then run: hostname $servername Update the hosts file &#8211; Look for the primary IP of the server. Follow the same format and replace the old hostname with the new hostname on the same line as the primary IP. vi /etc/hosts Update your network file with the new hostname: [...]]]></description>
			<content:encoded><![CDATA[<p>First login to the server via SSH.  Then run:<br />
<code>hostname $servername</code></p>
<p>Update the hosts file &#8211; Look for the primary IP of the server.  Follow the same format and replace the old hostname with the new hostname on the same line as the primary IP.<br />
 <code>vi /etc/hosts</code></p>
<p>Update your network file with the new hostname:<br />
<code>vi /etc/sysconfig/network</code></p>
]]></content:encoded>
			<wfw:commentRss>http://serversitters.com/technical/linux/linux-set-hostname/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Argument list too long</title>
		<link>http://serversitters.com/technical/linux/argument-list-too-long/</link>
		<comments>http://serversitters.com/technical/linux/argument-list-too-long/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 01:00:00 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://serversitters.com/technical/?p=128</guid>
		<description><![CDATA[In Linux there is a maximum number of files that can be removed from a folder using: rm -rf /home/$foldername/* Instead, you can use the find command which will find each file in a specific folder and then remove it. This is extremely helpful when you have to remove thousands of files from a mail [...]]]></description>
			<content:encoded><![CDATA[<p>In Linux there is a maximum number of files that can be removed from a folder using:<br />
rm -rf /home/$foldername/*</p>
<p>Instead, you can use the find command which will find each file in a specific folder and then remove it.  This is extremely helpful when you have to remove thousands of files from a mail queue after a spam bomb.  </p>
<p>BE CAREFUL &#8211; To remove all of the files in a folder use the following:<br />
<code>find /$fullpathtofolder -type f -exec rm -rf {} \;</code></p>
<p>i.e.<br />
<code>find /var/spool/mqueue -type f -exec rm -rf {} \;</code></p>
<p>By placing setting the -type to f you will ensure you only remove files and not folders within that folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://serversitters.com/technical/linux/argument-list-too-long/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get CPU speed in Linux</title>
		<link>http://serversitters.com/technical/linux/get-cpu-speed-in-linux/</link>
		<comments>http://serversitters.com/technical/linux/get-cpu-speed-in-linux/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 00:50:00 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://serversitters.com/technical/?p=124</guid>
		<description><![CDATA[cat /proc/cpuinfo This will show you the number of processors/cores and the speed/memory capabilities of them.]]></description>
			<content:encoded><![CDATA[<p><code>cat /proc/cpuinfo</code></p>
<p>This will show you the number of processors/cores and the speed/memory capabilities of them.</p>
]]></content:encoded>
			<wfw:commentRss>http://serversitters.com/technical/linux/get-cpu-speed-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make a file read only</title>
		<link>http://serversitters.com/technical/linux/make-a-file-read-only/</link>
		<comments>http://serversitters.com/technical/linux/make-a-file-read-only/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 02:21:40 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://serversitters.com/technical/?p=120</guid>
		<description><![CDATA[To make a file on a Linux system read only use the following: #add protection chattr +i filename This will ensure nothing can change the file unless it removes the chattr bit prior to writing to the file. If you need to update the file run: #remove protection chattr -i filename This will enable editing [...]]]></description>
			<content:encoded><![CDATA[<p>To make a file on a Linux system read only use the following:<br />
#add protection<br />
chattr +i filename</p>
<p>This will ensure nothing can change the file unless it removes the chattr bit prior to writing to the file.  If you need to update the file run:<br />
#remove protection<br />
chattr -i filename</p>
<p>This will enable editing so you can make changes.  However, be sure to reset the file as read only once you&#8217;re finished to ensure the file doesn&#8217;t change.  This is extremely useful with cpanel and other systems that change system files and reset them to defaults each time the service is restarted.  It will allow you to implement customizations without them being overwritten every time a service restarts.</p>
]]></content:encoded>
			<wfw:commentRss>http://serversitters.com/technical/linux/make-a-file-read-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>disable selinux</title>
		<link>http://serversitters.com/technical/linux/disable-selinux/</link>
		<comments>http://serversitters.com/technical/linux/disable-selinux/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 02:18:02 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://serversitters.com/technical/?p=118</guid>
		<description><![CDATA[selinux often breaks applications or scripts and it&#8217;s necessary to disable selinux. To disable selinux: echo 0 > /selinux/enforce]]></description>
			<content:encoded><![CDATA[<p>selinux often breaks applications or scripts and it&#8217;s necessary to disable selinux.  To disable selinux:</p>
<p>echo 0 > /selinux/enforce </p>
]]></content:encoded>
			<wfw:commentRss>http://serversitters.com/technical/linux/disable-selinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sed string replacement</title>
		<link>http://serversitters.com/technical/linux/sed-string-replacement/</link>
		<comments>http://serversitters.com/technical/linux/sed-string-replacement/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 02:16:57 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://serversitters.com/technical/?p=116</guid>
		<description><![CDATA[Here&#8217;s how you can replace a string in a file with sed: perl -pi -e &#8216;s/replaceme/reoplacewith/g&#8217; filename.txt This is a VERY basic replacement without and special characters. Be VERY careful if you have special characters that you&#8217;re trying to replace. If you have characters like: / you will have to proceed them with a \ [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how you can replace a string in a file with sed:</p>
<p>perl -pi -e &#8216;s/replaceme/reoplacewith/g&#8217; filename.txt</p>
<p>This is a VERY basic replacement without and special characters.  Be VERY careful if you have special characters that you&#8217;re trying to replace.  If you have characters like:<br />
/ you will have to proceed them with a \ to ensure you don&#8217;t wipe out the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://serversitters.com/technical/linux/sed-string-replacement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a cron job</title>
		<link>http://serversitters.com/technical/linux/create-a-cron-job/</link>
		<comments>http://serversitters.com/technical/linux/create-a-cron-job/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 02:14:41 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://serversitters.com/technical/?p=114</guid>
		<description><![CDATA[The format of the cron job is as follows: 1 = The minute after the hour that you want it done 2 = The hour you want it done (Military Time) 3 = Day of the Month 4 = Month of the Year 5 = Day of the week 6 = &#8216;command&#8217; that you want [...]]]></description>
			<content:encoded><![CDATA[<p>The format of the cron job is as follows: </p>
<p>1 = The minute after the hour that you want it done<br />
2 = The hour you want it done (Military Time)<br />
3 = Day of the Month<br />
4 = Month of the Year<br />
5 = Day of the week </p>
<p>6 = &#8216;command&#8217; that you want it to run</p>
<p>Example:</p>
<p>5 0 * * * /usr/local/bin/email </p>
<p>means -<br />
5 &#8211; 5th minute after the hour<br />
0 &#8211; In the 0 hour<br />
* &#8211; Everyday of the month<br />
* &#8211; Every month of the year<br />
* &#8211; Everyday of the week</p>
<p>minute	This controls what minute of the hour the command will run on,<br />
	 and is between &#8217;0&#8242; and &#8217;59&#8242;<br />
hour	This controls what hour the command will run on, and is specified in<br />
         the 24 hour clock, values must be between 0 and 23 (0 is midnight)<br />
dom	This is the Day of Month, that you want the command run on, e.g. to<br />
	 run a command on the 19th of each month, the dom would be 19.<br />
month	This is the month a specified command will run on, it may be specified<br />
	 numerically (0-12), or as the name of the month (e.g. May)<br />
dow	This is the Day of Week that you want a command to be run on, it can<br />
	 also be numeric (0-7) or as the name of the day (e.g. sun).<br />
user	This is the user who runs the command.<br />
cmd	This is the command that you want run. This field may contain<br />
	 multiple words or spaces.</p>
]]></content:encoded>
			<wfw:commentRss>http://serversitters.com/technical/linux/create-a-cron-job/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check for Bad Blocks</title>
		<link>http://serversitters.com/technical/linux/check-for-bad-blocks/</link>
		<comments>http://serversitters.com/technical/linux/check-for-bad-blocks/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 02:11:07 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://serversitters.com/technical/?p=110</guid>
		<description><![CDATA[check for bad blocks on a hard drive: badblocks -vv /dev/sda3 > badblocks.log &#038; The command above will check for badblocks on the partition /dev/sda3 and save the results to the log file badblocks.log checks for badblocks and it writes the results to: badblocks.log If you want to check a specific drive or partition you [...]]]></description>
			<content:encoded><![CDATA[<p>check for bad blocks on a hard drive:<br />
badblocks -vv /dev/sda3 > badblocks.log &#038;</p>
<p>The command above will check for badblocks on the partition /dev/sda3 and save the results to the log file badblocks.log</p>
<p>checks for badblocks and it writes the results to: badblocks.log</p>
<p>If you want to check a specific drive or partition you should run:<br />
fdisk -l|awk &#8216;{print $1}&#8217;|grep &#8220;/&#8221;<br />
This command will provide you with a list of partitions on your system that you can check.  </p>
]]></content:encoded>
			<wfw:commentRss>http://serversitters.com/technical/linux/check-for-bad-blocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

