Category: News

Irrlicht website update

Posted by – 2012/01/06

The WordPress version of the Irrlicht website is now live, which means we can edit pages and post news articles using an online editor, users can post comments and we can even appoint community editors to post stuff without giving them rights to the filesystem.

Expect lots more activity there in the future :)

2011 in review

Posted by – 2012/01/05

Dear diary

Sorry for not writing to you of late, but this year has been a busy one.  I’ll make up for my lack of output with this mammoth post reviewing a small selection of interesting things I got up to this year…

More…

Flattr

Posted by – 2010/08/14

Now that Flattr is finally in public beta, I’ve decided to sign up and pledge the minimum possible payment, a measly €2 a month. Now all I need to do is actually find some sites to donate to!

I’m kind of torn about adding Flattr links to my projects, on one hand I want to encourage the uptake by being another site which supports Flattr, on the other hand I don’t want to whore myself out for a few pence.

So at some point I’ll add Flattr links to the free Android apps which I’ve made, which will feature in the menu at the top shortly.

Website update

Posted by – 2009/12/30

I’ve finally got around to editing the Simplish template and adding pages for some of my old software projects. There’s some links at the top up there, hover over them and you get a nice drop-down menu with a list of projects.

The meat of this is JavaScript stolen from another theme and some PHP code gratuitously pasted into my header, this isn’t IP theft, and not just because it’s the season of sharing! This is what’s great about free software licenses.

More Sidewiki Leaks

Posted by – 2009/12/14

Apparently the British press have been barred from publishing any of Tiger Woods’ sex pictures, and the block somehow extends to Internet news sites. They aren’t even allowed to mention what the block is about, so I’ve taken the liberty of filling in the blanks on Google SidewikiLeaks and will update it to include links to pictures when they are inevitably released:

Google SideWiki Leaks

It makes you glad that America has freedom of the press, even if Britain doesn’t.

Chart Against The X Factor

Posted by – 2009/12/06

For the last four years running Simon Cowell’s plastic karaoke acts have held the Christmas #1 spot in the UK singles charts thanks to ITV’s hit show The X Factor. People have been complaining that this has ruined the great British tradition of betting on which artist will take the number one slot, as it’s traditionally the only time of year when the chart is dominated by wacky Christmas songs rather than the latest boy bands and whoever else thirteen year old girls spend their pocket money on.

I’m not too bothered about popular music, the singles chart or who gets the Xmas #1 slot, but last week I was invited to join a growing group on Facebook who are campaigning to knock the X Factor winner from the top spot by mass purchasing Rage Against The Machine’s classic track Killing in the Name. The sound of rebellion to conquer the airwaves, political rap metal on future Christmas compilation albums, all for the princely sum of 79p? I don’t usually buy digital downloads but this time you can count me in!

According to Sky News the group had 43,000 members sometime on Friday, but by the time I got home on Saturday night there were 180,000 members and rising. As the media coverage increases so do the new members, which made me interested: how does a phenomenon like this evolve, how will it turn out next Sunday? What happens when the UK Charts people decide that it’s against the rules and disqualify the single?

So I decided to log and graph the group’s membership, every fifteen minutes I grab the page using wget, I extract the number of users and dump that into a text file along with the current date and time. Then I cut through it using a couple of awk and sed one liners, dump the results into an HTML file, graph it using Google Charts and upload the output to my file dump.

Update: These graphs are no longer live! Click for the live versions which are updated much more often using a different script

Click for the source data Members per hour

Here’s the scraping script:

#!/bin/bash
 
cd /home/gaz/ratm/
 
# get the timestamp
timestamp=`date "+20%y/%m/%d %H:%M:%S"`
 
# get the file
wget --max-redirect 2 -O temp.html http://www.facebook.com/group.php?gid=2228594104 --user-agent="Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.5) Gecko/20091109 Ubuntu/9.10 (karmic) Firefox/3.5.5"
 
# extract user count from the file
usercount=`sed -n -e "s/.* of \(.*\) members.*/\1/p" temp.html`
 
