Playing with Planet

Today while I was bored and hiding inside to get away from the crappy weather, I decided to have a play with planet. Ive screwed something up as it should be serving the page as utf-8 but it doesnt seem to be. Other than that its working well. I’ve put it behind some auth until I check with the people whose blogs I have on it that they dont mind. Until then its just for my use.

First ruby script

Well technically not my first, but the first ive written from scratch. Its just a simple hello world example. Im going to try to extend it to do more now.
Heres what it currently looks like.

#!/usr/bin/ruby
# first cut of a ruby script
require ‘cgi’

# create a cgi object of type html 4
cgi = CGI.new(“html4”)
cgi.out {
cgi.html {
cgi.body {
cgi.h1 { “Hello Ruby!” }
}
}
}

And here is what it does.

Ajaxterm

Ive been playing with Ajaxterm today. Its really kinda cool, I have it running behind some password auth and over ssl now. Which is good, it means that in places where they have an aggresive outbound firewall stance I can still get to a terminal on my machine and ssh from there.

Weird problem

So tonight we came across a weird problem. This chunk of code in one of the Koha modules was causing a script that called it to hang. Only when called from the web though, it works fine from the command line

my $query =
“Select quantity,datereceived,freight,unitprice,listprice,ecost,quantityreceived
as qrev,subscription,title,itemtype,aqorders.biblionumber,aqorders.booksellerinvoicenumber,
quantity-quantityreceived as tleft,aqorders.ordernumber
as ordnum,entrydate,budgetdate,booksellerid,aqbasket.basketno
from aqorderbreakdown,aqbasket,aqorders
left join biblioitems on biblioitems.biblioitemnumber=aqorders.biblioitemnumber
where bookfundid=? and aqorders.ordernumber=aqorderbreakdown.ordernumber and
aqorders.basketno=aqbasket.basketno and (budgetdate >= ? and budgetdate < ?)
and (datecancellationprinted is NULL or datecancellationprinted='0000-00-00')
";
warn $query;

If the warn is commented out it works fine, I think there is a bug in the apache installed on the machine this was happening on.

Testing the code tag

Just testing out the code tag here. Here is some perl

use Getopt::Long;
my ($input_marc_file,$number,$nowarning) = (”,0);
my $version;
GetOptions(
‘file:s’ => $input_marc_file,
‘n:s’ => $number,
‘v’ => $version,
‘w’ => $nowarning,
);

Here is some ruby

class Foo
def bar
“abcde”
end
end

Here is a snippet of xml

some stuff

Thats really pretty cool, I can see Ill be using it a lot more.