linux Ubuntu

Year of the Linux Desktop

So, I’m developing Piracy Inc in Ruby on Rails version 3. Because newness is obviously better, I’m also doing this with a fully integrated IDE, in the form of Netbeans. Currently, the Debugger functionality of Netbeans doesn’t work under Windows (because it wants to compile a module, and there isn’t a compiler, and the precompiled versions don’t work, and getting a compiler working led to two hours of yak shaving that could have better been spent picking the lint out of my bellybutton).

So I decided to install Ubuntu, because there was a new version out, and because the server PInc will be running on will be a Linux server, so doing dev work on the same OS makes sense.

I have an ATI (now AMD) graphics card, a motherboard, and a complicated hard-drive setup. There’s a 1Tb drive acting as a windows/boot drive, a 30Gb SSD drive for things I want really fast access to (It used to also be the boot drive, but broke and got sent back, so the current boot drive was put in as a temporary stopgap, and I haven’t reinstalled since the SSD got returned) an SIL 3132 RAID card with 2x1Tb drives in Raid1, a USB hard drive for backups, and an HTC Desire mobile telephone.

So: Boot, SSD, Raid(Disk1,Disk2), USB, Phone.

Boot from CD. the partition manager scanning of the above takes ages.

Resize boot drive to install things onto, big partition.

No swap. Back. Wait for rescan.

Big partition. Swap drive. Install.



Grub cannot find the boot device. “grub rescue>” prompt.

GoogleGoogleGoogle How do I use grub rescue?

“The grub-rescue> mode is a more restricted subset of the grub> shell. Some commands are phrased differently here for easier use. Try help to start. “

Awesome. Except help doesn’t work, and the documentation doesn’t say how the command set differs. Root and boot don’t work either. Also:

Useful tip: try to load normal mode: insmod /boot/grub/normal.mod

Ah, so your hint to how to use grub rescue is to get to grub normal. Why does grub rescue exist, then?

I assume there is documentation for grub rescue somewhere, but I couldn’t find it. Eventually I realized I still needed to care about boot drives being in the first X cylinders of the hard drive, rebooted from rescue and reinstalled.

So, Ubuntu is installed across SSD and Boot, with churning stuff on Boot (/home, /var, /tmp, /swap) and more static stuff on the SSD. SSDs have more limited write-life, so this is Good Use Of Technology.

Support for my RAID card appears to be a little broken. By a little broken, I mean that each drive attached to the RAID card is currently available as a separate block mountable device in the My Computer window, which is pretty much the exact opposite of anything I ever want to happen ever ever ever involving anything ever attached to a RAID card. Still don’t know how to fix that, got dmraid to create another device as a RAID access, and mounted that. So long as I always mount the *right* block device called “RAID” and don’t accidentally mount one of the component devices on its own or write to it and invalidate the integrity of the set, I should be fine. It’s not as if they’ve all got the same name and icon, or anything.

No, wait.

My phone was running low on battery so I plugged it in.

Okay, graphics then. Right. I have an ATI graphics card, duel head output, left side Benq FP73G mounted landscape, right side secondary Benq FP73G+ mounted portrait. Monitor Preferences would allow me to enable the second monitor in desktop extension mode, but if I attempted to rotate it would spontaneously reboot X and lose everything I was doing. So I installed the AMD non-free graphics drivers because I hate freedom and want my shit to work.

The drivers installed and I had to reboot. How quaint. Right, fine, kernel modules are complicated. Reboot.

Or, you know, not. Can’t mount /home. or /var. Nor /tmp or swap.


Okay, so further research (involving command lines and fdisk) suggests that the drive referred to above as Boot is no longer /dev/sdd, but is instead /dev/sdf. Fine, some kind of updates happened. Change fstab, reboot.

X works, but it’s in mirrored display again, so I configure that to be duel head, and it tells me to reboot. It doesn’t mean reboot, it means restart X, so I press ctrl-alt-backspace, the time honoured method of “Get me out of here, X has gone crazy”. Apparently that doesn’t work either. Way to go. Ah well, give in, reboot. Take a recruiter call while it does so.

