Archive for the ‘IT Stuff’ Category

Linux / PocketPC / Evolution – Bliss!

Monday, November 29th, 2004

So, I’ve been wanting to get more organised. Ask anyone who knows me – its been something I’ve been wanting to do for years now, just never got round to it… :)

Today, I decided to bite the bullet and set aside an evening to getting some sort of solution working. 60 minutes later and here I am!

I already knew the candidate toolset from earlier explorations: SynCE for the Linux to PocketPC connection (I’ve been using this for months to transfer individual files to and from my iPaq), MultiSync to do synchronisation with an organiser, and Evolution as my Organiser – Calendar/Task Tracker/Mail Client.

Thanks to the wonders of Debian, a quick apt-get, and I had all the goodies installed. A pleasant 15-30 minutes spent getting the mail client kind of how I like it. Then another 15 minutes to get synchronisation working. So smooth! And functional too – the first sync was over in seconds, but a quick check of my Evolution window showed all my tasks present. Then I marked one task as completed on the PC and one on the iPaq. A re-sync, and both devices showed the change. Likewise Calendar events went across as well.

I’ll grant that its a bit rough around the edges. The setup of the SynCE connection between the PC and the PocketPC uses some command line tools which I’ll be wanting to script up, but that shouldn’t take long. Likewise, the MultiSync plugin for SynCE generates heaps of debugging output, which I think is fascinating, but could scare the casual observer.

But, in summary, it works, I encountered no real gotchas in setting it up, and I have a real, bona-fide Personal Information Manager running happily on my desktop Linux PC, syncing up with my PDA. I’m a happy man!

When I think about my first experiences with Linux back in the 1.2 days (1994!), it just amazes me to see how its evolved into a real candidate for a desktop OS. Kudos to all involved!

Addendum – almost perfect ;( I now notice that entries synced across from the Pocket PC to the PC have their time set to UTC which (in my case) makes the 10 hours later they should be! Both the PC and PDA are set up with the right time-zone. A quick search of the web shows this to be a known problem. Well, at least I have Tasks ok! Maybe a little kludgery will sort me out till the official fix arrives – I’ll see what I can do…..

JRobin – a quick and easy graphing tool

Tuesday, October 5th, 2004

So, finally got around to playing with JRobin, and I’m pretty impressed. To those who don’t know, JRobin is a re-implementation of RRDTool, a data storing and graphing utility, in pure Java (The original is your standard configure, make, make install C jobby).

Anyone who has worked in Network Management has almost certainly encountered RRDTool – its a nice generic tool to store arbitrary numeric data without having to worry about files growing without bound, due to its trick of being able to aggregate data as time goes by. Because of its command line interface, it can be grafted into any little sysadmin script to produce graphs on pretty much any aspect of a system.

I’ve been a big user of it in the past, mainly with Perl. RRDTool comes with Perl bindings which makes it pretty convenient. Similar bindings have existed for Java, but the need to manually compile up RRDTool for your particular platform has detracted somewhat from the run-anywhere Java thing!

JRobin is a re-implementation of RRDTool in pure java. So, bundle the JAR up and it should just work, no matter where your application runs.

I’ve just hacked together a quick app that reads in a log file and produces a graph, and the process is pretty painless. Loading up my log file (of timestamp, value pairs) was done with the following:


while ((line = reader.readLine()) != null) {
StringTokenizer tokenizer = new StringTokenizer(line);
long time = Long.parseLong(tokenizer.nextToken());
double value = Double.parseDouble(tokenizer.nextToken());
Sample sample = db.createSample();
sample.setTime(time);
sample.setValue("temp", value);
sample.update();
}

And producing a JPanel containing a graph is even easier!


RrdGraphDef def = new RrdGraphDef();
def.setTimePeriod(Util.getTimestamp(2004,9,01), Util.getTimestamp(2004,10,4));
def.setVerticalLabel("Degrees");
def.setTitle("Computer Room temperature");
def.datasource("t", RRDFILENAME, "temp", "AVERAGE");
def.area("t", new Color(0xFF,0,0),"Temperature");
def.gprint("t", "AVERAGE","Avg temp: @3@r");
def.setLowerLimit(0L);
RrdGraph g = new RrdGraph(def);
JPanel p = g.getChartPanel();

Pretty straightforward, Huh?!

Now, if its graphs you’re after, bear in mind that JRobin is not designed to produce 101 different types of 3D, animated, translucent graphs – you get a basic line graph, and thats it (although its perfectly servicable, and not unattractive). If you want fancy graphs, you’re better of storing the data yourself and using JFreeChart.

One final little thing, in this already overly-long post. As someone who does a lot of Perl code (and is imbued with some of that culture), I’ve gotta say its refreshing to be able to produce my graph without a single Factory, or Delegate, or Proxy in sight. I mean, don’t get me wrong – I love my Design Patterns – but sometimes you just want to write code. You know what I mean? ;)

The Webserver grows – bring on AWStats

Thursday, September 30th, 2004

No good having a blog if I can’t justify my own sense of importance by seeing just how many people hang on my every word. (You’ll be pleased to know that the count is currently 8 different people ;) )

So, in comes AWStats to analyse my web logs. Its not a bad little package. I’ve used a few tools over the years to do this sort of thing for various clients – Analog and Webalizer come to mind immediately. Of the three, Webalizer was the easiest to install and get things up and running quickly. Analog was very customisable, but lacked a bit of “sizzle”. So far, it seems that AWStats sits between these two – very comprehensive reporting capabilities, and a reasonably nice look. But the cost of that is a bit of a fiddle to get things running.

All in all, though, not too hard. Certainly worth a look, and probably my preference out of the three tools.

Blogging initiation – WordPress

Wednesday, September 29th, 2004

Well, after months of procrastination, I’ve finally entered the world of blogging, with WordPress being my initial tool of choice. So far, I’m pretty chuffed – the look is good, and the install was relatively painless.

Relatively!

Handy hint to others who are keen to try out this fella, the stable version (1.2) does not play nice with PHP 5. Instead, grab one of the nightly builds which seem pretty stable (so far!), have a nicer install process, and work with PHP 5.

I was able to set up a number of instances, each sharing the one database reasonably easily (although it involves hacking the config file, as opposed to using the excellent web-based GUI through which you can configure every other option). All things going well, these other instances will play host to the jet-setting stories of other members of the Asman horde…