<?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>Made of Everything You&#039;re Not &#187; IT</title>
	<atom:link href="http://blog.ericlamb.net/category/it/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ericlamb.net</link>
	<description>Thoughts on programming, people and life</description>
	<lastBuildDate>Thu, 29 Jul 2010 07:00:32 +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>A New Kind of Failure Point</title>
		<link>http://blog.ericlamb.net/2010/03/a-new-kind-of-failure-point/</link>
		<comments>http://blog.ericlamb.net/2010/03/a-new-kind-of-failure-point/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 08:16:42 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[backups]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=2977</guid>
		<description><![CDATA[It all started with a simple email from a client with the subject line &#8220;Broken Link&#8221;; looked like one of my client&#8217;s sites was down. Since this was the one that used that lovely of loveliest of programs, Dolphin CMS, I didn&#8217;t really thing much of it. Remember, Dolphin CMS sucks and, yes, it&#8217;s been [...]]]></description>
			<content:encoded><![CDATA[<p>It all started with a simple email from a client with the subject line &#8220;Broken Link&#8221;; looked like one of my client&#8217;s sites was down. Since this was the one that used that lovely of loveliest of programs, Dolphin CMS, I didn&#8217;t really thing much of it. Remember, <a title="Code Like It’s 1999 With Dolphin CMS" href="http://blog.ericlamb.net/2009/12/code-like-its-1999-with-dolphin-cms/" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2F2009%2F12%2Fcode-like-its-1999-with-dolphin-cms%2F','Code+Like+It%E2%80%99s+1999+With+Dolphin+CMS')" target="_blank">Dolphin CMS sucks</a> and, yes, it&#8217;s been known to just crumble on occasion (fucking <a title="Boonex" href="http://www.boonex.com/" onclick="return TrackClick('http%3A%2F%2Fwww.boonex.com%2F','Boonex')" target="_blank">Boonex</a>&#8230;). So, yeah, initially, I didn&#8217;t think much of this. But then again, I <em>have</em> been pretty happy lately and the universe really does hate us all. I should have known this was gonna be bad&#8230;</p>
<div id="attachment_2980" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2010/03/exploding-server.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2010%2F03%2Fexploding-server.png','A+New+Kind+of+Failure+Point')"><img class="size-medium wp-image-2980" title="A New Kind of Failure Point" src="http://blog.ericlamb.net/wp-content/uploads/2010/03/exploding-server-300x300.png" alt="exploding-server" width="300" height="300" /></a><p class="wp-caption-text">A New Kind of Failure Point</p></div>
<p>Looking into the problem it was immediately obvious what was going on; my server was gone. I couldn&#8217;t access any site, much less my client&#8217;s site who alerted me to the issue, using any protocol or tool (ssh, ftp, cpanel or whm at least). It was like it didn&#8217;t exist&#8230;</p>
<p>Immediately, I contacted the server provider, HostGator, where I had a dedicated server requisitioned a few years ago. Thinking this was at worst a network issue I contact HostGator and submitted a support ticket; that&#8217;s the only thing to do since I couldn&#8217;t personally deal with the issue. That&#8217;s the trade off for leasing a dedicated server; on the other hand HostGator will fix <em>anything</em> that goes wrong so it&#8217;s worth it in my opinion.</p>
<p>HostGator, to their credit, got back to me within 20 minutes to inform me that the server account was <strong>closed</strong>. My first thought:</p>
<p><em><strong>WHAT THE FUCK??!!??</strong></em></p>
<p>Looking into just what the hell happened I found out that the client who was paying the bill (I had worked out a &#8220;deal&#8221; for him where I built and maintained his sites and he would pay the hosting bill) just decided that he was done with the whole Internet thing. Seriously. Apparently, he decided to just stop paying the bill a couple months ago forcing HostGator to cancel the account because he, in his words, &#8220;Hadn&#8217;t made shit from this crap&#8221;.</p>
<p>Anyway, this all highlighted a failure point in my backup strategy. Yes, I had a  backup strategy and I even had backups locally. No, my problem was that I didn&#8217;t have access to any backup newer than 2 weeks old. Here&#8217;s how my backup strategy worked:</p>
<ol>
<li>Daily backups stored to a NAS on the rack.</li>
<li>Weekly backups FTPed to another HostGator account</li>
<li>Bi-weekly backups were being downloaded to my local network (home) every 2 weeks.</li>
</ol>
<p>See the problem point? Yeah, keeping too much of an interval on the network instead of within reach and not having access to my recent backups. That. Was. My. Bad.</p>
<p>Two weeks was just too much time to go without a physical backup. It&#8217;s an infinity on the Internet; too much stuff can happen in that time and ironically my client with the nasty, nasty, Dolphin CMS is proof of that. Unfortunately, two weeks ago her site had no traffic and no real use to anyone. Come two weeks later and she had gotten the membership up to a couple hundred users who were actually using the site. That&#8217;s the part that really sucked; I had failed my client.</p>
<p>This whole ordeal prompted a number of changes to my overall routine. Here&#8217;s the new setup.</p>
<ol>
<li>For starters I&#8217;m no longer leasing a server; instead I purchased my first server and have it hosted at a data center where I have personal 24/7 access to it and the rack it&#8217;s on.</li>
<li>Daily backups are being stored to a backup drive in my server and being mirrored to an external NAS on the rack.</li>
<li>Weekly, I will go to the data center and swap out the backup drive on the server with another keeping the drive at my house.</li>
<li>Bi-weekly backups will be downloaded to my laptop and kept close at hand.</li>
</ol>
<p>Overkill? Probably, but considering that the majority of this is automated I don&#8217;t see too much of an issue with it. In fact, the only thing I have to actually do is go to the data center once a week and switch out the drive so it&#8217;s really not too bad.</p>
<p>Hopefully, this&#8217;ll work out better than the last strategy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2010/03/a-new-kind-of-failure-point/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Horrors of C99.php</title>
		<link>http://blog.ericlamb.net/2010/02/the-horrors-of-c99-php/</link>
		<comments>http://blog.ericlamb.net/2010/02/the-horrors-of-c99-php/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 00:10:14 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Brain Dump]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[c99.php]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=2958</guid>
		<description><![CDATA[If you were a sysadmin a few years ago, and you had php on your servers, you’re probably already familiar with c99. In case you haven’t had the personal pleasure, c99, or specifically c99.php (hint: check the source), is the name of a script used by hackers to gain access to a web server running [...]]]></description>
			<content:encoded><![CDATA[<p>If you were a sysadmin a few years ago, and you had php on your servers, you’re probably already familiar with c99. In case you haven’t had the personal pleasure, c99, or specifically <a title="c99.php" href="http://corz.org/corz/c99.php" onclick="return TrackClick('http%3A%2F%2Fcorz.org%2Fcorz%2Fc99.php','c99.php')" target="_blank">c99.php</a> (hint: check the source), is the name of a script used by hackers to gain access to a web server running php using an exploit technique called <a title="Remote File Inclusion" href="http://en.wikipedia.org/wiki/Remote_File_Inclusion" onclick="return TrackClick('http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FRemote_File_Inclusion','Remote+File+Inclusion')" target="_blank">Remote File Inclusion</a>.</p>
<div id="attachment_2959" class="wp-caption aligncenter" style="width: 301px"><a href="http://blog.ericlamb.net/wp-content/uploads/2010/03/corz.org-c99shell_1258493034502-291x300.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2010%2F03%2Fcorz.org-c99shell_1258493034502-291x300.png','The+Horrors+of+C99.php')"><img class="size-full wp-image-2959" title="The Horrors of C99.php" src="http://blog.ericlamb.net/wp-content/uploads/2010/03/corz.org-c99shell_1258493034502-291x300.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2010%2F03%2Fcorz.org-c99shell_1258493034502-291x300.png','The+Horrors+of+C99.php')" alt="The Horrors of C99.php" width="291" height="300" /></a><p class="wp-caption-text">The Horrors of C99.php</p></div>
<h3>A Little History</h3>
<p>See, back in the day some php developers were pretty stupid. (Admit it; you were stupid once too.) What other explanation could there be for writing code that allowed the injection of arbitrary routines into a program. Trivially easy too.</p>
<p>To be fair, PHP was to blame a little for this as well. Given PHP’s high adoption, and design, by, and for, newbie programmers allowing such a technique by default was just ill conceived, and maybe even a little negligent. I understand the desire, and sometime need, for a technique that could be dangerous but to enable the feature by default…. damn man…</p>
<p>So, the risk was known, yet code was still being written (like the below example) that allowed remote file inclusion to be possible. Mostly because of the aforementioned default setting.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$color</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'blue'</span><span style="color: #339933;">;</span>
<span style="color: #22f;">if</span> <span style="color: #000;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #000;">&#40;</span> <span style="color: #000088;">$_GET</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'COLOR'</span><span style="color: #000;">&#93;</span> <span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span>
<span style="color: #000;">&#123;</span>
	<span style="color: #000088;">$color</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_GET</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'COLOR'</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000;">&#125;</span>
<span style="color: #22f;">require</span><span style="color: #000;">&#40;</span> <span style="color: #000088;">$color</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.php'</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>BTW, if you currently write code that does anything like the above, frankly, you’re an idiot. You aren’t nearly as smart and clever as you think you are. I promise you this will bite you. Bad too.</p>
<h3>About C99.php</h3>
<p>So, using a technique like the above opens you up to learning first hand about c99.php. Finding information about the program itself is a little tricky but there are a couple examples that highlight just how <a title="Find r57 and c99 Shells Hidden Inside PHP and TXT Files" onclick="return TrackClick('http%3A%2F%2Fwww.nullamatix.com%2Ffind-r57-and-c99-shells-hidden-inside-php-and-txt-files%2F','Find+r57+and+c99+Shells+Hidden+Inside+PHP+and+TXT+Files')" href="http://www.nullamatix.com/find-r57-and-c99-shells-hidden-inside-php-and-txt-files/" onclick="return TrackClick('http%3A%2F%2Fwww.nullamatix.com%2Ffind-r57-and-c99-shells-hidden-inside-php-and-txt-files%2F','Find+r57+and+c99+Shells+Hidden+Inside+PHP+and+TXT+Files')" target="_blank">devastating it can be</a>.</p>
<blockquote><p>When malicious intruders compromise a web server, there’s an excellent chance a famous Russian PHP script, r57shell, will follow. The r57shell PHP script gives the intruder a number of capabilities, including, but not limited to: downloading files, uploading files, creating backdoors, setting up a spam relay, forging email, bouncing a connection to decrease the risk of being caught, and even taking control of SQL databases. All these functions become readily available through an easy to use web interface, but now you can fight back.</p></blockquote>
<p>Using the above explanation, which I agree with, c99.php acts as an interface to control your server. Once it’s on your server an attacker has easy access to view all the files and their contents, make changes to the system, upload new files, manipulate the database(s) and more.</p>
<p>Quite the nasty little script but pretty elegant in how it’s implemented. c99 is a completely standalone script; even the images are embedded inside using base64!</p>
<p>Until a month ago I would have thought the risk of encountering c99.php in the wild would have been small these days. Then, SMACK!!, a client had a site get hacked (quick CYA; that I didn’t’ work on <img src='http://blog.ericlamb.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) using c99. So be warned. It’s out there and if you’re not smart, or if you’re a lazy, <em>lazy</em>, coder, c99 will get you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2010/02/the-horrors-of-c99-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parse Apache Log Files With PHP</title>
		<link>http://blog.ericlamb.net/2010/01/parse-apache-log-files-with-php/</link>
		<comments>http://blog.ericlamb.net/2010/01/parse-apache-log-files-with-php/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 08:35:41 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=2837</guid>
		<description><![CDATA[Parsing the log files generated by Apache is one of those random tasks with a random occurrence in my world. This is a task that, until recently, hadn&#8217;t come up enough to warrant any sort of a ready solution (and it was just fun enough to be ok to write a custom solution). So every [...]]]></description>
			<content:encoded><![CDATA[<p>Parsing the log files generated by Apache is one of those random tasks with a random occurrence in my world. This is a task that, until recently, hadn&#8217;t come up enough to warrant any sort of a ready solution (and it was just fun enough to be <em>ok </em>to write a custom solution). So every time this came up I would always fire up Google and go on a scavenger hunt for a starter script written in php.</p>
<div id="attachment_2841" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2010/01/apache.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2010%2F01%2Fapache.jpg','Parse+Apache+Log+Files+With+PHP')"><img src="http://blog.ericlamb.net/wp-content/uploads/2010/01/apache-300x225.jpg" alt="Parse Apache Log Files With PHP" title="Parse Apache Log Files With PHP" width="300" height="225" class="size-medium wp-image-2841" /></a><p class="wp-caption-text">Parse Apache Log Files With PHP</p></div>
<p>This always felt like a good idea at the time the need came up. These days, for some ungodly reason, parsing Apache logs seems to come up a little too frequently to keep this up. In the spirit of making my life a hell of a lot easier for tomorrow I&#8217;ve taken a shot at writing an Apache log parser written in PHP.</p>
<p>One thing I decided to implement is a filtering system so you can filter out based on a provided regex. Might not be too useful to everyone but it should be trivial to remove the functionality.</p>
<p>Anyway, I hope someone finds this useful (even to learn from and, of course, use)</p>
<p>Here&#8217;s the main class:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
 * Apache Log Parser
 * Parses an Apache log file and runs the strings through filters to find what you're looking for.
 * @author Eric Lamb
 *
 */</span>
<span style="color: #000000; font-weight: bold;">class</span> apache_log_parser
<span style="color: #000;">&#123;</span>
	<span style="color: #009933; font-style: italic;">/**
	 * The path to the log file
	 * @var string
	 */</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * What filters to apply. Should be in the format of array('KEY_TO_SEARCH' =&gt; array('regex' =&gt; 'YOUR_REGEX'))
	 * @var array
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$filters</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Duh.
	 * @param string $file
	 * @return void
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #000;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #000;">&#41;</span>
	<span style="color: #000;">&#123;</span>
		<span style="color: #22f;">if</span><span style="color: #000;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_readable</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #000;">&#41;</span><span style="color: #000;">&#41;</span>
		<span style="color: #000;">&#123;</span>
			<span style="color: #22f;">return</span> 	<span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
		<span style="color: #000;">&#125;</span>
&nbsp;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$file</span><span style="color: #339933;">;</span>
	<span style="color: #000;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Executes the supplied filter to the string
	 * @param $filer
	 * @param $status
	 * @return string
	 */</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> applyFilters<span style="color: #000;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #000;">&#41;</span>
	<span style="color: #000;">&#123;</span>
		<span style="color: #22f;">if</span><span style="color: #000;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">filters</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #990000;">is_array</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">filters</span><span style="color: #000;">&#41;</span><span style="color: #000;">&#41;</span>
		<span style="color: #000;">&#123;</span>
			<span style="color: #22f;">return</span> <span style="color: #000088;">$str</span><span style="color: #339933;">;</span>
		<span style="color: #000;">&#125;</span>
&nbsp;
		<span style="color: #22f;">foreach</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">filters</span> <span style="color: #22f;">AS</span> <span style="color: #000088;">$area</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$filter</span><span style="color: #000;">&#41;</span>
		<span style="color: #000;">&#123;</span>
			<span style="color: #22f;">if</span><span style="color: #000;">&#40;</span><span style="color: #990000;">preg_match</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$filter</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'regex'</span><span style="color: #000;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #000;">&#91;</span><span style="color: #000088;">$area</span><span style="color: #000;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #339933;">,</span> PREG_OFFSET_CAPTURE<span style="color: #000;">&#41;</span><span style="color: #000;">&#41;</span>
			<span style="color: #000;">&#123;</span>
				<span style="color: #22f;">return</span> <span style="color: #000088;">$str</span><span style="color: #339933;">;</span>
			<span style="color: #000;">&#125;</span>
		<span style="color: #000;">&#125;</span>
	<span style="color: #000;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Returns an array of all the filtered lines 
	 * @param $limit
	 * @return array
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getData<span style="color: #000;">&#40;</span><span style="color: #000088;">$limit</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #000;">&#41;</span>
	<span style="color: #000;">&#123;</span>
		<span style="color: #000088;">$handle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rb'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #22f;">if</span> <span style="color: #000;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#123;</span>
			<span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$lines</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #22f;">while</span> <span style="color: #000;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">feof</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #000;">&#41;</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#123;</span>
		        <span style="color: #000088;">$buffer</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fgets</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
		        <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">applyFilters</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">format_line</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$buffer</span><span style="color: #000;">&#41;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
		        <span style="color: #22f;">if</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #000;">&#41;</span>
		        <span style="color: #000;">&#123;</span>
		        	<span style="color: #000088;">$lines</span><span style="color: #000;">&#91;</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #339933;">;</span>
		        <span style="color: #000;">&#125;</span>
&nbsp;
		        <span style="color: #22f;">if</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$limit</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$limit</span><span style="color: #000;">&#41;</span>
		        <span style="color: #000;">&#123;</span>
		        	<span style="color: #22f;">break</span><span style="color: #339933;">;</span>
		        <span style="color: #000;">&#125;</span>
		        <span style="color: #000088;">$count</span><span style="color: #339933;">++;</span>
		    <span style="color: #000;">&#125;</span>
		    <span style="color: #990000;">fclose</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #22f;">return</span> <span style="color: #000088;">$lines</span><span style="color: #339933;">;</span>
		<span style="color: #000;">&#125;</span>		
	<span style="color: #000;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Regex to parse the log file line
	 * @param string $line
	 * @return array
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> format_log_line<span style="color: #000;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #000;">&#41;</span>
	<span style="color: #000;">&#123;</span>
		<span style="color: #990000;">preg_match</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">&quot;/^(\S+) (\S+) (\S+) \[([^:]+):(\d+:\d+:\d+) ([^\]]+)\] <span style="color: #000099; font-weight: bold;">\&quot;</span>(\S+) (.*?) (\S+)<span style="color: #000099; font-weight: bold;">\&quot;</span> (\S+) (\S+) (<span style="color: #000099; font-weight: bold;">\&quot;</span>.*?<span style="color: #000099; font-weight: bold;">\&quot;</span>) (<span style="color: #000099; font-weight: bold;">\&quot;</span>.*?<span style="color: #000099; font-weight: bold;">\&quot;</span>)$/&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$line</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// pattern to format the line</span>
		<span style="color: #22f;">return</span> <span style="color: #000088;">$matches</span><span style="color: #339933;">;</span>
	<span style="color: #000;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Takes the format_log_line array and makes it usable to us stupid humans
	 * @param $line
	 * @return array
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> format_line<span style="color: #000;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #000;">&#41;</span>
	<span style="color: #000;">&#123;</span>
		<span style="color: #000088;">$logs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">format_log_line</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// format the line</span>
&nbsp;
		<span style="color: #22f;">if</span> <span style="color: #000;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #000;">&#93;</span><span style="color: #000;">&#41;</span><span style="color: #000;">&#41;</span> <span style="color: #666666; font-style: italic;">// check that it formated OK</span>
		<span style="color: #000;">&#123;</span>
			<span style="color: #000088;">$formated_log</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// make an array to store the lin info in</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'ip'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'identity'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'user'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'date'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'time'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'timezone'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'method'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">7</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'path'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">8</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'protocal'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">9</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'status'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">10</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'bytes'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">11</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'referer'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">12</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$formated_log</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'agent'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$logs</span><span style="color: #000;">&#91;</span><span style="color: #cc66cc;">13</span><span style="color: #000;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #22f;">return</span> <span style="color: #000088;">$formated_log</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// return the array of info</span>
		<span style="color: #000;">&#125;</span>
		<span style="color: #22f;">else</span>
		<span style="color: #000;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">badRows</span><span style="color: #339933;">++;</span> <span style="color: #666666; font-style: italic;">// if the row is not in the right format add it to the bad rows</span>
			<span style="color: #22f;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #000;">&#125;</span>
	<span style="color: #000;">&#125;</span>
<span style="color: #000;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>And here&#8217;s an example of how to use it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> apache_log_parser<span style="color: #000;">&#40;</span><span style="color: #000088;">$d</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">path</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$entry</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Create an apache log parser</span>
<span style="color: #000088;">$data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">filters</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span>
	<span style="color: #0000ff;">'path'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'regex'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/^.*\.(FLV|flv)$/'</span><span style="color: #000;">&#41;</span> <span style="color: #666666; font-style: italic;">//pull only flv files</span>
<span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>A couple things to note about this script though:</p>
<p>1. The regex and parsing was pretty stolen from the <a href="http://phpclasses.ranchoweb.com/browse/package/2596.html" onclick="return TrackClick('http%3A%2F%2Fphpclasses.ranchoweb.com%2Fbrowse%2Fpackage%2F2596.html','Apache+Log+Parser+on+PHPClasses.org')" target="_blank">Apache Log Parser on PHPClasses.org</a>.<br />
2. Without filters the script is pretty memory intensive. My needs don&#8217;t require anything client facing but heed my adivice; Don&#8217;t use this on a public web server. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2010/01/parse-apache-log-files-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Blackberry Secret Codes</title>
		<link>http://blog.ericlamb.net/2009/12/blackberry-secret-codes/</link>
		<comments>http://blog.ericlamb.net/2009/12/blackberry-secret-codes/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 08:00:23 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[blackberry]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=2762</guid>
		<description><![CDATA[After my little foray into unlocking my old Blackberry Curve I started to think that there were probably other special codes to play around with. I&#8217;ve done a little bit of research and it turns out, yup, there are quite a few special codes to do some random things. Decibel meter Normally, the signal strength [...]]]></description>
			<content:encoded><![CDATA[<p>After my little foray into <a title="Unlock Blackberry Curve" href="http://blog.ericlamb.net/2009/12/how-to-unlock-att-blackberry/" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2F2009%2F12%2Fhow-to-unlock-att-blackberry%2F','Unlock+Blackberry+Curve')" target="_blank">unlocking my old Blackberry Curve</a> I started to think that there were probably other special codes to play around with. I&#8217;ve done a little bit of research and it turns out, yup, there are quite a few special codes to do some random things.</p>
<h3>Decibel meter</h3>
<p>Normally, the signal strength meter is a series of bars like the below image. Hold &#8220;Alt&#8221; and press &#8220;N&#8221;, &#8220;M&#8221;, &#8220;L&#8221;, &#8220;L&#8221;. To undo just redo <img src='http://blog.ericlamb.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="attachment_2781" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_5_13.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F12%2FCapture20_5_13.jpg','Normal+Signal+Strength+Indicator')"><img class="size-medium wp-image-2781" title="Normal Signal Strength Indicator" src="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_5_13-300x200.jpg" alt="Normal Signal Strength Indicator" width="300" height="200" /></a><p class="wp-caption-text">Normal Signal Strength Indicator</p></div>
<div id="attachment_2768" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_5_47.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F12%2FCapture20_5_47.jpg','Decibal+Meter')"><img class="size-medium wp-image-2768" title="Decibal Meter" src="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_5_47-300x200.jpg" alt="Decibal Meter" width="300" height="200" /></a><p class="wp-caption-text">Decibal Meter</p></div>
<h3>View Source Code</h3>
<p>This one every web developer should know. In the Browser, hold &#8220;Alt&#8221; and press &#8220;R&#8221;, &#8220;B&#8221;, &#8220;V&#8221;, &#8220;S&#8221;</p>
<div id="attachment_2767" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_7_54.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F12%2FCapture20_7_54.jpg','View+Source+Code')"><img class="size-medium wp-image-2767 " title="View Source Code" src="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_7_54-300x200.jpg" alt="View Source Code" width="300" height="200" /></a><p class="wp-caption-text">View Source Code</p></div>
<h3>Help Me! menu</h3>
<p>If you ever call up for support chances are you&#8217;ve been told to enter this one. It shows a bunch of info in one place but most of it will be greek to most people.  Hold &#8220;Alt&#8221; and (left) &#8220;shift&#8221;, then press &#8220;H&#8221;.</p>
<div id="attachment_2773" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_6_592.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F12%2FCapture20_6_592.jpg','Help+Me%21+Menu')"><img class="size-medium wp-image-2773" title="Help Me! Menu" src="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_6_592-300x200.jpg" alt="Help Me! Menu" width="300" height="200" /></a><p class="wp-caption-text">Help Me! Menu</p></div>
<h3>Display IMEI Code</h3>
<p>As far as I know this is really only useful for unlocking a device. Type &#8220;*&#8221;, &#8220;#&#8221;, &#8220;0&#8243;, &#8220;6&#8243;, &#8220;#&#8221; on the Home screen.</p>
<div id="attachment_2774" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_8_34.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F12%2FCapture20_8_34.jpg','Display+IMEI+Code')"><img class="size-medium wp-image-2774" title="Display IMEI Code" src="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_8_34-300x200.jpg" alt="Display IMEI Code" width="300" height="200" /></a><p class="wp-caption-text">Display IMEI Code</p></div>
<h3>Event Log</h3>
<p>The Event Log is probably only going to be useful if you&#8217;re a developer or similar. It displays all the last Java goodies that have happened since starting the device. Hold &#8220;Alt&#8221; and press &#8220;L&#8221;, &#8220;G&#8221;, &#8220;L&#8221;, &#8220;G&#8221;.</p>
<div id="attachment_2775" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/12/event-log.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F12%2Fevent-log.jpg','Event+Log')"><img class="size-medium wp-image-2775" title="Event Log" src="http://blog.ericlamb.net/wp-content/uploads/2009/12/event-log-300x200.jpg" alt="Event Log" width="300" height="200" /></a><p class="wp-caption-text">Event Log</p></div>
<h3>Show SIM Information</h3>
<p>This code will display the details about a SIM card. You have to enter this code from the SIM Options page and press &#8220;M&#8221;, &#8220;E&#8221;, &#8220;P&#8221;, &#8220;D&#8221;</p>
<div id="attachment_2776" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_9_53.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F12%2FCapture20_9_53.jpg','Show+SIM+Information')"><img class="size-medium wp-image-2776" title="Show SIM Information" src="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_9_53-300x200.jpg" alt="Show SIM Information" width="300" height="200" /></a><p class="wp-caption-text">Show SIM Information</p></div>
<p style="text-align: center;">
<h3>View Refld and ServiceUserId</h3>
<p>From inside a message hold &#8220;Alt&#8221; and press &#8220;V&#8221;, &#8220;I&#8221;, &#8220;E&#8221;, &#8220;W&#8221;</p>
<div id="attachment_2778" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_10_56.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F12%2FCapture20_10_56.jpg','View+Refld+and+ServiceUserId')"><img class="size-medium wp-image-2778" title="View Refld and ServiceUserId" src="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_10_56-300x200.jpg" alt="View Refld and ServiceUserId" width="300" height="200" /></a><p class="wp-caption-text">View Refld and ServiceUserId</p></div>
<h3>View Data Usage &amp; Voice Usage</h3>
<p>This one is really only good if you have a new, unused, Blackberry. It maxes out at the below but if you buy a &#8220;new&#8221; Blackberry enter this code and verify it. From Status Options page press &#8220;B&#8221;, &#8220;U&#8221;, &#8220;Y&#8221;, &#8220;R&#8221;</p>
<div id="attachment_2779" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_10_14.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F12%2FCapture20_10_14.jpg','View+Data+Usage+%26amp%3B+Voice+Usage')"><img class="size-medium wp-image-2779" title="View Data Usage &amp; Voice Usage" src="http://blog.ericlamb.net/wp-content/uploads/2009/12/Capture20_10_14-300x200.jpg" alt="View Data Usage &amp; Voice Usage" width="300" height="200" /></a><p class="wp-caption-text">View Data Usage &amp; Voice Usage</p></div>
<h3>Hard Reset</h3>
<p>Doing a Hard Reset is like taking the battery out and inserting it again. Handy if you&#8217;re not in the mood to fuddle with the case. Hold ALT + Right Shift + Del</p>
<h3>Validate Contact List</h3>
<p>I&#8217;m honestly not really sure what these last two do but I&#8217;m listing them anyway for completeness. Hold &#8220;Alt&#8221; and press &#8220;V&#8221;, &#8220;A&#8221;, &#8220;L&#8221;, &#8220;D&#8221; in address book list</p>
<h3>Rebuild Contact List</h3>
<p>Hold &#8220;Alt&#8221; and press &#8220;V&#8221;, &#8220;A&#8221;, &#8220;L&#8221;, &#8220;D&#8221; in address book list.</p>
<p>These are all the &#8220;secret codes&#8221; I could find but that doesn&#8217;t mean there aren&#8217;t any more. Also, these codes were only verified on the Blackberry Bold 9000 so they may not work with all devices. If anyone has any new ones please leave a comment and I&#8217;ll update a list.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/12/blackberry-secret-codes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Unlock AT&amp;T Blackberry</title>
		<link>http://blog.ericlamb.net/2009/12/how-to-unlock-att-blackberry/</link>
		<comments>http://blog.ericlamb.net/2009/12/how-to-unlock-att-blackberry/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 13:00:24 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Brain Dump]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[blackberry]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=427</guid>
		<description><![CDATA[My business partner recently had her phone literally break apart in her hands. Since communication between us is pretty crucial I decided to give her a backup Blackberry Curve I had as a replacement for my Blackberry Bold. Problem was that the Curve was bought through AT&#38;T and she uses T-mobile. The phone would have [...]]]></description>
			<content:encoded><![CDATA[<p>My business partner recently had her phone literally break apart in her hands. Since communication between us is pretty crucial I decided to give her a backup Blackberry Curve I had as a replacement for my Blackberry Bold. Problem was that the Curve was bought through AT&amp;T and she uses T-mobile. The phone would have to be unlocked.</p>
<div id="attachment_2757" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/12/unlock_att_phones.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F12%2Funlock_att_phones.jpg','How+To+Unlock+AT%26amp%3BT+Blackberry')"><img class="size-medium wp-image-2757" title="How To Unlock AT&amp;T Blackberry" src="http://blog.ericlamb.net/wp-content/uploads/2009/12/unlock_att_phones-300x300.jpg" alt="How To Unlock AT&amp;T Blackberry" width="300" height="300" /></a><p class="wp-caption-text">How To Unlock AT&amp;T Blackberry</p></div>
<p>Initially, I was a little nervous about the process of  unlocking the Blackberry. I&#8217;d never personally tried anything like this and my direct experience with the process was that a 3rd party company would have to be brought into the mix. I didn&#8217;t relish the idea of paying someone to handle what seemed to be a simple exercise when I&#8217;m capable of pushing buttons on a freaking phone.</p>
<p>Turns out it&#8217;s actually extremely easy to handle this yourself though it does require a phone call to AT&amp;T support. Simply call them up and they&#8217;ll ask you for your IMEI code; it&#8217;s under the battery on the serial number label. They&#8217;ll send you an email, like the below, that&#8217;ll walk you through the process.</p>
<blockquote><p><strong><span lang="en-us">Your device unlock request was received and processed, see below for details:</span></strong></p>
<p><span lang="en-us"> </span><span lang="en-us"> </span><strong> </strong></p>
<p><strong><span lang="en-us">IMEI: YOUR_IMEI_NUMBER</span></strong></p>
<p><strong><span lang="en-us">Unlock Code: YOUR_UNLOCK_CODE</span></strong></p>
<p><strong> </strong></p>
<p><strong><span lang="en-us"><span style="color: #ff0000;">Caution:</span></span></strong><strong><span lang="en-us"> If this process is unsuccessful ten times in a row, the phone will be permanently locked to the at&amp;t network. Do not attempt to enter the code more than one (1) time total.  Instructions below will assist you in unlocking your device, if these steps are unsuccessful please contact us at 1-800-331-0500 or (916) 843-4685 from overseas.</span></strong></p>
<p><strong><span lang="en-us">Blackberry 8310</span></strong></p>
<p><strong><span lang="en-us">Follow these steps to unlock device:</span></strong></p>
<p><strong><span lang="en-us">1. Turn off the radio! VERY IMPORTANT</span></strong></p>
<p><strong><span lang="en-us">2. Go to &#8220;Options&#8221;</span></strong></p>
<p><strong><span lang="en-us">3. Scroll to and select &#8220;Advanced Options&#8221;</span></strong></p>
<p><strong><span lang="en-us">4. Click on &#8220;SIM Card&#8221;</span></strong></p>
<p><strong><span lang="en-us">5. Type “MEPD” (You will not see on display what is being typed. To obtain a &#8220;P&#8221; double tap &#8220;OP&#8221; key)</span></strong></p>
<p><strong><span lang="en-us">6. Type “MEP2” (To obtain a &#8220;P&#8221; double tap &#8220;OP&#8221; key. Press “ALT &#8220;key to obtain a &#8220;2&#8243;)</span></strong></p>
<p><strong><span lang="en-us">7. Enter the unlock code</span></strong></p>
<p><strong><span lang="en-us">8. Press enter</span></strong></p>
<p><strong><span lang="en-us">9. Reboot device. Device is now unlocked.</span></strong></p>
<p><strong><span lang="en-us"><span style="color: #ff0000;">Note:</span></span></strong><strong><span lang="en-us"> To verify the IMEI, dial *#06# on device’s keypad, 15 digit # IMEI will display on the screen.  If this sequence does not work, pull the back/battery off the phone and the IMEI will be listed on the back of the phone.</span></strong></p></blockquote>
<p>All told the total time invested was only about 5 minutes. Seriously, 5 minutes. So why would I want to pay someone for this again?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/12/how-to-unlock-att-blackberry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Not Upgrade Perl I Thought</title>
		<link>http://blog.ericlamb.net/2009/12/why-not-upgrade-perl-i-thought/</link>
		<comments>http://blog.ericlamb.net/2009/12/why-not-upgrade-perl-i-thought/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 06:05:23 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[upgrade perl]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=2735</guid>
		<description><![CDATA[About a month ago I started receiving emails from my server about the installed version of PERL being too old and needing to be upgraded. Since my server uses WHM and cPanel, and thinking that upgrading PERL would have some pretty nasty consequences if something went wrong, I held off until I could familiarize myself [...]]]></description>
			<content:encoded><![CDATA[<p>About a month ago I started receiving emails from my server about the installed version of PERL being too old and needing to be upgraded. Since my server uses WHM and cPanel, and thinking that upgrading PERL would have some pretty nasty consequences if something went wrong, I held off until I could familiarize myself with the ins and outs of what this was all about. Now that I&#8217;ve done the upgrade I&#8217;m not sure it was really so worth the wait and worry.</p>
<p><a href="http://geekandpoke.typepad.com/geekandpoke/perl/" onclick="return TrackClick('http%3A%2F%2Fgeekandpoke.typepad.com%2Fgeekandpoke%2Fperl%2F','perl01')"><img src="http://blog.ericlamb.net/wp-content/uploads/2009/12/perl01-214x300.jpg" alt="perl01" title="perl01" width="214" height="300" class="aligncenter size-medium wp-image-2742" /></a></p>
<p>The first thing you want to do is backup all your installed CPAN modules. These are basically the library of functionality your system relies on to work. Pretty important stuff in there. It&#8217;s a pretty simple command though:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'autobundle'</span></pre></div></div>

<p>The above will create a &#8220;bundle&#8221; of all the CPAN modules you have installed to be used after the upgrade. Make a note of the bundle location though; you&#8217;ll need it later. </p>
<p>The instructions to do the actual installation were included in the email and is geared specifically towards cPanel servers:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>root
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>layer1.cpanel.net<span style="color: #000000; font-weight: bold;">/</span>perl588installer.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxf</span> perl588installer.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> perl588installer
.<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-optimize-memory</span></pre></div></div>

<p>This parts pretty simple, but time consuming. The whole process is automated and should take about an hour or three. When you come back you&#8217;re going to want to install the autobundle you created earlier. To do that you&#8217;ll need this command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'install Bundle::NAME_OF_BUNDLE_YOU_CREATED_EARLER'</span></pre></div></div>

<p>This is where things started getting difficult. This process is going to require all sorts of input from you. It&#8217;ll, thankfully, give you default options but the install will sit there until you enter <em>something</em>. All told, this process took me about 4 hours; just sitting there watching the process. </p>
<p>Definitely a pain but not upgrading PERL would have been worse. If you have to do it be sure to set aside an afternoon though. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/12/why-not-upgrade-perl-i-thought/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 Upgrade Experience</title>
		<link>http://blog.ericlamb.net/2009/12/windows-7-upgrade-experience/</link>
		<comments>http://blog.ericlamb.net/2009/12/windows-7-upgrade-experience/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 23:35:55 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Brain Dump]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=2723</guid>
		<description><![CDATA[When I purchased my newest laptop back in July, from Best Buy, it came with a free upgrade to Windows 7 when it came out a few months later. Fast forward to December and I&#8217;ve since received the new operating system and have installed it on the laptop. Since a lot of people are going [...]]]></description>
			<content:encoded><![CDATA[<p>When I purchased my newest laptop back in July, from <a title="Best Buy" href="http://bestbuy.com" onclick="return TrackClick('http%3A%2F%2Fbestbuy.com','Best+Buy')" target="_blank">Best Buy</a>, it came with a <a title="Free upgrade to Windows 7" href="http://bestbuy.com/windows7upgrade" onclick="return TrackClick('http%3A%2F%2Fbestbuy.com%2Fwindows7upgrade','Free+upgrade+to+Windows+7')" target="_blank">free upgrade to Windows 7</a> when it came out a few months later. Fast forward to December and I&#8217;ve since received the new operating system and have installed it on the laptop. Since a lot of people are going to be going through the same thing I put together some notes about the experience.</p>
<div id="attachment_2724" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/12/windows7.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F12%2Fwindows7.jpg','Windows+7')"><img class="size-medium wp-image-2724" title="Windows 7" src="http://blog.ericlamb.net/wp-content/uploads/2009/12/windows7-300x300.jpg" alt="Windows 7" width="300" height="300" /></a><p class="wp-caption-text">Windows 7</p></div>
<p>Because the promotion was for a version of <a title="Windows 7 Home Premium" href="http://www.microsoft.com/windows/windows-7/" onclick="return TrackClick('http%3A%2F%2Fwww.microsoft.com%2Fwindows%2Fwindows-7%2F','Windows+7+Home+Premium')" target="_blank">Windows 7</a> that was the same flavor as the installed Windows Vista, I was given a 64bit Windows 7 Home Premium copy. Personally, I would have preferred Business or Ultimate but ok, fine Home Premium it is. At least this meant that I wouldn&#8217;t have to do a clean install so I could keep all files and programs where they were (still backing up the data of course).</p>
<p>The upgrade package came with 2 discs; the Windows 7 disc and a driver upgrade disc. The instructions said to insert the upgrade disc first and I&#8217;ll be prompted to enter disc 2 when required. Doing so started an upgrade program that inspected my system and warned me about deauthorizing my iTunes account which immediately made me feel good about the experience.</p>
<p>All told the install took around 3.5 hours and was like watching water boiling. I did it super late at night but I was still up and every time I would check on it I swear the progress rarely looked like it was making any progress. Still, it <em>is</em> Windows, so I was used to this; just wait and be patient, it&#8217;ll finish. And eventually it did.</p>
<p>Upon first booting up there were a couple issues. One was my fault. The others&#8230; not so much. Probably the worst offense was that I had no Internet connectivity. I checked both my wired NIC and the wifi and both were working  fine; I could connect to my router through both and I could find my Xbox and PS3 on the network. I just couldn&#8217;t get online. I eventually found that this was caused by a conflict between <a title="Eset" href="http://www.eset.com/" onclick="return TrackClick('http%3A%2F%2Fwww.eset.com%2F','Eset')" target="_blank">Esets</a> firewall (which I had disabled in Vista) and the native Windows firewall. Uninstalling Eset and reinstalling it solved the issue.</p>
<p>I also had an issue with my local Apache webserver working. After checking the logs it turned out to be a soft link I had created under Vista to link the conf directory (makes editing the files from my working directory that much easier). Creating a new link solved the issue nicely.</p>
<p>The last issue is with the touchpad; and I haven&#8217;t really fixed it yet. At first, Windows thought the touchpad was a PS/2 mouse. This wouldn&#8217;t be an issue except I like the scrolling functions on the touchpad and the PS/2 drivers don&#8217;t support it. This seemed like a cut and dry driver issue except I installed all the latest drivers for my laptop that Gateway offered and it still doesn&#8217;t work all that well. Yes, it&#8217;s there but not in any real functional way. It&#8217;s jerky and hesitant when it works (around 30% of the time). Not enough to get me to downgrade but still a pain.</p>
<p>I&#8217;ve never really had an issue with Vista but I was still excited about Windows 7. Even though there were a couple hiccups during the install, and that my touchpad isn&#8217;t operating 100%, I&#8217;m still really happy with the experience.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/12/windows-7-upgrade-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IMAP on Blackberry: The Poor Mans BES</title>
		<link>http://blog.ericlamb.net/2009/12/imap-the-poor-mans-bes/</link>
		<comments>http://blog.ericlamb.net/2009/12/imap-the-poor-mans-bes/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 10:44:01 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Brain Dump]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[BES]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[gmail]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=2707</guid>
		<description><![CDATA[It&#8217;s crazy to me how important email is; it&#8217;s almost 2010 and I&#8217;m still, still, relying on email for communication more than anything else. Considering just how broken email is this, along with how I know it&#8217;s broken, this isn&#8217;t a little surprising. Managing the shear amount of email I get used to be pretty [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s crazy to me how important email is; it&#8217;s almost 2010 and I&#8217;m still, <em>still</em>, relying on email for communication more than anything else. Considering just how <a title="Is Email = Efail?" href="http://www.codinghorror.com/blog/archives/001191.html" onclick="return TrackClick('http%3A%2F%2Fwww.codinghorror.com%2Fblog%2Farchives%2F001191.html','Is+Email+%3D+Efail%3F')" target="_blank">broken</a> email is this, along with how I know it&#8217;s broken, this isn&#8217;t a little surprising. Managing the <a title="For your Perspective: My Email Hell" href="http://blog.ericlamb.net/2009/03/for-your-perspective-my-email-hell/" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2F2009%2F03%2Ffor-your-perspective-my-email-hell%2F','For+your+Perspective%3A+My+Email+Hell')" target="_self">shear amount of email</a> I get used to be pretty easy but now&#8230; it&#8217;s a little more painful but still manageable.</p>
<div id="attachment_2713" class="wp-caption aligncenter" style="width: 246px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/12/blackberry-imap.gif" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F12%2Fblackberry-imap.gif','IMAP+on+Blackberry%3A+The+Poor+Mans+BES')"><img class="size-medium wp-image-2713" title="IMAP on Blackberry: The Poor Mans BES" src="http://blog.ericlamb.net/wp-content/uploads/2009/12/blackberry-imap-236x300.gif" alt="IMAP on Blackberry: The Poor Mans BES" width="236" height="300" /></a><p class="wp-caption-text">IMAP on Blackberry: The Poor Mans BES</p></div>
<p>When I had the day job I had access to a nice little network with Exchange 2003 and the latest Blackberry Enterprise Server (BES). It never really occurred to me how spoiled this would make me but, now that it&#8217;s gone, it&#8217;s pretty obvious how much I relied on it for my email management.</p>
<p>Why? Syncing. Loved the whole syncing aspect; open an email on your Blackberry and the email was marked as open in Exchange. Send an email from your Blackberry and it appeared in your sent folder in Outlook. Even better if you sent an email in Outlook, through Exchange, it was put in your sent folder on your Blackberry. Simple. This was great for things like filing and responding to emails. Put simply, using the Exchange/BES combo allowed you to keep all your communication in sync.</p>
<p>Then I get unplugged from the BES and have to setup a new solution. First, I went to POP3 (as I was most familiar with the protocol) but this was a cluster fuck of a bad idea. Yes, email was put on the Blackberry but it&#8217;s a one way method and nothing was kept in sync. I&#8217;d do something on the device and when I would go to Gmail nothing would be there; this couldn&#8217;t do.</p>
<p>I also tried the native <a title="Gmail Blackberry Application" href="http://www.google.com/mobile/gmail/" onclick="return TrackClick('http%3A%2F%2Fwww.google.com%2Fmobile%2Fgmail%2F','Gmail+Blackberry+Application')" target="_blank">Gmail Blackberry app</a> but this too wasn&#8217;t ideal; I hated how it wasn&#8217;t truly a &#8220;native&#8221; app in that other apps would still open the default Blackberry message program to do anything email related. For example, if I clicked on an email on a web page while on the Blackberry it wouldn&#8217;t open the Gmail app but the native messaging one instead. I was surprised how much this happened and how much it bothered me but it did.</p>
<p>Then I learned that Gmail has IMAP support and have been using it ever since. So far, IMAP is the closest approximation of the BES experience I&#8217;ve found. It&#8217;s not without it&#8217;s issues or anything, and technically it&#8217;s <a title="Gmail Blackberry Help" href="https://mail.google.com/support/bin/answer.py?answer=78882" onclick="return TrackClick('https%3A%2F%2Fmail.google.com%2Fsupport%2Fbin%2Fanswer.py%3Fanswer%3D78882','Gmail+Blackberry+Help')" target="_blank">not supported by Google</a>, but it&#8217;s the best solution I&#8217;ve found.</p>
<p>Probably the biggest issue I have with the IMAP integration is that mail manipulated on the Gmail site doesn&#8217;t get synced to my Blackberry. This isn&#8217;t too bad since I usually only use the Gmail site for sending but if I want to keep things in sync I have to treat the Blackberry as the master.</p>
<p>To keep the calendar and contacts in sync requires the use of another Blackberry app called <a title="Google Sync" href="http://www.google.com/mobile/products/sync.html#p=default" onclick="return TrackClick('http%3A%2F%2Fwww.google.com%2Fmobile%2Fproducts%2Fsync.html%23p%3Ddefault','Google+Sync')" target="_blank">Google Sync</a>. Google Sync it&#8217;s keeps your contacts and calendar synced up between Google Calendar and Gmail contacts and your Blackberry.</p>
<p>While it&#8217;s not a perfect solution I&#8217;ve been mostly happy with IMAP and Gmail on the Blackberry. It&#8217;s way, <em>way,</em> better than paying money for an outsourced BES / Exchange account.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 491px; width: 1px; height: 1px;">this couldn&#8217;t do.;</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/12/imap-the-poor-mans-bes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hey!! You There, Pussy! Don&#8217;t Be A Pussy.</title>
		<link>http://blog.ericlamb.net/2009/09/hey-you-there-pussy-dont-be-a-pussy/</link>
		<comments>http://blog.ericlamb.net/2009/09/hey-you-there-pussy-dont-be-a-pussy/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 13:00:19 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Brain Dump]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=32</guid>
		<description><![CDATA[Working in IT requires balls; you have to make some really tough choices with very real consequences. It&#8217;s not really a problem for programmers; very few of us work on projects that has the potential to destroy lives or break companies apart. On the other hand, in IT, you&#8217;re dealing with the backbone of an [...]]]></description>
			<content:encoded><![CDATA[<p>Working in IT requires balls; you have to make some really tough choices with very real consequences. It&#8217;s not really a problem for programmers; very few of us work on projects that has the potential to destroy lives or break companies apart. On the other hand, in IT, you&#8217;re dealing with the backbone of an organization. Make a mistake here and: You. Are. In. Trouble.</p>
<div id="attachment_2539" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/09/Dont_Be_A_Pussy.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F09%2FDont_Be_A_Pussy.jpg','Don%E2%80%99t+Be+A+Pussy')"><img class="size-medium wp-image-2539" title="Don’t Be A Pussy" src="http://blog.ericlamb.net/wp-content/uploads/2009/09/Dont_Be_A_Pussy-300x240.jpg" alt="Don’t Be A Pussy" width="300" height="240" /></a><p class="wp-caption-text">Don’t Be A Pussy</p></div>
<p>Not to worry though; try as hard as you want to not fuck up and it&#8217;s just going to happen that much sooner.</p>
<p>I can say with absolute certainty that there&#8217;s going to come a time in your career when you fuck up. Big. Like really BIG. The type of mistake that has the potential to sink the company or client you&#8217;re working for/with. When it happens it&#8217;s going to be bad. So bad that you&#8217;ll have the fear of <em>Dad </em>in you. You remember that right? When Dad was coming home and you knew he knew what you did and you knew your life was over. If you didn&#8217;t have a Dad; think shear panic mixed with absolute paranoia and terror. Yeah, <em>that&#8217;s the stuff</em>.</p>
<p>What you did/will do isn&#8217;t important. What is important is how you deal with it. You&#8217;re going to have options when it  comes to dealing with the issue(s) and how you act is going to determine how your colleagues and peers look at you for the next few months. Make the wrong call and you&#8217;re in for some real uncomfortable silences and some really awkward sidelong glances.</p>
<p>If this has already happened to you; congratulations. Just know it probably won&#8217;t be the last. On the other hand if it hasn&#8217;t happened yet get ready; it will. You&#8217;re going to make some <em>stupid</em> mistakes in your career; mistakes so idiotic and so demoralizing your confidence will shatter and you&#8217;ll have a hard time getting back on the horse.</p>
<p>Like I said above, I have absolutely no idea what you do or what you can do to fuck it up so, as anecdotal examples only, I&#8217;m going to rely on my personal experience. I can honestly say, with absolute pride, that I have done the following:</p>
<ul>
<li>Deleted a database and couldn&#8217;t restore the data</li>
<li>Deleted all the rows in a table and didn&#8217;t have a backup</li>
<li>Deleted a user account and all the email and files associated with it.</li>
<li>Changed every users password to &#8220;password&#8221; in a database</li>
<li>Sent an internal cost analysis report for a client project to the client</li>
</ul>
<p>And that&#8217;s only what was off the top of my head; I&#8217;m sure I&#8217;ve blocked out some of the worse things. The one constant between the above list (aside from the stupidity involved) was that I <em>owned</em> the mistake. You have to immediately handle the situation whatever that means (it&#8217;ll depend on the situation).</p>
<p>After that though a funny thing will happen; it&#8217;s very likely your confidence will be shot. This is important because you need confidence (read: balls) to work in IT. There are too many things, that you just don&#8217;t know how to do, that you&#8217;re going to have to do, and that requires the confidence to know you can do these things. It&#8217;s why we make the big bucks.</p>
<p>In my experience the only thing you can do in these situations is get back on the horse ASAP. The sooner you do something, <em>anything</em>, that has consequences the better. You can&#8217;t wallow in the past and getting hung up isn&#8217;t the answer.</p>
<p>BTW: After reviewing the above I have to say:</p>
<p>Thank fucking God I don&#8217;t work in IT anymore.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/09/hey-you-there-pussy-dont-be-a-pussy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When Did Performance Stop Being Important?</title>
		<link>http://blog.ericlamb.net/2009/09/when-did-performance-stop-being-important/</link>
		<comments>http://blog.ericlamb.net/2009/09/when-did-performance-stop-being-important/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 13:00:13 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=2506</guid>
		<description><![CDATA[Now that I&#8217;m finally starting to &#8220;get&#8221; the Zend Framework I&#8217;m starting to have some serious doubts on whether I made the right choice; not in choosing Zend over another framework but in choosing any framework at all. The memory usage is just abysmal across the board and after working with the Zend Framework for [...]]]></description>
			<content:encoded><![CDATA[<p>Now that I&#8217;m finally starting to &#8220;get&#8221; the Zend Framework I&#8217;m starting to have some serious doubts on whether I made the right choice; not in choosing Zend over another framework but in choosing <em>any</em> framework at all. The memory usage is just abysmal across the board and after working with the Zend Framework for about a month or so it&#8217;s not entirely clear if it&#8217;s going to scale as I need it to.</p>
<div id="attachment_2508" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/09/performance.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F09%2Fperformance.jpg','When+Did+Performance+Stop+Mattering%3F')"><img class="size-medium wp-image-2508" title="When Did Performance Stop Mattering?" src="http://blog.ericlamb.net/wp-content/uploads/2009/09/performance-300x203.jpg" alt="When Did Performance Stop Mattering?" width="300" height="203" /></a><p class="wp-caption-text">When Did Performance Stop Mattering?</p></div>
<p>Which lead to the question of why.  At the moment it seems like a question of speed of development versus performance (which is ironic because <a title="Looking For More From Zend Framework" href="http://blog.ericlamb.net/2009/08/more-from-zend-framework/" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2F2009%2F08%2Fmore-from-zend-framework%2F','Looking+For+More+From+Zend+Framework')" target="_self">Zend Framework is <em>not</em> easy</a> <em>or speedy</em> to develop with).</p>
<p>&lt;disclaimer&gt;<br />
To be fair, it&#8217;s not just frameworks that have an uncomfortable overhead. Just take a look at Joomla and Drupal; 2 popular content management systems with an absurd overhead. It&#8217;s just easier to focus on my current interest rather than the CMS&#8217;es.<br />
&lt;/disclaimer&gt;</p>
<p>One thing I&#8217;m having a hard time getting comfortable with is how much memory is required when using a php web framework. Out of the box both Zend and Symfony (for example) use around 5MB per request. Understand, this is without any custom code. Just setting up the MVC and Autoloader for the default views and models. Nothing impressive or useful and 5 fucking MB to run <em>that</em>?</p>
<p>After having been on the wrong end of this issue on my own code I&#8217;m pretty sensitive to how my code performs; I&#8217;ve written some nasty algorithms and watching them crumble in real time has a tendency to turn you around <img src='http://blog.ericlamb.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Researching the issue doesn&#8217;t really help. There&#8217;s a lot of advice on how to improve the performance but it seems to always center around common sense improvements you should be using <em>anyway</em>.</p>
<p>The most touted improvement I&#8217;ve heard is that you have to use a PHP accelerator and opcode cache. I just find that response flawed but not because it&#8217;s bad advice but because it&#8217;s <em>common sense</em>. Yes, it&#8217;s true, but <em>not</em> using a framework in combination with a PHP accelerator and opcode cache is still better in my experience. All relying on those tools does is move the baseline for performance, which you&#8217;re supposed to do already, and a framework still consumes a good amount of resources on it&#8217;s own.</p>
<p>In my experience you get about a 50% reduction in memory usage when using something like x-cache but using the Zend Framework  still leaves a total of 2.5MB of memory usage to accomplish the bare minimum setup.</p>
<p>One saving grace is that hardware is cheap. Scaling with hardware is usually the go-to escape when the bottleneck is the code but it&#8217;s not without it&#8217;s own set of issues. For one thing while it&#8217;s true that hardware is cheap the labor to maintain that hardware is not. Especially if you want to maintain the server in a proper and responsible manner.</p>
<p>Another option, that&#8217;s really only available when using the Zend Framework, is decoupling the project from a direct dependence and not use the MVC components. In anticipation of doing this I&#8217;ve been writing a lot my recent code and projects in a style that&#8217;ll allow easy(ish) separation when the time comes.</p>
<p>At this point I haven&#8217;t used a framework in a production environment so all of this consternation might be for nothing. I just have a hard time accepting the performance hit of half a MB for using something trivial like a content management system (drupal) or, for example, a component like Zend_Navigation compared to the benefit. What are they actually doing to make the cost worth while?</p>
<p>Still another option is to just walk away from this whole OOP thing and head back to the familiar touch of procedural php and using functions and classes as more of decorators to apply than core components.  From my personal experience, and <em>only my experience</em>, using OOP is way more expensive than procedural. At the end of the day I need my programs to work fast, be easy to operate for my users and have a low impact on the server. How does using OOP help that?</p>
<p>At the moment I&#8217;m not sure how this is going to work out. I am confident it&#8217;ll be an adventure though. Hopefully, I find out how Zend will scale <em>before</em> a project of mine goes viral or gets popular. Hopefully.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/09/when-did-performance-stop-being-important/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