Can’t mount /home. or /var. Nor /tmp or swap.


The drives are back to being /sdd again. Great.

Can you spot a running thread, readers? Do you see why the numbers are getting shuffled? Has the reason I included “an HTC Desire mobile telephone” in the list of hard drives started to make sense?

Yes, plugging my phone in and then rebooting causes the allocation of my hard-wired hard-drives to go haywire.


Eventually, I find out that the AMD drivers autodetect the refresh rate of my monitor wrong, causing it to give up and go black. I find that my motherboard does strictly unnecessary things that cause USB drives to mean SATA drives get renumbered, I find that my RAID card is a “FakeRAID” card, the RAID equivalent of a winmodem, except with claimed support from Linux, and I should be grateful that it works at all.

And none of this is Ubuntu’s fault, really. It’s AMD’s stupid drivers, or the motherboard, or badly made cheap RAID cards. And the later problems installing Ruby from source (because Rails3 needs 1.9.2, which isn’t packaged), having to edit a Ruby library file to get the debugger to run the right script, but I spent more time attempting to get all of the little component parts to work together than I could spend actually progressing towards actual Piracy Inc development work.

The most common FUD campaign slogan against free software is that it’s only “free” if you don’t value the time you spend faffing with it to get it to work, and that’s a lot less true than it used to be, but the time I spend faffing with the above kind of crap is still far, far too much.

So it’s not the year of the linux desktop now, either.


Mass vhosting

My small server currently hosts a number of websites. Too many, really, I should get a bigger server. However, I long ago got bored of creating separate site files for every website I host, so I use MassVHost to make that go away. The same file runs on my dev servers, and it means that to create a new domain all I do is point DNS at it (via hosts, wildcard or whatever) and create a directory with the same name as the site. So, for example, I create /var/www/hosts/ and automatically points there.

This is what that looks like:

(That file is in /etc/apache2/sites-available as “vhosting”, then enabled with a2ensite. This is all under Debian. You’ll also need the vhosting module installed, enabled and working. )

One of the most common things you also need to do is automatically redirect people who go to “www.domain.tld” to “domain.tld” or vice versa depending on your religion. In this world, the canonical name of the site is whatever the directory is called. The thing with the 404 errors and the EverythingIsCatchingOnFire (Spot the reference for five points) stuff means that by default 404s go to this script, which in the event of a “This domain doesn’t exist”, it looks for an appropriate domain and sends you there:

(Meaning not only does go to the right place, but does too)

computing linux Ubuntu windows

A tale of two operating systems

My main machine is primarily used for websurfing, ssh and games, and because the first two are OS agnostic and the third isn’t, it runs Windows 7. Clare’s PC, however, runs Windows XP for games, and she would like it also to run Ubuntu, because it’s the OS she’s most familiar with.

(Yeah, I know).

So while she’s away at a LARP event for the weekend, I decided it was a good time to put the newest version of Ubuntu on her machine. When I built the Windows install, I left a partition at the end to put it on, so I booted from my handy 9.09 CD and installed it there. Ran though the install, answered all the questions, booted into shiny Linux install. Boom, multiboot.

No, wait. Hmm. The install process usually recognises Windows installs and adds them to the menu. Where is it?

Aha, they’re using the new version of grub. Maybe the detection’s not quite perfect. I’ll add it manually.

Menu item doesn’t work. Odd.

What do you mean “isn’t a valid NTFS drive”?

There is nothing quite like the sinking feeling when you realise that the drive that isn’t working anymore is the one that has your SO’s data on it. I mean, there are backups in place and everything, but still. There might be stuff not backed up.


This is when I discovered that Partition Magic-, my go-to software for “My Windows partition is hosed” – no longer exists, and that my old copy no longer works. So, I have a weekend of alternately trying not to think about it and tracking down things that might work that have no possibility of hosing the rest of the drive (I’m still pretty sure it’s just the partition table at this stage).

Fixed it in the end, though. I’d tried the Windows XP Recovery Console, because I’d assumed it was just the MBR broken and “fixmbr” repairs that. I had, however, not gone far enough.

