Tuesday, January 11, 2011

Testing Restlet webservices from telnet

For the upcoming P2P course at Aarhus University (which I have been co-teaching for the past four years) I am currently playing around with the Restlet REST API. We want the students to learn something about peer-to-peer algorithms, protocols, and techniques, and seeing as we like a hands-on approach we always ask them to code a small P2P system as an ongoing exercise throughout the course. In past years we have asked them to do this programming using regular sockets, but that is about to change... While learning about the socket abstraction may be instrumental in teaching a coming computer scientist about the underlying constructs of the network stack, it may be time to teach them this stuff only cursory and then skip ahead to a higher level of abstraction. I mean, who (besides myself) actually works with sockets anymore?

We have therefore decided to teach the students about REST and let them use the Restlet API to create their own P2P system. But before throwing a new API at my students, I like to experiment with it myself, and I therefore dived into a little bit of Restlet programming. In the process I needed to be able to test a HTTP PUT call to my Restlet, which can not (afaik) be done easily from a webbrowser. I therefore went to my old friend telnet for help. So, if you need to test a HTTP PUT call to a webserver from telnet do the following:
telnet localhost 8182
PUT /peerlist HTTP/1.1
Host: localhost
Content-Length: 13

Hello, World!
Substitute host, URL, and content to your hearts contend.

Wednesday, January 5, 2011

Scavenger and Presence are moving to GitHub

I am currently re-booting my work on Scavenger (and therefore also on the Presence service discovery framework) as I need it for some upcoming research. In the process I have decided to move the source code from the Google Code pages and onto GitHub instead. In the last couple of months I have become increasingly fond of git---especially as a collaborative tool where other developers can freely fork my repositories, play around with the source on their own, and then send me a pull request when they are satisfied with their changes. This way of working has worked out extremely well in my small LaTeX YaSnippet project. I hope that switching to GitHub means that more people will consider adding to both Scavenger and Presence.

While moving the code I have also done quite a bit of refactoing and "spring cleaning". This means that the code has now been split into six (more or less) independent projects. All of these can be found here https://github.com/madsdk/

Installing the Scavenger client library or the Scavenger daemon has also been simplified quite a bit. Both the lib and the daemon now have build scripts that work on Mac and Linux. If I e.g., would like a Scavenger daemon running om my laptop, I would simply download and run this script. The script must be placed in the folder where you would like to install the Scavenger daemon, and it will then download and build all dependencies (Stackless Python, Presence daemon, diverse Python modules). Notice that in order to build the Presence daemon you need to have the Qt development tools installed.

Happy hacking!