the ned net/ nedlog/ tags/ software

This feed contains pages in the "software" category.

urxvtd: a terminal daemon

urxvt (rxvt-unicode) is a terminal emulator with Unicode support. I recently switched from uxterm to urxvt because uxterm didn't properly parse key combinations including the Alt key and didn't always display non-Latin characters. Neither are particularly major annoyances.

While looking through the man page to find how to turn off the scroll bar, I learned about urxvtd: a daemon that opens multiple terminal windows in the same process. The advantage for doing so is faster creation time and reduced memory usage. I found that neither amounted to much in my case - the startup time improvement is barely noticeable and for the ten or so terminal windows I may have going, the memory savings appear negligible. It's still a nifty idea, and in any event the Alt key combinations work properly and characters I don't understand display as they should.

To use urxvtd, put the following in your ~/.xinitrc or ~/.xsession to start the daemon on login and exit on logout:

urxvtd -q -f -o

Then run the client with urxvtc. That was quick.

I'm using the following X resource definitions to make it look pretty:

URxvt.background: AntiqueWhite
URxvt.foreground: black
URxvt.scrollBar: off
URxvt.font: xft:DejaVu Sans Mono-12
Posted early Tuesday morning, July 10th, 2007 Tags: software
vim QuickFix

vim QuickFix is a nice feature that figures out how you screwed up your code by looking at compiler errors. It repositions your cursor over the first offending line and will show you the other errors on demand.

By default, it's set up for C/C++, but it's easy enough to set up for Java if you're using Ant. Set your 'makeprg' to ant without logging adornments:

:set makeprg=ant\ -emacs

And make a mistake in your Java code. Run ':make', and vim will background while ant runs. When you return to vim, your cursor should be over the error and you can run ':cl' to see the other errors in the compilation. Cool.

You'll need to make sure that your current working directory contains the build.xml file; I do this by using vimproject.

Posted Thursday evening, July 5th, 2007 Tags: code software
Bowdoin moves to Microsoft Exchange

The Bowdoin Orient has an article in this week's paper about student reactions to the new Microsoft Exchange webmail: "E-mail system gets poor reviews".

In summary, students don't use many of the features available and often can't use the features they want because those features only work in Internet Explorer on Windows. The switch to Exchange has traded the ability to search through email and manipulate multiple messages at the same time for shared calendars and task lists.

What really surprised me about the article was that 435 students forward their mail to an external account and don't use Bowdoin's system. That's one-fourth of the student population! IT says they're listening to students - the article reports that the CIO meets regularly with a student IT advisory council and a previous Orient article notes that students tested Exchange before the big roll-out - but you wouldn't know it looking at the end result.

Posted at lunch time on Friday, February 2nd, 2007 Tags: bowdoin opinion software
CRT Out on the IBM X40

I've got a presentation tomorrow, and I, like all good presenters, plan on boring my audience to tears by showing a computerized slide show and reading text off it word-from-word. In order to accomplish this noble goal, I needed to get video out working on my laptop.

The IBM folks seemed to have planned for everything, and if I press Fn+F7, the laptop switches on its external display settings and pipes the screen out to the projector. Great! Unfortunately, in so doing it turns off the laptop display, which clearly thwarts me from reading verbatim what is projected.

Soultion: use i810switch to manually turn the external display on without turning the built-in display off. Handy utility script:

#!/bin/sh

if [ $1 -a $1 = "on" ]; then
    sudo i810switch crt on
    killall xscreensaver
elif [ $1 -a $1 = "off" ]; then
    sudo i810switch crt off
    xscreensaver -no-splash &
else
    echo "choose off or on"
    exit 1
fi
Posted Monday afternoon, December 11th, 2006 Tags: hardware software
Ctrl-Enter to send messages in Gaim 2

Gaim 2.0-beta4 made its way into Debian testing a few days ago. I haven't see a whole lot of visible changes, but I was annoyed to see that the option to send messages on Ctrl-Enter instead of Enter had disappeared. Here's what I added to my ~/.gtkrc-2.0 to get that behavior back:

gtk-key-theme-name = "Emacs"
gtk-can-change-accels = 1
binding "gaim" {
    bind "<ctrl>Return" { "message_send" () }
    bind "Return" { "insert-at-cursor" ("\n") }
}
widget "*gaim_gtkconv_entry" binding "gaim"

You'll need to restart Gaim.

Posted Tuesday afternoon, November 7th, 2006 Tags: software
git-svn makes offline Subversion painless

Lately I have been trying to change the tools I use to better support offline work. I have already been using the distributed revision control system darcs for my personal projects but need to access a number of Subversion repositories with some frequency. I looked into tailor and svk as a way to commit and inspect the history of Subversion repositories offline, but neither worked particularly well for me. I heard about the new git-svn and decided to give it a shot; I'm very pleased with the result.

git-svn allows "bidirectional operation between a single Subversion branch and git" and does pretty much everything I want. The usage is simple: to start working, enter a new directory and do:

$ git-svn init [URL of Subversion repository]
$ git checkout -b local remotes/git-svn

And you've got a git repository with the entire history of the Subversion one. Do whatever - move, commit, rename, delete - and then when you're ready to push changes back to the Subversion repository:

$ git-svn fetch
$ git rebase remotes/git-svn
$ git-svn dcommit

And no one will know you weren't using Subversion.

All is not great, though: git-svn repositories are much bigger than Subversion ones. Some of the repositories I converted contain several years' worth of very small incremental revisions; one originally weighed in at 15MB, but when checked out with git ballooned to 98MB (!!!).

Luckily, there's a way to reduce disk usage: "packs". Running the following on the 98MB DNS git repository shrunk it to 3.5MB:

