WordPress – Creating my own menu

Introduction

As part of the introduction of WordPress as the primary engine for my site, I have had to set up a template.  However, WordPress is not the only element of my site, and I expect to also have to include (at minimum) the following:-

  • An instance of GitWeb – to display my software repositories
  • Demonstrations of my applications
  • An issue tracking system (possibly combined with a discussion forum)

Each of these elements will want to take charge of the Content of the Web Pages they are controlling, but I expect all of them to exhibit the same look and feel for the basic web page.  As with WordPress, the way I achieve this is via a site template.

However, this template system is not quite the same the approach in WordPress.  It uses the following approach.

Continue reading “WordPress – Creating my own menu”

Switching to WordPress

As will shortly become apparent as this blog goes live (I am currently editing posts on my test system, but intend to include the posts I am making whilst I am setting things up), I have switched my personal web site from Drupal to WordPress.  I thought I would explain why.

Over the years I have tried a number of different platforms for my web site.  My last but one implementation was WordPress, but I decided on my previous implementation to use Drupal.  My decision then was based on the fact that I had decided that wanted something more complex than a simple blog and Drupal looked to allow that possibility.  So I did set about building the site and managed to achieve a passable result.  However I didn’t find I was updating the site all that much with new ideas.

Continue reading “Switching to WordPress”

Keeping my personal data backed up

I just read a post on Slashdot asking the question of how to keep personal data safe.  The questioner had just returned from Mexico with lots (he said 16GB worth) of photographs.  Other peoples comments about offsite backup, and keeping too much data made me realise that some experiences I have from this last couple of weeks were worthy of some comment.

I have been looking at both offsite backup and reviewing my archived data.

I just read a post on Slashdot asking the question of how to keep personal data safe.  The questioner had just returned from Mexico with lots (he said 16GB worth) of photographs.  Other peoples comments about offsite backup, and keeping too much data made me realise that some experiences I have from this last couple of weeks were worthy of some comment.

I have been looking at both offsite backup and reviewing my archived data.
Continue reading “Keeping my personal data backed up”

Webkit Developers know best?

In a web application that I am building I need to use a multiple selection <select> list.  Because screen space is limited I decided I would set the size attribute to 2.

In the Chrome browser, the display produces 4 lines of text – not what I wanted at all.

After a bit of searching, it seems this the webkit developers have decided not to fix this "bug" because of usability issues.

In a web application that I am building I need to use a multiple selection <select> list.  Because screen space is limited I decided I would set the size attribute to 2.

In the Chrome browser, the display produces 4 lines of text – not what I wanted at all.

After a bit of searching, it seems this the webkit developers have decided not to fix this “bug” because of usability issues.

This seems to me the height of arrogance.  Who are they to decide that I don’t want only two entries in this case – this list itself is likely to be relatively small

Internet Explorer 8 bugs – why aren’t they fixed?

Not being much of a user of Windows – my desktop is running Gnome under Linux – I came across a strange Internet Explorer 8 bug last Friday. I was setting up a Simple Machines Forum (SMF) forum with a colleague and he was reporting that he couldn’t create or edit any posts with a length of more than about 10 lines.

Not being much of a user of Windows – my desktop is running Gnome under Linux – I came across a strange Internet Explorer 8 bug last Friday. I was setting up a Simple Machines Forum (SMF) forum with a colleague and he was reporting that he couldn’t create or edit any posts with a length of more than about 10 lines.

It wasn’t a problem for me running Firefox, so I decided to try all the different browsers to see if it was browser related. I have two virtual box installations of Windows XP, one with Internet Explorer 6 and one with Internet Explorer 7 and Safari installed, and I tried it will all of them. I tried with Google Chrome and with Opera as well. None of them had any problems.

In order to try Internet Explorer 8 I had to boot up my Windows 7 laptop. And sure enough, I discovered that as soon as a scroll box appeared in the posting box (a textarea) that Internet Explorer 8 started to try and scroll it to the top on every keystroke.

It can’t be just me having this problem I thought, and went to the SMF forum to ask for support there. Sure enough – as far back as March 2009 people had reported that if a textarea has a width expressed as a percentage Internet Explorer 8 exhibited these symptoms of scrolling to the top.

What puzzles me is why there is still no fix for this. Microsoft must realise that they are in a competitive market for browsers. How can it be that a problem as basic as this is known about for at least 15 months (and probably longer) and there isn’t an upgrade that solves it?

With my use of Linux, I am used to problems like this being fixed within days.

Why I think Michael Schumacher was dangerous in Hungary

I hope pictures speak louder than words. Even on the first picture Rubens is along side. But you can then clearly see Michael continue to move over

It was a controversial move that Michael Schumacher pulled on Rubens Barachello at the Hungarian Grand Prix 2010.  I looked at the video quite carefully and managed to extract four images in sequence that show precisely what happend

