Cricalix.Net

May 31, 2007

Onwards and southwards - ta-ra ta-ra!

Filed under: 42 — cricalix @ 9:05

Well, the ball is rolling for me to move south by about 60 miles as the crow flies. I’ve accepted a job at a utilities company as a system administrator, and if things go as planned, I should be starting there at the beginning of July. Cue frenzied packing, cleaning and decorating of the current property, so that it can be put up for rent. Mum was over Sunday gone to give me some help. I’ve contacted a charity furniture removal organisation - there’s a mattress and Welsh dresser that I don’t need, and would rather someone else got use from them, rather than chucking them in the tip. If the budget allows, and I replace the radiators as I go, I’ll have some old radiators that’ll need chucking too.

And so the checklist begins

  • Buy-to-let mortgage for the current property
  • New flooring where needed (bad floorboards)
  • New carpet
  • Removal of all the old, decrepit wallpaper, replacement with new or paint
  • Finishing off the sealant in the bathroom (first go was bad), wall in bathroom, vinyl flooring in bathroom, skirting in bathroom
  • Lick of paint on all doors, architraves
  • Finish the electric cable run up to the shed
  • Chuck as much stuff as I can into a self-storage place. Current estimates are about 20 pounds per week, depending on the space I use.
  • Second coat of paint in the kitchen, upstand for the countertop
  • Finish running phone cable to kitchen from upstairs
  • Sand, paint all windowsills
  • Tile kitchen windowsills?
  • Replace front and back doors with new uPVC doors
  • Other stuff I’ve probably forgotten, like electric and gas certifications for rental

(This post has been held back for about a week, while I waited for $dayjob to tell the rest of the company.)

May 29, 2007

Dhclient3 and MS DHCP classless static routes

Filed under: $work, Technology — cricalix @ 13:17

$dayjob uses a Microsoft server for DHCP. Not really a problem, except out of the box, the (K)Ubuntu dhcp client (dhclient3) doesn’t actually support option 249 - classless-static-routes (or ms-classless-static-routes as some sites on the net refer to it). The format that the MS DCHP server spits out is the mask, followed by the subnet, followed by the gateway, in hexidecimal, delimited with colons.

So, after a bit of digging around on the net, and not finding anything that useful, I rolled my own code to deal with it. It’s not pretty, it’s probably not efficient, but it certainly works (for me).

First off, a new file in /etc/dhcp3/dhclient-exit-hooks.d

configure_ms_classless_static_routes

#!/bin/sh
function process_routes() {
 perl /etc/dhcp3/perl-classless.pl $1 $interface
}
if [ "$reason" = "BOUND" ]
 then
 echo "ms_classless_static_routes = $new_ms_classless_static_routes"
 process_routes $new_ms_classless_static_routes
fi

Second, a perl script

/etc/dhcp3/perl-classless.pl

#!/usr/bin/perl
# Input line will be a long hex string, seperated by :s
# MS DHCP feeds us Class : SN : SN : SN : SN : RT : RT : RT : RT
$unit = '[dw]{1,2}';
$in = $ARGV[0];
$nic = $ARGV[1];
while ($in =~ m/($unit:$unit:$unit:$unit:$unit:$unit:$unit:$unit:$unit)/) {
 $match = $1;
 $in =~ s/$match://;
 @i = split(/:/, $match);
 $exec = sprintf("ip route add to unicast %d.%d.%d.%d/%d via %d.%d.%d.%d dev %s",
 hex($i[1]),hex($i[2]),hex($i[3]),hex($i[4]),hex($i[0]),
 hex($i[5]),hex($i[6]),hex($i[7]),hex($i[8]),$nic),
 print $exec . "n";
 system($exec);
}

Presto, working Microsoft classless static routes via DHCP.

May 18, 2007

Visuals.

Filed under: 42 — cricalix @ 14:13

