<?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>pixelnix.com</title>
	<atom:link href="http://pixelnix.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://pixelnix.com</link>
	<description></description>
	<lastBuildDate>Fri, 18 Jun 2010 20:10:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Custom logging to a database with PHP and Apache</title>
		<link>http://pixelnix.com/custom-logging-to-a-database-with-php-and-apache/</link>
		<comments>http://pixelnix.com/custom-logging-to-a-database-with-php-and-apache/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 19:20:21 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://pixelnix.com/?p=84</guid>
		<description><![CDATA[My organization needed a way to create several types of persistent database-stored logs for our PHP website, where each log entry would record which user was requesting the resource.  We decided we would try for a solution that did not require us to do a database insert for every page view, for obvious reasons.  Here [...]]]></description>
			<content:encoded><![CDATA[<p>My organization needed a way to create several types of persistent database-stored logs for our PHP website, where each log entry would record which user was requesting the resource.  We decided we would try for a solution that did not require us to do a database insert for every page view, for obvious reasons.  Here is what we came up with.  Our environment is PHP5 and Apache 2.2.</p>
<p><span id="more-84"></span>Apache&#8217;s <a href="http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#formats" target="_blank">custom log format</a> shows how to log variables from the Apache environment.  If there&#8217;s an environment variable called FOOBAR, you log it with the format string <em>%{FOOBAR}e</em>.  This is great because PHP can inject data into the Apache environment, meaning we can get more or less any data we like into an Apache custom log.</p>
<p>The first Apache configuration step was to create a custom log format that we can then apply to a logfile.  We create the log format in httpd.conf.  Find the log_config_module section and add a LogFormat directive there:</p>
<pre>&lt;IfModule log_config_module&gt;
LogFormat "%t %U %D %a %{MY_UID}e" mystats
&lt;/IfModule&gt;</pre>
<p>In this example, we add a log format named &#8220;mystats&#8221; which logs these datapoints:  date/time the request was received, URL path requested, time taken to serve the request, remote client IP address, and the environment variable MY_UID.  For our purposes, we are logging these data because our aim is to keep a 7-day rolling log of webserver performance &#8211; how long it took to process each request &#8211; to monitor our servers more effectively.</p>
<p>Then we set up a custom log for our site&#8217;s vhost in httpd-vhosts.conf:</p>
<pre>&lt;VirtualHhost 192.168.100.1:80&gt;
...
CustomLog logs/mysite_custom_log mystats
...
&lt;/VirtualHost&gt;</pre>
<p>This makes Apache start logging every request to that host, in the format defined by our LogFormat directive named &#8220;mystats&#8221;.</p>
<p>The first step in PHP code, then, is to simply inject the MY_UID environment variable containing the user ID of whoever is logged in.  In our master controller there&#8217;s a check to see if the client has an authenticated session, and if they do we just add a quick call to set the environment var:</p>
<pre>apache_setenv('MY_UID', $the_current_user_id);</pre>
<p>Once this in all in place, you should be able to tail the logfile mysite_custom_log and see that requests are being logged with the requesting client&#8217;s user ID, or &#8220;-&#8221; if no user is authenticated.</p>
<p>We rotate these logs daily.  Our final step is a cron&#8217;d PHP script that runs in the wee hours, taking yesterday&#8217;s log file, iterating each line, inserting the data into a table&#8230; and we&#8217;re done!  We logged each request with how long our server processed it, and who was signed in for that request, and we did it without adding any overhead to our application.</p>
]]></content:encoded>
			<wfw:commentRss>http://pixelnix.com/custom-logging-to-a-database-with-php-and-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Relaunching and retooling for Habitat for Humanity of Oregon</title>
		<link>http://pixelnix.com/relaunching-and-retooling-for-habitat-for-humanity-of-oregon/</link>
		<comments>http://pixelnix.com/relaunching-and-retooling-for-habitat-for-humanity-of-oregon/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 17:30:10 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[pixelnix]]></category>

		<guid isPermaLink="false">http://pixelnix.com/?p=78</guid>
		<description><![CDATA[Habitat Oregon is an umbrella support organization &#8220;created to offer fundraising, public relations, and advocacy support to all 34 Habitat affiliates – the groups of dedicated staff and volunteers building the homes – across our state.&#8221;  We are proud to support Habitat in Oregon, and to offer our small measure of help by launching the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.habitatoregon.org/about/" target="_blank">Habitat Oregon</a> is an umbrella support organization &#8220;created to offer fundraising, public relations, and advocacy support to all 34 Habitat affiliates – the groups of dedicated staff and volunteers building the homes – across our state.&#8221;  We are proud to support Habitat in Oregon, and to offer our small measure of help by launching the newly retooled <a href="http://habitatoregon.org" target="_blank">habitatoregon.org</a> &#8212; with new WordPress-powered content management capability, a blog, and an online forum for Habitat affiliate employees throughout Oregon.</p>
<p>Thanks, Habitat for Humanity of Oregon, for the opportunity to lend a hand!</p>
]]></content:encoded>
			<wfw:commentRss>http://pixelnix.com/relaunching-and-retooling-for-habitat-for-humanity-of-oregon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flexigrid jQuery plugin: extending to allow sorting of static grids</title>
		<link>http://pixelnix.com/flexigrid-jquery-plugin-extending-to-allow-sorting-of-static-grids/</link>
		<comments>http://pixelnix.com/flexigrid-jquery-plugin-extending-to-allow-sorting-of-static-grids/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 23:13:55 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[flexigrid]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://pixelnix.com/?p=74</guid>
		<description><![CDATA[Flexigrid is a nice lightweight jQuery plugin that turns tables into sortable, searchable, data-driven grids.  It&#8217;s all ajaxed up to the hilt, like every other jQuery plugin, but it can also create a quick nice-looking grid from a plain ol&#8217; HTML table.
Out of the box, though, its column sorting feature does not work unless your [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/flexigrid/" target="_blank">Flexigrid</a> is a nice lightweight jQuery plugin that turns tables into sortable, searchable, data-driven grids.  It&#8217;s all ajaxed up to the hilt, like every other jQuery plugin, but it can also create a quick nice-looking grid from a plain ol&#8217; HTML table.</p>
<p>Out of the box, though, its column sorting feature does not work unless your grid is hooked up to a server-side data source.  Here is a svn patch that adds this functionality to the current head branch of flexigrid.js:</p>
<p><a href="http://pixelnix.com/wp-content/uploads/flexigrid-sort-in-place.diff">flexigrid-sort-in-place.diff</a></p>
<p>This patch is built on the current trunk revision of flexigrid.js, which is r3.  I am currently unable to create a patch for the current release version (&#8220;1.0b3&#8243;), which is slightly different; but to apply these changes to that version is pretty simple, since I only made 3 changes:</p>
<ol>
<li>add &#8220;sortorder: &#8216;asc&#8217;&#8221; to the default properties struct up at the top</li>
<li>add the &#8220;else if (!p.url) this.inPlaceSort();&#8221; clause to the end of the changeSort method</li>
<li>copy in the inPlaceSort() function</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://pixelnix.com/flexigrid-jquery-plugin-extending-to-allow-sorting-of-static-grids/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>HATE.  DNS.</title>
		<link>http://pixelnix.com/hate-dns/</link>
		<comments>http://pixelnix.com/hate-dns/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 20:44:31 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[DNS]]></category>
		<category><![CDATA[series of tubes]]></category>

		<guid isPermaLink="false">http://pixelnix.com/?p=71</guid>
		<description><![CDATA[A short play in one act.
Nick: &#60;typing carefully&#62;
Nick:  &#60;clicks button&#62;
[some time passes]
Internet: &#8220;Oh, sorry, no trailing period? I&#8217;ll just assume you mean to send this
email to freakin Nepal. MORON.&#8221;
]]></description>
			<content:encoded><![CDATA[<p><em>A short play in one act.</em></p>
<p>Nick: &lt;typing carefully&gt;</p>
<p>Nick:  &lt;clicks button&gt;</p>
<p>[some time passes]</p>
<p>Internet: &#8220;Oh, sorry, no trailing period? I&#8217;ll just assume you mean to send this<br />
email to freakin Nepal. MORON.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://pixelnix.com/hate-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ant Tar task doesn&#8217;t care about your file permissions</title>
		<link>http://pixelnix.com/ant-tar-task-doesnt-care-about-your-file-permissions/</link>
		<comments>http://pixelnix.com/ant-tar-task-doesnt-care-about-your-file-permissions/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 16:36:23 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Apache Ant]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://pixelnix.com/?p=55</guid>
		<description><![CDATA[According to the documentation for the Ant Tar task, the &#8220;implicit fileset&#8221; of stuff to be included in your archive can be extended &#8220;to allow control over the access mode, username and groupname.&#8221;  I guess you have to read between the lines (or go with the ol&#8217; trial by error) to find out that not only [...]]]></description>
			<content:encoded><![CDATA[<p>According to <a href="http://ant.apache.org/manual/CoreTasks/tar.html">the documentation</a> for the Ant Tar task, the &#8220;implicit fileset&#8221; of stuff to be included in your archive can be extended &#8220;to allow control over the access mode, username and groupname.&#8221;  I guess you have to read between the lines (or go with the ol&#8217; trial by error) to find out that not only does the implicit fileset provide no control over these properties of your files, it actively reverts the file permissions to some default access mode (644).  Java ftw!</p>
<p>So you are hypothetically deploying your ant-built tar&#8217;d up software release.  Let&#8217;s further say for the sake of argument that it contains some business-critical scripts that must keep their executable mode to be run from cron.  Oops, those files are no longer executable!  You will soon be disappointed at the failure of your cron job to do anything at all, and you may experience some increased email volume accompanied by mild irritation.  If this condition persists, call your doctor, or go back and RTFM again because as the docs imply, this shortcoming can be easily overcome.</p>
<p><span id="more-55"></span>Your job is to identify all the files that need to keep their mode, username, or groupname, and specify said property in a special fileset called tarfileset.  In my ant build, let&#8217;s say the build root is ${builddir} and contains 2 components called src and lib.  I&#8217;ve got one specific file src/foo/exec.sh, and a whole tree of stuff at lib/bar, that have to be executable.  I will need to call the Tar task with two tarfilesets: one to include the executables and set their mode, and a second to include everything else while excluding the executables.</p>
<p>Before:</p>
<pre>&lt;tar destfile="${buildfile.name}"
     basedir="${builddir}"
     longfile="gnu"
     includes="src/**, lib/**"/&gt;</pre>
<p>After:</p>
<pre>&lt;tar destfile="${buildfile.name}" longfile="gnu"&gt;
     &lt;tarfileset dir="${builddir}" filemode="755"&gt;
         &lt;include name="src/foo/exec.sh"/&gt;
         &lt;include name="lib/bar/**"/&gt;
     &lt;/tarfileset&gt;
     &lt;tarfileset dir="${builddir}"&gt;
         &lt;include name="src/**"/&gt;
         &lt;include name="lib/**"/&gt;
         &lt;exclude name="src/foo/exec.sh"/&gt;
         &lt;exclude name="lib/bar/**"/&gt;
     &lt;/tarfileset&gt;
&lt;/tar&gt;</pre>
<p>Works for me!</p>
]]></content:encoded>
			<wfw:commentRss>http://pixelnix.com/ant-tar-task-doesnt-care-about-your-file-permissions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Thanks, Site5! (updated)</title>
		<link>http://pixelnix.com/thanks-site5/</link>
		<comments>http://pixelnix.com/thanks-site5/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 19:37:42 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[pixelnix]]></category>

		<guid isPermaLink="false">http://pixelnix.com/?p=62</guid>
		<description><![CDATA[I have generally had a good customer experience with web hosting from Site5.com.  Their customer support is responsive, price reasonable, server performance acceptable for the price.
The other day, someone at Site5 decided they had to respond to a vague and specious rumor circulating about a vulnerability in OpenSSH.  Their response?  To disable all customer ssh [...]]]></description>
			<content:encoded><![CDATA[<p>I have generally had a good customer experience with web hosting from Site5.com.  Their customer support is responsive, price reasonable, server performance acceptable for the price.</p>
<p>The other day, someone at Site5 decided they had to respond to <a href="http://isc.sans.org/diary.html?storyid=6742">a vague and specious rumor</a> circulating about a vulnerability in OpenSSH.  Their response?  To disable all customer ssh access.  Wheeeee!</p>
<p>Yesterday they finally turned back on SSH access.  But without any notice, they disabled ssh1 access on my server.  I don&#8217;t dispute that I should probably have been using ssh2 keys for accessing my svn repo over svn+ssh, but I wasn&#8217;t.  And since I am sort of a doofus sometimes when it comes to sysadmin type stuff, I got to spend half a day looking for some problem with my svn client before I thought of the obvious fact that while Site5 claimed all ssh access was restored, that claim may not have been entirely true.  Thanks Site5, you totally owe me a beer.</p>
<p>Update &#8211; <a href="http://isc.sans.org/diary.html?storyid=6760">SANS said yesterday</a> it was indeed a hoax.</p>
]]></content:encoded>
			<wfw:commentRss>http://pixelnix.com/thanks-site5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Projekt:Frontporch</title>
		<link>http://pixelnix.com/projektfrontporch/</link>
		<comments>http://pixelnix.com/projektfrontporch/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 20:34:45 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Life 'n stuff]]></category>

		<guid isPermaLink="false">http://pixelnix.com/?p=48</guid>
		<description><![CDATA[First drawings from the architect are in hand!  Before/after:


]]></description>
			<content:encoded><![CDATA[<p>First drawings from the architect are in hand!  Before/after:<span id="more-48"></span></p>
<p><img class="size-full wp-image-49 alignnone" src="http://pixelnix.com/wp-content/uploads/front-photo.jpg" alt="" width="400" height="297" /></p>
<p><img class="size-full wp-image-50 alignnone" src="http://pixelnix.com/wp-content/uploads/front-elevation.gif" alt="" width="328" height="309" /></p>
]]></content:encoded>
			<wfw:commentRss>http://pixelnix.com/projektfrontporch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Launched the new Habitat for Humanity Portland/Metro East</title>
		<link>http://pixelnix.com/launched-the-new-habitat-for-humanity-portlandmetro-east/</link>
		<comments>http://pixelnix.com/launched-the-new-habitat-for-humanity-portlandmetro-east/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 16:22:04 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Habitat for Humanity Portland/Metro East]]></category>
		<category><![CDATA[pixelnix]]></category>

		<guid isPermaLink="false">http://pixelnix.com/?p=39</guid>
		<description><![CDATA[Last night, Maria and I completed and launched the new habitatportlandmetro.org! Big props, as the kids say (they say that, right?), to Maria for driving this project to completion, and to Chris for laying out the best-designed Habitat site I&#8217;ve seen yet.
The launch was nearly 100% smooth, the only exception being when I broke Habitat&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Last night, Maria and I completed and launched the new <a href="http://habitatportlandmetro.org" target="_blank">habitatportlandmetro.org</a>! Big props, as the kids say (they say that, right?), to Maria for driving this project to completion, and to Chris for laying out the best-designed Habitat site I&#8217;ve seen yet.</p>
<p>The launch was nearly 100% smooth, the only exception being when I broke Habitat&#8217;s email for a half hour or so.  Turns out that if you move DNS for a domain, you move it for, you know, the whole domain, and stuff.  Who knew you could be a professional web developer while having such a crappy grasp of DNS?  Well, I&#8217;m living proof that it&#8217;s true.  Or false, depending on your definition of &#8220;professional&#8221;.</p>
<p><em>Update:  DNS caching is a giant PITA.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://pixelnix.com/launched-the-new-habitat-for-humanity-portlandmetro-east/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress plugins released</title>
		<link>http://pixelnix.com/wordpress-plugins-released/</link>
		<comments>http://pixelnix.com/wordpress-plugins-released/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 22:14:32 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://pixelnix.com/?p=28</guid>
		<description><![CDATA[I developed two plugins (so far) to support the new Habitat for Humanity Portland/Metro East site, and they are now listed in the WordPress Plugin Repository:

PageSpot
Media2Layout

So far today I have compulsively checked the download statistics and somehow 60+ people downloaded PageSpot within about 6 hours of it being published.  I know there are a lot [...]]]></description>
			<content:encoded><![CDATA[<p>I developed two plugins (so far) to support the new Habitat for Humanity Portland/Metro East site, and they are now listed in the <a href="http://wordpress.org/extend/plugins">WordPress Plugin Repository</a>:</p>
<ul>
<li><a href="http://wordpress.org/extend/plugins/pagespot/">PageSpot</a></li>
<li><a href="http://wordpress.org/extend/plugins/media2layout/">Media2Layout</a></li>
</ul>
<p>So far today I have compulsively checked the download statistics and somehow 60+ people downloaded PageSpot within about 6 hours of it being published.  I know there are a lot of WordPress blogs and users out there but there must be even more than I assumed.</p>
]]></content:encoded>
			<wfw:commentRss>http://pixelnix.com/wordpress-plugins-released/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Site update</title>
		<link>http://pixelnix.com/site-update/</link>
		<comments>http://pixelnix.com/site-update/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 19:01:16 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[pixelnix]]></category>

		<guid isPermaLink="false">http://pixelnix.com/?p=36</guid>
		<description><![CDATA[A brand new pixelnix.com says Hello, World!  More content to come as I invent it from the thin strands of ether holding together these interwebs.
]]></description>
			<content:encoded><![CDATA[<p>A brand new pixelnix.com says Hello, World!  More content to come as I invent it from the thin strands of ether holding together these interwebs.</p>
]]></content:encoded>
			<wfw:commentRss>http://pixelnix.com/site-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
