Tracking my internet connection

April 25, 2010 on 5:12 pm | In Coding, Making | No Comments

Ok, to be fair most of the time my internet connection is great – it’s nice and fast. But periodically it will go all wonky for a few days and then I want to ‘keep an eye’ on it. A bit tricky… However there are two good things: there’s a fairly simple web page on the router that gives me all its stats, and Be (my ISP) has an excellent forum with lots of helpful technical people & Be staff to give tips on what to do. So if I can gather useful info for them, I’m sure I’ll be able to fix it.

What I decided to do is only use Python to ‘scrape’ the data I wanted from the Router’s web page and the stuff it into some data store and give me a nice graph out of it. I did look at cacti/rrdtool but I would have had to install and configure lots of other things (as I’m on a Mac) and I just wanted to use Python ideally, because Mac OS X comes with Python pre-installed.

So instead, I’ve knocked up a simple script that reads the Router status once a minute and writes a row of data out to a sqlite database (which is very simple to knock up). Then I have another script that reads out of that database and produces a html page with a graph or two. I’ve used the Google Visualisation API to draw the graphs, because they have a simple python API for it and a nice timeline graph that I can use.

I’ve a little Mac mini that I can leave on running my little ‘monitor.py’ script and Mac OS X has ‘web sharing’ (using Apache web server) that I can use to invoke ‘report.py’ to produce some nice interactive graphs of the history of my router. (a quick link on how to set this up)

So now I will leave this running for a while and see what data it produces. When I have a LOT of data I should probably summarise per hour and/or per day, and not keep every single minute’s worth of data. I don’t need to worry about that too much yet.

I might even be able to use this approach at work, although we do have Cacti set up there, so that may be a better option, but it is very complicated to configure and this might be a simpler/more flexible solution – especially with lots of good graphing solutions now out there.

The scripts are here: speedtouch_monitor.zip (41 KB)
They should work with a Speedtouch 585 Modem set to it’s default IP address (eg any Be customer).
You will probably need to enter your router’s password in the monitor.py file.

Also here is an example report from report.py.

UI thoughts for snooker scorer

April 26, 2009 on 1:04 pm | In Coding | 3 Comments

Going for a walk yesterday was obvious a good move; not only was it a warm and sunny day but I also had a bit of a brainwave for the UI design of the Snooker Scorer. The problem I had was that I wanted to add some extra buttons in what was already a complex UI. I’m going to add some stat tracking so that users can see the pot and safety success rate – but right now there is only one button to swap players at the end of a break. I need to let users choose between three options; a safety (no pot attempted), a missed short pot and a missed long pot.

My previous prototype had some extra button squeezed in. This wasn’t great, because it made the space for all the other ‘pot ball’ buttons smaller, and also I just couldn’t work out how to make an icon for ‘safety’ or ‘missed long pot’.

My brainwave was to not put new buttons in. Instead I’ll make an overlay appear when the ‘swap players’ button is pressed and held down. The user can then drag up the screen to choose a short/long pot miss. If the user just presses down and releases their finger they will get a ‘safety’ which is roughly the same behavior as before. I think this will feel quite good in practice and also can be done without looking at the screen too much.

Continue reading UI thoughts for snooker scorer…

Snooker Score – update and future thoughts

April 5, 2009 on 7:26 pm | In Coding | 1 Comment

So my ‘snooker score’ app has been out for a couple of weeks now and I’ve been really pleased with it so far; I’ve had some great feedback from people and there are quite a few more things to do with it than I had originally thought.

In testing with Apple at the moment is a 1.1 update that will add

  • Undo (which I was planning to add anyway but was mentioned by a Finnish reviewer)
  • A bug fix – if the last ‘red and color’ you potted was a yellow, this would incorrectly have been considered as the last yellow. Now it will ask you to pot the yellow again, which is correct (pointed out by Ruud – many thanks!)
  • Remove Red Ball – a new action on the menu, you can take a red ball off the table without affecting the score. Ruud pointed out that you sometimes need to do this in Snooker, e.g. if you pot two balls in a single turn that’s not a foul, but you’ll only get 1 point for it. Also you could foul by potting a color and a red. In that case the color would be respotted (and the opponent would get points) but the red would not.
  • More info – the single line of information now changes every 2 seconds to show more information, including Current Break, Score Difference, Maximum Break, Points Remaining, Red Balls Remaining.

All in all this is a good next version – I’m very happy that I managed to get undo and an updating info line in so easily (the NSTimer class being easier to use than I’d expected).

Continue reading Snooker Score – update and future thoughts…

My app is out!

March 23, 2009 on 10:24 am | In Coding | 5 Comments

Very excited this morning my first iPhone application has been approved by Apple – it’s a very simple, but useful app for keeping track of the scores in a Snooker match. I’ve used it to keep track whilst watching Snooker on the TV and it seems to work for me.

There’s plenty more I would like to add to it, like working out how many Snookers someone is behind, collecting statistics for an entire match, allowing mistakes to be undone. I’d love to be able to get live scores into it somehow, so you can follow games as they happen (a bit like the wimbledon desktop app that IBM seem to do each year) but I’ll have to try and find a live score feed from somewhere. Tricky. Perhaps it can be ‘crowd-sourced’ from someone willing to sit on a web page and update the scores?

The main barrier to adding new features is time, and B’s macbook being dead again, so I have to share my iMac with her. Fingers crossed that the repair guys actually fix it this time.

Anyway – it’s been fun learning how to make an iPhone app so far and going through all the gubbins needed to get it on the app store. I don’t think Apple have made it too hard, although some parts (like tax forms) could be easier.

Now we’ll see if anyone likes it!

Update: Direct link to Snooker Scorer in iTunes app store.

Excellent comment-spam blocking plugin

January 31, 2007 on 10:18 pm | In Coding | 2 Comments

So, along with the new WordPress 2.1 we have a new version of the comment-spam-killer Akismet. It’s good, but not 100%, so I’m experimenting with other plugins as well.

A really nice idea is that of automatically turning off comments after a certain length of time (i.e. 3 months) as I’ve noticed almost all my comment spam is for OLD posts.

James McKay has already done this and offered it up to the internets here. It is made of 100% WIN and I like it very much indeed. It has many settings to fiddle with, although the defaults work right out of the box too.

I’m also using a ‘captcha’ service from ProtectWebForm.com that appears to be a free service – what nice people. They have a cunning method of detecting if you are using a proper web browser or something without Java Script, which most humans have turned on, and will only show you the “enter the magic secret code” form if it thinks you are an ROBOTZ!!!onetyone.

So far, after turning those on I have NO comment spam – wahey! I’m very happy.

Updated to wordpress 2.1

January 25, 2007 on 1:16 am | In Coding | 2 Comments

Seems to have broken the Flickr integration – oops!

Ahh my pics are rubbish anyways… but I shall have to sort it out for bobble’s site.

Next Page »

Creative Commons License This work is licensed under a Creative Commons Attribution 2.5 License.
Powered by WordPress with Pool theme design by Borja Fernandez, modified by bubb.
Entries and comments feeds. Valid XHTML and CSS. ^Top^