<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/templates/default/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <link href="http://anthology.spacemonkeys.ca/feeds/atom10.xml" rel="self" title="Anthology of Interest" type="application/atom+xml" />
    <link href="http://anthology.spacemonkeys.ca/"                        rel="alternate"    title="Anthology of Interest" type="text/html" />
    <link href="http://anthology.spacemonkeys.ca/rss.php?version=2.0"     rel="alternate"    title="Anthology of Interest" type="application/rss+xml" />
    <title type="html">Anthology of Interest</title>
    <subtitle type="html">Bastard coated bastard with a creamy bastard centre</subtitle>
    <icon>http://anthology.spacemonkeys.ca/templates/default/img/s9y_banner_small.png</icon>
    <id>http://anthology.spacemonkeys.ca/</id>
    <updated>2010-08-12T02:28:47Z</updated>
    <generator uri="http://www.s9y.org/" version="1.0">Serendipity 1.0 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>

    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/946-Mythbuntu-upstart-job-to-set-channel-3.html" rel="alternate" title="Mythbuntu upstart job to set channel 3" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2010-08-12T02:28:47Z</published>
        <updated>2010-08-12T02:28:47Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=946</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=946</wfw:commentRss>
    
    
        <id>http://anthology.spacemonkeys.ca/archives/946-guid.html</id>
        <title type="html">Mythbuntu upstart job to set channel 3</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I switched to digital cable recently, which means that there is now an external cable box for tuning.  That means the analog tuner on my mythbox must be set to channel 3 to receive the input from the cable box.  Unfortunately, <tt>ivtv-tune</tt> has a quirk that made it difficult to get the PVR-250 tuned to channel 3.  The problem is that <tt>ivtv-tune</tt> needs the HOME environment variable to be set, and it needs there to be a ~/.ivtv-tune file there.  Finally I got it working with this upstart script:</p>

<pre><tt>
# Ensures the PVR 250 card is set to channel 3 so that the cable box works.

description "Ensures the PVR 250 card is set to channel 3"
author "Matt Hughes <matt.c.hughes@gmail.com>"

start on mounted
stop on starting shutdown 

task

console output

script
echo "Changing tuner to channel 3..."
export HOME=/tmp
echo "device /dev/video0" > /tmp/.ivtv-tune
echo "freqtable us-cable" >> /tmp/.ivtv-tune
exec /usr/bin/ivtv-tune -c 3 -d /dev/video0
end script
</tt></pre>

<p>Now the ir-blaster can do it's thing and everything works.  As a side note, if your remove control stops working, you should replace the batteries be for messing with the LIRC configuration, even if you just updated your kernel.   !$!@#$@# Linux.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/945-The-super-easy-way-to-use-Emacs-and-Slime-with-Clojure.html" rel="alternate" title="The super easy way to use Emacs and Slime with Clojure" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2010-03-05T04:17:57Z</published>
        <updated>2010-03-05T04:17:57Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=945</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=945</wfw:commentRss>
    
            <category scheme="http://anthology.spacemonkeys.ca/categories/11-Computation" label="Computation" term="Computation" />
    
        <id>http://anthology.spacemonkeys.ca/archives/945-guid.html</id>
        <title type="html">The super easy way to use Emacs and Slime with Clojure</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I recently became interested in <a
href="http://anthology.spacemonkeys.ca/exit.php?url_id=710&amp;entry_id=945" title="http://clojure.org/"  onmouseover="window.status='http://clojure.org/';return true;" onmouseout="window.status='';return true;">Clojure</a>, a (mostly) functional lisp
that runs on the JVM.  While reading the documentation and watching
the screencasts, I wanted to start trying out some of the stuff I was
seeing.  I use <a href="http://anthology.spacemonkeys.ca/exit.php?url_id=706&amp;entry_id=945" title="http://www.gnu.org/software/emacs/"  onmouseover="window.status='http://www.gnu.org/software/emacs/';return true;" onmouseout="window.status='';return true;">Emacs</a>
for code, on Windows, Linux, and Mac OS, and it is particularly
nice for dynamic languages that provide a <a
href="http://anthology.spacemonkeys.ca/exit.php?url_id=707&amp;entry_id=945" title="http://en.wikipedia.org/wiki/Read-eval-print_loop"  onmouseover="window.status='http://en.wikipedia.org/wiki/Read-eval-print_loop';return true;" onmouseout="window.status='';return true;">REPL</a>.
Here's the super easy way to get started with Clojure on Emacs. </p>

<ol>

<li>Install a recent version of Emacs, 22 or 23, if you haven't
already got one.  I use <a
href="http://anthology.spacemonkeys.ca/exit.php?url_id=708&amp;entry_id=945" title="http://homepage.mac.com/zenitani/emacs-e.html"  onmouseover="window.status='http://homepage.mac.com/zenitani/emacs-e.html';return true;" onmouseout="window.status='';return true;">Carbon Emacs</a>
on OS X. </li>

