<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
   <channel>
      <title>Strange Loopiness</title>
      <link>http://www.zedlopez.com/strangeloopiness/</link>
      <description></description>
      <language>en</language>
      <copyright>Copyright 2010</copyright>
      <lastBuildDate>Tue, 27 Jul 2010 06:56:48 -0800</lastBuildDate>
      <generator>http://www.sixapart.com/movabletype/?v=4.12</generator>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs> 

      
      <item>
         <title>Escape from the shell</title>
         <description><![CDATA[<p>Perl's exec, system, and fork functions all let one execute system commands, and they all do it by driving a <span class="caps">POSIX </span>exec system call so they don't invoke a shell. But Perl's backtick operator (aka the qx quotelike operator), the easiest way to capture output from a command, invokes a shell, so the arguments to the command need to be shell-escaped.</p>

<p> <a href="http://search.cpan.org/~mschilli/Sysadm-Install-0.35/lib/Sysadm/Install.pm">Sysadm::Install</a> has quote and qquote functions that do a good job of this, but it's easy enough to avoid needing shell escaping.</p>



<pre>
sub command {
  my ($command, $dontchomp) = @_;
  $dontchomp //= 0;
  open(my $ph, qq{$command|}) or die &quot;Can't fork $command: $!&quot;;
  my $raw = do { local $/ = &lt;$ph&gt; };
  close($ph) or die &quot;$command returned error: $! $?&quot;;
  chomp $raw unless $dontchomp;
  return wantarray ? split &quot;\n&quot;, $raw : $raw;
}
</pre>



<p>Note that you pass the whole command line as one string, arguments and all. The default behavior is to chomp the command output, which differs from the native backtick behavior; you can pass a true value for the second arg, $dontchomp, if you don't want it.</p>

<p>Reading all the output into a scalar is suitable for things with modest amounts of output (like the situtations in which you would have been using a backtick.) If you were processing a lot of output, you'd want to open the pipehandle and iterate on &lt;$ph&gt; yourself.</p>

<p>The reason I went down this rabbit-hole is wanting to get info from ratpoison so I could write some window management scripts. When you pass ratpoison a command with its -c option, it expects the whole command as one string. So we do have to worry about quote-escaping that string, like so:</p>



<pre>
sub rp {
  local $_ = &quot;@_&quot;;
  s/&quot;/\\&quot;/g;
  return command(qq{ratpoison -c &quot;$_&quot;});
}
</pre>



<p>The way this is written, you can pass your arguments as a string or as a list, to taste.</p>



<pre>
rp(&quot;windows %c %t %n&quot;);
rp(&quot;windows&quot;, &quot;%c&quot;, &quot;%t&quot;, &quot;%n&quot;);
</pre>



<p>Ratpoison lets you pass it multiple commands at once, and this rp routine doesn't, but that's usually what you want when you're getting info out of it.</p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2010/07/escape_from_the_shell.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2010/07/escape_from_the_shell.html</guid>
         <category></category>
         <pubDate>Tue, 27 Jul 2010 06:56:48 -0800</pubDate>
      </item>
      
      <item>
         <title>CPAN handling</title>
         <description><![CDATA[<p>Later the same week I was having <a href="http://www.zedlopez.com/strangeloopiness/2010/06/not_an_ez_setup.html">problems building a Python package,</a> I rounded out my fun by having problems building a Perl package.</p>

<p>I learned that &lt;prefix&gt;/perl/&lt;version&gt;/Config.pm includes the various flags and settings that your perl was built with, and can be your guide to how to build things to play nice with your Perl instance. (<a href="http://search.cpan.org/~dagolden/Module-Build-0.3607/lib/Module/Build.pm">Module::Build</a> tries to do this automagically, but it wasn't working with the idiosyncrasies of the environment I was working with.)</p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2010/06/cpan_handling.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2010/06/cpan_handling.html</guid>
         <category></category>
         <pubDate>Mon, 21 Jun 2010 07:11:05 -0800</pubDate>
      </item>
      
      <item>
         <title>Not an ez_setup</title>
         <description><![CDATA[<p>I was trying to build a Python module yesterday, but <br />
<tt><br />
python setup.py build<br />
</tt><br />
insisted on including several compiler options that the compiler immediately balked at, returning an error. This is despite that the instance of Python I was using was freshly compiled with the same environment, so shouldn't have any mistaken notions of how things should be built.</p>

<p>setup.py went: </p>


<pre>
if os.name == &quot;posix&quot;:
    from setup_posix import get_config
else: # assume windows
    from setup_windows import get_config

metadata, options = get_config()
# other assignments to metadata
setup(**metadata)
</pre>



<p>so I just used pprint to look at options: </p>



<pre>
import pprint
pp = pprint.PrettyPrinter(indent=2)
metadata, options = get_config()
pp.pprint(options)
</pre>



<p>I saw that the unwanted compiler options were coming from <tt>options['extra_compile_args']</tt> so I set that to the null list, and now I could build it.</p>

<p>Also, I got to find out that the 3 year old release version of mod_python 3.3.1 has a <a href="https://issues.apache.org/jira/browse/MODPYTHON-249">bug</a> that causes compilation errors on some platforms (including mine, Solaris 2.10.)</p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2010/06/not_an_ez_setup.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2010/06/not_an_ez_setup.html</guid>
         <category></category>
         <pubDate>Wed, 09 Jun 2010 06:51:02 -0800</pubDate>
      </item>
      
      <item>
         <title>Ratpoison titlechanged hook</title>
         <description><![CDATA[<p>A <a href="http://git.savannah.gnu.org/cgit/ratpoison.git/commit/?id=c48f75e86aea05a8b09a9e52eebe202ac2e84c3c">tiny patch</a> I wrote was just committed to the <a href="http://www.nongnu.org/ratpoison/">ratpoison</a> git repository. It adds a <a href="http://www.nongnu.org/ratpoison/doc/Hooks.html">hook</a> called "titlechanged" that allows you to configure actions to be taken when the current window's title is changed.</p>

<p>My patch included a one-line description of the hook in the manual. It's accurate enough, but by itself it remains one of those things that would leave you thinking "OK, so I <em>can</em> do this, but why would I want to?" </p>

<p>So this entry is my explanation of why you might want to.</p>

<p>One of the points of ratpoison is that it just draws windows, with no titlebar or other window decoration (save for an optional border.) Most of the time, I find this to be a feature -- the titlebar rarely adds anything useful, so it's usually wasted space. But I sometimes found it to be a bug when using a web browser, when the window title is whatever's the contents of the current tab's title tag, info that isn't necessarily duplicated elsewhere and occasionally has value.</p>

<p>At some point, I toyed with a greasemonkey script that would reproduce the title in the body of the html in some distinctive style, but it was a pain. It took a while, but eventually I struck upon my current course and realized just how easy it would be to add the necessary support to ratpoison. (I programmed in C for five years in my first job out of college, but that was a long time ago, and I wouldn't claim to be a C programmer today. But the ratpoison source is so clean and clear, the patch was straightforward.) And it's a relief to know I'll never want to cobble together an application-specific workaround again.</p>

<p>How I'm using it relies on <a href="http://distanz.ch/inotail/">inotail</a> and <a href="http://sites.google.com/site/gotmor/dzen">dzen</a> (compiled from source for xft support, which the Ubuntu Lucid package doesn't have.)</p>

<p>In my .xsession, I have:</p>

<p><tt><br />
[ -f /tmp/left ] &amp;&amp; rm /tmp/left<br />
[ -f /tmp/right ] &amp;&amp; rm /tmp/right<br />
touch /tmp/left<br />
touch /tmp/right<br />
killall dzen2<br />
inotail -f /tmp/left|dzen2 -x 0 -w 400 -ta l -fg "#1F1F1F" -bg "#CFCFD7" -fn "Consolas-11" &amp;<br />
inotail -f /tmp/right|dzen2 -x 400 -w 1280 -ta r -fg "#1F1F1F" -bg "#CFCFD7" -fn "Consolas-11" &amp;<br />
/usr/local/bin/status.pl &amp;<br />
ratpoison<br />
</tt></p>

<p>In my .ratpoisonrc, I have:</p>

<p><tt><br />
set padding 0 16 0 0 <br />
addhook switchwin exec ratpoison -c "info %t" &gt; /tmp/right<br />
addhook switchframe exec ratpoison -c "info %t" &gt; /tmp/right<br />
addhook deletewindow exec ratpoison -c "info %t" &gt; /tmp/right<br />
addhook titlechanged exec ratpoison -c "info %t" &gt; /tmp/right<br />
</tt></p>

<p>"set padding" leaves 16 pixels at the top of the screen for the dzen2 bar, suitable for 1 line of Consolas-11. The hooks update /tmp/right whenever a potentially title-changing event occurs. (I was tempted to fire the titlechanged hooks in ratpoison as a side effect of the other hooks, but no other hook in ratpoison chains in that fashion, and I chose not to.) </p>

<p>Meanwhile, /usr/local/bin/status.pl writes to /tmp/left to update the left 400 pixels with the time and current <span class="caps">CPU </span>temp.</p>

<p><tt><br />
#!/usr/bin/perl<br />
my $font="Consolas-11";<br />
my $fg="#1F1F1F";<br />
my $bg="#CFCFD7";</p>

<p>while (1) {<br />
  open(KID_TO_WRITE, "&gt;/tmp/left") or die "couldn't open /tmp/left: $!";<br />
  my ($sec, $min, $hour) = localtime(time);<br />
  my $time = sprintf "%02d:%02d", $hour, $min;</p>

<p>  my @sensors = split "\n", `sensors`;<br />
  my ($systemp, $core0, $core1);<br />
  for (@sensors) {<br />
    /^Core 0/ &amp;&amp; do  { /(\d+\.\d+)/; $core0 = sprintf "%2.0f", $1; };<br />
    /^Core 1/ &amp;&amp; do  { /(\d+\.\d+)/; $core1 = sprintf "%2.0f", $1; };<br />
  }<br />
  print <span class="caps">KID</span>_TO_WRITE "$time ", (join "/", $core0, $core1), "\n";<br />
  sleep 15;<br />
  close <span class="caps">KID</span>_TO_WRITE;<br />
}<br />
</tt></p>

<p>I'm not using dual monitors at the moment. This setup would need some revision for that case; I'd probably want different dzen bars per screen (and I'd assign something to a switchscreen hook in ratpoison.) And the static width of the dzen bars wouldn't do the right thing with screen rotation, something I'll address at some point.</p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2010/05/a_tiny_patchhttpgitsavannahgnu.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2010/05/a_tiny_patchhttpgitsavannahgnu.html</guid>
         <category></category>
         <pubDate>Wed, 19 May 2010 07:23:55 -0800</pubDate>
      </item>
      
      <item>
         <title>What I tell you three times is true</title>
         <description><![CDATA[<p>Two science fiction novels I love pay tribute to <a href="http://www.literature.org/authors/carroll-lewis/the-hunting-of-the-snark/chapter-01.html">The Hunting of the Snark</a> with turning points in which computers allow otherwise unauthorized behavior when the user tells it something three times. (I'm not mentioning which novels, because it's a major spoiler for one of them.)</p>

<p>They have inspired this utterly brilliant idea:</p>

<p>Set up some pre- and post-processing of command lines in your shell so that it has a history of return codes as well as a history of the command lines themselves.</p>

<p>If a given command is identical to the two previous commands entered, and the two previous commands exited with identical non-zero return codes, automatically escalate privilege to root.</p>

<p>What could go wrong?</p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2010/05/what_i_tell_you_three_times_is.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2010/05/what_i_tell_you_three_times_is.html</guid>
         <category></category>
         <pubDate>Mon, 17 May 2010 13:02:01 -0800</pubDate>
      </item>
      
      <item>
         <title>Why I almost left Ubuntu</title>
         <description><![CDATA[<p>It's hard to believe, but I've been using Ubuntu for about 6 years now. I'd been using Gentoo beforehand; I've come to like the Debian packaging system, repositories whose intra-operability had been extensively tested (at least after release...), but with the regular release schedule putting a reasonable bound on getting recent versions of apps. And Pocahontas is happy with her Ubuntu (Gnome) desktop, and it's convenient to have all the machines in the house on the same <span class="caps">OS.</span></p>

<p>But I don't have any use for Gnome, or <span class="caps">KDE, </span>or desktop environments in general. I start with a command-line system, install X, build ratpoison from source (with a patch of my own), build rxvt-unicode from source (because even Lucid's package is one release behind, missing the crucial letterspace adjustment feature), build dzen2 from source (for xft support)... in short, I was acting more like an Arch Linux user. And I was often finding the Arch wiki and forums more helpful than Ubuntu's, given how often the latter's advice was desktop environment-centric. I figured why fight it? I'd give a distro more or less aimed at compulsive customizers a go.</p>

<p>So I did. I have a draft blog entry lying around talking about it, which was mostly positive. But I gave up due to a fatal flaw that I suspected (and am now confident) wasn't Arch's fault. <a href="https://bugzilla.redhat.com/show_bug.cgi?id=537708">This bug</a> in which mode_switch is intermittently locked may be common to all instances of Xorg's Xserver &gt;= 1.7. Harmless for the majority who've never Xmodmapped a mode_switch key into existence or mapped a keyboard layout that relied on it. But if you have, it makes your system unusable. At first I'd thought my keyboard was dirty and sticking, but it persisted with a new keyboard.</p>

<p>I wasn't willing to unlearn my custom keyboard layout, and didn't want to learn how to do it in <span class="caps">XKB </span>having found that a frustrating exercise when I'd looked into it before, so I thought I'd install the Ubuntu Lucid pre-release (I think it was the last Alpha.) My latest machine didn't have a CD drive, so I was installing with a <span class="caps">USB</span> CD drive. And after starting, the installer complained it couldn't find the CD drive, would I like to provide a driver on floppy? This was when I remembered I'd had the same problem with Karmic. So, like I did then, I started with Jaunty, planning to dist-upgrade for there. Which I did. But whether it was due to my manually configured <span class="caps">LVM</span>/crypto configuration or an Alpha bug, the two dist-upgrades left me with a system that froze on the Ubuntu boot screen.</p>

<p>Screw it, thought I, and I downloaded and burned a Debian Squeeze installer. There wasn't a heck of a lot of distance between Ubuntu and Debian the way I did it, anyway.</p>

<p>That was when I found out that whatever the problem was with the <span class="caps">USB</span> CD driver, it was something Ubuntu inherited from Debian.</p>

<p>Screw it, thought I, and ripped the one <span class="caps">SATA DVD </span>drive in the house out of its machine and installed it in mine (my current machine has a Zotac Ion mini-ITX motherboard with no <span class="caps">IDE </span>headers.) I started over with Lucid.</p>

<p>Shortly thereafter, I encountered the same X issue. So I had to break down and learn how to map my keyboard in <span class="caps">XKB.</span> If mode_switch and xmodmap are so marginal that a problem of those magnitude can stand, it's probably time to throw in the towel and get with the modern technique.</p>

<p>So after all of that, I'm back on Ubuntu, with no reason I couldn't switch back to Arch, except that all my tolerance for installing OSes has been used up for some months to come.</p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2010/05/why_i_almost_left_ubuntu.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2010/05/why_i_almost_left_ubuntu.html</guid>
         <category></category>
         <pubDate>Wed, 05 May 2010 07:11:17 -0800</pubDate>
      </item>
      
      <item>
         <title>Adventures in Ubuntu Lucid, Mythtv, and the Hauppauge HVR-2250</title>
         <description><![CDATA[<p><a href="http://www.kernellabs.com/hg/saa7164-stable">saa7164-stable</a> won't compile with Lucid's kernel due to some <a href="http://www.mail-archive.com/mythbuntu-bugs@lists.launchpad.net/msg00642.html">name changes</a> in recent kernels. One needs to use <a href="http://kernellabs.com/hg/~stoth/saa7164-dev/">saa7164-dev.</a></p>

<p>Compiling saa7164-dev errors out at first, too. But after <tt>make</tt> creates v4l/.config, you can <a href="http://www.mail-archive.com/ubuntu-devel-discuss@lists.ubuntu.com/msg09422.html">change</a> <span class="caps">CONFIG</span>_DVB_FIREDTV=m to <span class="caps">CONFIG</span>_DVB_FIREDTV=n</p>

<p>The <a href="http://www.linuxtv.org/wiki/index.php/Hauppauge_WinTV-HVR-2200">instructions</a> to extract and install the firmware are <a href="http://www.kernellabs.com/blog/?p=721%23comment-1323">outdated</a> with little attention being called to the fact. Follow the directions to get dvb-fe-tda10048-1.0.fw in the right place, but then download <a href="http://steventoth.net/linux/hvr22xx/firmwares/4038864/v4l-saa7164-1.0.2-3.fw">v4l-saa7164-1.0.2-3.fw</a> and <a href="http://steventoth.net/linux/hvr22xx/firmwares/4038864/v4l-saa7164-1.0.3-3.fw">v4l-saa7164-1.0.3-3.fw</a> directly and save them to /lib/firmware/`uname -r` (or /lib/firmware/2.6.32-20-generic at the moment for an up to date Ubuntu Lucid.) (I've also put all 3 directly in /lib/firmware, but that's probably redundant.)</p>

<p>Once you've gone through all of this, and done a <tt>make install</tt>, <tt>modprobe saa7164</tt> should make your system recognize the card. But the devices are owned by group video, and ordinary users aren't a member of it to start with. so <tt>adduser <em>yourusernamehere</em> video</tt>. (Remember that it won't take effect in existing logins.)</p>

<p>Lucid's mythtv is reasonably up-to-date and I've found no reason so far to seek out a more recent one.</p>

<p>I followed <a href="http://www.mythpvr.com/mythtv/tips/migrate-recordings.html">these instructions</a> to migrate my old mythtv recordings to the new server (I followed the advice in a comment there to use --complete-insert, though it may not have been necessary.)</p>

<p>After installing mythtv, I found that its channel scan was having some trouble finding everything. So I did a <tt>wajig install w-scan dvb-apps</tt>, did a <tt>service mythtv-backend stop</tt> to make sure there was no competition for the card, and:</p>

<p><tt>w_scan -x -f a -c us &gt; w_scan.out<br />
scan w_scan.out &gt; w_scan_channels.conf<br />
scan /usr/share/dvb/atsc/us-CA-SF-Bay-Area &gt; scan_channels.conf<br />
cat w_scan_channels.conf scan_channels.conf|sort|uniq &gt; channels.conf</tt></p>

<p>Then in mythv-setup I pointed it at channels.conf to do its scan.<br />
</tt></p>

<p>mythtv-backend was being started before the devices for the video card had been created, which resulted in errors in the log, though I'm not sure whether the situation was causing any real harm. At any rate, inspired by <a href="http://ubuntuforums.org/showpost.php?p=9040182&amp;postcount=11">this comment</a> I put this in /etc/init/mythtv-backend.conf:</p>

<p><tt># MythTV Backend service</p>

<p>description     "MythTV Backend"<br />
author          "Mario Limonciello <superm1@ubuntu.com>"<br />
# modified per http://swiss.ubuntuforums.org/showthread.php?t=1345079&amp;page=2 to wait for devices<br />
start on (local-filesystems and net-device-up <span class="caps">IFACE</span>=lo and started mysql)<br />
stop on starting shutdown</p>

<p>#expect fork<br />
respawn</p>

<p>pre-start script<br />
        <span class="caps">LOG</span>_FILE=/var/log/mythtv/mythbackend-init.log<br />
        . /etc/mythtv/mysql.txt<br />
	#get the tuner card paths<br />
	<span class="caps">TUNERS</span>=`mysql --user=${DBUserName} --password=${DBPassword} --database=${DBName} --skip-column-names --execute='SELECT <span class="caps">DISTINCT </span>videodevice <span class="caps">FROM </span>capturecard;'`<br />
	echo "`date`: Mythtv-backend Upstart; tuners found in database: ${TUNERS}" &gt;&gt; $LOG_FILE<br />
	for t in $TUNERS<br />
	do<br />
		while [ -c !$t ]; do<br />
		      	echo "`date`: Mythtv-backend Upstart; tuner device ${t} is not ready. Waiting 1 second..." &gt;&gt; $LOG_FILE<br />
			     	      sleep 1s<br />
				      	    done<br />
						echo "`date`: Mythtv-backend Upstart; tuner device ${t} is now ready" &gt;&gt; $LOG_FILE<br />
						done<br />
						echo  "`date`: Mythtv-backend Upstart: tuner devices are now registered. Starting mythbackend" &gt;&gt; $LOG_FILE</p>


<p>end script</p>


<p>script<br />
        test -f /etc/default/mythtv-backend &amp;&amp; . /etc/default/mythtv-backend || true<br />
        /usr/bin/mythbackend $ARGS<br />
end script<br />
</tt></p>

<p>Now all I have to do is find out why there's no sound (probably something independent of mythtv), why, even after all that scanning, it's not finding <span class="caps">KQED </span>(almost certainly having to do with the antenna), and why playing videos in mythfrontend causes the system to reboot after a few seconds (!)</p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2010/04/mythtv_on_ubuntu_lucid_gotchas.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2010/04/mythtv_on_ubuntu_lucid_gotchas.html</guid>
         <category></category>
         <pubDate>Tue, 13 Apr 2010 06:58:31 -0800</pubDate>
      </item>
      
      <item>
         <title><![CDATA[I &hearts; Perl, the command line, and Infocom text adventures]]></title>
         <description><![CDATA[<p>I decided to dust off (literally, it turned out) my Classic Text Adventure Masterpieces CD and install the games. I installed <a href="http://www.ifarchive.org/if-archive/infocom/interpreters/emacs/malyon.el">Malyon,</a> the zcode interpreter for Emacs. But it checks to see that the files end .z3, .z5, or .z8, indicating its zcode version, and all the zcode files from the CD ended .dat. And some of them were version 4, so it would be useful to have them marked correctly so I know which ones Malyon won't handle. The second byte of the file is the version number (and the first byte is guaranteed to be 0), and I wanted to skip the .dat files in 'save' directories, so:</p>

<p><tt>find . -name '*.dat'|fgrep -v '/save/'|xargs perl -e 'for (@ARGV) { $old=$_; read(FH, $buf, 2); $z=unpack "c", $buf; s/dat$/z$z/; rename $old, $_}'</tt></p>

<p>Next thing you know, I'm <a href="http://en.wikipedia.org/wiki/Zork_I#Notes">west of a white house.</a></p>

<p>Short shameful confession: the first Zork is the only Infocom game I ever finished (though I came <em>really</em> close with Hitchhiker's.) So I figure I have my next several years of gaming lined up.</p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2010/03/i_perl_the_command_line_and_in.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2010/03/i_perl_the_command_line_and_in.html</guid>
         <category></category>
         <pubDate>Tue, 16 Mar 2010 07:30:00 -0800</pubDate>
      </item>
      
      <item>
         <title>All Emacs (almost) all the time</title>
         <description><![CDATA[<blockquote><p><a href="http://www.openweblog.com/users/hexmode/535410.html">(For those not so familar with Emacs vs Vi,</a> let's just say this is like the social situation between Republicans and the Democrats or the Roman Catholics and Southern Baptists: You live next door to them, but you know they're going to hell.)</p></blockquote>

<p>Emacs can run in the background as a daemon, so it starts lickety-split when you need to spawn an editor. But what if it's not running yet? I needed a <a href="http://www.zedlopez.com/strangeloopiness/2009/02/new_and_improved_emacs_launche.html">convoluted method</a> for the Emacs 23.0.60 I was running in Ubuntu Intrepid; the Emacs 23.1.1 in Ubuntu Karmic's emacs23 package includes an improved emacsclient that'll launch an emacs daemon for you if you pass it an empty string for the alternative editor (-a parameter).</p>

<p>That's why this goes in /usr/local/bin/editor:</p>

<p><tt>#!/bin/sh<br />
exec emacsclient -c -a "" "$@"</tt></p>

<p>You're going to want to use this as your editor alternative and use that as your <span class="caps">EDITOR </span>environment variable, but there's a problem -- now if you <tt>sudo visudo</tt>, you're launching emacs and you're left with an emacs daemon running as root. Oops.</p>

<p>So you</p>

<p><tt>sudo visudo</tt></p>

<p>and add <tt>!env_editor,editor=/usr/bin/zile</tt> to the end of your <tt>Defaults</tt> line. </p>

<p>Now:</p>

<p><tt>sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/editor 99<br />
cat &gt;&gt; ~/.bashrc<br />
export <span class="caps">EDITOR</span>="/usr/bin/editor"<br />
export <span class="caps">VISUAL</span>="/usr/bin/editor"<br />
export <span class="caps">SUDO</span>_EDITOR="/usr/bin/zile"<br />
</tt></p>

<p>You'll want to be able to kill the emacs daemon, so this goes in /usr/local/bin/killemacs</p>

<p><tt>#!/bin/bash<br />
emacsclient -e "(progn (setq kill-emacs-hook 'nil) (kill-emacs))" &amp;&amp; rm -rf "/tmp/emacs`id -u`"</tt></p>

<p>And you'll want to automatically kill them on shutdown, so here's /etc/init.d/killemacsdaemons:</p>

<p><tt>#!/bin/sh<br />
exec find /tmp -maxdepth 1 -type d -name 'emacs*' -exec find {} -type s -name server \;|perl -ne 's/[^\d]//g; print scalar getpwuid($_), "\n"'|xargs -n 1 su -c /usr/local/bin/killemacs -</tt></p>

<p>Then:</p>

<p><tt>sudo update-rc.d killemacsdaemons stop 1 0 1 6 .</tt></p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2010/03/configuring_editor.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2010/03/configuring_editor.html</guid>
         <category></category>
         <pubDate>Thu, 11 Mar 2010 07:36:12 -0800</pubDate>
      </item>
      
      <item>
         <title>The first n things to do after installing an Ubuntu command-line system, where n is large</title>
         <description><![CDATA[<p>This is my guide to how to install Ubuntu. There aren't many like it, because this one is mine. This is using Karmic and for a single-user computer.</p>

<p>I start with the alternate install <span class="caps">CD, </span>and install a command-line system. There's a lot of talk about how Ubuntu is bloated, which is a little silly, as Ubuntu is not the same thing as the ubuntu-desktop metapackage. The command-line system will leave you with a few things you won't need -- it includes the tools for several filesystems, including <span class="caps">NTFS, </span>and support for various hardware, some of which you won't have. I don't doubt that there are leaner minimalist distributions, but it's a stretch to call this bloated.</p>

<p>Toward keeping it unbloated, the first step is turning off the automatic installation of recommended packages:</p>

<p><tt>echo 'APT::Install-Recommends "false";' | sudo tee &gt; /etc/apt/apt.conf.d/02notrecommended</tt></p>

<p>Then I install the first tools I want:</p>

<p><tt>sudo apt-get install wajig zile</tt></p>

<p>That's the last we'll see of apt-get, as wajig is my preferred front end to the Debian package manager. zile is a small Emacs-workalike. Next, I make sure it gets used whenever anything needs an editor (and that I never, ever get dumped into vi):</p>

<p><tt>sudo update-alternatives --install /usr/bin/vi vi /usr/bin/zile 99<br />
sudo update-alternatives --config editor</tt></p>

<p>The latter will prompt me to choose among installed editors; I pick zile.</p>

<p>Now I'm ready to configure sudo.</p>

<p><tt>sudo visudo</tt><br />
                                               <br />
I add to the line beginning <tt>Defaults        env_reset</tt>, making it:</p>

<p><tt>Defaults        env_reset,insults,!tty_tickets</tt></p>

<p>!tty_tickets makes the sudo timeout global, instead of on a per-session basis, so that if I sudo in one window, and, soon after, sudo in another, I won't have to type my password again. This is very useful. insults means sudo will insult me if I type my password wrong. This isn't useful except inasmuch as it amuses the 12-year-old in me.</p>

<p>Next is configuring my repository sources:</p>

<p><tt>sudo -e /etc/apt/sources.list</tt></p>

<p>This boils down to these four lines, with my <a href="http://www.zedlopez.com/strangeloopiness/2008/09/fastest_ubuntu_mirror_for_you.html">closest mirror</a> substituted for "us.archive.ubuntu.com"</p>

<p><tt>deb http://us.archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse<br />
deb-src http://us.archive.ubuntu.com/ubuntu/ karmic main restricted universe<br />
deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse<br />
deb http://us.archive.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse</tt></p>

<p>plus I keep the default last few lines:</p>

<p><tt>deb http://security.ubuntu.com/ubuntu karmic-security main restricted<br />
deb-src http://security.ubuntu.com/ubuntu karmic-security main restricted<br />
deb http://security.ubuntu.com/ubuntu karmic-security universe<br />
deb-src http://security.ubuntu.com/ubuntu karmic-security universe<br />
deb http://security.ubuntu.com/ubuntu karmic-security multiverse<br />
deb-src http://security.ubuntu.com/ubuntu karmic-security multiverse</tt></p>

<p>I make sure I'm up-to-date:</p>

<p><tt>sudo wajig update<br />
sudo wajig upgrade<br />
sudo wajig dist-upgrade<br />
</tt></p>

<p>Now it's time to install everything related to one of my most important tools, ssh:</p>

<p><tt>sudo wajig install ssh denyhosts molly-guard sshfs yafc keychain<br />
sudo -e /etc/ssh/sshd_config<br />
</tt></p>

<p>I modify /etc/hosts to assign shortcuts to several of my most-used machines.</p>

<p>I set "PermitRootLogin no" (even though I don't have a root password, so no one could login as root anyway), and "PasswordAuthentication no" to disable login by password altogether -- it'll require public key authentication.</p>

<p><tt>sudo adduser zed fuse</tt></p>

<p>sshfs is an amazingly useful tool that lets you mount remote filesystems over ssh so they're transparently accessibly as if they were local. But you have to add yourself to the fuse group (and it won't take until you logout and log back in.) I like to drop this in /usr/local/bin/mkmnt as a convenience to make the mount points I'll use with it:</p>

<p><tt>#!/bin/bash<br />
for i in $@<br />
do<br />
  mkdir /mnt/$i<br />
  chown root:fuse /mnt/$i<br />
  chmod 775 /mnt/$i<br />
done</tt></p>

<p>Finally:</p>

<p><tt>sudo chown root:fuse /mnt</tt><br />
<tt>sudo chmod 775 /mnt</tt></p>

<p>I used to configure denyhosts to make it more restrictive and quicker to ban, but I don't bother anymore. The defaults are reasonable. molly-guard is there to prevent accidentally shutting down or rebooting my machine when I'm logged in remotely. yafc is a much-improved sftp, with tab-completion. And keychain lets me type my ssh private key password just once. I just add this to my .bashrc:</p>

<p><tt>eval `keychain --eval --nogui -Q -q id_rsa`</tt></p>

<p>And I install my private and public keys in my .ssh directory.</p>

<p>Now we're ready to install X.</p>

<p><tt>sudo wajig install hal xorg nvidia-glx-185 nvidia-settings xdm msttcorefonts ttf-liberation ttf-droid xscreensaver</tt></p>

<p>This gets you a whole raft of video and input packages, most of which you don't need, but is a lot faster and easier than picking out the ones you do.</p>

<p>Now it's time to start building packages from source.</p>

<p><tt>sudo wajig install build-essential automake m4 subversion git-core fakeroot checkinstall libtool texinfo texinfo-doc-nonfree manpages-dev<br />
sudo wajig build-depend ratpoison<br />
sudo wajig build-depend rxvt-unicode-ml</tt></p>

<p>I like to do my building from source under /usr/local/src, so I'll make that a little easier:</p>

<p><tt>chmod -R root:admin /usr/local<br />
chown -R 775 /usr/local</tt></p>

<p>First, ratpoison:</p>

<p><tt>cd /usr/local/src<br />
git clone git://git.savannah.nongnu.org/ratpoison.git<br />
cd ratpoison<br />
autoreconf<br />
automake --add-missing<br />
autoreconf<br />
</tt></p>



<p>I put a <a href="http://www.mail-archive.com/ratpoison-devel@nongnu.org/msg00961.html">patch of my own</a> into title_changed.patch, and apply it, then build the Debian package:</p>

<p><tt>patch -p1 &lt; title_changed.patch<br />
fakeroot debian/rules binary</tt></p>

<p>This drops a .deb into /usr/local/src, and I install it:</p>

<p><tt>cd /usr/local/src<br />
sudo wajig install ratpoison_1.4.6~git-0_i386.deb</tt></p>

<p>Next comes rxvt-unicode. I'm still in /usr/local/src...</p>

<p><tt>wget http://dist.schmorp.de/rxvt-unicode/rxvt-unicode-9.07.tar.bz2<br />
tar xjf rxvt-unicode-9.07.tar.bz2<br />
cd rxvt-unicode-9.07<br />
./configure --prefix=/usr<br />
make<br />
sudo checkinstall --fstrans=no<br />
</tt></p>

<p>I use the name 'rxvt-unicode-ml', the same as Ubuntu normally uses for the full rxvt-unicode, the description 'rxvt-unicode-ml', and the version '9.07-1source'. Per the contents of urxvtc's man page, I put this in /usr/local/bin/urxvt:</p>

<p><tt>#!/bin/sh<br />
urxvtc "$@"<br />
if [ $? -eq 2 ]; then<br />
  urxvtd -q -o -f<br />
  urxvtc "$@"<br />
fi<br />
</tt></p>

<p>And that's what I define as my x-terminal-emulator:</p>

<p><tt>sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/local/bin/urxvt 99</tt></p>

<p>Now I can remove xterm. This'll take the xorg metapackage with it, but that's fine -- it's just a metapackage and all the stuff it installed will still be there.</p>

<p><tt>sudo wajig remove xterm</tt></p>

<p>Oh, so close. Now, per the xsession man page, I put this in /etc/X11/Xsession.d/35&#215;11-custom_xmodmap --</p>

<p><tt><span class="caps">SYSMODMAP</span>="/etc/X11/Xmodmap"<br />
<span class="caps">USRMODMAP</span>="$HOME/.xmodmap"</p>

<p>if [ -x /usr/bin/X11/xmodmap ]; then<br />
 if [ -f "$SYSMODMAP" ]; then<br />
   xmodmap "$SYSMODMAP"<br />
 fi<br />
 if [ -f "$USRMODMAP" ]; then<br />
  xmodmap "$USRMODMAP"<br />
 fi<br />
fi<br />
</tt></p>

<p>Then I populate /etc/X11/Xmodmap, ~/.Xresources, .ratpoisonrc, and put this in .xsession:</p>

<p><tt>xscreensaver-command -exit<br />
xscreensaver &amp;<br />
x-window-manager<br />
</tt></p>

<p>And now we're ready to run X. It's that easy.</p>

<p><tt>sudo invoke-rc.d xdm start</tt></p>

<p>I edit .xscreensaver to set 'splash: False', and run</p>

<p><tt>xscreensaver-demo</tt></p>

<p>so I can set the Mode to 'Blank Screen Only', turn on Display Power Management, and turn off 'Fade to Black when Blanking'. There are many beautiful xscreensaver hacks, but some of them create appreciable system load. I'm running it for security.</p>

<p><span class="caps">OK, </span>now for some miscellany. apt-file can do some tricks wajig can't.</p>

<p><tt>sudo wajig install apt-file<br />
sudo apt-file update</tt></p>

<p><tt>most</tt> is my preferred pager.</p>

<p><tt>sudo wajig install most<br />
sudo update-alternatives --config pager</tt></p>

<p>Really, the whole point of the exercise is Emacs.</p>

<p><tt>sudo wajig install emacs23 emacs-goodies-el python-mode yaml-mode</tt></p>

<p>I like Ruby, Perl, and Nethack. Someday I will ascend.</p>

<p><tt>sudo wajig install ruby-full ruby-elisp rubygems perl-doc nethack-el</tt></p>

<p>Some other important command-line tools:</p>

<p><tt>sudo wajig install screen ack-grep</tt></p>

<p>ack-grep's intended name is ack, but that's taken in the Debian world, so I uncomment this in the default .bashrc:</p>

<p><tt>if [ -f ~/.bash_aliases ]; then<br />
    . ~/.bash_aliases<br />
fi</tt></p>

<p>And into .bash_aliases goes:</p>

<p><tt>alias ack="ack-grep"</tt></p>

<p>Being able to unpack things is good:</p>

<p><tt>sudo wajig install atool unrar unzip</tt></p>

<p>Put this in ~/.atoolrc:</p>

<p><tt>use_rar_for_unpack 0</tt></p>

<p>The web is pretty important:</p>

<p><tt>sudo wajig install firefox epdfview privoxy</tt></p>

<p>Privoxy is a filtering web proxy.</p>

<p><tt>cd /tmp<br />
wget http://neilvandyke.org/privoxy-rules/neilvandyke.action<br />
sudo mv /tmp/neilvandyke.action /etc/privoxy<br />
sudo -e /etc/privoxy/config<br />
</tt></p>

<p>Between actionsfile default.action and actionsfile user.action, I add:</p>

<p><tt>actionsfile neilvandyke.action</tt></p>

<p>In user.action, I add some more sites, as well as define some sites on which to not block ads.</p>

<p>I get the Flash 10.1 beta:</p>

<p><tt>cd /tmp<br />
wget http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_1_p3_linux_022310.tar.gz<br />
tar xzf flashplayer10_1_p3_linux_022310.tar.gz<br />
mkdir ~/.mozilla/plugins<br />
mv libflashplayer.so ~/.mozilla/plugins<br />
</tt></p>

<p>Sound starts out set to zero, so I need alsamixer to turn it up:</p>

<p><tt>sudo wajig install alsa-utils<br />
alsamixer</tt></p>

<p>Get and install the forbidden packages:</p>

<p><tt><br />
cd /tmp<br />
wget http://packages.medibuntu.org/pool/non-free/w/w32codecs/w32codecs_20071007-0medibuntu5_i386.deb<br />
wget http://packages.medibuntu.org/pool/free/libd/libdvdcss/libdvdcss2_1.2.10-0.3medibuntu1_i386.deb<br />
sudo wajig install w32codecs_20071007-0medibuntu5_i386.deb<br />
sudo wajig install libdvdcss2_1.2.10-0.3medibuntu1_i386.deb<br />
</tt></p>

<p><a href="http://venutip.com/content/installing-vista-fonts-ubuntu">Install the fonts from Powerpoint.</a> </p>

<p>Monitoring is good. This includes:</p>

<p><tt>sudo wajig install lm-sensors htop iftop iotop hddtemp smartmontools</tt></p>

<p>Virtual machines are fun.</p>

<p><tt>sudo wajig install qemu kvm</tt></p>

<p>Downloader helpers.</p>

<p><tt>sudo wajig install transmission-cli axel</tt></p>

<p>Multimedia.</p>

<p><tt>sudo wajig install mplayer-nogui flac vorbis-tools vorbisgain feh</tt></p>

<p>Into every life some Microsoft Word docs must fall.</p>

<p><tt>sudo wajig install antiword</tt></p>

<p>Keep the computer time synced with atomic clocks:</p>

<p><tt>sudo wajig install ntp</tt><br />
<tt>sudo -e /etc/ntp.conf</tt></p>

<p>I remove the 'server ntp.ubuntu.com' line and replace it with:</p>

<p><tt>server 0.north-america.pool.ntp.org<br />
server 1.north-america.pool.ntp.org<br />
server 2.north-america.pool.ntp.org<br />
server 3.north-america.pool.ntp.org<br />
</tt></p>

<p>I like TeX, and LaTeX, and ConTeXt and printing things.</p>

<p><tt>sudo wajig install context texlive-latex-extra gv texlive-latex-extra-doc texlive-latex-base-doc cups-client texlive-latex-recommended texlive-latex-recommended-doc</tt></p>

<p>That may seem like a lot, and it is, but it's still not much compared to texlive-full.</p>

<p>I just need a client to a Cups server running elsewhere on my local network, so I just need to populate /etc/cups/client.conf:</p>

<p><tt>ServerName hostname_of_cups_server</tt></p>

<p>I want to access a Samba server on my local network, so:</p>

<p><tt>sudo wajig install smbfs<br />
mkmnt smbmountpoint<br />
</tt></p>

<p>I add this to /etc/fstab:</p>

<p>//smbhostname/Volume_1 /mnt/smbmountpoint cifs credentials=/etc/smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0</p>

<p>/etc/smbcredentials is of the form:</p>

<p><tt>username=smbusername<br />
password=smbpassword</tt></p>

<p>Then I just:</p>

<p><tt>sudo mount -a</tt></p>

<p>I've skimped on configuring Firefox, Emacs, urxvt, and on talking about the contents of my .Xresources, .Xmodmap, and .ratpoisonrc, as well as the other little scripts I put in /usr/local/bin. Maybe next time.</p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2010/03/what_i_do_after_installing_ubu.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2010/03/what_i_do_after_installing_ubu.html</guid>
         <category></category>
         <pubDate>Sun, 07 Mar 2010 21:09:26 -0800</pubDate>
      </item>
      
      <item>
         <title>Manually mounting whole disk encryted drive</title>
         <description><![CDATA[<p>The Debian installer (which I've been using with the Ubuntu Alternate Install CD for years) makes it easy to set up whole disk crypto with cryptsetup, <span class="caps">LUKS, </span>and <span class="caps">LVM.</span> So easy that it's easy to forget how to get to the info when you're not longer booting the disk, but are accessing it in an external drive. So here's a reminder of how to do it when it's <span class="caps">LVM </span>over a <span class="caps">LUKS </span>encrypted partition. <tt>ls dev</tt> or <tt>dmesg</tt> to get the device name of the encrypted partition. Let's say it was <tt>/dev/sdb1</tt>.</p>

<p><tt>sudo cryptsetup luksOpen /dev/sdb1 arbitraryname</tt></p>

<p><tt>sudo lvscan</tt></p>

<p>This'll give you the name of the logical volumes as they were originally set up. Let's say the one you're interested in was <tt>/dev/myvolumegroup/root</tt>.</p>

<p>You're almost there; all you have to do is make a mount point, e.g., <tt>/mnt/lvroot</tt> and:</p>

<p><tt>sudo mount /dev/myvolumegroup/root /mnt/lvroot</tt></p>

<p>Ta da.</p>

<p><b>Updated:</b> One may have to load some kernel modules before the luksOpen, e.g., </p>

<p><tt>modprobe dm_mod<br />
modprobe dm_crypt<br />
modprobe aes</tt></p>

<p>And mark the logical volume and/or volume group active:</p>

<p><tt>lvchange -ay logical_volume_name<br />
vgchange -ay volume_group_name</tt></p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2010/02/manually_mounting_whole_disk_e.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2010/02/manually_mounting_whole_disk_e.html</guid>
         <category></category>
         <pubDate>Sat, 27 Feb 2010 15:12:20 -0800</pubDate>
      </item>
      
      <item>
         <title>Chromium: useless (to me, for now)</title>
         <description><![CDATA[<p>I've been frustrated with Firefox grinding to a halt over time, and needing restarting. I've heard tell that Google's <a href="http://www.chromium.org/">Chromium browser</a> is much faster on Linux, so I thought I'd try it.</p>

<p>It took as long as the first time I tried to type something in a text field to be bit by <a href="http://code.google.com/p/chromium/issues/detail?id=24583">this bug.</a> The X Window System supports essentially a second shift key, called mode_switch. The other keys can have different definitions for all four of their unmodified, shifted, mode_switched, and shifted <em>and</em> mode_switched meanings. </p>

<p>So far as I know, most distributions don't do anything with them by default, but I use them extensively to provide, among other things, a set of cursor keys under my fingertips, without requiring moving my hands. </p>

<p>In Chromium, it's as if mode_switch is being held down all the time, so those keys can <em>only</em> produce the cursor movement, and not their normal text values, leaving me with half my keyboard missing.</p>

<p>A developer has marked it WontFix, saying it was a gtk problem that's been fixed in more recent versions. It's a problem that doesn't occur in any other gtk app; the gtk bug the developer cited as responsible is clearly unrelated; and I tried updating my gtk with no effect.</p>

<p>I'll try delving into the code myself, but <a href="http://www.zedlopez.com/strangeloopiness/2008/09/xterm_made_easy.html">this</a> is the extent of my gtk experience.</p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2010/01/chromium_useless_to_me_for_now.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2010/01/chromium_useless_to_me_for_now.html</guid>
         <category></category>
         <pubDate>Sat, 02 Jan 2010 12:50:14 -0800</pubDate>
      </item>
      
      <item>
         <title>Civilization in Wine on Linux. How civilized.</title>
         <description><![CDATA[<p>I have the Civilization IV: the Complete Edition <span class="caps">DVD </span>sans <span class="caps">DRM.</span> It works pretty well under Wine. But this is what it took (Ubuntu 8.10, aka Intrepid):</p>

<p>I find it makes life easier to segregate my Wine apps, so first steps were:</p>


<pre>export WINEPREFIX=/usr/local/civ
winecfg</pre>



<p>There, I set Wine to also consider /usr/local/civ to be where my My Documents folder was, so the game would create its "My Games" folder there instead of under my real Linux home directory.</p>

<p><a href="http://wine.budgetdedicated.com/archive/ubuntu/intrepid/wine_1.1.22~winehq0~ubuntu~8.10-0ubuntu1_i386.deb">Wine 1.1.22.</a> It failed with Wine 1.1.23, the current development release.<br />
Used <a href="http://winezeug.googlecode.com/svn/trunk/winetricks">winetricks</a> to install d3dx9 and msxml3<br />
Needed <a href="http://ubuntuforums.org/showthread.php?t=282051">this</a> to get around a stupid sound bug:</p>



<pre>mkdir -pv $HOME/.kde/socket-$HOSTNAME</pre>



<p>Then just running </p>

<pre>wine setup.exe</pre>

<p> on the file at the top level of the <span class="caps">DVD </span>did the rest. I selected "custom install" so I could set a less long, obnoxious installation path than the default. I installed the just-released <a href="http://www.firaxis.com/downloads/Patch/Civ4BeyondTheSwordPatch3.19.exe">Beyond the Sword 3.19 patch.</a></p>

<p>I put <a href="http://www.civfanatics.net/bluemarble/content/index.php">Blue Marble</a> on top of that, and ran vanilla Civ, Warlords, Beyond the Sword, and Colonization once each to create the appropriate folders under My Games, and to set the graphics and audio options to my preferences.</p>

<p>I edited each of the CivilizationIV.ini files in their respective directories under the installation directories to set NoIntroMovie = 1 and EnableVoice = 0. (The first is just by preference; the intro movies worked fine. The default EnableVoice = 1 resulted in a warning under Warlords, but not the others. Strange.) It didn't work to set these just in the CivilizationIV.ini files under My Games, which I would have thought was the point.</p>

<p>Finally, I backed up the results so I won't have to do all that again when I inevitably screw something up while playing with <a href="http://forums.civfanatics.com/downloads.php?do=cat&amp;id=1">mods.</a></p>

<p>The startup scripts are simply like this:</p>


<pre>#!/bin/bash
WINEPREFIX=/usr/local/civ 
/usr/bin/wine /usr/local/civ/drive_c/Program\ Files/civ4complete/Civilization4.exe $@</pre>



<p>Everything but a few cosmetic details works. Unit health bars don't, city progress bars on the main map don't (this can be ameliorated by requesting detailed city info in the options), the cursor animation doesn't work, so it doesn't turn into a little spinning globe when you're waiting. So far as I can tell, everything else works. (And my words are backed by a Holy Roman spaceship at Alpha Centauri.)</p>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2009/06/civilization_in_wine_on_linux.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2009/06/civilization_in_wine_on_linux.html</guid>
         <category></category>
         <pubDate>Sun, 14 Jun 2009 17:21:31 -0800</pubDate>
      </item>
      
      <item>
         <title>Ruby string escaping weirdness</title>
         <description><![CDATA[<p>Well, that's odd... (ruby 1.8.7)</p>



<pre>
irb(main):021:0&gt; '\\' + 'x'
=&gt; &quot;\\x&quot;
irb(main):022:0&gt; &quot;x&quot;.gsub(&quot;x&quot;,'\\' + 'x')
=&gt; &quot;\\x&quot;
irb(main):023:0&gt; '\\' + '&amp;'
=&gt; &quot;\\&amp;&quot;
irb(main):024:0&gt; &quot;&amp;&quot;.gsub(&quot;&amp;&quot;,'\\' + '&amp;')
=&gt; &quot;&amp;&quot;
</pre>]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2009/06/ruby_string_escaping_weirdness.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2009/06/ruby_string_escaping_weirdness.html</guid>
         <category></category>
         <pubDate>Fri, 12 Jun 2009 18:36:15 -0800</pubDate>
      </item>
      
      <item>
         <title>Recycling Palms as secondary LCD displays</title>
         <description><![CDATA[<p>Recently, I&#8217;ve had a crush on the computer lcd front panel displays you can find <a href="http://www.crystalfontz.com/products/index-usb.html">here</a> or <a href="http://www.matrixorbital.com/">here</a>. But they&#8217;re either tiny or expensive.</p>

<p>I remembered a project to let you use a Palm in its cradle as an LCD display. <a href="http://palmorb.sourceforge.net/">PalmOrb</a> has been orphaned since 2005, and, as of the last version, indicates you&#8217;re on your own with USB Palms (which are the only ones I have left.) It actually worked decently with <a href="http://ssl.bulix.org/projects/lcd4linux/">LCD4Linux</a>. But it only left you with a tiny block of text, and it was harder than I&#8217;d like to customize the output.</p>

<p>So I tried simply running <a href="http://netpage.estaminas.com.br/mmand/ptelnet.htm">ptelnet</a>, a Palm telnet app, to make a serial connection, and running a script that wrote to /dev/pilot (I had the visor module loaded), clearing the screen every minute (with VT100 escape codes) and sending status info.</p>

<p>It works pretty well, but the text is tiny, with no way to change the size. Anyone know of an alternative to ptelnet to just receive data from the serial connection and display it, that allows you to change fonts?</p>
]]></description>
         <link>http://www.zedlopez.com/strangeloopiness/2009/03/recycling_palms_as_secondary_l.html</link>
         <guid>http://www.zedlopez.com/strangeloopiness/2009/03/recycling_palms_as_secondary_l.html</guid>
         <category></category>
         <pubDate>Tue, 03 Mar 2009 10:14:14 -0800</pubDate>
      </item>
      
   </channel>
</rss>
