Sunday, 21 March 2010

iFolder 3.8

For quite a while now I've been looking for something that allows me to sync folders on my Linux (OpenSuSE) laptop with my server. I quite like the way that windows provides roaming profiles. This allows a user to share a home area with multiple machines. The real advance of roaming profiles is that they can be disconnected from the network and then sync backup when reconnected to the network. This is great for laptops. Another big advantage for me is that all the windows machines store a copy of their files on my central samba server. This means I can perform a backup from one central location.

The problem with Microsoft romaing profiles is they only sync on login/logout. First of, I hardly ever log out of my windows desktop machine. I just lock the screen, and second it takes ages to sync changes. I dread having to reboot my windows machine.

So I've been looking for something that would allow a roaming profile type system on Linux. I've tried a few different options over the last few years (unison, csync, rsync) but none them have really been what I was after. So the last week or so, I've been giving iFolder ago. First of I have to say, the server setup was pretty painful. Even though it's sponsored by Novell, the setup took most the last week to get working. In the end I deleted all the ifolder rpm's and deleted any left over files, then reinstalled it. This time the setup process worked, so I'm still sure exactly what was broken.

iFolder consists of a Linux server and client applications that run on MacOS, Linux and windows. Their is also a web client. As soon as I realised this I saw that iFolder has a lot of potential. As well has using it on Linux, it should be possible to use it on windows. So far I've only used it on my Linux laptop, but if that works well I'll probably try it on windows aswell.

The server is written in C# and runs within apache. This means that anywere I can access my web server, I can access the iFolders. This is really great. It means I could sync my folders whilst saying at a hotel with wireless for example (Though my internet upload speed sucks a bit to much for this). The syncing also happens all the time and not just on login/logout. This works much better with the way I work. The web client is also pretty good, this allows me to access my files from work for example. Probably also means I can look at files on my iPhone to some degree.

The downsides of iFolder that I've found so far is that their is no headless command line client. This would have been very useful for on the server it's self. I could have then exported that folder via samba. The client on Linux is also a gnome application which does not fit very well with my KDE desktop. I notice that the client is written in C# which makes me wonder if their are KDE bindings for C#. If so I could probably convert it to run on KDE.

So far I've sync two folders, one (10Gig and 300Meg). The largest one worked fine, but the smaller one is complaining of conflicts. Their should be no conflicts so I suspect it does not like the filenames these files use. That could be a problem as I don't want to be limited by file name. However it does make sense if windows is supported as well. The client pops up a notification balloon when conflicts are found. It's then possible to output the conflict resolve window and fix any problems.

So far I've feeling pretty positive about iFolder. The client does not quite fit with the desktop, it offers a lot of nice features and works pretty well once the server is setup. Going to take a little longer trial before I final decide that it's a winner and put to rest my looking for a Linux roaming profile solution.

Sunday, 14 March 2010

Multiple sounds devices in OpenSuSE 11.2

My dell studio laptop has two sounds devices. Both of them are are Intel devices, one of them is the normal laptop stereo output, the other is the HDMI out. I've been having the problem that ALSA/Pulseaudio apps don't output any sound. I did manage to convince KDE to output sound but telling it go strait to the sound card, however that is less than perfect as I'd rather it went to pulse audio.

After digging into this for a while I discovered that the problem was the dual sounds cards. Alsa and PluseAudio need to know that the stereo output is the default. This can be fixed in YaST by configuring the cards in the correct order (the default one first). This article gave me the info.

At some point I'd like to be able to output digital audio so I will probably need to find a way of switching also/pulseadio between the two devices.

Thursday, 11 March 2010

Linux backup

For a little while now, I've been backup in my server to a removable hard disc. This has worked pretty well till a couple of months ago when I inserted the backup drive into the server (the drive is in a caddy). This caused the computer to switch off! and their was a nasty burning smell. I feared that I'd fried the computer, but it turned out to be the hard disc.

So rather than replace the hard disc, I started to think about a better solution. The problem with removable hard discs is that you can't automate regular backups. This lead me to start thinking about NAS drives. A network storage device could sit on the network and be used to backup to on a regular basis. I have a central server in my house witch all the other desktops, media center's and laptops backup to. So this means only the server needs to be backed up. Because it's Linux I needed a NAS that supported things like rsync and NFS. It's also important that files copied from the server to retain their permissions and owner ship.

After speaking to friends and looking around the Internet I deiced on the Netgear ReadyNAS duo. This can take two hard discs, and has loads of features, including NFS and rsync. The device works well in Linux, Windows or OSX. The documentation does not really mention Linux.

Once connected network I powered it on and got a scare. The device was very loud. Turns out this is a not problem, as it settled down. In fact I've never heard it do that again. Its actually very quite. Next I followed the setup wizard you get when you access the admin interface for the first time. I then added a backup NFS share. The share was configured to be accessible only from the server and allow root to mount it.

Now I use the following script to perform backups. It's still a working in progress (let me know if you have suggestions for improvement). This performs a incremental backup to the mounted NFS share.
#! /usr/bin/perl

use File::Path;
use File::Copy;
use File::Temp;

my $BACKUP_DIR="/mounts/backup";
my $RSYNC_OPTIONS="-a --delete -v";
my $NUM_BACKUPS=4;
my @DIRS=("/usr/local/","/etc/","/srv/","/home/","/root/","/var/lib/samba/","/mnt/Films/Films/");

my $backupPrefix=$BACKUP_DIR."/backup.";

for ($count=$NUM_BACKUPS; $count>=1 ; $count--) {
if ($count==$NUM_BACKUPS) {
if ( -d $backupPrefix.$count ) {
print "Delete backup ".$backupPrefix.$count;
rmtree($backupPrefix.$count);
}
}
else {
my $previousDir=$backupPrefix.($count-1);
if ( -d $previousDir ) {
print "Moving backup ".$previousDir." to ".$backupPrefix.$count."\n";
move($previousDir,$backupPrefix.$count);
}
}
}

if ( -d $backupPrefix."1" ) {
print "Copying previous backup\n";
system("cp -al ".$backupPrefix."1/. ".$backupPrefix."0");
}

print "Backup up latest system changes\n";
foreach $dir (@DIRS) {
print "Backup up changes in ".$dir."\n";
mkpath($backupPrefix."0".$dir);
system("rsync ".$RSYNC_OPTIONS." ".$dir." ".$backupPrefix."0".$dir);
}

my $backupDataPath=$backupPrefix."0/backup-data";
if ( -d $backupDataPath ) {
rmtree($backupDataPath);
}

mkpath($backupDataPath);
system("rpm -qa > ".$backupDataPath."/packages.list");

Apple customer service

I've had my iphone just under a year now and other than it's lack of Linux support, I've been very happy with it.

This morning I notice that the battery was almost completely flat, so I plugged it into the charger. This is were the trouble started. For some reason the phone just went black and no amount of poking it would get it to turn back on. I tried all the suggested things on the web to do with resetting it, restoring it using i
iTunes, connecting to mains chargers. Nothing worked!

So I though I'd ring apple customer support, this was a pleasant change from customer support form other companies. I pretty much got strait though to a human and she took me though most the steps I'd already found of the web. She then emailed some stuff to try as well as confirming that my phone was still within it's 1 year hardware warranty.

The last thing she suggested was to arrange an appointment with the local apple store to have someone look at it. So since the phone was still not responding, this is what I did. You can arrange the appointment via the apple website, choose the time and leave a message. After that it was just a matter of poping down to the local apple store.

Once in the apple store, someone store me on time and took a look at the phone. They confirmed what I suspected and said the phone was faulty. Next they poped out the back of the shop and got me a new one. They activated it their and then so that I could use it and people could call me! The only thing left to do was go home, plug it into iTunes and restore my old phones backup onto the new one. This was pretty easy and worked without a hitch.

I have to say the whole experince was very present and quite surprising. I've had other broken phones in the past and it's usually been a lot more painful. Usally I've been without a phone for days. I can't think of any other phone that I could have got replaced the same day it broken. Thank you apple!