Skip to content

Posts from the ‘Technical’ Category


Finder Shared Items Persistence

Occasionally, the Finder will remember a shared server in the left hand Finder pane. This sort of persistent Shared server appears most likely because of an mDNSResponder cache problem. in order to get these inactive servers to once again disappear in OS X 10.3 or 10.4, follow the advice in the knowledge base article linked above. To make them disappear in OS X 10.5 Leopard, follow these instructions:

– Open the Network Preference Pane
– Select “Make Service Inactive” from menu at the bottom of interface list on the left hand side for the Airport interface and for the Ethernet interface.
– While the interfaces are inactive, relaunch the Finder (Hold down the option key, and click-and-hold the Dock Finder icon, until a menu appears with “Relaunch” as a menu item.
– Once the Finder is relaunched, make the Ethernet and Airport interfaces active again.

This should clear out the Bonjour cache of servers, and the Shared section should only list active servers once again.


Update Processing 1.0

Update Processing Icon
Update Processing is an application for Mac OS X to simplify the installation and updating of the development environment. It’s wonderful that Processing is updated so frequently, however; each update creates a little bit of work for developers, especially those that rely on custom libraries and need to reinstall all of the libraries each time. By running Update Processing, each update is installed with your custom libraries (such as mysql support) automatically. It is designed to archive your old versions in case a new update breaks your application and you need to roll back to a previous version.

Download Update Processing

Version History:
1.0 – January 30, 2008
– initial public release


Move The OS X Swapfile On Intel-Powered Macs

There’s been a lot of discussion over the years about the need for a separate swap partition or disk on OS X machines. I don’t have much to add to the debate, only to say that, as long as I can remember, minimizing fragmentation on hard disks has been one simple way of improving and maintaining system performance. As I mentioned in my article on FileVault, fragmentation on OS X disks is increased by the presence of large files, and therefore, my machines keep swapfiles and the sleepimage on a separate partition.
Recently, I was forced to upgrade my PowerBook, and when my MacBook arrived, I discovered that my preferred method of moving the swapfile offered by Professor Dave Bayer no longer worked. The culprit: the new GUID partition table. Prof. Bayer’s method relies on the commandline tool “pdisk” to handle and distinguish partitions. I modified his script to use “gpt” instead to handle the GUID partitioned MacBook.
I offer my modified version of his script to those adventurous folks who want to risk installing it, but I can not stress enough the fact that using this can cause inextricable damage to an OS X installation, and should only be attempted by people who have made complete, verified backups of their installations and are experts with the inner workings of the OS X operating system. Though this modified script has been tested quite a bit, I have only one machine on which to test it, and therefore can _not_ make _any_ guarantees of it. Use it at your own risk. I bear no liability should you mess up your machine.
Other caveats:
– This script is only compatible with Intel-based Macs
– This script has only been tested under OS X 10.4.9. Compatibility with other versions is unknown.
I ask that if you have success or failure using the modified script that you please comment here so that I can learn with which systems it is compatible and can correct any remaining issues.
Please see the superb documentation Prof. Bayer has provided on his site for further information about the original script.


The Downsides of FileVault

After reading Frankly, I love FileVault. It’s a little extra peace of mind that doesn’t come at a very high price. Apple has pointed out that a disk-hungry application’s performance might be affected if its files are accessed from within FileVault, but there are three additional potential problem areas that aren’t frequently discussed and results in unexpected or unpleasant user experience.

1) Applescript:
Lots of applications (like Quicksilver and Automator, for example) rely heavily on Applescript, and most Applescripts can not navigate a folder path inside of FileVault. Apple hasn’t addressed this problem since it showed up in Panther and very few Applescript developers have written their apps to either detect or circumvent this FileVault problem. So if you use FileVault, and can’t figure out why some app isn’t functioning the way you’d expect, try running it from a user account that isn’t running under FileVault.

2) Backup:
Never, ever try to backup anything except a subset of a home directory while logged into a user account that is FileVault-enabled. If your backup strategy is a full disk mirror using SuperDuper!, Carbon Copy Cloner, or the like, you must be logged in as a user without FileVault enabled. Otherwise, the backup application can not successfully capture the FileVault disk image. This also means that even incremental backups will take a bit of time since the the entire FileVault disk image must be backed up each time, and this might be tens of gigabytes.

3) Fragmentation and Performance
There has been a lot of discussion over the years about whether or not OS X HFS+ drives fragment. OS X will auto-defragment files that are less than 20 MB. FileVault being a sparse disk image means that it doesn’t need to occupy a contiguous area of the drive, but it is also guaranteed to be larger than 20MB. As a result, a drive containing a FileVault disk will invariably fragment, and in my experience, fragment badly. This slows the machine down noticeably. I have spent some time trying to lessen this issue by trying to figure out how to move my FileVault image to its own partition to no avail. If anyone can figure out how to do that, please let me know.

(4) Slow logout or shutdown)
There is a fourth issue, though not one I think is as important as the other three. Namely: when you log out of a FileVault-enabled user account, the OS offers to recover some disk space that is being wasted due to the way OS X handles file deletion on disk images. I highly recommend letting the OS recover that space, but that can take a couple of minutes depending on how many files were affected. I’ve read several comments complaining about how long it takes for PowerBooks and MacBooks to go to sleep when SafeSleep is enabled – those people would be horrified by how long it’ll take their computer to shutdown or log out with FileVault enabled. Not to mention, this “offer” comes in the form of dialog box, that doesn’t time-out. I have, more than once, forgotten about that dialog, told my computer to shutdown, left home before seeing it, and come back hours later to see my machine is still running with that dialog up waiting for me to tell it to recover the disk space.

All of this isn’t meant to discourage anyone from using FileVault. As I said before, I use it, and I’m glad I’ve got it as some additional peace of mind. However, you should consider these issues before enabling this feature.


Tweaking the VoiceNotes Widget

I’ve tried various applications to help me get my thoughts down quickly into something more permanent, and recently I’ve tried WidgetMachine’s NotePad 2.0 and VoiceNotes. I really like NotePad 2.0, but couldn’t get VoiceNotes to record correctly. After fixing it, I like it just as much. The problem was that VoiceNotes could not record to its default location in my home folder since I have FileVault enabled. I tweaked the widget to remedy that and then modified it to minimize the likelihood that one recording would overwrite another. By default each new recording has the exact same name unless you title the recording. If I’m in a hurry to record what I’m thinking about, I don’t have time to name the recording first. So instructions to modify the widget are below. Note: the usual disclaimers apply – modify at your own risk. Also, make sure you register this excellent widget.

Download and Uncompress

– Control-Click (or right-click) the Widget that was uncompressed

– Select “Show Package Contents”

– Open “voicenotes.js” in your favorite text editor

– Modify line 2 to select where notes should be stored. If you’re using FileVault, make sure the folder is not in your FileVault-protected home folder.

– Comment out line 115 that reads:

edit_div.innerText = "New Note";

by putting two slashes in front:

// edit_div.innerText = "New Note";

– Then copy and paste the following code below that line:

// Define a mostly unique name for the recording.
// Since the naming does not take timezone or daylight savings time
// into account it is possible for there to be overlap of filenames
// which may result in one recording overwriting another. 
var right_now=new Date();

var name_year = right_now.getYear(); 
if (name_year < 2000) 
name_year = name_year + 1900; 

var name_month = right_now.getMonth() + 1;
if (name_month < 10)
name_month = "0"+ name_month;

var name_date = right_now.getDate();
if (name_date < 10)
name_date = "0" + name_date;

var name_hrs = right_now.getHours();
if (name_hrs < 10)
name_hrs = "0"+name_hrs;

var name_min = right_now.getMinutes();
if (name_min < 10)
name_min = "0"+name_min;

var name_sec = right_now.getSeconds();
if (name_sec < 10)
name_sec = "0"+name_sec;

var new_name = ""+name_year+name_month+name_date+name_hrs+name_min+name_sec;

edit_div.innerText = new_name;

- Save the file.

- Double-click the widget to install it.

- When you create a new recording, it will now place the recording where you like and it will title each new recording with the current date and time by default (e.g. 20060629071908)


Swapping Modifier Keys Seperately on a Notebook and External Keyboard in Mac OSX Tiger (Update)

Previously, I used the method described on Heiko Hellweg’s site to modify the internal keyboard driver of the PowerBook, then use the Keyboard & Mouse Preference Pane to swap the modifier keys again. This resulted in consistent modifier key behaviour on both the built-in keyboard, and on the external keyboard.

Well, OrderedBytes has released a new version (v.4) of ControllerMate, which simultaneously disabled the previous method and opened up a new method. ControllerMate v4 includes it’s own ADBKeyboard driver which overrides the built-in one. I discovered this when I upgraded to v4 and immediately my modifier keys were back to normal. I wrote OrderedBytes, and Ken wrote back to say:
“CMv4 contains a custom ADB (and USB) keyboard and mouse driver to implement the “Controller Configurations”. This should allow you to redefine keyboard keys (such as swapping the command/option keys, or the control/caps-lock keys). These controller configurations work on a per-keyboard basis so any changes made to the internal keyboard do not affect any external keyboards that you have attached.
If you want to use your own version of Apple’s ADB keyboard driver (and it sounds like you do), there are a few ways that you can do it. The easiest is probably just to delete the CMADBKeyboard.kext driver from inside the ControllerMate.kext. This will have no ill effects on anything else in ControllerMate.”

However, instead of disabling the driver, I decided to use the new features of ControllerMate to re-enable my modifier keys configuration. Using ControllerMate to manage the PowerBook’s built-in keyboard means that now the built-in/external consistent modifier key behavior is available to new USB-keyboard-based PowerBooks as well as older ADB-keyboard-based PowerBooks. As of this writing, ControllerMate is not yet Intel-compatible, but Ken has said that is the next priority, at which point it should work for MacBooks as well.

– If you previously modified your AppleADBKeyboard.kext as described in the original posting, you can return it back to it’s original condition if you wish.

– Install ControllerMate v4.

– After rebooting, and launching ControllerMate, (and registering it), make sure the “Palette” window is visible and that the drop-down is set to “Controllers”

– Drag your built-in keyboard (labeled “Keyboard Apple”) from the Palette to the main ControllerMate Editor window. Drop it on the left half of the window below the Buttons labeled “Programming, Controller Types, Virtual Controllers”
Drag your built-in keyboard from the Palette to the main ControllerMate Editor window.

– Select the Keyboard controller configuration you just added to the Editor

– Select “Keypad LeftAlt” in the table on the right
Select 'Keypad LeftAlt' in the table on the right

– Select Keypad Left GUI” from the “Behavior” drop-down list
Select Keypad Left GUI

– do the same for “Keypad Left Gui” (Select “Keypad LeftAlt” as the Behavior)

– do the same again for “Keypad Right Gui” (Select “Keypad RightAlt” as the Behavior)

– do the same for “Keypad RightAlt” (Select “Keypad Right Gui” as the Behavior)
Completed configuration

– Save the configuration

– Under ControllerMate’s Preferences, make sure that “Enable ControllerMate Helper” is checked

– If you haven’t already, open the “Keyboard & Mouse” System Preference and under the “Keyboard” tab, click the “Modifier Keys…” button and then swap the Command and Option keys.

This method should work on new and old PowerBooks alike, and once a Universal version of ControllerMate is released, it will work for MacBooks as well.


KGTD and Next Actions in iCal

Update: Ethan has included this functionality in the latest version (0.83) of KGTD. I’ll leave this up for anyone who doesn’t want to upgrade yet.