The first picture shows Ruben right behind Michael, and you can see Michaels head tipped to one side as he is checking his mirrors.  Also notice that at this point they are both a long way from the pit wall (on our left, their right).

Continue reading “Why I think Michael Schumacher was dangerous in Hungary”

The ways in which Melinda Doolittle has ruined my life

It was on the 26th of June 2007 that Tiernan started a thread on the message boards of melindafan.net that started one of the most important threads in the history of Melinda’s Backups. It started

"Okay, this is in response to the thread listing all of the many blessings we've received because of
Melinda. I'm here to list the ways in which she has ruined my life!!!"

and proceeded to list 14 separate ways that had happened.

It was on the 26th of June 2007 that Tiernan started a thread on the message boards of melindafan.net that started one of the most important threads in the history of Melinda’s Backups. It started

“Okay, this is in response to the thread listing all of the many blessings we’ve received because of Melinda. I’m here to list the ways in which she has ruined my life!!!”

and proceeded to list 14 separate ways that had happened.

It was not so much these 14 points, or the fact that a whole set of other backups realised that they agreed with them, but the fact that this started a whole set of discussions about how each backup was more obsessed than the next, leading eventually for one of them to bring into the conversation about being captured and locked into a mental institution that just happened to be at Nutbush (from the song Nutbush City Limits).

The Meadows at Yosemite National Park

It was then that the story started, a story about escaping for the asylum, hiding in the outhouse (think about the words to the song) and waiting to be rescued by backups who turned up on motorcycles. But the story spiraled from there, into a romp across the country, with kidnapping and rescuing of Melinda and the eventual Melinda’s Backups first concert with Melinda at the meadows at Yosemite National Park.

The fantasy had taken to the end of July to get this far, but little did we realise that by November there actually would be a real Melinda’s Backups first concert and party – not in Yosemite, but just outside Nashville, at Franklin, Melinda’s home town. You can read about that in my blog post here

