Charles' Blog

General ramblings of a tech geek.

Testing What Happens When a Java Process Runs Out of Disk

| Comments

Needed to do some smoke testing of a java app that was downloading files. In particular I wanted to simulate it running out of disk.

I didn’t want to spin up a virtual machine, so instead I created a virtual disk and mounted it as an ordinary directory. I’d forgotten which commands to use to create, format, and mount a loop device. Blogging them so I can find them again.

1
2
3
4
5
6
# Create a raw 'disk' around 1 GB in size
dd if=/dev/zero of=disk.raw bs=1k count=1000000
# Format it - I went for ~900MB which suited my tests
mkfs -t ext2 disk1.raw  900000
# Mount the file into a local folder
sudo mount -o loop -t ext2 disk.raw ./mount-dir

Works a treat, and really easy to play with different disk sizes.

Interesting SemWeb Books

| Comments

Over the last few months I’ve been trying to understand a little more about semantic web concepts etc… Here’s a list of some of the books I’ve been flicking through. Thought I’d blog them so I can find them again in the future.

John Davies, Rudi Studer, Paul Warren. Semantic web technologies: trends and research in ontology-based systems. Wiley 2006.

Karin K. Breitman, Marco Antonio Casanova, Walter Truszkowski. Semantic web: concepts, technologies, and applications.Springer 2006.

Dean Allemang, Jim Hendler, Semantic web for the working ontologist: Effective modelling in RDFS and OWL.Elsevier 2008..

Pascal Hitzler, Markus Krotzsch, Sebastian Rudolph. Foundations of semantic web technologies. CRC Press, 2010

I found Davies et al. (2006) Quite interesting to flick through… two of the authors worked at the same company I was with so there’s some interesting case studies. However, I found the focus was a bit too much towards reasoning, discovery and other conceptual ideas.

Breitman et al. (2006) and Allemang et al. (2008) were interesting as well

My favourite was Hitzler et al. (2010). I really enjoyed their coverage of sparql – I read this one far more closely than the others.

Extracting Calendar Entries From Outlook

| Comments

Having migrated by Outlook mailbox, I wanted to load calendar entries into another calendar. Following my earlier post, I already had my calendar entries in ICAL format, so all seemed good. However, I also had a number of recurring events (birthdays etc) that I wanted to put into my Google Calendar. The following PERL script was a handy bit of code to extract the recurring events so that I could extract them and add to my public calendar.

1
2
3
4
5
6
7
8
9
10
11
12
$entry =  '';
while(<STDIN>) {
  if ($_ eq "" || $_ eq "\n") {
    if ($entry =~ /^RRULE\:/) {
      print $entry;
    }
    $entry = "\n";
  } else {
     $entry .= $_;
  }
}
print $entry;

Migrating Outlook to a Ubuntu Mailbox

| Comments

Wanted to migrate a load of emails and contacts from Outlook to my Ubuntu netbook. Turns out it’s really simple.

1) Copy the outlook ost file to the netbook. The location of this can be found by looking at outlook’s settings. Important: make sure outlook is closed first!

2) Convert the ost file to a pst. There’s a windows tool for this – but I found it worked ok under wine. The program’s called ost2pst

http://www.windowsreference.com/ms-exchange-server/how-to-convert-ost-to-pst-format-for-outlook/

3) Install the readpst program (sudo apt-get install readpst – on Ubuntu). Then it’s a simple command to create a UNIX mailbox (one file for each folder)

readpst outlook.pst

4) Enjoy your windows mail in the mail client of your choice. Being a fan of terminal apps, I’m using Alpine ;–)

Leaving BT

| Comments

Today’s my last full-day working at BT. I’m marking the event with a final visit to Adastral Park in Martlesham, Ipswich.

Over the last few years, I’ve worked with some pretty smart engineers and had a lot of fun. I’m really excited about joining Talis, but I’m going to miss a lot of great people.

Def Proxy

| Comments

A while ago, I wrote some funky code to proxy interfaces method calls and delegate against a meta Object. For the last couple of day Tim Watson and I have been generalising this as a library for custom proxying between Java interfaces.

Code’s available on github: https://github.com/hyperthunk/def-proxy

Skype on Ubuntu 10.04

| Comments

Installed Skype from the standard package – all looks fine – but I’ve got to sort my microphone out first!

Did have a problem with menus being invisible (black text on black background). My fix was to simply change the settings of the current “style” and remove skype’s own ‘clean looks’ style with the ubuntu one.

Go to Options > General > Choose Style

and instead of “clean looks” choose “Desktop settings”. You will need to restart Skype.