Virgin Media and its not so Superhub

There was a time when I would have recommended Virgin media to anyone. Their flagship product at the time, the 50Mb service, was fantastic for me. A rock solid service that never had any issues (other than at one time when BT cut through the fibre), gave me a guaranteed 5MB/s, and never had any noticeable packet loss or congestion.

Since Virgin have upgraded me to 100Mbps however, I have had no end of issues. Two faulty “superhubs”, an awful service during peak hours, and countless minutes of unhelpful customer service.

virginmediasuperhub Virgin Media and its not so Superhub

Using my own router and disabling the “Super”hubs built in functions has improved things – I am no longer getting the hub losing connection and resetting itself 12 times a day – but not much. Not to mention the STMs being introduced. One could conceivably hit their STM limit with only ~20 minutes of legitimate useage (eg Steam, ISO downloads etc), let alone pirated material.

The bigger issue here however is that Virgin are chasing headline speeds without actually being able to sell the capacity required; hence the new STMs on its flagship product, and countless threads on the user forums about unuseable connections.

The worst of it? I have been told personally that the support team have detected “over-utilisation” on my UBR, but it is 3% below their threshold to raise it as a problem with the network team. In other words, I am going to have to put up with a dreadful connection during peak hours (when I might, oh I don’t know what to play a computer game, or the other half might want to watch IPlayer on our Smart TV), and endure it getting significantly worse until they will even raise it as an issue.

Cheers Richard, cheers Usain!

On the trail of the White Horse

It has been news for a while now, but it doesn’t make it any less tragic that Caballo Blanco has passed away.

Micah True was introduced to the world at large by the seminal Born to Run, and for many people – myself included – has been a source of inspiration.

This article, and its comments below, by Christopher McDougall shows just how much he was cared for around the world.

“McOso, who cares how Geronimo died?” he’d say. “Let’s just talk about how he lived.”

Run Free.

1984 is finally here

I’ve never been foolish enough to think that, living here in the UK, I am totally “free”. I do however enjoy a good standard of life and am free, within certain restrictions, to pursue my life as I see fit.

The government will be able to monitor the calls, emails, texts and website visits of everyone in the UK under new legislation set to be announced soon.

Internet firms will be required to give intelligence agency GCHQ access to communications on demand, in real time.

http://www.bbc.co.uk/news/uk-politics-17576745

So the government has finally come to legislate the ability to listen and monitor all private conversations, which makes one wonder how long it has been going on in ‘secret’. I wonder how many people have read or seen something like 1984, or V for Vendetta and then think that it would never happen.

It is a pretty drastic step in a democracy.–Shami Chakrabarti

Indeed it is, and it saddens me that my liberty and privacy is so cheap. And it further saddens me that I can do nothing about it.

A long hard slog

With my first ultra fast approaching, my training has been far from ideal. Whilst a week skiing worked wonders for my leg strength, it did nothing to help condition my legs for the repetetive slog of 33 cold, hard miles.

Added to this the last week I have had rather debilitating digestive issues and have been horribly dehydrated, despite trying to over hydrate, and been unable to run as a result. So far from ideal – the key stage when I just need to be getting out on my feet and getting miles in so far has been spent doing neither.

I’m always in two minds as to whether or not I can compete at an event like this: logic tells me no, at least not the first time. Hopefully common sense will prevail; make sure I finish one first, and maybe next time I can try and be a bit more competetive; ideally with better preparations.

On a brighter note I did manage to [poorly] capture a rather pretty sun rise.
IMG 20120207 075151cleaned A long hard slog

Creating IIS 6 Directories by C#

I’ve been writing this for a while today and couldn’t figure out why I couldn’t get the application to create within IIS. The virtual directory created without problems, but after that nothing happened. It turns out that the msdn library was incorrect!

Here is a working IIS 6 virtual directory creator. The only paramaters that need to be changed are in the // Set comment.

// IIS 6 Virtual Directory Builder and Configuration
// http://r-dunn.co.uk/ieatpenguin/computing/software/962/
// Please feel free to use and distribute

// Set variables: Site_Name,Path_to_wwwroot,Virtual_Directory_Name,Path_to_virtual_dir
// Change the port number after "ServerBindings" if you wish to use a different port.

using System;
using System.IO;
using System.DirectoryServices;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Collections;

namespace System_DirectoryServices_DirectoryEntry_ConfigIIS
{
  class Program
  {
    static void Main(string[] args)
    {
        CreateSite("IIS://Localhost/W3SVC", "555", "Site_Name", "Path_to_wwwroot");
        SetSingleProperty("IIS://Localhost/W3SVC/555", "ServerBindings", ":8080:");
        CreateVDir("IIS://Localhost/W3SVC/1/Root", "Virtual_Directory_Name", "Path_to_virtual_dir");
    }

    static void CreateSite(string metabasePath, string siteID, string siteName, string physicalPath)
    {
      //  metabasePath is of the form "IIS://<servername>/<service>"
      //    for example "IIS://localhost/W3SVC" 
      //  siteID is of the form "<number>", for example "555"
      Console.WriteLine("\nCreating site {0}/{1}, mapping the Root application to {2}:", 
          metabasePath, siteID, physicalPath);

      try
      {
        DirectoryEntry service = new DirectoryEntry(metabasePath);
        string className = service.SchemaClassName.ToString();
        if (className.EndsWith("Service"))
        {
          DirectoryEntries sites = service.Children;
          DirectoryEntry newSite = sites.Add(siteID, (className.Replace("Service", "Server")));
          newSite.Properties["ServerComment"][0] = siteName;
          newSite.CommitChanges();

          DirectoryEntry newRoot;
          newRoot = newSite.Children.Add("Root", "IIsWebVirtualDir");
          newRoot.Properties["Path"][0] = physicalPath;
          newRoot.Properties["AccessScript"][0] = true;
          newRoot.CommitChanges();

          Console.WriteLine(" Done. Your site will not start until you set the ServerBindings or SecureBindings property.");
        }
        else
          Console.WriteLine(" Failed. A site can only be created in a service node.");
      }
      catch (Exception ex)
      {
        Console.WriteLine("Failed in CreateSite with the following exception: \n{0}", ex.Message);
      }
    }

    static void SetSingleProperty(string metabasePath, string propertyName, object newValue)
    {
      //  metabasePath is of the form "IIS://<servername>/<path>"
      //    for example "IIS://localhost/W3SVC/1" 
      Console.WriteLine("\nSetting single property at {0}/{1} to {2} ({3}):",
          metabasePath, propertyName, newValue, newValue.GetType().ToString());

      try
      {
          DirectoryEntry path = new DirectoryEntry(metabasePath);
          PropertyValueCollection propValues = path.Properties[propertyName];
          string oldType = propValues.Value.GetType().ToString();
          string newType = newValue.GetType().ToString();
          Console.WriteLine(" Old value of {0} is {1} ({2})", propertyName, propValues.Value, oldType);
          if (newType == oldType)
          {
              path.Properties[propertyName][0] = newValue;
              path.CommitChanges();
              Console.WriteLine("Done");
          }
          else
              Console.WriteLine(" Failed in SetSingleProperty; type of new value does not match property");
      }
      catch (Exception ex)
      {
          if ("HRESULT 0x80005006" == ex.Message)
              Console.WriteLine(" Property {0} does not exist at {1}", propertyName, metabasePath);
          else
              Console.WriteLine("Failed in SetSingleProperty with the following exception: \n{0}", ex.Message);
      }
    }

