PrBoom WAD names

PrBoom works with multiple released versions of Doom, but has particular naming conventions you must follow if you want the Launcher to see the WAD file.

Ultimate Doom
Doom II
TNT: Evilution
The Plutonia Experiment

This is particularily important because the Steam version of Ultimate Doom has the WAD file named doom.wad.


Using a NextWindow touchscreen with Ubuntu

This should work for any X.org based Linux system. The key is to point it at the right event id as follows in /etc/X11/xorg.conf :

Section "InputDevice"
        Identifier "touchscreen"
        Driver "evtouch"
        Option "Device" "/dev/input/by-id/usb-NextWindow_Touchscreen-event-mouse"
        Option "DeviceName" "touchscreen"
        Option "MinX" "1"
        Option "MinY" "1"
        Option "MaxX" "32768"
        Option "MaxY" "32768"
        Option "ReportingMode" "Raw"
        Option "Emulate3Buttons" "false"
        Option "Emulate3Timeout" "50"
        Option "SendCoreEvents" "On"
        Option "CorePointer"

Note that this is for the newest 2150 versions. Without the /dev/input/by-id line, the event number seemed to change somewhat randomly on reboot.


Routing a port through a machine that's not the default router

I have an OpenVPN machine on my network that hosts a VPN, but it is not the default router for the network. I wanted to forward a port for the OpenVPN clients so that they could see another machine on the local network. To do this requires a number of steps.

First, the machine that they'll be connecting to needs a default route added for the OpenVPN network, or the packets will never return. My OpenVPN network is and my local network is in these examples. The OpenVPN server is and on tun0 and eth0 respectively; the machine I want my OpenVPN clients to be able to connect to on port 6666 is

route add -net netmask gw dev eth0

This allows the server to return TCP. Of course, the machine must have its firewall set to allow port 6666 in, but that's simple.

Then, the OpenVPN server needs its forwarding enabled. The commands that worked for me were:

iptables -t nat -A PREROUTING -p tcp --dport 6666 -j DNAT --to
iptables -A FORWARD -p tcp -s --sport 6666 -j ACCEPT
iptables -A FORWARD -p tcp -d --dport 6666 -j ACCEPT

This allows the communication in, and the response back out. I had also added these lines to my INPUT and OUTPUT chains; I'm not sure if they were needed:

iptables -A firewall-input -p udp --dport 6666 -j ACCEPT
iptables -A firewall-output -p tcp -m state --state NEW -m tcp --dport 6666 -j ACCEPT

If not, they don't hurt anything.


Using SSH to connect to a link-local IPv6 address

It turns out that the self-assigned IPv6 addresses you see are not unique; they're only guaranteed unique on each interface. To ssh to one, you'd need to run:

ssh fe80::21c:c0ff:fe52:c5ec%eth0

for example, where %eth0 specifies eth0.


Using command line switches in bash scripts

I have a number of bash scripts that do useful things to lists of items, such as this:


By using shift, I can have the script run through various IP addresses, for example. But I wanted more. I wanted the same command to sometimes take -t tag as an option and do something different. It turns out there's a relatively easy way to do this using the getopts builtin in bash. However, while it easily found the option (if present), it ruined the shifting feature, until I figured it out. Here's a snippet that sets TAG if -t tag is present, and then is ready to be shifted through as normal.

while getopts "t:h" OPTIONNAME; do
case "$OPTIONNAME" in
t) TAG="$OPTARG";;
[?]) help;;

shift $(($OPTIND - 1))

At this point, you can use $1 as normal; it will be the first non-option parameter. Additional options can be specified in a similar manner.

Bypassing SSH host key checks and the SSH agent

Sometimes you have too many SSH keys loaded, and trying to SSH to a box will fail. Sometimes you're trying to SSH to a box that's been rebooted into another OS or from a rescue CD.

The following command will disable key-based authentication, and ignore your known_hosts file:

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o'RSAAuthentication=no' -o 'PubkeyAuthentication=no'


Xen recovery on CentOS

I had a Xen domain crash, and it was a file image based LVM system. To mount the system manually in the host, I had to do:

losetup /dev/loop0 /storage/image.disk
kpartx -a /dev/loop0
vgchange -ay
mount /dev/VolGroup00/LogVol00 /mnt

This allowed me to access the LVM volume. To unmount it, I needed to do:

umount /mnt
vgchange -an VolGroup00
kpartx -d /dev/loop0
losetup -d /dev/loop0

Now I could attempt to boot the domain again.


bzr error on BranchHooks

On one Ubuntu 8.04 system, I was getting the following error:

0.031 looking for plugins in /root/.bazaar/plugins
0.031 looking for plugins in /usr/lib/python2.5/site-packages/bzrlib/plugins
[ 7744] 2009-05-19 09:37:54.672 WARNING: 'BranchHooks' object has no attribute 'install_hook'
[ 7744] 2009-05-19 09:37:54.673 WARNING: Unable to load plugin 'dbus' from '/usr/lib/python2.5/site-packages/bzrlib/plugins'
0.093 Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/bzrlib/plugin.py", line 231, in load_from_dir
exec "import bzrlib.plugins.%s" % name in {}
File "", line 1, in
File "/usr/lib/python2.5/site-packages/bzrlib/plugins/dbus/__init__.py", line 76, in
File "/usr/lib/python2.5/site-packages/bzrlib/plugins/dbus/hook.py", line 30, in install_hooks
Branch.hooks.install_hook('set_rh', on_set_rh)
AttributeError: 'BranchHooks' object has no attribute 'install_hook'

Everything else worked fine, but it was reporting an issue with install_hook. I tracked it down, and fixed it by deleting the dbus directory in /usr/lib/python2.5/site-packages/bzrlib/plugins - not sure where it had come from, but other systems didn't have it.


NVidia TwinView on Ubuntu

After using envyng to install the NVIDIA drivers, I would get this error when trying to turn on TwinView:

Failed to set MetaMode (2) 'DFP-0: 1920x1200 @1920x1200 +0+0, DFP-1: nvidia-auto-select @1920x1200 +1920+0' (Mode 3840x1200, id: 60) on X screen 0

Even when running sudo nvidia-settings I would get this error, and things just wouldn't work.

Turns out the correct thing to do is to run sudo nvidia-settings, detect the second screen, and configure it as you want, and don't hit apply - instead hit Save to X Configuration File and then hit CTRL+ALT+BACKSPACE to restart X. This worked for me. Note that it will log you out and close any open programs you have. Now I have double desktops!


Diablo II on Vista

If you try to install Diablo 2 on Vista you may get this error:

Error in script file Setupdat\inst.ins, line 14: undefined symbol (desktop)
First, you need to add the a registry key in the following location:

HKEY_CURRENT_USER\Software\Microsoft\Windows\Current Version\Explorer\Shell Folders

If there is no key named "Programs" add one of type string with the following contents:

C:\\Users\\%USERNAME%\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs

Exactly as shown. If there is no key named "Desktop" add one also: