Friday, January 29, 2010

Selecting a Default Kernel to Boot (GRUB2)

A recent Kernel upgrade (2.6.32) brought with it a nasty regression: the Kernel does not detect that my USB cable modem link is up.

But I still have the previous Kernel (2.6.30) installed, so the workaround is rather simple - make this Kernel the default one in GRUB2.

I didn't bother looking this up anywhere, but the following procedure works for me (as root):
  1. open /etc/default/grub for editing
  2. modify GRUB_DEFAULT:
    GRUB_DEFAULT=2
    the number in red is the number of the GRUB2 menu entry you wish to make default (the first menu entry number is 0)
  3. run
    update-grub

Friday, January 22, 2010

Creating Floppy Disk Images

Here's a recipe for creating a floppy disk image from scratch:
  1. install Mtools:
    aptitude install mtools
  2. make sure you have the following in /etc/mtools.conf:
    # # dosemu floppy image
    drive n: file="/var/lib/dosemu/fdimage"
    
    (it's the default configuration on Debian)
  3. create the directory:
    mkdir -p /var/lib/dosemu/ # as root
  4. create a 1.44MB floppy disk image with mformat:
    mformat -f 1440 -C n:
    or, if you happen to have your own bootsector binary file available:
    mformat -B bootsector -f 1440 -C n:
  5. loop mount the floppy image:
    mount -o loop /var/lib/dosemu/fdimage /mnt/image
  6. populate the image with files
  7. unmount the image:
    umount /mnt/image
  8. Rinse and repeat

Friday, January 15, 2010

BaculaFS: Bacula Filesystem in USErspace

I've recently released BaculaFS. BaculaFS is a tool that exposes the Bacula catalog and storage as a read-only Filesystem in USErspace (FUSE).

If you have setuptools installed you can get and install BaculaFS like this:
easy_install BaculaFS
and then run it like this (as root):
baculafs [options] [mount point]
Note that, depending on your setup, it can take quite a while for BaculaFS to start up, as it runs the necessary queries against the Bacula catalog database (if you're impatient you can try -o logging=debug - it won't accelerate anything, but the feedback may ease your pain).

I wrote BaculaFS from the bottom up, and I guess it shows. Nevertheless, I think it's pretty cool. I use it with rsync, Baobab, and other file oriented tools (I even managed to clone a Git repository directly from backup).

Unfortunately, extracting files from the Bacula backup storage can be rather slow. This can make BaculaFS barely usable with Nautilus (and probably with other file managers), because it is simply too aggressive, attempting, by default, to read each and every file it encounters.

I hope some of you will find it useful. If you happen to hit any problem please submit a bug report.

Enjoy.

Friday, January 8, 2010

Can't Delete Print Jobs on Windows

My brother-in-law called me up the other night. He's taking a C programming course, and I half expected him to ask me for some help with his homework. I was wrong - he seems to be handling it quite well, for a guy who never programmed before.

I was disappointed to hear that he called me up to fix a printing problem. He complained that he can't print on his Window$ XP PC, because a print job that he cancelled has not been removed from the printer queue (it's status is "Deleting - Printing" - WTF?), so all the subsequent jobs were stuck, waiting for the first one to finish.

Well, I have a reputation to keep. I sat down at my wife's laptop, so that I could both follow his description of what he already did, and guide him through any suggestion of mine. Turns out he already tried most of my suggestions, including power cycling both his printer and his PC.

I had one last idea: Google. I came up with several links (including a Micro$oft support article and this blog entry), from which the following procedure was derived:
  1. click the Start bottom and then select "Run..."
  2. stop the spooler service by typing
    net stop spooler
    and then hit Enter or press OK
  3. launch the file explorer (e.g. by hitting the Windows Key and "e" together)
  4. navigate to the folder
    %SystemRoot%\System32\Spool\Printers
    the %SystemRoot% bit is supposed to be automatically replaced with the path to the Window$ system folder (e.g. C:\WINDOWS)
  5. delete the *.spl and *.shd files that show the approximate time and date of the print job causing the problem (or delete everything there, if you don't mind losing other pending print jobs)
  6. click Start, select "Run..."
  7. restart the spooler service by typing:
    net start spooler
    and hit Enter or press OK

Friday, January 1, 2010

Can't Connect to VNC Server

A few days ago I found that I could not connect to a standalone VNC server session that I've started on my home PC with
vnc4server
I checked the log file at ~/.vnc/machine-cycle:1.log. The log file contained a few error messages about a missing /etc/X11/xserver/SecurityPolicy and missing font directories under /usr/X11R6/lib/X11/fonts/, but I was rather sure that I've seen these messages before, so it wasn't as helpful as I hoped.

I checked the Debian BTS page for vnc4server and my problem was right there as bugs #561619 and #560137. The comments for the latter provide both an explanation (it's related to IPv6 - way over my pretty head), and a workaround that fixed the problem at my end - run the following as root:
sed -i 's/net.ipv6.bindv6only\ =\ 1/net.ipv6.bindv6only\ =\ 0/' /etc/sysctl.d/bindv6only.conf && invoke-rc.d procps restart
That's good enough for me.