Posts tagged with "guide"


De-Chromeify Firefox 4.0

Somewhere along the way, the Mozilla UI team must have figured the best way to make things simpler was to copy Chrome. Fortunately with a key extension and some UI tweaks Firefox 4.0 can be be reconstructed :).

The right is the bight

Firstly, to what the Mozilla team did right. Despite still being drawn in XUL (which I used to loathe but now love the flexibility!), Firefox 4.0 looks more like a Mac application. The toolbar buttons are smaller and look like Mac buttons, and the URL and search boxes respect Mac interface guidelines (square for the former, rounded for the latter).

It could be attributed to a placebo effect or given I installed it from scratch, but the UI feels slightly more responsive too. It still takes more "dock bounces" to load than Safari, but less than before even with my trillions of extensions.

Finally, I find this trend of remove menu bars to be extremely obnoxious, but fortunately the Linux versions didn't follow Windows Vista/7 and Chrome's lead!

Restoring tabs

The most striking UI change is the moving of tabs above the address bar. This distressed my sister no end, but fortunately they can be moved back to where they were before by choosing View, Toolbars then unchecking Tabs on Top.

As you probably know by now, I strongly suggest you use an extension like Tree Style Tab to put tabs on the side and save yourself from needless side scrolling, but do what you will ;)

Restoring the status bar

As with Chrome, Firefox no longer has a status bar. Extension icons are now relegated to an optional Extensions Bar which can be reenabled from the View, Toolbars menu. Problem is, even with this enabled we still have hovered URLs appearing in a silly transient bubble like what I've dubbed Chrome's Foo-Foo bar. In my opinion, the Foo-Foo bar is a huge step backwards in usability.

The solution is the Status-4-Evar extension which puts status messages back into the same readable place they were before alongside the extension icons. As an added perk, the extension also replaces the Fusion extension which never got a Firefox 4.0 update. Nice!

Removing fluff

Curiously, Firefox 4.0 doesn't create a ./chrome/userChrome.css folder and file in your profile folder anymore, but both can be recreated and Firefox will use them.

These are some of the things I remove using that file:

/* Required XUL namespace reference */
/* @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); */
/* UPADTE: No longer needed with Firefox 4! Schweet :)*/

/* Remove cruft from URL and search bars */
#urlbar .autocomplete-history-dropmarker,
#star-button,
.search-go-button,
.tabs-newtab-button {
    display: none !important;
}

/* Remove favicons from bookmark bar links */
toolbarbutton.bookmark-item > .toolbarbutton-icon {
    display: none;
}

/* Make bookmark bar folder icons stand out
   by making them bold, regular links normal */

toolbarbutton.bookmark-item {
    font-weight:normal !important;
}
toolbarbutton.bookmark-item[type="menu"] {
    font-weight:bold !important;
}


SpinRite on a Mac using QEMU

More out of interest sake than being under any illusion of practicality, I decided this evening to try running SpinRite in QEMU on my Mac Pro. The verdict: it works, if you have lots of spare time!

Notes before proceeding

I tested this on a Mac Pro, running SpinRite in QEMU on a non-system drive. I would assume if you booted Mac OS X off an external drive you could try this on your machine's system drive as well, but your mileage may vary.

QEMU is easy enough to build yourself, or its available on Homebrew, MacPorts, Fink and pkgsrc.

Finally, this action is allowing software raw access to your drive, so be extremely careful about getting the labels and identifiers right. Backup your stuff. Do at your own risk!

The procedure

1. Go into Disk Utility, click the drive you want to run SpinRite on, then go to File → Get Info. Under the "disk identifier" heading you should see a string called disk[number]. Make a note of it.

2. Use Disk Utility to unmount the drive. If it says the drive is busy but you're sure you're not doing anything with it, you can force eject it with its shell sibling:

% sudo hdiutil eject -force /Volumes/[label]

2. Temporarily assign yourself ownership of that volume:

% sudo chown [your username] /dev/disk[number]

3. Fire up a QEMU session:

% qemu -hda /dev/disk[X] -cdrom spinrite.iso -boot d

From here on in, its just like SpinRite on a regular machine... although an order of magnitude slower!

Don't forget when you're done to return permissions to root on the drive:

% sudo chown root /dev/disk[number]

Why go to all the trouble?

SpinRite is a preventative hard drive maintenance utility that is run off a bootable FreeDOS image burned either to a CD or run off a floppy disk. Unfortunately, while it boots on Intel Macs, the software requires BIOS level access to drives which EFI obviously fails to provide. As a consequence, the keyboard doesn't work and even if it did, the drives wouldn't be accessible.

One potential workaround is to physically remove internal drives from Macs, install them in a regular PC with a BIOS and perform SpinRite on it. While this works, its terribly clumsy and doesn't lend itself well to performing regular maintenance as Steve Gibson suggests we use it.

This got me thinking whether or not it can be virtualised. Provided the software had raw access to the drive, theoretically one could create a virtual machine, boot off the SpinRite ISO image and have it do its thing. I'd tried it using raw access in VirtualBox before, but it was complicated to configure and ran as slow as molasses.

Turns out, using QEMU to do this on a non-system drive is fairly simple, though just as slow. Oh well, you live and learn!


Image Capture.app not saving scanned images?

I was going mad trying to figure out why Image Capture.app wasn't saving any images from my scanner this afternoon. Turns out the destination drive I'd selected was completely out of of drive space. I would have appreciated at least some error or warning from either the Finder or Image Capture, but at least I figured it out eventually!

Passing this nugget of information on for what it may be worth if you're having/had/sandwich a similar issue.


Fixing an old, broken WordPress page

I got quite a rude shock recently to discover the archive page wasn't working! if you've been using WordPress for a long time and suddenly a custom page of yours is rendering blank, maybe this might come in handy.

Explanation sounds like an expired "planation"

When I first started using WordPress in 2005 I created a custom page template for the archive page, because I didn't like the way WordPress didn't (and still doesn't!) have a basic index feature.

The problem is, you can't call the WordPress API within a regular post or page because WordPress (for good reason) sanitises any code. The workaround is to create a custom page template in your theme that displays what you want, then selecting it from the "template" drop down box for the page you want to change in the WP admin interface.

For example, I had nicearchive.php in my theme folder which called the code to render the list of posts. It was called Nice Archive List, and I had it selected as a template for my Archive page which was otherwise blank.

I remember doing this for my archive page five years ago, but I'd noticed starting around WordPress 2.x that the template drop down menu didn't reference anything for the archive page. I didn't really care, because it still worked. Somehow!

Smite and solution to being smite-ed

Maybe it was the latest WordPress update that did it, but suddenly the archive page stopped working and instead rendered a blank, generic page. Obviously the voodoo association between page and the custom page template file was finally severed.

Going into the custom template file for that page I noticed it didn't have any template header code at all.

<?php /*
Template Name: Nice Archive List
*/ ?>

After adding this to the page template file, I was able to go to the archive page in the WP admin screen and choose the template from the template drop down box. Now the page renders properly again.

This raises several questions! First, how did the template work before without those necessary lines? Did older versions of WordPress handle page templates differently? Did the animators of K-On expect otaku to obsess over Mugi's eyebrows to the extent they did, or did it catch them off guard? If so, they're smart for using it as a plot device later XD. I haven't got around to reading the manga.Mi


Using VirtualBox floppy disk images

One of my New Year resolutions was to do more with people's feedback here, so here I go making good on that promise! I got an email this morning from a reader wanting to know how to mount floppy disk images in VirtualBox virtual machines.

Le steps

VirtualBox has support for floppy disk images, but unlike optical and hard drives its associated controller isn't enabled in new VMs by default. Fortunately, that's easy enough to fix.

  1. From the VirtualBox GUI, choose the VM you want to modify and hit Settings
  2. Choose the Storage tab
  3. Under the Storage Tree, click the second icon with a green plus and choose
    "Add Floppy Controller"

Now when you start that VM, there will be a floppy disk icon in the status bar which you can right click and mount floppy disk images with, without all those horrible noises and slow speeds of REAL floppy disks! Its magic, I tell you ^___^.

In the default open dialog box it will only let you choose standard RAW/img files, but I've been able to also use vfd files without problems.


Wired’s How-To wiki can prevent hangovers

Icon from the Tango Desktop ProjectI didn't know this: Wired has a How-To Wiki you can edit. One article proports to teach you how to prevent a hangover with these tips:

  • Don't drink on an empty stomach
  • Drink water between alcoholic drinks
  • Know your limits
  • Pre-Load with Vitamins and Antioxidants
  • Put a B-complex vitamin, electrolyte and water on your pillow
  • Take N-acetylcystine, NAC
  • Read Rubénerd.com

I have an even more effective approach, and its far simpler than ingesting a bunch of terms I only know because I studied chemistry: drink coffee instead. Now if you'd excuse me, its been two hours since I've had a cuppa and I'm having withdrawals.


Using QEMU for DOS on *nix

While DOSBox is a great piece of kit, sometimes you may have more speciailised DOS needs that require the use of a VM. In my case, I use QEMU and so far things are working great.

Getting it

The first step, surprising though it may seem, is to grab QEMU. Fortunately it's well enough known that most package managers carry it, even MacPorts and Homebrew on OS X do. Its relatively small and builds quite fast.

Creating a disk image

For my needs, raw images work just fine, plus they have the added benefit that they can be easily mounted on the host to modify its contents later.

QEMU comes with the qemu-img utility for creating disk images. This line will create a 500MiB raw disk image:

% qemu-img create -f raw dos.img 500M

Booting a virtual machine

This will start qemu with an extravagent 8MiB of RAM, dos.img as the master drive on the first virtual IDE channel (as a regular machine would probably be configured) and with our bootable PCDOS.iso image in the virtual CD-ROM.

% qemu -m 8 -hda dos.img -cdrom pcdos.iso

From hereon in, its as if you're installing DOS on a regular machine. Relive the glory days of frequent system crashes, conventional memory ceilings, three finger salutes and those dark blue setup screens!

Mount the disk image on the host

You'll want to shut down QEMU first (no, really?), then as root mount the disk image to a mountpoint of your choosing. *nix systems would typically employ the loopback device for this.

# mount -o loop,offset=32256 dos.img /mnt

Now you can access and transfer your precious DOS files :)

