Posts

Showing posts from December, 2010

Restoring files manually from a mondo backup

As already mentioned in earlier posts, I uses mondo to create system backups of all my systems. By system backups I mean; create a backup of the live system, without any personal data. In short, this is a backup of everything except home folders. The home folders are backed up using rsync and external disks, but this is another story. Restoring from a mondo backup is easy; simply burn the images, put it in a cd drive and nuke the system (yes, this is a restore option in mondo :) ). If you just want to restore some files from the backup, without overwriting the whole system, there's an easy way to do this. Suppose you created an ISO a while ago and these are stored on some disk. First, you will need to mount the ISO as a loopback device like so: mount -o loop MyIso.iso /mnt The ISO is now mounted in /mnt . Now locate the file you want to restore (I was going to restore smb.conf ): $ grep smb.conf /mnt/archives/filelist.* /mnt/archives/filelist.11:/var/lib/ucf/cache/:etc:samba:

Failed to issue the StartTLS instruction: Protocol error

I encountered the error mentioned in the title of this post after upgrading my samba install on Debian Lenny using Enterprise Samba binaries. The latest version they distribute at the time of writing is 3.4.9. My samba install talks to an ldap backend and the above error was shown upon starting the new version. Seems they added (or changed the default) option for the ldap protocol in smb.conf . Adding: ldap ssl = off makes the error go away. Cool.

Building queries ... the easy way

On a past project, users needed to be able to create a custom query and execute it. To do this, the user was able to select a field, an operator and select or fill in a value. If, for example, we were searching for people living in Belgium, the user would select person.address.country for the field, like for the operator and fill in "BE" for the value. I'm sure you all know how the resulting SQL would look like. There are different ways to create a query builder. If you're using Hibernate , the above example could easily be translated to HQL using the criteria API. In some cases, however, the resulting SQL is not exactly what you wanted (e.g. not performing well) or maybe Hibernate is just not capable generating a correct SQL. Unfortunately, at that time, we discovered we were suffering both aforementioned problems, so the only solution was to create our own query builders using string concatenation. Yes, this can get ugly really fast, when not being careful, but I

Updating the location for your photo's in f-spot

I've been using f-spot for quite some time now to manage and categorise all my pictures. In older Ubuntu versions (8.04 and earlier), the default location for f-spot to store its photo's was: /home/username/Photos . For some reason, Ubuntu 10.04 (probably earlier versions as well) changed this folder to: /home/username/Pictures/Photos . I didn't notice this until today, while I was importing photo's and checking the contents of /home/username/Photos only to see nothing was copied to this location. That's when I discovered they changed the default location :) Since f-spot is backed by an sqlite database, this wasn't very hard to solve: create a backup of the sqlite database photos.db (should be underneath /home/username/.config/f-spot ) now update the location with sqlite3: kenneth@pavane:/data/home/kenneth/.config/f-spot$ sqlite3 photos.db SQLite version 3.6.22 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite