Saturday, 12 November 2011

Minecraft Mod Manager Website Wish

I seem to have become the Minecraft system support person for lots of son #1's friends. The trouble is that they all want mods installed and while not that difficult, you need to be able to unpack JAR files in order to do that. This is well beyond the technical grasp of most Minecraft parents it seems. What I really want is a web site where you can just click a few buttons and it will install the mods. I'm going to see if I can contact the person who writes MineSwitcher to use that as a starting point.

Monday, 17 October 2011

I'm A Bitcoin Trader

This morning my money transfer cleared into my Mt Gox account. It had taken two working days from the point I instructed the bank. I'm looking to buy 10 BTC, but I've got the maths wrong in the previous post. I'm going to make a first go at getting as many BTC as possible for my 3 GBP and transfer over some more funds.

The price this evening for BTC on Mt Gox is 1.71 per BTC. I'm going to put in an order for 1 BTC at 1.70 and another at 1.30 and see what happens. My 1.70 offer was immediately taken up. The 1.30 sat there.

Next I decided to get my new BTC out of Mt Gox. After my transaction fee I had 0.994 BTC left. I put in my Bitcoin address and submitted the request to Mt Gox. The option that I wasn't aware of was the "green address" This option seems to mean that the receiver can trust the transaction with zero confirmations. As I'm not that time sensitive I decided not to take the option. I fired off the request at 19:10 UK time. By 19:11 I had an unconfirmed transaction in my Bitcoin client. Next I went to the internet banking site, put 16GBP in the Mt Gox account, and then fired off an email to Wuala requesting 100GB of storage for 10BTC. By 19:28 I had my first confirmation of the Bitcoin transfer.

Sunday, 16 October 2011

Float Food Trip Disappointing

Yesterday we went with Jess and her boys on a "a foodie, floating, family day out exploring the region's historic waterways". Really disappointing. It turned out to be a much delayed 20 minute canal trip from the Mark Addy to the Lowry theatre. As for the food, the kids got a carton of Vimto and a Chorley cake. Apparently it was celebrating the launch of some book. That passed me by.

Still, we had a nice time wandering around Media City and annoying the pettifogging BBC security personnel: "That is an official BBC prop".

Wednesday, 12 October 2011

Buying Some Bitcoins

I wanted to buy some backup space on Wuala using their bitcoin offer. As I'd only every dabbled with bitcoin previously I only owned 0.005BTC. How many bitcoins do I need?
Wuala are selling 1GB of storage for a year for 0.1BTC. Looking on Mt. Gox, I can today (12 Oct 2011) buy 1BTC for about 2.60 GBP. That would be a staggering 26 pence per GB per year. I figure I'll push the boat out and try to get 100GB. I've sent a bank transfer of 3GBP to Mt. Gox. As soon as it clears I'll have a go at buying storage with bitcoins.

Monday, 10 October 2011

Power Up Or Run Down?

The Security Now Podcast has just informed me that lithium-ion batteries should be kept charged but nickel-metal hydride ones need to be fully discharged in order maintain battery life.
For my gadgets that means:
  • Work laptop - Keep Charged
  • Nokia E71 - Keep Charged
  • HTC Desire - Keep Charged
  • Mifi (Huawei E585) - Keep Charged
  • Asus Aee Transformer tablet - Keep Charged

Friday, 7 October 2011

Setting Up A Minecraft Server

#1 and #2 sons are both addicted to Minecraft. In our "Dad and son techie evening" this week #1 son said that he wanted to set up a Minecraft server. It was actually very easy.

  1. Follow the instructions from the Minecraft Wiki to get the Java files on to the server
  2. I had to reduce the memory footprint as I'm installing it on the Rimuhosting VPS server that is quite restricted on RAM. I went for starting with 500 megs and maximum of 800 megs
  3. Set up a white list file with the users we want to allow
  4. Kick off the server: java -Xms500M -Xmx800M -jar minecraft_server.jar nogui
For now I just kept the server running in a screen session on the server. I do have a shopping list of things to tidy up:
  • Set it up properly to start at boot time following the Debian init.d approach
  • Set up logrotate to manage the log file
  • I really must set up iptables or equivalent to give me a suitable firewall

Wednesday, 5 October 2011

Wuala, Sunk Cost And Backup Economics

Time spent backing up is rewarded in heaven. Hence I was disappointed at the Wuala announcement that they had stopped their P2P backup storage trading. I had managed to get 40GB of backup space available by sharing disk space on various PCs. I need roughly 60GB available for backup at the moment. The Wuala folks say that I can keep the 40GB free for a year which is a pretty large incentive to stay with them. They also sell space using bitcoin. I could buy another 20GB for a year for 2 BTC which at current rates is about 7 GBP. Treating my 40GB to date as a sunk cost I think it makes sense to stay with Wuala for the next twelve months. Reminder to self: start looking for a new backup provider in September 2012.

Tuesday, 4 October 2011

The Math Book

I've just finished reading The Math Book. Nice book for dipping into with a page per topic on mathematics throughout history. My favourite was audioactive sequences.

Saturday, 1 October 2011

Debian Server To Send Email Automatically

I run a debian server with Rimu Hosting (highly recommended). Every week I've been going on to do a bit of house keeping. I realised that I could automate those tasks and get the server to send me an email to tell me what it had done. I decided the first problem to solve was to get the server to send me an email from the command line. After a little googling I tried this:

echo "This is a test" | mail -s "Just testing from the server"

That didn't quite work as expected. The problem was that I run my email from Google Apps on my domain. I wanted addresses to be picked up by Google's email servers. However, the debain server knew that it was so decided to handle the email itself. It very efficiently delivered the email to the linux user account on the server, and not my Google mail box.

I needed a way to tell the server that email to should be handed off to Google and not processed locally. A bit more googling led me to the Debian Wiki page about Gmail and Exim4. I followed those instructions to the letter and tried again:

echo "This is a test" | mail -v -s "Just testing from the server"

Nothing seemed to happen at all. No email arrived either locally on the server or to Google. Hmmm.

Back to the drawing board. I next tried to send an email to my wife's account to see if I could figure out what was working.

echo "This is a test" | mail -v -s "Just testing from the server"

That worked like a dream. So the Exim config is working fine, but the mail program doesn't know to go to the SMTP server rather than delivering locally.

Digging into the docs I figured out that I needed to make sure that the "local_domains" parameter was set correctly. I edited /etc/exim4/conf.d/main/01_exim4-config_listmacrosdefs and changed the local_domains parameter to be empty. I re-ran:

sudo update-exim4.conf

...and tried again. It worked. Yeah!

Wednesday, 28 September 2011

Getting Ready For John Hegley

Went to the Manchester Museum today with the boys. We were taking a look at the Living Worlds exhibit in preparation for them going to see John Hegley next week. I wish I could go along.

Friday, 23 September 2011

Manchester Jelly

Today I spent the day working from Manchester Jelly. It was quite an interesting day. I definitely felt the outsider working for "the man". I wasn't quite sure how much we were suppose to be chatting about things. The conversation came and went. Sometimes there were conversations about WordPress, VAT returns, charge out rates. Sometimes there were Trappist like silences. I think that if there becomes a core of people who turn up reasonably regularly then some common shared background will emerge and conversation is likely to flow more smoothly. Oh, and I did manage to have a reasonably productive day!

Wednesday, 21 September 2011

Make Vibrobot

#2 son and I have just finshing making the Make Magazine Vibrobot. We used a metal shoe polish tin as we couldn't find a metal sweets tin. The shoe polish tin was circular so the cable ties wouldn't hold the motor in place. #2 son solved the problem "use duct tape". I have taught him well!

Tuesday, 20 September 2011


I've been playing with foursquare recently. It is quite good fun, but I have no friends. If you are on foursquare and you know me, you can add me as a friend.

Monday, 19 September 2011

Tooth Fairy Arrives

Son #2's first two teeth both fell out on the same day yesterday. The tooth fairy came over night. Given #1 son's common reading of Wikipedia as the Source of Truth I hope he stays off the topic.

Sunday, 18 September 2011

Minecraft Mod Manager

Son #1 has got hugely into Minecraft recently. As a result son #2 is now interested in it also, but that's a different story. I've been roped in as the tech support to install all the "mods". Installing mods involves unpacking and repacking the contents of the minecraft.jar file and moving resources about in your minecraft folder. This is too tricky for a nine-year-old to do reliably at the moment. I've started writing a python script to automate the process. I had a quick goolge to see if I could find someone solving this problem already but didn't find anything.

Saturday, 30 April 2011

Send and Receive SMS with Python

