Saturday, 5 January 2013

Remote Access to Home Router Using SSH Port Forwarding

Here's the problem: I'm going to be at MadLab for the Coder Dojo today and I want to be able to remotely set up new Minecraft servers running on my machine at home. I can SSH in just fine, but to set up a new server I'll need to set up a new port-forwarding rule on my home router. The router is only accessible from within my home LAN.

SSH port-forwarding to the rescue:

At first I thought I could set up a simple local forwarding rule on the server with

ssh dave@myhost.com -L 8080:192.168.1.254:80

It connected fine, and then I tried in the local browser,

http://localhost:8080/

The page returned, but wouldn't let me access the router. It responded with HTTP error of 403 forbidden. Presumably this is because chrome is sending my laptop IP as the source IP.

In order to get round this I tried dynamic SSH forwarding as a SOCKS server:

ssh -C -D 1080 dave@myhost.com

I set up the SOCKS settings in Firefox to proxy port 1080 on local host and...

Bingo! http://192.168.1.254/ in firefox now gave me access to the router's configuration page.


Wednesday, 2 January 2013

Rimu Hosting DNS API

Here's the shell script that I'm using on my linux boxes to keep the DNS hosted by Rimu Hosting up to date with any changes to my dynamically allocated IP address from BT.


#!/bin/bash
wget -q -O -  -i rimu-dns-urls.txt  > /dev/null


The idea is to have a text file of URLs each of which updates the DNS for one address.  The list currently looks like this:

https://rimuhosting.com/dns/dyndns.jsp?host=lego.goopot.co.uk&api_key=MY-SECRET-NUMBER&ttl=300
https://rimuhosting.com/dns/dyndns.jsp?host=lego-wiki.goopot.co.uk&api_key=MY-SECRET-NUMBER&ttl=300


I then set up a one-line crontab entry to run this every five minutes:

*/5 * * * * cd ~dave/code/dynadns; ./dns-rimu.sh





Saturday, 22 December 2012

SSD Fail

Well I've learned some things about SSD drives and my old Compaq Presario.  

  1. The first hard drive to boot is the one plugged SATA port 0 and you can't override that in the BIOS
  2. Even when you get the SSD to boot it runs really slowly
  3. The  AS SSD Benchmark is a really good tool for diagnosing SSD performance issues
  4. If your SSD is running in IDE mode then it will be really slow.  To fix it you need to be able to run in AHCI mode
  5. But...the Compaq Presario has a Intel ICH7 southbridge chip set that doesn't support AHCI

So I can't use my new SSD on my old PC.  I'll have to put it into the newer Zoostorm PC.

Sunday, 16 December 2012

Failure Installing the SSD Drive

My new SSD drive arrived and I've been spending spare moments this weekend trying to install it -- without success. I've been mostly following this Lifehacker article on installing a new SSD.  Here's the steps so far...


  1. Using a combination of CCleaner and Windows Disk Cleanup I managed to get the disk usage on the old drive down to 247GB so it should just about squeeze onto the new  256GB SSD.
  2. I turned off the PC and installed the SSD in the 3.5" disk adaptor bracket.
  3. My first discovery was that I had no spare SATA power connectors.  I temporarily took the one out of the CD Drive. On Sunday I got an adapter from Maplin 
  4. I defraged the old HDD
  5. I used EaseUS to copy my C: drive onto the SSD drive.  I asked EaseUS to put 2MB unallocated at the start of the SSD as per the next step in LifeHacker.  That might have been a source of problems as the LifeHacker article suggests letting GParted do that
  6. I tried to get the SSD to boot via the BIOS.  It didn't work.  The drive complained that the disk wasn't bootable
  7. Next I tried EasyBCD to fix the boot record.  That got the SSD dual booting having started the boot on the old HDD.  If I told the BIOS to boot straight from the SSD it still said it wasn't bootable
  8. I then asked EasyBCD to fix the MBR.  I selected for it to "Install the Vista/7 Bootloader to the MBR" but the program crashed!
  9. Feeling a little desperate I bought a copy of the Windows Vista Recovery Disk from Neosmart.  I followed the instructions, let it run the auto recovery and it said it has fixed the boot data.  However, booting through the BIOS still failed
  10. I've now decided to give up and start again.  As I write this I'm defragging the HDD one more time.  I'll then start back at the top of the list of instructions and see what happens this time








Thursday, 13 December 2012

SSD Drive

My 2009 vintage Compaq Presario is running out of disk space.  I've been convinced that SSDs are the way to go.  The PC is running SATA II supporting up to 3GB/s transfer rates.  I've ordered 256GB SATA II SSD from Crucial.

In the meantime CCleaner has bought me back about 20GB of cleaned up temp and cache files.

Sunday, 9 December 2012

Spanning Backup for Google Accounts

I've just purchased Spanning Backup for our home Google Apps accounts.  I feel that I should really write a little script to pull my Google data out to a local hard drive periodically.  I've got a year to find the time to write that script before I need to renew Spanning.