<?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>ArghWebWorks &#187; system admin</title>
	<atom:link href="http://www.arghwebworks.com/category/system-admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.arghwebworks.com</link>
	<description>True happiness comes from the joy of deeds well done, the zest of creating things new --- Antoine de Saint-Exupery</description>
	<lastBuildDate>Fri, 16 Apr 2010 20:48:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Pipe to PHP Script from Evolution</title>
		<link>http://www.arghwebworks.com/2010/04/04/pipe-to-php-script-from-evolution/</link>
		<comments>http://www.arghwebworks.com/2010/04/04/pipe-to-php-script-from-evolution/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 06:41:46 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[system admin]]></category>
		<category><![CDATA[system administration]]></category>

		<guid isPermaLink="false">http://www.arghwebworks.com/?p=149</guid>
		<description><![CDATA[Here&#8217;s a quick example of how to pipe a message to a PHP script from Evolution (the gnome-tastic email client).
First, write a script, using very clear paths. And use php://stdin to capture the input stream:

#!/usr/bin/php -q
< ?php
include_once( dirname(__FILE__).'/includeme.php' );
$input='';
$fh=fopen( 'php://stdin', 'r' );
while( ! feof( $fh ) ) {
        [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick example of how to pipe a message to a <a href="http://www.php.net" class="ubernym uttInitialism"><abbr class="uttInitialism" title="PHP: Hypertext Preprocessor">PHP</abbr></a> script from Evolution (the gnome-tastic email client).</p>
<p>First, write a script, using very clear paths. And use php://stdin to capture the input stream:</p>
<p><code><br />
#!/usr/bin/php -q<br />
< ?php<br />
include_once( dirname(__FILE__).'/includeme.php' );<br />
$input='';<br />
$fh=fopen( 'php://stdin', 'r' );<br />
while( ! feof( $fh ) ) {<br />
        $input .= fread( $fh, 4096);<br />
}<br />
fclose( $fh );<br />
</code></p>
<p>Do whatever you need to with the $input variable. I had subscribed to a newsletter, and was using <a href="http://www.php.net" class="ubernym uttInitialism"><abbr class="uttInitialism" title="PHP: Hypertext Preprocessor">PHP</abbr></a> to parse out the interesting bits of the newsletter (everything between the h1, h2 and h3 tags, so I knew if I needed to read it), and remail that to a more-frequently checked email address.</p>
<p>You can test your file with a shell command of "cat (testfile) | $somescript.php "</p>
<p>When it's perfect, then go to your evolution program and use the "message filters" to "pipe a message to a program." And pipe it to this one (including of course the explicit paths).</p>
<p>The things to take away here are the php://stdin slurp, and the fact that you have to use explicit paths (and you'll have a dickens of a time tracking down any errors).</p>
<p>Hope that helps ya!</code></p>]]></content:encoded>
			<wfw:commentRss>http://www.arghwebworks.com/2010/04/04/pipe-to-php-script-from-evolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Quick Eye on the Referrers</title>
		<link>http://www.arghwebworks.com/2009/05/05/a-quick-eye-on-the-referrers/</link>
		<comments>http://www.arghwebworks.com/2009/05/05/a-quick-eye-on-the-referrers/#comments</comments>
		<pubDate>Tue, 05 May 2009 18:27:39 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[Search Engines]]></category>
		<category><![CDATA[Webmastering]]></category>
		<category><![CDATA[system admin]]></category>

		<guid isPermaLink="false">http://www.arghwebworks.com/?p=115</guid>
		<description><![CDATA[One of my clients has an extremely busy website. And it&#8217;s a popular place for people to show his images and offer a cracked version of his product for sale. We can see them in the apache logs- the referrer shows their domain name. One thing I like to do in order to keep an [...]]]></description>
			<content:encoded><![CDATA[<p>One of my clients has an extremely busy website. And it&#8217;s a popular place for people to show his images and offer a cracked version of his product for sale. We can see them in the apache logs- the referrer shows their domain name. One thing I like to do in order to keep an eye on this is to tail his apache logs and pull out the refer data. I&#8217;m using this:</p>
<p>[code]<br />
tail -f access.log | cut -d\  -f9,11 | grep -v (domain name)<br />
[/code]</p>
<p>That&#8217;s two spaces after the -d\; the backslash is escaping the space used as the delimiter. You may need different field numbers (9 and 11 are the ones for his combined logs that show the <abbr class="uttInitialism" title="HyperText Transfer Protocol">HTTP</abbr> status code and the referrer).  And of course I need to grep out the domain name of his site because it&#8217;s all over those lines.</p>
<p>Hope that helps ya.</p>]]></content:encoded>
			<wfw:commentRss>http://www.arghwebworks.com/2009/05/05/a-quick-eye-on-the-referrers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Timing Page Loads</title>
		<link>http://www.arghwebworks.com/2008/04/03/timing-page-loads/</link>
		<comments>http://www.arghwebworks.com/2008/04/03/timing-page-loads/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 14:18:23 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[Webmastering]]></category>
		<category><![CDATA[system admin]]></category>
		<category><![CDATA[system administration]]></category>

		<guid isPermaLink="false">http://www.arghwebworks.com/2008/04/03/timing-page-loads/</guid>
		<description><![CDATA[Every morning, I had a client calling me and asking &#8220;Is our server abnormally unresponsive?&#8221;  They were browsing their website and it seemed to them that the pages were taking longer than usual to render.  Once I figured out why they were asking and what they were measuring with, I realized I could [...]]]></description>
			<content:encoded><![CDATA[<p>Every morning, I had a client calling me and asking &#8220;Is our server abnormally unresponsive?&#8221;  They were browsing their website and it seemed to them that the pages were taking longer than usual to render.  Once I figured out why they were asking and what they were measuring with, I realized I could graph this amount of time, the important thing was figuring out how to get this information.</p>
<p>Here&#8217;s what I came up with: I was already running mrtg-rrd to do much of their graphing, so I wanted to create a MRTG Target line to correspond to &#8220;how long does our page take to render.&#8221;  I wrote a script to run &#8220;/path/towget &#8211;delete-after -pq (page) -O /tmp/garbage&#8221; and display the amount of time it took.  I wrote it in <a href="http://www.php.net" class="ubernym uttInitialism"><abbr class="uttInitialism" title="PHP: Hypertext Preprocessor">php</abbr></a> because it was easiest.</p>
<p><code><br />
$wget="/usr/bin/wget -pq --delete-after -O /tmp/garbage";<br />
$toget = "$site";<br />
$start=microtime(true);<br />
exec( "$wget $toget", $out, $e );<br />
$end=microtime(true);<br />
$dur=round( $end-$start, 3 );<br />
print "$dur\n";<br />
</code></p>
<p>The problem with this is that I was running it on their gateway; their gateway is also the monitor and grapher.   It was taking less than a second to render the page ( because of local network speeds ). Instead, I wanted it to more closely correspond to what the client would be seeing. Their development server is at their office; so I put the script there and wrote the MRTG target to point at a local ( on the gateway ) script that got the value from the development server, printed it twice, printed the date and the name of the site. It looks like this:<br />
<code><br />
$user='foo';<br />
$password='bar';<br />
$sitename='example.com';<br />
exec("/usr/bin/lynx -auth=$user:$password --dump http://developmentserver.com/scriptname.php ", $out, $e );<br />
$time=0;<br />
while ( ($time==0) &#038;&#038; (count( $out ) > 0 ) ) {<br />
        $time=(float) array_shift( $out );<br />
}<br />
print "$time\n";<br />
print "$time\n";<br />
print date("r\n");<br />
print "$sitename\n";<br />
</code></p>
<p>A couple of important caveats. The day after I started running this ( it averages around 4.6 seconds, btw, much too long imho ), the displayed time doubled.  It could have been a change to the page we&#8217;re looking for, but it turned out to be a DNS issue on the development server. So DNS is important. This doesn&#8217;t take into account the amount of time a browser takes to render a page; it&#8217;s just the time to download all the pieces. So processor intensive stuff, like super heavy javascript or super heavy tables, won&#8217;t show up here.  However, if you keep in mind what the value is- how long to resolve and download all the pieces of a web page, this is a useful metric.</p>]]></content:encoded>
			<wfw:commentRss>http://www.arghwebworks.com/2008/04/03/timing-page-loads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Configure An Automated Login</title>
		<link>http://www.arghwebworks.com/2008/02/06/automated-login-for-system-maintenance/</link>
		<comments>http://www.arghwebworks.com/2008/02/06/automated-login-for-system-maintenance/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 07:14:44 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[system admin]]></category>
		<category><![CDATA[]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[remote host]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.arghwebworks.com/?p=100</guid>
		<description><![CDATA[I&#8217;ll be honest, I do a lot of command line work. Of course you know by now that Telnet, the granddaddy of connecting-to-command-line programs isn&#8217;t very secure, so reasonable people ( and even a few unreasonable ones ) have turned to an encrypted protocol called SSH for their command line needs.
I ssh to the servers [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be honest, I do a lot of command line work. Of course you know by now that Telnet, the granddaddy of connecting-to-command-line programs isn&#8217;t very secure, so reasonable people ( and even a few unreasonable ones ) have turned to an encrypted protocol called SSH for their command line needs.</p>
<p>I ssh to the servers my sites are on in order to look at server statistics.  I can&#8217;t stand automatically generated passwords with numbers, letters, capital letters, punctuation and more than thirty-five characters. They&#8217;re irritating, though pretty secure, I&#8217;ll admit. So here&#8217;s what to do in order to connect more automatically with your server.</p>
<p>First, make sure you have SSH access. With <a href="http://www.site5.com/in.php?id=28661">Site 5</a>, it took me an email. With <a href="http://www.dpbolvw.net/click-2566207-10409150" target="_top">Hostgator</a>, it took an email and a scanned copy of my driver&#8217;s license.  No big deal, really.  Ok, now you&#8217;ve got access to the server, what next? </p>
<p>I like a SSH client named <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">Putty</a>. Don&#8217;t use this in countries that outlaw encryption, for gods&#8217; sake!  <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">Download Putty</a> and PuttyGen ( you&#8217;ll need this in a couple of minutes).  You can save them to your desktop, or to a thumbdrive, or whatever.  Save the files. </p>
<p>Then run PuttyGen by double clicking on the icon.  You want to create a SSH RSA 2 key.  Click &#8220;generate.&#8221;  You&#8217;ll need to &#8220;create some randomness&#8221; by moving the cursor around the blank area. Nothing fancy, just move the mouse.  Click &#8220;save public key&#8221; to save the public key. You&#8217;ll want to come up with some identifying name for it; let&#8217;s use myserver.pub. And then you&#8217;ll need to save the private key. Click &#8220;Save Private Key&#8221; and it&#8217;ll ask you for a passphrase. A passphrase is a good idea, but if your computer is in your house and nobody else uses it, et cetera, you may not need one. Use your judgement.  If you&#8217;re doing this on a laptop or a thumbdrive, you&#8217;ll want to use a passphrase. It&#8217;s just like a password.  Enter &#8220;myserver.ppk as the name of the key and click OK to continue.</p>
<p>Hopefully this is the only time you&#8217;ll need your password for your account at your host. Click on the putty.exe file and run it. Type the name of your host ( possibly www.domainname.com, however you&#8217;d normally connect ) into the host box and make sure &#8220;ssh&#8221; is selected for connection type. Connect, and type in your password. You&#8217;re logged in now! Yay!  See if there&#8217;s already a .ssh directory there with the command &#8220;ls .ssh&#8221;. If it&#8217;s not there, create the .ssh directory with the command &#8220;mkdir .ssh.&#8221;  Chmod it to usable only by you: &#8220;chmod 700 .ssh&#8221;.</p>
<p>Enter the .ssh directory ( cd .ssh ) and look for a file named &#8220;authorized_keys.&#8221; If it&#8217;s not there, don&#8217;t worry, we&#8217;ll create it.  Go back to where you saved your public key ( above, with the PuttyGen software. The public key is the one named &#8220;myserver.pub.&#8221; Open it up with a text editor like notepad. It should look something like this:</p>
<p>ssh-rsa AAB3NzD+rXhGEB9Bt6kEotYi/+gvcGKrRpeNIIekJvnCj4jAsmu9eQHgwxJq1rsTqo0iJAw0B6w0LPn+0omkorYcqA89OK/gsI1VuFuS+WV4oFCXbRBqJJkdkxz972uOqj/rn7re/zn3oKzsPhqUKCtdjz/c7S/zAX5DLT/DDhWkzS4QzrlZYWI0H8ruKh7ZcmOd7texXFkFFRYca7djvsFIbLQ//KVMAZ2l78r53SSvnNd2GoF3n9yvQsslze0t7Dh9t1i4Hni53rc990jpw== </p>
<p>with a comment at the right end of it ( leave the comment there ).  Copy that entire thing. Go back to the Putty window and type &#8220;cat >> authorized_keys&#8221; and hit return. The cursor will drop to the next line.  Paste in your public key, hit enter, and then hit &#8220;Ctrl-D&#8221; and enter, and your authorized keys file will be complete.  You&#8217;ll want to &#8220;chmod 600 authorized_keys&#8221; to make sure that only you can read it. Or write it.  Make sure the file is only one line long; the ssh key shouldn&#8217;t be broken into separate lines.</p>
<p>Ok, exit from your putty program. Close it up and restart it.  Enter your server&#8217;s host name again in the box, and ensure it&#8217;s set for SSH.  On the left hand window pane, go to &#8220;connection&#8221; and then to &#8220;rlogin.&#8221; Enter your username. Then go down a little more in the left window and hit &#8220;SSH&#8221; and then &#8220;Auth.&#8221;  Use the myserver.ppk private key for authentication. It&#8217;s just like every other file- browse box.  Make sure you go back to the left hand pane, back up to &#8220;Session&#8221; and save it. You&#8217;ll need to enter a name in the &#8220;name&#8221; box and then press &#8220;save.&#8221;  </p>
<p>To use it, double click on the saved name in the little window.  If everything went according to plan, Putty will read the private key (you&#8217;ll need your passphrase here if you used one ), generate the public key, and then use that to authenticate with the server, and then log you in.<br />
<img src="http://www.ftjcfx.com/image-2566207-10409150" width="1" height="1" border="0"/></p>]]></content:encoded>
			<wfw:commentRss>http://www.arghwebworks.com/2008/02/06/automated-login-for-system-maintenance/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stupid &#8220;Yum&#8221; tricks.</title>
		<link>http://www.arghwebworks.com/2008/01/25/stupid-yum-tricks/</link>
		<comments>http://www.arghwebworks.com/2008/01/25/stupid-yum-tricks/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 03:40:06 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[system admin]]></category>

		<guid isPermaLink="false">http://www.arghwebworks.com/?p=99</guid>
		<description><![CDATA[
Note to self:don&#8217;t do &#8220;yum -y remove coreutils.&#8221;

It seemed like a good idea at the time. I installed CentOS 5 on a new computer with a big hard drive, intended solely for network storage over NFS. So I figured I&#8217;d remove all the unneeded packages. I ran &#8220;yum list &#124; grep installed&#8221; to get a [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
Note to self:don&#8217;t do &#8220;yum -y remove coreutils.&#8221;
</p></blockquote>
<p>It seemed like a good idea at the time. I installed CentOS 5 on a new computer with a big hard drive, intended solely for network storage over NFS. So I figured I&#8217;d remove all the unneeded packages. I ran &#8220;yum list | grep installed&#8221; to get a list of all the installed packages, and then made a long list of packages to remove.</p>
<p>When it got to the &#8220;doing it&#8221; part, it started throwing out this error&#8230;</p>
<blockquote><p>
/etc/rc.d/init.d/nfs: line 125: rm: command not found<br />
/etc/init.d/functions: line 303: rm: command not found</p>
<p>/etc/rc.d/init.d/rpcidmapd: line 68: rm: command not found<br />
/etc/rc.d/init.d/nfslock: line 29: uname: command not found
</p></blockquote>
<p>Well, what happened?</p>
<p>When I ran my &#8220;yum remove&#8221; line to remove the 25 or so packages, I included the -y flag, which assumes &#8220;yes&#8221; for everything.  I scrolled up and it was removing some packages that required some of the packages that I was deleting. So, for instance, it was removing python. Nevermind that yum requires <strong>python.</strong> It was going.  It was also removing coreutils, which is where <strong>uname</strong> and <strong>rm</strong> went.  When I realized what it was doing, I aborted it. </p>
<p>My terminal is already fubar though.</p>
<p>scp still works, however, so I&#8217;m copying the /usr/ and the /lib/ and the /bin/ directories from another system with the same release and the same processor type, and I hope that when I do a &#8220;yum install&#8221; to replace all the packages that were removed that I&#8217;ll be back to normal in relatively no time.  I don&#8217;t really feel like driving back down to the colocation again; it&#8217;s been twice already today.</p>
<p>Edit:<br />
Nope, it&#8217;s broken.  Off to the colo again. Don&#8217;t feel right about charging the client for my enthusiasm so it&#8217;ll be just me.</p>]]></content:encoded>
			<wfw:commentRss>http://www.arghwebworks.com/2008/01/25/stupid-yum-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asterisk-mrtg.pl</title>
		<link>http://www.arghwebworks.com/2008/01/20/asterisk-mrtgpl/</link>
		<comments>http://www.arghwebworks.com/2008/01/20/asterisk-mrtgpl/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 04:35:35 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[system admin]]></category>

		<guid isPermaLink="false">http://www.arghwebworks.com/?p=98</guid>
		<description><![CDATA[This script ( see that download link far to the right of &#8220;An MRTG script to allow graphing of concurrent calls in asterisk&#8221; ? ) is good, but I think it could be somewhat better. 
That&#8217;s because in the version of asterisk we have on our system, the Manager interface outputs the channel in upper [...]]]></description>
			<content:encoded><![CDATA[<p>This <a href='http://karlsbakk.net/asterisk/'>script</a> ( see that download link far to the right of &#8220;An MRTG script to allow graphing of concurrent calls in asterisk&#8221; ? ) is good, but I think it could be somewhat better. </p>
<p>That&#8217;s because in the version of asterisk we have on our system, the Manager interface outputs the channel in upper case not lower case: SIP not sip. So we had it configured for &#8220;sip&#8221; and it wasn&#8217;t returning anything. I changed it to &#8220;SIP&#8221; and it&#8217;s working again, but a case-insensitive flag would help me <img src='http://www.arghwebworks.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>]]></content:encoded>
			<wfw:commentRss>http://www.arghwebworks.com/2008/01/20/asterisk-mrtgpl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two steps to securing your server</title>
		<link>http://www.arghwebworks.com/2008/01/02/two-steps-to-securing-your-server/</link>
		<comments>http://www.arghwebworks.com/2008/01/02/two-steps-to-securing-your-server/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 16:18:46 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[system admin]]></category>

		<guid isPermaLink="false">http://www.arghwebworks.com/?p=96</guid>
		<description><![CDATA[Here are two steps to using ssh to secure your server.
First, I assume you use ssh to connect to the server, and use a public/private key pair to help with security. In your .ssh/authorized_keys file, in front of the public key entry for the one you use, put &#8220;from=&#8217;(address)&#8217; . So your line looks like [...]]]></description>
			<content:encoded><![CDATA[<p>Here are two steps to using ssh to secure your server.</p>
<p>First, I assume you use ssh to connect to the server, and use a public/private key pair to help with security. In your .ssh/authorized_keys file, in front of the public key entry for the one you use, put &#8220;from=&#8217;(address)&#8217; . So your line looks like this:</p>
<p>from=&#8221;209.31.6?.*,192.168.?.*&#8221; ssh-rsa (redacted).  </p>
<p>What this&#8217;ll do is restrict the use of your key to your ip address ( as you can see from the example, you can use wildcards ). </p>
<p>Additionally, if you have a portable drive, like a <abbr class="uttInitialism" title="Universal Serial Bus">usb</abbr> keyfob, you can create a secondary key ( with a passphrase ) and add that as well; put the private key file ( not the .pub one ) on the drive. Add the shared public key to the authorized key file. </p>
<p>If you&#8217;re using linux&#8217;s ssh to connect, use the -i switch to specify the identity file ( the alternative key file ) like this:</p>
<p>ssh -i id_alternate user@server</p>
<p>It&#8217;ll prompt you for the passphrase.</p>]]></content:encoded>
			<wfw:commentRss>http://www.arghwebworks.com/2008/01/02/two-steps-to-securing-your-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Thorns of Cacti</title>
		<link>http://www.arghwebworks.com/2007/12/12/the-thorns-of-cacti/</link>
		<comments>http://www.arghwebworks.com/2007/12/12/the-thorns-of-cacti/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 06:57:07 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[system admin]]></category>

		<guid isPermaLink="false">http://www.arghwebworks.com/?p=94</guid>
		<description><![CDATA[Learned a lot about cacti today.  
First, had a problem where I couldn&#8217;t get anything to go into the $argv variables in php. Even in a dummy &#8220;print_r($argv)&#8221; script. Nothing. var_dump claimed that the $argv array was null.   I finally gave up and forced it to use the right php.ini file with [...]]]></description>
			<content:encoded><![CDATA[<p>Learned a lot about cacti today.  </p>
<p>First, had a problem where I couldn&#8217;t get anything to go into the $argv variables in <a href="http://www.php.net" class="ubernym uttInitialism"><abbr class="uttInitialism" title="PHP: Hypertext Preprocessor">php</abbr></a>. Even in a dummy &#8220;print_r($argv)&#8221; script. Nothing. var_dump claimed that the $argv array was null.   I finally gave up and forced it to use the right <a href="http://www.php.net" class="ubernym uttInitialism"><abbr class="uttInitialism" title="PHP: Hypertext Preprocessor">php</abbr></a>.ini file with the -c (path to <a href="http://www.php.net" class="ubernym uttInitialism"><abbr class="uttInitialism" title="PHP: Hypertext Preprocessor">php</abbr></a>.ini) flags.</p>
<p>Second, had a problem where the mysql version didn&#8217;t support the global use of &#8220;show status&#8221; &#8212; so I had to make the adjustment to the mysql_stats file listed here&#8230; http://forums.cacti.net/about6108-0-asc-105.html</p>
<p>Third, had to remove the texts in &#8220;unit grid value&#8221; and recreate all my graphs.  http://forums.cacti.net/about12327-0-asc-15.html</p>
<p>Fourth, and I was starting to feel kind of old-hat at this; some of the servers I was configuring were deduced by cacti to be &#8220;down&#8221; &#8212; and it refused to make graphs for me. I had to remove the snmp community string and cacti figured out not to check that for those servers (those servers didn&#8217;t have snmp running ).</p>]]></content:encoded>
			<wfw:commentRss>http://www.arghwebworks.com/2007/12/12/the-thorns-of-cacti/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You get what you pay for</title>
		<link>http://www.arghwebworks.com/2007/08/22/you-get-what-you-pay-for/</link>
		<comments>http://www.arghwebworks.com/2007/08/22/you-get-what-you-pay-for/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 05:28:50 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[system admin]]></category>

		<guid isPermaLink="false">http://www.arghwebworks.com/?p=85</guid>
		<description><![CDATA[I&#8217;ve learned something very important in a project I&#8217;ve been working on this week. You get what you pay for. Never again will I purchase a hosting package at 1and1.com. Between problems transferring my domain, to problems importing a database, even to problems setting up a database- How can it take three hours to create [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve learned something very important in a project I&#8217;ve been working on this week. You get what you pay for. Never again will I purchase a hosting package at 1and1.com. Between problems transferring my domain, to problems importing a database, even to problems setting up a database- How can it take <em>three hours</em> to create a freaking database? I&#8217;m talking &#8220;create database&#8221; here!</p>]]></content:encoded>
			<wfw:commentRss>http://www.arghwebworks.com/2007/08/22/you-get-what-you-pay-for/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snort Alerts via RSS</title>
		<link>http://www.arghwebworks.com/2007/05/19/snort-alerts-via-rss/</link>
		<comments>http://www.arghwebworks.com/2007/05/19/snort-alerts-via-rss/#comments</comments>
		<pubDate>Sat, 19 May 2007 22:26:53 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[system admin]]></category>

		<guid isPermaLink="false">http://www.arghwebworks.com/?p=71</guid>
		<description><![CDATA[IMified is getting the means to watch an RSS feed, and I myself rely on lots of RSS feeds throughout my day.  I wanted to cobble together a Snort->RSS feed tool, and couldn&#8217;t find one. So I wrote a perl script- but my perl-fu isn&#8217;t what I&#8217;d like it to be. Feel free to [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.arghwebworks.com/?p=69'>IMified</a> is getting the means to watch an RSS feed, and I myself rely on lots of RSS feeds throughout my day.  I wanted to cobble together a Snort-><abbr class="uttInitialism" title="Really Simple Syndication">RSS</abbr> feed tool, and couldn&#8217;t find one. So I wrote a perl script- but my perl-fu isn&#8217;t what I&#8217;d like it to be. Feel free to comment on this terrible script. It does, however, validate <em>and</em> work.<br />
<span id="more-71"></span><br />
<code type="perl"><br />
use strict;<br />
use POSIX qw(strftime);<br />
use Time::Local;<br />
my $i=0;<br />
$ENV{PATH}='';<br />
my $now = time();<br />
my $tz = strftime("%z", localtime($now));<br />
$tz =~ s/(\d{2})(\d{2})/$1:$2/;<br />
# RFC822 (actually RFC2822, as the year has 4 digits)<br />
my $pubDate= strftime("%a, %d %b %Y %H:%M:%S %z", localtime($now)) . "\n";<br />
# ---<br />
my $year=(localtime)[5];<br />
$year += 1900;</p>
<p>#-------------------------------------------------------<br />
sub print_head() {<br />
        print "Content-Type:text/xml\n\n";<br />
        print "< ?xml version=\"1.0\"?>\n";<br />
        print "<rss version=\"2.0\">\n";<br />
        print "<channel>\n";<br />
        print "\n";<br />
        print "
<link>http://g2.mohost.com/cgi-bin/snort-rss.cgi</link>\n";<br />
        print "<description>Snort alerts</description>\n";<br />
        print "<language>en-us</language>\n";<br />
        print "
<pubdate>$pubDate</pubdate>\n";<br />
        print "<generator>Some Dumb CGI Script</generator>\n";<br />
#       print "<managingeditor>you\@there.tld</managingeditor>\n";<br />
#       print "<webmaster>you\@there.tldm</webmaster>\n";<br />
}<br />
sub print_foot() {<br />
        print '</channel>';<br />
        print '</rss>';<br />
}<br />
#-------------------------------------------------------<br />
print_head();<br />
open( INPUT, " /usr/bin/tail -25 /var/log/snort/alert | /usr/bin/tac |" );<br />
while(<br />
<input />){<br />
        my      $holder=$_;</p>
<p>        if ( m/\[\*\*\] \[(.*?)\](.*?)\[\*\*\]\D*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\D*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/ ) {</p>
<p>                my ( $a,$b,$c) = split (':', $1 );<br />
                my $sid="$a:$b";<br />
                my $link="http://www.snort.org/pub-bin/sigs.cgi?sid=".$sid;</p>
<p>                my $info=$2;<br />
                my $source=$3;<br />
                my $destination=$4;</p>
<p>                $holder =~ m/^(\d\d)\/(\d\d)-(\d\d):(\d\d):(\d\d)\./;<br />
                my $month= $1;<br />
                $month -= 1;<br />
                my $day= $2;<br />
                my $hr = $3;<br />
                my $min = $4;<br />
                my $sec = $5;<br />
                my $stamp=timelocal( $sec, $min, $hr, $day, $month, $year);<br />
                my $gmstamp= strftime("%a, %d %b %Y %H:%M:%S %z", localtime( $stamp ) );</p>
<p>                print "<item>\n";<br />
                print "\n";<br />
                print "
<link>$link</link>\n";<br />
                print "<guid>$link&amp;c=$i</guid>\n";<br />
                print "<description>$info</description>\n";<br />
                print "
<pubdate>$gmstamp</pubdate>\n";<br />
                print "</item>\n";<br />
        }<br />
        $i++;<br />
}<br />
close INPUT;</p>
<p>print_foot();<br />
</code></p>]]></content:encoded>
			<wfw:commentRss>http://www.arghwebworks.com/2007/05/19/snort-alerts-via-rss/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.364 seconds -->
