Capturing the screen in MacOS X

MacOS X comes with a built-in ability for capturing screenshots. The two most popular ones are:

Command ⌘ + Shift + 3 for capturing the whole screen and Command ⌘ + Shift + 4 for capturing a portion of the screen. The latter one changes your mouse pointer into a cross-hair, allowing you to select an area. Both shortcuts place the result onto a PNG file on your desktop.

How about capturing only the active application window? There is a trick for that too.

Press Command ⌘ + Shift + 4, then press Space, and the mouse pointer will change to a camera icon and highlight the active window under it. Click to make the capture.

Create your own Mac OS X Lion USB Drive (with the original icon)

Apple has released the Mac OS X Lion USB Drive, but I doubt it’ll be a hit for $69. Ouch. If you have already bought (and upgraded to) the Lion, you can create your own Mac OS X Lion Install drive using any spare 4.3Gb+ (8Gb to be safe) USB thumb drive. Here is how.

Insert your USB drive into a USB port, and launch the Disk Utility. Click your USB drive in the drive list at the left, and select the Partition tab. Change the volume name to Mac OS X Install.

Continue reading

A solution to the PHP5, GD, libpng “Abort trap (6)” bug

My WordPress has been acting up recently, throwing mysterious “IO Error” errors every time I was trying to upload a PNG file. Upon closer examination of the Apache logs I’ve found yet another cryptic error line for every failed upload attempt:

[notice] child pid 14139 exit signal Abort trap (6)

Reinstalling the PHP5, GD and libpng failed to fix this for me, so I’ve decided to check the loading order of the PHP extensions in the extensions.ini. Indeed, the gd.so was being loaded the last. Moving the “extension=gd.so” line to the top of the list fixed this problem for me after a restart of Apache.

So give it a try before googling for the “Abort trap (6)” error like I did, the search results contained mostly mailing list noise and bug reports fixed in earlier versions of PHP.