<?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>These are Dark Times, Lad</title>
	<atom:link href="http://blog.timvalenta.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.timvalenta.com</link>
	<description></description>
	<lastBuildDate>Fri, 20 Jan 2012 05:50:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Automatically Restart Minecraft Server on Linux</title>
		<link>http://blog.timvalenta.com/2012/01/16/automatically-restart-minecraft-server-on-linux/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=automatically-restart-minecraft-server-on-linux</link>
		<comments>http://blog.timvalenta.com/2012/01/16/automatically-restart-minecraft-server-on-linux/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 21:35:05 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Hobbies]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[minecraft]]></category>
		<category><![CDATA[psutil]]></category>

		<guid isPermaLink="false">http://blog.timvalenta.com/?p=539</guid>
		<description><![CDATA[<p>On Linux, all manner of automation is available.  I run my own minecraft server process on my virtual private server, and have been occasionally faced with random crashes.  (Truth be told, the machine needs just a tad more RAM, so perhaps the process is killed by the OS for this reason.)</p> <p>To keep my Minecraft [...]]]></description>
			<content:encoded><![CDATA[<p>On Linux, all manner of automation is available.  I run my own minecraft server process on my virtual private server, and have been occasionally faced with random crashes.  (Truth be told, the machine needs just a tad more RAM, so perhaps the process is killed by the OS for this reason.)</p>
<p>To keep my Minecraft server running through those unpredictable crashes, I have a simple cron script running periodically to check the status of the process:</p>
<pre><span style="color: #999999;">#! /usr/bin/env python</span>

<strong>import</strong> psutil
<strong>from</strong> subprocess <strong>import</strong> PIPE

CWD = <span style="color: #008000;">"/home/tim/minecraft/" <span style="color: #888888;"># Path to where Minecraft lives</span></span>
JAVA_EXE = <span style="color: #008000;">"/usr/lib/jvm/java-6-sun-1.6.0.24/jre/bin/java"</span>
MINECRAFT_JAR = <span style="color: #008000;">"minecraft_server-1.1.jar"</span>
MINECRAFT_COMMAND = <span style="color: #008000;">"<span style="color: #99cc00;">{0}</span> -Xmx1024M -Xms1024M -jar <span style="color: #99cc00;">{1}</span> nogui"</span>.format(JAVA_EXE, MINECRAFT_JAR).split()
SCREEN_COMMAND = <span style="color: #008000;">"screen </span><span style="color: #008000;">-d </span><span style="color: #008000;">-m </span><span style="color: #008000;">-S </span><span style="color: #008000;">minecraft"</span>.split()

<strong>def</strong> check_minecraft(process):
    <strong>if</strong> process.name == <span style="color: #008000;">"java"</span>:
        <strong>if</strong> [process.exe] + process.cmdline[1:] == MINECRAFT_COMMAND:
            <strong>print</strong> <span style="color: #008000;">"Minecraft is up and running!"</span>
            <strong>return</strong> <strong>True</strong>

<strong>def</strong> start_minecraft():
    <strong>print</strong> <span style="color: #008000;">"Minecraft isn't running. Starting it with following command: <span style="color: #99cc00;">{0}</span>"</span>.format(
            <span style="color: #008000;">" "</span>.join(SCREEN_COMMAND + MINECRAFT_COMMAND))
    process = psutil.Popen(SCREEN_COMMAND + MINECRAFT_COMMAND, stdout=PIPE, cwd=CWD)

<strong>for</strong> p <strong>in</strong> psutil.process_iter():
    <strong>if</strong> check_minecraft(p):
        <strong>break</strong>
<strong>else</strong>:
    start_minecraft()</pre>
<p>There are a few things going on here.  First, I&#8217;m using a super simple open source cross-platform library called <a title="psutil library for python" href="http://code.google.com/p/psutil/">psutil</a> to do the high-level scanning for my minecraft process.  You can easily install it by running &#8220;pip install psutil&#8221; or &#8220;easy_install psutil&#8221;.</p>
<p>After that, I have a bunch of constants that help me make the script maintainable, especially for playing with different server versions.  The Java version looks scary, but just type &#8220;which java&#8221; into your command line to discover it&#8217;s full path.</p>
<p>Then a couple of functions that do the units of work: check if a process is my minecraft process, and one to start a new process for minecraft.</p>
<p>Finally, a loop to do the work in context:  Iterate all processes and check each with my first function.  If that function ever returns True, then the loop should break.  Otherwise, if the loop finishes without breaking, it means we never found Minecraft&#8217;s process, and should start one ourselves.</p>
<p>The process is spawned using the psutil&#8217;s wrapper for the subprocess.Popen command native to Python.  It merely adds the psutil&#8217;s helpful attributes to the returned process object.  I&#8217;m not making use of that object in my code, but it stops me from importing more stuff up top so I&#8217;m using it anyway.  Popen takes the command to be run as an iterable, so that one isn&#8217;t forced to construct awkward strings programmatically.  I&#8217;m leveraging the <a title="screen utility" href="http://lmgtfy.com/?q=linux+screen">screen</a> command to start the process in a background shell that won&#8217;t die when my SSH user logs out.  The important screen flags are &#8220;-d -m&#8221;, which starts a shell in a disconnected state by default.  (We&#8217;re running from a cron script after all&#8211; it would be chaotic to attempt to communicate with the process programmatically to detached from it manually.)</p>
<p>All of this enables me to manually log into my box at any time and connect myself to the minecraft output screen via:</p>
<p>screen -r -S minecraft</p>
<p>(The &#8220;-S minecraft&#8221; is coming from the fact that I wanted to explicitly name the session, in case there are multiple sessions taking place concurrently.)  Now I can interact with the server via command line as if it were in front of me all along.  To gracefully disconnect without doing any damage, you press Control-A and then Control-D.  This detaches you from the background screen without actually ending it.  It can be reattached via that command above as many times as you want.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timvalenta.com/2012/01/16/automatically-restart-minecraft-server-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strike Against SOPA</title>
		<link>http://blog.timvalenta.com/2012/01/14/strike-against-sopa/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=strike-against-sopa</link>
		<comments>http://blog.timvalenta.com/2012/01/14/strike-against-sopa/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 05:56:08 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[censorship]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[sopa]]></category>
		<category><![CDATA[strike]]></category>

		<guid isPermaLink="false">http://blog.timvalenta.com/?p=534</guid>
		<description><![CDATA[<p><a href="http://sopastrike.com/">http://sopastrike.com/</a></p> <p>Quite a lot has been said about SOPA and its trans-political meanings for people everywhere, but to further drive the points home, the <a href="http://fightforthefuture.org/">Fight For the Future</a> group is encouraging websites everywhere to go on an Internet strike.  This means bringing down your own web site (hopefully with a helpful message about [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sopastrike.com/">http://sopastrike.com/</a></p>
<p>Quite a lot has been said about SOPA and its trans-political meanings for people everywhere, but to further drive the points home, the <a href="http://fightforthefuture.org/">Fight For the Future</a> group is encouraging websites everywhere to go on an Internet strike.  This means bringing down your own web site (hopefully with a helpful message about why the site is down) to clearly illustrate how a broken Internet would feel.  For the first time in my life, I had a moment of clarity wherein I saw the Internet as a mildly abstract yet actual place, like a park or city square where brillant and budding minds and window shoppers congregate, unhindered and free to behave as they desire.  And then I could see both the reason why the private industries might want to arbitrarily muzzle people in that square, and why that would be unacceptable for those of us in that square.</p>
<p>I intuitively perceive SOPA as nothing but corporate self-service, with an actual 100% negligence to who we are, we citizens of the planet.  My moment of clarity came because I had no previous need for a real-world analogy of what the Internet is.  This is because the Internet is not a place or a thing to be experienced.  It is the set of protocols and the infrastructure that enables experiences to occur between human beings and machines.  It is correspondingly absurd that, in the analogy of the city square or park, the government should have a reason to ban the use of spaces in the square, like a blacklist of persons&#8217; supposed names or appearances, or geographical coordinates that correspond to fraudulent salesmen, and then to hand the executive control of that power to the industries that can pay government officials to write bills for them that give the impression of throwing a tantrum about corrupted human behaviors, namely theft of claimed ideas and patterns of physical and non-physical <em>things</em>.</p>
<p>The world is not done evolving.  By extension, the Internet isn&#8217;t done evolving, because the Internet is us, the metaphysical square of sometimes disparate people with unique interests and purposes.  If private industry says that, for their own safety at a distance, they need to install trap doors on all spots in the square so that they can flush anyone they disapprove of out of apparent existence, then I say No.  This strategy will unavoidably fail.  An infinite number of examples will demonstrate the flatly obvious impossibility of a working blacklisting system, both past, present, and future.  Blacklisting doesn&#8217;t work.  If blacklisting worked, there wouldn&#8217;t be email spam or IP address abuse.  There would be no need for heuristics in virus scanners.  There would be no need for DNSsec.  There would be no need for a lot of things, because the blacklisting would just take care of it and we would be doing business as usual.</p>
<p>And for all of these reasons (despite a small number of visitors to this site for helpful information about using MySQLdb in Python 2.6, or fixing glitched wallpaper in OSX, or my needlessly snide rant a long time ago about why Java is stupid), timvalenta.com and its subdomains will be offline for the duration of September 18th, starting at 8am UTC.  I&#8217;m just a little guy on this &#8220;Internet&#8221; thing, but I contribute to it, and I don&#8217;t want SOPA to exist in any of the incarnations it has come to the U.S. Congress floor in.  It is wrong.  Because the writers of SOPA cannot understand this perspective, we go on a strike to remind them of what a fantastic source of collective knowledge we are, and that to censor us at all is to claim that we don&#8217;t deserve the right to speak as we wish.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timvalenta.com/2012/01/14/strike-against-sopa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing sidebar icons in Textmate</title>
		<link>http://blog.timvalenta.com/2011/12/27/textmate-sidebar-icons/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=textmate-sidebar-icons</link>
		<comments>http://blog.timvalenta.com/2011/12/27/textmate-sidebar-icons/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 20:16:53 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Textmate]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[plist]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://blog.timvalenta.com/?p=528</guid>
		<description><![CDATA[<p>Now here&#8217;s a difficult-to-Google-search niche concern: how do I change the sidebar icons for files (or folders) in the Textmate sidebar?</p> <p>Most of my attempts to find an existing article on the subject were decided failures, because the query was just too wordy, and all I&#8217;d find was Textmate replacement icons and file type icons [...]]]></description>
			<content:encoded><![CDATA[<p>Now here&#8217;s a difficult-to-Google-search niche concern: how do I change the sidebar icons for files (or folders) in the Textmate sidebar?</p>
<p>Most of my attempts to find an existing article on the subject were decided failures, because the query was just too wordy, and all I&#8217;d find was Textmate replacement icons and file type icons for Finder&#8217;s use.</p>
<p>The reason I wanted to accomplish this was that Textmate actually has a surprisingly small number of icons it uses for different file types, and much of my work is done in Python, which doesn&#8217;t have a proper icon in Textmate.  It shares the icon used by serialization formats like YAML and PLISTs.</p>
<p>I&#8217;ve gotten by for over two years with all of my icons looking exactly the same, but finally I got tired of not being able to have visual cues about file types.</p>
<p>If anybody else knows of a simpler way to accomplish this, please let me know!  In the meantime, here is my hack:</p>
<p>Right-click your Textmate app and choose &#8220;Show Package Contents&#8221;, and then browse to Contents/Resources/File Icons/</p>
<p>If you want to modify an existing icon, you can simply change a file found here.  The resources are in TIFF format by default, but they don&#8217;t have to be.  Also, some icons apply to multiple extension types, and if you want to add a new icon altogether for new extensions, open up the Bindings.plist file in that same directory.  By default it&#8217;ll want to open with Xcode, but it&#8217;s just a subset of XML, so you can open it in whatever you want.</p>
<p>The bindings file contains a list of arbitrary &lt;key&gt; elements that match the file names from the File Icons folder (minus extension), and are then followed by an &lt;array&gt; element of &lt;string&gt; items that enumerate all of the file extensions that the icon applies to.  For example, Textmate&#8217;s C++ icon actually applies to files with extensions in C, cc, cxx, ccp, and c++, while a separate icon for C only has a extension list with just a lowercase c.</p>
<p>In my case, I found a nice Python source file image called &#8220;text-x-python.png&#8221; and added the following to my PLIST:</p>
<pre>    &lt;key&gt;text-x-python&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;py&lt;/string&gt;
    &lt;/array&gt;</pre>
<p>You should note that the extensions in the &lt;array&gt; are case sensitive, so if you&#8217;re one of those guys that likes to watch the world burn and you use uppercase or mixed-case extensions, you&#8217;ll have to add your variations to the &lt;array&gt; items.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timvalenta.com/2011/12/27/textmate-sidebar-icons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Boot Camp Driver Downloads</title>
		<link>http://blog.timvalenta.com/2011/11/19/boot-camp-driver-downloads/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=boot-camp-driver-downloads</link>
		<comments>http://blog.timvalenta.com/2011/11/19/boot-camp-driver-downloads/#comments</comments>
		<pubDate>Sun, 20 Nov 2011 06:56:18 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[boot camp]]></category>
		<category><![CDATA[bootcamp]]></category>
		<category><![CDATA[dmg]]></category>
		<category><![CDATA[drivers]]></category>
		<category><![CDATA[iso]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[virtualclonedrive]]></category>

		<guid isPermaLink="false">http://blog.timvalenta.com/?p=520</guid>
		<description><![CDATA[<p>For any that have tried to set up Boot Camp without your unique computer&#8217;s OS X installation disk (which holds the boot camp drivers) will know that using other Mac disks simply won&#8217;t work.  Even if you crack open the folders to run the individual driver installers will eventually encounter weird problems or arbitrary failures.</p> [...]]]></description>
			<content:encoded><![CDATA[<p>For any that have tried to set up Boot Camp <strong>without</strong> your unique computer&#8217;s OS X installation disk (which holds the boot camp drivers) will know that using other Mac disks simply won&#8217;t work.  Even if you crack open the folders to run the individual driver installers will eventually encounter weird problems or arbitrary failures.</p>
<p>There&#8217;s no magic trick to force those drivers to work.  You really do need the right driver installers as found on your model&#8217;s installation CD.  It&#8217;s not a trick.</p>
<p>To compound the problem, on Snow Leopard I couldn&#8217;t for the life of me get the Boot Camp Assistant to download the right driver package.  It complained that the download was mundanely &#8220;not available&#8221;.</p>
<p>But what happens when you&#8217;re doing up your friend&#8217;s Boot Camp installation for him and he simply doesn&#8217;t have the installation DVD anymore?  The vast Internet didn&#8217;t easily yield anything usable.  For example, even fetching <a href="http://thepiratebay.org/torrent/5875557/MacBook_Pro_15__mid_2010_i7">some guy&#8217;s DMG image of this install DVD</a> didn&#8217;t work.  I suspect the DMG was just a rip of the HFS file system portion, not the hidden partitions that hold the Windows-readable parts (which include the valued drivers).</p>
<p>Then I discovered the mothership, as discussed on <a href="http://forums.macrumors.com/showpost.php?p=12864948&amp;postcount=14">a MacRumours forum post</a>.  The link they provide is to the primary resource consulted by OS X.  It&#8217;s a huge PLIST file (an XML standard Apple uses for preferences and configurations) so it&#8217;s not terribly readable, but it&#8217;s valuable.</p>
<p><a href="http://swscan.apple.com/content/catalogs/others/index-lion-snowleopard-leopard.merged-1.sucatalog">http://swscan.apple.com/content/catalogs/others/index-lion-snowleopard-leopard.merged-1.sucatalog</a></p>
<p>Searching this particular page (at present) for &#8220;<em>BootCampESD.pkg</em>&#8220; yields four matches.  I frankly don&#8217;t know the difference between them, despite their various version numbers, but usually just above or below the match you&#8217;ll see something like the following:</p>
<p><code>PostDate<br />
2010-10-20T18:59:32Z</code></p>
<p>This should help you figure out the correct date for your Macbook Pro model, which are periodically refreshed from time to time.  You will need the correct version in order for the drivers to install properly on your Windows partition.  If it doesn&#8217;t work, then there&#8217;s no two ways about it: you&#8217;ve got the wrong package.  Try a different one.</p>
<p>So copy out the URL to one of the packages, which will look like this:</p>
<p><code>http://swcdn.apple.com/content/downloads/54/00/041-0694/sq2RLp7XVNQzRG8qdpsq9sj4pHsgXkgPYg/BootCampESD.pkg</code></p>
<p>From OS X, paste that into a browser tab to start the download of that file.  Each one is about 500MB in size.  I hope you pay for fast broadband!  You&#8217;ll notice this is a Mac-style PKG installer.  Run it and point it at a reusable portable drive for installation.  You&#8217;ll end up with a few folders on your drive (which may or may not appear to have a recursive alias chain&#8230; try ejecting it and reinserting if you&#8217;re having trouble).  Navigate to:</p>
<p><code>Library/Application Support/BootCamp/</code></p>
<p>Here you&#8217;ll find a DMG called WindowsSupport.dmg.  This is the magic archive you&#8217;ve been looking for.  Mount it and copy its contents out to the root of your portable drive, so that it&#8217;s easily visible from Windows when you take it over there.</p>
<p>If by chance you&#8217;re adventurous, you can actually use 7-zip to open that DMG file from Windows, where there is a lone file called 0.Apple_ISO.  If you extract that and rename it to have a proper &#8220;ISO&#8221; extension, you can mount that ISO in Windows using something like VirtualCloneDrive, or other free virtual ISO software.  Inside that ISO are the same files that you otherwise could have extracted from the DMG in OS X.</p>
<p>Once you&#8217;ve got the files, just take the portable drive to your Windows partition and run the base &#8220;setup.exe&#8221; file.  If it says it&#8217;s not the right version of Boot Camp for your computer, then don&#8217;t screw with it.  It&#8217;s not lying to you.  Delete the contents of your portable drive and repeat the above download process on a different PKG from the Apple URL.</p>
<p>May you find that for which you search this day.  I know this has caused me a lot of trouble on more than one occasion <img src='http://blog.timvalenta.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timvalenta.com/2011/11/19/boot-camp-driver-downloads/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>pip install spatialite</title>
		<link>http://blog.timvalenta.com/2011/11/12/pip-install-spatialite/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pip-install-spatialite</link>
		<comments>http://blog.timvalenta.com/2011/11/12/pip-install-spatialite/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 02:49:30 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[gdal]]></category>
		<category><![CDATA[pip]]></category>
		<category><![CDATA[proj]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[spatialite]]></category>
		<category><![CDATA[virtualenv geos]]></category>

		<guid isPermaLink="false">http://blog.timvalenta.com/?p=517</guid>
		<description><![CDATA[<p>You thought it&#8217;d be that easy, did you?</p> <p>First make sure your dependencies are met.  Generally this means GEOS, GDAL, and PROJ.  If you&#8217;re using a proper package manager on your system, this should be as easy as requesting those packages to be installed by those names.</p> <p>On OS X I had a wild ride [...]]]></description>
			<content:encoded><![CDATA[<p>You thought it&#8217;d be that easy, did you?</p>
<p>First make sure your dependencies are met.  Generally this means GEOS, GDAL, and PROJ.  If you&#8217;re using a proper package manager on your system, this should be as easy as requesting those packages to be installed by those names.</p>
<p>On OS X I had a wild ride trying to figure out why my virtualenv&#8217;s pip wasn&#8217;t finding the &#8220;<code>geos_c.h</code>&#8221; and &#8220;<code>proj_api.h</code>&#8221; headers from <code>/opt/local/include</code>.  I confirmed that the virtualenv itself was configured to include this root in the generic makefile (which is never *not* the case, but a sanity check was in order).</p>
<p>However, the build errors persisted when it was time to include <code>geos_c.h</code>, so I cracked open my virtualenv&#8217;s <code>build/pyspatialite*/setup.py</code> and noticed that it keeps a list of include roots, which is empty by default.  It appends its own local root to that list during execution, but my precious system includes weren&#8217;t making the cut.  So I modified the list to merely include <code>'/opt/local/include'</code> by default, and it built smoothly.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timvalenta.com/2011/11/12/pip-install-spatialite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iOS 5: Terms and Conditions have changed, but I won&#8217;t show them to you to accept, even if you wanted to.</title>
		<link>http://blog.timvalenta.com/2011/10/12/ios-5-terms-and-conditions-have-changed-but-i-wont-show-them-to-you-to-accept-even-if-you-wanted-to/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ios-5-terms-and-conditions-have-changed-but-i-wont-show-them-to-you-to-accept-even-if-you-wanted-to</link>
		<comments>http://blog.timvalenta.com/2011/10/12/ios-5-terms-and-conditions-have-changed-but-i-wont-show-them-to-you-to-accept-even-if-you-wanted-to/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 00:15:32 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iCloud]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[sync]]></category>
		<category><![CDATA[Terms and Conditions]]></category>

		<guid isPermaLink="false">http://blog.timvalenta.com/?p=500</guid>
		<description><![CDATA[<p>After a rather painful upgrade from iOS 5 beta to iOS 5 release (involving several DFU mode attempts and iTunes error messages during upgrade), my apps somehow got stuck in limbo as they attempted to begin restoring.</p> <p>All the icons appeared with their progress bars, subtitled &#8220;Wating&#8230;&#8221;, and after a while, I got the popup [...]]]></description>
			<content:encoded><![CDATA[<p>After a rather painful upgrade from iOS 5 beta to iOS 5 release (involving several DFU mode attempts and iTunes error messages during upgrade), my apps somehow got stuck in limbo as they attempted to begin restoring.</p>
<p>All the icons appeared with their progress bars, subtitled &#8220;Wating&#8230;&#8221;, and after a while, I got the popup telling me to log in with my Apple ID.  But the popup showed somebody else&#8217;s Apple ID that I had never seen before, from a Verizon email address.  (I&#8217;m an AT&amp;T customer, never having had a phone on Verizon!)</p>
<p>I knew everything was about to go to hell, but I cleared out the address and entered my own login information.  After a really, really long pause, I got the typical notice about how the iTunes Terms and Conditions had changed, and that I&#8217;d need to accept them.  So of course I pushed OK, but absolutely nothing happens.  In fact, right away the progress indicator at the top right of the status bar goes away, and I&#8217;m left with a phone devoid of apps, dim with empty progress bars, no longer titled &#8220;Wating&#8230;&#8221;.  Nothing happens.</p>
<p>Touching one of the app icons, the process repeats, though this time without the Apple ID sign in form.  Just a message that the terms have changed, but no popup to read or accept them with.</p>
<p>I tried slamming on a lot of different functions before I tried the following:</p>
<ol>
<li>Go to the App Store application</li>
<li>Go to the Updates tab panel thing.</li>
<li>The list is empty, but at the top there is a link for viewing purchases.  Touch that.</li>
<li>Now touch the cloud icon next to any app for your phone.</li>
<li>The app will attempt to download, but you&#8217;ll get the notice about the updated Terms and Conditions.</li>
<li>This time the popup actually happens and you can push Accept.</li>
<li>You&#8217;ll get a notice that thanks you for accepting the mandatory contract, and tells you to try your purchase again.</li>
<li>Touch OK, but then close the App Store and return to your home screen.</li>
<li>Touch one of your dimmed app icons, and the original process of trying to redownload all apps will begin again.</li>
</ol>
<div>Now it works!  This was a bit of a case of &#8220;there&#8217;s an error, but I&#8217;m not going to help you solve it, dearest user&#8221;.  Yeah, well, screw you too, iOS 5 <img src='http://blog.timvalenta.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
]]></content:encoded>
			<wfw:commentRss>http://blog.timvalenta.com/2011/10/12/ios-5-terms-and-conditions-have-changed-but-i-wont-show-them-to-you-to-accept-even-if-you-wanted-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python 3.2 virtualenv Fails Installation of pip</title>
		<link>http://blog.timvalenta.com/2011/10/08/python-3-2-virtualenv-fails-installation-of-pip/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=python-3-2-virtualenv-fails-installation-of-pip</link>
		<comments>http://blog.timvalenta.com/2011/10/08/python-3-2-virtualenv-fails-installation-of-pip/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 02:18:40 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[distribute]]></category>
		<category><![CDATA[easy_install]]></category>
		<category><![CDATA[Macports]]></category>
		<category><![CDATA[pip]]></category>
		<category><![CDATA[python 3.2]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://blog.timvalenta.com/?p=483</guid>
		<description><![CDATA[<p>One of the most frustrating types of problem is one where you can&#8217;t control something that is obviously going wrong.</p> <p>For months, off and on, I&#8217;ve been casually trying to start Python3.2 virtualenvs for projects, because I care very much about progressing the state of Python 3.x&#8217;s ecosystem.  But every time I tried to create [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most frustrating types of problem is one where you can&#8217;t control something that is obviously going wrong.</p>
<p>For months, off and on, I&#8217;ve been casually trying to start Python3.2 virtualenvs for projects, because I care very much about progressing the state of Python 3.x&#8217;s ecosystem.  But every time I tried to create one, something like the following happens, given updated versions of Macports, python32, and python3.2-distribute:</p>
<pre style="background: #ddd; overflow: auto; padding: 1em;">virtualenv-3.2 virtualenv
New python executable in virtualenv/bin/python
Installing distribute..........................................................................................................................................................................................................................................................................................................................................................................done.
Installing pip....
  Complete output from command /Users/Miyako/Etc/virtualenv/bin/python /Users/Miyako/Etc/virtualenv/bin/easy_install /opt/local/Library/F...ort/pip-1.0.1.tar.gz:
  /Users/Miyako/Etc/virtualenv/bin/python: can't open file '/Users/Miyako/Etc/virtualenv/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
...Installing pip...done.
Traceback (most recent call last):
  File "/opt/local/bin/virtualenv-3.2", line 9, in
    load_entry_point('virtualenv==1.6.1', 'console_scripts', 'virtualenv')()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/virtualenv.py", line 795, in main
    never_download=options.never_download)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/virtualenv.py", line 897, in create_environment
    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/virtualenv.py", line 633, in install_pip
    filter_stdout=_filter_setup)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/virtualenv.py", line 863, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /Users/Miyako/Etc/virtualenv/bin/python /Users/Miyako/Etc/virtualenv/bin/easy_install /opt/local/Library/F...ort/pip-1.0.1.tar.gz failed with error code 2</pre>
<p>The woefully misleading part of this is that pip isn&#8217;t the thing actually failing— distribute didn&#8217;t work, and therefore when it comes time to throw easy_install into the mix for unpacking a bundled version of pip, easy_install is missing.</p>
<p>Running the command with more verbosity yields much more interesting information:</p>
<pre style="background: #ddd; overflow: auto; padding: 1em;">virtualenv-3.2 -vvv virtualenv
Creating virtualenv/lib/python3.2
Symlinking Python bootstrap modules
  Symlinking virtualenv/lib/python3.2/config-3.2m
  Symlinking virtualenv/lib/python3.2/lib-dynload
  Symlinking virtualenv/lib/python3.2/os.py
  Ignoring built-in bootstrap module: posix
# --- snip ---
Creating virtualenv/lib/python3.2/distutils
Writing virtualenv/lib/python3.2/distutils/__init__.py
Writing virtualenv/lib/python3.2/distutils/distutils.cfg
Using existing distribute egg: /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/virtualenv_support/distribute-0.6.16.tar.gz
Installing distribute...
  Running command /Users/Miyako/Etc/virtualenv/bin/python -c "#!python
"""Bootstra... main(sys.argv[1:])
" -v --always-copy -U distribute
  Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.15.tar.gz
  Extracting in /var/folders/rx/hvchmjtx027dy05fs5mqkyk80000gn/T/tmpm6_d7o
  Now working in /var/folders/rx/hvchmjtx027dy05fs5mqkyk80000gn/T/tmpm6_d7o/distribute-0.6.15
  Installing Distribute
# --- snip ---
Processing distribute-0.6.15-py3.2.egg
creating /Users/Miyako/Etc/virtualenv/lib/python3.2/site-packages/distribute-0.6.15-py3.2.egg
Extracting distribute-0.6.15-py3.2.egg to /Users/Miyako/Etc/virtualenv/lib/python3.2/site-packages
Adding distribute 0.6.15 to easy-install.pth file
Traceback (most recent call last):
File "setup.py", line 211, in
scripts = scripts,
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/dist.py", line 929, in run_commands
self.run_command(cmd)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/dist.py", line 948, in run_command
cmd_obj.run()
File "build/src/setuptools/command/install.py", line 73, in run
self.do_egg_install()
File "build/src/setuptools/command/install.py", line 101, in do_egg_install
cmd.run()
File "build/src/setuptools/command/easy_install.py", line 344, in run
self.easy_install(spec, not self.no_deps)
File "build/src/setuptools/command/easy_install.py", line 564, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "build/src/setuptools/command/easy_install.py", line 616, in install_item
self.process_distribution(spec, dist, deps)
File "build/src/setuptools/command/easy_install.py", line 645, in process_distribution
self.install_egg_scripts(dist)
File "build/src/setuptools/command/easy_install.py", line 515, in install_egg_scripts
self.install_wrapper_scripts(dist)
File "build/src/setuptools/command/easy_install.py", line 719, in install_wrapper_scripts
for args in get_script_args(dist):
File "build/src/setuptools/command/easy_install.py", line 1741, in get_script_args
header = get_script_header("", executable, wininst)
File "build/src/setuptools/command/easy_install.py", line 1593, in get_script_header
match = first_line_re.match(first)
TypeError: can't use a bytes pattern on a string-like object
Something went wrong during the installation.
See the error message above.
...Installing distribute...done.
Installing existing pip-1.0.1.tar.gz distribution: /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/virtualenv_support/pip-1.0.1.tar.gz
Installing pip...
Running command /Users/Miyako/Etc/virtualenv/bin/python /Users/Miyako/Etc/virtualenv/bin/easy_install /opt/local/Library/F...ort/pip-1.0.1.tar.gz
/Users/Miyako/Etc/virtualenv/bin/python: can't open file '/Users/Miyako/Etc/virtualenv/bin/easy_install': [Errno 2] No such file or directory
Complete output from command /Users/Miyako/Etc/virtualenv/bin/python /Users/Miyako/Etc/virtualenv/bin/easy_install /opt/local/Library/F...ort/pip-1.0.1.tar.gz:
/Users/Miyako/Etc/virtualenv/bin/python: can't open file '/Users/Miyako/Etc/virtualenv/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
...Installing pip...done.</pre>
<p>And of course this shows a much bigger problem.  Near the middle of all of that, it reveals:</p>
<pre style="background: #ddd; overflow: auto; padding: 1em;">Using existing distribute egg: /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/virtualenv_support/distribute-0.6.16.tar.gz</pre>
<p>0.6.16 is not at all the latest version, and is <a href="https://groups.google.com/forum/#!topic/the-fellowship-of-the-packaging/lFQa7cFd8Io">specifically mentioned as patched and fixed</a> concerning this problem.</p>
<p>First I tried punching my desk. When I was satisfied that wasn&#8217;t working, I tried putting 0.6.21 in that magic location, to see if it would get noticed, but to no avail.  When I removed 0.6.16 from that spot entirely, virtualenv started downloading 0.6.15 into the local directory where I was running my command.  Took me a while to notice this, by the way, since I had to scan the output to even notice the message:</p>
<pre style="background: #ddd; overflow: auto; padding: 1em;">No distribute egg found; downloading
Installing distribute...
  Running command /Users/Miyako/Etc/virtualenv/bin/python -c "#!python
"""Bootstra... main(sys.argv[1:])
" -v --always-copy -U distribute
  Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.15.tar.gz
  Extracting in /var/folders/rx/hvchmjtx027dy05fs5mqkyk80000gn/T/tmp013ka0
  Now working in /var/folders/rx/hvchmjtx027dy05fs5mqkyk80000gn/T/tmp013ka0/distribute-0.6.15
  Installing Distribute</pre>
<p>So now it&#8217;s just pissing me off for fun, I suppose.  Why 0.6.15?  Who knows.  Must be coded into the current version of virtualenv3.2</p>
<p>I actually had no idea how to make it stop fetching 0.6.15, so I downloaded 0.6.21 and renamed the tar.gz file as if it were 0.6.15, placing it into the local directory where I run my virtualenv command, and it fell for it.  Virtualenv installed everything and finished successfully.</p>
<p>Hopefully this helps somebody else out there.  I&#8217;m sure this will clear itself up as Macports and virtualenv update over time, but until this, it&#8217;s just a wildly frustrating problem with no clear configuration solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timvalenta.com/2011/10/08/python-3-2-virtualenv-fails-installation-of-pip/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Simple About.me WordPress Plugin</title>
		<link>http://blog.timvalenta.com/2011/09/18/simple-about-me-wordpress-plugin/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=simple-about-me-wordpress-plugin</link>
		<comments>http://blog.timvalenta.com/2011/09/18/simple-about-me-wordpress-plugin/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 23:34:26 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Hobbies]]></category>
		<category><![CDATA[about.me]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.timvalenta.com/?p=480</guid>
		<description><![CDATA[<p>Today I looked at my blog sidebar and decided that I would finally replace the overly simplistic text widget with my about.me URL.  I wanted a plugin that would take my username and just go and figure out the details of showing the image in the sidebar.</p> <p>Presenting, the Simple about.me Widget:</p> <p><a href="http://blog.timvalenta.com/wp-content/uploads/2011/09/about-me-0.2.zip">about-me-0.2</a></p> <p>This [...]]]></description>
			<content:encoded><![CDATA[<p>Today I looked at my blog sidebar and decided that I would finally replace the overly simplistic text widget with my about.me URL.  I wanted a plugin that would take my username and just go and figure out the details of showing the image in the sidebar.</p>
<p>Presenting, the <strong>Simple about.me Widget</strong>:</p>
<p><a href="http://blog.timvalenta.com/wp-content/uploads/2011/09/about-me-0.2.zip">about-me-0.2</a></p>
<p>This widget takes your username and grabs the background image you&#8217;re using over on about.me, saving it to the plugin&#8217;s directory for caching purposes.  The image is currently not resized at all, so that it can be dynamically set to be the full width of your sidebar.  (This means that a tall image will in fact be tall in your sidebar.  The width dimension is the one that is constrained.)</p>
<p>For this plugin to successfully save your background image, your web server user must be able to write to the plugin folder.  In a situation where you use the WordPress UI to install a plugin, this shouldn&#8217;t be a problem, but if you manually copy the folder to your server, you&#8217;re going to have to make sure it&#8217;s writable.</p>
<p>In the future it would be nice to remove the need to locally cache the image file (for example, use a service for that, like <a href="http://url2png.com/">http://url2png.com/</a>), but this is free, and I ain&#8217;t rich.</p>
<p>I will submit this to the main WordPress directory of plugins once I work out a few more things in the code, to make it easier for users to understand the cache problem, and to do thumbnailing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timvalenta.com/2011/09/18/simple-about-me-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mac Apache User</title>
		<link>http://blog.timvalenta.com/2011/09/18/mac-apache-user/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mac-apache-user</link>
		<comments>http://blog.timvalenta.com/2011/09/18/mac-apache-user/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 20:06:06 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://blog.timvalenta.com/?p=476</guid>
		<description><![CDATA[<p>&#8230; is &#8220;www&#8221;.  When you chown or chgrp to &#8220;www&#8221;, it is curious that it actually sets it to &#8220;_www&#8221;, but don&#8217;t argue with it!</p>]]></description>
			<content:encoded><![CDATA[<p>&#8230; is &#8220;www&#8221;.  When you chown or chgrp to &#8220;www&#8221;, it is curious that it actually sets it to &#8220;_www&#8221;, but don&#8217;t argue with it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timvalenta.com/2011/09/18/mac-apache-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cygwin says &#8220;Terminate batch job? (Y/N)&#8221;; I dislike stupid questions</title>
		<link>http://blog.timvalenta.com/2011/09/14/terminate-batch-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=terminate-batch-job</link>
		<comments>http://blog.timvalenta.com/2011/09/14/terminate-batch-job/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 21:03:26 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.timvalenta.com/?p=471</guid>
		<description><![CDATA[<p>To use Windows for the type of work I do, I need command line tools like ssh, and the standard Unix core utilities.  The standard Cygwin launcher is a batch file, so using Ctrl-D in certain kinds of contexts (<a title="Console2" href="http://sourceforge.net/projects/console/">Console2</a>, for example) causes a message that asks if you want to log out [...]]]></description>
			<content:encoded><![CDATA[<p>To use Windows for the type of work I do, I need command line tools like ssh, and the standard Unix core utilities.  The standard Cygwin launcher is a batch file, so using Ctrl-D in certain kinds of contexts (<a title="Console2" href="http://sourceforge.net/projects/console/">Console2</a>, for example) causes a message that asks if you want to log out of the session.  If you&#8217;re new to the scene, you might appreciate the message, but for those seasoned enough to want Cygwin for the sake of getting back to &#8220;how things should be&#8221;, you don&#8217;t want to encounter prompts that have no default response and which interrupt the workflow.</p>
<p><a href="http://kt2t.us/terminatebatchjob.htm">This guy</a> noted that changing your launcher to point to the bash.exe file for login actually works more smoothly:</p>
<pre>C:\cygwin\bin\bash.exe --login -i</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.timvalenta.com/2011/09/14/terminate-batch-job/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

