Flickr™ last.fm

Monday 28th April 08

When Leopard was released it came bundled with what was supposed to be revolutionary new backup software. However, as far as I can tell it sucks balls. I have long known that my backups are inadequate (I write this with my last back up being 5 months old). I decided that I really should improve matters so got myself a new portable hard-drive which now means I can backup my iBook where ever I am. This is where the fun started.

On first connecting my external hard-drive I repartitioned it to give it over twice the space of my hard drive along with a partition for me to put random other files that I want to carry around. I then set Time Machine to backup my entire hard-drive. After a good number of hours it was done. This was good. Then after about 6 or 7 backups it stopped. It produced the error "couldn't write the data to backup volume". This was odd. So I investigated. Sure enough running disk-utility on the partition I could see it was broken and needed wiping before I could use it again.

So I wiped the partition like a good boy and set about setting Time Machine to do another back up on the volume. This time the 'initial backup' crashed my entire mac half way through. I had to do a force shut-down to get the machine to respond to me. When I started the mac again it didn't like the backup it had already done. So I wiped the partition like a good boy and set about setting Time Machine to do another back up on the volume.

I pray that this backup will work and these will be the last of my worries but if they are not I am going to have to resort to just doing a less regular backup using SuperDuper. Apple this has been a less than fun and is certainly not the plug and play experience that I have come to expect.

Saturday 26th April 08

At our Students' Union Excellence In Volunteering Awards ceremony on Thursday evening a website which I created won the award for "Best Website / Publications" in the societies category. I am now hoping that, as I am no longer on the committee, no-one decides its a good idea to start again with a new site.

ECSS Website

Sunday 20th April 08

I wasn't tagged in this meme but I thought I would join in anyway. I have no idea how python got that high but hey.

eris:~ edd$ history | awk '{a[$2]++}END{for(i in a){print a[i] " "  i}}' | sort -rn | head
112 python
69 cd
64 touch
46 svn
36 ls
26 ssh
17 whois
12 su
11 vi
11 ping

Wednesday 9th April 08

I just got naked for CSS Naked Day. I should do this more often, I dont look to bad without any clothes on.

Friday 4th April 08

I have been playing with a little python trying to get some things working. Thought I would share some of the my efforts. Its just a simple class that gets remote files which it caches to stop hammering remote servers. There are probably more efficient and better ways of doing it but this works. Use or ignore as you see fit.

import os
import urllib2

class getFileContents:
    '''Get remote file contents and cache the file for a given length of time.'''
    def getremote(self):
        request = urllib2.Request(self.url) 
        request.add_header("User-Agent", "getFileContents/python - e26.co.uk")
        opener = urllib2.build_opener() 
        contents = opener.open(request).read()
        self.savefile(contents)
        return contents

    def getlocal(self):
        return file(self.cache).read()

    def savefile(self,contents):
        handler = open(self.cache, "w")
        handler.write(contents)
        handler.close()

    def cachetimedout(self):
        return (os.stat(self.cache).st_mtime < (time.time()-self.cacheTime))

    def __init__(self, url, cachefile, cacheTime=200):
        self.url = url
        self.cache = cachefile
        self.cacheTime = cacheTime
        if self.cachetimedout():
            self.contents = self.getremote()
        else: 
            self.contents = self.getlocal()

    def __str__(self):
        return self.contents

© 2008 Edd Sowden