<?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>damonparker.org &#187; SysAdmin</title>
	<atom:link href="http://damonparker.org/blog/category/technical/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://damonparker.org</link>
	<description>code / ecommerce / life</description>
	<lastBuildDate>Mon, 14 Jun 2010 14:33:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-RC3</generator>
		<item>
		<title>rpmdb: unable to join the environment</title>
		<link>http://damonparker.org/blog/2007/09/10/rpmdb-unable-to-join-the-environment/</link>
		<comments>http://damonparker.org/blog/2007/09/10/rpmdb-unable-to-join-the-environment/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 17:03:15 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/09/10/rpmdb-unable-to-join-the-environment/</guid>
		<description><![CDATA[This weekend I was contacted by a client regarding a server that had run out of room on the main hard drive. Among the things that were corrupted by the drive filling up was the RPM database. When trying to query of upgrade any package, the error message rpmdb: unable to join the environment error: [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>This weekend I was contacted by a client regarding a server that had run out of room on the main hard drive.  Among the things that were corrupted by the drive filling up was the <a href="http://en.wikipedia.org/wiki/RPM_Package_Manager" rel="external">RPM</a> database.</p>
<p>When trying to query of upgrade any package, the error message</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rpmdb: unable to join the environment<br />
error: db4 error<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span> from dbenv-<span style="color: #66cc66;">&gt;</span>open: Resource temporarily unavailable<br />
error: cannot open Packages index using db3 - Resource temporarily unavailable <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span><br />
error: cannot open Packages database <span style="color: #b1b100;">in</span> <span style="color: #66cc66;">/</span>var<span style="color: #66cc66;">/</span>lib<span style="color: #66cc66;">/</span>rpm<br />
warning: <span style="color: #66cc66;">/</span>root<span style="color: #66cc66;">/</span>webmin-<span style="color: #cc66cc;">1.360</span>-<span style="color: #cc66cc;">1</span>.noarch.rpm: V3 DSA signature: NOKEY, key ID 11f63c51<br />
rpmdb: unable to join the environment<br />
error: db4 error<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span> from dbenv-<span style="color: #66cc66;">&gt;</span>open: Resource temporarily unavailable<br />
error: cannot open Packages database <span style="color: #b1b100;">in</span> <span style="color: #66cc66;">/</span>var<span style="color: #66cc66;">/</span>lib<span style="color: #66cc66;">/</span>rpm<br />
rpmdb: unable to join the environment<br />
error: db4 error<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span> from dbenv-<span style="color: #66cc66;">&gt;</span>open: Resource temporarily unavailable<br />
error: cannot open Packages database <span style="color: #b1b100;">in</span> <span style="color: #66cc66;">/</span>var<span style="color: #66cc66;">/</span>lib<span style="color: #66cc66;">/</span>rpm</div></div>
<p>A search turned up this howto on <a href="http://www.rpm.org/hintskinks/repairdb/" rel="external">repairing the db</a>.</p>
<p>These two commands made quick work of the fix.  First remove any old lock files:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rm -f <span style="color: #66cc66;">/</span>var<span style="color: #66cc66;">/</span>lib<span style="color: #66cc66;">/</span>rpm<span style="color: #66cc66;">/</span>__db<span style="color: #66cc66;">*</span></div></div>
<p>Then rebuild the RPM database:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rpm -vv --rebuilddb</div></div>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=380" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=380&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/09/10/rpmdb-unable-to-join-the-environment/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SSH-Keygen For Public Key Authentication</title>
		<link>http://damonparker.org/blog/2007/08/07/ssh-keygen-for-public-key-authentication/</link>
		<comments>http://damonparker.org/blog/2007/08/07/ssh-keygen-for-public-key-authentication/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 15:16:09 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/08/07/ssh-keygen-for-public-key-authentication/</guid>
		<description><![CDATA[ssh-keygen -t dsa -b 1024 &#91;root@titan .ssh&#93;# ssh-keygen -t dsa -b 1024 Generating public/private dsa key pair. Enter file in which to save the key &#40;/root/.ssh/id_dsa&#41;: Enter passphrase &#40;empty for no passphrase&#41;: Enter same passphrase again: Your identification has been saved in /root/.ssh/id_dsa. Your public key has been saved in /root/.ssh/id_dsa.pub. The key fingerprint is: [...]]]></description>
			<content:encoded><![CDATA[<p></p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ssh-keygen -t dsa -b <span style="color: #cc66cc;">1024</span></div></div>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#91;</span>root<span style="color: #66cc66;">@</span>titan .ssh<span style="color: #66cc66;">&#93;</span><span style="color: #808080; font-style: italic;"># ssh-keygen -t dsa -b 1024</span><br />
Generating public<span style="color: #66cc66;">/</span>private dsa key pair.<br />
Enter file <span style="color: #b1b100;">in</span> which to save the key <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">/</span>root<span style="color: #66cc66;">/</span>.ssh<span style="color: #66cc66;">/</span>id_dsa<span style="color: #66cc66;">&#41;</span>: <br />
Enter passphrase <span style="color: #66cc66;">&#40;</span>empty <span style="color: #b1b100;">for</span> no passphrase<span style="color: #66cc66;">&#41;</span>: <br />
Enter same passphrase again: <br />
Your identification has been saved <span style="color: #b1b100;">in</span> <span style="color: #66cc66;">/</span>root<span style="color: #66cc66;">/</span>.ssh<span style="color: #66cc66;">/</span>id_dsa.<br />
Your public key has been saved <span style="color: #b1b100;">in</span> <span style="color: #66cc66;">/</span>root<span style="color: #66cc66;">/</span>.ssh<span style="color: #66cc66;">/</span>id_dsa.pub.<br />
The key fingerprint is:<br />
d2:<span style="color: #cc66cc;">32</span>:02:4e:<span style="color: #cc66cc;">25</span>:<span style="color: #cc66cc;">27</span>:<span style="color: #cc66cc;">53</span>:8f:c1:ab:<span style="color: #cc66cc;">80</span>:02:0f:<span style="color: #cc66cc;">25</span>:da:af root<span style="color: #66cc66;">@</span>host.domain.com</div></div>
<p>Then copy in any public keys into ~/.ssh/authorized_keys</p>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=375" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=375&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/08/07/ssh-keygen-for-public-key-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lighttpd vs thttpd Update3</title>
		<link>http://damonparker.org/blog/2007/08/07/lighttpd-vs-thttpd-update3/</link>
		<comments>http://damonparker.org/blog/2007/08/07/lighttpd-vs-thttpd-update3/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 11:45:33 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/08/07/lighttpd-vs-thttpd-update3/</guid>
		<description><![CDATA[I have been asked several times recently about my original comparison of Lighttpd and thttpd and subsequent benchmarks for Lighttpd vs thttpd. I do not have updated benchmarks for these two. However, Lighttpd is still under active development with the latest release Lighttpd 1.4.16 dated 7/24/07. The most recent thttpd release has a newest file [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I have been asked several times recently about my original comparison of <a href="http://www.damonparker.org/blog/2005/04/10/lighttpd-vs-thttpd/">Lighttpd  and thttpd</a> and subsequent benchmarks for <a href="http://damonparker.org/blog/2005/04/14/lighttpd-vs-thttpd-part-2/">Lighttpd vs thttpd</a>.</p>
<p>I do not have updated benchmarks for these two.  However, Lighttpd is still under active development with the latest release <a href="http://www.lighttpd.net/2007/7/24/1-4-16-let-s-ship-it" rel="external">Lighttpd 1.4.16</a> dated 7/24/07.  The most recent <a href="http://www.acme.com/software/thttpd/" rel="external">thttpd</a> release has a newest file date of 6/29/05 (I couldn&#8217;t find an official release date for thttpd 2.25b).  I would surmise that the performance for Lighttpd would only have increased as it is still under active development.   Without a new release, thttpd&#8217;s performance surely hasn&#8217;t changed since my benchmark.</p>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=372" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=372&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/08/07/lighttpd-vs-thttpd-update3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plesk Qmail and Remote Black Lists (or Plesk says Qmail not started)</title>
		<link>http://damonparker.org/blog/2007/07/07/plesk-qmail-rbl-not-started/</link>
		<comments>http://damonparker.org/blog/2007/07/07/plesk-qmail-rbl-not-started/#comments</comments>
		<pubDate>Sat, 07 Jul 2007 12:07:41 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/07/07/plesk-qmail-rbl-not-started/</guid>
		<description><![CDATA[With the recent increase in SPAM volume, I have had two clients contact me with Qmail problems on Plesk servers. The error they were receiving was in the status page of the Plesk admin panel. Under the status line for Qmail, Plesk said Qmail not started Several attempts to restart Qmail produced the same results. [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>With the recent increase in SPAM volume, I have had two clients contact me with <a href="http://qmail.org" rel="external">Qmail</a> problems on <a href="http://plesk.com" rel="external">Plesk</a> servers.  The error they were receiving was in the status page of the Plesk admin panel.  Under the status line for Qmail, Plesk said</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Qmail not started</div></div>
<p>Several attempts to restart Qmail produced the same results.  Restart the server&#8230; still no Qmail.  Looking through the Qmail settings in Plesk I noticed the server owner had ticked _all_ <a href="http://en.wikipedia.org/wiki/Real-time_Blackhole_List#Terminology" rel="external">RBL</a>.  Each blacklist check requires a distinct call to the specified RBL service <strong>for every email</strong>.  A busy server with many domains might have several thousand email addresses on it.  With only a hundred SPAMs a day to each email address (I get 400+ <strong>a day</strong> on my main accounts), its easy to see how Qmail could get worked over with a million RBL checks a day.  Not to mention the load added to the RBL servers themselves.</p>
<p>I un-ticked all but two RBL checks and Qmail started right up.  There is a limit to how many RBL services Plesk Qmail can support.  I would recommend only a couple.  If many SPAMs are still getting through select a few different ones, don&#8217;t just blindly add more checks.  More is not always better.  Sometimes more is just <em>more</em>.  I suggest testing various combinations until you find the best for your server and users.</p>
<p>Another worthwhile note is that these RBLs sometimes go away or are inaccessible for a period of time.  If you are trying to use one that is down, all of your mail will be delayed while each attempt has to time out before Qmail can process the mail further.  If you have problems with sluggish mail check the sites of the RBLs in use to verify they are indeed active.</p>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=299" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=299&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/07/07/plesk-qmail-rbl-not-started/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exim Queue Snippets</title>
		<link>http://damonparker.org/blog/2007/06/28/exim-queue-snippets/</link>
		<comments>http://damonparker.org/blog/2007/06/28/exim-queue-snippets/#comments</comments>
		<pubDate>Thu, 28 Jun 2007 13:26:13 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/06/28/exim-queue-snippets/</guid>
		<description><![CDATA[These are all useful when trying to track down an open formmail script. List bounce messages exiqgrep -f '^&#60;&#62;$' Freeze bounce messages exiqgrep -i -f '^&#60;&#62;$' &#124; xargs exim -Mf Freeze messages from user@domain.com exiqgrep -i -f user@domain.com&#124; xargs exim -Mf Find out what user your webserver runs as. Use this as the email address [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>These are all useful when trying to track down an open formmail script.</p>
<p>List bounce messages</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exiqgrep -f <span style="color: #ff0000;">'^&lt;&gt;$'</span></div></div>
<p>Freeze bounce messages</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exiqgrep -i -f <span style="color: #ff0000;">'^&lt;&gt;$'</span> <span style="color: #66cc66;">|</span> xargs exim -Mf</div></div>
<p>Freeze messages from <em>user@domain.com</em></p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exiqgrep -i -f user<span style="color: #66cc66;">@</span>domain.com<span style="color: #66cc66;">|</span> xargs exim -Mf</div></div>
<p>Find out what user your webserver runs as.  Use this as the email address to key on.  For example, my Apache runs as <em>nobody</em> so I want to freeze all messages sent from the user <em>nobody@domain.com</em> so I can look through them to see if I can deduce where the insecure formmail script is.</p>
<p>Delete frozen messages</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exiqgrep -z -i <span style="color: #66cc66;">|</span> xargs exim -Mrm</div></div>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=301" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=301&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/06/28/exim-queue-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recursive Chmod Tricks</title>
		<link>http://damonparker.org/blog/2007/06/27/recursive-chmod-tricks/</link>
		<comments>http://damonparker.org/blog/2007/06/27/recursive-chmod-tricks/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 13:03:22 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/06/27/recursive-chmod-tricks/</guid>
		<description><![CDATA[Recursively chmod only directories find . -type d -exec chmod 755 &#123;&#125; \; Similarly, recursively set the execute bit on every directory chmod -R a+X * The +X flag sets the execute bit on directories only Recursively chmod only files find . -type f -exec chmod 644 &#123;&#125; \; Recursively chmod only PHP files (with [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Recursively chmod only directories</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">find . -<span style="color: #000066;">type</span> d -<span style="color: #000066;">exec</span> chmod <span style="color: #cc66cc;">755</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span> \;</div></div>
<p>Similarly, recursively set the execute bit on every directory</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">chmod -R a+X <span style="color: #66cc66;">*</span></div></div>
<p>The +X flag sets the execute bit on directories only</p>
<p>Recursively chmod only files</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">find . -<span style="color: #000066;">type</span> f -<span style="color: #000066;">exec</span> chmod <span style="color: #cc66cc;">644</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span> \;</div></div>
<p>Recursively chmod only PHP files (with extension .php)</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">find . -<span style="color: #000066;">type</span> f -name <span style="color: #ff0000;">'*.php'</span> -<span style="color: #000066;">exec</span> chmod <span style="color: #cc66cc;">644</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span> \;</div></div>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=347" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=347&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/06/27/recursive-chmod-tricks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Qmailscan Report</title>
		<link>http://damonparker.org/blog/2007/05/07/qmailscan-report/</link>
		<comments>http://damonparker.org/blog/2007/05/07/qmailscan-report/#comments</comments>
		<pubDate>Mon, 07 May 2007 21:15:30 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/05/07/qmailscan-report/</guid>
		<description><![CDATA[more /var/spool/qmailscan/quarantine.log &#124; grep &#34;`date '+%d %b %Y'`&#34; &#124; cut -f5 &#124; sort &#124; uniq -c &#124; sort]]></description>
			<content:encoded><![CDATA[<p></p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">more <span style="color: #66cc66;">/</span>var<span style="color: #66cc66;">/</span>spool<span style="color: #66cc66;">/</span>qmailscan<span style="color: #66cc66;">/</span>quarantine.log <span style="color: #66cc66;">|</span> grep <span style="color: #ff0000;">&quot;`date '+%d %b %Y'`&quot;</span> <span style="color: #66cc66;">|</span> cut -f5 <span style="color: #66cc66;">|</span> sort <span style="color: #66cc66;">|</span> uniq -c <span style="color: #66cc66;">|</span> sort</div></div>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=352" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=352&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/05/07/qmailscan-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lsof Tricks</title>
		<link>http://damonparker.org/blog/2007/04/10/lsof-tricks/</link>
		<comments>http://damonparker.org/blog/2007/04/10/lsof-tricks/#comments</comments>
		<pubDate>Tue, 10 Apr 2007 11:09:23 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/04/10/lsof-tricks/</guid>
		<description><![CDATA[Lsof (LiSt Open Files) is a powerful Unix command utility that comes in handy in many security and performance related sysadmin tasks. List the PIDs of running httpd processes. The -t option specifies terse output, only PIDs. lsof -t `which httpd` List process listening to port 80. lsof -i : 80 List processes of the [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://en.wikipedia.org/wiki/Lsof" rel="external">Lsof</a> (LiSt Open Files) is a powerful Unix command utility that comes in handy in many security and performance related sysadmin tasks.</p>
<p>List the PIDs of running httpd processes.  The <em>-t</em> option specifies <em>terse</em> output, only PIDs.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">lsof -t `which httpd`</div></div>
<p>List process listening to port 80.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">lsof -i : <span style="color: #cc66cc;">80</span></div></div>
<p>List processes of the specified command (<em>-c</em>).  Search is implied in this usage.  It essentially searches for any process name starting with the specified value.  The second example would list all process starting with <em>m</em>, (<em>mysqld</em>, <em>mutt</em>, etc.)</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">lsof -c httpd<br />
lsof -c m</div></div>
<p>Find processes owned by users <em>apache</em> or <em>nobody</em>.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">lsof -u apache,nobody</div></div>
<p>Find the files using the process specified by PID
<pid>.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">lsof +p <span style="color: #66cc66;">&lt;</span>pid<span style="color: #66cc66;">&gt;</span></div></div>
<p>Find processes with files open in the directory specified.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">lsof +D <span style="color: #66cc66;">/</span>tmp</div></div>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=307" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=307&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/04/10/lsof-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick and Dirty MySQL Backup Script</title>
		<link>http://damonparker.org/blog/2007/03/14/quick-and-dirty-mysql-backup-script/</link>
		<comments>http://damonparker.org/blog/2007/03/14/quick-and-dirty-mysql-backup-script/#comments</comments>
		<pubDate>Wed, 14 Mar 2007 10:22:53 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Sites]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/03/14/quick-and-dirty-mysql-backup-script/</guid>
		<description><![CDATA[I previously posted a Quick and Dirty MySQL Backup snippet that has gotten a bit of traffic. It works well in a pinch, but it doesn&#8217;t have any features. I use it primarily as a safety backup when performing maintenance on a MySQL server. Several of my clients have requested a script that they can [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I previously posted a <a href="http://damonparker.org/blog/2006/08/04/quick-and-dirty-mysql-backup/">Quick and Dirty MySQL Backup snippet</a> that has gotten a bit of traffic.  It works well in a pinch, but it doesn&#8217;t have any features.  I use it primarily as a safety backup when performing maintenance on a MySQL server.  </p>
<p>Several of my clients have requested a script that they can use to do on demand one-off backups.   I rolled the snippet up into a very quick-and-dirty MySQL backup.  </p>
<h4>Download <a href="http://damonparker.org/files/mysql_quick_back.sh">mysql_quick_back.sh</a></h4>
<h4>Installation</h4>
<ol>
<li>Copy mysql_quick_back.sh to a directory in your path (<em>~/bin/</em> for me).</li>
<li>Set execute bits with
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">chmod <span style="color: #cc66cc;">755</span> mysql_quick_back.sh</div></div>
</li>
<li>Set MySQL user/pass, directory to save backups to and notification email in script configuration
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># START configure </span><br />
<span style="color: #808080; font-style: italic;"># MySQL user, needs SELECT privileges </span><br />
<span style="color: #808080; font-style: italic;"># Create a new user with these permissions! &nbsp;More secure than using a user</span><br />
<span style="color: #808080; font-style: italic;"># with full permissions</span><br />
<span style="color: #0000ff;">user=</span><br />
<br />
<span style="color: #808080; font-style: italic;"># MySQL password</span><br />
<span style="color: #0000ff;">pass=</span><br />
<br />
<span style="color: #808080; font-style: italic;"># admin email address</span><br />
<span style="color: #0000ff;">adminemail=</span><br />
<br />
<span style="color: #808080; font-style: italic;"># backup location without trailing slash</span><br />
<span style="color: #808080; font-style: italic;"># set to current directory</span><br />
<span style="color: #0000ff;">backuppath=</span>.<br />
<span style="color: #808080; font-style: italic;"># or set to your home directory</span><br />
<span style="color: #808080; font-style: italic;">#backuppath=/home/admin/db_backs</span></div></div>
</li>
</ol>
<h4>Usage</h4>
<p>Simply execute the script</p>
<h4>NOTE</h4>
<p>For a full MySQL backup application, check out the original <a href="http://worldcommunity.com/opensource/utilities/mysql_backup.html" rel="external">MySQL Backup</a> by Peter Falkenberg Brown.   MySQL Backup is robust enough to use as a daily backup.  I use it on most of the servers I manage.</p>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=326" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=326&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/03/14/quick-and-dirty-mysql-backup-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update tzdata for New Daylight Savings Time</title>
		<link>http://damonparker.org/blog/2007/03/10/tzdata-dst/</link>
		<comments>http://damonparker.org/blog/2007/03/10/tzdata-dst/#comments</comments>
		<pubDate>Sat, 10 Mar 2007 11:47:27 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/03/10/tzdata-dst/</guid>
		<description><![CDATA[The fed mandated daylight savings time changes go into effect this weekend. To ensure you have the updated days do a quick test zdump -v /etc/localtime &#124; grep 2007 If you see this Sunday&#8217;s date March 11 2007 then you have the updated package. Sunday&#8217;s DST change should be handled. [root@calypso files]# zdump -v /etc/localtime [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The fed mandated daylight savings time changes go into effect this weekend.  To ensure you have the updated days do a quick test</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">zdump -v <span style="color: #66cc66;">/</span>etc<span style="color: #66cc66;">/</span>localtime <span style="color: #66cc66;">|</span> grep <span style="color: #cc66cc;">2007</span></div></div>
<p>If you see this Sunday&#8217;s date March 11 2007 then you have the updated package.  Sunday&#8217;s DST change should be handled.</p>
<div class="code" style="overflow: auto;">
[root@calypso files]# zdump -v /etc/localtime | grep 2007<br />
347:/etc/localtime  Sun Mar 11 07:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 CST isdst=0 gmtoff=-21600<br />
348:/etc/localtime  Sun Mar 11 08:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 CDT isdst=1 gmtoff=-18000<br />
349:/etc/localtime  Sun Nov  4 06:59:59 2007 UTC = Sun Nov  4 01:59:59 2007 CDT isdst=1 gmtoff=-18000<br />
350:/etc/localtime  Sun Nov  4 07:00:00 2007 UTC = Sun Nov  4 01:00:00 2007 CST isdst=0 gmtoff=-21600</div>
<p>If you see April 1 2007 your tzdata package needs updating.  Upgrade with your favorite package tool up2date, yum, apt-get&#8230;</p>
<p>More details at <a href="http://www.linux-watch.com/news/NS6300294422.html" rel="external">Linux Watch</a></p>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=324" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=324&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/03/10/tzdata-dst/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using xcache
Page Caching using xcache
Database Caching 18/58 queries in 0.007 seconds using xcache
Content Delivery Network via cdn.damonparker.org/q9i5a4w8/cds

Served from: damonparker.org @ 2010-07-30 14:18:00 -->