Justification

Why use QEMU over VirtualBox or other souped up virtualisation software?

QEMU is simple, no messy GUIs to get in the way. It's portable, and the disk images it uses can be easily mounted on the host just like a regular drive without having to convert it first, even on machines that don't have QEMU. And finally, speed isn't really an issue with DOS, so I'd rather have the convenience ;)

Why do you run DOS Ruben?

I seem to always attract troll comments on posts such as this! One of the things I moonlight as is a DOS and CP/M guy, setting up VMs for clients so they can access data locked into obscure file formats and/or abandonware applications. Also for process control software that companies still depend upon but can't use natively on modern hardware. And finally, Commander Keen. HAPPY?


Waking up your lazy Fedora 14 ThinkPad X40

After initially mentioning here that my ThinkPad X40 had no suspend issues on Fedora 14, the reported issues with suspending on that hardware have sporadically started to occur. I don't know why it works sometimes and not other times, unless a recent software update stuffed something up.

Fortunately I have a solution! If your ThinkPad X40 doesn't come out of standby, hold the power button, then hit a random number of keys for upwards of 20 seconds. That seems like a long time and the screen remains dark the entire time, but eventually it wakes up.

Arch Linux never did this on this machine, so I'm thinking its a Red Hat issue, or maybe the latest kernel doesn't like this machine either. Oh well, se a vida é.


Windows NT 4.0 sound in VirtualBox

So you want to get sound working in your Windows NT 4.0 VirtualBox virtual machine to relieve the glory days of your electronic youth, or some other reason you're too embarrased to discuss? Don't we all.

Caveats, mmm, must be Russian for bug larvae

Before we go any further, two quick points.

Unlike newer operating systems, Windows NT 4.0 is accorded VirtualBox additions that don't bother to set up the sound system. How dreadfully inconsiderate. Fortunately, after you've installed Service Pack 6 and the VirtualBox additions (in that order), it only takes a few minor adjustments to get sound.

The other point is, these instructions work and are current as of VirtualBox 3.2.10, build r66523. That's very close to a satanic number, just saying. I've been using NT 4 in VirtualBox for many years and the software has a habit of requiring different sound settings and drivers with subsequent releases.

The procedure

  1. Click your Windows NT 4.0 VM and hit Settings. Under the Audio tab, change the Audio Controller to SoundBlaster 16.

  2. Start the VM (always helps). Navigate to StartSettingsControl Panel and choose Multimedia. Under the Devices tab, click Add....

  3. Choose Create Labs Sound Blaster 1.X, Pro, 16 and hit OK. You'll need to specify the location of your Windows NT 4 installation files. I installed mine from CD, so I mounted the installation CD at this point, then hit OK

  4. Leave the I/O Address at "220" and click Continue, then under MPU401 I/O Address, change the value from "330" to "Disable" and hit OK.

  5. If you've mounted the installation CD, unmount it now otherwise when you restart it'll boot into that instead of your VM!

  6. Hit Restart Now. Surprisingly for a Redmond product, this is an example of a voluntary restart.

Now go grab yourself a 2.x series version of Winamp from OldVersions.com and relive the old days!

Link arms, don't make them


Cleaning VMware's .DownloadManager

The .DownloadManager folder

If you've ever attempted a download from the VMware website on your Mac, chances are you have some junk files you can delete in a folder called ".DownloadManager" If you're as obsessed as me, you'll want to delete it!

The delete is the bongly bong deng diggy diggy

You can use the Finder by clicking the "Go" menu, then "Go To Folder..." and entering in "~/.DownloadManager". Then you can safely delete the folder.

Alternatively, just use the Terminal:

% rm -r ~/.DownloadManager

Or for the paranoid:

% rm -irv ~/.DownloadManager

Or if you wanted to be really stupid and utterly superflous:

#!/usr/bin/perl -w
use strict;
my $junk = '~/.DownloadManager';
system("rm -r $junk");
while (1) { print("The Bird is The Word!\n"); }

One of these paragraphs is really important!

Icon from the Tango Desktop ProjectUnlike my computer desk, I like to keep my computer hard drives spotlessly organised, so when I find junk I delete it. In this case, I was going through my home directory and found a ton of unessisary files. What surprises me is... I don't ever remember using VMware's Download Manager at all. Maybe someone went into my brain and altered my memories. What a terrifying prospect.

Did you know there's a place in South Australia called Prospect? It's in Prospect. I assume its name was derived from the process of prospecting. Or maybe there was a prospective name, but it never materialised. You know if you spell materialised without the m, you don't get a name of a place in South Australia all. Coincidence? I think not. Wait, don't read too far into that previous sentence, however short it was.

As with all my posts, take my advice and use it at your own risk! I'm assuming the only side effect would be that if you did use VMware's Download Manager (whatever that is) and you were part way through a download, you may need to start again.