<?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>CodeWord: Apokalyptik &#187; Personal</title>
	<atom:link href="http://blog.apokalyptik.com/category/personal/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.apokalyptik.com</link>
	<description>The random things that spew forth from my brain...</description>
	<lastBuildDate>Sun, 29 Aug 2010 18:53:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>OnLive on OSX over WIFI</title>
		<link>http://blog.apokalyptik.com/2010/08/29/onlive-on-osx-over-wifi/</link>
		<comments>http://blog.apokalyptik.com/2010/08/29/onlive-on-osx-over-wifi/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 18:53:06 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Funny Stuff]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[SRSLY]]></category>
		<category><![CDATA[Web Stuff]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[onlive]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=661</guid>
		<description><![CDATA[This does, in fact, work.]]></description>
			<content:encoded><![CDATA[<p><a href="http://forums.macrumors.com/showpost.php?p=10581531&#038;postcount=7">This</a> does, in fact, work.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2010/08/29/onlive-on-osx-over-wifi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My Buddy Boy&#8230; Some Bad News</title>
		<link>http://blog.apokalyptik.com/2010/07/25/my-buddy-boy-some-bad-news/</link>
		<comments>http://blog.apokalyptik.com/2010/07/25/my-buddy-boy-some-bad-news/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 17:15:23 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Buddy]]></category>
		<category><![CDATA[Dogs]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=650</guid>
		<description><![CDATA[Buddy has been sick off and on for a few weeks now in various forms and to various degrees. He developed this little light, rare, cough&#8230; Then a week and a half ago He was throwing up his food and we saw blood. We took him to the emergency vet and had him checked out, [...]]]></description>
			<content:encoded><![CDATA[<p>Buddy has been sick off and on for a few weeks now in various forms and to various degrees.  He developed this little light, rare, cough&#8230; Then a week and a half ago He was throwing up his food and we saw blood.  We took him to the emergency vet and had him checked out, we had an x-ray done looking for blockages in his digestive track, there were none.  <a href="http://blog.apokalyptik.com/wp-content/uploads/2010/06/buddy-x-ray-2.jpg">We did see something in his lungs</a>.  The normal vet thought it was probably a little bronchitis or similar and advised waiting a few days to see what happened.  It got worse and his breathing became labored.  We got him back in for more X-Rays just this Friday, and the results suggested one of two things. </p>
<p>There is a very real possibility that he has cancer of some sort.  There is a more slim possibility that he has a systemic fungal infection.</p>
<p>Of the two we&#8217;re hoping for the yeast infection (and 6-12 months of Meds.)  Because of how the X-rays look and how bad shape he&#8217;s falling into so fast&#8230; If it&#8217;s cancer&#8230; It&#8217;s pretty much a death sentence.  So we&#8217;re waiting for results on his blood tests to see if its a fungus.  And we&#8217;ve been trying to have as many good moments with him as we have left. Moments where he&#8217;s wagging his tail.  Times when he wants to play ball. Even just times when he wants to cuddle.  The house is already very different. I find myself crying at random memories.  He gave me a face bath on Friday night&#8230; I couldn&#8217;t help but wonder if it was going to be the last one I&#8217;d get.</p>
<p>He&#8217;s not even 5 years old now, and he&#8217;s been through so much. He&#8217;s had such a hard life, medically.  He&#8217;s survived parvo, allergies, too many infections to count.  In the end I&#8217;m not crying for him, he&#8217;s going to a better place his pains get to end now. I&#8217;m crying for me&#8230; Because I already miss my friend now and It hurts to think how much I&#8217;ll miss him when he&#8217;s gone.</p>
<p>There&#8217;s very little blame to be had here. We feed him the best, we take care of him as best we can, we play with him, love him. </p>
<p>I wish that I had something better to put here. Something funny, or insightful, or informative. </p>
<p>I really do.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2010/07/25/my-buddy-boy-some-bad-news/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Time based bloom filters</title>
		<link>http://blog.apokalyptik.com/2010/01/06/time-based-bloom-filters/</link>
		<comments>http://blog.apokalyptik.com/2010/01/06/time-based-bloom-filters/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 04:29:56 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[Ruby (on or off) Rails]]></category>
		<category><![CDATA[SRSLY]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=498</guid>
		<description><![CDATA[I find this concept fascinating and plan to investigate further down this road.]]></description>
			<content:encoded><![CDATA[<p>I find <a href="http://www.igvita.com/2010/01/06/flow-analysis-time-based-bloom-filters/">this concep</a>t fascinating and plan to investigate further down this road.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2010/01/06/time-based-bloom-filters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Erlang&#8230; Starting to come together&#8230;</title>
		<link>http://blog.apokalyptik.com/2009/03/30/erlang-starting-to-come-together/</link>
		<comments>http://blog.apokalyptik.com/2009/03/30/erlang-starting-to-come-together/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 05:55:28 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=426</guid>
		<description><![CDATA[I&#8217;m finally starting to &#8220;get&#8221; erlang&#8230; just a little bit&#8230; I&#8217;ve managed to make several TCP daemons&#8230; an echo server, a reverse echo server, and a server which spits out an md5 values of the input given. Yea&#8230; I know&#8230; Lame&#8230; but its one hump I&#8217;m finally over&#8230;]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m finally starting to &#8220;get&#8221; erlang&#8230; just a little bit&#8230; I&#8217;ve managed to make several TCP daemons&#8230; an echo server, a reverse echo server, and a server which spits out an md5 values of the input given.  </p>
<p>Yea&#8230; I know&#8230; Lame&#8230; but its one hump I&#8217;m finally over&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2009/03/30/erlang-starting-to-come-together/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debian Lenny, Avahi, AFP&#8230; Linux Fileserver for OSX Clients</title>
		<link>http://blog.apokalyptik.com/2009/02/12/debian-lenny-avahi-afp-linux-fileserver-for-osx-clients/</link>
		<comments>http://blog.apokalyptik.com/2009/02/12/debian-lenny-avahi-afp-linux-fileserver-for-osx-clients/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 01:25:51 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=391</guid>
		<description><![CDATA[If you&#8217;re like me you have an OSX computer or 3 at home, and a debian file server. If you&#8217;re like me you hate samba/nfs on principle and want your debian server to show up in finder.  If you&#8217;re like me you arent using debian 3 which is what most of the walkthroughs seem to [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me you have an OSX computer or 3 at home, and a debian file server. If you&#8217;re like me you hate samba/nfs on principle and want your debian server to show up in finder.  If you&#8217;re like me you arent using debian 3 which is what most of the walkthroughs seem to expect&#8230;  This is how I did it&#8230; With Debian Lenny.</p>
<p>What we&#8217;re using, and why:</p>
<ul>
<li>Avahi handles zeroconf (making it show up in finder) (most howtos involve howl which is no longer in apt)</li>
<li>netatalk has afpd</li>
<li>afpd is the fileserver</li>
</ul>
<p>From: <a href="http://blog.damontimm.com/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/">http://blog.damontimm.com/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/</a></p>
<ul>
<li>apt-get update</li>
<li>mkdir -p ~/src/netatalk</li>
<li>cd ~/src/netatalk</li>
<li>apt-get install cracklib2-dev libssl-dev</li>
<li>apt-get source netatalk</li>
<li>apt-get build-dep netatalk</li>
<li>cd netatalk-2.0.3</li>
</ul>
<p>From: <a href="http://www.sharedknowhow.com/2008/05/installing-netatalk-under-centos-5-with-leopard-support/">http://www.sharedknowhow.com/2008/05/installing-netatalk-under-centos-5-with-leopard-support/</a></p>
<ul>
<li>vim bin/cnid/cnid_index.c ## replace &#8220;ret = db-&gt;stat(db, &amp;sp, 0);&#8221; with &#8220;ret = db-&gt;stat(db, NULL, &amp;sp, 0);&#8221; line 277</li>
<li>vim etc/cnid_dbd/dbif.c ## replace &#8220;ret = db-&gt;stat(db, &amp;sp, 0);&#8221; with &#8220;ret = db-&gt;stat(db, NULL, &amp;sp, 0);&#8221; line 517</li>
</ul>
<p>Mine</p>
<ul>
<li>./configure &#8211;prefix=/usr/local/netatalk</li>
<li>make</li>
<li>make install</li>
<li>vim /etc/rc.local ## add &#8220;/usr/local/netatalk/sbin/afpd&#8221;</li>
<li>/usr/local/netatalk/sbin/afpd</li>
</ul>
<p>From: <a href="http://www.disgruntled-dutch.com/2007/general/how-to-get-your-linux-based-afp-server-to-show-up-correctly-in-leopards-new-finder">http://www.disgruntled-dutch.com/2007/general/how-to-get-your-linux-based-afp-server-to-show-up-correctly-in-leopards-new-finder</a></p>
<ul>
<li>apt-get install avahi-daemon</li>
<li>vim /etc/nsswitch.conf ## make the hosts line read &#8220;hosts: files dns mdns4&#8243;</li>
<li>cd /etc/avahi/services</li>
<li>wget http://www.disgruntled-dutch.com/media/afpd.service</li>
<li>/etc/init.d/avahi-daemon restart</li>
</ul>
<p>in case that file drops off the face of the net, this is its contents (except &#8220;&lt; ?&#8221; is &#8220;&lt;?&#8221; and &#8220;&lt; !&#8221; is &#8220;&lt;!&#8221;) :</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;">&lt; ?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">standalone</span>=<span style="color: #ff0000;">'no'</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!--*-nxml-*--&gt;</span>
<span style="color: #009900;">&lt; !DOCTYPE service-group SYSTEM <span style="color: #ff0000;">&quot;avahi-service.dtd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service</span> -group<span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name</span> <span style="color: #000066;">replace-wildcards</span>=<span style="color: #ff0000;">&quot;yes&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>%h<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>_afpovertcp._tcp<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;port<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>548<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/port<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>At this point your server should show up under the network in your finder&#8230; and you should be able to connect with any system username/pw combo</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2009/02/12/debian-lenny-avahi-afp-linux-fileserver-for-osx-clients/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>a dumbed down version of wpdb for sqlite</title>
		<link>http://blog.apokalyptik.com/2008/11/18/a-dumbed-down-version-of-wpdb-for-sqlite/</link>
		<comments>http://blog.apokalyptik.com/2008/11/18/a-dumbed-down-version-of-wpdb-for-sqlite/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 20:08:47 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Stuff]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=307</guid>
		<description><![CDATA[I&#8217;ve been working, gradually, on a project using an sqlite3 database (for its convenience) and found myself missing the clean elegance of wpdb&#8230; so I implemented it. It was actually really easy to do, and I figured I would throw it up here for anyone else wishing to use it. The functionality that I build [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working, gradually, on a project using an sqlite3 database (for its convenience) and found myself missing the clean elegance of wpdb&#8230; so I implemented it.  It was actually really easy to do, and I figured I would throw it up here for anyone else wishing to use it.    The functionality that I build this around is obtainable here: http://php-sqlite3.sourceforge.net/pmwiki/pmwiki.php (don&#8217;t freak&#8230; its in apt&#8230;)  </p>
<p>With this I can focus on the sql, which is different enough, and not fumble over function names and such&#8230;  $db = new sqlite_wpdb($dbfile, 3); var_dump($db->get_results(&#8220;SELECT * FROM `mytable` LIMIT 5&#8243;));</p>
<p>the code is below&#8230; and hopefully not too mangled&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> sqlite_wpdb <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$version</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$db</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> sqwpdb<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$version</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
                <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$version</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$version</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$function</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;sqlite<span style="color: #006699; font-weight: bold;">{$version}</span>_open&quot;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$function</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">db</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #000088;">$function</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">version</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$version</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fquery</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;sqlite<span style="color: #006699; font-weight: bold;">{$this-&gt;version}</span>_query&quot;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ferror</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;sqlite<span style="color: #006699; font-weight: bold;">{$this-&gt;version}</span>_error&quot;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">farray</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;sqlite<span style="color: #006699; font-weight: bold;">{$this-&gt;version}</span>_fetch_array&quot;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> escape<span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;''&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">call_user_func</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fquery</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">db</span><span style="color: #339933;">,</span> <span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">result</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">error</span> <span style="color: #339933;">=</span> <span style="color: #990000;">call_user_func</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ferror</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">db</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> array_to_object<span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$array</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #000088;">$object</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> stdClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$array</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$idx</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$val</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$object</span><span style="color: #339933;">-&gt;</span><span style="color: #000088;">$idx</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$val</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #000088;">$object</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> get_results<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$rval</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">array_to_object</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">call_user_func</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">farray</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">result</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$rval</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #000088;">$rval</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> get_row<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #990000;">array_shift</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$results</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> get_var<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_val</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> get_val<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_row</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">get_object_vars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #990000;">array_shift</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> get_col<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$column</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$results</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$row</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">get_object_vars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                                <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
                        <span style="color: #000088;">$column</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_shift</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #000088;">$column</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2008/11/18/a-dumbed-down-version-of-wpdb-for-sqlite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Writing your own shell in php</title>
		<link>http://blog.apokalyptik.com/2008/08/03/writing-your-own-shell-in-php/</link>
		<comments>http://blog.apokalyptik.com/2008/08/03/writing-your-own-shell-in-php/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 20:47:48 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Stuff]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=295</guid>
		<description><![CDATA[I&#8217;ve always wanted to write my own simple shell in php.  Call me a glutin for punishment, but it seems like something that a lot of people could use to be able to do&#8230; If your web app had a command line interface for various things&#8230; like looking up stats, or users, or suspending naughty [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always wanted to write my own simple shell in php.  Call me a glutin for punishment, but it seems like something that a lot of people could use to be able to do&#8230; If your web app had a command line interface for various things&#8230; like looking up stats, or users, or suspending naughty accounts, or whatever&#8230;. wouldnt that be cool and useful?  Talk about geek porn.  Anyways this this morning I got around to tinkering with the idea, and here is what i came up with&#8230; It&#8217;s rough, and empty, but its REALLY easy to extend and plug into any php application.</p>
<pre>apokalyptik:~/phpshell$ ./shell.php

/home/apokalyptik/phpshell &gt; hello

hi there

/home/apokalyptik/phpshell &gt; hello world

hi there world

/home/apokalyptik/phpshell &gt; cd ..

/home/apokalyptik/ &gt; cd phpshell

/home/apokalyptik/phpshell &gt; ls

shell.php

/home/apokalyptik//phpshell &gt; exit

apokalyptik:~/phpshell$ ./shell.php</pre>
<p>See the source here: <a href="http://blog.apokalyptik.com/files/phpshell/shell.phps">shell.phps</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2008/08/03/writing-your-own-shell-in-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>building sed for osx</title>
		<link>http://blog.apokalyptik.com/2008/04/24/building-sed-for-osx/</link>
		<comments>http://blog.apokalyptik.com/2008/04/24/building-sed-for-osx/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 17:03:40 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=282</guid>
		<description><![CDATA[I work in linux a lot&#8230; not bsd. So the OSX (bsd style) implementation of sed really throws me for a loop when I go text-file-spelunking, whats worse is that my scripts using sed aren&#8217;t portable between the two OSs. A quick googling this morning landed me here: http://wiki.octave.org/wiki.pl?OctaveForMac which gives perfectly good instructions on [...]]]></description>
			<content:encoded><![CDATA[<p>I work in linux a lot&#8230; not bsd.  So the OSX (bsd style) implementation of sed really throws me for a loop when I go text-file-spelunking, whats worse is that my scripts using sed aren&#8217;t portable between the two OSs.  </p>
<p>A quick googling this morning  landed me here: <a href="http://wiki.octave.org/wiki.pl?OctaveForMac">http://wiki.octave.org/wiki.pl?OctaveForMac</a> which gives perfectly good instructions on installing sed. except it didnt work.  I grabbed  the latest version of sed (4.1.5) and got the error </p>
<pre>
sed: 1: "install_sh=/Users/apoka ...": command i expects \ followed by text
sed: 1: "install_sh=/Users/apoka ...": command i expects \ followed by text
</pre>
<p>Ironic, huh?  Well taking a guess that at some point sed hadcome to depend on its own functionality to configure itself I jumped back a version&#8230; Figuring i replace BSD sed with an out of date GNU sed, and then use the old GNU sed to build the new GNU sed. Which worked great.  I Installed first sed-3.0.2, and then 4.1.5 in this manner:</p>
<pre>
./configure --prefix=/usr/ --with-included-regex --with-included-gettext &#038;&#038; make &#038;&#038; sudo make install
</pre>
<p>I&#8217;m happy with my -r again&#8230;</p>
<pre>
# date | sed -r s/'[0-9]'/'?'/g
Thu Apr ?? ??:??:?? PDT ????
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2008/04/24/building-sed-for-osx/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Daemonize Anything</title>
		<link>http://blog.apokalyptik.com/2008/04/10/daemonize-anything/</link>
		<comments>http://blog.apokalyptik.com/2008/04/10/daemonize-anything/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 02:50:03 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=280</guid>
		<description><![CDATA[I hacked together this little C program from this other little c program. Basically acts as an execution wrapper that lets you fork() and detach and run a command in the background with a pidfile and log file for program output. So far I havent had any problems with it&#8230; but then I&#8217;m not a [...]]]></description>
			<content:encoded><![CDATA[<p>I hacked together <a href="/files/daemonize/daemonize.c">this little C program</a> from <a href="http://www.enderunix.org/documents/eng/daemon.php">this other little c program</a>.  Basically acts as an execution wrapper that lets you fork() and detach and run a command in the background with a pidfile and log file for program output. So far I havent had any problems with it&#8230; but then I&#8217;m not a true C guy so any input is welcomed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2008/04/10/daemonize-anything/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bella and buddy, represent&#8217;n</title>
		<link>http://blog.apokalyptik.com/2008/03/31/bella-and-buddy-representn/</link>
		<comments>http://blog.apokalyptik.com/2008/03/31/bella-and-buddy-representn/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 23:40:07 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Bella]]></category>
		<category><![CDATA[Buddy]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Dogs]]></category>
		<category><![CDATA[Funny Stuff]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Random Thoughts]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=278</guid>
		<description><![CDATA[They&#8217;re down with the Dubya P.]]></description>
			<content:encoded><![CDATA[<p>They&#8217;re down with the Dubya P.</p>
<p>
<center><br />
<img src="http://tmp.thoughtcandy.com/images/photo/bf0/21912/DSC_1747-small.jpg" alt="" /><br />
<br />
<img src="http://tmp.thoughtcandy.com/images/photo/0d1/21890/DSC_1725-small.jpg" alt="" /><br />
<br />
<img src="http://tmp.thoughtcandy.com/images/photo/d62/21854/DSC_1689-small.jpg" alt="" /><br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2008/03/31/bella-and-buddy-representn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