<li>Follow the instructions here: <a
href="http://anthology.spacemonkeys.ca/exit.php?url=aHR0cDovL3Ryb21leS5jb20vZWxwYS9pbnN0YWxsLmh0bWw=&amp;entry_id=945" title="http://tromey.com/elpa/install.html"  onmouseover="window.status='http://tromey.com/elpa/install.html';return true;" onmouseout="window.status='';return true;">Install the Emacs Lisp
Package Archive (ELPA)</a> script</li>

<li>Get a list of available packages (optional, but interesting):
<tt>M-x package-list-packages</tt></li>

<li>Install the <a href="http://anthology.spacemonkeys.ca/exit.php?url_id=709&amp;entry_id=945" title="http://common-lisp.net/project/slime/"  onmouseover="window.status='http://common-lisp.net/project/slime/';return true;" onmouseout="window.status='';return true;">Slime</a> and Clojure packages:</li>
<ul>
<li><tt>M-x package-install clojure-mode</tt></li>
<li><tt>M-x package-install clojure-test-mode</tt></li>
<li><tt>M-x package-install swank-clojure</tt></li>
<li><tt>M-x package-install slime</tt></li>
</ul>

<li>Run Clojure in SLIME:<tt>M-x slime</tt>.  You should be asked if
you want to download and install Clojure.  Say yes, and let it do it's
thing, and you will eventually see a buffer that looks like this:
</li> 

<blockquote><pre>
; SLIME 20091016
user> 
user> 
</pre></blockquote>

<li>Read stuff on <a href="http://anthology.spacemonkeys.ca/exit.php?url_id=710&amp;entry_id=945" title="http://clojure.org/"  onmouseover="window.status='http://clojure.org/';return true;" onmouseout="window.status='';return true;">clojure.org</a>, watch
the screencasts on <a
href="http://anthology.spacemonkeys.ca/exit.php?url_id=711&amp;entry_id=945" title="http://clojure.blip.tv/"  onmouseover="window.status='http://clojure.blip.tv/';return true;" onmouseout="window.status='';return true;">clojure.blip.tv</a>, and have fun!</li>

<li>Try out ants.clj as detailed at <a
href="http://anthology.spacemonkeys.ca/exit.php?url=aHR0cDovL3JpZGRlbGwudXMvdHV0b3JpYWwvc2xpbWVfc3dhbmsvc2xpbWVfc3dhbmsuaHRtbA==&amp;entry_id=945" title="http://riddell.us/tutorial/slime_swank/slime_swank.html"  onmouseover="window.status='http://riddell.us/tutorial/slime_swank/slime_swank.html';return true;" onmouseout="window.status='';return true;">this
other not so easy Clojure+Slime+Emacs guide</a>.  Skip down to the
"Test Configuration" section.</li>

</ol>

<p>For more information about how Slime works, see <a
href="http://anthology.spacemonkeys.ca/exit.php?url=aHR0cDovL2JjLnRlY2guY29vcC9ibG9nLzA4MTIwOS5odG1s&amp;entry_id=945" title="http://bc.tech.coop/blog/081209.html"  onmouseover="window.status='http://bc.tech.coop/blog/081209.html';return true;" onmouseout="window.status='';return true;">this post by Bill
Clementson</a>. </p>

<p>This <a href="http://anthology.spacemonkeys.ca/exit.php?url=aHR0cDovL3ZpbWVvLmNvbS8yNDE5NTk2&amp;entry_id=945" title="http://vimeo.com/2419596"  onmouseover="window.status='http://vimeo.com/2419596';return true;" onmouseout="window.status='';return true;">Emacs+Slime+Clojure
video on Vimeo</a> may also be interesting, although dated. </p>
 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/944-Releasing-Phred...-finally..html" rel="alternate" title="Releasing Phred... finally." />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2010-02-28T17:46:37Z</published>
        <updated>2010-02-28T17:46:37Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=944</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=944</wfw:commentRss>
    
            <category scheme="http://anthology.spacemonkeys.ca/categories/11-Computation" label="Computation" term="Computation" />
    
        <id>http://anthology.spacemonkeys.ca/archives/944-guid.html</id>
        <title type="html">Releasing Phred... finally.</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Today I've posted <a href="http://anthology.spacemonkeys.ca/exit.php?url_id=699&amp;entry_id=944" title="http://code.google.com/p/phred/"  onmouseover="window.status='http://code.google.com/p/phred/';return true;" onmouseout="window.status='';return true;">Phred</a>, the 3d FDTD program I wrote for my M.A.Sc,
to Google code.  In some ways it is very simple: it only supports
uniform grading for instance.  The way the updates are handled is not
very flexible.  The testing is pretty primitive.  Other things about
it are still really cool: it runs on a variety on super-computers, or
at least it did five years ago.  It uses Python as a scripting
language for problem set-up.  It implements the Drude model for
modelling some kinds of metal.  It's a good example of my skills as
they were five years ago.  Despite cringing at some of this code, I'm
still pretty proud of it. </p>