$ git repack -d

Sweet! That's a fourth of the Subversion repository size!

I should also note that git is very speedy. Checkins are instantaneous and the blame command only takes a few seconds on large files with lots of history. I'm definitely reconsidering my preference for darcs.

Posted at teatime on Monday, October 30th, 2006 Tags: software
Python Makes My Head Spin Sometimes

There's a Python idiom to concisely create and populate list; this is handy because you can't initalizie lists to a predetermined size otherwise.

In [7]: a = [[0]*5]*5

In [8]: a
Out[8]:
[[0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0]]

Python's references are tricky, though, and I spent some time tracking down a bug in one of my programs because of the intersection of lists and references.

Using the above two-dimensional list a, I get:

In [9]: for i in range(5):
   ...:     for j in range(5):
   ...:         a[i][j] += 1
   ...:
   ...:

In [10]: a
Out[10]:
[[5, 5, 5, 5, 5],
 [5, 5, 5, 5, 5],
 [5, 5, 5, 5, 5],
 [5, 5, 5, 5, 5],
 [5, 5, 5, 5, 5]]

When I wanted each of the items to be incremented by one. Apparently Python is creating 5 references to the same object and putting them into one list.

Posted Monday afternoon, October 9th, 2006 Tags: software
A useable XTerm

I've been using gnome-terminal as my terminal emulator of choice for quite a while. It does a lot of nice things - tabs, highlights URLs when you hover over them for copying so you don't have to manually run your mouse over the whole thing, and does fonts well. On the down side, it eats up a relatively large amount of memory (this is a terminal emulator, after all), is slow to start, and does mishandles the many wierd characters I get in my junk mail folder and screws up the display.

I finally became annoyed enough to look into making an XTerm (or, more accurately, UXTerm, since I'm using a UTF-8-encoded locale) suitable for normal usage. By default, at least on Debian, it's horrendous - itty bitty font and white text on a black background. Here's what I put in my ~/.Xdefaults:

UXTerm*faceName: DejaVu Sans Mono
UXTerm*faceSize: 12
UXTerm*background: AntiqueWhite
UXTerm*foreground: gray15

XTerm works great - it loads up almost instantaneously, uses very little memory, and now is even readable.

Posted Sunday evening, July 23rd, 2006 Tags: software
New computer

I put together a new computer this week and am very excited about it. In one fell swoop I've made the jump to 64-bit, DDR RAM, SATA, USB2, and SMP all at once - sweet!

I've named it barry in line with my new computer naming scheme: there's also a bruce, hal, jonn, and ray. Bonus points for anyone who can tell me what those names have in common.

Debian GNU/Linux has had no problems recognizing any of the hardware. The motherboard is an Asus A8V with the VIA K8T800 chipset; I specifically stayed away from NVIDIA's because of their demonstrated resistance to free software and have not been disappointed with the VIA support in the Linux kernel. Working with the motherboard is cumbersome because it chooses to place important connectors in odd places - the sound pins sit between two PCI slots - but I've been happy so far.

The CPU itself is an X2 3800+ at 2GHz. There is no way I am ever getting the CPU fan back off - that was quite the tight fit. I finally took a screwdriver and pressed down with both hands to get it to snap into place and am surprised the thing didn't shatter. On the upside, kernel-package, running at a nice level of 10 and competing with emacs, music listening, web surfing, and ssh-ing, produces a full kernel with FUSE modules in 20 minutes (wall-clock time), hours less than it was taking me on the PIII laptop.

I was also amused to notice that the latest emacs CVS snapshot takes ten minutes longer to compile than the full Linux kernel.

The Coolermaster CAC-T05-UW case is fantastic. The packaging was hilarious; the product name is "Centurion" and the word-for-word official description of the case is:

Centurion, an honorable name, represents quality of Discipline, Integrity & Loyalty. With the Centurion besides you, now you can concord the world feeling safe and proud without having to be a Caesar.

Wow. It's just a case, guys. That being said, I only needed a screwdriver to attach the motherboard. The PCI/AGP slots have a sturdy snap-lock, as do the drive bays, and there's a big fan right in front of the hard drives to keep them cool. The whole rig is the quietest computer I've had, allowing me to concord the world using an inside voice.

Posted late Saturday evening, July 1st, 2006 Tags: debian hardware software
Making ion3 Shortcut Keys Less Obtrusive

"Ion is a tiling tabbed window manager designed with keyboard users in mind." It's fantastic because it takes care of trivial tasks for you and puts the focus on the application. I often forget that I'm using anything other than a console or a web browser, which I certainly can't say about something like KDE or GNOME. All windows are maximized in their frames; a window can have multiple frame, sized as the user chooses; frames do not overlap.

Unfortunately, by default it takes over some important and useful keys, namely the function keys and the left alt key as a modifier. I use the function keys in emacs and mc and the left alt as a modifier in irssi, firefox, and gaim. ion3, give me my keys back!

Luckily, it's a fairly simple task. I followed the instructions at the ion3 wiki and remapped my META key to the right alt key and ALTMETA to the left one. It works out nicely. Here's my .xmodmaprc:

! Map the right alt key to Hyper_R
keycode 113 = Hyper_R

! Map a fake right alt key to avoid problems with ion.
keycode 255 = Alt_R

! Make Hyper_R generate a mod3 modifier
add Mod3 = Hyper_R

You'll need to make sure you run xmodmap ~/.xmodmaprc at some point for X to pick up the changes. To let ion3 know about META key changes, I put the following in my ~/.ion3/cfg_debian.lua:

META="Mod3+"
ALTMETA="Mod1+"

And now I have my keys back.

Posted mid-morning Tuesday, April 18th, 2006 Tags: software