May 05
This morning I needed to choose a hex color, but I didn’t have easy access to the Color Picker utility in Mac OS X. So I spent about 15 minutes creating a Color Picker.app utility and installed some plugins. Yes, you can install plugins for Color Picker.

Download Color Picker.app here.
Just drag to /Applications/Utilities/ and then you can find the Color Picker in Spotlight.
While you’re at it, make Color Picker more useful by installing these plugins:
Apr 15
The problem with unofficial, de facto standards, like magic.mime? What happened late last month, when the Unix file(1) command development team, led by Christos Zoulas, released version 4.24, a minor revision that changes the entire magic format and no longer generates a magic.mime file.
Many programs rely on the magic format in order to identify a file’s MIME type (for example, returning “video/quicktime” for a QuickTime movie or “image/jpeg” for a JPEG image). With MIME detection being merged into magic.mgc, a compiled file, programs that rely on this functionality must be modified in order to use the latest changes.
According to Christos the new format yields more accurate results:
[N]ow mime detection is more precise as it depends on the full magic specification of each magic type, not just a single magic/offset.
And indeed, in testing this appears to be the case, e.g., MP4 videos are detected more often than they were in 4.23. But to use these latest changes, many developers must make system-level calls directly to the file command until extensions are updated.
The PHP extension Fileinfo, for example, is a thin wrapper around the library version of file (libmagic), but yet does not understand the new format. In PHP, calling the file command on a fast machine via exec() is about 16 times slower than using Fileinfo (0.128 seconds versus 0.008).
Of course, there is a standard specification, but neither file(1) nor Fileinfo use it, unfortunately.
cheap propecia
propecia online
buy propecia online
lasix
buy lasix
lasix online
purchase lasix
accutane
buy accutane
accutane online
cheap accutane
buy accutane online
diflucan
buy diflucan
diflucan online
viagra
buy viagra
buy viagra online
viagra online
discount viagra
order viagra
cheap viagra
acomplia
buy acomplia
buy acomplia online
acomplia online
tadalafil
buy tadalafil
soma
soma online
buy carisoprodol
order carisoprodol
carisoprodol online
buy soma
order soma
levitra
buy levitra
cheap levitra
levitra online
buy levitra online
order levitra
cipro
cipro online
buy cipro
zithromax
buy zithromax
zithromax online
viagra soft
viagra soft tabs
buy viagra soft tabs
cialis
Buy Cialis
Buy Cialis Online
cialis online
Online Cialis
Order Cialis
Cheap Cialis
Discount Cialis
rimonabant
buy rimonabant
cialis soft
cialis soft tabs
cialis soft tab
buy cialis soft tab
amoxil
buy amoxil
amoxil online
order amoxil
voltaren
buy voltaren
order voltaren
voltaren online
finasteride
buy finasteride
finasteride online
flagyl
flagyl online
buy flagyl
vardenafil
buy vardenafil
vardenafil online
sildenafil citrate
sildenafil
buy sildenafil citrate
buy sildenafil
propecia
buy propecia
order propecia
cheap propecia
propecia online
buy propecia online
lasix
buy lasix
lasix online
purchase lasix
accutane
buy accutane
accutane online
cheap accutane
buy accutane online
diflucan
buy diflucan
diflucan online
viagra
buy viagra
buy viagra online
viagra online
discount viagra
order viagra
cheap viagra
acomplia
buy acomplia
buy acomplia online
acomplia online
tadalafil
buy tadalafil
soma
soma online
buy carisoprodol
order carisoprodol
carisoprodol online
buy soma
order soma
levitra
buy levitra
cheap levitra
levitra online
buy levitra online
order levitra
cipro
cipro online
buy cipro
zithromax
buy zithromax
zithromax online
viagra soft
viagra soft tabs
buy viagra soft tabs
cialis
Buy Cialis
Buy Cialis Online
cialis online
Online Cialis
Order Cialis
Cheap Cialis
Discount Cialis
rimonabant
buy rimonabant
cialis soft
cialis soft tabs
cialis soft tab
buy cialis soft tab
amoxil
buy amoxil
amoxil online
order amoxil
voltaren
buy voltaren
order voltaren
voltaren online
finasteride
buy finasteride
finasteride online
flagyl
flagyl online
buy flagyl
vardenafil
buy vardenafil
vardenafil online
sildenafil citrate
sildenafil
buy sildenafil citrate
buy sildenafil
propecia
buy propecia
order propecia
cheap propecia
propecia online
buy propecia online
lasix
buy lasix
lasix online
purchase lasix
accutane
buy accutane
accutane online
cheap accutane
buy accutane online
diflucan
buy diflucan
diflucan online
viagra
buy viagra
buy viagra online
viagra online
discount viagra
order viagra
cheap viagra
acomplia
buy acomplia
buy acomplia online
acomplia online
tadalafil
buy tadalafil
soma
soma online
buy carisoprodol
order carisoprodol
carisoprodol online
buy soma
order soma
levitra
buy levitra
cheap levitra
levitra online
buy levitra online
order levitra
cipro
cipro online
buy cipro
zithromax
buy zithromax
zithromax online
viagra soft
viagra soft tabs
buy viagra soft tabs
cialis
Buy Cialis
Buy Cialis Online
cialis online
Online Cialis
Order Cialis
Cheap Cialis
Discount Cialis
rimonabant
buy rimonabant
cialis soft
cialis soft tabs
cialis soft tab
buy cialis soft tab
amoxil
Apr 14
Leopard users know how useful Quick Look can be, but using it from the command line is harder than it should be. After looking at other people’s solutions, I decided to write my own.
#!/bin/bash
#
# ql(1)
#
# Quick Look command for terminal use
#
if [[ ${#} -lt 1 || ${1} == "-h" || ${1} == "--help" ]]; then
echo -e "Usage: ql [options] "
echo -e "\t-t\tForce text mode"
else
if [[ ${1} == "-t" ]]; then
shift
qlmanage -p -c public.plain-text "${@}" >& /dev/null &
else
qlmanage -p "${@}" >& /dev/null &
fi
PID=${!}
PID_IN_USE=1
while [ ${PID_IN_USE} ]; do
PID_IN_USE=`ps | awk '{ print $1 }' | grep ${PID}`
read -sn 1 -t 1
if [[ ${?} -eq 0 && ${PID_IN_USE} ]]; then # user quit via GUI
kill ${PID}
exit 0
fi
done
fi
Besides saving on typing, this script has a few other advantages over the qlmanage command:
- It automatically returns the command line to you if you close Quick Look with the GUI (after a short delay)
- You can force plaintext mode for text files that don’t have generators configured (for example, CSS files by default) with the -t option.
- You can hit any key to close the Quick Look window.
Download ql here.
Apr 05
Feel like wasting several hours? Try installing Windows XP with Boot Camp 2.0 (the version released as part of Mac OS X 10.5 Leopard) using NTFS, the file system required for partitions larger than 32 GB. Then watch as it fails miserably, again and again.
Windows could not start because the following file is missing or corrupt:
<Windows root>\system32\hal.dll.
Please re-install a copy of the above file.
Sound familiar? You didn’t do anything wrong—this is actually Apple’s fault. Hal.dll, the “hardware abstraction layer”, doesn’t have any particular significance; it just happens to be the first file that Windows looks for as it’s loading. Attempting to replace this file with the copy on disk won’t work, and your boot.ini is probably fine.
So how do you fix it, then? The solution is a bit involved, but not too bad all things considered. Here are the steps:
- If you haven’t already removed the bad installation, you’ll need to do so. In OS X, open Boot Camp, click Continue, select “Create or remove a Windows partition”, click Continue, and then click Restore.
- Create a new partition as you did before, and start the installation.
- After the computer has rebooted and it’s booted from the CD, type “R” to go to the console. You should be dumped to the C:\ prompt.
- We’re going to reformat the drive as NTFS ourselves instead of letting the Windows installer do it. Type the following and hit Return:
format c: /q /fs:ntfs
Then type this to reboot the computer:
exit
- Hold Option after it restarts, then boot to the Windows installation CD again (I believe it boots to the CD by default at this point, but this is just to be sure).
- Install to C: (be careful not to select your OS X volume!), but—and this is important—choose NOT to reformat. Leave the file system as is.
- Continue the installation process as you would normally.
That’s it! If things went well, the lovely 256-color Windows logo should load and you’ll be looking at Napa Valley in no time.
Mar 31
MySQL 5.0.51 on Mac OS X 10.5 (Leopard) is usually a model of how to port to Mac: an easy-to-use .dmg, a sensible install location, and a preference pane normally mean It Just Works™. On my last couple of installs, though, I’ve ran into some minor headaches. Here’s how I got around them.
First, the preference pane. When you try to either start or stop the MySQL server, it just kind of thinks for a second and then does nothing. It’s not your fault; the preferences pane just doesn’t work in Leopard. The good news is that there’s a fix out, located at the URL below:
ftp://ftp.mysql.com/pub/mysql/download/gui-tools/MySQL.prefPane-leopardfix.zip
Remove your old preference pane first (command-click and select “Remove ‘MySQL’ Preference Pane”), then doubleclick on the new one to install.
The second problem is that the MySQL daemon doesn’t launch on boot. MySQLCOM (the startup script) isn’t even in /Library/StartupItems! In fact, it’s just been installed to the wrong place. Run this command to move it to the right spot:
sudo mv /usr/local/MySQLCOM /Library/StartupItems/MySQLCOM
Type in your password and you’re good to go.
All things considered, both are pretty painless. Now if only MySQL would test their releases on OS X before releasing them, that would be delightful.