home · projects · papers · blog · gallery · contact ·
anil madhavapeddy // anil.recoil.org


Blog updating 30,000 feet in the sky

Posted by avsm Mon, 27 Jun 2005 15:05:02 GMT

So I'm half-way to Tokyo Narita on a Lufthansa flight, and I happened to open my laptop and discover that they have in-flight WiFi access! So I did what any self-respecting person would do ... update my blog! Very cool indeed, although a bit latent it offers complete IP access (no proxies), and even UDP so Skype works (barely).

sleek:~ avsm$ ping recoil.org
PING recoil.org (194.70.3.133): 56 data bytes
64 bytes from 194.70.3.133: icmp_seq=0 ttl=235 time=631.553 ms
64 bytes from 194.70.3.133: icmp_seq=1 ttl=235 time=629.864 ms
64 bytes from 194.70.3.133: icmp_seq=2 ttl=235 time=626.753 ms

sleek:~ avsm$ traceroute recoil.org
traceroute to recoil.org (194.70.3.133), 64 hops max, 40 byte packets
 1  172.16.64.1 (172.16.64.1)  3.330 ms  26.993 ms  2.348 ms
 2  cbb-cds-psn.by.boeing (172.16.0.18)  2.131 ms  2.177 ms  2.074 ms
 3  sbs.by.boeing (172.31.0.1)  2.500 ms  2.797 ms  2.137 ms
 4  * * *
 5  10.10.36.21 (10.10.36.21)  587.252 ms  745.720 ms  581.943 ms
 6  mos02r03-v25.connexionbyboeing.net (10.10.36.2)  769.563 ms  583.565 ms  581.822 ms
 7  mos02r21-f2-9.connexionbyboeing.net (10.10.32.25)  580.833 ms  869.622 ms  656.564 ms
 8  10.10.32.33 (10.10.32.33)  581.529 ms  764.980 ms  570.506 ms
 9  mos02r01-f2-3.connexionbyboeing.net (10.10.32.130)  585.012 ms  582.451 ms  768.756 ms
10  mos02r02-f2-3.connexionbyboeing.net (10.10.32.131)  580.568 ms  580.606 ms  586.664 ms
11  asd2-rou-1014.nl.eurorings.net (134.222.97.217)  1391.234 ms  737.475 ms  1024.744 ms
(...etc)

Posted in  | no comments

Python on Symbian Series 60

Posted by avsm Fri, 24 Jun 2005 13:14:37 GMT

I bought a Nokia 7610 some time ago, and have taken hundreds of pictures using it. When creating the gallery section of my site, I ran into an annoying limitation: the pictures contained on the phone did not embed the date the picture was taken as part of the image. Manually copying the date and time for 350 images was a bit much as well...

The problem with sending images via Bluetooth to my laptop is that the OBEX transfer stamps the date of the transfer instead of the date the picture was taken. There turned out to be a conveniently easy answer to this problem though, as Nokia released a version of Python for Symbian Series 60. This suddenly elevates the phone from being a complete pain to program (due to the Symbian C++ libraries being amazingly badly documented), to something that's actually quite usable.

It took about an hour to come up with the first cut of imgcollect.py, which assembles a list of mtimes for each image on my phone, performs Bluetooth Device Discovery, and transmits the mtimes and all the pictures to my laptop. After that, a little shell script on the laptop is enough to stamp the pictures with the correct mtime:

#!/bin/sh
while read FNAME MTIME; do
        DATE=`date -r $MTIME "+%G%m%d%H%M.%S"`
        touch -t $DATE $FNAME
done

I'm actually quite impressed with Nokia at last! Next step is to work out a two-way synchronization so that I don't keep re-transmitting images which I already have on the phone (unfortunately, iSync is pretty useless with the Nokia 7610, even in Tiger).

Posted in  | no comments

"Cricket is just baseball on valium"

Posted by avsm Thu, 23 Jun 2005 20:40:18 GMT

Well ok, it wasn't the fastest game ever, but the graduate team assembled today to play the now-traditional summer cricket match against the staff of Robinson College. It had a moderately nail-biting finish, with the students clinching victory with one over to spare! Unfortunately, that put me on the losing side, as I was subbed to the staff since they were one short. But I reckon I can claim the moral victory!

A formidable squad assembles...
A formidable squad assembles...
...and a glorious day to avoid writing thesis begins
...and a glorious day to avoid writing thesis begins
This is a picture of us playing croquet a few days ago, in case you were bored of cricket.
This is a picture of us playing croquet a few days ago, in case you were bored of cricket.

Posted in ,  | no comments

Updated Subethaedit OCaml mode

Posted by avsm Tue, 21 Jun 2005 21:01:38 GMT

The Subethaedit syntax highlighting for OCaml is working nicely. I fixed up few minor bugs and packaged up version 1.1, available here. Have fun!

Posted in  | no comments

Return of the Thesisometer

Posted by avsm Tue, 21 Jun 2005 15:30:59 GMT

Summer is upon us, the sun is shining, the birds are singing, and ... the thesisometer has returned, courtesy of Andy Warfield! It's going to be a long summer ...

Posted in ,  | no comments

C2K5 thoughts

Posted by avsm Sat, 04 Jun 2005 15:14:18 GMT

Finally had some time to get back from the OpenBSD hackathon and take stock of what I worked on. It was pretty interesting one this year, as I went without having much idea of what to work on (unlike last year, when I had a mad backlog to catch up on). Some stuff I did during the week included:

  • Clean up the atomicio interface used in OpenSSH and nc(1) to provide simpler semantics. Error checking from read/write functions are a real headache in C, as the functions return -1 on error, which means a signed ssize_t is returned. However, they accept an unsigned value as the size of the buffer to process, which means they could potentially return a value outside the range of the return value. This means you have to check if the return is -1, which indicates an error, and otherwise cast to a size_t to correctly get the buffer size back. With the new atomicio, it always returns a size_t, and returns 0 to signal an error (with errno containing the error, and EPIPE being set for an EOF condition).
  • Start looking at the Bluetooth stack to get L2CAP and RFCOMM support. We are half-way through un-netgraphing the FreeBSD stack and having a more traditional netbt socket interface (much like netinet or netinet6) to Bluetooth.
  • Use CIL to implement a few fun kernel source->source transforms. kerneltrace just accepts a regular expression and inserts a printf in the function prologue which outputs the function name and any arguments passed into it. Had this idea when chatting with Marius, and it turned out to be very useful when trying to figure out dataflow in the Bluetooth stack (just compile with make CC="/usr/local/bin/cilly --dokerneltrace --trace-regexp='ubt|ng_blue'"). The second one was even simpler; randomvars assigns a non-zero value to every local variable in a function call to help track down uninitialized-local-variable bugs. Heres one Chad Loder found in mg(1).
  • Other random signed/unsigned cleanups in OpenSSH. Boring but important I guess...

All in all, the hackathon re-motivated me to continue work on the OCaml-based daemons that Dave and I have been hacking on. I don't want to be fixing random buffer or integer overflows in an OpenBSD hackathon 5 years from now; we need to move on to more high-level issues.

Posted in ,  | no comments




Copyright © 2003-2006 by Anil Madhavapeddy. All rights reserved.
Original design used with kind permission from Jon Parise.
Valid CSS
Valid XHTML 1.0