Archive for April, 2006

Tough Luck

WPH 2-1 GLS

Won in the very last second.

I was a bit concerned coming into this game, as the opposition have handed out some spanking in previous weeks. 11-0 against Ryde district, poor buggers. Fortuntely they were only playing with eleven against our fourteen.

It was a pretty even matched first half, until fairly late on they made a break down the wing to goal, and while chasing I somehow brought their forward down. I don’t think it was disputable, it deserved a penalty, but he certainly made a meal out of his theatrics.

So 1-0 at half time, we were a bit down. The second half started a little better, and they eventually lost 2 players to injury. Do we need any more of an invitation? James S scored a cracker, proving himself to be a very versatile player, both in defence and attack. I think we had some of the better play, but they were very dangerous on the counter attak, while we slept at the back. They had a goal disallowed for offside, and as the final minutes drew, we were really pushing for the winner.

In the dying seconds DaiChi released a precise ball to me inside the six-yard box, and cutting the very same player who danced for a penalty in the second half, I was brutally cut down by another of their players. Dan Fisher stepped up and smashed the penatly home as the ref blew the final whistle.

Suppose I should feel a bit sorry for them, but as they say, ‘That’s Soccer’. So long as we win. :)

The next day: I’m a bloody wreck, my knee is swollen with a massive bruise, and my ankle hurts like buggery. Things you overlook when pumped with adrenaline.

Stay put! USB devices and udev

In Ubuntu (and Linux I presume) removable devices, like my USB flash drives, digital audio players and digital cameras, have this tendancy to appear in different device node locations (/dev/sda, /dev/sdc1, etc) depending on which port they plug into, or which device is plugged in first. This is a real pain for trying to customise your /etc/fstab.

Some nice soul on the Ubuntu Forums suggested udev as a solution, so I thought I'd look into it. udev allows persistent device naming, based on a match with a given udev rule. In other words, if a device is attached that matches certain criteria it is given it's own device node, rather than being assigned a dynamic one.

It's actually really easy to setup.

To start with you need to know the dynamic device node that is given to a device when attached for the first time, the best way that I know of to determine this is to use the tail command

tail -f /var/log/messages

When a device is plugged in, the screen will update with the newest messages, usually imparting some knowledge on the location of the new device. So first my USB disc

[4295259.290000] usb 1-3: new full speed USB device using ohci_hcd and address 5
[4295259.558000] Initializing USB Mass Storage driver...
[4295259.558000] scsi6 : SCSI emulation for USB Mass Storage devices
[4295259.558000] usbcore: registered new driver usb-storage
[4295259.558000] USB Mass Storage support registered.
[4295264.572000]   Vendor:    Model: TS128MJFLASHA   Rev: 1.00
[4295264.572000]   Type:   Direct-Access         ANSI SCSI revision: 02
[4295264.596000] SCSI device sdc: 253400 512-byte hdwr sectors (130 MB)
[4295264.609000] sdc: Write Protect is off
[4295264.637000] SCSI device sdc: 253400 512-byte hdwr sectors (130 MB)
[4295264.650000] sdc: Write Protect is off
[4295264.650000]  sdc: sdc1
[4295264.758000] sd 6:0:0:0: Attached scsi removable disk sdc
[4295264.758000] sd 6:0:0:0: Attached scsi generic sg2 type 0

I guess that more than you need to know, but there is some very useful information in there. Most I don't really care about now, except that the USB flash disc has been given the dynamic device node /dev/sdc1.

Next my other devices, a SD card reader, which is given /dev/sdd1. My Digital Audio Player is assigned /dev/sde1. My digital camera and mobile phone didn't like playing ball, so I'll leave that for another day, at least the SD card reader was okay.

So next thing is to find out some unique information from each device, information that will be used in defining the udev rules, remembering a match is required to assign the persistant node. The next command is from the 'Writing udev rules' link at the bottom of this entry

udevinfo -a -p $(udevinfo -q path -n /dev/sdc)

Which yields some information on my USB flash disc. I've trimmed the output quite a bit.

looking at the device chain at '/sys/devices/pci0000:00/0000:00:02.0/usb1/1-3':
BUS=="usb"
SYSFS{product}=="TS128MJFLASHA"

These are the two items of interest to me. The device is connected to the USB bus, and the product is identified by TS128MJFLASHA.

Next thing is to create the udev rule concerning this device. I'll start by creating my own .rules file

sudo nano /etc/udev/rules.d/10-local.rules

Apparently the default udev rules are 50-udev.rules, so by naming my rules 10-local.rules, they are looked at first. I don't have any 50-udev.rules file, but I'll name it 10-local.rules anyway. The rule I will use for the flash disc looks like this.

BUS=="usb", SYSFS{product}=="TS128MJFLASHA", KERNEL=="sd?1", NAME="transcend128mb", SYMLINK="usbdevices/transcend128mb"

The KERNEL="sd?1" will only match locations like /dev/sda1, /dev/sdb1 and more importantly, as the guide says, it won't match nodes like /dev/sda, /dev/sdb, which can be fdisk'ed.

