<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>ongardie.net</title><link>http://ongardie.net/blog/</link><description>ongardie.net Blog</description><lastBuildDate>Sat, 13 Mar 2010 14:33:55 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Upgrading to Debian Squeeze</title><link>http://ongardie.net/blog/squeeze/</link><description>&lt;a href="http://www.debian.org/" alt="www.debian.org"&gt;&lt;img style="float:right" src="http://ongardie.net/var/blog/squeeze/debian_logo.png" alt="Debian logo" /&gt;&lt;/a&gt;

&lt;p&gt;
I've switched my laptop over from Debian Lenny (stable) to Squeeze (testing).
While I made it this far with the aging software available in Lenny by
pulling newer packages from backports and unstable, I finally gave in for
Python 2.6.
&lt;/p&gt;

&lt;p&gt;
In case it helps anyone else, my laptop is a Lenovo Thinkpad T61 with an Intel
graphics chip and wifi card. Much of what broke is related to
&lt;a href="http://en.wikipedia.org/wiki/Mode-setting#Linux"&gt;kernel mode-setting (KMS)&lt;/a&gt;.
Here's the list:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I had &lt;code&gt;vga=794&lt;/code&gt; in my &lt;code&gt;/etc/default/grub&lt;/code&gt;, which is
no longer compatible. On Squeeze's kernel with this setting, the console
framebuffer did not display anything. I think the &lt;code&gt;GRUB_GFXMODE&lt;/code&gt;
variable is supposed to replace it.&lt;/li&gt;
&lt;li&gt;X failed to start and failed to let me switch back to the consoles on
Squeeze's kernel
(&lt;a href="http://packages.debian.org/squeeze/linux-image-2.6.32-trunk-amd64"&gt;linux-image-2.6.32-trunk-amd64&lt;/a&gt; 2.6.32-5).
I think you need an Intel graphics chip and 4GB of RAM to enjoy this bug (which
seems at least related to FreeDesktop's
&lt;a href="http://bugs.freedesktop.org/show_bug.cgi?id=25510"&gt;Bug #25510&lt;/a&gt;).
If you're so lucky, the kernel in unstable fixes the problem for me
(&lt;a href="http://packages.debian.org/unstable/linux-image-2.6.32-2-amd64"&gt;linux-image-2.6.32-2-amd64&lt;/a&gt; 2.6.32-8).&lt;/li&gt;
&lt;li&gt;I had a residual config file that apt did not purge at
&lt;code&gt;/etc/udev/rules.d/z60_xserver_xorg_input_wacom.rules&lt;/code&gt; that caused
screenfuls of warnings early in the boot process.&lt;/li&gt;
&lt;li&gt;Something has broken &lt;code&gt;ifconfig wlan0 up&lt;/code&gt; on boot, but an easy
work-around is to turn the hardware radio kill switch to off and then back
to on.&lt;/li&gt;
&lt;li&gt;Despite my efforts, Bluetooth is enabling itself. I'll have to find a way
to turn that off again.&lt;/li&gt;
&lt;li&gt;Instead of using &lt;code&gt;module-assistant&lt;/code&gt; to build the ThinkPad SMAPI
module, I installed the &lt;code&gt;tp-smapi-dkms&lt;/code&gt; package.&lt;/li&gt;
&lt;li&gt;IPython doesn't ship with &lt;code&gt;/usr/bin/ipython2.6&lt;/code&gt; yet, but copying
&lt;code&gt;/usr/bin/ipython2.5&lt;/code&gt; seems to work fine. (It uses &lt;code&gt;$0&lt;/code&gt;
to determine which version of Python to call.)&lt;/li&gt;
&lt;/ul&gt;
</description><guid isPermaLink="true">http://ongardie.net/blog/squeeze/</guid><pubDate>Sun, 21 Feb 2010 21:48:00 GMT</pubDate></item><item><title>Book Log</title><link>http://ongardie.net/blog/book-log/</link><description>&lt;p&gt;
&lt;p&gt;
In addition to my &lt;a href="http://ongardie.net/misc/movies/"&gt;movie log&lt;/a&gt;, I've now
started a &lt;a href="http://ongardie.net/misc/books/"&gt;book log&lt;/a&gt; going back to last
summer.
&lt;/p&gt;

&lt;h2&gt;100 Movies by May 10th?&lt;/h2&gt;
&lt;p&gt;
In other news, the movie log is now up to 87 films. I hadn't yet cranked out
any numbers with it, but this announcement is as good a time as any to start,
right?
&lt;/p&gt;

&lt;p&gt;
The movie log seems to grow roughly linearly over time. Assuming that a linear
model fits the data and that I am capable of basic statistics (neither of which
we should count on), I will have watched 100 films by the 716th day since the
start of the log, which comes out to May 10, 2010. Here's a pretty graph:
&lt;img style="display: block; margin-left: auto; margin-right: auto" src="http://ongardie.net/var/blog/book-log/movies_over_time.png" alt="movies watched over time" /&gt;
&lt;/p&gt;
</description><guid isPermaLink="true">http://ongardie.net/blog/book-log/</guid><pubDate>Sun, 14 Feb 2010 03:19:00 GMT</pubDate></item><item><title>My Brain is Out of Memory</title><link>http://ongardie.net/blog/brain-oom/</link><description>&lt;h2&gt;
I'm not writing enough.
&lt;/h2&gt;

&lt;p&gt;
The &lt;a href="http://www.stanford.edu/class/cs245/"&gt;databases course&lt;/a&gt; I'm
taking is all about "IOs", the number of disk reads and writes it takes a
database system to service a query. In the examples, the data sets are too
large to fit in the available memory, so they need to be stored on disks. Disk
IOs are extremely slow, however, so the course treats them as the only
interesting predictor of performance. But I'm working on a databases project,
&lt;a href="http://fiz.stanford.edu:8081/display/ramcloud/Home"&gt;RAMCloud&lt;/a&gt;, that
works in a completely different way, and all this talk about disk IOs seems
archaic to me.
&lt;/p&gt;

&lt;p&gt;
Still, there is something I can take away from the course. While RAMCloud
doesn't have a tiny amount of memory to work with, my brain does. If my brain's
memory is running low, despite the performance penalties involved, I need to
write thoughts down and store them for later use. Otherwise, I'll forget what
I've been thinking about and have to start all over.
&lt;/p&gt;

&lt;p&gt;
In its current form, RAMCloud is an elegant but complex beast. We have a lot of
design choices to work out, and we can't just take them one at a time. As I
race from thinking about one design concern to the next, I rarely take the time
to record my thoughts well enough to easily pick up the discussion later. The
next time I come back to a topic, my brain panics, assuming that it's a new
problem with no clear solution. Then, thousands of IOs later, I slowly pick up
on my old train of thought. It's a waste of time. It's even worse when I
interrupt other people and get them freaking out over the same thing, only to
re-discover the solution together a few minutes later.
&lt;/p&gt;

&lt;p&gt;
I just read an
&lt;a href="http://www.techcrunch.com/2010/02/06/the-war-on-interruptions-an-excerpt-from-switch-how-to-change-things-when-change-is-hard/"&gt;excerpt&lt;/a&gt;
from &lt;em&gt;Switch: How to Change Things When Change Is Hard&lt;/em&gt; by Chip and Dan
Heath, which has two great examples of how costly interruptions can be. In the
first, nurses make mistakes with medications because others (surgeons, even)
are interrupting them. In the second example, hitting closer to home, software
engineers delay their release schedule substantially by interrupting each
other. I feel guilty. I've been interrupting my officemates and group members
too much, and I think it's hurting everyone.
&lt;/p&gt;

&lt;h2&gt;
Here's what I'm going to do
&lt;/h2&gt;

&lt;p&gt;
To interrupt someone, I have to knock on an imaginary door. I'm going to make
the person inside stop what they're doing, get up, walk to the door, and open
it for me. By the time they get back to what they're doing, they will have
trouble picking it back up. I need to justify why I'm knocking, and I need to
come prepared.
&lt;/p&gt;

&lt;p&gt;
Next, when I'm done with that conversation, or when I'm done with any task,
that's a door I'm closing. Someone, maybe me, will eventually come back and
open that door. It's my responsibility now to not waste their time later. If
there's something they will need to know, it's up to me to write that down
while I still remember.
&lt;/p&gt;


</description><guid isPermaLink="true">http://ongardie.net/blog/brain-oom/</guid><pubDate>Sat, 06 Feb 2010 20:30:00 GMT</pubDate></item><item><title>Rice.edu Email Account Deleted</title><link>http://ongardie.net/blog/rice-email/</link><description>&lt;p&gt;
Rice has deleted my undergraduate email account, diego.ongaro@rice.edu , since
I am no longer a student there. If you tried to send to that address and
received a bounce notification, please resend your email to the same username at
alumni.rice.edu instead.
&lt;/p&gt;
</description><guid isPermaLink="true">http://ongardie.net/blog/rice-email/</guid><pubDate>Mon, 30 Nov 2009 05:21:00 GMT</pubDate></item><item><title>Twin Peaks iPhone Panorama</title><link>http://ongardie.net/blog/twin-peaks/</link><description>&lt;p&gt;
I went up to
&lt;a href="http://en.wikipedia.org/wiki/Twin_Peaks_(San_Francisco,_California)"&gt;Twin Peaks&lt;/a&gt;
in San Francisco with &lt;a href="http://jicksta.com"&gt;Jay&lt;/a&gt; a few weeks ago. It
was a nice view but kind of a worst-case scenario for a photo: my iPhone camera
(VGA), poor lighting as the sun was setting, and stong winds.
&lt;/p&gt;
&lt;p&gt;
That day I took a bunch of overlapping shots with my phone. Then I used the
&lt;a href="http://www.gimp.org"&gt;GIMP&lt;/a&gt;'s automatic white balance correction on
each of them. Next I stitched them together with
&lt;a href="http://hugin.sourceforge.net"&gt;Hugin&lt;/a&gt;, and finally I edited
the stitched image with the GIMP. The following mediocre image is the result
(&lt;a href="http://ongardie.net/var/blog/twin-peaks/pan_large.jpg"&gt;click&lt;/a&gt;
for the full 1534x652 image):
&lt;/p&gt;

&lt;a href="http://ongardie.net/var/blog/twin-peaks/pan_large.jpg"&gt;
&lt;img src="http://ongardie.net/var/blog/twin-peaks/pan_small.jpg" alt="panorama" /&gt;
&lt;/a&gt;

&lt;p&gt;
The 1 megapixel result really wasn't worth the time. Even in the thumbnail,
it's easy to see that multiple source images are contributing their different
colors and brightness levels. Maybe Hugin could correct for more of this with
the proper settings, but I haven't taken the time to learn it well enough to
know how. Although mine has a slightly larger angle, I think
&lt;a href="http://en.wikipedia.org/wiki/File:San_Francisco_panorama_from_Twin_Peaks.jpg"&gt;the one on wikipedia&lt;/a&gt;
still wins.
&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;
I also took this suprising shot:
&lt;/p&gt;
&lt;img src="http://ongardie.net/var/blog/twin-peaks/slanted.jpg" alt="slanted Golden Gate bridge" /&gt;

&lt;p&gt;
It turns out the iPhone's cheap camera scans horizontally from top to bottom.
As I was in a car moving left, the lines lower on the image were scanned later
and appear shifted to the right. Kirk Mastin has an
&lt;a href="http://lofihistyle.com/2008/11/iphone-rolling-shutter-creative/"&gt;interesting post&lt;/a&gt;
about this rolling shutter effect and what you can do with it.
Jeffrey Erlich also has an awesome
&lt;a href="http://www.flickr.com/photos/jerlich/sets/72157614852342118/with/3331783600/"&gt;album&lt;/a&gt;
that makes use of this effect.
&lt;/p&gt;
</description><guid isPermaLink="true">http://ongardie.net/blog/twin-peaks/</guid><pubDate>Sun, 08 Nov 2009 00:27:00 GMT</pubDate></item><item><title>Xfce Stopwatch Plugin</title><link>http://ongardie.net/blog/stopwatch/</link><description>&lt;p&gt;
I needed an excuse to try &lt;a href="http://mmassonnet.blogspot.com"&gt;Mike&lt;/a&gt;'s
&lt;a href="http://git.xfce.org/bindings/xfce4-vala/"&gt;Vala bindings for Xfce&lt;/a&gt;,
so I created a new little plugin for the panel, the
&lt;a href="http://goodies.xfce.org/projects/panel-plugins/xfce4-stopwatch-plugin"&gt;xfce4-stopwatch-plugin&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
In the original release announcement on July 28th, I wrote:
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
This is the first release of the stopwatch panel plugin, which you can
use to time yourself on different tasks. It's stable and usable, but
quite minimal still.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;
The functionality is best summarized with this image from the web site:
&lt;img src="http://ongardie.net/var/blog/stopwatch/help.png" alt="screenshots" /&gt;
&lt;/p&gt;

&lt;h2&gt;Vala&lt;/h2&gt;
&lt;p&gt;
From their web site,
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
&lt;a href="http://live.gnome.org/Vala"&gt;Vala&lt;/a&gt; is a new programming language
that aims to bring modern programming language features to GNOME developers
without imposing any additional runtime requirements and without using a
different ABI compared to applications and libraries written in C.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;
Instead of having to write tons of
&lt;a href="http://library.gnome.org/devel/gobject/unstable/howto-gobject.html"&gt;boilerplate code&lt;/a&gt;
to create new GObjects in C and for other common tasks in developing GTK-based
applications, Vala builds these features into the language. The Vala code you
write passes through the Vala compiler, which produces GObject-based C code.
From there, GCC compiles that to a binary as usual. There is no runtime, so
Vala-produced code can run as fast as hand-coded C.
&lt;/p&gt;

&lt;p&gt;
Vala makes it easy to write fast, object-oriented code for GTK-based projects.
With Mike's Xfce bindings for Vala, you gain access to Xfce's libraries from
Vala, letting you write panel plugins or other Xfce projects in Vala. It's a
cool idea and something I definitely wanted to try.
&lt;/p&gt;

&lt;h2&gt;Developing the Stopwatch Plugin&lt;/h2&gt;
&lt;p&gt;
In general, Vala is pretty easy to write if you've worked with GObject before.
I did hit a few bugs while developing even this simple plugin, so it's evident
that Vala and the Xfce bindings aren't mature yet:
&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;
I filed &lt;a href="http://bugzilla.gnome.org/show_bug.cgi?id=587150"&gt;GNOME Bug 587150&lt;/a&gt;,
a bug in Vala's POSIX bindings for the &lt;code&gt;time_t&lt;/code&gt; type. Vala treats it
as a GObject instead of an integer, making it unusable to pass around your
program in many ways. This bug hasn't seen any attention yet, but I've worked
around it for Stopwatch by not using &lt;code&gt;time_t&lt;/code&gt;.
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Evan Nemerson fixed this one.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
I &lt;a href="http://git.xfce.org/bindings/xfce4-vala/commit/?id=f1695e8f95e9647db4989c968cf4768476272e0e"&gt;patched&lt;/a&gt;
a small bug in Xfce's Vala bindings for the
&lt;a href="http://www.xfce.org/documentation/4.6/api/libxfce4panel/XfceHVBox.html"&gt;XfceHVBox&lt;/a&gt;
widget. The Vala compiler was producing calls to &lt;code&gt;xfce_hv_box_new()&lt;/code&gt;
instead of &lt;code&gt;xfce_hvbox_new()&lt;/code&gt;, which of course caused a problem when
GCC tried to resolve the symbol.
&lt;/li&gt;

&lt;li&gt;
I also filed &lt;a href="http://bugzilla.gnome.org/show_bug.cgi?id=589930"&gt;GNOME Bug 589930&lt;/a&gt;,
a bug in Vala's generated code for &lt;code&gt;sscanf&lt;/code&gt;. It always added an
extra NULL argument at the end of the arguments list. Jürg Billeter fixed this
one quickly with
&lt;a href="http://git.gnome.org/cgit/vala/commit/?id=7d5a61e38664ceabfe6a903af38d057bdf831a4b"&gt;this commit&lt;/a&gt;,
which made it into Vala 0.7.5.
&lt;/li&gt;

&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;
Despite these hurdles, writing the Stopwatch plugin in Vala has been a
pleasure. Admittedly the plugin doesn't do much, but the code is very short and
straight-forward.
&lt;/p&gt;

&lt;p&gt;
Stopwatch will probably see just one or two more releases before it's
feature-complete. I'd also like to port the Places plugin to Vala at some
point, but I'm waiting to see how volume management plays out once
&lt;a href="http://gezeiten.org/post/2009/06/Preview:-Browsing-SFTP-with-Thunar"&gt;ThunarVFS is gone&lt;/a&gt;.
&lt;/p&gt;
</description><guid isPermaLink="true">http://ongardie.net/blog/stopwatch/</guid><pubDate>Mon, 17 Aug 2009 03:49:00 GMT</pubDate></item><item><title>Lighttpd Fails to Bind to Localhost</title><link>http://ongardie.net/blog/lighttpd-bind-localhost/</link><description>&lt;img style="float:left" src="http://ongardie.net/var/blog/lighttpd-bind-localhost/lighttpd_logo.png" alt="lighttpd logo" /&gt;

&lt;p&gt;
I installed the web server &lt;a href="http://www.lighttpd.net"&gt;lighttpd&lt;/a&gt;
on my laptop to test some configuration settings. As I didn't want to expose
the server on the network, I uncommented
&lt;code&gt;server.bind = "localhost"&lt;/code&gt; from
&lt;code&gt;/etc/lighttpd/lighttpd.conf&lt;/code&gt;.
&lt;/p&gt;

&lt;p style="clear: both"&gt;
Then, restarting lighttpd failed with the following error:
&lt;/p&gt;
&lt;pre&gt;
&lt;span style="display:none"&gt;(network.c.201)&lt;/span&gt;getaddrinfo failed:  Name or service not known ' localhost '
&lt;/pre&gt;

&lt;p&gt;
This is lighttpd 1.4.19-5 from main on Debian Lenny.
&lt;/p&gt;

&lt;p&gt;
I was still able to ping localhost and checked my &lt;code&gt;/etc/hosts&lt;/code&gt; file,
but everything seemed fine. Finally, I checked the line of code the error
points to (network.c line 201) and noticed it's part of an IPv6-specific chunk
of code.
&lt;/p&gt;

&lt;p&gt;
I found I could work around this issue by disabling IPv6 entirely in
&lt;code&gt;/etc/lighttpd/lighttpd.conf&lt;/code&gt;. For the uninitiated, comment out this
line:
&lt;/p&gt;
&lt;pre&gt;
&amp;#35;&amp;#35; Use ipv6 only if available.
include_shell "/usr/share/lighttpd/use-ipv6.pl"
&lt;/pre&gt;

&lt;h2&gt;Other Reports of This Issue&lt;/h2&gt;
&lt;p&gt;
A &lt;a href="http://forum.lighttpd.net/topic/64647"&gt;couple reports&lt;/a&gt; of the
same problem can be found on the old lighttpd forums, but no resolution was
reached. Unfortunately, I can't reply there because those forums are now
locked, and historical threads were not copied to lighttpd's new forums. The
first report was from Debian's 1.4.19-1 package, and the second report does not
identify the version.
&lt;/p&gt;

&lt;p&gt;
A &lt;a href="http://lists.debian.org/debian-user-spanish/2009/03/msg00751.html"&gt;post&lt;/a&gt;
on the debian-user-spanish list reports the same problem on Debian Lenny but
received no replies.
&lt;/p&gt;

&lt;p&gt;
That mailing list post does point to
&lt;a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=489063"&gt;Debian bug 489063&lt;/a&gt;
(which doesn't come up on Google when you search for the error message). There,
Pierre Habouzit, one of lighttpd's maintainers on Debian, suggests using
&lt;code&gt;server.bind = "::1"&lt;/code&gt; instead of &lt;code&gt;server.bind = "localhost"&lt;/code&gt;
when IPv6 is enabled. This will start up the server without errors, but then I
can only access it as &lt;code&gt;http://ip6-localhost/&lt;/code&gt; (not
&lt;code&gt;http://localhost/&lt;/code&gt;).
&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;
This is a pretty annoying little issue, and it hasn't fully been resolved.
At a minimum, this:
&lt;/p&gt;
&lt;pre&gt;
&amp;#35;&amp;#35; bind to localhost only (default: all interfaces)
# server.bind                = "localhost"
&lt;/pre&gt;
&lt;p&gt;
should be:
&lt;/p&gt;
&lt;pre&gt;
&amp;#35;&amp;#35; bind to localhost only (default: all interfaces)
&amp;#35;&amp;#35; use ::1 when IPv6 is enabled or localhost for IPv4
&amp;#35;&amp;#35; (see Debian bug #489063)
# server.bind                = "::1"
# server.bind                = "localhost"
&lt;/pre&gt;
&lt;p&gt;
That would at least point people in the right direction.
&lt;/p&gt;
&lt;p&gt;
I've sunk enough time into this for now, though.
I'll post an update here if I pursue this any further.
&lt;/p&gt;
</description><guid isPermaLink="true">http://ongardie.net/blog/lighttpd-bind-localhost/</guid><pubDate>Wed, 05 Aug 2009 15:21:00 GMT</pubDate></item><item><title>Chef Roger's Knife List</title><link>http://ongardie.net/blog/chef-roger-knives/</link><description>&lt;p&gt;
Last semester at Rice, I took the class Cooking with Chef Roger. The
man is passionate about his knives, and he gave us a list of brands he
recommends. From one of the few scraps of notes that survived, here is
Chef Roger Elkhouri's list of quality brands for chef's knives (French
knives):
&lt;/p&gt;

&lt;a style="float:right" href="http://commons.wikimedia.org/wiki/File:Chef's_Knife.jpg"&gt;&lt;img src="http://ongardie.net/var/blog/chef-roger-knives/chefs_knife.jpg" alt="chef's knife" /&gt;&lt;/a&gt;

&lt;h2&gt;Mid-Range Brands&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.cuisinart.com/"&gt;Cuisinart&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.kitchenaid.com/"&gt;KitchenAid&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Top-of-the-Line Brands&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://usa.jahenckels.com/"&gt;J.A. Henckels&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.wusthof.com/"&gt;Wusthof&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.fdick.com/"&gt;Friedr. Dick&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.victorinox.com/"&gt;Victorinox&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.global-knife.com/"&gt;Global&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.kershawknives.com/products.php?brand=shun"&gt;Shun&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description><guid isPermaLink="true">http://ongardie.net/blog/chef-roger-knives/</guid><pubDate>Sun, 02 Aug 2009 17:56:00 GMT</pubDate></item><item><title>Xorg.conf for QEMU/KVM</title><link>http://ongardie.net/blog/qemu-xorg/</link><description>&lt;p&gt;
If you want to use a large resolution with a QEMU or KVM virtual
machine, you'll need to manually specify a few things in xorg.conf.
Out of the box, you can usually only use resolutions up to 800x600,
although Fedora and Ubuntu have
&lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=251264"&gt;patched this&lt;/a&gt;
up to 1024x768.
&lt;/p&gt;

&lt;p&gt;
I created this
&lt;a href="http://ongardie.net/var/blog/qemu-xorg/xorg.conf"&gt;xorg.conf&lt;/a&gt;
to work with larger resolutions. With it, I was able to use up to
1280x1024 with the default emulated graphics and up to 1920x1200 when
passing the &lt;code&gt;-std-vga&lt;/code&gt; option to QEMU or KVM.
&lt;/p&gt;

&lt;p&gt;
To make use of this:
&lt;/p&gt;
&lt;ol&gt;
 &lt;li&gt;
    Back up your existing &lt;code&gt;/etc/X11/xorg.conf&lt;/code&gt; in your
    virtual machine, if any.
 &lt;/li&gt;
 &lt;li&gt;
    Save the file to &lt;code&gt;/etc/X11/xorg.conf&lt;/code&gt; in your virtual
    machine:
&lt;pre&gt;
sudo wget -O /etc/X11/xorg.conf &amp;#92;
http://ongardie.net/var/blog/qemu-xorg/xorg.conf
&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    If you want to use a resolution other than 1280x1024, modify the
&lt;code&gt;Modes&lt;/code&gt; line to suit your needs.
  &lt;/li&gt;
  &lt;li&gt;
    Start or restart your virtual machine's X server.
  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
If you're having problems, try passing QEMU/KVM the &lt;code&gt;-std-vga&lt;/code&gt; flag.
&lt;/p&gt;
</description><guid isPermaLink="true">http://ongardie.net/blog/qemu-xorg/</guid><pubDate>Wed, 01 Jul 2009 03:02:00 GMT</pubDate></item><item><title>Cgit Hacking</title><link>http://ongardie.net/blog/cgit-hacking/</link><description>&lt;img src="http://ongardie.net/var/blog/cgit-hacking/cgit-logo.png" alt="cgit logo" style="float:right" /&gt;
&lt;p&gt;
Last week I hacked a couple new features into
&lt;a href="http://hjemli.net/git/cgit/about/"&gt;cgit&lt;/a&gt;, a web interface
for Git, since it's the one I
&lt;a href="http://ongardie.net/git/"&gt;use on ongardie.net&lt;/a&gt;. I added
&lt;code&gt;https://&lt;/code&gt; URLs for the Atom feed and also syntax highlighting when
viewing files.
&lt;/p&gt;

&lt;h2&gt;HTTPS URLs for Cgit's Atom feed&lt;/h2&gt;
&lt;p&gt;
Cgit generates Atom feeds so that you can keep track of changes from
your feed reader. Unfortunately, that requires a full URL, which it
assumed started with &lt;code&gt;http://&lt;/code&gt;. This obviously didn't work
for &lt;code&gt;https://&lt;/code&gt;-only installations.
&lt;/p&gt;
&lt;p&gt;
I modified cgit to check the &lt;code&gt;HTTPS&lt;/code&gt; CGI variable. If it's
set to &lt;code&gt;on&lt;/code&gt;, cgit now generates full URLs starting with
&lt;code&gt;https://&lt;/code&gt;. While this isn't part of the official CGI spec,
most servers will set it, including Apache and lighttpd.
&lt;/p&gt;
&lt;p&gt;
Lars Hjemli, the maintainer of cgit,
&lt;a href="http://hjemli.net/git/cgit/commit/?h=wip&amp;amp;id=086fef8a4a1a5f90eafb21fcbc4b3731d6736cb1"&gt;merged in my change&lt;/a&gt;, 
so it should be part of a future cgit release:
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
This looks good. I've merged it into my wip-branch on
&lt;a href="http://hjemli.net/git/cgit"&gt;http://hjemli.net/git/cgit&lt;/a&gt;
where I'll let it cook for a little while before merging to my master.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;Syntax Highlighting for Cgit&lt;/h2&gt;
&lt;p&gt;
Cgit is useful for browsing around a project's history, but it didn't do
syntax highlighting for source code. This made it unpleasant to use for
reading complete files (as opposed to diffs).
&lt;/p&gt;

&lt;p&gt;
I modified cgit to make use of the
&lt;a href="http://www.andre-simon.de/doku/highlight/en/highlight.html"&gt;highlight&lt;/a&gt;
program, when available, to color source code. If highlight is
unavailable or fails, cgit falls back to the old black-and-white view.
&lt;/p&gt;

&lt;p&gt;
While the patch is small and self-contained, it's specific to highlight
and just tacked on in the source code. Lars didn't take this one:
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
I like the result, but I think the implementation has to be more
generic. And I'm currently about to add support for a few plugins/hooks
to cgit which I think can be used to achieve the same result so lets see
how that works out first, ok?
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
I'll be working with Lars on getting a cleaner solution merged into his
tree once he's added support for plugins. In the mean time, feel free to
use the code from my repository, which seems to work just fine.
&lt;/p&gt;

&lt;hr /&gt;
&lt;p&gt;
Both of these features can be found on my cgit repo:
&lt;/p&gt;
&lt;ul&gt;
 &lt;li&gt;git clone http://ongardie.net/cgit.git&lt;/li&gt;
 &lt;li&gt;&lt;a href="http://ongardie.net/git/cgit/"&gt;cgit front-end&lt;/a&gt; (running
here with both of these changes)&lt;/li&gt;
&lt;/ul&gt;
See the &lt;code&gt;https&lt;/code&gt; and &lt;code&gt;highlight&lt;/code&gt; branches,
respectively. Both were branched from cgit's &lt;code&gt;master&lt;/code&gt; branch.
</description><guid isPermaLink="true">http://ongardie.net/blog/cgit-hacking/</guid><pubDate>Wed, 17 Jun 2009 16:45:00 GMT</pubDate></item><item><title>Tabs in Vim</title><link>http://ongardie.net/blog/vim-tabs/</link><description>&lt;img src="http://ongardie.net/var/blog/vim-tabs/vim-logo.png" alt="Vim logo" style="float:right" /&gt;
&lt;p&gt;
Version 7 of Vim introduced tabs to the editor, and these are a few of
my tab-related tips.
If you aren't familiar with tabs in Vim, start with the basics
on
&lt;a href="http://blog.golden-ratio.net/2008/08/19/using-tabs-in-vim/"&gt;The Golden Ratio&lt;/a&gt;
or
&lt;a href="http://www.linux.com/archive/articles/59533"&gt;Linux.com&lt;/a&gt;.
&lt;/p&gt;

&lt;h2&gt;Open Files in Tabs&lt;/h2&gt;
&lt;p&gt;
If you want to open multiple files in their own tabs in a new Vim
session, use the &lt;code&gt;-p&lt;/code&gt; flag on the command line for
&lt;code&gt;vim&lt;/code&gt; or &lt;code&gt;gvim&lt;/code&gt;. For example, to open all files
in the current directory, use the following:&lt;/p&gt;
&lt;pre&gt;
vim -p *
&lt;/pre&gt;

&lt;p style="padding-top: 10px"&gt;
When you give Vim multiple files to edit, its default behavior is to
use several buffers. If you want to use tabs as the default behavior
instead (that is, without typing the &lt;code&gt;-p&lt;/code&gt; flag every time),
set up a couple shell aliases. For bash, place these in your
&lt;code&gt;~/.bashrc&lt;/code&gt;:
&lt;/p&gt;
&lt;pre&gt;
alias vim='vim -p'
alias gvim='gvim -p'
&lt;/pre&gt;

&lt;p style="padding-top: 10px"&gt;
Also, Vim will open a maximum of 10 tabs like this by default. To
increase that limit to, for example, 50, add the following to your
&lt;code&gt;~/.vimrc&lt;/code&gt;:
&lt;/p&gt;
&lt;pre&gt;
set tabpagemax=50
&lt;/pre&gt;

&lt;h2&gt;Easier Tab Navigation&lt;/h2&gt;
&lt;p&gt;
When you have more than a few tabs open, it can become difficult to
navigate them with only the keyboard. You can use
&lt;code&gt;{count}gt&lt;/code&gt; to go to the &lt;em&gt;count&lt;/em&gt;-th tab
(starting with 1), but counting them yourself is a waste of time.
Placing the tab number on its label solves this problem.
&lt;/p&gt;
&lt;img src="http://ongardie.net/var/blog/vim-tabs/vim-tab-labels.png" alt="Vim tab labels" /&gt;
&lt;p&gt;
You can see how I set a custom tab label in
&lt;a href="http://ongardie.net/git/vim/commit/?id=ae39cc8678860376a07cd3e797f78135cb134fa3"&gt;this&lt;/a&gt;
commit to my Vim configuration repository.
The blog post on
&lt;a href="http://blog.golden-ratio.net/2008/08/19/using-tabs-in-vim/"&gt;The Golden Ratio&lt;/a&gt;
has another custom tab label you could check out.
&lt;/p&gt;
</description><guid isPermaLink="true">http://ongardie.net/blog/vim-tabs/</guid><pubDate>Fri, 29 May 2009 04:51:00 GMT</pubDate></item><item><title>Overlooked Python Built-Ins</title><link>http://ongardie.net/blog/python-builtins/</link><description>&lt;img src="http://ongardie.net/var/blog/python-builtins/python-logo.png" alt="Python logo" style="float:right" /&gt;
&lt;p&gt;
So, I just realized that I re-implemented two built-in Python
functions on a small project I'm working on for
&lt;a href="http://www.etszone.com"&gt;ETSZONE&lt;/a&gt;.
I just didn't know that these existed, so I'm writing about them here
in case you've overlooked them too.
&lt;/p&gt;

&lt;h2&gt;&lt;a href="http://docs.python.org/library/functions.html#sorted"&gt;sorted&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;
This is useful if you want to sort a copy of a list. Use
&lt;code&gt;sorted()&lt;/code&gt; instead of copying the list and then using
&lt;code&gt;list.sort()&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
This was my re-implementation (and I think I still like its name
better):
&lt;/p&gt;
&lt;pre&gt;
def sort(seq, **args):
    x = list(seq)
    x.sort(**args)
    return x
&lt;/pre&gt;
&lt;p&gt;
The &lt;code&gt;sorted&lt;/code&gt; function has been available since Python v2.4.
&lt;/p&gt;

&lt;h2&gt;&lt;a href="http://docs.python.org/library/functions.html#enumerate"&gt;enumerate&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;
This is useful when you want a foreach loop, but you also need a loop
counter around. Use &lt;code&gt;enumerate()&lt;/code&gt; instead of keeping a
counter elsewhere.
&lt;/p&gt;
&lt;p&gt;
For example, I was writing out a spreadsheet with
&lt;a href="http://ooolib.sourceforge.net/"&gt;ooolib-python&lt;/a&gt;.
For each spreadsheet cell to write, I had to specify row and column
indexes. I could write more natural loops with &lt;code&gt;enumerate&lt;/code&gt;,
while still having a counter to use as a row or column index.
&lt;/p&gt;
&lt;p&gt;
This was my re-implementation (and its name would have never caught
on):
&lt;/p&gt;
&lt;pre&gt;
def indexiter(iterable):
    return zip(range(len(iterable)), iterable)
&lt;/pre&gt;
&lt;p&gt;
The &lt;code&gt;enumerate&lt;/code&gt; function has been available since Python v2.3.
Read about the optional &lt;code&gt;start&lt;/code&gt; parameter in the
&lt;a href="http://docs.python.org/library/functions.html#enumerate"&gt;docs&lt;/a&gt;
- it looks useful, but it's new in Python 2.6.
&lt;/p&gt;

&lt;hr /&gt;
This shows that it's a good idea to occasionally browse back through
the very basic support a language gives you, since you might just find
a couple useful tools in there that you had overlooked. If you're into
Python, start
&lt;a href="http://docs.python.org/library/functions.html"&gt;here&lt;/a&gt;.
</description><guid isPermaLink="true">http://ongardie.net/blog/python-builtins/</guid><pubDate>Sat, 23 May 2009 04:52:00 GMT</pubDate></item><item><title>Stack Overflow DevDays Registration</title><link>http://ongardie.net/blog/stack-devday-reg/</link><description>
&lt;p&gt;
&lt;img src="http://ongardie.net/var/blog/stack-devday-reg/stackoverflow.png" alt="Stack Overflow logo" /&gt;
&lt;/p&gt;

&lt;p&gt;
I just read about Stack Overflow DevDays on &lt;a href="http://www.joelonsoftware.com"&gt;Joel on Software&lt;/a&gt;
(&lt;a href="http://www.joelonsoftware.com/items/2009/05/12.html"&gt;post&lt;/a&gt;):
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;
It's going to be in October, in five separate cities. In each city, we're
planning a one-day event.
&lt;/p&gt;

&lt;p&gt;
We decided to cram as many diverse topics as possible into a single day
event. Like a tasting menu at a great restaurant, we'll line up six great
speakers in each city.
&lt;/p&gt;

&lt;p&gt;
This is not going to be just a Java conference or a .NET conference or a
Ruby conference. This will be completely ecumenical. We'll have somebody to
introduce Microsoft's new web framework, ASP.NET MVC, but we'll also get
someone to talk about writing code for Google's new mobile operating
system, Android. And in each city, we'll find one local computer science
professor or graduate student to tell us about something new and
interesting in academia.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;
I picked up one of the $10 student tickets for San Francisco.
Now, I'm not a big &lt;a href="http://stackoverflow.com/"&gt;Stack Overflow&lt;/a&gt;
user, but, at that price, I had to go for it. I'm especially hoping to hear
more about the first 4 topics listed:
Android, Objective C and iPhone development, Google App Engine, and Python.
&lt;/p&gt;
</description><guid isPermaLink="true">http://ongardie.net/blog/stack-devday-reg/</guid><pubDate>Wed, 13 May 2009 02:17:00 GMT</pubDate></item><item><title>Extract Unique Lines From a File</title><link>http://ongardie.net/blog/sort-uniq/</link><description>&lt;p&gt;
If you want to get rid of duplicate lines from a file or pipe, use
&lt;/p&gt;
&lt;pre&gt;sort -u&lt;/pre&gt; or &lt;pre&gt;sort | uniq&lt;/pre&gt;

&lt;br /&gt;

&lt;p&gt;
For example, maybe you're searching for another front-end to &lt;code&gt;libpurple&lt;/code&gt;,
the library underneath &lt;a href="http://www.pidgin.im/"&gt;pidgin&lt;/a&gt;.
You try to use &lt;code&gt;apt-cache rdepends&lt;/code&gt;
but find the output is cluttered with duplicate entries
(&lt;a href="http://bugs.debian.org/335925"&gt;bug #335925&lt;/a&gt;).
&lt;/p&gt;

&lt;pre&gt;
$ apt-cache rdepends libpurple0 | tail -n +3 | sort
  finch
  finch
  libpurple-bin
  libpurple-bin
  libpurple-dev
  libpurple-dev
  msn-pecan
  pidgin
  pidgin
  pidgin-dbg
  pidgin-dbg
  pidgin-facebookchat
  pidgin-librvp
  pidgin-mpris
  pidgin-nateon
  pidgin-plugin-pack
  pidgin-privacy-please
  pidgin-privacy-please
  pidgin-sipe
  telepathy-haze
  telepathy-haze
&lt;/pre&gt;
&lt;p&gt;
Note that I've trimmed off the header (with &lt;code&gt;tail&lt;/code&gt;)
and sorted the list (with &lt;code&gt;sort&lt;/code&gt;) here to make this more obvious.
&lt;/p&gt;

&lt;p&gt;
Using the above tip to see only unique lines, you can easily work around this bug:
&lt;/p&gt;
&lt;pre&gt;
$ apt-cache rdepends libpurple0 | tail -n +3 | sort -u
  finch
  libpurple-bin
  libpurple-dev
  msn-pecan
  pidgin
  pidgin-dbg
  pidgin-facebookchat
  pidgin-librvp
  pidgin-mpris
  pidgin-nateon
  pidgin-plugin-pack
  pidgin-privacy-please
  pidgin-sipe
  telepathy-haze
&lt;/pre&gt;
</description><guid isPermaLink="true">http://ongardie.net/blog/sort-uniq/</guid><pubDate>Fri, 08 May 2009 04:52:00 GMT</pubDate></item><item><title>Off-Brand Q-tips</title><link>http://ongardie.net/blog/q-tips/</link><description>&lt;p&gt;To start off this blog, I'm writing about things you stick in your ear. I suspect I'll end up writing about techier subjects soon enough. Nevertheless, it's probably worthwhile to &lt;em&gt;attempt&lt;/em&gt; to set a precedent of, at least occasionally, writing about something low-tech.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Q-tips, or rather &lt;em&gt;cotton swabs&lt;/em&gt;, always warn you not to insert them into your ear canal. After all, they officially have a &lt;a href="http://www.qtips.com/variety.php"&gt;variety of legitimate uses&lt;/a&gt;. Let's face it though: they were &lt;a href="http://home.nycap.rr.com/useless/q-tips/"&gt;created for ear cleaning&lt;/a&gt;, so they work rather well for that.&lt;/p&gt;

&lt;div class="center"&gt;&lt;img src="http://ongardie.net/var/blog/q-tips/ear_warning.jpg" alt="Warning on Q-tips package" /&gt;&lt;/div&gt;

&lt;p&gt;Well, cotton swabs aren't something you need to buy very often. You have to run out of them to realize just how nice they are. My roommate Matt and I ran out of cotton swabs on Monday a couple weeks ago. So, of course, that Wednesday I had a doctor's appointment. The ear thermometer must have had a fun time in there...&lt;/p&gt;

&lt;p&gt;Anyway, I was still pretty thankful we ran out. We had the off-brand, wannabe Q-tips before. The ones with a tiny amount of cotton on each end. The ones that will not give until they entirely bend in the center. I've grown to hate the off-brands with a passion, and yet seem to keep encountering them.&lt;/p&gt;

&lt;img  style="float:right" src="http://ongardie.net/var/blog/q-tips/price_per_unit.jpg" alt="Per unit price of off-brand cotton swabs" /&gt;

&lt;p&gt;It's marketing. The real Q-tips are more expensive at the store. The off-brands cost a couple bucks less, and you &lt;em&gt;get more&lt;/em&gt; - the price per unit of the off-brands can't be beat. The problem is, you don't want more. You &lt;em&gt;really&lt;/em&gt; don't want more of them. You'll go home with your 300-pack of $1.99 cotton swabs, try to clean your ear with one, and get just a little pissed off at how ineffective it is. The next day after your shower, you'll again be a little pissed off. Even if you share your cotton swabs with someone else, you're still going to be a little pissed off, every single day, for about the next 5 months. Is that really worth saving a couple bucks?&lt;/p&gt;
</description><guid isPermaLink="true">http://ongardie.net/blog/q-tips/</guid><pubDate>Sat, 29 Dec 2007 05:50:00 GMT</pubDate></item></channel></rss>