    static void CreateVDir(string metabasePath, string vDirName, string physicalPath)
    {
      //  metabasePath is of the form "IIS://<servername>/<service>/<siteID>/Root[/<vdir>]"
      //    for example "IIS://localhost/W3SVC/1/Root" 
      Console.WriteLine("\nCreating virtual directory {0}/{1}, mapping the Root application to {2}:",
          metabasePath, vDirName, physicalPath);

      try
      {
        DirectoryEntry site = new DirectoryEntry(metabasePath);
        string className = site.SchemaClassName.ToString();
        if ((className.EndsWith("Server")) || (className.EndsWith("VirtualDir")))
        {
          DirectoryEntries vdirs = site.Children;
          DirectoryEntry newVDir = vdirs.Add(vDirName, (className.Replace("Service", "VirtualDir")));
          newVDir.Properties["Path"][0] = physicalPath;
          newVDir.Properties["AccessScript"][0] = true;

          // Create Application, set appropriate documents and permissions
          newVDir.Invoke("AppCreate", new object[1] { 1 });
          newVDir.Properties["AppFriendlyName"].Value = vDirName;
          newVDir.Properties["EnableDirBrowsing"][0] = false;
          newVDir.Properties["AccessRead"][0] = true;
          newVDir.Properties["AccessExecute"][0] = true;
          newVDir.Properties["AccessWrite"][0] = false;
          newVDir.Properties["EnableDefaultDoc"][0] = true;
          newVDir.Properties["DefaultDoc"][0] = "ReportsIsapi.dll?Login,ReportsIsapi.dll";
          newVDir.Properties["AspEnableParentPaths"][0] = true;
          newVDir.CommitChanges();

          Console.WriteLine(" Done.");
        }
        else
          Console.WriteLine(" Failed. A virtual directory can only be created in a site or virtual directory node.");
      }
      catch (Exception ex)
      {
        Console.WriteLine("Failed in CreateVDir with the following exception: \n{0}", ex.Message);
      }
    }
  }
}

Don’t forget to use a double ‘\\’ in your pathnames to avoid the compiler interpreting them as an escape sequence. I certainly did.

Note to self: Seal Yoghurt

The main advantage of running in the mornings through winter is that you get to mark the advance of the seasons, and almost will Spring in as you move each foot forward.

The beauty of dawn still never ceases to amaze me, and I consider myself fortunate in that I actually can get up at an uncivilised hour to trot off the 15 miles to work; because despite niggles here and there, it really isn’t a chore. It is the most peaceful time of the day, I didn’t see a soul out on the pavement until around half way through my run this morning, and whilst that is unusual for a city centre – and the route I take – it was a liberating experience.

The first person I did pass had a gorgeous spaniel who looked most perplexed as to why someone was chugging along with a backpack wearing some ludicrously bright and reflective clothing, a head torch set to dazzle, and had yoghurt all over his legs.

Of course, it wasn’t until 7 or 8 miles in when I stopped for a hot cross bun and a drink that I actually noticed the yoghurt: a spattering down the front of my legs. I have an unfortunate but small hole in the bottom of my rucksack, and sure enough one of my yoghurt pots had burst in my bag, and dripped out down onto my legs. Oh well – no harm done, other than a bag full of yoghurt.

Dawn had broken around 7:50 this morning, and I sauntered into the village where I work at 8:10am, running smoothly. I felt like I had had a good run; my average speed was ticking along nicely, and I was enjoying myself thoroughly. Being a regular commuter by bike, you get to recognise the other regulars and say good morning as you pass. It’s nice passing them as they recognise you with a look of surprise because you’re not on your bike, but still take the time to say good morning. It’s little things like this that help take the mind out of the work, and just enjoy the run.

A great enjoyable run this morning, encompassing just under 15 miles in 1 hour 48 minutes was only slightly marred by getting to work and realising that the small spattering of yoghurt on the front of my legs was only marred by the huge deluge, that dwarfed it, on the back. The only way I can really describe it is that it probably looked – to the dozens of people I passed and who passed me on the commute to work – like I’d shat myself and let it just run down my legs, after eating something altogether unpleasant the night before.

Oh well. It will wash out!

Backing up The Latest File – Name Unknown

It’s a common enough issue for me that I want to be able to backup the latest backup of a database, and using variables to set date and time I never quite know what the filename of the backup will be.

::copy latest file to network server
set LF=
for /F %%i in ('dir /Od /b *.sql') DO set LF=%%i
:
echo%TIME% on %DATE%: Latest Backup is %LF% >> Backup.file
:
xcopy /Y %LF% \\networkserver\bugzilla

My solution is to sort the backup directory by date, and create a variable based on the filename of the most recent file.

I then echo the time and date to a file (Backup.file) so that I have a log of the backup process that I can check should I need to in the future.

Finally, the script copies the latest backup to a network location.

