What Jessie Did Next...

...being the inane ramblings of a mundane Yorkshire bird.

Category: Geek (page 2 of 10)

As seen on IRC:

<@Menus> $colleague was supposed to be flying to .mx yesterday
<@Menus> i think they’ve only started not letting people go today
<@Menus> and those who are there are being brought back
<@sooB> Menus: can’t he fly to a secondary mx instead?

*sigh*

Once again I find myself cleaning up undefined variables referenced in PHP. Yet more bedroom coders who think they can write stuff, causing notices, errors and warnings to spew out just simply because they can’t be arsed to learn to use isset().

THIS IS WRONG:

if ( ! $_REQUEST[‘blah’] ) {
echo “thingy isn’t set”;
}

THIS IS RIGHT:

if ( ! isset($_REQUEST[‘blah’]) ) {
echo “thingy isn’t set”;
}

For crying out loud, is it any fucking wonder PHP gets such a bad rap when you bloody idiots are making vague assumptions about undefined values being FALSE? I should set fire to every bastard one of you.

(Next week’s rant: !== vs !=).

As seen on Facebook:

‘Thirteen die after C. diff outbreak at hospital’ – sounds like one seriously extreme kernel-patching meetup.

(Thanks Christo :))

Only a short post but one I felt of note since I come across developers and media designers who still don’t employ code version control, wipe out each others’ changes, and lose days of work regularly. Worse still they don’t understand the paradigm, or throw a perfectly good svn/cvs regime away because they can’t be arsed.

So, head over to Smashing Magazine’s round-up on Subversion and learn to do code control properly – trust me, it’ll save your ass when you have more than one developer or when you make cock-ups you only discover months later.

I gave up on Safari yonks ago on my Mac and I’ve been a bit of a Firefox bitch for years, although I’ve heard good things about the Safari 4 Beta which came out the other day. It’s hardly going to ride roughshod over an installation I already use so I thought I’d give it a go.

Installation nice and smooth, although really why did I need to reboot? Am I running Windows on this thing? No. There is no need. Come on, Apple – stop being daft.

Truthful verdict on the app itself? It’s quite nifty. Blindingly fast on my Macbook, at least in comparison to Firefox; the really very fast Javascript engine will help a lot with my $dayjob work on webapps too. Rendering seems OK but I’ve not tried to do any of the more interesting stuff yet (book hotel rooms, upload content, all that foo).

One big annoyance – the positioning of the tabs right at the top. Thanks to Hitch, this can be sorted on the command line with:

defaults write com.apple.Safari DebugSafari4TabBarIsOnTop -bool NO

…which will shift them back below the location bar after an app restart. More undocumented UI fiddles here.

One minor annoyance – because of the preinstalled RSS feeds, it fills your “popular sites” shizzle with CNet, Youtube, Amazon et al. Easily sorted tho.

So far so good – I’ll try it in preference to Firefox for a few days (although probably longer if I can find a way of importing my stored security stuff, bookmarks, and stuff).

Gooroo (one of my current clients) have set up a blog for their software-as-a-service thingy. If you’re interested in SaaS and cloud computing it’s one to pop in your RSS feed (although it will probably be a bit buzzword-tastic at times).

Link here. I’m sure they’d appreciate comments and discussion!

Ben forwarded me this article, which explains how much damn pain us IT nerds/geeks go through (and probably why we drink so much).

My favourite quote: “See, you’re never going to get them to stop sticking the fork in their eyes. Never. Stop trying, it’s fantasy. Along those lines, they’re never going to treat you like more than a glorified janicopter, where your only useful function is to STFU and bail them out of that jail they worked so hard to get themselves into.”

I can probably apply this analogy to supporting end-users on web apps right this very second, and in fact most of the customer-facing jobs I’ve been in; they’ll never stop sticking the fork in their eyes, so give up trying to stop them…

I’m dealing with a mess of a user interface design today, so here’s two links which I came across from Smashing Magazine:

I will not pretend I think they are all correct but they are good ideas and good guidelines in some cases. In fact, any “design agency” who might want to get involved in UI design should read them – because sending me a PSD which could have been done better by a monkey using Photoshop and flinging shit at a keyboard is not the answer.

