Annoying drop-shadows in Leopard grabs

In my previous post, you’ll see a screengrab of a PC88 emulator running on my Mac. hat you don’t see, is the 50 pixels or so of drop-shadow and transparency that Apple decided Leopard should add to window grabs not only as a default, but with no option to turn them off. Exactly why they thought everyone would need drop-shadows on every window they take a snapshot of, I don’t really know.

The type of grab I’m talking about is the one I use most often: press Shift-Cmd-4, then tap Space and click on the window you want a picture of. In Leopard (at least, Leopard on my iMac but strangely not on my MacBook), you get this:

PC88 Emulator grab

It looks fancy and stuff, but makes the image so much wider and taller. For the picture in the last post, I cropped it out manually using Preview.

Thankfully, I’ve found three solutions. None are perfect, but at least I don’t have to do the cropping any more.

1) Use Grab. It’s installed in Applications somewhere, and offers much the same functionality as the normal hotkey-based grabber, but doesn’t add the shadow effect. It also doesn’t save the image to the desktop instantly, which is a slight faff.

2) Use this script here.  This means running a script before the grab, which takes away the simplicity of the hotkey option, but you could always add it to a menu or dock or hotkey or something.

3) Trigger screencapture from the terminal with the command “screencapture -io”. The i says “choose what to grab” and the o says “don’t do the shadow thing”.

Making a Mac wake and sleep remotely

I’ve been having a play with the sleep options on my new iMac over the last few days. Since it’s replacing an always-on PC, I could keep this always-on too, but I thought I may as well make it sleep overnight and save the planet from global warming.

As an aside, I don’t believe in global warming. But anyway.

Things weren’t working right, as far as sleeping was concerned, and I asked about in uk.comp.sys.mac for some help. An interesting idea was proposed for making my Mac sleep all the time, except when I need to use it – even if that was remotely. So how do I make it wake up and sleep from another location?


Since I can SSH into it from the outside world, I had a look to see what command will put the machine to sleep from an SSH session. Thanks to this page (in the comments), I found the answer to be the following command:

osascript -e 'tell application "System Events" to sleep'


Wake Up

Now, this is a bit more tricky. Of course, you can set the Energy Saver settings to “Wake for Ethernet network administrator access” – Wake On LAN, basically. Thing is, it’s behind a router on the other side of the internet, and my router isn’t fancy enough to support sending out Magic Packets.

Thankfully, uk.comp.sys.mac had an answer for this too, with this website. You just fill in your MAC address (that’s MAC not Mac!) router IP or full address, and what port you want to sent the Magic Packet on. Of course, you need to tell your router to forward that port to your Mac, but that’s simple enough. Click the button, and rise and shine!

All this was an interesting and enlightening diversion, but it doesn’t really solve my original problem of my iMac not going to sleep when it’s supposed to…

“Iif” statements with Yes/No fields in Access

I came across an odd thing today. I have a database with a numeric field and a Yes/No field. If the Yes/No is Yes, a calculation is done on the numeric field (in a query), otherwise a different calculation is carried out.

Lets say the numeric field is “Hours” and the Yes/No is “Extra”, and the calculation is to multiply Hours by 0 (if Yes) or -1 (if No). This may not make sense here but does in the context of my database.

Anyway. Unlike Excel or VB or pretty much anything, Access uses an If statement called “Iif”. With two eyes. According to the Access Help, you use it like this:

=IIf([Confirmed] = "Yes", "Order Confirmed", "Order Not Confirmed")

This suggests you match the word Yes from the Yes/No field, right? Wrong.

If I do this:

=IIf([Extra] = "Yes", 0, -1)

Then both Yes and No match to give -1. After checking more documentation, and searching round the internets, virtually all examples seem to check against the words Yes or No. Which doesn’t work.

The solution (as I finally twigged) is to do this:

=IIf([Extra] = True, 0, -1)

Now why can’t the examples tell you this?

Slipstreaming SP2 into Windows Server 2003

And other tales.

For the last couple of days, I’ve been struggling to get Server 2003 installed on a new Dell PowerEdge 2950 III server. I didn’t think ¬¨¬£500 for the OS and Dell to install it was value for money, when I had some spare licences lying around. Unfortunately, wishing to save this money was a real headache.

First of all, OS-less Dell servers come with… nothing. No software at all (aside from some drivers). When you turn them on, they ask for the Dell Server Setup Disc, which they don’t come with. So I found an ISO of this on Dell’s website, downloaded and burnt it, only to find that when run, it wouldn’t recognise the RAID array in the server. Grr!

It turns out that v5.2 of this software (filename OM_5.2.0_ISM_A00.ISO) isn’t the right disc – it doesn’t support PERC 6 RAID devices. What you need is actually the “Dell Systems Build and Update Utility” v5.3 (filename OM_5.3.0_BUU_A00.ISO). So, with that, finally, I could set up the hard drive and get on with the Server 2003 install. Phew!

Except… I couldn’t. The “BUU” only supports Server 2003 Service Pack 2. Which I don’t have. I do, however, have a vanilla Server 2003 disc, and so began the search for how to slipstream SP2 into it. Many websites had conflicting information, some referring to disc 2 of Server 2003 when my copy is only one disc. Thankfully, I found this page:

