XEN and Kernel update

Server is up and running again. This morning I finished the xen (3.4) and kernel (2.6.32) updates I prepared yesterday evening. The only pitfall I stumbled across, was that the kernel in the debian repository (2.6.26-xen) seemingly wasn’t compatible with the latest xen in the debian repository (system would hang while booting, I guess that’s what I get for using “testing”).

Anyway, anyone using “lenny” or “testing” and wanting to update xen; here are a few tips to make the transition a breeze:

  • The debian wiki is full of useful information regarding xen
  • backports.org has a current xen kernel (linux-image-2.6.32-bpo.4-xen-amd64) that works fine with xen 3.4, just follow the instructions on backports.org on how to add it to apt.
  • I had to deactivate the “vfb” (VNC console) setting in the domU config files to get my guests to boot, browsing the Internet I saw people having the same problem with the “dhcp” setting.
  • If you are planning on updating the guests kernels too (advised), remember to change the “kernel” and “ramdisk” settings in the domU config files accordingly

With these few points in mind, the update is a breeze.

Grid clicker script

I finished up my “grid clicker” script. it is intended to simplify testing of games where you have to click certain patterns (a grid). Typical facebook games like farmville or funfari are great examples of this. just download the file (here is the sourcecode), execute it, and an eye should appear in your task bar. Double clicking on the icon in your task bar will start the script, just follow the instructions and everything should be fine.

And while I am at it: here is a spreadsheet I started for plants/trees/animals in funfari: Google online spreadsheets

Mythtv and IR Blaster

We use a set-top-box as the video source for mythtv. And while this works perfectly fine, we have to manually make sure the right channel is set for what mythtv wants to record. This can turn out to being a pain at time, especially when multiple things are planned to be recorded on different channels. So I went and ordered a IR transmitter from irblaster.info to give mythtv the possibility to change channels itself.

Since a bunch of the infos I found online were a bit out dated, here are a few tips for anyone using current versions of the software (I’ve got mythtv-backend 0.22 and lirc 0.8.4a running on a mythbuntu based system when I wrote this)

Hardware is easy to set up, just plug it into a free serial port.
1st we will head over to http://lirc.sourceforge.net/remotes/ and grab the file for our reciever set-top-box if we don’t already have them.
Then go edit /etc/lirc/hardware.conf and add the transmitter settings, these were mine:
TRANSMITTER="Skymaster_XL10"
TRANSMITTER_MODULES="lirc_dev lirc_serial"
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE="/dev/lirc1"
TRANSMITTER_LIRCD_CONF="skymaster/XL10"
TRANSMITTER_LIRCD_ARGS=""

now include the reciever settings to /etc/lirc/lircd.conf
I edited my /etc/init.d/lirc to execute the following line before starting the daemon (was needed to ensure the lirc_serial module can be loaded):
/bin/setserial /dev/ttyS0 uart none
Restart lircd and you can then start testing if transmitting codes work with irsend works. here is a little wrapper script I wrote around irsend for mythtv to use. You may have to twiddle around with the sleeps and change the $Remote to your reciever. If the sleeps are too long (-> the script takes to long to finish switching channels), then mythtv will timeout and not display live tv.

If everything is working fine, then go ahead and tell mythtv to use the script to change channels. This is done in the tuner card setup of mythtv-backend (mythtv-setup).

Farmville

Farmvill can be a fun way to pass some time, but if your fields get to be a bit big clicking on every single field can get to be a bit tiresome. I found this autohotkey script in the depths of the internet. It simplifies the process greatly 😉

bash scripting … switching into directory of the script

Sometimes it is useful to switch into the directory of the script e.g. when we need to call or include further files and don’t want to go through the hassle of searching for the script in the file system. Especially when symlinks are involved everything get a bit more interesting. This little snippet switches into the directory of the script, using readlink to dereference symlinks if the script is called via a symlink.