<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Strange Loopiness</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/" />
    <link rel="self" type="application/atom+xml" href="http://www.zedlopez.com/strangeloopiness/atom.xml" />
   <id>tag:www.zedlopez.com,2009:/strangeloopiness//2</id>
    <link rel="service.post" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2" title="Strange Loopiness" />
    <updated>2009-06-15T01:58:49Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.12</generator>
 

<entry>
    <title>Civilization in Wine on Linux. How civilized.</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2009/06/civilization_in_wine_on_linux.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=3161" title="Civilization in Wine on Linux. How civilized." />
    <id>tag:www.zedlopez.com,2009:/strangeloopiness//2.3161</id>
    
    <published>2009-06-15T00:21:31Z</published>
    <updated>2009-06-15T01:58:49Z</updated>
    
    <summary>I have the Civilization IV: the Complete Edition DVD sans DRM. It works pretty well under Wine. But this is what it took (Ubuntu 8.10, aka Intrepid): I find it makes life easier to segregate my Wine apps, so first...</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![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>]]>
        
    </content>
</entry>

<entry>
    <title>Ruby string escaping weirdness</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2009/06/ruby_string_escaping_weirdness.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=3159" title="Ruby string escaping weirdness" />
    <id>tag:www.zedlopez.com,2009:/strangeloopiness//2.3159</id>
    
    <published>2009-06-13T01:36:15Z</published>
    <updated>2009-06-13T01:38:21Z</updated>
    
    <summary><![CDATA[Well, that's odd... (ruby 1.8.7) 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;...]]></summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![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>]]>
        
    </content>
</entry>

<entry>
    <title>Recycling Palms as secondary LCD displays</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2009/03/recycling_palms_as_secondary_l.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=3137" title="Recycling Palms as secondary LCD displays" />
    <id>tag:www.zedlopez.com,2009:/strangeloopiness//2.3137</id>
    
    <published>2009-03-03T18:14:14Z</published>
    <updated>2009-03-03T18:41:32Z</updated>
    
    <summary>Recently, I&#8217;ve had a crush on the computer lcd front panel displays you can find here or here. But they&#8217;re either tiny or expensive. I remembered a project to let you use a Palm in its cradle as an LCD...</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![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>
]]>
        

    </content>
</entry>

<entry>
    <title>New and improved emacs launcher</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2009/02/new_and_improved_emacs_launche.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=3134" title="New and improved emacs launcher" />
    <id>tag:www.zedlopez.com,2009:/strangeloopiness//2.3134</id>
    
    <published>2009-02-13T15:02:30Z</published>
    <updated>2009-02-13T20:11:15Z</updated>
    
    <summary><![CDATA[I'm much happier with this combination. /usr/local/bin/editor is: #!/bin/bash ALTERNATE_EDITOR=/usr/local/bin/editor2 emacsclient -c &quot;$*&quot; /usr/local/bin/editor2 is: #!/bin/bash EMACS=/usr/bin/emacs EMACSCLIENT=/usr/bin/emacsclient SOCKET=/tmp/emacs`id -u`/server $EMACS --daemon count=25 while [ $[ count-- ] -gt 0 ]; do if [ -e $SOCKET ] &amp;&amp; [ !...]]></summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![CDATA[<p>I'm much happier with this combination. /usr/local/bin/editor is:</p>

<code>
#!/bin/bash
ALTERNATE_EDITOR=/usr/local/bin/editor2 emacsclient -c &quot;$*&quot;
</code>

<p>/usr/local/bin/editor2 is:<br />
#!/bin/bash<br />
<span class="caps">EMACS</span>=/usr/bin/emacs<br />
<span class="caps">EMACSCLIENT</span>=/usr/bin/emacsclient<br />
<span class="caps">SOCKET</span>=/tmp/emacs`id -u`/server</p>

<p>$EMACS --daemon</p>

<p>count=25</p>

<p>while [ $[ count-- ] -gt 0 ]; do<br />
  if [ -e $SOCKET ] &amp;&amp; [ ! (lsof $SOCKET &amp;&gt; /dev/null) ]; then <br />
      $EMACSCLIENT -c "$*"<br />
      break<br />
  fi<br />
  sleep .2<br />
done<br />
</code></p>

<p>Among the advantages here over the old one:</p>

<p>emacs --daemon is only run if emacsclient can't find a socket, as opposed to emacsclient encountering any error</p>

<p>The old one slept for 1 second after launching the daemon. This was occasionally too short, but usually too long. This one checks for the socket five times a second, and gives up after five seconds. (There are imaginable race conditions that could give undesirable results, but I don't expect to ever actually encounter them.)</p>]]>
        
    </content>
</entry>

<entry>
    <title>Daemon Emacs</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2009/02/daemon_emacs.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=3128" title="Daemon Emacs" />
    <id>tag:www.zedlopez.com,2009:/strangeloopiness//2.3128</id>
    
    <published>2009-02-03T22:24:51Z</published>
    <updated>2009-02-03T22:47:41Z</updated>
    
    <summary>A nifty feature in the current development version of Emacs (now available in a pretest release candidate) is that you can start it as a daemon, to which graphical and terminal clients alike can attach. A not so nifty lack...</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![CDATA[<p>A nifty feature in the current development version  of Emacs (now available in a <a href="http://alpha.gnu.org/gnu/emacs/pretest/">pretest</a> release candidate) is that you can <a href="http://www.emacswiki.org/emacs/EmacsAsDaemon">start it as a daemon</a>, to which graphical and terminal clients alike can attach. A not so nifty lack of feature is there being no easy standard way to do the obvious: launch a client if the daemon's running; if it's not, start the daemon, and then launch the client. So everyone cobbles together their own. Here's mine, which cribs from <a href="http://remi.vanicat.free.fr/blog/index.php/general/2008/03/21/trying-to-launch-emacs-only-when-needed/">here.</a></p>

<p><tt>#!/bin/bash<br />
if [ -z $DISPLAY ] ; then<br />
  <span class="caps">OPT</span>="-t"<br />
else<br />
  <span class="caps">OPT</span>="-c"<br />
fi</p>

<p>if [ -z "$*" ]; then<br />
  <span class="caps">OPT</span>="$OPT -e (raise-frame)"<br />
else<br />
  <span class="caps">OPT</span>="$OPT $@"<br />
fi<br />
emacsclient $OPT 2&gt;/dev/null || (<br />
	(emacs --daemon)<br />
	sleep 1<br />
	emacsclient $OPT)</tt></p>

<p>I have that as /usr/local/bin/editor. To stop emacs nicely, and get prompted to save unfinished business, I have another script with:</p>

<p><tt>/usr/local/bin/editor -e '(save-buffers-kill-emacs)'</tt></p>]]>
        
    </content>
</entry>

<entry>
    <title>My own virtual Ubuntu Intrepid</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2008/10/my_own_virtual_ubuntu_intrepid.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=3099" title="My own virtual Ubuntu Intrepid" />
    <id>tag:www.zedlopez.com,2008:/strangeloopiness//2.3099</id>
    
    <published>2008-10-14T05:11:57Z</published>
    <updated>2008-10-14T05:36:59Z</updated>
    
    <summary> Make sure your CPU supports virtualization (you may have to turn it on in the BIOS) cat /proc/cpuinfo |egrep &apos;(svm|vmx)&apos; If you get no response, it doesn&apos;t. A response means you&apos;re good to go. Download the Ubuntu Intrepid Beta...</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![CDATA[<ol>
<li><p>Make sure your CPU supports virtualization (you may have to turn it on in the BIOS)</p>

<p><code>cat /proc/cpuinfo |egrep '(svm|vmx)'</code></p>

<p>If you get no response, it doesn't. A response means you're good to go.</p></li>
<li><p>Download the Ubuntu Intrepid Beta alternate install CD</p></li>
<li><p>install qemu and kvm</p>

<p><code>sudo apt-get install qemu kvm</code></p></li>
<li><p>create the disk image that will serve as the virtualized intrepid's hard drive</p>

<p><code>qemu-img create -f qcow2 intrepid.img 6G</code></p></li>
<li><p>start the vm, booting the Intrepid CD</p>

<p><code>sudo kvm -cdrom ubuntu-8.10-beta-alternate-i386.iso -hda intrepid.img -boot d -m 256M</code></p></li>
<li><p>Hit F4 to choose a command-line install; go through the installation.</p></li>
<li><p>When the installation finishes and reboots, kill the VM. Restart it with:</p>

<p><code>sudo kvm -hda qemu/intrepid.img -boot c -m 256M -redir tcp:2222::22 &amp;</code></p></li>
<li><p>In the VM, turn off apt-get automatically installing recommended packages</p>

<p><code>echo  'APT::Install-Recommends "false";'|sudo tee /etc/apt/apt.conf</code></p></li>
<li><p>In the VM, Edit /etc/apt/sources.list to point to the closest mirror</p></li>
<li><p>In the VM, Bring yourself up-to-date and install openssh-server</p>

<p><code>sudo apt-get update
sudo apt-get upgrade
sudo apt-get install openssh-server</code></p></li>
<li><p>On your real machine, ssh into the VM.</p>

<p><code>ssh -p 2222 username@localhost</code></p></li>
<li><p>Have fun with your new virtual Intrepid.</p></li>
</ol>
]]>
        

    </content>
</entry>

<entry>
    <title>xterm made easy</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2008/09/xterm_made_easy.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=3096" title="xterm made easy" />
    <id>tag:www.zedlopez.com,2008:/strangeloopiness//2.3096</id>
    
    <published>2008-09-22T14:12:29Z</published>
    <updated>2008-09-22T16:25:44Z</updated>
    
    <summary>I&#8217;m a fan of the rxvt-unicode terminal emulator, but it has one problem: it sometimes spaces xft fonts badly, with conspicuous gaps between the characters, making for fewer characters per line. Looking into alternatives, I found that the GTK library...</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![CDATA[<p>I&#8217;m a fan of the <a href="http://software.schmorp.de/pkg/rxvt-unicode.html">rxvt-unicode</a> terminal emulator, but it has one problem: it sometimes spaces xft fonts badly, with conspicuous gaps between the characters, making for fewer characters per line.</p>

<p>Looking into alternatives, I found that the GTK library includes vte, a terminal emulator widget that a <a href="http://www.calno.com/evilvte/">bunch of terminal emulators</a> use. And they all look good, but had a drawback I couldn&#8217;t live with: none of the ones I tried recognized my Meta-keys, which I&#8217;ve grown used to using for command-line editing in my shell.</p>

<p>vte, along with the Ruby GTK bindings, makes life so easy, I just rolled my own. This is just the Ruby vte demo program that comes with the bindings with a couple of lines added to handle Meta-keys.</p>

<pre><code>require "vte"

window = Gtk::Window.new("Terminal sample")
window.signal_connect("destroy"){Gtk.main_quit}

vte = Vte::Terminal.new
vte.set_font("DejaVu Sans Mono 16", Vte::TerminalAntiAlias::FORCE_ENABLE)

Gtk.key_snooper_install {|t, e| 
  vte.feed_child("\e")  if e.state.meta_mask? and e.event_type == Gdk::Event::KEY_PRESS
}

vte.signal_connect("child-exited") do |widget|
  Gtk.main_quit
end
vte.signal_connect("window-title-changed") do |widget|
  window.title = vte.window_title
end
vte.fork_command
window.add(vte)
window.show_all

Gtk.main
</code></pre>
]]>
        

    </content>
</entry>

<entry>
    <title>Fastest Ubuntu mirror for you</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2008/09/fastest_ubuntu_mirror_for_you.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=3093" title="Fastest Ubuntu mirror for you" />
    <id>tag:www.zedlopez.com,2008:/strangeloopiness//2.3093</id>
    
    <published>2008-09-17T02:18:20Z</published>
    <updated>2008-09-17T05:50:11Z</updated>
    
    <summary>I recently learned about netselect-apt, a Debian package to find the fastest Debian mirror. Ubuntu Hardy includes it, but it&apos;s worse than useless -- it&apos;s still hard-coded to work with Debian. But it&apos;s easy enough to reproduce its essential functionality....</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![CDATA[<p>I recently learned about <a href="http://www.debiantoday.com/get-more-from-apt/">netselect-apt</a>, a Debian package to find the fastest Debian mirror. Ubuntu Hardy includes it, but it's worse than useless -- it's still hard-coded to work with Debian. But it's easy enough to reproduce its essential functionality.</p>

<p><tt>
sudo apt-get install netselect<br />
wget --no-check-certificate -O mirrors https://launchpad.net/ubuntu/+archivemirrors<br />
sudo netselect -v -s 5 $(perl -F'"' -ane 'print "$F[1] " if (/United States/ .. /highlighted/) &amp;&amp; /http/' mirrors)<br />
</tt></p>

<p>That gives the top 5 (from fastest to slowest) in the US using http. It should be reasonably clear how to adjust the number returned, the country, or the protocol (which could be 'ftp' or 'rsync'.) It erroneously considers canonical.com a mirror in Viet Nam (it fails to find the end correctly for the last country in the list), but there's only one mirror in Viet Nam, and this is a quick hack, so I can live with that.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>PDF Viewer</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2008/06/pdf_viewer.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=2040" title="PDF Viewer" />
    <id>tag:www.zedlopez.com,2008:/strangeloopiness//2.2040</id>
    
    <published>2008-06-19T05:16:27Z</published>
    <updated>2008-06-19T05:52:33Z</updated>
    
    <summary>I don&apos;t use a desktop environment; I use an antidesktop environment featuring the ultra-minimalist ratpoison window manager and the ultra-maximalist Emacs. It makes me grumpy when applications depend on installing huge portions of Gnome or KDE. So I was never...</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![CDATA[<p>I don't use a <a href="http://en.wikipedia.org/wiki/Desktop_environment">desktop environment;</a> I use an <a href="http://freshmeat.net/articles/view/581/">antidesktop environment</a> featuring the ultra-minimalist <a href="http://ratpoison.antidesktop.net">ratpoison</a> window manager and the ultra-maximalist <a href="http://emacswiki.org">Emacs.</a></p>

<p>It makes me grumpy when applications depend on installing huge portions of Gnome or <span class="caps">KDE.</span> So I was never thrilled with the <span class="caps">PDF </span>viewer choices.</p>

<p><a href="http://pages.cs.wisc.edu/~ghost/">ghostview</a> and <a href="http://www.foolabs.com/xpdf/">xpdf</a> are good tools, but ugly, and they don't natively talk to <span class="caps">CUPS </span>print servers. evince and kpdf want to install huge portions of Gnome and <span class="caps">KDE, </span>respectively. I haven't tried acroread, but I scramble for alternative's to Adobe's bloated reader in Windows, so I thought I'd spare myself.</p>

<p>So I was happy to find <a href="http://www.emma-soft.com/eblog/category/epdfview/">epdfview,</a> which shares some of evince's dependencies on graphics libraries without the gratuitous dependencies.</p>

<p>But there was a catch: Ubuntu 8.04's binary package doesn't include <span class="caps">CUPS </span>support, for no apparent reason (there's already a <a href="https://bugs.launchpad.net/ubuntu/+source/epdfview/+bug/239459">bug</a> filed.) The good news is that you can build it yourself.</p>

<p>So I'm now a happy viewer and printer of <span class="caps">PDF</span>s while still avoiding having dbus, gamin, bonobo, etc., installed.</p>]]>
        
    </content>
</entry>

<entry>
    <title>First look at Ubuntu Gutsy Beta</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2007/10/first_look_at_ubuntu_gutsy_bet_1.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=1947" title="First look at Ubuntu Gutsy Beta" />
    <id>tag:www.zedlopez.com,2007:/strangeloopiness//2.1947</id>
    
    <published>2007-10-04T13:56:56Z</published>
    <updated>2007-10-04T19:50:46Z</updated>
    
    <summary>The forthcoming Ubuntu release, 7.10, the Gutsy Gibbon, is scheduled for release next month, 10/18. I recently tried installing it, and quickly encountered this bug, reported as fixed yesterday. Ubuntu had inherited from Debian a problem whereby network interfaces&apos; names...</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![CDATA[<p>The forthcoming Ubuntu release, <a href="http://www.ubuntu.com/testing/gutsybeta">7.10, the Gutsy Gibbon,</a> is <a href="https://wiki.ubuntu.com/GutsyReleaseSchedule">scheduled for release</a> next month, 10/18. I recently tried installing it, and quickly encountered <a href="https://bugs.launchpad.net/ubuntu/+source/udev/+bug/145382">this bug,</a> reported as fixed yesterday.</p>

<p>Ubuntu had inherited from Debian a <a href="http://www.debian-administration.org/articles/502">problem</a> whereby  network interfaces' names can be inconsistent from one reboot to the next. The installer identified my mobo's wired network interface as eth1. On rebooting, the OS decided it was eth2, but /etc/network/interfaces had been configured to use the (now non-existent) eth1, hence no network.</p>

<p>In days' past, I've used <a href="http://www.stuvel.eu/archive/26/ethernet-numbering-in-ubuntu">/etc/iftab</a> to ensure it didn't recur, but, apparently, <a href="https://wiki.ubuntu.com/BugSquad">as of Gutsy,</a> this approach is deprecated, and the shiny new method is to use <a href="http://obsidianlake.blogspot.com/2007/08/persistent-network-interfaces-eth.html">udev.</a></p>

<p>I then spent much time bashing my head against trying to arrange to boot into an encrypted root filesystem within an <a href="http://tldp.org/HOWTO/LVM-HOWTO/whatislvm.html"><span class="caps">LVM2</span></a> logical volume on an encrypted <a href="http://luks.endorphin.org/"><span class="caps">LUKS</span></a> partition, similar to <a href="https://help.ubuntu.com/community/EncryptedFilesystemLVMHowto?highlight=%28encryptedfilesystem%29">this</a> but using <a href="http://yaird.alioth.debian.org/">yaird</a> to create the boot image. This is something I've done in the current Ubuntu release, Feisty. But I ran into a <a href="https://bugs.launchpad.net/ubuntu/+source/yaird/+bug/148727">couple</a> of <a href="https://bugs.launchpad.net/ubuntu/+source/yaird/+bug/148724">bugs</a> in Gutsy's yaird package. (The trivial one also existed in Feisty, but I didn't report it then.)</p>

<p>It'd be nice if Ubuntu offered an encrypted root installation option like <a href="http://www.debian.org/releases/stable/i386/ch06s03.html.en">Debian Etch,</a> but I'd probably want enough things different from any set of options offered to end up doing it manually anyway.</p>

<p>I'm pretty sure I know how to fix the problem now. But I haven't had the time to take another crack at it, so my first look has been stalled here.</p>

<p>Maybe when I'm done, I'll write <a href="https://help.ubuntu.com/community/?action=fullsearch&amp;value=encryptedfilesystem&amp;titlesearch=Titles">yet another encrypted root howto.</a></p>]]>
        
    </content>
</entry>

<entry>
    <title>Seeking Random Numbers. Must pass Chi-Square test. No freaks.</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2007/07/seeking_random_numbers_must_pa.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=1936" title="Seeking Random Numbers. Must pass Chi-Square test. No freaks." />
    <id>tag:www.zedlopez.com,2007:/strangeloopiness//2.1936</id>
    
    <published>2007-07-03T14:18:50Z</published>
    <updated>2007-07-03T15:33:59Z</updated>
    
    <summary>Pocahontas had some little webcam she&apos;d gotten a while ago as a promo item for signing up with an ISP. For a while, I&apos;ve had in the back of my mind to use it to build a LavaCan. Because, you...</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![CDATA[<p>Pocahontas had some little webcam she'd gotten a while ago as a promo item for signing up with an <span class="caps">ISP.</span> For a while, I've had in the back of my mind to use it to build a <a href="http://www.lavarnd.org/what/process.html">LavaCan.</a> Because, you know, every home needs a cryptographically secure source of random numbers in hardware. Well, it seems like people were lucky to get this camera working with an allegedly <a href="http://www.computing.net/windows95/wwwboard/forum/16264.html">supported <span class="caps">OS.</span></a> This guy heroically <a href="http://jcoppens.com/globo/gl4pre/cam/index.en.php">analyzed the signal between the PC and the webcam</a> and came up with some sort of picture, but his write-up falls short of providing code.</p>

<p>Oh well. The Weecam's off to the <a href="http://www.accrc.org/">Alameda County Computer Resource Center,</a> and I'll give <a href="http://www.freewebs.com/pmutaf/iwrandom.html">iwrandom</a> a try. (But a webcam in the dark is so much cooler, drat it.)</p>]]>
        
    </content>
</entry>

<entry>
    <title>Apt-get globally, gem locally</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2007/06/aptget_globally_gem_locally.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=1929" title="Apt-get globally, gem locally" />
    <id>tag:www.zedlopez.com,2007:/strangeloopiness//2.1929</id>
    
    <published>2007-06-16T05:22:35Z</published>
    <updated>2007-06-16T05:36:32Z</updated>
    
    <summary>It seems that Debian packages and Ruby gems don&apos;t play nicely together. I had apt-get installed rails, and my first attempt to use a rails app (someone else had written) blew up because it had an internal check for a...</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![CDATA[<p>It seems that <a href="http://pkg-ruby-extras.alioth.debian.org/rubygems.html">Debian packages and Ruby gems</a> don't play nicely together. I had apt-get installed rails, and my first attempt to use a rails app (someone else had written) blew up because it had an internal check for a Rails gem of a certain version. Since my Rails hadn't been installed as a gem at all, it immediately failed.</p>

<p>So far as I can read on the Interwebs, most people facing this install rubygems as root, and do their subsequent gem installs as root, letting them write wherever in the filesystem they like. </p>

<p>That makes me queasy. I don't want to mix two package systems in the same environment.</p>

<p>So here's how I installed ruby/rubygems/rails in Ubuntu 7.04, with all gems under /usr/local.</p>

<p>Following the ruby1.8 package's own instructions for a full Ruby 1.8 distribution:</p>

<pre><code>sudo apt-get install ruby1.8 ruby1.8-dev ri1.8 rdoc1.8 irb1.8 ruby1.8-elisp ruby1.8-examples libdbm-ruby1.8 libgdbm-ruby1.8 libtcltk-ruby1.8 libopenssl-ruby1.8 libreadline-ruby1.8</code></pre>

<p>I assign ownership of /usr/local and everything under it to the admin group, and make /usr/local and its subdirectories group-writable (per Ubuntu's defaults, my primary login, which I created during installation, is a member of the admin group.)</p>

<pre><code>sudo chown -R root:admin /usr/local 
sudo chmod 775 /usr/local /usr/local/*</code></pre>

<p>I get and install rubygems.</p>

<pre><code>mkdir /usr/local/lib/rubygems
export GEM_HOME=/usr/local/lib/rubygems
cd /usr/local/src
# as of this writing, the latest rubygems from http://rubyforge.org/frs/?group_id=126
wget http://rubyforge.org/frs/download.php/20989/rubygems-0.9.4.tgz
tar xzf rubygems-0.9.4.tgz
cd rubygems-0.9.4
ruby setup.rb config --prefix=/usr/local
ruby setup.rb setup
ruby setup.rb install</code></pre>

<p>I add the following to my .bashrc, but you'll want them in any environment using gems. With multiple users on a system, you might want to put this in /etc/bash.bashrc.</p>

<pre><code>export GEM_HOME=/usr/local/lib/rubygems
export RUBYLIB=/usr/local/site_ruby/1.8
export RUBYOPT=rubygems
export PATH=$PATH:/usr/local/lib/rubygems/bin</code></pre>

<p>The grand finale:</p>

<pre><code>source .bashrc # or wherever you put them
gem install rails --include-dependencies</code></pre>

<p>It's <em>that</em> easy!</p>

<p>References:</p>


<ul>
<li><a href="http://schf.uc.org/articles/2006/11/15/installing-mongrel-on-a-shared-host">Installing Rails and Mongrel on a Shared Host</a></li>
<li><a href="http://www.debian-administration.org/articles/329">Ruby on Rails on Debian</a></li>
<li><a href="http://rubygems.org/read/chapter/3">RubyGems User Guide, Ch. 3</a></li>
</ul>

]]>
        
    </content>
</entry>

<entry>
    <title>Tolerance</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2007/04/tolerance.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=1924" title="Tolerance" />
    <id>tag:www.zedlopez.com,2007:/strangeloopiness//2.1924</id>
    
    <published>2007-04-15T06:25:02Z</published>
    <updated>2007-04-15T06:38:47Z</updated>
    
    <summary>I enjoyed this take on an Emo Philips joke (found on the Church of Emacs page.) I asked my email-pal: &quot;UNIX or Windoze?&quot;. He replied &quot;UNIX&quot;. I said &quot;Ah...me too!&quot;. I asked my email-pal: &quot;Linux or AIX?&quot;. He said &quot;Linux,...</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![CDATA[<p>I enjoyed <a href="http://www.dina.kvl.dk/~abraham/religion/one-true-editor.html">this take</a> on an <a href="http://www.guardian.co.uk/g2/story/0,3604,1580452,00.html">Emo Philips joke</a> (found on the <a href="http://www.dina.kvl.dk/~abraham/religion/">Church of Emacs</a> page.)</p>

<blockquote><p>I asked my email-pal: "UNIX or Windoze?". He replied "UNIX". I said "Ah...me too!".</p>

<p>I asked my email-pal: "Linux or <span class="caps">AIX</span>?". He said "Linux, of course". I said "Me too".</p>

<p>I asked him: "Emacs or vi". He replied "Emacs". I said "Me too. Small world."</p>

<p>I asked him: "GNU Emacs or XEmacs?", and he said "GNU Emacs". I said "oh, me too."</p>

<p>I asked him "GNU Emacs 19 or <span class="caps">GNU</span> Emacs 20"? and he said "GNU Emacs 19". I said "oh, me too."</p>

<p>I asked him, "GNU Emacs 19.29 or <span class="caps">GNU</span> Emacs 19.34", and he replied "GNU Emacs 19.29". I said "DIE <span class="caps">YOU OBSOLETE NOGOOD SOCIALLY MALADJUSTED CELIBATE COMMIE FASCIST DORK</span>!", and never emailed him again. </p></blockquote>

<p>Ubuntu Linux 7.04 beta, <span class="caps">GNU</span> Emacs 23.0.0.1 alpha, with Xft support. But I'm reformed --  <em>any</em>  Linux or <span class="caps">BSD </span>distro and Emacs flavor is OK by me. (Everyone else can <span class="caps">DIE</span>!)</p>]]>
        
    </content>
</entry>

<entry>
    <title>Movable Type 3.2+ Annoyances</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2006/12/movable_type_32_annoyances.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=1883" title="Movable Type 3.2+ Annoyances" />
    <id>tag:www.zedlopez.com,2006:/strangeloopiness//2.1883</id>
    
    <published>2006-12-07T16:08:10Z</published>
    <updated>2006-12-07T16:39:24Z</updated>
    
    <summary>The default individual entry archive template includes a block of template markup for posting comments... but that block doesn&apos;t support Typekey authorization. You need to boost the markup from the comment preview template. The text boxes on the edit entry...</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![CDATA[<p>The <a href="http://www.sixapart.com/movabletype/default_templates_32/individual_entry_archive.txt">default individual entry archive template</a> includes a block of template markup for posting comments... but that block doesn't support Typekey authorization. You need to boost the markup from the <a href="http://www.sixapart.com/movabletype/default_templates_32/comment_preview_template.txt">comment preview template.</a></p>

<p>The text boxes on the edit entry page are tiny little things, because mt-static/styles.css is missing an entry for the full-width class. This can be fixed by putting this in your mt-static/user_styles.css:</p>

<code>
.full-width { 
  width: 100%;
}
</code>]]>
        
    </content>
</entry>

<entry>
    <title>But am I paranoid enough?</title>
    <link rel="alternate" type="text/html" href="http://www.zedlopez.com/strangeloopiness/2006/10/but_am_i_paranoid_enough.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.mememachinego.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=2/entry_id=1857" title="But am I paranoid enough?" />
    <id>tag:www.zedlopez.com,2006:/strangeloopiness//2.1857</id>
    
    <published>2006-10-16T13:54:11Z</published>
    <updated>2006-10-16T14:15:11Z</updated>
    
    <summary>This security professional is so paranoid that Bruce Schneier thought he had to be kidding. And for Bruce Schneier, SHA-1 is merely a compression algorithm....</summary>
    <author>
        <name>Zed</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.zedlopez.com/strangeloopiness/">
        <![CDATA[<p>This security professional is <a href="http://www.securityfocus.com/columnists/320">so paranoid</a> that Bruce Schneier thought <a href="http://www.schneier.com/blog/archives/2005/10/computersecurit.html">he had to be kidding.</a></p>

<p>And <a href="http://geekz.co.uk/schneierfacts/fact/164">for Bruce Schneier, <span class="caps">SHA</span>-1 is merely a compression algorithm.</a></p>]]>
        
    </content>
</entry>

</feed> 