There’s something about the visuals in the music video for Nelly Furtado’s Say It Right that just make me want to watch the music video again and again. Perhaps it’s the contrast of her skin against Timbaland’s, or the use of the white background. Either way, I really wish I could get some high-resolution stills of some of the frames.

Nelly 1Nelly 5
Nelly 9Nelly 6

May 10, 2007

Sugar Fabrication

Filed under: Technology — cricalix @ 15:41

Courtesy of my RSS feeds, I got a notification about the folks over at Evil Mad Scientist, who made a 3D printer with a hot-air gun.  Absolutely wicked, and just so cool to see what some hackers can do.

May 9, 2007

What do you mean USB hotplugging doesn’t load the right module?

Filed under: Technology — cricalix @ 13:47

Smart me decided to plug my D80 in to my work PC (Kubuntu 7.04) today over my lunch break and browse some photos I took this morning. Nothing unusual there, I’ve done it before. So, plug it in, and … nothing. Not even a KDE dialog saying a new device has been plugged in, what would I like to do with it. Most unusual, it didn’t do that before the OS upgrade.

So, I interrogate the system for the list of USB devices that are plugged in:

Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 004: ID 045e:001e Microsoft Corp. IntelliMouse Explorer
Bus 003 Device 003: ID 413c:2010 Dell Computer Corp.
Bus 003 Device 002: ID 413c:1003 Dell Computer Corp.
Bus 003 Device 001: ID 0000:0000

Peculiar. Mouse, keyboard, hub. No camera. What’s the system log say?

May 9 13:20:52 localhost kernel: [1205659.868257] usb 5-8: new high speed USB device using ehci_hcd and address 4
May 9 13:20:53 localhost kernel: [1205660.001218] usb 5-8: configuration #1 chosen from 1 choice

Nope, that’s not right - there’s nothing after the configuration chosen line.

Drop the ehci driver, just to see what’s going on. Get the same lines, this time for the uhci_hcd driver. lsusb still says there’s no camera, udevinfo says nothing useful, and udevmonitor just says

UEVENT[1178714879.888701] add /devices/pci0000:00/0000:00:1d.7/usb5/5-7 (usb)
UEVENT[1178714879.888772] add /class/usb_endpoint/usbdev5.8_ep00 (usb_endpoint)
UEVENT[1178714879.888939] add /devices/pci0000:00/0000:00:1d.7/usb5/5-7/5-7:1.0 (usb)
UEVENT[1178714879.888954] add /class/usb_endpoint/usbdev5.8_ep81 (usb_endpoint)
UEVENT[1178714879.888964] add /class/usb_endpoint/usbdev5.8_ep02 (usb_endpoint)
UEVENT[1178714879.888974] add /class/usb_device/usbdev5.8 (usb_device)

Not a single UDEV line indicating that udev has triggered any kind of event.

For giggles, I removed uhci_hcd. Oops, there went my mouse and keyboard. I also discovered that if I unplug the keyboard and plug it back in, uhci_hcd didn’t get reloaded. Hmmm. SSH to the rescue.

Now, weirdly enough, other commands say ‘Yes, there’s a camera there Jim, and no, it isn’t dead.’, such as cat /proc/bus/usb/devices

T: Bus=05 Lev=01 Prnt=01 Port=07 Cnt=01 Dev#= 5 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=04b0 ProdID=0411 Rev= 1.01
S: Manufacturer=NIKON
S: Product=NIKON DSC D80

And lshal says

usb_device.device_revision_bcd = 257 (0×101) (int)
info.product = ‘NIKON DSC D80′ (string)
usb_device.product = ‘NIKON DSC D80′ (string)
info.vendor = ‘NIKON’ (string)
usb_device.vendor = ‘NIKON’ (string)
usb_device.product_id = 1041 (0×411) (int)
usb_device.vendor_id = 1200 (0×4b0) (int)

I’m confused :(


Powered by WordPress. Theme by H P Nadig