I was thinking about writing a text-based game similar to the classic Fighting Fantasy books, but using SMS as the delivery mechanism. To do that I would need a way to send and receive SMS text messages to and from a server. As a challenge to see how that would work I wanted to write a prototype that would look like this:

CPU>>User: "Hello! What is your name?"
User>>CPU: "Fred"
CPU>>User: "Nice to meet you Fred"

The program itself is obviously easy. The problem is how to do the input and output over SMS. On to Google to see if I could find anything. Second link down on my first search I found the Active State code recipe 'Send and receive SMS messages using TextMagic'. It had a nice looking python package available. Reading the TextMagic website it seems that the only way to get started is to buy 200 SMS credits for £20. Hmm a little pricey as a barrier to entry.
I remember using Clickatell for this sort of thing ages ago. I took a look back at their site. The reality-check came in pretty quickly as Clickatell was going to cost minimum of €100 to set up and then €25 per month to run. So, back to TextMagic. And then I found out how to sign up for a free trial account!
With the free trial set up the next job was to set up the python environment. I use virtualenv to keep my python installation clean. To get started therefore created a new virtualenv.

$ virtualenv sms
$ source sms/bin/activate

I then installed the PyTextMagicSMS package.
$ sms/bin/easy_install PyTextMagicSMS
The first job was to try the sample sending program:

import textmagic.client
client = textmagic.client.TextMagicClient('your_username', 'your_api_password')
result = client.send("Hello, World!", "1234567890")

...which worked a treat. Obviously change the method parameters to match your settings.
So onwards to reading the Text Magic documentation to find out how to receive a reply. There are two ways of receiving a reply. Either you can poll your in-box to see what messages you have received, or you can set a callback URL to be notified of the response. The callback URL is clearly the way to go for anything of any complexity, but just to get started we will poll the in-box.

import textmagic.client
client = textmagic.client.TextMagicClient('name', 'pw')

received_messages = client.receive(0)
messages_info = received_messages['messages']
print('%d messages in in-box' % len(messages_info))
if len(messages_info) > 0:
first_message = messages_info[0]
print("Message from: %s" % first_message['from'])

Okay, so we're getting close to a solution. I'll have one program that sends the hello part of the conversation, a second program that checks the in-box for replies and then sends the final message. Here's the sending one...

import sys
import textmagic.client

client = textmagic.client.TextMagicClient('username', 'password')
no = sys.argv[1]

result = client.send("Hello! What is your name?", no)

...and here's the receiving one...

import textmagic.client
client = textmagic.client.TextMagicClient('username', 'password')

received_messages = client.receive(0)
messages_info = received_messages['messages']
print('%d messages in in-box' % len(messages_info))
if len(messages_info) > 0:
first_message = messages_info[0]
from_no = first_message['from']
name = first_message['text']
print("Message from: %s" % from_no)

client.send("Nice to meet you %s!" % name, from_no)
print("I have sent a reply")

All this needs is a main loop round it to keep polling for input and we're done.

Friday, 22 April 2011

Pennington Flash to Wigan Pier Bike Ride

Had a great bike ride with the whole family today. We went from Pennington Flash to Wigan Pier. We stopped at the Dover Lock Inn on both the way out and the way back. It even had a bouncy castle in the grounds.
The only down side was that the museum at the Wigan Pier end of the ride had closed down. That did rather mean that we got to the end of the ride and there was no where to get a nice ice cream.
Still, according to the Gmaps Pedometer we made a rather impressive 13.3 miles.

Wednesday, 30 March 2011

Unthanks Sound Check

We had an exciting trip today. Becca who teaches DS1 viola at the RNCM also plays in the band The Unthanks. They are playing at the Manchester Cathedral tonight. We went along to see the sound check. All very exciting. The boys of course thought that Becca was the star not knowing who the Unthank sisters are. Earlier on we made Mother's Day cards. I'm really not very good at teaching drawing. You Tube helped out with a video on how to draw a flower. I don't understand how when the guy on the video draws it looks really good, but when I do exactly the same thing it somehow looks crummy.

Tuesday, 29 March 2011

Turning Off Google Ads

I'm going to take my Google Ads off this blog site. It has been an interesting experience. In three years I've had 3,000 page impressions resulting in 34 click throughs and earning me £6 pounds. When it comes down to it this is not going to pay the mortgage and I'd rather have the higher esteem of any readers by not having adverts on the site.