<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Matt Z</title>
	<atom:link href="http://namelythehedgehog.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://namelythehedgehog.wordpress.com</link>
	<description>Hackish solutions to obscure problems</description>
	<lastBuildDate>Tue, 20 Apr 2010 21:46:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='namelythehedgehog.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Matt Z</title>
		<link>http://namelythehedgehog.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://namelythehedgehog.wordpress.com/osd.xml" title="Matt Z" />
	<atom:link rel='hub' href='http://namelythehedgehog.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Compile static copy of Midnight Commander</title>
		<link>http://namelythehedgehog.wordpress.com/2010/04/20/compile-static-copy-of-midnight-commander/</link>
		<comments>http://namelythehedgehog.wordpress.com/2010/04/20/compile-static-copy-of-midnight-commander/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 21:31:32 +0000</pubDate>
		<dc:creator>namelythehedgehog</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[not slacking off my code's compiling]]></category>
		<category><![CDATA[one-liners]]></category>

		<guid isPermaLink="false">http://namelythehedgehog.wordpress.com/?p=44</guid>
		<description><![CDATA[I work with quite a few clusters, and in trying to get batch jobs running, I tend to generate many tiny files which are usually almost identical and almost useless.  The rare exception is the lone non-identical file, which is invariably critical in solving a problem.  Run a test job ten or fifty times, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=44&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I work with quite a few clusters, and in trying to get batch jobs running, I tend to generate many tiny files which are usually almost identical and almost useless.  The rare exception is the lone non-identical file, which is invariably critical in solving a problem.  Run a test job ten or fifty times, and a directory can fill up rapidly.  ls and rm get annoying for large directories.  So, I like to have a text-mode file manager on hand to help sort through, mark, and blow away useless cruft while identifying useful cruft.</p>
<p>I grew up with <a href="http://www.midnight-commander.org/">Midnight Commander</a>, and I&#8217;m a creature of habit, so I set about trying to compile a copy of mc statically, so I only had to do it once for all the x86_64 clusters I deal with (and incidentally dodge the problems of differing versions of dependency libraries, lack of development libraries, and so on).  Turns out that&#8217;s not so simple.  One would hope that</p>
<p><tt>./configure --disable-shared --enable-static</tt></p>
<p>would do it.  Not so much, at least not with mc.  The mc binary would still be huge, but would still contain dynamic links to glib, pcre, curses, and a host of other things.</p>
<p>Various mailing list posts circa 2002 were unhelpful, especially those of the form &#8220;edit the Makefiles and add <tt>-static</tt> to <tt>LIBS</tt>&#8220;.  Though a scientist, after a few hours the scientific process breaks down and I make more than one change at once.  In other words, the following, while it worked, probably contains thoroughly unnecessary duplication of flags:</p>
<pre>./configure --with-glib-static --without-x --disable-shared --enable-static \
    CC='gcc -static -static-libgcc -fno-exceptions' \
    CXX='g++ -static -static-libgcc -fno-exceptions' \
    LDFLAGS='-Wl,-static -static -lc' \
    LIBS='-lc'
</pre>
<p>The keys to success were:</p>
<ol>
<li>Specifying CC, CXX, LDFLAGS, and LIBS as command-line arguments to configure rather than environment variables.  In the latter case, configure only seems to honor them occasionally.</li>
<li>Putting the static linkage options into what will run as the compiler.</li>
<li>When <tt>-static-libgcc</tt> is specified, an <tt>-fno-exceptions</tt> option may be necessary to avoid pulling in stack unwinding code that seems to be available only in a shared library.</li>
<li>Adding <tt>LIBS='-lc'</tt>, because otherwise <tt>LDFLAGS='-Wl,-static'</tt> seemed to cause the linker to miss the crt0 startup routines, which a tailing <tt>'-lc'</tt> fixes.</li>
</ol>
<p>That generated a completely static executable.  Installation wasn&#8217;t terribly straightforward, since I didn&#8217;t want to install a second copy of mc on my development box (even in my home directory), tar it up, and then clean it up.  (I don&#8217;t claim this is logical; just that I simply didn&#8217;t want to do it after spending far too long trying to get a static executable.)   I wound up pulling everything from my (properly installed, local) copy of mc, both from <tt>/etc/mc</tt> and <tt>/usr/share/mc</tt>, pooling it in one directory (<tt>~/etc/mc</tt>) on the clusters, and pointing mc to it with <tt>MC_DATADIR=$HOME/etc/mc</tt> (via an export <tt>MC_DATADIR=...</tt> in my <tt>.bashrc</tt>).</p>
<p>It should be noted that this hack depends on the presence of static link libraries for glib, ncurses/slang, and perhaps pcre.  That took a little doing as well (since my development box runs Gentoo, that meant twiddling with USE flags and re-emerging some packages).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namelythehedgehog.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namelythehedgehog.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namelythehedgehog.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namelythehedgehog.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namelythehedgehog.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namelythehedgehog.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namelythehedgehog.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namelythehedgehog.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namelythehedgehog.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namelythehedgehog.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namelythehedgehog.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namelythehedgehog.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namelythehedgehog.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namelythehedgehog.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=44&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namelythehedgehog.wordpress.com/2010/04/20/compile-static-copy-of-midnight-commander/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64747678b9535f6e22e23daa3890ec61?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matt</media:title>
		</media:content>
	</item>
		<item>
		<title>Keyboard and mouse broken after xorg-server update</title>
		<link>http://namelythehedgehog.wordpress.com/2010/04/20/keyboard-and-mouse-broken-after-xorg-server-update/</link>
		<comments>http://namelythehedgehog.wordpress.com/2010/04/20/keyboard-and-mouse-broken-after-xorg-server-update/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 21:01:49 +0000</pubDate>
		<dc:creator>namelythehedgehog</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[one-liners]]></category>
		<category><![CDATA[RTFM]]></category>

		<guid isPermaLink="false">http://namelythehedgehog.wordpress.com/?p=41</guid>
		<description><![CDATA[So, in a case of RTFM (or perhaps RTFF, read the f-ing forum), keyboard and mouse on my home router were out of commission after an update of Xorg server.  I&#8217;d even run revdep-rebuild without any library name to try to sort out exactly what was meant by the &#8220;You MUST run revdep-rebuild after this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=41&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So, in a case of RTFM (or perhaps RTFF, read the f-ing forum), keyboard and mouse on my home router were out of commission after an update of Xorg server.  I&#8217;d even run revdep-rebuild without any library name to try to sort out exactly what was meant by the &#8220;You MUST run revdep-rebuild after this update&#8221; message the dbus update gave me.  Everything checked out clean.</p>
<p>But (who knew?) an Xorg server version bump might break various other modules, especially driver modules. A quick search of the Gentoo Forums gave a particularly elegant one-liner:</p>
<p><tt>emerge -av1 $(qlist -I -C x11-drivers)</tt></p>
<p>which reads, &#8220;emerge, verbosely and asking for confirmation, any installed package from the category x11-drivers&#8221;.  <tt>qlist</tt> is part of <tt>portage-utils</tt>.</p>
<p>That would include display drivers, but stripping those out left <tt>x11-drivers/xf86-input-evdev</tt> (and <tt>-keyboard</tt> and <tt>-mouse</tt>, for good measure).  My keyboard and mouse immediately worked again.</p>
<p>*headdesk*</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namelythehedgehog.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namelythehedgehog.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namelythehedgehog.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namelythehedgehog.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namelythehedgehog.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namelythehedgehog.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namelythehedgehog.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namelythehedgehog.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namelythehedgehog.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namelythehedgehog.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namelythehedgehog.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namelythehedgehog.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namelythehedgehog.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namelythehedgehog.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=41&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namelythehedgehog.wordpress.com/2010/04/20/keyboard-and-mouse-broken-after-xorg-server-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64747678b9535f6e22e23daa3890ec61?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matt</media:title>
		</media:content>
	</item>
		<item>
		<title>Been a while</title>
		<link>http://namelythehedgehog.wordpress.com/2010/04/20/been-a-while/</link>
		<comments>http://namelythehedgehog.wordpress.com/2010/04/20/been-a-while/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 20:50:51 +0000</pubDate>
		<dc:creator>namelythehedgehog</dc:creator>
				<category><![CDATA[Babble]]></category>

		<guid isPermaLink="false">http://namelythehedgehog.wordpress.com/?p=34</guid>
		<description><![CDATA[So, almost two years ago I created this blog for two purposes: To record — for posterity — all the dirty hacks clever solutions I came up with in the course of systems administration and programming projects. To make those publicly available, since it seemed that every problem I wound up solving was usually a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=34&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So, almost two years ago I created this blog for two purposes:</p>
<ol>
<li>To record — for posterity — all the <del datetime="2010-04-20T20:42:03+00:00">dirty hacks</del> clever solutions I came up with in the course of systems administration and programming projects.</li>
<li>To make those publicly available, since it seemed that every problem I wound up solving was usually a pain and almost never documented clearly in a manual, man page, mailing list, blog, &amp;c.</li>
</ol>
<p>And for almost two years, I&#8217;ve not run across things which have driven me sufficiently crazy to cause me to take time out to post.  But it seems time to make a return.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namelythehedgehog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namelythehedgehog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namelythehedgehog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namelythehedgehog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namelythehedgehog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namelythehedgehog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namelythehedgehog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namelythehedgehog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namelythehedgehog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namelythehedgehog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namelythehedgehog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namelythehedgehog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namelythehedgehog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namelythehedgehog.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=34&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namelythehedgehog.wordpress.com/2010/04/20/been-a-while/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64747678b9535f6e22e23daa3890ec61?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matt</media:title>
		</media:content>
	</item>
		<item>
		<title>Mercurial, Eclipse, Hard Links</title>
		<link>http://namelythehedgehog.wordpress.com/2008/07/30/mercurial-eclipse-hard-links/</link>
		<comments>http://namelythehedgehog.wordpress.com/2008/07/30/mercurial-eclipse-hard-links/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 17:10:33 +0000</pubDate>
		<dc:creator>namelythehedgehog</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://namelythehedgehog.wordpress.com/?p=31</guid>
		<description><![CDATA[For one of my major projects, I use Mercurial for version control, and Eclipse with PyDev for my primary development environment.  I frequently clone a development trunk to create new development branches (usually one per feature set I&#8217;m working on at a time).  I had a little hiccup of paranoia about what it means to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=31&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For one of my major projects, I use <a href="http://www.selenic.com/mercurial/">Mercurial</a> for version control, and <a href="http://www.eclipse.org/">Eclipse</a> with <a href="http://pydev.sourceforge.net/">PyDev</a> for my primary development environment.  I frequently clone a development trunk to create new development branches (usually one per feature set I&#8217;m working on at a time).  I had a little hiccup of paranoia about what it means to clone a repository, since at least some of the newly-cloned files are not physical copies, but hard links.  And I didn&#8217;t know what Eclipse did with hard links.</p>
<p>A quick look at the output of <code>hg clone --help</code> reveals the following:</p>
<ul>
<li>Running <code>hg clone</code> copies the tracked files and hard links the metadata (.hg directory).</li>
<li><code>hg clone --pull</code> copies everything and hard links nothing.</li>
<li><code>cp -al</code> copies nothing and hard links everything, which means your editor had better break hard links or else changes will be saved in two repositories at once.</li>
</ul>
<p>In other words, an invocation of <code>hg clone</code> followed by editing some tracked files will always do the right thing, regardless of what your editor does.  Since I always clone repositories using <code>hg clone</code> (disk space isn&#8217;t too tight at the moment), it was never an issue, even using a rather complex Java IDE.</p>
<p>That got me wondering, though, what would have happened if I cloned using <code>cp -al</code>. It turns out that by default,</p>
<ul>
<li><a href="http://www.gnu.org/software/emacs/elisp/html_node/Rename-or-Copy.html">emacs breaks hard links</a>.  Can be overridden by adding <code>(setq backup-by-copying-when-linked t)</code> to one&#8217;s &#8220;.emacs&#8221; file.</span></li>
<li><span class="example"><a href="http://openwall.info/wiki/internal/vimrc">vim preserves hard links</a>.  Can be overriden by <code>set bkc=no</code> in <code>.vimrc</code> or at the vim command line</span></li>
<li><span class="example">Eclipse preserves hard links.  This was tested empirically rather than looked up in documentation, and there isn&#8217;t an easily-located setting to change this.</span></li>
<li><span class="example">OS X TextEdit breaks hard links.  Also tested, and I didn&#8217;t even look for a way to change it.</span></li>
</ul>
<p>The moral of the story:  when in doubt, <code>hg clone</code>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/namelythehedgehog.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/namelythehedgehog.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namelythehedgehog.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namelythehedgehog.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namelythehedgehog.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namelythehedgehog.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namelythehedgehog.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namelythehedgehog.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namelythehedgehog.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namelythehedgehog.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namelythehedgehog.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namelythehedgehog.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namelythehedgehog.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namelythehedgehog.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namelythehedgehog.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namelythehedgehog.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=31&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namelythehedgehog.wordpress.com/2008/07/30/mercurial-eclipse-hard-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64747678b9535f6e22e23daa3890ec61?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matt</media:title>
		</media:content>
	</item>
		<item>
		<title>Schema management with SQLAlchemy</title>
		<link>http://namelythehedgehog.wordpress.com/2008/07/25/schema-management-with-sqlalchemy/</link>
		<comments>http://namelythehedgehog.wordpress.com/2008/07/25/schema-management-with-sqlalchemy/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 22:24:32 +0000</pubDate>
		<dc:creator>namelythehedgehog</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Pylons]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[SQLAlchemy]]></category>

		<guid isPermaLink="false">http://namelythehedgehog.wordpress.com/?p=26</guid>
		<description><![CDATA[At work I&#8217;m developing a database system for tracking quantum mechanics calculations. It&#8217;s been done before, but a) this focuses more on job tracking than job submission and analysis, b) it&#8217;s really more about the command-line side of things with a web-based search, c) it&#8217;s more about some home-grown dynamics calculations than general-purpose &#8220;QM for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=26&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>At work I&#8217;m developing a database system for tracking quantum mechanics calculations.  It&#8217;s been done <a href="http://www.webmo.net/">before</a>, but a) this focuses more on job tracking than job submission and analysis, b) it&#8217;s really more about the command-line side of things with a web-based search, c) it&#8217;s more about some home-grown dynamics calculations than general-purpose &#8220;QM for the masses&#8221;, and d) it&#8217;s what a professor hired me to do, so I don&#8217;t ask questions.</p>
<p>The core of the system is Python-based, with database handling care of <a href="http://www.sqlalchemy.org/">SQLAlchemy</a> and a web interface using <a href="http://pylonshq.com/">Pylons</a>.  Pylons is a mixed blessing.  It&#8217;s relatively lean and eminently customizable, but it has the feel of a large number of developing (i.e. beta) projects glued together with chewing gum.  They&#8217;re very high-quality beta, and the chewing gum is well-placed.  For the most part, it&#8217;s better than inventing or re-inventing a web framework.  My main gripe is that the documentation is scattered everywhere, and the bulk of Pylons-specific documentation is not a reference work, but a set of FAQs and cookbook recipes.  That said, it&#8217;s the least intrusive framework I investigated, and I&#8217;m sticking with it for now.  If I have spare time, perhaps I&#8217;ll contribute some development effort or some documentation.</p>
<p>The question of the day relates not to Pylons but SQLAlchemy.  I&#8217;m working on a feature enhancement which will require some minor database restructuring, which raises the broader issue of schema migration.  So far, there have only been beta deployments of this software, so hand-coded migration scripts have been much handier than anything else.  As soon as the package is released to the project director&#8217;s collaborators, it&#8217;ll need to be a more automatic process.</p>
<p>So, just having gone public on this blog, and not knowing if there will be any readership, I pose the question: what are people&#8217;s experiences with schema migration?   I&#8217;m poking around <a href="http://code.google.com/p/sqlalchemy-migrate/">sqlalchemy-migrate</a>.  It seems well-thought-out, but I have two concerns:</p>
<ul>
<li>The version management is not exactly lightweight.  I currently have a one-row entry in the DB for schema version.  I&#8217;d rather not have to add another table to the DB, or another entire tree in the source code.</li>
<li>The fewer dependent packages I have to make scientific end-users install, the less trouble support will be.  It&#8217;d be great not to have to include another package in the installation instructions, and it&#8217;s one less thing that can break.</li>
</ul>
<p>So, as I said&#8230;comments on experiences with schema migration would be helpful.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/namelythehedgehog.wordpress.com/26/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/namelythehedgehog.wordpress.com/26/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namelythehedgehog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namelythehedgehog.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namelythehedgehog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namelythehedgehog.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namelythehedgehog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namelythehedgehog.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namelythehedgehog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namelythehedgehog.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namelythehedgehog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namelythehedgehog.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namelythehedgehog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namelythehedgehog.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namelythehedgehog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namelythehedgehog.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=26&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namelythehedgehog.wordpress.com/2008/07/25/schema-management-with-sqlalchemy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64747678b9535f6e22e23daa3890ec61?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matt</media:title>
		</media:content>
	</item>
		<item>
		<title>Un-quarantine downloaded files on OS X</title>
		<link>http://namelythehedgehog.wordpress.com/2008/07/22/un-quarantine-downloaded-files-on-os-x/</link>
		<comments>http://namelythehedgehog.wordpress.com/2008/07/22/un-quarantine-downloaded-files-on-os-x/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 22:23:08 +0000</pubDate>
		<dc:creator>namelythehedgehog</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://ariel/wordpress/?p=8</guid>
		<description><![CDATA[Though I agree in principle with the idea of marking downloaded files as hazardous, it can be quite annoying when, say, extracting piles and piles of W3C documentation for future reference &#8212; especially when opening some index.html pops up a dialog box about a downloaded application. The &#8220;downloaded application&#8221; marker OS X puts on downloaded [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=14&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Though I agree in principle with the idea of marking downloaded files as hazardous, it can be quite annoying when, say, extracting piles and piles of W3C documentation for future reference &#8212; especially when opening some index.html pops up a dialog box about a downloaded application.  The  &#8220;downloaded application&#8221; marker OS X puts on downloaded files is in fact an <a href="http://en.wikipedia.org/wiki/Extended_file_attributes#Mac_OS_X">extended attribute</a>.</p>
<p>The attribute in question is &#8220;com.apple.quarantine&#8221;, as shown below:</p>
<pre>$ ls -l@
total 1560
drwxr-xr-x  25 mzwier  staff     850 Jul 22 18:04 html40
-rw-r--r--@  1 mzwier  staff  369830 Jul 22 18:00 html40.tgz
	com.apple.quarantine	    42</pre>
<p>The tool to manage extended attribute data is (logically), &#8220;xattr&#8221;.  xattr has no man page, but an informative-enough help option (this directly from <code>xattr --help</code>, reprinted for reference and discussion):</p>
<pre>$ xattr --help
usage: xattr [-l] file [file ...]
       xattr -p [-l] attr_name file [file ...]
       xattr -w attr_name attr_value file [file ...]
       xattr -d attr_name file [file ...]

The first form lists the names of all xattrs on the given file(s).
The second form (-p) prints the value of the xattr attr_name.
The third form (-w) sets the value of the xattr attr_name to attr_value.
The fourth form (-d) deletes the xattr attr_name.

options:
  -h: print this help
  -l: print long format (attr_name: attr_value)</pre>
<p>So, to lift the quarantine on a specific file, the proper move is</p>
<pre>xattr -d com.apple.quarantine FILE</pre>
<p>To lift the quarantine on a whole directory tree (say, of documentation), the move is</p>
<pre>find DIRNAME -print0 | xargs -0 xattr -d com.apple.quarantine</pre>
<p>piggybacking on standard tricks with <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/find.1.html">find</a> and <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/xargs.1.html">xargs</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/namelythehedgehog.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/namelythehedgehog.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namelythehedgehog.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namelythehedgehog.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namelythehedgehog.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namelythehedgehog.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namelythehedgehog.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namelythehedgehog.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namelythehedgehog.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namelythehedgehog.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namelythehedgehog.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namelythehedgehog.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namelythehedgehog.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namelythehedgehog.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namelythehedgehog.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namelythehedgehog.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=14&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namelythehedgehog.wordpress.com/2008/07/22/un-quarantine-downloaded-files-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64747678b9535f6e22e23daa3890ec61?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matt</media:title>
		</media:content>
	</item>
		<item>
		<title>Automatic Backup of USB Drive</title>
		<link>http://namelythehedgehog.wordpress.com/2008/07/21/automatic-backup-of-usb-drive/</link>
		<comments>http://namelythehedgehog.wordpress.com/2008/07/21/automatic-backup-of-usb-drive/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 22:13:58 +0000</pubDate>
		<dc:creator>namelythehedgehog</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://ariel/wordpress/?p=3</guid>
		<description><![CDATA[I&#8217;ve started to keep some regularly-updated critical information on my USB thumb drive. Apple&#8217;s Time Machine doesn&#8217;t seem to be willing to back up external disks (or at least VFAT-formatted external disks). I figured I&#8217;d piggyback on Time Machine&#8217;s hourly backups by using rsync to copy the thumb drive periodically to my MacBook&#8217;s hard drive. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=11&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started to keep some regularly-updated critical information on my USB thumb drive.  Apple&#8217;s Time Machine doesn&#8217;t seem to be willing to back up external disks (or at least VFAT-formatted external disks).  I figured I&#8217;d piggyback on Time Machine&#8217;s hourly backups by using rsync to copy the thumb drive periodically to my MacBook&#8217;s hard drive.  OS X 10.5 still supports cron, but I keep running across references to <a href="http://en.wikipedia.org/wiki/Launchd">launchd</a>.  After some googling, I came up with the following script:</p>
<p><pre class="brush: php;">
#!/bin/bash
test -e /Volumes/MCZ &amp;&amp;
  rsync -avr --delete /Volumes/MCZ $HOME/Metabackup/ &gt;&amp; $HOME/Metabackup/MCZ.log
</pre><br />
and the following plist describing the new &#8220;service&#8221; I wanted launchd to handle:</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
&lt;plist version=&quot;1.0&quot;&gt;
&lt;dict&gt;
        &lt;key&gt;KeepAlive&lt;/key&gt;
        &lt;false/&gt;
        &lt;key&gt;Label&lt;/key&gt;
        &lt;string&gt;znet.backups.mczthumb&lt;/string&gt;
        &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
                &lt;string&gt;/bin/bash&lt;/string&gt;
                &lt;string&gt;/Users/mzwier/bin/backup-thumb.sh&lt;/string&gt;
        &lt;/array&gt;
        &lt;key&gt;RunAtLoad&lt;/key&gt;
        &lt;true/&gt;
        &lt;key&gt;StartCalendarInterval&lt;/key&gt;
        &lt;dict&gt;
                &lt;key&gt;Minute&lt;/key&gt;
                &lt;integer&gt;52&lt;/integer&gt;
        &lt;/dict&gt;
&lt;/dict&gt;
&lt;/plist&gt;
</pre></p>
<p>This is exactly equivalent to the cron line</p>
<pre>52 * * * * /bin/bash /Users/mzwier/bin/backup-thumb.sh</pre>
<p>I saved the plist in <code>~/Library/LaunchAgents</code> (as <code>znet.backups.mczthumb</code>) and ran <code>launchctl</code>:</p>
<p><code>launchd% load /Users/mzwier/Library/LaunchAgents/znet.backups.mczthumb</code></p>
<p>Worked on the first try.  It may be useful to perform an update every time the drive is mounted, but that&#8217;s a challenge for another day.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/namelythehedgehog.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/namelythehedgehog.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namelythehedgehog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namelythehedgehog.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namelythehedgehog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namelythehedgehog.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namelythehedgehog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namelythehedgehog.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namelythehedgehog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namelythehedgehog.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namelythehedgehog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namelythehedgehog.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namelythehedgehog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namelythehedgehog.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namelythehedgehog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namelythehedgehog.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namelythehedgehog.wordpress.com&amp;blog=4327461&amp;post=11&amp;subd=namelythehedgehog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namelythehedgehog.wordpress.com/2008/07/21/automatic-backup-of-usb-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64747678b9535f6e22e23daa3890ec61?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matt</media:title>
		</media:content>
	</item>
	</channel>
</rss>