This was used in conjunction with my bugzilla backup script, hence the directory names, but it can of course be used for anything.

Automated Backup of Bugzilla Database on Windows

Bugzilla isn’t really designed to be used on Windows, but once set up its fairly easy to administer.

One obviously important thing is backing up the database. Using the niftily built in mysqldump I used the following solution. Note this assumes default settings were used in the installation of Bugzilla.

First, add mysql to the windows path if it hasn’t been done so already, by running up a command prompt:

PATH=%PATH%;C:\Program Files\Bugzilla\mysql\bin\

I then use a command file to create the backup dump, and then append the date and time to the file name. Note I have also created a user (backup) on the bugzilla database with a limited set of privileges (Select, Lock Table, Show Databases, Event).

rem commmand to dump the database to file
mysqldump -ubackup -pbackup Bugs > c:\bugsbackup\bz.sql

rem set date and time into useable file format
set _my_datetime=%date%_%time%
set _my_datetime=%_my_datetime: =_%
set _my_datetime=%_my_datetime::=%
set _my_datetime=%_my_datetime:/=_%
set _my_datetime=%_my_datetime:.=_%

rem rename file
ren "c:\bugsbackup\bz.sql" bz_%_my_datetime%.sql

This command file can of course be added to scheduled tasks and run as frequently as you want.

A Better Christmas Than Expected

I did approach the Christmas period with a sense of foreboding – it’s a usual time to eat and drink too much, put on some weight, and lose all the fitness I’d worked so hard to build after injuring my ankle.

However, I did not eat to excess, and I managed a fell race on Boxing day. My legs in truth still haven’t recovered fully; my running is dreadful at present. The daily cycle commute of 30 miles is a wonderful cross train however, and whilst my legs feel like two blocks of lead, I am encouraged by my fitness. I don’t appear to have lost much, (not that I had a huge amount before Christmas mind!), and I have lost half a kilo. Ideally I would like to lose 5-8 KGs for racing, but given that I’m so far off being able to race yet, I can’t be too unhappy.

So today I will be entering the Haworth Hobble. And a-hobbling I shall be. I plan to walk/jog the distance this year, my real aim is to do a good years work on the hills, and then run it next year. I can’t see me ever getting near the winning times which are usually and incredibly down near the 4 hour mark, but I’d like to be able to compete, and that will require a long set up time. Plans after that vary, but they certainly include moving house in order to be able to train in hills!

The 8am Dawn-Endorphin Rush

Ever since my serious ankle injury earlier in the year, it has been a rough and at times painful recovery for me, mentally more than physically. The physical pain is something I’m used too and have had to cope with a lot, but mentally I get frustrated and upset if I can’t run.

I was a bit anxious setting off this morning, it’s a long way to work, and although I’ve been running pretty well recently, I’ve not done the half marathon distance (save one run that went somewhat close after going wrong on a Monday night,) in an awful long time.

Getting up when its dark has never really been difficult for me, I’m an early morning person. And given how warm it is for the time of year, it was actually nice getting outside so early. My part of the world is peaceful at 6:30am, and it is quite a fulfilling experience treading the streets without meeting anyone for at least half an hour.

I ran through town to Histon, where I picked up the path on the Guided Busway that runs from Cambridge through to St Ives. This is long and very straight. My total run was 14.21 miles, and most of it was done on this path, pretty slowly. It was at times demoralising, because way down the long route one can see traffic lights. It’s easy to run along setting markers, and to set these sets of lights as markers made things feel good for a while, and the euphoric feeling would slowly tail off as I’d realise that they were still a long way ahead.

Still, when dawn broke at roughly 8am, I stopped to have a drink, turn off my light and watch the sun crest over the horizon. I’m so disappointed that I had no camera with me as it was one of the most beautiful sights I’ve seen in a long time. The suns rise in turn gave rise to sheer enthusiam within myself as well – I finished the last few miles considerably faster than I’d run all morning, and I got to work and into the shower feeling good. Far from fresh, but feeling good. And feeling so pleased with myself. I’m far off what one would call a reasonable half marathon time, but the simple fact that I ran the distance so soon after my injury made me feel amazing.

And I haven’t stopped grinning.