# remove any commas from the string
usercount=${usercount//[,]/}
 
# it must have a length, or it will cause problems when Facebook is having problems!
# in this case, we just give a -1 (not good practice from a stats PoV, but it keeps it simple) 
if [ "${#usercount}" -eq "0" ]
then
    usercount="-1"
fi
 
# remove the temporary file
rm temp.html
 
# write the output in CSV format
echo "$timestamp,$usercount" >> data.dat
 
# next I run the graph generating script

And this one (no longer in use) creates the two above charts from the data:

#!/bin/bash
 
# gets a column from a line of a CSV file. The first index is 1, not 0.
getElement() {
    RESULT=0
    local p=`echo "$1"p`
    RESULT=$(echo $2 | sed 's/,/\n/g' | sed -n $p)
}
 
# get the start and end times
 
getElement 1 "$(tail -1 data.dat)"
end=$RESULT
getElement 1 "$(sed -n '1p' data.dat)"
start=$RESULT
 
# get the current minimum and maximum values
min=$(cat minval)
max=$(cat maxval)
 
# get the last value
getElement 2 "$(tail -1 data.dat)"
lastval=$RESULT
 
# set new max value
 
if [ "$lastval" -gt "$max" ]
then
    echo "$lastval" > maxval
    maxval=$lastval
    echo New maximum, $lastval
fi
 
# and the new min value
 
if [ "$lastval" -gt 0 ]
then
    if [ "$lastval" -lt "$min" ]
    then
        echo "$lastval" > minval
        min=$lastval
    fi
fi
 
# get values for the Y axis
quart=$((($max - $min) / 4))
q1=$(($min + $quart * 1))
q2=$(($min + $quart * 2))
q3=$(($min + $quart * 3))
 
# extract the data using regexp:
# 1. get every 4th line of the file, meaning hourly
# 2. take all the values from the file
# 3. remove the trailing comma
 
data=$(awk 'NR%4==0' data.dat | sed -n -e "s/.*,\([0-9]*\)/\1/p" | tr "\n" "," | sed -e "s/\(.*\),/\1/")
 
# build the URL to the total members chart
total_members="http://chart.apis.google.com/chart?chtt=Total+Members&chs=600x300&cht=ls&chxt=x,y&chxl=0:|$start|$end|1:|$min|$q1|$q2|$q3|$max&chds=$min,$max&chd=t:$data"
 
# now let's do members per hour
 
lastval=$min
min=0
max=0
data=""
inputList=$(awk 'NR%4==0' data.dat | sed -n -e "s/.*,\([0-9]*\)/\1/p")
while read line; do
    if [ "$line" -gt "0" ]
    then 
        val=$(($line - $lastval))
        lastval=$line
    else
        val=0
    fi
 
    if [ "$val" -gt "$max" ]
    then
        max=$val
    fi
 
    data="$data,$val"
done <<< "$inputList"
 
# remove comma prefix
data=$(echo "$data" | sed -e "s/,\(.*\)/\1/g")
 
# build the per hour chart
members_per_hr="http://chart.apis.google.com/chart?chtt=Members+per+hr&chs=600x300&cht=ls&chxt=x,y&chxl=0:|$start|$end|1:|$min|$max&chds=$min,$max&chd=t:$data"
 
# I then create an HTML file from some templates and upload everything to my dump

Ubuntu 9.10: works for me!

Posted by – 2009/11/08

I was a bit worried about upgrading to Ubuntu 9.10 after El Reg’s scare stories claimed that nine out of ten people had problems with the automatic upgrade.
I guess their stats were skewed, nine out of ten people who are complaining on the Ubuntu forums were complaining about the upgrade, which is nothing like nine in ten people having problems.

Worked fine for me on two different machines, my only problem is that the battery charge profile on my laptop was lost.

PHP file list using mod_rewrite

Posted by – 2009/09/14

I’ve noticed that most of the traffic to this site is actually people visiting my permanent and temporary file dumps, which until today were literally a bunch of files dumped in a folder. DreamHost don’t keep my logs for over 30 days and I’d like to incorporate my file dumps into my Piwik stats, so I made a nice fancy file list in PHP. It has nice looking icons courtesy of famfamfam, though may move to stdicon in the future.

Some caveats:

  • The file list currently tracks directory views (via the template) but not yet file downloads, as that requires a Piwik plugin that isn’t final so I haven’t installed it, adding it should be trivial though.
  • As requests are passed through PHP using mod_rewrite it will result in long running scripts on your server, which may upset your shared web hosting provider.
  • Scripts are not yet excluded by rewrite rules! You won’t want to keep other scripts containing sensitive information in dirs under the path.
  • Access to files and folders beginning with “.” will be blocked.
  • It only works on Unices, not Windows servers as they don’t have the “file” command to get the MIME type.
  • You’ll obviously need an Apache installation with mod_rewrite.

To install it, just copy index.php, .htaccess and .filelist/ to the directory where you store your files. You can get the script (without icons) from SVN.

PISG is up again

Posted by – 2009/09/04

Now that I have a reliable shell, #irrlicht once again has an eggdrop bot, which will be useful because we haven’t had any way to add new operators for at least two years. The bot is logging and there’s a cron job to upload PISG output to the stats page. So anything you do say will be taken down and may be used in evidence against you…

bitplane also makes sailors blush, 0.3% of the time.

Oh, shiiii…

Piwik in, Google Analytics out

Posted by – 2009/08/27

I’ve stopped using Google Analytics and have now moved over to Piwik. I don’t have that many visitors, but there are still lots of good reasons to use Piwik. It’s better for everyone if I keep hold of my own stats instead of giving it all to Google and I may even do some Piwik hacking in the future.

Getting it working in Gallery2 was a bit of a pain, so I updated their wiki for them, but other than that it’s about the same as installing Google Analytics.

Subscribers are welcome to see my laughable stats :)