<?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>King of the Potato People &#187; Coding</title>
	<atom:link href="http://www.potato-people.com/blog/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.potato-people.com/blog</link>
	<description>Code, photos and ramblings of Rick Hodger</description>
	<lastBuildDate>Fri, 23 Jul 2010 10:03:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Postfix Mail Queue statistics via SNMP</title>
		<link>http://www.potato-people.com/blog/2009/06/postfix-mail-queue-statistics-via-snmp/</link>
		<comments>http://www.potato-people.com/blog/2009/06/postfix-mail-queue-statistics-via-snmp/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 16:30:21 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[snmp]]></category>

		<guid isPermaLink="false">http://www.potato-people.com/blog/?p=55</guid>
		<description><![CDATA[This post documents a small shell script designed to provide basic mail queue statistics via SNMP for Postfix. Requirements Postfix Net-SNMP Installation The code can be downloaded here. To install, place the script anywhere in your system and edit it to provide the correct path to the &#8220;qshape&#8221; perl script that comes with Postfix. Note: [...]]]></description>
			<content:encoded><![CDATA[<p>This post documents a small shell script designed to provide basic mail queue statistics via SNMP for Postfix.</p>
<p><strong>Requirements</strong></p>
<ul>
<li><a href="http://www.postfix.org/">Postfix</a></li>
<li><a href="http://www.net-snmp.org">Net-SNMP</a></li>
</ul>
<p><strong>Installation</strong></p>
<p>The code can be downloaded <a href="http://www.potato-people.com/code/misctools/snmpqshape.sh.gz">here</a>.</p>
<p>To install, place the script anywhere in your system and edit it to provide the correct path to the &#8220;qshape&#8221; perl script that comes with Postfix.</p>
<p><em>Note: Under openSUSE qshape.pl is part of the postfix-docs package and is not installed by default.</em></p>
<p>To configure net-snmp, edit your snmpd.conf line and add a line as follows:</p>
<p><code>pass [oid-of-choice] /bin/snmpqshape.sh [oid-of-choice]</code></p>
<p>For example, due to a quirk in a paticular SNMP monitoring package I use, I had to use an OID belonging to Motorola:</p>
<p><code>pass .1.3.6.1.4.1.17713.2 /bin/snmpqshape.sh .1.3.6.1.4.1.17713.2</code></p>
<p>Net-SNMP will return 3 OIDs on query:</p>
<p><code>.0 :: Incoming<br />
.1 :: Active<br />
.2 :: Deferred</code></p>
<p><strong>MRTG / RRDTool</strong></p>
<p>Since the setup of monitoring / statistics tools such as MRTG or RRDTool is site-specific, no provisions are made on this page to provide a complete usage example. A minimal example for RRDTool:<br />
<code>#! /bin/sh<br />
STR="`snmpwalk -OvQ -r 10 -t 5 -v 2c -c publicommunity hostname.site.com \<br />
.1.3.6.1.4.1.17713.2 | perl -ne 's/^/:/;s/\n//;print'`"<br />
rrdtool update /path/to/rr-database.rrd -t incoming:active:deferred N${STR}</code></p>
<p><strong>DISCLAIMER</strong><br />
This code is free to use and distribute, and the author offers no liability or warranty for it&#8217;s misuse.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.potato-people.com/blog/2009/06/postfix-mail-queue-statistics-via-snmp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP :: Convert a string to NATO alphabet</title>
		<link>http://www.potato-people.com/blog/2009/04/php-convert-a-string-to-nato-alphabet/</link>
		<comments>http://www.potato-people.com/blog/2009/04/php-convert-a-string-to-nato-alphabet/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 16:05:43 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Geek]]></category>

		<guid isPermaLink="false">http://www.potato-people.com/blog/?p=47</guid>
		<description><![CDATA[Giving a password over the phone to someone is always painful, and I can never remember the NATO alphabet (Whiskey Tango Foxtrot!). The following PHP function will convert any string into the NATO alphabet for easy recitation. function convert_to_nato($word) { $lib['a']="Alpha"; $lib['b']="Bravo"; $lib['c']="Charlie"; $lib['d']="Delta"; $lib['e']="Echo"; $lib['f']="Foxtrot"; $lib['g']="Golf"; $lib['h']="Hotel"; $lib['i']="India"; $lib['j']="Juliet"; $lib['k']="Kilo"; $lib['l']="Lima"; $lib['m']="Mike"; $lib['n']="November"; $lib['o']="Oscar"; [...]]]></description>
			<content:encoded><![CDATA[<p>Giving a password over the phone to someone is always painful, and I can never remember the NATO alphabet (Whiskey Tango Foxtrot!). The following PHP function will convert any string into the NATO alphabet for easy recitation.</p>
<p><span id="more-47"></span></p>
<pre>function convert_to_nato($word) {
     $lib['a']="Alpha";
     $lib['b']="Bravo";
     $lib['c']="Charlie";
     $lib['d']="Delta";
     $lib['e']="Echo";
     $lib['f']="Foxtrot";
     $lib['g']="Golf";
     $lib['h']="Hotel";
     $lib['i']="India";
     $lib['j']="Juliet";
     $lib['k']="Kilo";
     $lib['l']="Lima";
     $lib['m']="Mike";
     $lib['n']="November";
     $lib['o']="Oscar";
     $lib['p']="Papa";
     $lib['q']="Quebec";
     $lib['r']="Romeo";
     $lib['s']="Sierra";
     $lib['t']="Tango";
     $lib['u']="Uniform";
     $lib['v']="Victor";
     $lib['w']="Whiskey";
     $lib['x']="X-Ray";
     $lib['y']="Yankee";
     $lib['z']="Zulu";
     $lib['0']="Zero";
     $lib['1']="One";
     $lib['2']="Two";
     $lib['3']="Three";
     $lib['4']="Four";
     $lib['5']="Five";
     $lib['6']="Six";
     $lib['7']="Seven";
     $lib['8']="Eight";
     $lib['9']="Nine";
     $lib['-']="Dash";

     $nato=array();

     for($i=0;$i
          $letter=substr($word,$i,1);
          if (!empty($lib[$letter])) {
               $nletter=strtolower($lib[$letter]);
          } else {
               if (!empty($lib[strtolower($letter)])) {
                    $nletter=strtoupper($lib[strtolower($letter)]);
               } else {
                    $nletter=$letter;
               }
          }
          $nato[]=$nletter;
     }

     return implode(" ",$nato);
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.potato-people.com/blog/2009/04/php-convert-a-string-to-nato-alphabet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spamhaus DROP list</title>
		<link>http://www.potato-people.com/blog/2008/09/spamhaus-drop-list/</link>
		<comments>http://www.potato-people.com/blog/2008/09/spamhaus-drop-list/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 10:04:45 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[ISP]]></category>
		<category><![CDATA[anti]]></category>
		<category><![CDATA[antispam]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spamhaus]]></category>

		<guid isPermaLink="false">http://www.potato-people.com/blog/?p=25</guid>
		<description><![CDATA[The Spamhaus DROP list (Don&#8217;t Route or Peer) is still awaiting it&#8217;s BGP feed for network providers. So in the meantime, I&#8217;ve knocked up a little PHP script that downloads the DROP list from Spamhaus and spits out either a list of IPtables rules or a Cisco access control list. View Source: http://www.potato-people.com/code/misctools/spamhausdrop.phps Download: http://www.potato-people.com/code/misctools/spamhausdrop.tar.gz]]></description>
			<content:encoded><![CDATA[<p>The Spamhaus DROP list (Don&#8217;t Route or Peer) is still awaiting it&#8217;s BGP feed for network providers. So in the meantime, I&#8217;ve knocked up a little PHP script that downloads the DROP list from Spamhaus and spits out either a list of IPtables rules or a Cisco access control list.</p>
<p>View Source: <a href="http://www.potato-people.com/code/misctools/spamhausdrop.phps">http://www.potato-people.com/code/misctools/spamhausdrop.phps</a></p>
<p>Download: <a href="http://www.potato-people.com/code/misctools/spamhausdrop.tar.gz">http://www.potato-people.com/code/misctools/spamhausdrop.tar.gz</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.potato-people.com/blog/2008/09/spamhaus-drop-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reservoir</title>
		<link>http://www.potato-people.com/blog/2008/04/reservoir/</link>
		<comments>http://www.potato-people.com/blog/2008/04/reservoir/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 12:09:53 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[oooh]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.potato-people.com/blog/?p=6</guid>
		<description><![CDATA[In my spare time, I&#8217;m working on a tool for photographers for managing photo collections. I was unable to find one that matched my requirements in the open source world, and frankly didn&#8217;t like the look of a lot of the commercial ones. Plus, making it web based means I can access my photos from [...]]]></description>
			<content:encoded><![CDATA[<p>In my spare time, I&#8217;m working on a tool for photographers for managing photo collections. I was unable to find one that matched my requirements in the open source world, and frankly didn&#8217;t like the look of a lot of the commercial ones. Plus, making it web based means I can access my photos from anywhere in the world.</p>
<p>Click through for a demo video of the progress so far&#8230;</p>
<p><span id="more-6"></span></p>
<p><a href="http://www.potato-people.com/blog/wp-content/uploads/2008/04/11apr2008_demo.swf"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="467" height="268" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.potato-people.com/blog/wp-content/uploads/2008/04/11apr2008_demo.swf" /><embed type="application/x-shockwave-flash" width="467" height="268" src="http://www.potato-people.com/blog/wp-content/uploads/2008/04/11apr2008_demo.swf"></embed></object> </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.potato-people.com/blog/2008/04/reservoir/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