Anyway, Melinda’s Backups all left melindafan.net and setup their own web site and message forum (“http://www.melindasbackups.com/forum (registration required). Before we left we were able to capture the whole thread and turn it into a .pdf file.

If you would like to read it, you can download it from here

The making of MBChat v3 – part 2 coordinating multiple activities

In the previous blog article I discuss a process which would take several seconds to run. Obviously it is started as soon in the load process for the initial web page as possible.

Several other activities have to happen, such as loading the sound libraries, the dom has to be ready, the user has to have entered his username and password and it has to have been validated before the user can enter chat.

In the previous blog article I discuss a process which would take several seconds to run. Obviously it is started as soon in the load process for the initial web page as possible.

Several other activities have to happen, such as loading the sound libraries, the DOM has to be ready, the user has to have entered his username and password and it has to have been validated before the user can enter chat.

So several of the start up steps in getting the user properly logged on to chat and with the sound system fully working have to be co-ordinated. In order to avoid having to poll some flag to see if an item had completed, I decided to write a mootools class to handle this situation.

In order to create a coordination point for several activities, the programmer declares a new instance of the coordinator class, thus:-

var coordinator = new Coordinator(['rsa','login','dom','verify'],function(activity){
    loginRequestOptions.e = activity.get('rsa').e.toString();
    loginRequestOptions.n = activity.get('rsa').n.toString(10);
    loginRequestOptions.msg = 'MBChat version:'+MBChatVersion+'   using:'+Browser.Engine.name+Browser.Engine.version;
    loginRequestOptions.msg += ' on:'+Browser.Platform.name;
MBchat.init(loginRequestOptions,activity.get('rsa'));
    window.addEvent('beforeunload', function() {
         MBchat.logout(); //Will send you back from whence you came (if you are not already on the way)
    });
    soundcoord.done('chat',{});
});

In this instance, I am creating a coordinator which will coordinate the activities with the names of the first array parameter. When all the activities are complete the second parameter is a function which gets called with the activity object. This consists of a set of objects keyed by the activity name which are parameters which can be used. In this instance we are getting the public key components of the ‘rsa’ activity to pass to loginRequestOptions.

Note also at the end of the function a call to soundcoord.done. This is another coordinator I set up to coordinate the initialisation of the sound system. We can’t do anything with the sound system until both it is ready, and the user has logged into the chat (through this current activity). The done method is called with the name of the activity and an object (in this case empty) to pass into the final function in the activity parameter.

Just for completeness, this is the call to coordinate.done for the rsa activity so you can see how parameters (in this case the RSA key pair) are passed

var rsa = new RSA();
function genResult (key,rsa) {
    coordinator.done('rsa',key);
};

/*
We are kicking off a process to generate a rsa public/private key pair.  Typically this
takes about 1.2 seconds or so to run to completion with this key length, so should be done
before the user has completed his input - which is when we will need the result.  The genResult
function will be called when complete.
*/

rsa.generateAsync(64,65537,genResult);

This class itself is very very simple. You can download the latest release from my git repository as shown here. Although you might like to just copy and paste it from here

/*
 	Copyright (c) 2011 Alan Chandler
    This file is part of Coordinator.

    Coordinator is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Coordinator is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Coordinator(file COPYING.txt).  If not, 
    see <http://www.gnu.org/licenses/>.

*/

var Coordinator = new Class({
    initialize: function(activities,callback) { //an array of activity names
        this.activities = new Hash();
        activities.each(function(activity) {
            this.activities.set(activity,false);
        }.bind(this));
        this.callback = callback;
    },
    done: function(activity,parameters) {
        this.activities.set(activity,parameters);
        if (this.activities.every(function(activity) {
            return activity;
            })) this.callback(this.activities);
    }
});

The Squeeze between a Rock and a Hard Place (installing a Debian Squeeze system)

I have just re-installed my Debian MythTV server now that I have bought it bigger disks. In fact, with two new 1TB (ie approx 1000 Gigs) disks, I have put them together as a RAID1 pair and use this box to act as my new Home Internet Gateway.

I wanted to use Debian Squeeze because it will soon (sic) become Debian Stable and it is the first distribution that supports the Ext-4 filesystem that I feel is necessary for this important set of files.

However, I do not have a CD-ROM drive on this machine, so this is the story of installing Debian Squeeze using just just usb memory. With the easy and availability of USB to SD card converters, it does not matter whether you use a memory stick or an SD card – the process can be the same.

I have also decided to use extlinux as the boot loader. I have simple boot requirements, and feel nervous that using Grub (the Debian standard) means the use of a program to create the configuration file. What happens when I need to do something manual.

I have just re-installed my Debian MythTV server now that I have bought it bigger disks. In fact, with two new 1TB (ie approx 1000 Gigs) disks, I have put them together as a RAID1 pair and use this box to act as my new Home Internet Gateway.

I wanted to use Debian Squeeze because it will soon (sic) become Debian Stable and it is the first distribution that supports the Ext-4 filesystem that I feel is necessary for this important set of files.

However, I do not have a CD-ROM drive on this machine, so this is the story of installing Debian Squeeze using just just usb memory. With the easy and availability of USB to SD card converters, it does not matter whether you use a memory stick or an SD card – the process can be the same.

I have also decided to use extlinux as the boot loader. I have simple boot requirements, and feel nervous that using Grub (the Debian standard) means the use of a program to create the configuration file. What happens when I need to do something manual.

This blog entry does two things.

  1. It describes how to turn a bootable usb memory stick into an installation disk
  2. How to setup extlinux as the bootloader

Creating a USB installation memory stick

The first job is to prepare the USB memory stick (or SD card). The majority will already be formatted so that they have a boot sector that is bootable, with a single partition, formatted as FAT. If they are not, its straight forward under Linux to format them yourselves. I tend to use cfdisk as my disk partitioning program because I find it easier to use, but it doesn’t matter which. Just mark the first partition bootable, and then format it using the command

mkfs -t vfat /dev/sdX1

where /dev/sdX is the device name of your usb stick when plugged in. You can also use

mkdosfs /dev/sdX1

directly if your prefer (I never remember the second, so always use the first). mkdosfs is found in the dosfstools Debian package.

The second step is to locate and download the latest installer images. The Debian installer consist of a kernel image and and initrd image. The kernel is obvious, what is less clear is that the initrd image is the software the controls the install process. Start by navigating to http://www.debian.org/devel/debian-installer/ and looking for the different architecture images listed under the heading “other images (netboot, USB stick, etc)” (at the time of writing the squeeze alpha images are available as are the daily build images – I have used the daily builds without problems)

Regardless of which one of these two you choose you will then need to go down one further level into directory “hd-media”. In there you will find a vmlinuz image (the linux kernel) and an initrd.gz file listed. Download both of them.

You will also need an .iso image as when the installer starts it looks at all the possible partitions for a .iso image in the root. Obviously having it in the same root as the installer is the ideal here. If you have sufficient space to store a full CD image (approx 700Mb) this would be the ideal image to download, if not you will have to choose one of the smaller images (netinst or business card). I found I needed the full CD image to support my ethernet hardware so you may be forced to go for the large image anyway.

You can get the CD images from the same installer page – but then select the weekly snapshot CD image for your architecture as the one to download. Download CD1 – you don’t need any of the others.

Copy all three files (vmlinuz, initrd.gz and the .iso to the usb drive once it has been mounted.

You are also going to put syslinux on the usb, however for now just create a file syslinux.cfg in the root of the partition with the following contents

default vmlinuz
append initrd=initrd.gz

which will tell syslinux to boot the vmlinuz image with initrd=initrd.gz appended to the command line.

Finally unmount the usb stick and then type

syslinux /dev/sdX1

to put syslinux image on the partition’s boot sector.

You should now have an installation usb 🙂

Installing extlinux as the boot loader