Windows Server 2003 Service Pack 2 Released ‚Äö?Ñ?Æ The NeoSmart Files

Following the instructions there to the letter (well, except for the typo at the bottom where it says “c:\xp”), I managed to get a working Server 2003 SP2 CD, which the Dell software recognised, used, and allowed me to get the server up and running.

How to install XP on a Philips Freevents laptop

We got a couple of Philips Freevents 11NB5800 laptops at work this week, and they’re actually very nice. Of course, they come with Vista installed, so we had to remove that.

Problem #1
There are no XP drivers for the Freevents 11B5800. There’s nothing in the box (not even a Vista restore disc), and Philips have no mention of any of their laptops on their website. In fact, outside of PC World’s online store, the Freevents doesn’t appear to exist.

Thankfully, the 11NB5800 is actually just a re-badged Twinhead F11Y. It took me ages to figure that out, and it was only by searching for the SATA controller chip that I made the connection. Twinhead helpfully provide all the necessary drivers for XP (and ME and 2000, if you’re that way inclined).

Problem #2
Sadly, you can’t get as far as XP installing, as the XP Pro SP2 install disc doesn’t include the SATA driver necessary for the installer to see the laptop’s hard drive. Of course, this is often a problem, but you can usually solve it by putting the driver files on a floppy disk and pressing F6 when prompted during setup.

If only it were that easy. I had a USB floppy drive and managed to find Ye Olde Floppy Diskette, put the drivers on it, and pressed F6. XP Setup recognised the drivers, and I chose the Mobile variant of the Intel SATA chipset driver, and Setup continued. Unfortunately, Setup still couldn’t see the hard drive.

Problem #3
Then, after some more Googling and getting a hint from someone having similar problems with a HP laptop, I found this page. I tried the same thing, slipstreaming the SATA drivers into a copy of the XP Pro SP2 setup disc, creating a new disc in the process. Booting from this new disc and… success! I could see the hard drive, delete the Vista partition, and start XP Setup!

Problem #4
But then, disaster! The partition formatted, and the files needed for setup were copied to the hard drive, and then the machine rebooted as expected. But that was all – the laptop froze on the POST screen and refused to progress any further. I couldn’t get into the BIOS, I couldn’t boot from a CD, and removing the battery for a while before trying again was futile. Oops!

Luckily, I had another identical laptop. I decided to try the risky venture again, only with one small (and, it turned out, vitally important) difference. On the partitioning options during setup, I deleted both the Vista and the small System Restore partitions from the drive. This time, everything worked fine and after a (surprisingly quick) installation, I was at the XP desktop ready to install all the XP drivers previously downloaded from Twinhead’s website.

Freevents Laptop

Of course, I still have one bricked laptop, but as soon as I figure out how to get the hard drive out, I’ll have that sorted by cloning the working one to it…

ActiveSync and ZoneAlarm: Happy at last

I upgraded the free ZoneAlarm a few days ago, haven’t not done so in about 6 months, and was annoyed when it started asking me if I wanted to allow all the programs I’d previously allowed.¬¨‚Ć I thought upgrades were supposed to carry over the settings too?

However, I’d noticed this morning that ActiveSync, which I use with my PDA/phone, wasn’t able to fully connect. It’ll see the phone when I plug it in, but can’t sync. Looking in ZoneAlarm’s allowed list, everything to do with ActiveSync had full access already, but only by disabling the firewall could the phone sync correctly.

It seems the problem lies with “zones”. ActiveSync (at least, version 4.5 that I’m using) creates a network connection between the PC and phone, complete with IP addresses and stuff. In ZoneAlarm’s firewall zones, the virtual adapter “Windows Mobile-based device” was set to have its IP range in the “Internet” zone. Flick this over to “Trusted” instead, and magically it all works again!

Onkyo breaks Wii Virtual Console: The Horror!

Noooo! My lovely shiny expensive sexy audio equipment has a flaw! A nasty horrid flaw! It seems that you can’t play Wii Virtual Console games through it.

The picture splits in half, and the left half is on the right and vice versa. Then the screen goes black. And then I can’t use the Home button to bring up the menu, as when I do, the Wii crashes. Rubbish!

Thankfully, I figured ot a workaround. Until now, everything that goes through the Onkyo SR605 gets upscaled over HDMI. This makes the Wii’s picture look lovelier than ever, but sadly, stops VC games from being visible. So I just ran a component cable back to the TV from the receiver, and luckily that works!

Of course, I now have to change input on the TV if I want to play VC games, but that’s a small price to pay.

Which all means I can now play Adventure of Lolo 2 that I bought at the weekend!

Drupal register_globals problem

Have you tried to install Drupal, and got a message saying your server environment is unsupported because you have register_globals turned on? Have you been unable to change this because your web host (1&1, in my case) doesn’t let you play with PHP’s settings (and quite right too)?

Help is (possibly) at hand! It’s likely that although you can’t configure PHP directly, your host will allow per-directory PHP configuration changes. You do this with a plain-text file called php.ini, which in this case is placed in the root directory of your Drupal install, and contains just one line:

register_globals = off

Hurrah, eh? You can thank me with beer.