<?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>sheenaustin.com &#187; Linux</title>
	<atom:link href="http://www.sheenaustin.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sheenaustin.com</link>
	<description>my home on the interweb</description>
	<lastBuildDate>Wed, 21 Jul 2010 01:59:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Error: RewriteEngine not allowed here</title>
		<link>http://www.sheenaustin.com/2009/05/01/error-rewriteengine-not-allowed-here/</link>
		<comments>http://www.sheenaustin.com/2009/05/01/error-rewriteengine-not-allowed-here/#comments</comments>
		<pubDate>Sat, 02 May 2009 06:56:11 +0000</pubDate>
		<dc:creator>Sheen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Allowed]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[ReWriteEngine]]></category>

		<guid isPermaLink="false">http://www.sheenaustin.com/2009/05/01/error-rewriteengine-not-allowed-here/</guid>
		<description><![CDATA[I started seeing this error on my website after enabling “pretty” Permalinks in WordPress and as a direct result of it, I got html Error 500 (Internal Server Error). If you get this error, it can be fixed by doing the following: First check if the mod_rewrite module is loaded in apache. To do that, [...]


Related posts:<ol><li><a href='http://www.sheenaustin.com/2009/04/28/setting-up-split-brain-dns-in-windows-server/' rel='bookmark' title='Permanent Link: Setting up Split Brain DNS in Windows Server 2003'>Setting up Split Brain DNS in Windows Server 2003</a></li>
<li><a href='http://www.sheenaustin.com/2010/01/15/ocs-2007-event-id-14517-when-starting-services/' rel='bookmark' title='Permanent Link: OCS 2007 Protocol Stack Error Event ID 14517 When Starting Services'>OCS 2007 Protocol Stack Error Event ID 14517 When Starting Services</a></li>
<li><a href='http://www.sheenaustin.com/2010/06/11/symantec-backup-exec-error-0xe00084af-all-versions/' rel='bookmark' title='Permanent Link: Symantec Backup Exec Error 0xe00084af (All Versions)'>Symantec Backup Exec Error 0xe00084af (All Versions)</a></li>
<li><a href='http://www.sheenaustin.com/2009/06/18/exchange-2007-recreate-owa-folders/' rel='bookmark' title='Permanent Link: Exchange 2007 Recreate OWA folders'>Exchange 2007 Recreate OWA folders</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I started seeing this error on my website after enabling “pretty” Permalinks in WordPress and as a direct result of it, I got html Error 500 (Internal Server Error). If you get this error, it can be fixed by doing the following:</p>
<p><span id="more-105"></span></p>
<p>First check if the mod_rewrite module is loaded in apache. To do that, type the following command and you should get the output as shown below:</p>
<blockquote><p>[rootuser@server ~]# cat /etc/httpd/conf/httpd.conf | grep rewrite<br />
LoadModule rewrite_module modules/mod_rewrite.so</p></blockquote>
<p>If you do not use virtual hosts, the next step refers to your httpd.conf file. If you do use virtual hosts, the next step refers to the vhost conf file.</p>
<p>Use your favorite editor to edit your vhost configuration file and check for all instances of the line that contains: ‘AllowOverride’ and see if it looks something like this:</p>
<blockquote><p>AllowOverride Indexes FileInfo</p></blockquote>
<p>The key here is ‘FileInfo’ if it isn&#8217;t there, add it. Now reload apache by issuing:</p>
<blockquote><p>service httpd reload</p></blockquote>
<p>If the RewriteEngine has been called in either your vhost file (or httpd.conf) file or the .htaccess file, you should now see the Internal Server Error go away.</p>
<p>This was a pretty weird error and I couldn’t find enough documentation about ‘FileInfo’ on the internet (not even on redhat’s website). I was lucky to come across one instance of it</p>
<p>On another note, it is safer not to use AllowOverride All as it increases the surface area for an attacker to compromise your website. Always only allow modules that are needed. Also, for better performance, always call and configure the modules in the apache configuration files rather than the .htaccess. htaccess is called at page load but the modules are loaded and configured when the webserver has been started.</p>
<p>Let me know if you have found a similar problems and if you have found a better way of fixing it!</p>


<p>Related posts:<ol><li><a href='http://www.sheenaustin.com/2009/04/28/setting-up-split-brain-dns-in-windows-server/' rel='bookmark' title='Permanent Link: Setting up Split Brain DNS in Windows Server 2003'>Setting up Split Brain DNS in Windows Server 2003</a></li>
<li><a href='http://www.sheenaustin.com/2010/01/15/ocs-2007-event-id-14517-when-starting-services/' rel='bookmark' title='Permanent Link: OCS 2007 Protocol Stack Error Event ID 14517 When Starting Services'>OCS 2007 Protocol Stack Error Event ID 14517 When Starting Services</a></li>
<li><a href='http://www.sheenaustin.com/2010/06/11/symantec-backup-exec-error-0xe00084af-all-versions/' rel='bookmark' title='Permanent Link: Symantec Backup Exec Error 0xe00084af (All Versions)'>Symantec Backup Exec Error 0xe00084af (All Versions)</a></li>
<li><a href='http://www.sheenaustin.com/2009/06/18/exchange-2007-recreate-owa-folders/' rel='bookmark' title='Permanent Link: Exchange 2007 Recreate OWA folders'>Exchange 2007 Recreate OWA folders</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sheenaustin.com/2009/05/01/error-rewriteengine-not-allowed-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script to kill processes older than x days.</title>
		<link>http://www.sheenaustin.com/2008/12/06/script-to-kill-processes-older-than-x-days/</link>
		<comments>http://www.sheenaustin.com/2008/12/06/script-to-kill-processes-older-than-x-days/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 05:24:49 +0000</pubDate>
		<dc:creator>Sheen</dc:creator>
				<category><![CDATA[Linux Scripting]]></category>
		<category><![CDATA[Kill processes older than x days]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SIGKILL]]></category>
		<category><![CDATA[SIGTERM]]></category>

		<guid isPermaLink="false">http://www.sheenaustin.com/?p=5</guid>
		<description><![CDATA[On a linux farm sometimes there would be a need to kill processes that have been running for extended periods of time and notify the users before doing it. I had such a requirement and had to scour the internet for a lot of long hours to find a proper script to get this job [...]


Related posts:<ol><li><a href='http://www.sheenaustin.com/2009/06/19/active-directory-password-expiry-reminder-email/' rel='bookmark' title='Permanent Link: Active Directory Password Expiry Reminder Email'>Active Directory Password Expiry Reminder Email</a></li>
<li><a href='http://www.sheenaustin.com/2009/05/04/active-directory-audit-script/' rel='bookmark' title='Permanent Link: Active Directory Audit Script'>Active Directory Audit Script</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>On a linux farm sometimes there would be a need to kill processes that have been running for extended periods of time and notify the users before doing it. I had such a requirement and had to scour the internet for a lot of long hours to find a proper script to get this job done but couldn&#8217;t find one. This script was written with ideas various sources and has been tested in an RHEL environment.<span id="more-5"></span></p>
<blockquote>
<p style="TEXT-ALIGN: left">#!/bin/bash</p>
<p style="TEXT-ALIGN: left"># This is a script to identify user processes that have been running</p>
<p style="TEXT-ALIGN: left"># longer than a pre set number of days.</p>
<p style="TEXT-ALIGN: left">　</p>
<p style="TEXT-ALIGN: left"># **** BEGIN CONFIGURABLE PARAMETERS ****</p>
<p style="TEXT-ALIGN: left"># WARNING!! The following values should NOT be NULL.</p>
<p style="TEXT-ALIGN: left"># The script will not work with NULL values.</p>
<p style="TEXT-ALIGN: left"># Path to the logfile</p>
<p style="TEXT-ALIGN: left">LOG=/var/log/prockill</p>
<p style="TEXT-ALIGN: left"># List of groups to which users belong to</p>
<p style="TEXT-ALIGN: left"># The format should be &#8216;group1| group2| group3| group4&#8242;</p>
<p style="TEXT-ALIGN: left">GROUP=&#8217;everyone| utmp| 2000&#8242;</p>
<p style="TEXT-ALIGN: left"># Set the maximum age of a process before it is killed or email notification is sent</p>
<p style="TEXT-ALIGN: left"># If you want to notify users after 5 days and kill processes after 8 days then</p>
<p style="TEXT-ALIGN: left"># AGEKILL=&#8217;1-| 2-| 3-| 4-| 5-| 6-| 7-| 8-&#8217;</p>
<p style="TEXT-ALIGN: left"># AGEMAIL=&#8217;1-| 2-| 3-| 4-| 5-&#8217;</p>
<p style="TEXT-ALIGN: left"># AGE=3</p>
<p style="TEXT-ALIGN: left">AGEKILL=&#8217;1-| 2-| 3-| 4-| 5-| 6-| 7-| 8-| 9-| 10-| 11-| 12-| 13-| 14-| 15-| 16-| 17-| 18-| 19-| 20-| 21-| 22-| 23-| 24-&#8217;</p>
<p style="TEXT-ALIGN: left">AGEEMAIL=&#8217;1-| 2-| 3-| 4-| 5-| 6-| 7-| 8-| 9-| 10-| 11-| 12-| 13-| 14-| 15-| 16-| 17-| 18-| 19-| 20-&#8217;</p>
<p style="TEXT-ALIGN: left">AGE=3</p>
<p style="TEXT-ALIGN: left"># Email Address to send notifications to</p>
<p style="TEXT-ALIGN: left"><a href="mailto:MAIL=user@email.com">MAIL=user@email.com</a></p>
<p style="TEXT-ALIGN: left"># Exceptions: processes that you dont want to kill</p>
<p style="TEXT-ALIGN: left">EXCP=&#8217;ldap&#8217;</p>
<p style="TEXT-ALIGN: left"># **** END CONFIGURABLE PARAMETERS ****</p>
<p style="TEXT-ALIGN: left">　</p>
<p style="TEXT-ALIGN: left"># **** USER NOTIFICATION &amp; PROCESS KILL ****</p>
<p style="TEXT-ALIGN: left"># Check if users have been notified</p>
<p style="TEXT-ALIGN: left">if [ -f /tmp/prockill.notified ]</p>
<p style="TEXT-ALIGN: left">then</p>
<p style="TEXT-ALIGN: left"># **** PROCESS KILL ****</p>
<p style="TEXT-ALIGN: left">if [ "`find /tmp/prockill.notified -mtime +$AGE`" != "" ] # Checking if the file was created x days ago</p>
<p style="TEXT-ALIGN: left">then # If file was created x days ago, its been x days since the users were notified.</p>
<p style="TEXT-ALIGN: left"># Demarc start of log</p>
<p style="TEXT-ALIGN: left">echo &#8220;**** Start List Processes Killed on `date` ****&#8221; &gt;&gt; $LOG</p>
<p style="TEXT-ALIGN: left"># Logging list of processes that match our conditions</p>
<p style="TEXT-ALIGN: left">ps -A -o user,pid,etime,group,args | egrep &#8220;$GROUP&#8221; | egrep -v &#8220;$EXCP&#8221; | grep &#8220;-&#8221; | egrep -v &#8220;$AGEKILL&#8221; &gt;&gt; $LOG</p>
<p style="TEXT-ALIGN: left"># Demarc start of log</p>
<p style="TEXT-ALIGN: left">echo &#8220;**** End List Processes Killed on `date` ****&#8221; &gt;&gt; $LOG</p>
<p style="TEXT-ALIGN: left"># Issuing SIGTERM to give processes a chance to exit gracefully</p>
<p style="TEXT-ALIGN: left">kill -15 `ps -A -o user,pid,etime,group,args | egrep &#8220;$GROUP&#8221; | egrep -v &#8220;$EXCP&#8221; | grep &#8220;-&#8221; | egrep -v &#8220;$AGEKILL&#8221; | cut -c10-15` &gt; /dev/null</p>
<p style="TEXT-ALIGN: left"># Wait for 30 seconds to allow processes to terminate</p>
<p style="TEXT-ALIGN: left">echo &#8220;Waiting for processess to cleanly exit&#8230;&#8221;</p>
<p style="TEXT-ALIGN: left">sleep 30s</p>
<p style="TEXT-ALIGN: left"># Issuing SIGKILL to force all misbehaving processes to die.</p>
<p style="TEXT-ALIGN: left">kill -9 `ps -A -o user,pid,etime,group,args | egrep &#8220;$GROUP&#8221; | egrep -v &#8220;$EXCP&#8221; | grep &#8220;-&#8221; | egrep -v &#8220;$AGEKILL&#8221; | cut -c10-15` &gt; /dev/null</p>
<p style="TEXT-ALIGN: left">rm -rf /tmp/prockill.notified # Clear the notified flag</p>
<p style="TEXT-ALIGN: left">exit 1</p>
<p style="TEXT-ALIGN: left">fi</p>
<p style="TEXT-ALIGN: left">else</p>
<p style="TEXT-ALIGN: left"># **** USER NOTIFICATION ****</p>
<p style="TEXT-ALIGN: left"># Get list of users and number of processes owned by them.</p>
<p style="TEXT-ALIGN: left">ps -A -o user,pid,etime,group | egrep &#8220;$GROUP&#8221; | egrep -v &#8220;$EXCP&#8221; | grep &#8220;-&#8221; | egrep -v &#8220;$AGEEMAIL&#8221; | cut -d&#8217; &#8216; -f1 | uniq -c &gt;&gt; /tmp/prockill.eml</p>
<p style="TEXT-ALIGN: left"># Send email only if the filesize is greater than 0</p>
<p style="TEXT-ALIGN: left">if [ -s /tmp/prockill.eml ]</p>
<p style="TEXT-ALIGN: left">then</p>
<p style="TEXT-ALIGN: left"># Log notification.</p>
<p style="TEXT-ALIGN: left">echo &#8220;**** Start List Notified Processes on `date` ****&#8221; &gt;&gt; $LOG</p>
<p style="TEXT-ALIGN: left">echo &#8220;The following users have the indicated number of proceses that will be killed in 24 hours:&#8221;</p>
<p style="TEXT-ALIGN: left">cat /tmp/prockill.eml &gt;&gt; $LOG</p>
<p style="TEXT-ALIGN: left">echo &#8220;**** End List Notified Processes on `date` ****&#8221; &gt;&gt; $LOG</p>
<p style="TEXT-ALIGN: left"># Email Process list</p>
<p style="TEXT-ALIGN: left">mail -s &#8220;$HOSTNAME &#8211; Old Process Report&#8221; $MAIL &lt; /tmp/prockill.eml</p>
<p style="TEXT-ALIGN: left">rm -rf /tmp/prockill.eml</p>
<p style="TEXT-ALIGN: left">touch /tmp/prockill.notified # Set notified flag</p>
<p style="TEXT-ALIGN: left">exit 1</p>
<p style="TEXT-ALIGN: left">else</p>
<p style="TEXT-ALIGN: left"># Log notification</p>
<p style="TEXT-ALIGN: left">echo &#8220;**** Start List Notified Processes on `date` ****&#8221; &gt;&gt; $LOG</p>
<p style="TEXT-ALIGN: left">echo &#8220;No old processes to kill!&#8221; &gt;&gt; $LOG</p>
<p style="TEXT-ALIGN: left">echo &#8220;**** End List Notified Processes on `date` ****&#8221; &gt;&gt; $LOG</p>
<p style="TEXT-ALIGN: left">exit 1</p>
<p style="TEXT-ALIGN: left">fi</p>
<p style="TEXT-ALIGN: left">fi</p>
</blockquote>


<p>Related posts:<ol><li><a href='http://www.sheenaustin.com/2009/06/19/active-directory-password-expiry-reminder-email/' rel='bookmark' title='Permanent Link: Active Directory Password Expiry Reminder Email'>Active Directory Password Expiry Reminder Email</a></li>
<li><a href='http://www.sheenaustin.com/2009/05/04/active-directory-audit-script/' rel='bookmark' title='Permanent Link: Active Directory Audit Script'>Active Directory Audit Script</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sheenaustin.com/2008/12/06/script-to-kill-processes-older-than-x-days/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
