<?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>John Kary</title>
	<atom:link href="http://johnkary.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://johnkary.net</link>
	<description>Web and application developer from Lawrence, KS.</description>
	<lastBuildDate>Sat, 21 Apr 2012 03:58:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Color temperature and why I don&#8217;t yet own an iPad</title>
		<link>http://johnkary.net/color-temperature-and-why-i-dont-yet-own-an-ipad/</link>
		<comments>http://johnkary.net/color-temperature-and-why-i-dont-yet-own-an-ipad/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 14:22:27 +0000</pubDate>
		<dc:creator>John Kary</dc:creator>
				<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://johnkary.net/?p=376</guid>
		<description><![CDATA[Like some of you, I have not yet caved and bought an iPad. Or any other tablet device, for that matter. But given that "the new" third-generation iPad was officially made available at 8:00AM this morning, that might change soon.

But even with its revolutionary display panel, I'm still reluctant to buy for one small, but very significant feature that's still lacking: color temperature control.]]></description>
			<content:encoded><![CDATA[<p>Like some of you, I have not yet caved and bought an iPad. Or any other tablet device, for that matter. But given &#8220;the new&#8221; third-generation iPad was officially made available at 8:00AM this morning, that might soon change.</p>
<p>When the iPad debuted in April 2010 I didn&#8217;t feel I had a use for it that justified the cost. I mean, &#8220;my laptop can do anything,&#8221; I thought at the time. &#8220;Why would I want a crippled computer?&#8221; Was the world really ready for the new device Steve demoed?</p>
<p>But two years later, the tablet as a device is now a sustained product (I&#8217;m reluctant to call it &#8220;matured&#8221;), has first-class content available for it, and has carved its own niche in the device landscape. That $650 in my wallet is starting to feel mighty heavy&#8230;</p>
<h3>My device usage</h3>
<p>I currently spend most of my screen-time working from a 17&#8243; MacBook Pro: the normal 8-ish hours for my full-time employment, then after hours doing some reading, researching, personal programming projects and open-source work.</p>
<p>The iPad would mostly take over as a device for casual browsing with Instapaper, HackerNews, Twitter and RSS. It would also see the occasional movie or gaming while traveling. A single device for these purposes would allow me to focus on reading, instead of being distracted by email, code, chat and all the clutter that comes with normal work when using my laptop.</p>
<p>Much of this type of usage would happen in the late evening and into the night.</p>
<p>Yet there is one killer app I use on Mac OS that isn&#8217;t natively available for iOS, but makes working in the evening exponentially more comfortable: <a href="http://stereopsis.com/flux/">F.lux</a>.</p>
<div style="text-align: center; margin-bottom:2em;">
<img src="http://johnkary.net/wp-content/uploads/2012/03/flux-logo-lg.png" style="background-color:#fff" alt="" title="F.lux logo" width="291" height="128" class="aligncenter size-full wp-image-377" />
</div>
<p>F.lux a little app that runs in the background and automatically adjusts the <a href="http://en.wikipedia.org/wiki/Color_temperature">color temperature</a> of the screen according to the current position of the sun in the sky.</p>
<p>During normal daylight hours the screen is unaffected, resulting in light emitted at about 6500K, or about the same color temperature as sunlight radiating under a clear blue sky. But as the sun sets and the color of the light outside changes, F.lux gradually transitions the color temperature of the screen from 6500K to 2700K, which is closer to that of indoor incandescent tungsten lighting. This color-shift makes the laptop screen appear similar in color to your working environment, making it less jarring and easier on the eyes.</p>
<div style="text-align: center; margin-bottom:2em;">
<img alt="The color appearance of various light sources can be defined in terms of color temperature, measured in kelvin (K). Northern Light/Blue Sky (8500K); Daylight Fluorescent Lamp (6400K); Clear Mercury Lamp (6000K); Clear Metal Halide Lamp (4500K); Cool White Fluorescent Lamp (4000K); Tungsten Halogen Lamp (3200K); Warm White Fluorescent Lamp (3000K); 40W Incandescent Lamp (2600K); High Pressure Sodium Lamp (2000K); Candle (1800K)" src="http://finishingacademy.com/training/Refinish/Module1/images/Images_%20Booth%20Design/Lighting/kelvin.GIF" title="Common light sources' color temperature measured in degrees Kelvin" class="aligncenter" width="500" />
</div>
<p>The human brain is very good at determining colors in varying lighting conditions and deciding, &#8220;that&#8217;s blue&#8221; or &#8220;that&#8217;s white&#8221;.</p>
<p>It&#8217;s so good that you often will not notice a difference in color because all other colors are contextually and equally shifted towards the blue or orange end of the spectrum depending on the light source.</p>
<p>You are likely only aware of a difference when looking at a picture and being removed from the actual experience. If you&#8217;re familiar with fixing the white balance of a photo, your brain is doing exactly that, all in real time.</p>
<p>This effect is most pronounced when comparing color swatches side-by-side and deciding which one appears more blue or more orange.</p>
<div style="text-align: center; margin-bottom:2em;">
<img alt="Two color swatches, one blue-ish gray, the other orange-ish gray, each with three strips of varying darkness" src="http://upload.wikimedia.org/wikipedia/commons/f/f9/Grays.svg" title="Swatches of varying shades of gray" class="aligncenter" width="500" /><br/><br />
Source: <a href="http://en.wikipedia.org/wiki/File:Grays.svg">http://en.wikipedia.org/wiki/File:Grays.svg</a>
</div>
<p>When working in a mixed light source environment, such as an orange incandescent lamp illuminating your living room while you work on your couch with the blue-white glow of your laptop, your brain is actually in a constant tug-of-war.</p>
<p>The brain is trying to create an equilibrium by balancing the colors in the room towards the blue of the laptop, and the laptop light towards the orange of the room. But switching context between looking at your laptop and glancing around the room creates a constant battle for how the brain balances the colors the eye sees. You might better know this tug-of-war as a headache.</p>
<p>F.lux stands to save your headache by correcting this contextual imbalance and tuning your laptop screen to emit light close to that illuminating your working area. Just select from the presets for the different types of lighting: tungsten, halogen, fluorescent, daylight, and a custom setting to set your own color temp.</p>
<p>To demonstrate how beneficial this is, install F.lux and fire up your laptop after the sun has set. Then select &#8220;Disable for an hour&#8221; from its icon in the menu bar. You will notice how jarring the blueish 6500K screen feels and how it hurts your eyes. It&#8217;s like hearing a high-pitched screeching noise after listening to the relaxing tunes of, say, <a href="http://www.youtube.com/watch?v=FJbP5wozNUM">Jonn Serrie</a>.</p>
<h3>Color temperature&#8217;s effect on sleep</h3>
<p>The F.lux website has an entire page <a href="http://stereopsis.com/flux/research.html">dedicated to research</a> that negatively correlates drowsiness, while positively correlating alertness, in people exposed to light that is close in color temperature to that of a normal computer screen. This is essentially sunlight that makes you feel more alert and less tired.</p>
<p>These <a href="http://www.jstage.jst.go.jp/article/jpa/24/2/24_183/_article">findings</a> can be appropriated to say that using your computer or iPad (without F.lux) before attempting to sleep may lead to trouble falling asleep, and/or being less likely to experience the deeper levels of sleep required for to feel fully rested.</p>
<h3>What about the iPad</h3>
<p>The iPad emits a cool light of <a href="http://www.displaymate.com/iPad_2_ShootOut.htm#Measurements">about 7000K</a>, which is even slightly more blue than the normal 6500K daylight and even further from the 2700K incandescent light color temperature.</p>
<p>This leads me to believe that using an iPad in the evening hours would only keep me awake, which isn&#8217;t a desirable side effect. I&#8217;d rather be winding down from the day than trying to keep myself away. Right now I don&#8217;t have that problem because I use F.lux on my laptop.</p>
<p>But the F.lux authors do not offer a native iOS app. Instead, they offer an <a href="http://stereopsis.com/flux/ios.html">unofficial iOS app</a> that can only be installed after jailbreaking the device. This is because there are no open APIs to hook into adjusting the colors of the display.</p>
<p>I would love it if Apple incorporated this type of color shifting technology into its hardware by adding a sensor for light temperature and allowing the screen to adjust. It would work as an optional setting, as the color shifting is greatly undesirable when doing work like photo editing, where the screen&#8217;s color is of utmost importance.</p>
<p>I think the general public would see this as magical, and could even be marketed as a health benefit&#8211;which surely could earn points for Apple in the mass media, who likes to inflate stories about how extended use of technology is bad. Maybe this could even bring the concept of color temperature and its physiological effects more into the mainstream awareness.</p>
<h3>Thoughts?</h3>
<p>It may seem silly that the absence of a single small application would make me think twice about buying a shiny new gadget. But that&#8217;s really because of the positive impact it has had on me.</p>
<p>It&#8217;s one of those things that after you start using it, you can&#8217;t imagine going back.</p>
<p>Have you noticed this jarring effect when using a laptop in the evening?</p>
<p>Or maybe you already use F.lux. Is it as revolutionary for you as it is for me?</p>
<p>Has anyone installed the F.lux iOS app or found an alternative that makes reading from a screen easier at night?</p>
]]></content:encoded>
			<wfw:commentRss>http://johnkary.net/color-temperature-and-why-i-dont-yet-own-an-ipad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>git 1.7.8 changes for the everyday developer</title>
		<link>http://johnkary.net/git-1-7-8-changes-for-the-everyday-developer/</link>
		<comments>http://johnkary.net/git-1-7-8-changes-for-the-everyday-developer/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 16:18:39 +0000</pubDate>
		<dc:creator>John Kary</dc:creator>
				<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://johnkary.net/?p=354</guid>
		<description><![CDATA[git 1.7.8 was released a little over a week ago. You can view the 1.7.8 <a href="https://raw.github.com/gitster/git/master/Documentation/RelNotes/1.7.8.txt">release notes</a> for a full list of changes.

Most changes will probably not affect your every day use of git, but a few new features should be useful.]]></description>
			<content:encoded><![CDATA[<p>git 1.7.8 was released a little over a week ago. You can view the 1.7.8 <a href="https://raw.github.com/gitster/git/master/Documentation/RelNotes/1.7.8.txt">release notes</a> for a full list of changes.</p>
<p>Most changes will probably not affect your every day use of git, but a few new features should be useful.</p>
<h3><code>git merge</code> learned the <code>--edit</code> option to allow editing the merge commit log message</h3>
<p>If your development revolves around feature branches, you probably already branch and merge daily. Depending on your preference, you might preserve merge commits in your log history. If you abide by <a href="http://nvie.com/posts/a-successful-git-branching-model/">gitflow</a> or manually specify the <code>--no-ff</code> option when merging, you are preserving the merge commit.</p>
<p>By default, these commits are auto-generated by git and don&#8217;t tell you much. They list which files had conflicts, if any, and the name of the merged branch. Unless there is a conflict, you are not given the chance to edit the commit message when making the merge. But thanks to the new <code>--edit</code> option, you can now add a custom message when merging.</p>
<p>Using <code>--edit</code> will cause git to perform the merge then drop you into your <code>core.editor</code> application to edit the merge commit message itself before finally writing it to your history.</p>
<p>You could use this functionality to write a quick all-inclusive summary of a feature you are merging and how it might integrate with other pieces of your software. If I&#8217;m working on an internal team project, I&#8217;ll also include any commands my co-developers need to make in lieu of these new changes.</p>
<div class="terminal">
<pre>git merge --no-ff --edit</pre>
</div>
<h3><code>git grep</code> learned <code>--untracked</code> option</h3>
<p>If you aren&#8217;t familiar with the Unix tool <a href="http://en.wikipedia.org/wiki/Grep">grep</a>, it basically allows you to search for text within other blocks of text. That block of text may be a large log file or any other type of output sent to your console.</p>
<p><code>git grep</code> is similar to normal grep, but provides grep functionality within the context of a git repository. For example, <code>git grep</code> takes into account the files ignored in <code>.gitignore</code> and will not return results found in those files.</p>
<p>With the new <code>--untracked</code> option, <code>git grep</code> can now search through untracked files as well. So if you have untracked files you might have created but not yet added to your project, you can search through them as well.</p>
<div class="terminal">
<pre>git grep --untracked "string to find"</pre>
</div>
<h3><code>git diff</code> learned <code>--function-context</code> option to show the whole function as context that was affected by a change</h3>
<p>When displaying a diff, a one-line change is normally shown with 3 lines of context. This means the 3 lines both before and after the change are displayed to help remind you where this change was made.</p>
<div class="terminal horizontal-scroll">
<pre> <span class="dark-blue">(master)</span> <span class="red">~/Sites/hallcenter_awards/symfony</span> $ git diff
diff --git a/apps/applicant/modules/application/actions/actions.class.php b/apps/applicant/modules/application/actions/actions.class.php
index 5092da4..ec22e6d 100644
--- a/apps/applicant/modules/application/actions/actions.class.php
+++ b/apps/applicant/modules/application/actions/actions.class.php
<span class="sea-green">@@ -21,7 +21,6 @@</span> class applicationActions extends BaseActions

         $this->route = $this->getContext()->getRouting()->getCurrentRouteName();

<span class="red">-        $this->competition = $this->getCompetitionBySlug($request);</span>
         $this->forward404Unless($this->competition->isPassedOpenDate(), 'Competition not open for Applications yet.');

         $this->applicant = $this->getUser()->getGuardUser();
</pre>
</div>
<p>If your change is within a larger function or block of code, like the previous example, 3 lines of context isn&#8217;t enough to tell exactly where in the function this change was made. git shows us the class declaration as context (seen above as <code>class applicationActions extends BaseActions</code>), but wouldn&#8217;t it be great if we could see the entirety of the function where the change was made?</p>
<p>The new option <code>--function-context</code> (or its <code>-W</code> short option) attempts to provide you this context, giving you all lines of the function within which your change was made:</p>
<div class="terminal horizontal-scroll">
<pre> <span class="dark-blue">(master)</span> <span class="red">~/Sites/hallcenter_awards/symfony</span> $ git diff --function-context
diff --git a/apps/applicant/modules/application/actions/actions.class.php b/apps/applicant/modules/application/actions/actions.class.php
index 5092da4..ec22e6d 100644
--- a/apps/applicant/modules/application/actions/actions.class.php
+++ b/apps/applicant/modules/application/actions/actions.class.php
<span class="sea-green">@@ -11,203 +11,202 @@</span>
 class applicationActions extends BaseActions
 {
     /**
      * Executes before every action
      *
      * Sets navigation breadcrumbs
      */
     public function preExecute()
     {
         $request = $this->getRequest();

         $this->route = $this->getContext()->getRouting()->getCurrentRouteName();

<span class="red">-        $this->competition = $this->getCompetitionBySlug($request);</span>
         $this->forward404Unless($this->competition->isPassedOpenDate(), 'Competition not open for Applications yet.');

         $this->applicant = $this->getUser()->getGuardUser();
         $this->application = $this->getApplicantCompetitionApplication($this->applicant, $this->competition);

         $this->setSlotBreadcrumbCompetition($this->competition->getTitle(), 'application_overview', array('slug' => $this->competition->getSlug()));
         $this->setSlotBreadcrumbCompetitionPage('Application Form');
     }

     /**
      * Displays Application form
      *
      * If Applicant has already started applying, display their info
      *
      * @param sfWebRequest $request
      */
     public function executeNew(sfWebRequest $request)
     {
         $this->redirectIf($this->applicationExists($this->application), array(
             'sf_route' => 'application_edit',
             'slug' => $this->competition->getSlug(),
         ));
    }
    // basically continues until the end of the file
</pre>
</div>
<p>I&#8217;ve found this option rather unreliable, at least within a large PHP class. My tests found <code>--function-context</code> often results in displaying almost all of the original file, and git appears ignorant of PHP&#8217;s function boundaries. The number of context lines before and after a change seem random, and the diff doesn&#8217;t necessarily always show all lines of the function, either.</p>
<p>The <a href="http://permalink.gmane.org/gmane.comp.version-control.git/183199">original patch</a> message that introduced this change sheds some light:</p>
<blockquote><p>This implementation has the same shortcoming as the one in grep, namely that there is no way to explicitly find the end of a function. That means that a few lines of extra context are shown, right up to the next recognized function begins.</p></blockquote>
<p>So it appears detecting a function&#8217;s boundaries is difficult for git. It seems in this instance, git <em>never</em> detects a function boundary and gives us the context of the entire file.</p>
<p>Perhaps support for this functionality will improve in future versions.</p>
<p>For now, <code>git diff</code> already supports the <code>--unified=</code> option, or its short version <code>-U</code>, for displaying a larger number of context lines than the default of 3. At this point, I can only recommend using <code>--unified=</code> to display more lines of context in your diffs.</p>
<div class="terminal">
<pre>git diff --unified=10</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://johnkary.net/git-1-7-8-changes-for-the-everyday-developer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>I didn&#8217;t know it couldn&#8217;t be done, so I did it</title>
		<link>http://johnkary.net/i-didnt-know-it-couldnt-be-done-so-i-did-it/</link>
		<comments>http://johnkary.net/i-didnt-know-it-couldnt-be-done-so-i-did-it/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 13:29:46 +0000</pubDate>
		<dc:creator>John Kary</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[inspiration]]></category>

		<guid isPermaLink="false">http://johnkary.net/?p=348</guid>
		<description><![CDATA[Steve Jobs visited Xerox in 1979 to see the Xerox Star: a computer promoting a revolutionary graphical user interface.

Jobs loved what he saw. Xerox had developed one of the first GUI's, one that would ultimately lay the foundation for the concept of "windows" (small W) and the "desktop" we know in modern operating systems.

When he tasked Bill Atkinson, Atkinson created something even more revolutionary...]]></description>
			<content:encoded><![CDATA[<p>Steve Jobs visited Xerox in 1979 to see the Xerox Star: a computer promoting a revolutionary graphical user interface.</p>
<p>Jobs loved what he saw. Xerox had developed one of the first GUI&#8217;s, one that would ultimately lay the foundation for the concept of &#8220;windows&#8221; (small W) and the &#8220;desktop&#8221; we know in modern operating systems.</p>
<p>Jobs saw the potential of such a user interface, and an ability to capitalize on Xerox&#8217;s early work, but deliver it at a fraction of the price. He immediately tasked early Apple employee Bill Atkinson with replicating what the two had seen at Xerox.</p>
<p>Atkinson&#8217;s finished product not only faithfully reproduced what he and Jobs had seen at Xerox, but Atkinson also inadvertently added a revolutionary feature we now take for granted: the ability for windows on screen to <em>overlap</em>.</p>
<p>Biographer Walter Isaacson writes in <em>Steve Jobs</em>, &#8220;Atkins pushed himself to make this trick work because he thought he had seen this capability during his visit to Xerox PARC.&#8221;</p>
<p>Atkinson told Isaacson,</p>
<blockquote><p>&#8220;Because I didn&#8217;t know it couldn&#8217;t be done, I was enabled to do it.&#8221;</p></blockquote>
<p>Sometimes we think we know the rules and limitations of an idea. Until someone comes along and breaks those rules, simply because they didn&#8217;t know such rules existed.</p>
<p>It&#8217;s amazing what can be done when nobody tells you you can&#8217;t.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnkary.net/i-didnt-know-it-couldnt-be-done-so-i-did-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting into The Zone: Music</title>
		<link>http://johnkary.net/getting-into-the-zone-music/</link>
		<comments>http://johnkary.net/getting-into-the-zone-music/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 14:11:23 +0000</pubDate>
		<dc:creator>John Kary</dc:creator>
				<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://johnkary.net/?p=337</guid>
		<description><![CDATA[In part one of this two-part series on being in The Zone, I'm going to talk about how Music affects my ability to be in The Zone: that "deeply creative space where inspiration is built", as <a href="http://www.randsinrepose.com/archives/2006/07/10/a_nerd_in_a_cave.html">Rands puts it</a>. That mental place where you're so focused that nothing else matters except the bug you're hunting, the feature you're cranking out or the blog post you're writing.

By the end of this article I hope you have a better sense of how <em>you</em> choose what to listen to, and that I introduce you to some new artists to increase your productivity when working.]]></description>
			<content:encoded><![CDATA[<p>In part one of this two-part series on being in The Zone, I&#8217;m going to talk about how Music affects my ability to be in The Zone: that &#8220;deeply creative space where inspiration is built&#8221;, as <a href="http://www.randsinrepose.com/archives/2006/07/10/a_nerd_in_a_cave.html">Rands puts it</a>. That mental place where you&#8217;re so focused that nothing else matters except the bug you&#8217;re hunting, the feature you&#8217;re cranking out or the blog post you&#8217;re writing.</p>
<p>By the end of this article I hope you have a better sense of how <em>you</em> choose what to listen to, and that I introduce you to some new artists to increase your productivity when working.</p>
<p>The most important part for me in finding The Zone is my auditory environment. Where I work varies: the office, at home, 30,000 feet in an airplane, etc. Each environment has its own accompanying distractions: conversations in the next cubicle row, people walking by, my neighbor&#8217;s rhythmic subwoofer, the barista making a drink order, the impending &#8220;Would you like something to drink?&#8221; from the flight attendant making her way down the isle.</p>
<p>Music and quality audio equipment have become my great equalizer. (Another post on audio equipment in The Zone will be posted soon.)</p>
<p>But music alone isn&#8217;t enough. I can&#8217;t slip into The Zone just listening to just any music. The type of music that makes me most productive is affected by many factors:</p>
<ul>
<li><strong>What am I working on?</strong> Find a beat and rhythm to match the task. Is it a long, enduring task like fixing an epic bug? Or am I drudging through mindless work and need something to liven it up?</li>
<li><strong>Does the task require internal dialogue, like reading or writing?</strong> Music with lyrics interferes with my thinking. I process things internally by talking to myself in my head. Someone singing in my ear creates another voice commanding my attention, detracting me from clarity.</li>
<li><strong>What&#8217;s the weather like?</strong> I seem to prefer different types of music given the weather. A sunny Summer day calls for different music than a blustery Winter day.</li>
<li><strong>What time is it?</strong> If I&#8217;m winding down for the day I probably don&#8217;t want to turn on some 140 bpm Trance. That would just keep me awake. Unless that&#8217;s exactly what I need.</li>
<li><strong>What mood am I in?</strong> Maybe my morning didn&#8217;t go so well, or maybe I just pushed a great new feature and am reeling with excitement.</li>
</ul>
<p>Whatever the case, what I pick to listen to is both an extension of what mood I&#8217;m in and what mental state and mood I <strong>need</strong> to put myself in to be productive in what I&#8217;m working on.</p>
<h3>Early Morning (5am &#8211; 8am) &#8211; Low-key</h3>
<p>I use my mornings to catch up on Twitter, articles I&#8217;ve saved to Instapaper, or sometimes experiment or test out solutions to problems I&#8217;ve been mulling over. Whatever the case, I don&#8217;t like much distraction.</p>
<p>The darkness and lack of buzz before sunrise allows me to focus. No one is moving except the birds and squirrels outside. Jason Friend and DHH hit it perfectly in their book &#8220;Rework&#8221;:</p>
<blockquote><p>Think about it: When do you get most of your work done? If you’re like most people, it’s at night or early in the morning. It’s no coincidence that these are the times when nobody else is around. [...] Long stretches of alone time are when you’re most productive. When you don’t have to mind-shift between various tasks, you get a boatload done.</p></blockquote>
<p>Jazz and low-key minimalism tunes allow me to get my brain moving and cognitively functioning. It&#8217;s like morning coffee for my ears. Contemplative, but energizing.</p>
<p><strong>Music:</strong><br />
(<a href="http://heliosmusic.bandcamp.com/album/eingya">Listen</a>) Goldmund<br />
(<a href="http://kilimanjaro.bandcamp.com/album/ep-two">Listen</a>) KILIMANJARO<br />
Gonzales &#8211; Solo Piano<br />
Miles Davis &#8211; Kind of Blue</p>
<h3>Morning Work (8am &#8211; 12pm)</h3>
<p>By now I&#8217;m in the office and ready to start on the day&#8217;s work. Check email, put out any fires, start structuring my plan for the day.</p>
<p>Right now, I need music to keep me deep in thought and focused. The office usually has many people running around, or having conversations. My goal is to tune them out.</p>
<p>This music is a bit spacey and droning. The minimalism and calming nature also keeps me level-headed about any boogiemen I might discover in my Inbox.</p>
<p>After filing and sending email, it&#8217;s usually any new support work or maintenance programming on my current project. Tying up loose ends so I can have a productive rest of the day where I&#8217;ll write new code, perhaps continuing what I was building on earlier in the morning.</p>
<p><strong>Music:</strong><br />
(<a href="http://www.youtube.com/watch?v=S5Qw9ANrbIg">Listen</a>) Cliff Martinez &#8211; Solaris Soundtrack<br />
(<a href="http://www.youtube.com/watch?v=aV-Itpop9Jo">Listen</a>) Jonn Serrie</p>
<h3>Afternoon (1pm &#8211; 5pm)</h3>
<p>The post-lunch time slot can be difficult. It&#8217;s either a continuation of a productive morning, or an uphill battle to stay focused. Depending on the day, over lunch I either played basketball, watched a video/conference talk I saved via Instapaper, read a programming-related book or caught up with co-workers.</p>
<p>I try to pick music to draw me back into my productive morning state, or kick-start me into The Zone if my morning yield was poor. Caffeine with lunch seems to be a reliable way to get me going in the afternoon and keep me focused. Adding the right music to that allows me to get a lot done.</p>
<p>Music during this time varies so much because it depends how my morning went. I usually kick iTunes into Shuffle and play tracks until something hits the spot.</p>
<p>I&#8217;m usually in this mode until the end of the work day.</p>
<p><strong>Music:</strong><br />
Electronic / Trance &#8211; <a href="http://www.di.fm/trance/">DI.fm Trance Channel</a> or <a href="http://www.astateoftrance.com/news/a-state-of-trance-500/">Armin van Buuren</a><br />
Radiohead<br />
Nine Inch Nails<br />
August Burns Red<br />
As Tall As Lions<br />
The Mars Volta<br />
Circa Survive<br />
Pendulum</p>
<h3>Night (10pm &#8211; 1am) &#8211; Drifting</h3>
<p>By now, errands have been run, dinner is finished and cleaned up, I&#8217;ve spent time with friends or my girlfriend, and I&#8217;m ready to get back to it.</p>
<p>If I had an early morning or a long day, there&#8217;s usually another window of quality focus during the nighttime hours. There&#8217;s not much coming through on Twitter, not many people on chat, and nothing of interest on TV. I can focus again.</p>
<p>This is another period of quality isolation time, allowing me to ignore everything else from the comfort of my couch and crank on more code or work on a blog post. (It&#8217;s 1:30am as I type this.)</p>
<p>I try not to let myself go to sleep if I&#8217;m in the middle of coding a feature or fixing a bug. There&#8217;s time investment required to orient my mind to what I&#8217;m doing, like having a virtual machine running, a few terminal sessions going, a few tabs open in NetBeans and a dirty working tree in git.</p>
<p>But I can usually find this weird blissful mental state where I feel half-asleep but can focus intensely on what I&#8217;m doing even though I&#8217;m really tired. It&#8217;s like I can ignore anything else on my mind from the day and just sink into a comfortable place and code. I get lost in the music and time stands still.</p>
<p><strong>Music:</strong><br />
(<a href="http://bennjordan.bandcamp.com/album/pale-blue-dot">Listen</a>) Benn Jordan &#8211; Pale Blue Dot<br />
(<a href="http://www.youtube.com/watch?v=wZWo8g5sAkY">Listen</a>) Sven Weisemann<br />
(<a href="http://www.youtube.com/watch?v=aV-Itpop9Jo">Listen</a>) Jonn Serrie<br />
(<a href="http://www.myspace.com/maseratirocks">Listen</a>) Maserati<br />
(<a href="http://theflashbulb.bandcamp.com/album/soundtrack-to-a-vacant-life">Listen</a>) The Flashbulb<br />
(<a href="http://www.myspace.com/themercuryprogram">Listen</a>) The Mercury Program</p>
<p>What I listen to throughout the day greatly varies, and so does the equipment I use to listen to it. Check back soon when I&#8217;ll post Part Two of this series: an in-depth look at the audio equipment I use during each of these times of day, and my recommendations on specific audio gear to help coax yourself into The Zone.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnkary.net/getting-into-the-zone-music/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>git 1.7.7 changes affecting the everyday developer</title>
		<link>http://johnkary.net/git-1-7-7-changes-affecting-the-everyday-developer/</link>
		<comments>http://johnkary.net/git-1-7-7-changes-affecting-the-everyday-developer/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 06:00:42 +0000</pubDate>
		<dc:creator>John Kary</dc:creator>
				<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://johnkary.net/?p=321</guid>
		<description><![CDATA[<a href="http://git-scm.com/">git 1.7.7 was released</a> within the last few weeks. You can <a href="https://raw.github.com/gitster/git/master/Documentation/RelNotes/1.7.7.txt">view the 1.7.7 release notes</a> for a full list of changes.

Most changes will probably not affect your every day use of git, but two new additions should prove very useful for many developers.]]></description>
			<content:encoded><![CDATA[<p><a href="http://git-scm.com/">git 1.7.7 was released</a> within the last few weeks. You can <a href="https://raw.github.com/gitster/git/master/Documentation/RelNotes/1.7.7.txt">view the 1.7.7 release notes</a> for a full list of changes.</p>
<p>Most changes will probably not affect your every day use of git, but two new additions should prove very useful for many developers:</p>
<h3>&#8220;git stash&#8221; learned an &#8220;&#8211;include-untracked option&#8221;</h3>
<p><a href="http://schacon.github.com/git/user-manual.html#interrupted-work">git stash</a> is one of my favorite git features. If you don&#8217;t know about <code>git stash</code> yet, it allows you to take all of the changes in your working tree that haven&#8217;t been committed and temporarily store them, then cleans your working tree.</p>
<p>Basically it tells git, &#8220;Hey, I&#8217;m not ready to commit all of these changes, but I really need to get back to the way my repository was right after I made my last commit. So save my most recent changes with this given description, so I don&#8217;t forget what I was working on, and I&#8217;ll come back to them later.&#8221;</p>
<p>Prior to git 1.7.7, if you ran <code>git stash save</code> it would only stash changes for files that were already under version control. So if you had created a new file that was part of the feature you were working on and wanted to stash it, you were stuck with an ugly work around of having to add it to the repo using <code>git add</code>, then stashing your changes. When later replaying the stash, those files would still appear in the staging area/index.</p>
<p>But with the new option <code>--include-untracked</code>, or simply <code>-u</code>, <code>git stash</code> can now save your working tree exactly the way you had it when you created the stash.</p>
<p><code>git stash -u</code><br />
<code>git stash --include-untracked</code></p>
<h3>&#8220;git submodule update&#8221; reports any errors at the end instead of halting on error</h3>
<p><a href="http://schacon.github.com/git/user-manual.html#submodules">git submodules</a> allow you to embed and track a foreign repository in your parent repository. They are great when you want to distribute code between multiple projects, but keep the distributed code in its own repository with its own version history.</p>
<p>Prior to git 1.7.7, if you ran <code>git submodule update</code> and there was a problem, git would immediately halt. Halting in the middle of updating might update some of your submodules and leave others unupdated.</p>
<p>But now, git will continue updating all submodules and instead report a list of errors after attempting to update all submodules.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnkary.net/git-1-7-7-changes-affecting-the-everyday-developer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Thoughts on Carl Sagan&#8217;s &#8220;Pale Blue Dot&#8221;</title>
		<link>http://johnkary.net/thoughts-on-carl-sagans-pale-blue-dot/</link>
		<comments>http://johnkary.net/thoughts-on-carl-sagans-pale-blue-dot/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 06:51:51 +0000</pubDate>
		<dc:creator>John Kary</dc:creator>
				<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://johnkary.net/?p=299</guid>
		<description><![CDATA[Carl Sagan's book "<a href="http://www.amazon.com/Pale-Blue-Dot-Vision-Future/dp/0345376595/">Pale Blue Dot</a>" is a truly inspirational book. It has given me a new outlook on the fragility of life on Earth, and cultured new thoughts on what interplanetary travel might mean for the future of the human species.

Here, I detail some of my thoughts on the ideas expressed in the book.]]></description>
			<content:encoded><![CDATA[<p>Carl Sagan&#8217;s book &#8220;<a href="http://www.amazon.com/Pale-Blue-Dot-Vision-Future/dp/0345376595/">Pale Blue Dot</a>&#8221; is a truly inspirational book. It has given me a new outlook on the fragility of life on Earth, and cultured new thoughts on what interplanetary travel might mean for the future of the human species.</p>
<div style="text-align: center; margin-bottom:2em;"><a href="http://johnkary.net/wp-content/uploads/2011/01/pale_blue_dot.jpg"><img class="aligncenter size-full wp-image-302" title="Pale Blue Dot" src="http://johnkary.net/wp-content/uploads/2011/01/pale_blue_dot.jpg" alt="" width="439" height="596" /></a></div>
<p>Sagan lays out two over-arching requirements that must be met for the survival of the human species, which he reinforces in various ways throughout the book:</p>
<h3>We must venture outside Earth, and ultimately outside the dependency of the Sun, if humans are to survive the end of the Earth</h3>
<p>The Sun and Earth have limited lifespans, albeit billions of years. The Sun will eventually turn into a red giant star (the current estimate being in about 5 billion years.) Increasing in size and amount of light energy emitted during this process, it will alter the atmospheric composition of Earth by increasing its surface temperature.</p>
<p>These atmospheric changes will cause a chain reaction in all living organisms on Earth as the atmosphere and oceans begin to boil away. The balance of life that has evolved while the Earth is in its current stage will cease to exist, perhaps giving way to a new quality of life and organisms better suited to tolerate the new conditions, before all atmosphere, water and upper layers of earth are burned away.</p>
<p>Finally, after all molten matter is stripped from the surface, Earth&#8217;s iron core will be engulfed by the expanding horizon of the red giant star previously known as our Sun. All human creations, trees, grass, dirt, fossil fuels, buildings, gravestones, and all remains of every organism to ever grace the Earth&#8230; all planetary matter will have been broken down into other energy, and ultimately re-distributed into surrounding space, to one day be recombined into (anti?) matter or energy somewhere else in the Universe.</p>
<p>Our history as a species and everything every single human has ever worked for will be gone. The only remaining remnants of our existence will be the light and radio waves that were reflected and emitted during our existence on Earth. Anyone observing Earth from billions of light-years away would actually be observing Earth as we currently inhabit it. Wave to them.</p>
<p>That is unless we destroy ourselves first.</p>
<h3>We mustn&#8217;t destroy ourselves</h3>
<p>Whether through rash decision by an ideologic or radical peoples, or by means of ignorance or plain selfishness, the human species has the ability to destroy itself. Whether through technological means such as nuclear war, or selfishness and shortsightedness in damaging the delicate life balance under which current organisms have evolved.</p>
<p>The human species, in its development of technology and its ever-increasing rate of advancement, has harnessed power capable of mass destruction. While this power might seem small in scope of the energy harnessed by the perpetual motion of the Universe, it is enough to destroy our entire world. Whether used recklessly by way of a political statement, or pure accident, the technology enabling this power is now a lit fuse that could easily disrupt our existence.</p>
<p>By establishing a human presence on surrounding worlds and stars, we can lower our vulnerability to catastrophe like this and the fragility of the Earth that ultimately cultivated us.</p>
<p>Sagan argues through much of the book that the first step in exploring the stars is sending humans to Mars. But his pessimistic outlook on the state of the human race suggests he believes humans will destroy themselves and their planet before spacefaring nations can foster the finances to accomplish such a feat.</p>
<p>Given the current financial state of the United States in 2011, it would seem increasingly unlikely for such an undertaking to see approval by its governing bodies anytime soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnkary.net/thoughts-on-carl-sagans-pale-blue-dot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaScript Effects: Knowing &#8220;when&#8221; is more important than &#8220;how&#8221;</title>
		<link>http://johnkary.net/javascript-effects-knowing-when-is-more-important-than-how/</link>
		<comments>http://johnkary.net/javascript-effects-knowing-when-is-more-important-than-how/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 15:15:35 +0000</pubDate>
		<dc:creator>John Kary</dc:creator>
				<category><![CDATA[best practices]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://johnkary.net/?p=163</guid>
		<description><![CDATA[You have undoubtedly seen many tutorial sites showing off how to implement the newest whiz-bang features of modern JavaScript libraries. While most of these sites do an adequate job of showing users "how to" implement features, they almost always neglect teaching <em>when</em> to use these techniques, and more importantly, when to forego them.]]></description>
			<content:encoded><![CDATA[<p>You have undoubtedly seen many tutorial sites showing off how to implement the newest whiz-bang features of modern JavaScript libraries. While most of these sites do an adequate job of showing users &#8220;how to&#8221; implement features, they almost always neglect teaching <em>when</em> to use these techniques, and more importantly, when to forego them.</p>
<p>At <a href="http://www.ku.edu">the University of Kansas</a> where I do web development work, we recently had a random student developer from another large University call our help desk and suggest we implement a collapsable content list (an <a href="http://docs.jquery.com/UI/Accordion">accordion</a>) on our <a href="http://www.ku.edu/academics/schools/">Academic Schools &#038; Departments page</a> (seen below.)</p>
<p><img src="http://johnkary.net/wp-content/uploads/2010/02/academics-full.png" alt="KU: Academic Schools &amp; Departments" title="KU: Academic Schools &amp; Departments" width="500" height="1177" class="aligncenter size-full wp-image-164" /></p>
<p>Even though the content is in a list format with headings over each area, I chose not to use an accordion. <strong>Why not?</strong> Let&#8217;s consider a few things.</p>
<h3>How did the user arrive at this page?</h3>
<p>Looking at our Google Analytics numbers, about 99% of visits to the Academics page come from the KU&#8217;s homepage and primary site pages. A link to &#8220;Academics&#8221; lives in the top-navigation, so it&#8217;s very visible. This indicates the user is already browsing around our primary site, where they find general info about the University.</p>
<p>This particular page is also the 3rd-most visited page on KU&#8217;s main website, only behind the Homepage and A-Z&#8217;s &#8220;E&#8221; page (where users go to click on &#8220;Email.&#8221;) So it&#8217;s seeing a lot of traffic.</p>
<h3>How many clicks deep is this page? What other pages might the user have encountered before arriving at this page?</h3>
<p>This page is one click deep at all times. A user can access this page with one click from almost any other page on KU&#8217;s website, so its content should be geared to hit a wide audience with a variety of expectations.</p>
<h3>What is the context of this page?</h3>
<p>In this case, the Search tab is active when the user first arrives. Users are accustomed to (and often prefer) searching to find the content they want, so we let them Search first. Search provides instant gratification and is a low time investment opposed to reading a long page of text or links.</p>
<p><img src="http://johnkary.net/wp-content/uploads/2010/02/ku-academics-search.png" alt="KU: Academics Search" title="KU: Academics Search" width="500" class="aligncenter size-full wp-image-166" /></p>
<p>We also operate under the assumption that after a user finds the information they seek, they stop looking. If search meets their needs, they will not likely encounter our list of Schools &amp; Departments.</p>
<p>So what can we conclude about the context of this page and the user arriving there?</p>
<ul>
<li>The user is looking for info about the schools and departments KU offers.</li>
<li>Since the user was first provided a Search box, they likely already searched for the info they wanted and their needs were not met.</li>
<li>They may or may not know the name of the department they&#8217;re looking for and&#8230;
<ul>
<li>want to see a hierarchy of schools and departments</li>
<li>want to see all options and pick the one that best matches what they&#8217;re looking for</li>
</ul>
</li>
</ul>
<p>Now that we&#8217;ve asked given context to the page visitors, let&#8217;s pick up where most tutorials start: the content being presented.</p>
<h3>What type of content is this?</h3>
<p>Our very long list is broken down in a hierarchy by School, then Department. If we took into account only the hierarchy and length, a collapsed list would absolutely solve that problem. But let&#8217;s go beyond content tutorials and dig a bit deeper.</p>
<h3>Does the user need to see all content at once?</h3>
<p>In this case, yes, they likely do. The user didn&#8217;t find what they wanted using the search, and they want to see all possible options to find the one that best matches what they&#8217;re looking for.</p>
<p>Remember, this user might not know what they&#8217;re looking for because this page is not very deep in the navigation structure. So rather than hide a bunch of content from the user, we give it to them all at once. They can use CTRL + F to search the page content for a specific department, or quickly skim over each school and through the department lists.</p>
<h3>Conclusion</h3>
<p>These are all questions you should ask yourself before implementing any type of visual effect or design element. You might think you&#8217;re being clever, but you could just as easily be hurting the usability of your site&#8217;s content.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnkary.net/javascript-effects-knowing-when-is-more-important-than-how/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Who Cares? Crowdsourcing Your News Intake</title>
		<link>http://johnkary.net/who-cares-crowdsourcing-your-news-intake/</link>
		<comments>http://johnkary.net/who-cares-crowdsourcing-your-news-intake/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 18:56:20 +0000</pubDate>
		<dc:creator>John Kary</dc:creator>
				<category><![CDATA[media]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://johnkary.net/?p=259</guid>
		<description><![CDATA[Looking at some generic news aggregate site, it seems there's a lot of important things going on in the news. Some radical pastor wants to burn Korans. Huge fires are engulfing a San Francisco neighborhood. "Evil" zombies are now back. In 3D.

Does any of that really affect you? No, really... does it?

NO! And if you think it does, it doesn't. Want proof?]]></description>
			<content:encoded><![CDATA[<p>Looking at some generic news aggregate site, it seems there&#8217;s a lot of important things going on in the news. Some radical pastor wants to burn Korans. Huge fires are engulfing a San Francisco neighborhood. &#8220;Evil&#8221; zombies are now back. In 3D.</p>
<p>Does any of that really affect you? No, really&#8230; does it?</p>
<p>NO! And if you think it does, it doesn&#8217;t. Want proof?</p>
<p>Before reading any news article today, insert &#8220;Who cares if&#8230;&#8221; in front of the headline.</p>
<p>Who cares if some radical pastor wants to burn Korans?<br />
Who cares if huge fires are engulfing a San Francisco neighborhood? (OK, unless you have family in the neighborhood.)<br />
Who cares if there&#8217;s another meaningless evil zombie movie, now in 3D?</p>
<p>Who cares? Not me, and not you.</p>
<p>We&#8217;re fed this junk news because the news companies NEED something to cover. If they don&#8217;t cover SOMETHING they&#8217;re sending out dead air, or blank newspapers, or a news junkie&#8217;s cryptonite: re-runs.</p>
<p>It&#8217;s not just national and local news networks and newspapers. It&#8217;s all over our digital life too.</p>
<p>Look at your RSS Feed (if you even still use one.) Your Twitter feed. Your Facebook feed. How many of those stories do you actually read? How many do you actually care about? You probably don&#8217;t even have enough time to keep up with it all.</p>
<p>People follow this junk news so they can keep up on current events, or have something to talk about at the water cooler, or chat up acquaintances at awkward dinners and family get togethers. People get a sense of pride from knowing &#8220;what&#8217;s going on in the world!&#8221;</p>
<p>Some people get satisfaction relaying the newest news message to someone else. Or being the first to know something among their friends. It actually validates their news obsession and gives them a sense of being &#8220;in the know.&#8221;</p>
<p>We&#8217;re so bent on crowdsourcing things these days&#8230; how about crowdsource your news reading?</p>
<p>Let everyone else keep up on news for you. Let them tell you about it over lunch or a drink. This will not only free you up for more important things, but reaffirm your friend&#8217;s need to feel important for catching you up on the big story.</p>
<p>So purge your RSS feed. Stop following Tech Crunch, Gizmodo, Engadget and Apple News. 95% of their stories don&#8217;t matter anyway.</p>
<p>Unfollow all but a subset of your Twitter crew. Focus on the ones putting out meaningful content and not just noise.</p>
<p>Unfriend all those acquaintances and old high school friends on Facebook. Or stop logging in so often, or close your account all together. Take a friend out to lunch if you want to catch up on what they&#8217;ve been doing instead of passively taking in their life.</p>
<p>If something big is happening, let someone else tell you about it. Then ask yourself, who cares? It won&#8217;t be you.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnkary.net/who-cares-crowdsourcing-your-news-intake/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MediaTemple &#8220;WordPress Redirect Exploit&#8221; exposes weakness in GridServer security</title>
		<link>http://johnkary.net/mediatemple-wordpress-redirect-exploit-exposes-weakness-in-gridserver-security/</link>
		<comments>http://johnkary.net/mediatemple-wordpress-redirect-exploit-exposes-weakness-in-gridserver-security/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 23:08:04 +0000</pubDate>
		<dc:creator>John Kary</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://johnkary.net/?p=239</guid>
		<description><![CDATA[Instances of WordPress installed on certain clusters of MediaTemple's GridServer were recently hit with an <a href="http://wiki.mediatemple.net/w/WordPress_Redirect_Exploit">exploit</a> that appended an external JavaScript to each post's content field, ultimately redirecting to redirecting to a TinyURL address, resolving to the domain http://www.qooglesearch.com.

MediaTemple asserts in a <a href="weblog.mediatemple.net/weblog/2010/07/16/1404-wordpress-redirect-exploit-2/"> July 16, 2010 blog entry</a>, "We do not believe that this is an infrastructure issue, but we are still investigating the root cause(s)."

I believe I have evidence to the contrary.]]></description>
			<content:encoded><![CDATA[<p>Instances of WordPress installed on certain clusters of MediaTemple&#8217;s GridServer [also called (gs)] were recently hit with an <a href="http://wiki.mediatemple.net/w/WordPress_Redirect_Exploit">exploit</a> that appended an external JavaScript to each post&#8217;s content field, ultimately redirecting to redirecting to a TinyURL address, resolving to the domain http://www.qooglesearch.com.</p>
<p>MediaTemple asserts in a <a href="http://weblog.mediatemple.net/weblog/2010/07/16/1404-wordpress-redirect-exploit-2/">July 16, 2010 blog entry</a>, &#8220;We do not believe that this is an infrastructure issue, but we are still investigating the root cause(s).&#8221;</p>
<p>I believe I have evidence to the contrary.</p>
<hr/>
<p>I noticed today my WordPress blogs had been hit by the Redirect Exploit. I followed the <a href="http://wiki.mediatemple.net/w/WordPress_Redirect_Exploit#Clean-Up">fix instructions</a> and came across something fishy.</p>
<p>Before upgrading one of my old blogs from WordPress 2.5 to 2.6, I had made a full copy of the database. So I then had two identical databases up with different names. I switched the database name in my WordPress config and went along with the upgrade. So my WordPress 2.5 database lay dorment, without an active frontend to administer it.</p>
<p>I ran the fix code against my old WP 2.5 database, and found it had been injected with the exploit code, <strong>even without an active WordPress install pointing to it.</strong></p>
<p>This is significant because most WordPress exploits are local to the installation itself, and likely do not affect installations on a host&#8217;s entire network.</p>
<p><strong>This leads me to believe the exploit was carried out as a result of a system-level security breach by obtaining a list of all databases on all compromised accounts, and running an UPDATE query to inject code into every WordPress database.</strong></p>
<hr/>
<p>MediaTemple&#8217;s head of support and a few sysadmin/security guys were nice enough to give me a call after I put out <a href="http://twitter.com/johnkary/status/19107499517">this tweet</a> to discuss what I had found, and divulge a bit of what they know.</p>
<p>They believe someone possibly obtained a list of database credentials, then used those credentials to scan and inject code. They said they had already enacted some system changes to mitigate some security issues, and were in the process of re-architecting some aspects of the shared system.</p>
<p>I expect we will see more news from the MediaTemple crew about this exploit in the coming weeks.</p>
<p>To prevent further exploits, you should manually change the password of every database account on your (gs) account, and check that your /domains/ directory is not world-readable (chmod <del datetime="2010-07-22T13:28:51+00:00">755</del> 750)</p>
<p><strong>July 21, 7:50pm Update:</strong> A previous version of this article had info that could be interpreted as users having access to other users accounts on the system. That was not the intended message and the wording has been updated to reflect this change.</p>
<p><strong>September 30, 2010 Update:</strong> Since this article, I have needed to remove malicious JavaScript from this blog two more times, each time with a slightly different-looking exploit code. The most recent exploit I discovered yesterday when a user reported Google was reporting my blog as hosting malware. Sadly, this was not limited to just my blog.</p>
<p>MANY domains on my MediaTemple grid-server account were found to be listed as hosting malware by Google. <strong>Even domains without WordPress installed.</strong> This points to a larger issue where either the server itself is insecure or a web application on the server (WordPress?) is being used as an attack vector to modify files on the filesystem.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnkary.net/mediatemple-wordpress-redirect-exploit-exposes-weakness-in-gridserver-security/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>I May Be Doing it Wrong, But I Have My Sanity</title>
		<link>http://johnkary.net/i-may-be-doing-it-wrong-but-i-have-my-sanity/</link>
		<comments>http://johnkary.net/i-may-be-doing-it-wrong-but-i-have-my-sanity/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 15:12:39 +0000</pubDate>
		<dc:creator>John Kary</dc:creator>
				<category><![CDATA[best practices]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://johnkary.net/?p=224</guid>
		<description><![CDATA[Marco Tabini <a href="http://www.phparch.com/2010/03/10/programming-youre-doing-it-wrong/">recently wrote</a> on the php&#124;architect blog that "programmers are doing it wrong." He argues that many programmers have become hung up on writing mythical perfect code that abides by all modern best practices instead of doing what we are hired to do: solve problems quickly and efficiently. But if you spend time writing it well the first time, you too can save your sanity.]]></description>
			<content:encoded><![CDATA[<p>Marco Tabini <a href="http://www.phparch.com/2010/03/10/programming-youre-doing-it-wrong/">recently wrote</a> on the php|architect blog that &#8220;programmers are doing it wrong.&#8221; He argues that many programmers have become hung up on writing mythical perfect code that abides by all modern best practices instead of doing what we are hired to do: solve problems quickly and efficiently. But if you spend time writing it well the first time, you too can save your sanity.</p>
<p>I&#8217;ll admit, I&#8217;m in that latter group of striving to write &#8220;perfect code.&#8221; I constantly read articles, pour over well-written open-source code (mostly Symfony code) and review conference presentation slides posted by notable developers on <a href="http://www.slideshare.net/search/slideshow?searchfrom=header&#038;q=PHP">SlideShare</a>.</p>
<p>Like every one of us, I&#8217;ve come a long way from where I was when I started writing PHP. (With a long way to go, still, I&#8217;m sure.) I remember the days of constantly hitting syntax errors before discovering IDEs and performing search and replace over an entire project to update code duplicated across multiple files. Yeah, it was a nightmare. One I would prefer to not repeat.</p>
<p>So while I&#8217;m not going to read a single article about a design pattern and roll it into my next production product, I am going to continue learning from the best developers in the industry and explore the concepts they advocate.</p>
<h3>The Redheaded Stepchild: WordPress (and its many siblings)</h3>
<p>Marco also claims that even though WordPress is regarded as &#8220;unmaintainable&#8221; by many in the community, it has plenty of maintainers and many plugin contributors. But making the &#8220;quantity over quality&#8221; argument here holds no weight.</p>
<p>WordPress has a lot of maintainers because it still relies on concepts and methods that many junior developers think are OK. Meaning, &#8220;WordPress developers&#8221; haven&#8217;t become fed up with their code quality enough to push deeper. WordPress&#8217; codebase is how beginners write code, so it is familiar to a large number of developers eager to put their mark on something. Many PHP programmers never progress past this stage. And their ignorance is probably bliss.</p>
<p>Given WordPress&#8217; popularity, many junior developers view the code under the hood and think, &#8220;WordPress is successful. This must be how you write successful PHP code.&#8221; NO! It&#8217;s not! Writing code like that is what makes you hate your job!</p>
<p>Marco argues that if your code works and you are releasing software, you are doing it right. But how much did you hate your life when&#8230;</p>
<ol>
<li>you had to fix more than one security issue per release cycle</li>
<li>you spent hours trying to fix a single bug, only to have squash it, and it broke twenty other things</li>
<li>realizing you missed other occurrences of that same bug after fixing it in the previous release</li>
<li>the API/software you write third-party code for breaks your plugin with every release (just like WordPress does.)</li>
</ol>
<p>Having to fix broken code not done well the first time will cost your client more money, and cost you your patience and ambition. Spend time thinking about your next function before you haphazardly write it. Think about its context, where might it be reused in the future, and what parts could be swapped out to make it more reusable and easier to test.</p>
<p>Where do you want to spend your time&#8230; Up front researching, reading and writing quality code up front with <a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself">DRY principles</a> and hopefully at least <a href="http://www.slideshare.net/sebastian_bergmann/getting-started-with-phpunit">some unit tests</a>? Or at crunch time cursing your monitor and slamming your head on your desk agonizing over code you wrote 3 months ago?</p>
<h3>Do Something! Learn From the Best</h3>
<p>When you&#8217;re writing code or debugging old code and thinking, &#8220;There&#8217;s got to be a better way&#8230;!&#8221; There is.</p>
<p>Start with the PHP Advent series: <a href="http://phpadvent.org/2009">2009</a>, <a href="http://phpadvent.org/2008">2008</a>, <a href="http://shiflett.org/blog/2007/dec/php-advent-calendar-2007">2007</a>.</p>
<p>Learn <a href="http://fabien.potencier.org/article/11/what-is-dependency-injection">what Dependency Injection is</a> and <a href="http://www.slideshare.net/fabpot/dependency-injection-confoo-2010">how you can use it</a>.</p>
<p><a href="http://www.slideshare.net/spriebsch/antiphpatterns-confoo-montreal-2010">Unlearn everything you&#8217;ve read</a> on design patterns in the last 5 years.</p>
<p><a href="http://twitter.com/pmjones">Follow</a> <a href="http://twitter.com/shiflett">some</a> <a href="http://twitter.com/coates">of</a> <a href="http://twitter.com/derickr">the</a> <a href="http://twitter.com/s_bergmann">most</a> <a href="http://twitter.com/rasmus">respected</a> <a href="http://twitter.com/giorgiosironi">PHP</a> <a href="http://twitter.com/jwage">developers</a> <a href="http://twitter.com/phparch">on</a> <a href="http://twitter.com/fabpot">Twitter</a>.</p>
<p>And start writing better code.</p>
<p>[Disclaimer: Yes, this blog uses WordPress.] </p>
]]></content:encoded>
			<wfw:commentRss>http://johnkary.net/i-may-be-doing-it-wrong-but-i-have-my-sanity/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

