Archive for 2012

The Trouble Getting A 69

As someone who uses the bus a lot I’ve been using the Real Time Information system since it came out. I now use it pretty much every day to plan my trip.

Usually I find the data to be pretty accurate, with one constant exception – the 69 passing my house in the mornings which is constantly late.

A few weeks ago I decided to gather some data and find out just how late it was. There is still no API for accessing the real time information, so I wrote a python script to get the data from the website, and set up a cron job on my raspberry pi to run the script between 8:00 and 8:45.

That was three weeks ago, so I figured there was enough data gathered that it was worth putting it in a spreadsheet for further analysis. Here’s what I’ve learned:

  • At 8am the bus is due between 8:14 and 8:17
  • On most days it actually arrived between 8:30 and 8:35
  • The first three days seem to have had extra delays, arriving between 8:40 and 8:45
  • On one of the 15 days the bus didn’t run

The full data is available here

RPi Munin Temperatures

Just two weeks ago I upgraded my raspberry pi from the original squeeze image to the newer wheezy based raspbian. Something I tried to do was to get temperature information in munin, but it didn’t seem possible

Today’s update from Eben indicated this was now simples. So, I updated and after reboot the temperature was available from /sys/class/thermal/thermal_zone0/temp.

I’ve put together a quick munin plugin to record this. The temperatures end up getting rounded to the nearest degree, but I think that’s ok.

#!/bin/bash

if [ "$1" == "autoconf" ]; then
     if [ -e /sys/class/thermal/thermal_zone0/temp ]; then
         echo "yes"
     else
         echo "no"
         exit 1
     fi
elif [ "$1" == "config" ]; then
     echo "graph_title Raspberry Pi Temperature"
     echo "graph_args --base 1000 -l 0"
     echo "graph_vlabel Temperature in Celsius"
     echo "graph_category Sensors"
     echo "temp.label temp"
else
     temp=$(cat /sys/class/thermal/thermal_zone0/temp)
     echo "temp.value $((temp/1000))"
fi

Updated: Screenshots in LXDE

Back in 2010 I wrote about how to configure the gnome screenshot tool in lxde/openbox. Since then the advance of gnome3 has continued with 3.6 bringing changes that some don’t quite agree with.

I too have a new problem using gnome utilities since upgrading to Fedora 17 (with gnome 3.4). The behaviour of the screenshot tool has changed so that it no longer seems to ask where to save the screenshot (giving you an opportunity to choose a useful filename), but saves it with a timestamp in your homedir. While it is possible to force an interface it doesn’t seem possible to enable just the filename selection screen, having filename selection means you need to see the ugly set of all possible screenshot options first (how not very gnome).

Because of this I’ve decided to move to the xfce screenshot tool. It was an easy choice since I already brought in xfce utilities to replace other broken gnome ones (terminal, power-manager), and it’s pretty close to how the old gnome tool operated. My lxde-rc.xml how looks like:


<keybind key="Print">
<action name="Execute">
<command>xfce4-screenshooter -f</command>
</action>
</keybind>
<keybind key="A-Print">
<action name="Execute">
<command>xfce4-screenshooter -w</command>
</action>
</keybind>
<keybind key="C-Print">
<action name="Execute">
<command>xfce4-screenshooter -r</command>
</action>
</keybind>

As a bonus, I now have support for taking a screenshot of a selected region, which I’ve bound to Ctrl+Printscreen.