UK VAT Rate changes from next Monday 1st December. That gives everyone precisely fuck all time to implement any changes on custom-written software.

It’s not often I post generic info here regarding me and consultancy time, but this is justified in my opinion: If any clients – past or present – are reading this who want me to come in and sort out the VAT rates on their systems (if I designed it it’ll be easy, if I didn’t then it’ll probably be a nightmare) please get in touch with me fast.

My time’s filling up at a rate of knots and if you want me to get in and even just take a look, you need to contact me now.

Here endeth the public service broadcast, brought to you live from a coffee shop in Manchester Airport arrivals lounge.

Insert “fat pipe” jokes here:

“A sperm = 37.5 MB of genetic information. Using basic math, we can compute the bandwidth of human male ejaculation as: (37.5MB x 100M x 2.25)/5 = (37,500,000 bytes/sperm x 100,000,000 sperm/ml x 2.25 ml) / 5 seconds = 1,687,500,000,000,000 bytes/sec = 1,687.5 TerraBytes/sec.”

(from FreeNode #programming).

In my arsenal of USB2-attached hard drives, there’s a 500GB LaCie “Big Disk” USB2. This has been running for a while and seemed OK, although the USB2 chipset does get a little confused when there’s a sudden power loss. Sadly it died a fortnight ago – dmesg pointed out to me that the USB had disappeared, and upon investigation it looked like complete power loss or at least drive failure. The data wasn’t critical (I used it as a scratchpad) but curiosity got the better of me and I decided to attempt retrieval of the data.

Inside these “Big Disk” units are invariably two smaller drives – LaCie’s attempt to sell off bigger-than-consumer space using commodity disks. In this case, there were two Samsung drives of 250GB apiece (SP2514N). I have a handy USB-IDE interface which I used to plug in each drive in turn:

  • Disk 1 (Master) obviously had a partition table on it with a single 500GB ext3 partition defined (yes, it’s a 250GB disk!). Familiar, maybe this isn’t a dead loss!
  • Disk 2 spun up, detected, but no partition table.

My USB-IDE thingy doesn’t allow me to connect two disks at once so I figured I’d put it down for a week while I purchased a big enough disk to recover any data to.

The big question at this stage was whether the data was striped (RAID0) or whether disk2 was “welded onto the end” of disk1’s partition.

Once I’d got a big enough disk to recover data to, the first thing I did was get all the data off the disks using:

dd if=/dev/sdc of=disk1.bin bs=1M

and the same for the second disk (although sending it to disk2.bin in this case). That left me with two 250GB files, and I used losetup on disk1.bin (the one with the partition table):

losetup /dev/loop1 disk1.bin

That in turn gave me:

        Device Boot      Start         End      Blocks   Id  System
/dev/loop1p1 1 60802 488392033+ c W95 FAT32 (LBA)

So far so good, but it’s still just half the disk I’m mounting (and I’m pretty convinced the partition was ext3, not fat32!). By this time I wasn’t in the mood to try and work out striping (and if it’s needed in the future use mdadm or lvm), so just went for the theory that disk2 was lumped onto the end of disk1, making an uberimage through use of something as simple as ‘cat’:

cat disk2.bin >>disk1.bin

I mounted the loopback again, and tried to get to the partition:

# mount /dev/loop1p1 /mnt
mount: special device /dev/loop1p1 does not exist

Bollocks.

Enter your local friendly Interweb maillist, and Peter informed me that the fdisk partition was most likely a red herring and pointed me at the losetup ‘-o’ option which would skip the partition table straight to partition 1. Couple that hint with this info via Google and we’re in business using parted and offsets:

# parted disk1.bin
GNU Parted 1.7.1
Using /media/disk-1/disk1.bin
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit
Unit? [compact]? B
(parted) print

Disk /media/disk-1/disk1.bin: 500118700031B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32256B 500113474559B 500113442304B primary ext3 lba
(parted) quit
# mount -o loop,ro,offset=32256 disk-1.bin /mnt/disk1
# cd /mnt/disk1
# ls
lost+found junkheap Graphics
# rsync...

You get the idea – it’ll take a while. Mine’s still not finished and of course some data may be mangled so probably worth using –ignore-errors in your rsync as well.

So to summarise:

  • If your LaCie “Big Disk” fails and it’s not the PSU or one of the disks, it’s worth popping the disks out and attempting to weld the two disk images together.
  • The exact model this worked on was the USB2 500GB “Big Disk” configured in JBOD mode – I can’t tell you the model number because helpfully it’s not printed anywhere on the chassis or label.
  • You need at lot of disk space – a pile for the image (which will be the size of the “Big Disk” even if it’s not full), and a pile of space to recover the data to. I got a 1TB disk from our local computer shop.
  • All this was done using my little eeePC which is running Ubuntu Hardy Heron.

I went into the Vodafone Shop in Wakefield this morning and returned the N96. I also talked Nicky out of getting an N95.

I walked out with a Nokia E71 which seems to do everything I want it to and with reasonable competence, and Nicky ended up with an E66. Time will tell how we get on with those…

So the time’s come to upgrade my phone – my Nokia E65 is getting a bit long in the tooth and we’ve been on a rubbish tariff anyway, off to the Vodafone shop I go. I’d sorta contemplated an iPhone but the whole kill switch thing put me off.

Our local Vodafone shop in Wakefield has a useful chap working there who’s given me good advice in the past: a very pleasant gentleman called Gareth. I went in, explained the monthly £200-plus phone bills, and tried some handsets. I must admit, I was a bit single-minded about this: a friend also has an N96 and likes it, and I’ve known quite a few friends with N95s who said they’re OK. To be fair Gareth told me it wasn’t a decent handset for my needs and it seemed a little sluggish in the shop but I put that down to “new setup” and things. Bad bad move, should’ve listened to the Bloke Who Knows.

Some of the more interesting problems:

  • It’s slow. I’m not talking about odd bouts of sluggishness, it sometimes pauses for 5-10s and buffers the keypresses so you’ll get a rapid burst of functionality followed by nothing.
  • Random reboots. It’s done it twice in the middle of calls, once while using the video player on the stock videos it comes with, and once while using the MP3 player.
  • The MP3 player itself seems to be purely a reference implementation of the Fraunhofer decoder – it occasionally skips and garbles on known-good MP3s, and once it’s garbled the only way of fixing it is a reboot.
  • Awful camera. Admittedly I didn’t get it for the camera, but to say “ooooh 5MP” then chuck out awful poorly-focused shots isn’t good.
  • One fun point on Saturday it decided to not switch on: I was pretty sure the battery had died but once I’d removed and re-inserted the battery itself it came back with a decent charge.
  • One word: “power saver”. Utterly useless, looks like the phone has run out of charge which I’m pretty paranoid about since the earlier “don’t switch on” problems.
  • No thankyou, I don’t want to share that video on t’Internet. No, I don’t. Really I don’t. Please stop asking me. Please stop trying to upload it. Really. JUST STOP, YOU…
  • Downloading S60 apps via the browser causes a system reset sometimes – happened with PuTTY.
  • Cheap. Plastic. Feels cheap and plastic, almost like I’d break it if it was at the bottom of my bag.
  • And after all that, the keypad is awful to type on – buttons arranged in a format which makes it easy to not send texts, or accidentally cancel things out.

Just to give you an idea of how bad it’s got, I’ve put my SIM back in the old E65. The new handset’s off back this morning, and I’ll probably go for an E71 instead on the advice of People Who Use Phones In The Same Manner As Me.

(So, why do I need to give the E71 a miss? Comments please…!)

“Crystal Reports – oh dear God I’d forgotten about that – the last time I used it was in 1998 when I worked with Deverill in Poole. Horrible piece of software.”

And now I’m getting it to talk to PHP via the Crystal Reports web service. *shudder*

I meant to post this yesterday:

<@flange> so, i hear you can get any gtld you want now apart from .cheezburger
<@flange> icann has .cheezburger

Will needs shooting for that one.

Older posts Newer posts