Archive for December, 2007

Tying Perl hashes to Amazon S3 buckets

Sunday, December 16th, 2007

As mentioned last time, I released my first Perl module to the CPAN, called Tie::Amazon::S3. What it does is rather simple: it allows one to treat an Amazon S3 bucket as a Perl hash, like so:


use Tie::Amazon::S3;
tie my %bucket, 'Tie::Amazon::S3', $my_aws_id, $my_aws_passwd, $my_s3_bucket;
 
# read a remote file to a scalar
my $textfile = $bucket{textfile};
 
# write some text to a key
$bucket{'songs/freesoftwaresong/list'} = <<EOF;
freesoftwaresong.au
jonobacon-freesoftwaresong.ogg
Fenster-FreeSoftwareSong.ogg
EOF

Tie::Amazon::S3 builds on top of Leon Brocard’s Net::Amazon::S3 module, so one can still do other actions such as setting a key’s ACL by accessing the tied(%bucket).

Today I made another version of that module, completing the hash abstraction by implementing some missing methods, allowing one to iterate through the list of available keys in the bucket (e.g. foreach keys %bucket and such.)

As mentioned, it can be found on the CPAN, but I also have a git tree up. Helpful comments & patches are welcome!

To Australia and Back: OSDC Brisbane 2007

Saturday, December 15th, 2007

Its been a couple of weeks since the Open Source Developers’ Conference in Brisbane, but it was only now that I’ve got the time to blog about it. :) This is due to some work that got piled in my backlog (I haven’t been lazy enough to have this work all automated yet :().

First off, my trip to Brisbane was a long one, due to the UNDP travel agency giving me a route taking me to Bangkok first, because of my exchange grant’s papers made in short notice. No matter: this being my first ever international trip, this meant that I would be visiting two different countries in just one shot.

Bangkok was just an overnight stay though, so I didn’t see much, but their new airport was nevertheless impressive. Arriving there at almost midnight, the only bright places I saw were the big Suvarnabhumi airport and the Novotel where I had my layover. After some sleep, I had a pleasant morning, but only a short one at Bangkok, as my flight to Brisbane followed after:

DSC06879.JPG

The Brisbane flight was long, and I arrived just an hour before midnight. Now, my next problem was getting a place to stay.

I took an airport shuttle to the Royal on the Park, where the conference will be held, first to see if there are any free rooms, or barring that, some recommendation on nearby places to stay, even if only for the night. I was quite anxious because I wasn’t able to arrange for accommodation prior to this trip (short notice, remember?), so I decided to go directly to the venue to be the best way of trying my luck.

And try my luck it was! First, I was greeted by a front desk manager who turned out to be a fellow Filipino, and he helped me get a room in the hotel. At the time though, he could not guarantee that I can stay there for the duration of the trip (only for the night) but he would help me to find alternate accommodation instead on the next day. I thought that was good enough, since it was already midnight by the time I reached the hotel, and just a bed to sleep on for the night would do great for me to worry about moving elsewhere later.

And the next day: Day 1 of OSDC:

DSC06880.JPG

I was up rather too early that day; the worrying about moving elsewhere settled in too early as well, and had made me check out very early so I can hopefully look for that alternate accommodation by lunchtime. One by one, the attendees came, and soon enough more than a couple of hundred people were filling the main conference room, waiting for OSDC to begin. And we began with a keynote from Rusty Russell on C, the humbling language and Ian Clatworthy’s talk on distributed version control systems.

After the keynote, I was notified by the hotel management that instead of moving elsewhere, I can just remain there for the duration of the conference. I was quite relieved!

For the remainder of the day, I listened in on the Perl stream of talks from Kirrily Robert, Josh Heumann, and Jacinta Richardson, on packaging Perl modules, Perl 6, and Perl code optimizations, respectively. Kirrily’s talk was timely since I am writing a couple of Perl modules to be released on the CPAN (one, Tie::Amazon::S3, is now up ;)

On the morning Day 2, I listened in on Mark Rees’ talk on testing web applications using twill and a scripting language, like Python. I then followed Adam Kennedy’s talk on the CPAN 1.5, learning about CPAN::Mini, the CPANPLUS (which IIRC will be standard in Perl 5.10) and the Tiny modules in the process. More on the Perl stream continued with another talk from Josh Heumann on intermediate Perl testing, providing a humorous yet informative strategies not really just for testing Perl scripts or modules but for software testing in general:

DSC06888.JPG

Later in the afternoon was Paul King’s talk on agile developer practices for dynamic languages, covering Groovy and Ruby. That was later followed by Leslie Hawthorn’s talk about the Google Summer of Code and the announcement of the Highly Open Participation contest for the young geeks who are not yet in college or university but would like to work on open source projects just like the SoC-ers.

After the day’s schedule of talks, there was a break before the conference dinner, allowing also for a short keysigning session and CACert identity check.

Then, we had the conference dinner, sponsored by Google. There was also a game held: every table makes up a team who, given some Play-dohs and imagination, are to make up a `bug’; the best `bug’ wins a free book. Unfortunately, my table/team didn’t win any books, but that was beside the point anyway, as the bugs that were made up were quite something:

DSC06898.JPG

DSC06895.JPG

On the last day, the morning talks I attended were all about Ruby and Rails. Nic Williams gave an introductory talk on Rails, then Paul King gave another talk, this time on Grails (the Java version of Rails,) and closing the morning session was Keith Pitty’s talk on Ruby for Java shops. For the afternoon, I followed Adam Kennedy’s talk on optimizing projects for wetware.

DSC06936.JPG

For the closing keynote, Nat Torkington talked about the future of software:

DSC06945.JPG

And with a day left before returning home, I went to sightseeing mode, bought a couple of books, and the mandatory pasalubong for the relatives. At midnight, my flight took me back to Bangkok, another long trip that touched down at the crack of dawn:

DSC07034.JPG

After a few hours’ wait, I took the plane back to Manila, returning home just after lunchtime.

This being my first international trip, making it alone seemed to be quite an adventure. But I wasn’t really alone in this endeavor: kudos goes to the UNDP International Open Source Network for their exchange grant program, to my relatives for their support, to Free and Open Source Software for really making things rock (and free ;), and to $DEITY for being there.

Until the next trip!