the network is alive!

i’ve just rebooted my main PC and all the network interfaces came back to life.  that’s the first time since the upgrade to fedora 8 last November.

even more scary – the virbr0 interface has reappeared so it’s just about possible that my VMs will work again too.

guess it must be time to upgrade to fedora 9 then.

all this (the fixing, not the breaking) was brought about by finally tracking down the /etc/udev/rules.d/70-persistent-net.rules file, doing man udev and setting debug in /etc/udev/udev.conf (but actually using the udevcontrol command mentioned in the comments of that file).  to their great credit, redhat pointed me at that (persistent-net.rules) file when i raised the problem as a weirdly worded bug when it happened – but i was a bit confused about what i was trying to fix at the time.

the real problem was that those rules try to maintain network card to interface name relationships by using the hardware address on the card.  that’s fine except that the sky2 device on my motherboard seems to have a zero address – which doesn’t work so well.  i changed the rule to use the vendor and product ID instead on the assumption that i won’t install another of the same device.  i still don’t know if that rule is actually working or if it’s just failing all the rules now and defaulting back to the name assignment i want.

udevinfo -a -p /sys/bus/pci/drivers/sky2/0000\:02\:00.0/ was useful for finding out that stuff for the rules.

now all i need is a way to set the hardware address properly.  at the moment i’m doing it with ifconfig eth0 hw ether 12:34:56:78:90:ab from /etc/rc.local.  discovered modinfo but that didn’t help.  you can run a command from the udev rules – that’s probably the answer.

clearly though, i still don’t understand the udev rules.  as far as i can understand those files i now have a specific match for each network device on my system, each of which sets that device to a nice, unique name.  even so, the system says it can’t rename one of them during udev startup.  grrrr.



well, i’ve scanned over 200 barcodes now. but what have i learned?

  • you can get away with a lot of noise in the picture.
  • all those silly things that we try at supermarkets to get the scan to work are actually very sensible.
  • with my dodgy setup it’s only very slightly quicker than typing. but lots more geeky fun.
  • shiny things are bad.

geek goodness

last night was proper geek time for me. last year i hacked together an old webcam and a 35mm lens cap so that i could attach a second-hand zoom lens to the webcam. it kind of worked but the pictures were weird (see my little profile icon here) and it was hard to use.

say cheese

well, now i’ve found a use for it – as a barcode scanner!

i’ve got another webcam but it can’t produce a big enough image of a normal barcode. my zoom lens cam works well. mind you, the webcam isn’t great quality and the lens is old and dirty and i’ve not looked after either whilst sticking them together or since, so the pictures are a bit iffy.


so, i found zebra – a bit of FOSS software that can scan in barcodes. had to install a few devel packages on fedora 8 to get it to compile. then i had to modify the code to get it to talk to the second webcam, not the first.

it still refused – turns out the webcam only supports GREY or YUV420p formats but the code only supports RGB24. a quick bit of googling and wikipediaing and coding and we had it accepting YUV420p and reading the black and white data correctly. … and barcodes appeared!!

can you tell what it is yet?

another fix was required to the zebra scanner so that it includes the check digit in its output – the searches didn’t work without it.

EAN-13: 0702727136221
EAN-13: 5060067000844
EAN-13: 5060034578109
EAN-13: 5022366552943
EAN-13: 5055201800763

the next nice find on the net was barcodepedia. loverly. great idea. didn’t have many of the DVDs i scanned. plus it looks like i might have broken it by pestering it with searches. sorry about that.

5022366552943 – Ghost in the Shell [Region 2] on
5023965343321 – Katakuri-ke no kôfuku on
5023965347428 – Mou gaan dou on
5023965350220 on
5023965351227 on

however, it did know about manufacturer codes, so even if it doesn’t know what DVD it is you can still find out who made it.

whilst looking at these extra details and trying it out on a book i saw that the barcode is actually the ISBN number. so i googled for an online ISBN search and was reminded to look at amazon.

and that made me think of just passing the barcode values to amazon in the first place – which works!

a little bit of scripting later and i can now point books and DVDs at my hacked up webcam and the titles from amazon pop up on the screen. 🙂

Tenchi Muyo! DVD Ultimate Collection (NTSC)
Wario Ware: Smooth Moves (Wii)
Azumanga Daioh – Vol. 1
Azumanga Daioh – Vol. 2
My Wrongs #8245-8249 & 117 [2002]
At The Height Of Summer [2001]
Ghost in the Shell: Stand Alone Complex – Solid State
Ghost In The Shell [1995]
The Happiness Of The Katakuris [2003]
Infernal Affairs [2004]
The Hitchhikers Guide to the Galaxy (2 Disc Edition) [2005]

next up – get more details from amazon and/or barcodepedia and save them to a CSV or XML file that gcstar can read.