I love, and live by, Ethan Schoonover’s KGTD. However, I also use my Treo to take care of tasks while commuting. However, KGTD doesn’t sync tasks into iCal so that I can identify Next Actions in each Context. So I modified Ethan’s code slightly, and now Next Actions sync as “important” priority tasks, and all other tasks have no priority.
I’m certain Ethan will include a similar feature in the next version of KGTD, but if you need this functionality right now, you can download the modified version of the Sync script.
Modified 0.75.2 Sync.script
To install it, after uncompressing it:

  • Run the current Sync script from KGTD, and then sync all your devices to make sure all your data is in place.
  • Quit KGTD
  • Backup your iCal data, and KGTD just incase something unexpected happens
  • Delete all your tasks in iCal. This prevents duplicate tasks
  • Open the “/Library/Scripts/Applications/OmniOutliner Pro/Kinkless” folder.
  • Rename “Sync” to “Original Sync”
  • Copy the modified “Sync” to the Kinkless folder
  • I’ve only modified a couple of lines in Ethan’s script, but something unexpected might still go wrong. You use this script at your own risk; I am not responsible for any lost data. That said, I’ve been using it daily for months without any problems.


    Safari Google Toolbar-like Highlighting

    I find using a web browser to be a more pleasant experience when I can use the Google Toolbar. The features that make using it so much more pleasant is being able to pinpoint where in the result document my query terms appeared. I feel like it enables me to quickly get at the “meat” of the information I’m searching for. I love Safari, but have used Firefox because the Google Toolbar is available for it. Thanks to Pierre-Luc Samuel’s superb Ultimate Highlight Bookmarklet 1.5b, I was well on my way to getting my beloved highlighting back. My only problem with it was that I often write more specific queries to Google; most often including quoted phrases. Unfortunately, his Safari-compatible Bookmarklet didn’t handle quoted phrases. Below is my update to his bookmarklet that now supports quoted phrases as well.
    Highlight (Note: Bookmarklet updated March 04, 07)
    Drag the link above to Safari’s Bookmark Bar. I recommend dragging it all the way to the left on the Bookmark Bar. If you do, you can simple hit Command-1 and quickly launch and, when hit again, quit the highlighting of your last search phrase.
    The Bookmarklet has a few problems, the most important of which is that it relies of the google referrer link to provide the query terms. If you run it from a page that you didn’t connect to from a Google results page, you’ll have to enter the terms you want highlighted by hand.


    ELBT595 and the Treo 650

    Connecting the Treo 650 to the ELBT595 was a snap.

    Make the ELBT595 base discoverable by:
    • System Setup -> Bluetooth -> Select Mobile -> Empty -> Find Me

    On the Treo:
    • go to the Bluetooth application
    • select Setup Devices
    • then select “Hands-free Setup”
    • Find the base and connect with the PIN displayed on the base
    • Then when the pairing is complete, the Treo will ask if you’re connecting to a “Headset” or a “Car Kit” – Select “Car Kit” and then “Done”
    If your Treo doesn’t ask you if you’re connecting to Headset or Car Kit, then you’re probably using an older firmware on your Treo. Please upgrade your Treo and try again.

    Treating the ELBT595 as a Car Kit makes the whole set up work correctly.

    However, Car Kits keep an open Bluetooth connection with the Treo. This will drain your battery more rapidly. Consider keeping your Treo in a charger near your ELBT595 base. Also, this means that your Treo’s Bluetooth connection is incessantly occupied – as long as the Treo is in range of the ELBT595, you can’t send files to the Treo via Bluetooth from any other devices nor can you connect your Bluetooth headset to the Treo directly.


    ELBT595 Base Reset

    So you’ve got your fancy Uniden ELBT595 cordless phone, and new handsets aren’t registering with the base anymore, or maybe you’ve just got all sorts of messed up settings and just want to reset everything and start over. It’s not documented anywhere else, so here’s how to do it:
    • Unplug the AC adapter from the back of the base
    • Remove the backup battery from the base
    • Press and hold both the do-not-disturb (dnd) key and the delete (ø) key.
    • Keep holding them down while you plug in the AC adapter again.
    • Wait until you hear a long beep.
    • You can release the keys now.
    • Unplug the base, replace the backup battery, and plug the base in again.

    Now you’ve got a fully cleared base.

    You can press and hold ‘end’ and ‘#’ on the handset, then select “Replacing Base” then drop the handset back in the base to reregister it as the #1 handset.

    I had to do this because the handset that shipped with mine wasn’t properly registered to the base. When I finally succeeded at registering the handset with the base it was shown as #2. I hoped that by registering the handset repeatedly, I’d reach #10, then loop back around to #1. No luck. It just stopped accepting handset registrations when I reached #10. Clearing the base’s memory is the only way to get back to #1.

    Now, if someone could point me to the method for wiping the memory of a handset…