Category Archives: tech

Random stuff

It’s Friday afternoon, so here’s some random stuff:

  • We live across the road from a park, and most Saturday mornings some guy rides his bike there to do Yoga. He also brings his pet chicken to the park and lets it run around. (This might be normal behavior in San Fransisco or somewhere, but in suburban Adelaide it is kinda odd)
  • Alex is now 2, and doesn’t like sleeping at childcare. Fortunately, they have figured out that letting him sleep with a ladder (yes, a full size, aluminum ladder) will calm him down and get him to sleep.
  • Paul Keating – no matter if you loved him or hated him – had a unique way with words. From yesterday’s Financial Review: “When push came to shove, McGuiness’s journalism did not add up to a row of beans. He help more political, philosophic and economic positions than would have the Karma Sutra had it been a philosophic text“.
  • If you don’t program, and you write about the meaning of programming APIs then your opinion is moot. This also applies if you try and talk about APIs
  • The Moth is a cool boat, but has come a long way since my circa-1970 tunnel hulled version. It’s kind of weird that they banned tunnel hulls, but freaking hydrofoils are okay…

Run your web code from your IDE

Many Java developers complain about the length of time it takes to deploy their webapps for development, or to start the embedded WebTools server in Eclipse, or to use the mvn jetty:run process with Maven.

At work, we’ve created a solution using class which starts up Jetty and gets it to serve your webapp from within the IDE. This means you have start up times of seconds, and can debug without using remote debugging.

Happily, we’ve been able to open source this, too, so people can try it for themselves rather than just here me talk about it.

The source code is here, but you are probably better off using Maven, adding the following repository to your pom.xml:


<repository>
<id>EdAuUtil</id>
<url>http://maven.uat.educationau.edu.au/EdAuUtil</url>
</repository>

and adding the following dependencies:

<dependency>
<groupId>au.edu.educationau.opensource</groupId>
<artifactId>EdAuUtils</artifactId>
<version>0.9</version>
</dependency>

<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>6.1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>jasper</artifactId>
<version>6.0.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-ant</artifactId>
<version>0.8</version>
<scope>test</scope>
</dependency>

Then you can run the class au.edu.educationau.opensource.devsupport.TestWebServer from your IDE. I need to generate the javadocs and put them up somewhere, but for the moment the code is reasonably well documented.

Predictions for 2008

So it turns out that it’s 2008 and the thing to do is to do predictions for the next year. Here’s my 2:

  1. Facebook will have a huge leak of personal private information. It will turn out to be due to buggy code, which will finally focus some attention on the fact that Facebook’s codebase appears to be really, really bad.
  2. Someone will realize that recommendations are the next search. Some company will work out how to do for recommendations what Google did for search: ie, take what is currently an overly commercial medium (eg, Amazon recommendations etc) and turn it into a consumer facing tool which is generally useful. By 2010 what they did will seem obvious, and by 2011 they will be billionaires.

Update – 1 more thing:

OpenSocial will succeed in a big way – not because of support from the big players (Google etc) but because lots of small open source web projects (WordPress, Drupal, Joomla etc) can easily add support and will finally have a standard way of creating cross-platform compatible software.

Shipping software

http://me.edu.au/p/nlothian

Custom vertical social network, with feed integration (kind of like the Facebook activity stream, but driven by RSS), communities and single-sign on across a number of other applications.

Open Social support coming soon. I should do a post on how the open source implementation of that works. For the time being, though, this is all the code you need to show a Google Gadget into your app:

<c:import url=”/ifr”>
<c:param name=”url”>http://www.labpixies.com/campaigns/todo/todo.xml</c:param>
</c:import>

The Napster (Grockster?) of Facebook

IANAL, but how can Audibie possibly be legal? Since the doctrine of inducement appeared (ref Grockster) I can’t see how the DCMA safe-harbor provisions would save them. Perhaps they are relying on the fact that they don’t host the files themselves – although that didn’t save Grockster or Napster.

It’s interesting to think what Facebook’s liability would be over an application like this. Facebook have a currently have a copyright policy which passes responsibility for DMCA takedown requests onto the application author. Audibie have posted their takedown procedures, in accordance with the DCMA.