The NAME="128FLASH", SYMLINK="usbdisc/128FLASH" will create the persistant node at /dev/1transcend128mb and a symlink /dev/usbdisc/transcend128mb that points to the persistant node /dev/transcend128mb.

Following the same method for the other USB devices, my complete udev.rules will look like

BUS=="usb", SYSFS{product}=="TS128MJFLASHA", KERNEL=="sd?1", NAME="transcend128mb", SYMLINK="usbdevices/transcend128mb"
BUS=="usb", SYSFS{manufacturer}=="Alcor Micro", KERNEL=="sd?1", NAME="sd_reader", SYMLINK="usbdevices/sd_reader"
BUS=="usb", SYSFS{manufacturer}=="SAMSUNG ", SYSFS{product}=="YP-T8           ", KERNEL=="sd?1", NAME="ypt8_dap", SYMLINK="usbdevices/ypt8_dap"

To start using these new rules, you need to run the command udevstart if you are using Ubuntu Breezy 5.10.

sudo udevstart

Now to quicly check that the new nodes have been created.

ls -l /dev/usbdevices
total 0
lrwxrwxrwx  1 root root 12 2006-04-25 17:13 sd_reader -> ../sd_reader
lrwxrwxrwx  1 root root 17 2006-04-25 17:13 transcend128mb -> ../transcend128mb
lrwxrwxrwx  1 root root 11 2006-04-25 17:13 ypt8_dap -> ../ypt8_dap

Finally I can edit my /etc/fstab to setup the mount points for these devices

/dev/usbdevices/transcend128mb  /media/usb128mb vfat    iocharset=utf8,umask=000        0       0
/dev/usbdevices/sd_reader       /media/sd_card  vfat    iocharset=utf8,umask=000        0       0
/dev/usbdevices/ypt8_dap        /media/ypt8     vfat    iocharset=utf8,umask=000        0       0

Not hard, not a lot of work, but that was a lot to write down!

This is a great link for creating udev rules, and where I got most of this from.

http://reactivated.net/writing_udev_rules.html

(Wish I could find a way to make code blocks look better too)

Reinstall Plans

I’ve been using Ubuntu and Linux in general for almost eight months now. What a great eye-opening experience it has been. Wish I’d started a blog when I started using it, I would have liked to look back now and see what I thought of it then. It would have been very useful in documenting things I configured and forgot about. Oh well, at least I’ll have something to rediscover when I install Dapper in June.

I don’t think that I’m a very knowledgable user yet, but I’m certainly very comfortable working with Linux. Maybe I’m exceptionally intelligent :) or maybe I lucked out with good hardware, but my transition from Windows to Linux was silky smooth. I still haven’t got my 5.1 surround working yet, but I pin that on Creative.

Ubuntu is soo much easier to install and setup than Windows, I really think it is. I don’t understand how people can see otherwise. Apart from my sound card I must have inadvertantly chosen perfectly supported hardware. It’s ironic; I created this PC well before thinking of using Linux and it worked straight away in Ubuntu, as opposed to Windows, which required installing graphics/sound/SATA/ethernet drivers and rebooting a dozen times, not to mention the obigatory firewall/anti-virus software.

Okay, when I go to install Dapper in a couple of months, I am re-installing Windows XP. It’s been 8 months since the last install, and its getting predictably chunked up. I’m going to document the entire process for each OS, so at least I can prove to myself that Ubuntu easier to install and setup.

Now all I need to do is work out how I am going to divy up my hard disc space.

Finally some heart!

WPH 3-0 STA

After some very ordinary performances to start the season off, we finally pulled our heads in and delivered a great game. We reshuffled the formation a bit and the result was instant. Daichi was fantastic in the centre of the park with Dan, going up against guys three times their size. I started up front with Phil where we tore things up, like the good old days. Still got to work on the finish, but my touch was good. We got a pretty cheap own goal, through the efforts of Scott, but it was a forced error and a goal is a goal.

Second half picked up where we left off, and as the opposition tired we definitely took advantage. I was very at home on the left wing, I forgot how much space you can have if you run hard, and I ran hard. A big change from holding the centre and much more fun. I don’t know how I kept running as I know I’m not that fit yet. I paid for it two hours later when I got home, I could hardly stay awake.

We got two nicely finished goals from Phil and Dan towards the end of the second half, to cap a really good performance. I hope the guys notice the difference when you play with some desire and effort. I’m not too fussed on the end result, but when you play to the best of your ability and some heart, its just alot more fun

Can’t wait for next week!

Maybe I should give WordPress a look in

Wow I finally created my blog.

I've had this account for about a week and was terribly hung up over the name. Not that I think this is a great name.

I don't ever expect people to read this anyway. Hopefully this will be a good way to keep track of my life and help me organise things.

So, my blog…

Next Page »


My Photos

James getting dragged up the hill

Another insane run

img_0104

Insane run

More Photos

How many times has this site been visited?

  • 135,007 apparently

Site Stats