Posts

Showing posts from 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

Kubuntu 10.04, the aftermath (2)

Image
Now that I had my system up and running, it was time to add some of the applications I love to use. The previous LTS version shipped with Thunderbird 2, whereas the current LTS comes with Thunderbird 3. The new version recognized my existing profile (underneath HOME/.thunderbird , which is where all accounts are kept) without any problems. No mails got lost in the transition. The new version comes with smart folders, which gives an aggregated view on all folders when using different accounts (e.g. webmail, gmail, your ISP's pop mail, ...). My favorite photo management software, f-spot , is also updated and I was very pleased to see it converted my database from the older version without any issues. In short, all software I used on 8.04 managed to convert my personal settings and data without any problems, which was a relief. For the rare occasions I still need Windows (only to sync my GPS software with my old PDA, actually), I've set up a virtual machine inside vmware server. U

Kubuntu 10.04, the aftermath (1)

I've been using Ubuntu since Hoary, which was released 5 years ago. It has always been, and still is, my preferred OS for desktop computing. April 29th the latest LTS version, 10.04, was released. This week, I decided to take it for a spin. Being able to upgrade / dist-upgrade on a Debian based Linux system, has always been one of the main reasons why I like Ubuntu so much. In Ubuntu's early days, however, breakage was very likely after dist-upgrading your system. dist-upgrading from Hoary (5.04) towards Dapper (6.06) every six months has been a true nightmare. After that experience, I decided to stick with every LTS version (i.e., 6.06, 8.04, 10.04, ...) and reinstall from scratch. Having my home directory on a separate partition, eases this process a lot. Just reinstall Ubuntu (after backing everything up of course), mount the home partition and your done. Since I became a big fan of KDE, over the years I've been using Linux, I decided to replace my Kubuntu 8.04 (which wa

When June 1 1900 is not June 1 1900

We're developing a fairly large application in Java. There are 2 front end applications, one written in Flex, the other in plain Spring-MVC and Spring-WebFlow. Both of them are using 3 main applications deployed as 3 different wars on the same application server. The front end applications talk with the back end applications using RMI exposed as HTTP. The back end applications also talk to each other using the same protocol. One of the applications deployed in the back end is responsible for validating data entered in the front end applications. One of the rules in the, so called ValidationService, checks if the SSIN of a person is valid. In Belgium, all people have a unique SSIN (Social Security Identification Number), comprised of 11 digits. The first 6 digits are based on the person's birth date. So if this person was born on April 21, 1978, the SSIN starts with 780421xxxyy. To check if an SSIN is valid, you need to check the person's birth date against these first 6 dig

The story of the Cobalt Qube

Image
The other week, a friendly colleague of mine brought me a small present. He gave me one of his Cobalt Qube s (for free!) which was collecting dust at his home. He was certain that I could give it a better use. I think I can still remember the days these things hit the market (somewhere in the late 90's). This was a home / office server appliance way before the people of Microsoft thought up their Windows Home Server . It was running some modified version of Linux RedHat, featuring a web interface for all administrative tasks. It also had 2 network cards, so you could easily turn it into a gateway / firewall. The RedHat version running on the Qube was known to be notoriously insecure. It was also running an older 2.0.x kernel which was outdated, even at that time. The Qube 2700 and Qube 2 were both equipped with a MIPS processor. Later models had an i386 architecture. Mine was a Qube 2. Getting the serial connection to work The Qube does not have any VGA adapter, so if you want to s