If I was Facebook I’d be pretty worried that might not be enough.

Beware the fast follower

Regarding Google To “Out Open” Facebook On November 5 – beware the fast follower.

Facebook has a pretty nice API, but depending exactly what Google shares it could be possible to build some pretty impressive applications. Imagine knowing the frequency each Gmail contact was emailed… that would make facebook.friends.areFriends look kind of primitive.

Oh, BTW – I was wrong (or more charitably – misguided) about this stuff. Brad was right – making public data portable is the only safe way to go.

Quick & Dirty Server Monitoring

Sometimes it’s difficult to setup Nagios for server monitoring. This is what I do instead.

Firstly, for load monitoring:


#!/bin/bash

FILENAME=< absolute path >/monitoring/logs/load-$(date +%Y%m%d).txt

cat /proc/loadavg | awk '{print strftime("%Y/%m/%d %H:%M:%S", systime()), $1, $2, $3}' >>  $FILENAME

Run it both from cron, and then I use another cron script and gnuplot to graph the output.

genloadgraph.sh:



DATE=$1
if [ -z $DATE ]; then DATE="$(date +%Y%m%d)"; fi
FILENAME=load-$DATE.txt
cp < absolute path >/monitoring/logs/$FILENAME < absolute path >/monitoring/load.txt
gnuplot < absolute path >/monitoring/loadplot.p
rm < absolute path >/monitoring/load.txt

loadplot.p:


set terminal png large size 800,600
set xdata time
set timefmt "%Y/%m/%d %H:%M:%S"
set title "Load"
set format x "%H:%M:%S"
set out '< absolute path >/monitoring/load.png'
plot "< absolute path >/monitoring/load.txt" using 1:3 title '1 min average' with lines, "< absolute path >/monitoring/load.txt" using 1:4 title '5 min average' with lines, "< absolute path >/monitoring/load.txt" using 1:5 title '15 min average' with lines
set output

Gives a graph like this:

Load Graph

It possible to do a similar thing for website monitoring:



#!/bin/bash

FILENAME=< absolute path >/monitoring/logs/nicklothian-$(date +%Y%m%d).txt
(time wget -q --delete-after http://nicklothian.com/blog/) 2>&1 | awk '/real/ {print strftime("%Y

/%m/%d %H:%M:%S", systime()), $2}' >> $FILENAME

Preserving privacy while promoting social network portability

Brad Fitzpatrick and David Recordon recently wrote an interesting paper Thoughts on the Social Graph which gathered quite a lot of attention. They addressed some themes which I’ve been thinking about for quite a while now, and certainly moved the issue on a lot more than the recent Wired article did.

There’s no doubt that Brad & David know what they are talking about, either. Indeed, if Tim O’Reilly invented Web 2.0, then I think it’s not much of an exaggeration to say that Brad wrote the software which powers it.

However, I think their approach to the social network problem is surprising. In particular, I think it’s odd that the people who invented OpenID are proposing a centralized repository for all social networking data.

I believe there are better approaches. I’ve proposed and built a demonstrator for a system using what must be one of the most under appreciated data structures of all time: the Bloom filter. In short, a Bloom filter is a compact data structure which will remember if it has seen a piece of data previously, without remember the data itself. Obviously, this is useful in the social networking context because you can do things like load up all a users contact and then make the Bloom filter public. That allows system to query the filter to see if they know another user, without exposing their contact list to privacy leaks.

Incidentally, that demonstrator is my first Facebook app. Writing Facebook apps turns out to be pretty nice, although in this case I wrote it in PHP -which is less enjoyable. Have I ever mentioned that I’m not a huge PHP fan? Perhaps that’s partially because I don’t know PHP at all, but it’s just such a goopy language. Mucking around with Ruby (which I don’t know either) makes you go hmmm.. that’s nice. Even in Javascript I find myself going hmm… okay.. not quite what I expected, but it kind of makes sense. Doing the same in PHP just makes you go hmmm… – not in a good way, either.