Microsoft Windows XP(TM) Recovery Console.
The Recovery Console provides system repair and recovery functionality
Type EXIT to quit the Recovery Console and restart the computer.
Which Windows installation would you like to log onto
(To cancel, press ENTER)? 1
The target partition is C:.
Rre you sure you want to write a new hootsector to the partition C: ?
The file system on the startup partition is NTFS.
FIXBOOT is writing a new boot sector.
The new bootsector was successfully written.

And relax.

Imported From Epistula Mobile Ubuntu

Import ant

I have had it with Windows Mobile Devices.

My main phone has been a HTC Wizard, sold by O2 as the XDA Mini. I bought it because it has a nice screen, a built-in keyboard, and will run PuTTY, which is handy when I’m pretending to be a sysadmin. It’s useful, in that it’s a pretty good Internet Device – though one of the new Nokia tablets would be better – but it fails massivly on several important criteria. Like:

  • It’s too big. It’s not a device you can slip into your pocket and forget about, and it has an exposed screen so you have to remember not to put it where your keys or anything sharp is.
  • The touch-screen is too stupid, and occasional resets the time while in your pocket.
  • The battery life is annoying.
  • You can’t lock the display when the media-player is on.
  • The headphone jack is 2.5mm. Why? What is stopping them from using a standard jack?
  • Windows.
  • Mobile.
  • Sucks
  • Donkey
  • Balls.
  • Yes, that did need to be five or six points.

    So, my new solution is for the XDA to live in my bag and be Wifi and GPRS if I can be bothered to swap the sim around, and I have got hold of a Sony Eriksson z310g. One of the few Eriksson’s with the clamshell form factor I prefer, an Eriksson interface (which I prefer to most of the rest) MP3 ringtone support and, and this was no small part of my decision to buy it, support for trutap. If I’m going to work for a mobile application company, it would seem useful if the software works on my phone. (FTR, it installed quickly and easily, its failure to connect to start with was because the phone installed the new Internet settings for WAP but not Java connections, and the MSN IM networking stuff seems to work. I’m pleasantly surprised :-).

    Now the complicated bit. Getting my contacts off my XDA onto the 310 from a clean Windows install (without the supplied XDA drivers). Note: I do not have Office installed.

  • Install Microsoft Active Sync
  • Discover latest Active Sync will not sync to Windows’ built in address book like all previous versions would.
  • Discover that there is no way around this, searching on the internet for a while.
  • Decide to fuck this and try it in Linux. (Ubuntu, Feisty Fawn install)
  • Find a tutorial for this follow it religiously.
  • Everything installs fine, detects fine, all messages fine.
  • Click “Sync”
  • Nothing happens.
  • Tail all relevant logs, track USB connections, unplug USB, reboot, plug in, tracking all logs, viewing all messages, turning up debug.
  • Nothing happens.
  • Search internet for solutions to nothing happening.
  • Nothing continues to happen.
  • Decide to fuck this and go back to Windows
  • Find age-old version of Outlook 2002 that came with an older computer.
  • Install it.
  • Discover that latest version of Active Sync doesn’t support that either.
  • Wonder how Microsoft Internet Explorer is not allowed to be backwardly compatible with itself when ActiveSync is.
  • Wonder how the fuck we expect Microsoft to comply with other people’s data interoperability ideals when their own software is incompatible with itself.
  • Locate shady copy of Outlook 2007.
  • Install shady copy of Outlook 2007. Am surprised when I don’t have to reboot.
  • ActiveSync doesn’t find any copy of Outlook on this computer.
  • Reboot.
  • ActiveSync finds Outlook 2007.
  • The more things change.
  • Sync contacts to Outlook.
  • Install “Sony Ericsson PC Suite”
  • Allow PC Suite to sync with Outlook and Phone.
  • Get contacts on new phone.
  • Jump for joy.
  • Attempt to PURGE all traces of Outlook from my computer
  • Fail.
  • Book complete windows Reinstall for when I get back home from Christmas With Folks.
  • Sigh.
  • Go find Christmas Cake.
  • Yay Christmas Cake