<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Made of Bugs</title>
	<atom:link href="http://blog.nelhage.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.nelhage.com</link>
	<description>It's software. It's made of bugs.</description>
	<pubDate>Thu, 18 Sep 2008 16:11:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>wpa_supplicant: GUI and wpa_action</title>
		<link>http://blog.nelhage.com/archives/13</link>
		<comments>http://blog.nelhage.com/archives/13#comments</comments>
		<pubDate>Thu, 18 Sep 2008 16:07:49 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[wifi]]></category>

		<category><![CDATA[wpa_supplicant]]></category>

		<guid isPermaLink="false">http://blog.nelhage.com/?p=13</guid>
		<description><![CDATA[I&#8217;ve made two new interesting discoveries about wpa_supplicant since
writing my last blog post on the subject. (Actually, I pretty much
made both of them while reading documentation in order to write it,
and have been lame about writing them up).

Using wpa_gui

It turns out that wpa_gui not only allows you to select existing
networks, but also to scan for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made two new interesting discoveries about <code>wpa_supplicant</code> since
writing my last blog post on the subject. (Actually, I pretty much
made both of them while reading documentation in order to write it,
and have been lame about writing them up).</p>

<h2>Using <code>wpa_gui</code></h2>

<p>It turns out that <code>wpa_gui</code> not only allows you to select existing
networks, but also to scan for and add new networks to your
configuration file. In addition, you can run it as yourself, without
needing to <code>sudo</code> it. In order to do so, you need to add two lines to
<code>/etc/wpa_supplicant/wpa_supplicant.conf</code>:</p>

<pre><code>ctrl_interface_group=netdev
update_config=1
</code></pre>

<p><code>ctrl_interface_group</code> selects a UNIX group that will be given
permission to read/write the control socket. I chose <code>netdev</code> because
it seems like it&#8217;s supposed to be networking-related, and my login
user was already in it on my Ubuntu machine.</p>

<p><code>update_config</code> allows <code>wpa_supplicant</code> to write back to its conf file
if instructed to configure new networks by a UI (<code>wpa_cli</code> or
<code>wpa_gui</code>). Note that this will squash any comments you have in the
file.</p>

<h2><code>wpa_action</code> — a mostly-baked roaming solution</h2>

<p>The setup I described in the previous post causes <code>wpa_supplicant</code> to
manage associating with access points, while Debian&#8217;s <code>ifupdown</code>
request DHCP independently. There&#8217;s no communication between the
layer, so if you switch networks, or associate sometime <em>after</em> we
bring up the interface, nothing tells <code>dhclient</code> to request a new
lease. It turns out we can turn this picture inside-out, and make
<code>wpa_supplicant</code> responsible for bringing up and down a virtual
interface, whenever it associates or loses association.</p>

<p>To make this work, we&#8217;re going to need to edit
<code>/etc/network/interface</code> again. Our <code>wpa_supplicant.conf</code> can stay
unchanged; Debian&#8217;s wrapper scripts do all the magic. Replace your
<code>ath0</code> block and add a virtual <code>default</code> interface as follows:</p>

<pre><code>iface ath0 inet manual
  wpa-driver wext
  wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp
</code></pre>

<p>The way this is going to work is that, whenever <code>wpa_supplicant</code>
associates to a network, it will bring up the virtual <code>default</code>
interface, causing <code>ifupdown</code> to spawn <code>dhclient</code> and request
DHCP. When it loses association, it brings it down, killing the DHCP
daemon.</p>

<p>Furthermore, we can associate different virtual interfaces with
different networks. Suppose that I usually want DHCP, but at home
(essid <code>nelhage</code>) I don&#8217;t run a DHCP server, and just want my laptop
to always grab <code>10.0.1.100</code>. I can add an interface to
<code>wpa_supplicant.conf</code>:</p>

<pre><code>network={
    ssid="nelhage"
    id_str="nelhage"
    key_mgmt=NONE
}
</code></pre>

<p>And then I add a new virtual interface to <code>interfaces</code>, corresponding
to the <code>id_str</code>:</p>

<pre><code>iface nelhage inet static
        address 10.0.1.100
        netmask 255.255.255.0
        network 10.0.1.0
        gateway 10.0.1.1
</code></pre>

<p>Now, if <code>wpa_supplicant</code> associates to the <code>nelhage</code> network, it will
bring up the <code>nelhage</code> interface, binding <code>ath0</code> to the static
configuration there listed.</p>

<p>For documentation, check out the third section of
<code>/usr/share/doc/wpasupplicant/README.modes.gz</code> on your Debian or
Ubuntu machine.</p>

<h2>In conclusion&#8230;</h2>

<p>This setup actually seems pretty close to the correct design for a
roaming wifi architecture, to me. Unfortunately, my experience is that
it hasn&#8217;t worked well for me; For some reason, when I put it in
roaming mode, it fails to associate with networks that it otherwise
works fine with. I suspect that this is related to <code>madwifi</code> suckage
as much as <code>wpa_supplicant</code> suck, though, so I&#8217;d encourage everyone
else who&#8217;s been fighting with wifi to try it out and report back if it
works for them.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/archives/13/feed</wfw:commentRss>
		</item>
		<item>
		<title>autocutsel</title>
		<link>http://blog.nelhage.com/archives/12</link>
		<comments>http://blog.nelhage.com/archives/12#comments</comments>
		<pubDate>Tue, 16 Sep 2008 16:08:12 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nelhage.com/?p=12</guid>
		<description><![CDATA[As most of you probably know, X has several different mechanisms for
copy-paste, used by different applications in different ways. I know
some people who use them deliberately, juggling two pieces of text in
different clipboards at once, but for me, it&#8217;s always just been
annoying. When I copy something, be it by Gnome C-c, emacs C-w, or
selecting it [...]]]></description>
			<content:encoded><![CDATA[<p>As most of you probably know, X has several different mechanisms for
copy-paste, used by different applications in different ways. I know
some people who use them deliberately, juggling two pieces of text in
different clipboards at once, but for me, it&#8217;s always just been
annoying. When I copy something, be it by Gnome <code>C-c</code>, emacs <code>C-w</code>, or
selecting it in an xterm, I then want to be able to paste it again, no
matter what mechanism I use.</p>

<p>I&#8217;ve long thought it should be trivial to write a daemon that
synchronizes the clipboards, and it turns out that indeed someone&#8217;s
done so: <a href="http://www.nongnu.org/autocutsel/">Autocutsel</a>. And now, it turns out there are in
fact at least three clipboards, but by running it twice, syncing
between two pairs, I&#8217;ve no longer had the issue of pasting from the
wrong clipboard and having to remember <em>how</em> I copied that URL to give
to someone. My <code>.xsession</code> incant is simply:</p>

<pre><code>autocutsel -fork
autocutsel -selection PRIMARY -fork
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/archives/12/feed</wfw:commentRss>
		</item>
		<item>
		<title>New Blog Location</title>
		<link>http://blog.nelhage.com/archives/11</link>
		<comments>http://blog.nelhage.com/archives/11#comments</comments>
		<pubDate>Fri, 12 Sep 2008 18:17:42 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[blog]]></category>

		<category><![CDATA[blogger]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://nelhage.scripts.mit.edu/madeofbugs/?p=11</guid>
		<description><![CDATA[I finally got fed up with Blogger, and am moving this blog to live on
Wordpress hosted off of scripts.mit.edu. In the process of
converting everything over and setting up Wordpress I&#8217;ve decided I
hate it, but hopefully I hate it less than I hate Blogger. We&#8217;ll see.

I&#8217;ve also changed the URL to this blog from
http://nelhage.com/blog to
http://blog.nelhage.com, which [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got fed up with Blogger, and am moving this blog to live on
Wordpress hosted off of <a href="http://scripts.mit.edu">scripts.mit.edu</a>. In the process of
converting everything over and setting up Wordpress I&#8217;ve decided I
hate it, but hopefully I hate it less than I hate Blogger. We&#8217;ll see.</p>

<p>I&#8217;ve also changed the URL to this blog from
<a href="http://nelhage.com/blog">http://nelhage.com/blog</a> to
<a href="http://blog.nelhage.com">http://blog.nelhage.com</a>, which I like
better as URL anyways. It should redirect to the toplevel of the new
URL now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/archives/11/feed</wfw:commentRss>
		</item>
		<item>
		<title>Using wpa_supplicant on Debian/Ubuntu</title>
		<link>http://blog.nelhage.com/archives/10</link>
		<comments>http://blog.nelhage.com/archives/10#comments</comments>
		<pubDate>Fri, 22 Aug 2008 18:06:00 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[debian]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[wifi]]></category>

		<category><![CDATA[wpa_supplicant]]></category>

		<guid isPermaLink="false">http://nelhage.scripts.mit.edu/madeofbugs/?p=10</guid>
		<description><![CDATA[I&#8217;ve been using wpa_supplicant to manage wifi on my Ubuntu laptop
for a while, and have found that it&#8217;s pretty close to what I want for
managing wireless — closer than anything else I&#8217;ve found, at least. I
figured I should document my setup and experiences.

Some Background

You probably all know just how much wireless on Linux can be [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <code>wpa_supplicant</code> to manage wifi on my Ubuntu laptop
for a while, and have found that it&#8217;s pretty close to what I want for
managing wireless — closer than anything else I&#8217;ve found, at least. I
figured I should document my setup and experiences.</p>

<h2>Some Background</h2>

<p>You probably all know just how much wireless on Linux can be a pain to
get working right. Getting drivers and so forth working is usually
fine these days, especially if you&#8217;re using Ubuntu, but managing
connecting to multiple networks and dealing with WPA and WEP is a
serious pain in the ass. Debian&#8217;s solution the <code>ifupdown</code>
infrastructure lets you specify a single network or <code>any</code>, and doesn&#8217;t
have an answer for encryption, as far as I can tell. Ubuntu (and
Fedora)&#8217;s NetworkManager works great when it works, but it wants to
own your entire networking stack, isn&#8217;t very transparent or debuggable
when networking isn&#8217;t working, and the only interface is a dock
applet, which is problematic for my minimalist <a href="http://xmonad.org">XMonad</a>-based
desktop.</p>

<h2>Enter <code>wpa_supplicant</code></h2>

<p>Despite its name, <code>wpa_supplicant</code> isn&#8217;t just about WPA. It&#8217;s actually
a general management system for your wireless in disguise. You give it
a config file of networks you want to connect to if they&#8217;re available,
optionally with priorities, and settings about the kind of encryption
and a password or key if needed. You then tell it &#8220;go&#8221;, and it will go
scan for networks and connect to the appropriate ones as needed. If
you need to override it, there&#8217;s a command line client (<code>wpa_cli</code>) to
connect to the running ndaemon and tell it connect to a specific
network or AP (I think — I haven&#8217;t actually had occasion to use it
much at all)</p>

<h2>My configuration</h2>

<p>I have an Atheros wifi card, so my wifi device is <code>ath0</code>. Adjust this
as appropriate (it&#8217;ll probably be <code>eth1</code> with most other drivers)</p>

<p>First, install the necessary packages:</p>

<pre><code>$ sudo apt-get install wpasupplicant
</code></pre>

<p>Then set up your configuration:</p>

<ul>
<li><p><code>/etc/network/interfaces</code> — We&#8217;re still going to use <code>ifupdown</code> to
manage getting DHCP, but just not for wireless. So add a stanza to
<code>interfaces</code> that looks something like:</p>

<pre><code>auto ath0
iface ath0 inet dhcp
wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
</code></pre></li>
<li><p><code>/etc/wpa_supplicant/wpa_supplicant.conf</code> — This is the file where
you&#8217;re going to specify what networks you want to connect
to. <code>/usr/share/doc/wpasupplicant/examples/</code> can explain the full
range of options better than I can, but there are some examples
below. For now, you can just put a</p>

<pre><code>ctrl_interface=/var/run/wpa_supplicant
</code></pre></li>
</ul>

<p>at the start of the file.</p>

<p>Now, configure your networks in <code>wpa_supplicant.conf</code>. Some examples:</p>

<ul>
<li><p>MIT&#8217;s network &#8212; open, no encryption</p>

<pre><code>network={
    ssid="MIT"
    key_mgmt=NONE
}
</code></pre></li>
<li><p>WEP, hex key</p>

<pre><code>network={
    ssid="langtonlabs"
    key_mgmt=NONE
    wep_key0=deadbeef
}
</code></pre></li>
<li><p>WPA1, password</p>

<pre><code>network={
    ssid="wireless-is-a-lie"
    psk="passw0rd"
}
</code></pre></li>
</ul>

<p>Now if you bring up the interface with <code>ifup ath0</code>, <code>wpa_supplicant</code>
will start scanning for networks and associate as needed. The crappy
thing about this solution is that there&#8217;s no communication between
<code>wpa_supplicant</code> and <code>dhclient</code>, so you won&#8217;t automatically try to get
a new lease if you switch networks. I solve this with a <code>ifup --force
ath0</code> when I move my laptop between access points. I don&#8217;t do this too
often without suspending, though, so it&#8217;s not a huge deal. Browsing
documentation points me at something called <code>wpa_action</code> that&#8217;s
supposed to fix this&#8230; If I figure it out I&#8217;ll post again.</p>

<p>This works quite well for me, better than any other solution I&#8217;ve
found for moving my laptop between multiple access points, and handles
WEP, WPA, and WPA2 just fine. Hopefully it&#8217;ll be helpful for someone
else.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/archives/10/feed</wfw:commentRss>
		</item>
		<item>
		<title>Automounting sshfs</title>
		<link>http://blog.nelhage.com/archives/9</link>
		<comments>http://blog.nelhage.com/archives/9#comments</comments>
		<pubDate>Sun, 23 Mar 2008 22:54:00 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[afuse]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[ssh]]></category>

		<category><![CDATA[sshfs]]></category>

		<guid isPermaLink="false">http://nelhage.scripts.mit.edu/madeofbugs/?p=9</guid>
		<description><![CDATA[For some time now, many of us around MIT have noticed just how awesome
sshfs is. It gives a totally lightweight way to access the
remote filesystem of any machine you have ssh to, without requiring
any extra setup on the host. I&#8217;ve been running for at least a year
now with my /data RAID on my server sshfs-mounted [...]]]></description>
			<content:encoded><![CDATA[<p>For some time now, many of us around MIT have noticed just how awesome
<a href="http://fuse.sourceforge.net/sshfs.html">sshfs</a> is. It gives a totally lightweight way to access the
remote filesystem of any machine you have ssh to, without requiring
<em>any</em> extra setup on the host. I&#8217;ve been running for at least a year
now with my <code>/data</code> RAID on my server sshfs-mounted on my laptop, and
it works totally great.</p>

<p>Recently, I came across two awesome things that make sshfs even
neater. The first is the <code>ServerAliveInterval</code> ssh configuration
option. I (and many others) had noticed that if you changed IP
addresses (which happens all the time with our laptops), sshfs will
just kinda hang there, and so will anything that tries to access
anything in the ssfs-mounted filesystem. <code>sshfs</code> has a <code>-o reconnect</code>
option that makes it automatically reconnect the underlying ssh if it
dies, but it doesn&#8217;t solve the problem of the ssh hanging forever. The
solution, it turns out, is the <code>ServerAliveInterval</code> config
option. Just add</p>

<pre><code>Host *
ServerAliveInterval 15
</code></pre>

<p>to <code>.ssh/config</code>, and ssh will send in-protocol keepalives every 15
seconds if the connection is idle, and die if it doesn&#8217;t receive
anything back. Combine this with <code>-o reconnect</code>, and everything Just
Works when you change IPs</p>

<p>The second cool thing is <a href="http://afuse.sourceforge.net/">afuse</a>, the FUSE automounter. It lets
you set up an automounter for just about anything you can think of,
using another FUSE filesystem itself. I simply run it as</p>

<pre><code>afuse -o mount_template='sshfs -o reconnect %r:/ %m' -o unmount_template='fusermount -u -z %m' /ssh
</code></pre>

<p>from my <code>.xsession</code>, and I have a <code>/ssh</code> automounter!  Combined with
the wonders of kerberos and public keys, so I never have to type a
password, and I can get easy remote access to just about every machine
I care about!</p>

<p>(Note that I did have to chown <code>/ssh</code> to me in order for me to be able
to run <code>afuse</code> as me, which is necessary for <code>sshfs</code> to access my
kerberos tickets and ssh keys. This is fine for my laptop, but
obviously wouldn&#8217;t work for a dialup or other multi-user machine.)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/archives/9/feed</wfw:commentRss>
		</item>
		<item>
		<title>Conkeror</title>
		<link>http://blog.nelhage.com/archives/8</link>
		<comments>http://blog.nelhage.com/archives/8#comments</comments>
		<pubDate>Thu, 13 Mar 2008 23:57:00 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[conkeror]]></category>

		<category><![CDATA[emacs]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[js]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://nelhage.scripts.mit.edu/madeofbugs/?p=8</guid>
		<description><![CDATA[I&#8217;ve recently switched to Conkeror as my primary
browser. It started life as a Firefox extension, but nowadays it&#8217;s a
standalone app built on top of Mozilla&#8217;s xulrunner, so it uses the
Gecko rendering engine.

What it is, is an emacs implemented in Javascript, for the web. This
means on the one hand that it acts like emacs. Most of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently switched to <a href="http://conkeror.mozdev.org">Conkeror</a> as my primary
browser. It started life as a Firefox extension, but nowadays it&#8217;s a
standalone app built on top of Mozilla&#8217;s xulrunner, so it uses the
Gecko rendering engine.</p>

<p>What it is, is an emacs implemented in Javascript, for the web. This
means on the one hand that it <em>acts</em> like emacs. Most of the basic
emacs keybindings are supported &#8212; you open URLs with <code>C-x C-f</code>, and
have buffers you can switch between with <code>C-x b</code> and so on.</p>

<p>However, what is also means is that internally, it is fully an emacs,
with all the extensibility and all the other things that applies. The
UI you see is just code written on top of a generic core, that
implements the core emacs primitives, including</p>

<ul>
<li>The basic <code>buffer</code> datatype. But instead of being a plain text
store, it&#8217;s instead a full Gecko XUL/XHTML DOM.</li>
<li>A self-documenting <code>command</code> infrastructure and <code>variable</code>
infrastructure, that lets you look up the documentation and
definition of any command or configuration variable.</li>
<li><code>keymaps</code> accessible from javascript that map keys and
key sequences to commands, letting you rebind any key from your
configuration code, and define new modes with completely new
keybinding sets</li>
</ul>

<p>In other words, it really is not just an emacs-like frontend to
Gecko/Firefox, but is a full platform on top of xulrunner for writing
interactive applications in javascript/html/css like emacs.</p>

<p>I predict it&#8217;s only a matter of time before someone</p>

<ul>
<li>Adds the ability to edit local files and becomes a full text editor
that can actually start to <em>compete</em> with emacs. At that point
people will start to port things like <code>emacs-vc</code> and all the Nice
Things we&#8217;ve come to expect from emacs, and</li>
<li>Writes a mailreader for it ;)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/archives/8/feed</wfw:commentRss>
		</item>
		<item>
		<title>todo.pl ratmenu</title>
		<link>http://blog.nelhage.com/archives/7</link>
		<comments>http://blog.nelhage.com/archives/7#comments</comments>
		<pubDate>Wed, 20 Feb 2008 03:46:00 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[hiveminder]]></category>

		<category><![CDATA[ratmenu]]></category>

		<category><![CDATA[todo.pl]]></category>

		<guid isPermaLink="false">http://nelhage.scripts.mit.edu/madeofbugs/?p=7</guid>
		<description><![CDATA[broder has been hacking on some better quicksilver
integration for Hiveminder using todo.pl.

I don&#8217;t use a mac, but I don&#8217;t see why linux users shouldn&#8217;t get fun
toys to. So I hacked up the following two-liner that uses
todo.pl and ratmenu to pop up a list of tasks, and mark
one as completed:

#!/bin/sh
todo.pl &#124; perl -ne 'push @a,$2,"todo.pl done [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ebroder.net">broder</a> has been hacking on some better quicksilver
integration for <a href="http://hiveminder.com">Hiveminder</a> using todo.pl.</p>

<p>I don&#8217;t use a mac, but I don&#8217;t see why linux users shouldn&#8217;t get fun
toys to. So I hacked up the following two-liner that uses
<a href="http://hiveminder.com/tools">todo.pl</a> and ratmenu to pop up a list of tasks, and mark
one as completed:</p>

<pre><code>#!/bin/sh
todo.pl | perl -ne 'push @a,$2,"todo.pl done $1" if /^#([\w]+) (.+)$/;&#8217; \
               -e &#8216;END{exec(&#8221;ratmenu&#8221;,@a)}&#8217;
</code></pre>

<p>I dropped it into my <code>~/bin</code> and bound it to <code>C-t x</code> in my window
manager (<a href="http://xmonad.org">XMonad</a>). I love it already.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/archives/7/feed</wfw:commentRss>
		</item>
		<item>
		<title>A week with the iPhone</title>
		<link>http://blog.nelhage.com/archives/6</link>
		<comments>http://blog.nelhage.com/archives/6#comments</comments>
		<pubDate>Mon, 31 Dec 2007 05:41:00 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[hardware]]></category>

		<category><![CDATA[iPhone]]></category>

		<category><![CDATA[sync]]></category>

		<guid isPermaLink="false">http://nelhage.scripts.mit.edu/madeofbugs/?p=6</guid>
		<description><![CDATA[I&#8217;ve had a new iPhone for about a week now, so I figure it&#8217;s time to
write up some thoughts about it.

First, the little things. It is, in typical Apple fashion, an
incredibly slick piece of work. Scrolling and zooming images or
webpages is simple, easy, and, well, just fun to do and watch. Mobile
Safari does a great [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had a new iPhone for about a week now, so I figure it&#8217;s time to
write up some thoughts about it.</p>

<p>First, the little things. It is, in typical Apple fashion, an
incredibly slick piece of work. Scrolling and zooming images or
webpages is simple, easy, and, well, just fun to do and watch. Mobile
Safari does a great job of making full webpages usable on the tiny
screen.</p>

<p>The keyboard is totally fine after a little practice. I don&#8217;t think
it&#8217;d work nearly as well for e.g. working at a shell; the predictive
text is key to using it well, and getting at symbols is a bit of a
pain. Also, I&#8217;ve found that using it (or just using the phone heavily)
with one hand (phone in palm, thumb on keys) is <em>horrible</em> for my
hand. Doing so for more than a very short time leaves the back of my
hand and/or thumb hurting for the rest of the day.</p>

<p>I haven&#8217;t hacked the phone at all &#8212; Firmare 1.1.2 patched the hole
jailbreakme used to get in, and my attempts to downgrade the firmware
left the phone nonfunctional until I flashed it up again. I may try
again later, but I&#8217;ll probably just wait and see what the official SDK
looks like in a month or two.</p>

<p>My first major complaint about the iPhone is that it seems to be, for
all it&#8217;s supposedly running a nearly full-blown OS X, a single-tasking
device. There&#8217;s no way that get Mail to download your email in the
background. Switch away from Safari, and the only option is to pause
what it&#8217;s doing, not keep loading or running JS in the background. So,
if I want to be logged into AIM via a Web 2.0 javascript client,
that&#8217;s all I&#8217;m doing. No checking mail or making notes in the
background, or even browsing the web in abother window! Leave two
windows open long enough, and Safari will eventually decide to
entirely forget about the contents of the inactive one, presumably to
save memory. I haven&#8217;t checked, but I bet even an incoming call will
completely pause whatever&#8217;s running, so stay on a call for more than
30s and you&#8217;ll get bumped. I understand the desire to keep resource
usage down, but this is pretty annoying.</p>

<p><strong>Edit</strong>: Apparently Mail is fetching in the background. That doesn&#8217;t
change the fact that Safari, and hence every &#8220;supported&#8221; custom &#8220;app&#8221;
(by which I mean webapps), can&#8217;t run in the background.</p>

<p>The second issue is more fundamental. The iPhone seems to be basically
a dumb internet client. It expects to be connected to the web all the
time. Take away the web, and it becomes more of an iPod than a
PDA. And EDGE, while it&#8217;s not horrible, just doesn&#8217;t quite cut it for
this purpose. Hiveminder is practically unusable from the thing over
EDGE, due to the server roundtrips for every operation. And while a
local client might be able to hide that in the background, we don&#8217;t
(currently) get the ability to write such a thing even if someone
wanted. The Javascript AIM client I&#8217;ve been using is decent, but it&#8217;s
definitely not as smooth as a local one could be. (And Safari doesn&#8217;t
save passwords, so I get to type my password, mixed caps and symbols
and all, on the soft keyboard every time. It&#8217;s the little things.)
You also can&#8217;t save content from the web on the phone itself; You can
download images or calendars from a computer to the phone, but not
from the phone itself, which is pretty annoying.</p>

<p>I&#8217;ve spent most of the last four days outside of wifi, so I&#8217;ve been
using the phone via EDGE a lot. I&#8217;m starting to buy into Jesse&#8217;s
vision of a disconnected syncable future more and more. I really want
my data local, not 1s latency away, or completely inaccessible because
I happened to step inside the wrong building.</p>

<p>I think the summary is: No, cute little JS webapps are not in fact
nearly sufficient as a development platform for this thing. It&#8217;s got
great potential, but Apple, please give us a real SDK. When you
release your announced SDK in a month or so, it had better let us
write apps that are first-class in every way compared to the built-in
apps. Otherwise, I will never be able to take the (unhacked) iPhone
seriously.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/archives/6/feed</wfw:commentRss>
		</item>
		<item>
		<title>DEF CON</title>
		<link>http://blog.nelhage.com/archives/5</link>
		<comments>http://blog.nelhage.com/archives/5#comments</comments>
		<pubDate>Mon, 06 Aug 2007 02:53:00 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[DEFCON]]></category>

		<category><![CDATA[hackers]]></category>

		<category><![CDATA[summer]]></category>

		<guid isPermaLink="false">http://nelhage.scripts.mit.edu/madeofbugs/?p=5</guid>
		<description><![CDATA[I&#8217;m sitting in the airport in Las Vegas on the way back from [DEF
CON][http://defcon.org] 15. It&#8217;s the first time I&#8217;ve been at the con,
and it wasn&#8217;t really what I expected. Frankly, I walked away feeling
kinda underwhelmed.

Very few of the talks were as technical as I was hoping &#8212; they were
almost universally broad overviews of an [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sitting in the airport in Las Vegas on the way back from [DEF
CON][http://defcon.org] 15. It&#8217;s the first time I&#8217;ve been at the con,
and it wasn&#8217;t really what I expected. Frankly, I walked away feeling
kinda underwhelmed.</p>

<p>Very few of the talks were as technical as I was hoping &#8212; they were
almost universally broad overviews of an area, with lots of
introduction, and relatively little, to my eye, technical meat. Jim
informs me this is fairly typical, and it makes sense, but it was
disappointing for me. I was really hoping to find more talks that I
would have to stretch to understand, or look at the slides later over
Wikipedia and some code samples to figure out what was going on, but
everything I saw felt kinda dumbed-down. It&#8217;s probably realistically
all I can expect from a con of that size, but it&#8217;s not what I was
hoping for.</p>

<p>I felt like I was disappointed at the amount of cool random hacker
energy from the attendants, as well. DEF CON seems to be universally
characterized as “hardk0re”, but it didn&#8217;t always feel like it to
me. There was a “Øwn the box, Own the box” contest, where about a
dozen boxes were put on the network at published IPs, and if you
compromised one of them, you would walk away with it. Not one of them
got owned, even ones running known-vulnerable services (albeit
protected by ASLR and some form of W^X). Maybe the boxes actually were
just really secure, but I had hoped that at the place with a
reputation for “The world&#8217;s most hostile network,” one of them would
have gotten cracked. It seems like people — at least the people with
real skill and experience — probably just weren’t trying. Obviously a
crappy PIII isn’t worth the time you’re going to spend cracking it,
but I would hope people would do it for the fun and the challenge.</p>

<p>Maybe part of the problem is that no one wanted to take much time out
of the talks to work on other stuff. I think that if I go back, I&#8217;ll
probably punt most of the talks, and spend my time at the contests,
learning to pick locks better, or participating in aCTF or attacking
the ØtB/OtB boxes myself. I severely doubt I would have won anything,
but I think I would have learned more, and met more cool people, than
I did at the talks.</p>

<p>I am glad I went, despite the disappointment. It was fun, some of the
talks were pretty cool, the DEF CON badge is totally fucking awesome
(I think I&#8217;m going to try to get the technology and time to hack at it
over the year), the NBC Dateline reporter getting outed was fucking
hilarious, and it was a really interesting experience. I&#8217;m not yet
sure whether or not I&#8217;ll go back again, though.</p>

<p>I might follow up this post with a more specific one about things that
were cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/archives/5/feed</wfw:commentRss>
		</item>
		<item>
		<title></title>
		<link>http://blog.nelhage.com/archives/3</link>
		<comments>http://blog.nelhage.com/archives/3#comments</comments>
		<pubDate>Sun, 11 Feb 2007 05:33:00 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[6.170]]></category>

		<category><![CDATA[cvs]]></category>

		<category><![CDATA[svk]]></category>

		<category><![CDATA[svn]]></category>

		<category><![CDATA[tailor]]></category>

		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://nelhage.scripts.mit.edu/madeofbugs/?p=3</guid>
		<description><![CDATA[I&#8217;m taking 6.170 Lab in Software
Engineering this semester. The course sucks in various ways, but
one of the most egregious, in my opinion, is that they force you to
use CVS for your version control. Problem sets are distributed by the
TAs importing them into your repository, and are then checked out
later to be graded. Well, CVS sucks, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m taking <a href="http://web.mit.edu/6.170/www/">6.170</a> Lab in Software
Engineering this semester. The course sucks in various ways, but
one of the most egregious, in my opinion, is that they <em>force</em> you to
use CVS for your version control. Problem sets are distributed by the
TAs importing them into your repository, and are then checked out
later to be graded. Well, CVS sucks, and there&#8217;s no way I&#8217;m going to
use it when there are sane, modern alternatives like SVN and
<a href="http://svk.bestpractical.com/">SVK</a></p>

<p>Luckily for sanity, there&#8217;s a great piece of software called
<a href="http://www.darcs.net/DarcsWiki/Tailor">Tailor</a> designed to solve exactly this problem &#8212; it lets you
mirror a repository that uses one version control system into one
using another. So, I can mirror the required CVS repository into a svn
repository somewhere, and operate against that.</p>

<p>But the issue is that tailor only really does one-way mirroring; It
doesn&#8217;t do syncing and merging between the two repositories. So, if I
have svn mirror CVS, then changes I make don&#8217;t get propagated back. If
I mirror svn to CVS, I don&#8217;t get new problem sets the TAs import.</p>

<p>My current solution, which I can describe only as “I know what I am
doing is wrong”, is as follows:</p>

<ul>
<li>I have tailor set up to merge from SVN to CVS</li>
<li><code>tailor</code> runs in a SVN post-commit hook, so revisions are
automatically pushed to CVS</li>
<li><p>Whenever the TAs announce a new pset is available, I do the following:</p>

<pre><code># The svn repo is checked out at ~/6.170/psets
# The cvs repo is located at /mit/nelhage/6.170/cvsroot
# The TAs have just announced ps2 is available
$ cd ~/6.170/psets
$ cvs -d /mit/nelhage/6.170/cvsroot co /psets/ps2
$ svn add ps2
$ rm -rf /mit/nelhage/6.170/cvsroot/psets/ps2
$ svn ci -m "ps2 import from CVS"
</code></pre></li>
</ul>

<p>That is to say, I manually add the new problem set to SVN, and then
delete all trace of it from CVS, and then the commit runs tailor to
re-create it in CVS, but keeping svn as the master repository.</p>

<p>The sketchy piece is that I am <em>actually</em> deleting all trace of it
from the CVSROOT; There is no trace whatsoever of the initial import
by the TAs.</p>

<p>However, the same time, it feels somewhat elegant; The svn
repository is at all times the master, containg all the
information in the CVS repository. And, frankly, I&#8217;m uncomfortable
that the TAs are injecting things directly into my repository
anyways, so I have no problem undoing it.</p>

<ul>
<li><a href="http://web.mit.edu/nelhage/Public/6.170.tailor">tailor configuration file</a></li>
<li><a href="http://web.mit.edu/nelhage/Public/psets.post-commit">post-commit hook to run tailor</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/archives/3/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