<p>You can find the <a href="http://anthology.spacemonkeys.ca/exit.php?url_id=699&amp;entry_id=944" title="http://code.google.com/p/phred/"  onmouseover="window.status='http://code.google.com/p/phred/';return true;" onmouseout="window.status='';return true;">Phred Google Code project page here.</a></p>

<p>Cool stuff about Phred:</p>
<ul>
<li>Runs on a variety of machines:</li>
<ul>
<li>Many variants of Linux</li>
<li>IBM eServer BladeCenter HS20 (<a href="http://anthology.spacemonkeys.ca/exit.php?url_id=700&amp;entry_id=944" title="http://www.westgrid.ca/support/quickstart/glacier"  onmouseover="window.status='http://www.westgrid.ca/support/quickstart/glacier';return true;" onmouseout="window.status='';return true;">WestGrid's Glacier</a>)</li>
<li>IBM pSeries SMP (<a href="http://anthology.spacemonkeys.ca/exit.php?url_id=701&amp;entry_id=944" title="http://www.westgrid.ca/support/quickstart/cortex"  onmouseover="window.status='http://www.westgrid.ca/support/quickstart/cortex';return true;" onmouseout="window.status='';return true;">WestGrid's Cortex</a>)</li>
<li>HP AlphaServer running Tru64 (<a href="http://anthology.spacemonkeys.ca/exit.php?url_id=702&amp;entry_id=944" title="http://www.westgrid.ca/support/quickstart/lattice"  onmouseover="window.status='http://www.westgrid.ca/support/quickstart/lattice';return true;" onmouseout="window.status='';return true;">WestGrid's Lattice</a>)... I think.
There might have been compiler issues.</li>
<li>SGI Origin (<a
href="http://anthology.spacemonkeys.ca/exit.php?url=aHR0cDovL3d3dy53ZXN0Z3JpZC5jYS9zdXBwb3J0L3F1aWNrc3RhcnQvbmV4dXM=&amp;entry_id=944" title="http://www.westgrid.ca/support/quickstart/nexus"  onmouseover="window.status='http://www.westgrid.ca/support/quickstart/nexus';return true;" onmouseout="window.status='';return true;">WestGrid's
Nexus</a>)</li>
<li>IBM SP Nighthawk-2 (<a href="http://anthology.spacemonkeys.ca/exit.php?url_id=703&amp;entry_id=944" title="http://rcf.uvic.ca/index.php?id=7"  onmouseover="window.status='http://rcf.uvic.ca/index.php?id=7';return true;" onmouseout="window.status='';return true;">UVic's Minerva</a>)</li>
</ul>
<li>Problems are scripted in <a
href="http://anthology.spacemonkeys.ca/exit.php?url_id=704&amp;entry_id=944" title="http://python.org/"  onmouseover="window.status='http://python.org/';return true;" onmouseout="window.status='';return true;">Python</a></li>
<li>Drude model for simulating dispersive materials such as gold and silver.</li>
<li>Uses a hybrid MPI/OpenMP model for parallel computation.  I found
that MPI by itself generally gave better performance, even on SMP
machines. </li>
</ul>

<p>I ran the majority of my large simulations on Nexus and Glacier,
and smaller simulations on Debian Linux, so those are the best
tested.  However, things have come along way in five years, and I'm
not sure if everything would still compile given various software
updates than may have been rolled out. </p>

<p>There are a lot of rough edges and unfinished things in the code.
I was experimenting with template meta-programming for the updates,
for instance.  Template meta-programming is interesting, but because
it's a side-effect of a language feature designed for something else
it is hard to use.  The error messages are particularly
unhelpful. </p>

<p>My goal in releasing this is mostly just to preserve it for my own
reference, to ensure that it is not lost when the hard drive it was on
is disposed of or dies.  Open source is more than just the code.  It
takes a lot of work to build up a community, get people interested,
accept patches, and so on.  I don't have time to give this project
that kind of love.  Perhaps someone else will be interested in picking
it up and taking it over, but that seems unlikely.  There are already
many other actively maintained open source FDTD packages out there. </p>
 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/943-XTerm-and-meta.html" rel="alternate" title="XTerm and meta" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2010-02-16T17:57:25Z</published>
        <updated>2010-02-20T18:31:00Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=943</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=943</wfw:commentRss>
    
            <category scheme="http://anthology.spacemonkeys.ca/categories/11-Computation" label="Computation" term="Computation" />
    
        <id>http://anthology.spacemonkeys.ca/archives/943-guid.html</id>
        <title type="html">XTerm and meta</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I'm using <a href="http://anthology.spacemonkeys.ca/exit.php?url_id=697&amp;entry_id=943" title="http://cygwin.com/"  onmouseover="window.status='http://cygwin.com/';return true;" onmouseout="window.status='';return true;">Cygwin</a> and X11 on Windows 7, and I'm
pretty happy with it so far.  The newest version of Cygwin integrates
nicely, and 7 seems pretty polished and much nicer overall than XP (I
never really used Vista).  </p>

<p>The one problem I've been having is related to the meta key in
XTerm.  I'm a heavy user of the Emacs movement keys, so M-b, M-f, M-a
and friends see heavy use.  However, in the default configuration, I
get garbage and strange behaviour. </p>

<p>I finally found the fix in an <a
href="http://anthology.spacemonkeys.ca/exit.php?url=aHR0cDovL2tldmluZnJhbmNpcy5uZXQvam91cm5hbC8yMDA1LzA2L3h0ZXJtLW1ldGEta2V5LXdlaXJkbmVzcy8=&amp;entry_id=943" title="http://kevinfrancis.net/journal/2005/06/xterm-meta-key-weirdness/"  onmouseover="window.status='http://kevinfrancis.net/journal/2005/06/xterm-meta-key-weirdness/';return true;" onmouseout="window.status='';return true;">old
blog post from 2005</a>.  To summarize, the fix is to ctrl-left click
and make sure that "meta sends escape" is selected.  This can be made
permanent by adding this to your .Xresources file:</p>

<pre>
<blockquote>
XTerm*metaSendsEscape: true
</blockquote>
</pre>

<p>To load that change without restarting X, run <tt>xrdb -override
.Xresources</tt>.</p>

<p>Now to figure out what is wrong with X11 on Snow Leopard!</p>

<p>UPDATE:  If adding the above your your .Xresources file does not work, try adding it to .Xdefaults instead.  Alternatively, add <tt>xrdb -merge ~/.Xresources</tt> to your .xinitrc file. </p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/942-AFP-server-on-Ubutnu-for-Leopard-clients.html" rel="alternate" title="AFP server on Ubutnu for Leopard clients" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2009-06-21T13:45:54Z</published>
        <updated>2009-06-27T18:23:29Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=942</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=942</wfw:commentRss>
    
            <category scheme="http://anthology.spacemonkeys.ca/categories/11-Computation" label="Computation" term="Computation" />
    
        <id>http://anthology.spacemonkeys.ca/archives/942-guid.html</id>
        <title type="html">AFP server on Ubutnu for Leopard clients</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I was trying to set up netatalk to serve files off my linux box to my macs, but Leopard was giving a cryptic error message whenever I tried to connect to the server.  Turns out the that the default netatalk package that comes with Ubuntu doesn't have SSL support enabled, which Leopard requires.  I finally found a blog entry that shows how to <a href="http://anthology.spacemonkeys.ca/exit.php?url_id=695&amp;entry_id=942" title="http://blog.damontimm.com/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/comment-page-2/#comment-7359"  onmouseover="window.status='http://blog.damontimm.com/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/comment-page-2/#comment-7359';return true;" onmouseout="window.status='';return true;">build an SSL enabled netatalk package.</a>  Works like a charm now!  </p>

<p>AFP replaces SSHFS and Macfuse for me, as I couldn't get the volumes to mount read/write after upgrading to Leopard.  AFP is really more suitable anyway. </p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/941-Installing-Leopard,-part-II.html" rel="alternate" title="Installing Leopard, part II" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2009-04-05T03:41:25Z</published>
        <updated>2009-05-20T04:32:01Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=941</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=941</wfw:commentRss>
    
    
        <id>http://anthology.spacemonkeys.ca/archives/941-guid.html</id>
        <title type="html">Installing Leopard, part II</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I wrote a program to completely remove the FAT partition table
entry from the GPT, which meant learning about CRC-32 and messing up
with the <tt>dd</tt> command, which was... fun.  All this effort didn't pan out however.</p>

<p>Ultimately, I ended up installing Leopard to an external drive,
migrating my backup into the new install, then formatting my internal
drive before using SuperDuper! to copy the new Leopard install to the
internal drive.  After I had been running Leopard off of the external
drive for a while, a box popped up that told me that my internal drive
was now available for use in a limited capacity.  Turns out Leopard
had been silently running fsck_hfs on the file system, and that it
turned up errors in the drive.  That's probably the reason I couldn't
get the Leopard installer to recognize the drive.  I just wasn't
patient enough.  If I had waited for the installer to finish the fsck,
it probably would have shown up.  </p>

<p>The error fsck_hfs found was "Incorrect number of thread records
found."  Apparently this is not something that can be fixed in HFS+
file systems.  Or at least, the built in tools can't fix it.</p>

 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/940-Bootcamp,-Tiger,-and-Leopard-oh-my!.html" rel="alternate" title="Bootcamp, Tiger, and Leopard oh my!" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2009-03-09T21:42:48Z</published>
        <updated>2009-03-09T21:42:48Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=940</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=940</wfw:commentRss>
    
            <category scheme="http://anthology.spacemonkeys.ca/categories/11-Computation" label="Computation" term="Computation" />
    
        <id>http://anthology.spacemonkeys.ca/archives/940-guid.html</id>
        <title type="html">Bootcamp, Tiger, and Leopard oh my!</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I've been trying to upgrade my MacBook Pro to Leopard for the last few
days.  The trouble is, the installer refuses to detect any of the
partitions on my hard drive.  It doesn't even show the drive with a
exclamation mark and tell me I need to repartition, which seems to be
fairly common.  The Disk Utility and command line tools in the
installer don't see the partitions either, so it seems to a problem at
a more fundamental (kernel?) level.  Tiger works fine, as does the
installer for Tiger.  From searching the inter-tubes, it appears that
the problem is related to my bootcamp partition.  The Leopard
installed seems to require a specific partition layout in order for it
to detect the partitions, which seems massively stupid.  Especially
when bootcamp installations are probably fairly common on Tiger
machines.</p>

<p>I tried a couple of things already, such are resetting the protective
MBR to contain only the EFI protection partition, but that had no
effect.  Since I have <a
href="http://anthology.spacemonkeys.ca/exit.php?url_id=694&amp;entry_id=940" title="http://refit.sourceforge.net/"  onmouseover="window.status='http://refit.sourceforge.net/';return true;" onmouseout="window.status='';return true;">rEFIt</a> installed, I wasn't
worried about trashing the MBR, since rEFIt can recreate it from the
GPT. </p>

<p>A guy on this thread about the <a
href="http://anthology.spacemonkeys.ca/exit.php?url=aHR0cDovL2ZvcnVtcy5tYWNydW1vcnMuY29tL3Nob3d0aHJlYWQucGhwP3Q9Mzc0OTk1&amp;entry_id=940" title="http://forums.macrumors.com/showthread.php?t=374995"  onmouseover="window.status='http://forums.macrumors.com/showthread.php?t=374995';return true;" onmouseout="window.status='';return true;">Leopard
Installer disk detection problems</a> suggests that the installer
requires the GPT itself to be set up in exactly the right way. It
requires either a single HFS+ partition of any size, or a single HFS+
partition followed by a "basic data" partition, as long as the sum of
the two partition sizes is exactly the size of the disk.  My disk
<em>appears</em> to fit the second case... Except it doesn't, because
there is a gap between the HFS+ and FAT32 partitions, which can be seen
with the <tt>gpt</tt> tool:</p>

<pre><tt>
thunderstorm:~ mch$ sudo gpt -r -v -v show /dev/disk0
gpt show: /dev/disk0: mediasize=80026361856; sectorsize=512; blocks=156301488
gpt show: /dev/disk0: PMBR at sector 0
gpt show: /dev/disk0: Pri GPT at sector 1
gpt show: /dev/disk0: Sec GPT at sector 156301487
      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34          6         
         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640  102760448      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  103170088     262144         
  103432232   52869216      3  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
  156301448          7         
  156301455         32         Sec GPT table
  156301487          1         Sec GPT header
</tt></pre>

<p>So, there is a 6 sector gap between the table and the HFS+
partition, and a 262144 sector gap between the HFS+ partition and the
FAT32 partition.  That second gap is probably what is messing up the
Leopard installer. </p>

<p>Here's what <tt>diskutil</tt> has to say about the disk:</p>

<pre><tt>
thunderstorm:~ mch$ sudo diskutil list disk0
/dev/disk0
   #:                   type name               size      identifier
   0:  GUID_partition_scheme                    *74.5 GB  disk0
   1:                    EFI                    200.0 MB  disk0s1
   2:              Apple_HFS Thunderstorm       49.0 GB   disk0s2
   3:   Microsoft Basic Data HELL               25.2 GB   disk0s3
</pre></tt>

<p>Yes, my Windows partition is named HELL. Here is my MBR, after I
trashed it so that it only contains the protective GPT partition:</p>

<pre><tt>
thunderstorm:~ mch$ sudo fdisk /dev/rdisk0
Disk: /dev/rdisk0       geometry: 9729/255/63 [156301488 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE    0   0   2 - 1023 254  63 [         1 -  156301487] <Unknown ID>
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
</tt></pre>

<p>The next step is to back up my boot camp partition before taking
the FAT32 partition out of the GPT...  I'm hoping that that will let
me install Leopard, after which I can attempt to restore the GPT
entry for the FAT32, and hopefully everything will work. </p>
 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/939-Some-greasemonkey-action-for-the-Calgary-Public-Library.html" rel="alternate" title="Some greasemonkey action for the Calgary Public Library" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2008-11-02T03:56:26Z</published>
        <updated>2008-11-09T05:28:34Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=939</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=939</wfw:commentRss>
    
            <category scheme="http://anthology.spacemonkeys.ca/categories/11-Computation" label="Computation" term="Computation" />
    
        <id>http://anthology.spacemonkeys.ca/archives/939-guid.html</id>
        <title type="html">Some greasemonkey action for the Calgary Public Library</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>The <a href="http://anthology.spacemonkeys.ca/exit.php?url_id=691&amp;entry_id=939" title="https://catalogue.calgarypubliclibrary.com/ipac20/ipac.jsp?menu=account"  onmouseover="window.status='https://catalogue.calgarypubliclibrary.com/ipac20/ipac.jsp?menu=account';return true;" onmouseout="window.status='';return true;">"My account"</a> page on the <a href="http://anthology.spacemonkeys.ca/exit.php?url_id=692&amp;entry_id=939" title="http://calgarypubliclibrary.com/"  onmouseover="window.status='http://calgarypubliclibrary.com/';return true;" onmouseout="window.status='';return true;">Calgary Public Library</a> site uses your library card number and a pin number to authenticate you.  However, both form fields are of type "password", which means that Firefox won't save the username / password information.  Since the site seems to randomly log you out, it becomes a pain in the ass to get out the library card over and over again to type it in by hand. </p>

<p>This <a href="http://anthology.spacemonkeys.ca/exit.php?url_id=693&amp;entry_id=939" title="http://www.greasespot.net/"  onmouseover="window.status='http://www.greasespot.net/';return true;" onmouseout="window.status='';return true;">Greasemonkey</a> script simply changes the library card barcode number field from a password type to a text type, which allows Firefox to remember the contents.  Unfortunately, when Firefox fills the form, it places the "password" (your pin) in the first password field it finds... since the autofill happens before the Greasemonkey script runs. The barcode isn't autofilled anywhere, so it is necessary to embed it in the script itself. Or you can type the first number in the barcode field and it will autofill it then. </p>

<p>NOTE: after using the CPL website a while, I noticed that the original version of this script was filling in random form fields.  It needed to be modified to look for some unique characteristic of the sign in page.  Since the CPL website uses a single JSP and GET URL parameters to navigate all the pages, one can't use the greasemonkey include/exclude URL thing. </p>

<blockquote>
<pre><tt>
// ==UserScript==
// @name           Calgary Public Library Login fixer
// @namespace      http://spacemonkeys.ca/greasemonkey
// @description    Changes the password box to a text box so 
//                 that firefox can remember the form fields. 
// @include        https://catalogue.calgarypubliclibrary.com/ipac20/*
// ==/UserScript==

var inputFields = document.getElementsByTagName('input');
var barcode = inputFields[9];
var barcodeLabel = barcode.parentNode.parentNode.childNodes[0].childNodes[0];
var pin = inputFields[10];
var pinLabel = pin.parentNode.parentNode.childNodes[0].childNodes[0];

var mycardNumber = "xxxxxxxxxxxxxx";

// Firefox autofills the pin into the barcode field, probably because
// that is the first password field it sees.  The barcode itself is lost.
if (pin.name == "sec2" 
    &&amp; barcode.name == "sec1" 
    &&amp; barcodeLabel.data.search("Library Card Number:") != -1 
    &&amp; pinLabel.data.search("Last 4 numbers") != -1)
{
    var temp = barcode.value;
    barcode.value = mycardNumber;
    pin.value = temp;

    // Make the barcode number a text field, so that Firefox will be able
    // to remember the barcode/pin combo. 
    barcode.type = 'text';
}
</tt></pre>
</blockquote>

<p>It looks like the CPL is in the middle of overhauling their site, so maybe the need for this script will go away. </p>

<p>If anyone can tell me how to get Firefox to redo the autofill after changing the barcode field to text, that would be great!</p>
 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/938-Whats-with-all-the-bacon.html" rel="alternate" title="What's with all the bacon?" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2008-02-02T04:28:08Z</published>
        <updated>2008-02-02T04:28:08Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=938</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=938</wfw:commentRss>
    
    
        <id>http://anthology.spacemonkeys.ca/archives/938-guid.html</id>
        <title type="html">What's with all the bacon?</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                I'm guessing it's this: 

<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/IVKJpkq-wNo&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/IVKJpkq-wNo&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>

 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/937-Lines-of-code...-useful-metric.html" rel="alternate" title="Lines of code... useful metric?" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2008-01-26T17:48:14Z</published>
        <updated>2008-01-26T17:52:14Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=937</wfw:comment>
    
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=937</wfw:commentRss>
    
            <category scheme="http://anthology.spacemonkeys.ca/categories/11-Computation" label="Computation" term="Computation" />
    
        <id>http://anthology.spacemonkeys.ca/archives/937-guid.html</id>
        <title type="html">Lines of code... useful metric?</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I'm often asked how many lines of code there are in some project I'm working on. I think it's the least useful metric of any codebase, but people always seem interested in knowing. I'm not sure if they are more impressed by a small number or a large number...</p>

<p>Since it comes up, here's a one liner to count the number of lines of code.</p>
<pre><tt>
find . -name "*.cc" -or -name "*.hh" -exec wc -l "{}" ";" | gawk '{nlines = nlines + $1} END {print nlines}'
</tt></pre> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/936-Installing-GRUB-on-a-USB-drive.html" rel="alternate" title="Installing GRUB on a USB drive" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2008-01-03T19:18:16Z</published>
        <updated>2008-01-03T19:18:16Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=936</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=936</wfw:commentRss>
    
            <category scheme="http://anthology.spacemonkeys.ca/categories/11-Computation" label="Computation" term="Computation" />
    
        <id>http://anthology.spacemonkeys.ca/archives/936-guid.html</id>
        <title type="html">Installing GRUB on a USB drive</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>If you want to have multiple OS's on your USB drive, you can install GRUB. I haven't actually installed multiple OS's, but GRUB does work:</p>

<ol>
<li>Mount the drive somewhere, say /media/usb.
<li>Copy the grub files to the flash drive: <tt>mkdir -p /media/usb/boot/grub</tt>, then <tt>cp -R /boot/grub/* /media/usb/boot/grub</tt>.
<li>Change the device map for the flash drive: <tt>echo "(hd0) /dev/sdb" > /media/usb/boot/grub/device.map</tt>
<li>Run grub using the new device map: <tt>grub --device-map=/media/usb/boot/grub/device.map</tt>
<li>Install grub on the flash drive: <tt>root (hd0,0)</tt>, then <tt>setup (hd0)</tt>, and <tt>quit</tt>.
<li>Edit the /media/usb/boot/grub/menu.lst file so that it will load FreeDOS by default:
<pre><tt>
      default 0
      timeout 10

      title FreeDOS
      root (hd0,0)
      chainloader +1
      makeactive
      boot
</tt></pre>
<li>Unmount and test in qemu, or on a real machine. 
</ol>
 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/935-Creating-a-bootable-USB-drive-with-FreeDOS.html" rel="alternate" title="Creating a bootable USB drive with FreeDOS" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-12-27T07:04:48Z</published>
        <updated>2008-01-03T19:17:47Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=935</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=935</wfw:commentRss>
    
            <category scheme="http://anthology.spacemonkeys.ca/categories/11-Computation" label="Computation" term="Computation" />
    
        <id>http://anthology.spacemonkeys.ca/archives/935-guid.html</id>
        <title type="html">Creating a bootable USB drive with FreeDOS</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>It is sometimes necessary, even in this day and age, to use DOS or
some other simple operating system to directly access hardware to
perform tasks such as BIOS upgrades. Floppies, the traditional boot
media for quick and dirty tasks such as this, are almost extinct. CD's
are cumbersome to use and change. It is therefore handy to use
some other portable external bootable media for jobs such as
this. Enter the bootable USB key.</p>

<p><a href="http://anthology.spacemonkeys.ca/exit.php?url=aHR0cDovL2ZyZWVkb3Mub3JnLw==&amp;entry_id=935" title="http://freedos.org/"  onmouseover="window.status='http://freedos.org/';return true;" onmouseout="window.status='';return true;">FreeDOS</a> is a handy open source alternative to
MS-DOS, but it only comes as a CD image that must be burned to a CD
and then installed to a hard drive in order to be usable. This makes
it a bit cumbersome to install on a USB key. </p>

<p>I took a somewhat circuitous route to arrive at these
instructions, which included installing FreeDOS in a VMware Fusion
virtual machine, copying that virtual disk to a flat image file,
moving that image file into a Ubuntu virtual machine, byzantine
manipulations of a USB flash drive with <tt>dd</tt>, and learning more
about FAT and MBR than I ever wanted to know. Hopefully the distilled
instructions below are a little easier.</p>

<p>I assume that you have a Linux capable of running <a
href="http://anthology.spacemonkeys.ca/exit.php?url=aHR0cDovL2ZhYnJpY2UuYmVsbGFyZC5mcmVlLmZyL3FlbXUv&amp;entry_id=935" title="http://fabrice.bellard.free.fr/qemu/"  onmouseover="window.status='http://fabrice.bellard.free.fr/qemu/';return true;" onmouseout="window.status='';return true;">QEMU</a> (there is a version of <a href="http://anthology.spacemonkeys.ca/exit.php?url=aHR0cDovL3d3dy5ranUtYXBwLm9yZy9ranUv&amp;entry_id=935" title="http://www.kju-app.org/kju/"  onmouseover="window.status='http://www.kju-app.org/kju/';return true;" onmouseout="window.status='';return true;">QEMU for OS X</a>). You don't need
to use QEMU... but it makes it easier to try different things are
repeat the process while still doing other things, since you don't
have to reboot all the time. </p>

<ol>
<li>Download the FreeDOS installer ISO from <a
href="http://anthology.spacemonkeys.ca/exit.php?url=aHR0cDovL2ZyZWVkb3Mub3JnLw==&amp;entry_id=935" title="http://freedos.org/"  onmouseover="window.status='http://freedos.org/';return true;" onmouseout="window.status='';return true;">FreeDOS.org</a>.</li>
<li>Partition your USB flash drive as you please. You should have at
least one FAT32 primary partition on which you will install
FreeDOS.</li>
<li>Run qemu-launcher. Set it to boot from CD-ROM, and set the CD-ROM
path to point to the FreeDOS ISO you just downloaded. Set hard disk
path to point at the raw flash device (something like /dev/sdb... find
out from dmesg).</li>
<li>Launch qemu. It should boot the FreeDOS installer. Install FreeDOS
on the "hard drive". I recommend installing just the base set of
packages, unless you want to experiment with networking, etc in FreeDOS.</li>
<li>If you don't need multiboot, you are done. </li>
<li>Close QEMU, unplug the flash drive, and try to test it on a real system. If you have trouble, like it says that no OS is found, it may be necessary to run QEMU again in the same way as before, except instead of using the installer, use the live CD and run <tt>fdisk /mbr</tt> and <tt>sys c:</tt> to make sure the drive is fully bootable. 
</ol>

<p>If you want to use multiple OS's on the flash drive, then you can
install grub and set it up to boot each one. But that's for a later
post...</p>

 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/934-Crashes-can-be-entertaining....html" rel="alternate" title="Crashes can be entertaining..." />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-12-24T06:13:54Z</published>
        <updated>2007-12-24T06:13:54Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=934</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=934</wfw:commentRss>
    
            <category scheme="http://anthology.spacemonkeys.ca/categories/15-Sports" label="Sports" term="Sports" />
    
        <id>http://anthology.spacemonkeys.ca/archives/934-guid.html</id>
        <title type="html">Crashes can be entertaining...</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>but is thinking that one of the drivers you are cheering for just died entertainment?</p>

<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/hkqahGb1OME&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/hkqahGb1OME&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>

<p>Urgh. Yay safety innovation. Concussion and a sore (broken?) ankle. Wow.</p>

<p>Crashes are entertaining when you don't know who is involved, but it's pretty dramatic when it happens to someone you are cheering for. Which is part of watching sports I guess... experiencing the lows is just as much a part of it as the highs. Of course you alway want more points and less crashes in that case. </p>

<p>Montreal was perhaps the most entertaining race of the season, and that's because a lot of unexpected stuff happened, not because anyone drove particularity well. </p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/933-Watch-sports-for-the-crashes.html" rel="alternate" title="Watch sports for the crashes?" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-12-22T13:26:23Z</published>
        <updated>2007-12-22T16:43:48Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=933</wfw:comment>
    
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=933</wfw:commentRss>
    
    
        <id>http://anthology.spacemonkeys.ca/archives/933-guid.html</id>
        <title type="html">Watch sports for the crashes?</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Short track speed skating is entertaining because it's fast, and sometimes there are spectacular crashes.  Riding in a velodrome is no different....</p>

<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/S0tMhlhnga0&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/S0tMhlhnga0&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>

<p>Dumb passing maneuver by #3. </p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://anthology.spacemonkeys.ca/archives/932-Line-by-line-processing-with-Bash.html" rel="alternate" title="Line by line processing with Bash" />
        <author>
            <name>Matt Hughes</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-10-14T17:20:54Z</published>
        <updated>2008-04-10T04:51:38Z</updated>
        <wfw:comment>http://anthology.spacemonkeys.ca/wfwcomment.php?cid=932</wfw:comment>
    
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://anthology.spacemonkeys.ca/rss.php?version=atom1.0&amp;type=comments&amp;cid=932</wfw:commentRss>
    
            <category scheme="http://anthology.spacemonkeys.ca/categories/11-Computation" label="Computation" term="Computation" />
    
        <id>http://anthology.spacemonkeys.ca/archives/932-guid.html</id>
        <title type="html">Line by line processing with Bash</title>
        <content type="xhtml" xml:base="http://anthology.spacemonkeys.ca/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I often tried to use bash's for loops to do line by line processing, but it's alway been a pain in the ass. An example. I have a list of files in a text file, and I want to copy each file to some other location. The naïve method:</p>
<pre><tt>for F in `cat names.txt`; do cp $F /new/path; done
</tt></pre>

<p>Unfortunately, names.txt looks like this:</p>
<pre><tt>This filename has spaces 1.txt
This filename has spaces 2.txt
...
This filename has spaces N.txt
</tt></pre>

<p>Bash breaks each line on the space, so the for loop doesn't copy each complete filename. If there are no spaces or tabs in the filenames, then the for loop works ok. The right solution is to use the read command and a while loop: </p>

<pre><tt>cat names.txt | while read FILENAME; do cp "$FILENAME" /new/path; done
</tt></pre>

<p>Update per comment below: added quotes around $FILENAME.</p>

<p>Thanks <a href="http://anthology.spacemonkeys.ca/exit.php?url_id=681&amp;entry_id=932" title="http://codebyexample.electricmonk.nl/Bash/ProcessEachLineInAFile"  onmouseover="window.status='http://codebyexample.electricmonk.nl/Bash/ProcessEachLineInAFile';return true;" onmouseout="window.status='';return true;">electricmonk</a>!.</p> 
            </div>
        </content>
        
    </entry>

</feed>
