Archive for the ‘ OS X ’ Category

Invoke Quicksilver In All Spaces After 10.6 (Snow Leopard) Upgrade

After upgrading to 10.6 my beloved Quicksilver had grown some new bad habits. If I wasn’t in the first space (#1 / top left), Quicksilver would bring me back there every time I invoked it. So if I was trying to open an app or run a command in Space #2, running a Quicksilver command would bring me back to Space #1. VERY annoying.

Here’s the fix:

  1. Make sure you’re running the latest version of Quicksilver: b56a7
  2. In Preferences > Application, check “Show icon in dock”

Now, I don’t want the app showing up in my dock or running applications list either, but until they fix this error (which may take some time) it’s far less obnoxious than the issue I was trying to solve!!

As a side note, it’s very important to make sure you’re running the latest version (link above). Before updating to b56a7, I couldn’t see the Preferences screen after upgrading to 10.6 (just had a blank white panel), so obviously #1 must come before #2!

Solve Slow iDisk Syncing After Upgrading to 10.6 (Snow Leopard)

I use iDisk Sync (via MobileMe) to keep my desktop and my laptop in sync so I don’t have to remember to copy files back and forth every time I grab one or the other. This worked great until my upgrade to 10.6 – ever since then the iDisk status bar would say “Checking items” for hours, never really seeming to do anything. I finally found a fix that seems to have done the trick, thanks to Matio Martin and John Brissenden over at this very long support post. Here are the steps:

  1. Go to System Preferences > MobileMe > iDisk
  2. Switch off iDisk sync and keep it switched off
  3. Log out of MobileMe in the Account tab
  4. Log in again with nonsense login details (make up anything – you’ll get a login error. This somehow “resets” everything)
  5. Log in properly with your correct user/pass
  6. Turn iDisk syncing back on (you may need to re-enable everything on the Sync tab as well – just choose “Merge Data” – everything worked flawlessly for me)

Granted, this will take some time as each machine re-downloads everything on your iDisk. It took about 30 minutes to download the 2.5GB I have on my iDisk. But once that was completed it’s working smoothly again – almost feels even faster than it was on 10.5. I can’t tell you exactly how or why it works – but it appears as if it has re-mapped all of the files and it’s no longer churning endlessly in vain.

Sync And Share Your iCal Calendar With Multiple People Using BusySync and Google Calendar

My wife and I keep our calendars in iCal, but without some divine intervention we couldn’t sync our calendars or view each other’s calendar in iCal. We ran into this same issue at the office as well – I needed our Project Manager to see my calendar, but because we were both using iCal we were isolated into our own little islands of calendar hell.

So we started using Google Calendar, where we could share calendars and see each others events – even add events to each others calendars. But let’s face it… it’s just not as pretty or convenient as iCal, and it won’t sync events to my iPhone. If only there was a way to do this in iCal…

Well, I found a way. Using BusySync, I can use Google Calendar as a conduit, which holds and shares all of our calendar information. So I can see the calendars of others, and they can see mine. When I add an event in iCal, BusySync sends that information to Google Calendar, and BusySync on the other user’s computer picks it up and updates the information in iCal for them. The whole process happens within seconds – it’s pretty amazing. Watch the video to see what I mean.

So what happens if I have multiple computers and an iPhone? (Which I do). That’s where MobileMe comes in. Here’s the full setup:

We have an iMac at home which we use as our “base” – that’s where BusySync is installed. This computer is always on, so there’s never a lag in the data getting synced. If I add a calendar event on my laptop, MobileMe syncs that information with my iPhone and the iMac at home. BusySync then picks it up and syncs it to Google Calendar, which in turn triggers BusySync on other user’s machines to update the calendar event on their iCal calendar. And with MobileMe it shows up on their iPhones as well.

So with the two services combined, you can have multiple shared calendars, managed by multiple people, syncing on multiple computers and phones without doing anything more than simply adding an event.

Hidden Files in OS X Finder – No Terminal Hacking With Path Finder

I posted a way to show hidden files in OS X’s Finder a while back and have found a much better option that I thought I’d share. Path Finder from cocoatech is an amazing app, and even with the improvements to the Finder in Leopard, Path Finder still blows it out of the water. Five reasons I can’t live without it:

1) Show Hidden Files. This is huge when you’re working with a website that requires the .htaccess file or editing system files without the Terminal. If I want to copy a folder or group of files while ignoring .DS_Store files and .svn (Subversion) files, the Finder is great. But .htaccess is going to be left behind too. Path Finder shows and hides system files with a simple “show invisibles” checkbox.

2) Those Relentless .DS_Store Files. Sure, they tell the finder what font size, color or format to show each unique finder window in, but come on… do we REALLY need this written in every folder the Finder touches whether we change the layout or not? I hate clutter. Even if it’s invisible clutter. Path Finder shows folders without adding a .DS_Store file to tell you it’s been there.

3) Compressing Folders. Have you ever opened one of those .zip files you’re sending your PC friends that you compressed from the Finder? They’re filled with all kinds of extra junk that you can’t see on a Mac, but confuses the hell out of someone on a PC who’s looking at two versions of every file in the folder (a hidden __MACOSX folder contains duplicates (0 or 1KB versions) of every file – most likely meta data about each file). Path Finder compresses folders without adding… whatever that is that the Finder adds.

4) Tabs. Tabs… hello, Apple? TABS!! They’re everywhere now. They should be on the Finder too. Even my toaster has tabs now.

5) Sort Folders First. If I had to choose one thing I miss from my days on Windows, it would be that the Windows Explorer always sorted folders first, and then files. I always found it hard to quickly find things in the Finder with folders and files all jumbled together (sorting by “Kind” fixes this… sort of). Path Finder brings that back, and it’s oh so nice.

Another nice feature (I could go on with 20 more of these, but I won’t) is something they call the “Drop Stack.” It’s a magical place where you can put files… almost like a little favorites drawer, to access quickly, or burn to a CD, without creating a folder on the Desktop for them.

So I suggest you check out Path Finder – it’s well worth the $35 you’ll shell out for it.

Local Web Development With OS X 10.5 (Leopard)

With the release of Leopard last Friday, it appears the bulk of my previous tutorials are now taken care of out of the box. mod_rewrite is enabled by default, and a decent (but not robust) installation of PHP 5.2.4 is ready to go – it only needs to be uncommented in the Apache configuration file.

The PHP installation is missing some key extensions, like PostgreSQL support and the GD library to name a few. But the majority of commonly used extensions are ready to go. Marc Liyanage is already on the case and working out the kinks for his own installer including those additions. The only thing missing at this point is MySQL support for Leopard. As of this writing, there is no installer available yet.

The rest of this post assumes you are working from a clean install or an “archive and install” of 10.5. I’m not sure what the Apache configuration files may look like if you simply upgraded from 10.4 or 10.3 – if they are clean this should work just fine.

Open the Apache configuration file (I’m using TextMate, which is where the ‘mate’ command comes from):
$ mate /etc/apache2/httpd.conf
and scroll to line 114 – it should look like this:
#LoadModule php5_module libexec/apache2/
Just remove the comment:
LoadModule php5_module libexec/apache2/

To enable Virtual Hosts, uncomment line 461:
Include /private/etc/apache2/extra/httpd-vhosts.conf
and add your own directories in your /etc/apache2/users/you.conf file. Similar to the 10.4 configuration, change the first two lines (inside <Directory "/Users...>) like so:
Options All
AllowOverride All

and add your Virtual Host directives after that:

<VirtualHost *:80>
DocumentRoot /Users/yourname/Sites
ServerName localhost

<VirtualHost *:80>
DocumentRoot /Users/yourname/Sites/devsite
ServerName devsite

Restart Apache:
$ sudo apachectl restart
and you’re all set.

The only thing left to do is update your hosts file:
$ mate /etc/hosts
and add whatever you used for your ServerName after the other entries: devsite


Now I need to figure out if those rumors of Ruby on Rails out of the box are true…

Save Time (and code) Using Virtual Hosts For Local OS X Web Development With mod_rewrite

UPDATE: This tutorial was written for OS X 10.4 and parts of it are no longer necessary with OS X 10.5. See this post for details.

Using a few built-in tools in OS X, I’ve found a great way to develop sites as Virtual Hosts on Apache. If you are a web developer working on a Mac and you need to develop sites using root relative paths without adding a base href tag to every page on your site, this tutorial should help tremendously. Here’s how it works:

First, make sure you’ve got PHP and MySQL installed – those are the only two things you should need to install outside of the stock OS X configuration.

Next, follow this tutorial on enabling mod_rewrite on OS X that I’ve written previously.

The rest will involve some basic command line use, but it’s pretty painless. As mentioned in the mod_rewrite tutorial, I highly recommend TextMate for editing the configuration files. If you’re a UNIX purist, there’s always vi.

For this example, create a new folder in your /Users/yourname/Sites folder called devsite and place some files there (a simple html or php file with something to output in a browser will do).

  1. Open your httpd.conf file and enable Virtual Hosts:
    $ mate /etc/httpd/httpd.conf
    Around line 1063 (almost at the bottom of the file), you should find and uncomment this line:
    NameVirtualHost *:80
  2. Open your users.conf file and add a Virtual Host directive:
    $ mate /etc/httpd/users/yourname.conf
    After the <Directory>...</Directory> portion, add the following:

    <VirtualHost *:80>
    DocumentRoot /Users/yourname/Sites
    ServerName localhost

    <VirtualHost *:80>
    DocumentRoot /Users/yourname/Sites/devsite
    ServerName devsite

    Keeping the localhost portion at the top will still allow you to view the root of the server and anything in it’s directory at http://localhost.

  3. Open your hosts file and add your new site name to bypass DNS:
    $ mate /etc/hosts
    Make sure these three lines stay at the top: localhost broadcasthost
    ::1 localhost

    And add this line after it: devsite
  4. Restart Apache
    $ sudo apachectl restart

You can now view your local files in your browser at http://devsite.

Let’s step back and look at what we’ve done and why this is so useful.

Most likely, until now, you were viewing local development sites by going to something like http://localhost/~yourname/devsite/fancy/url (or instead of localhost) and doing anything with mod_rewrite meant lots of base href tags and RewriteBase configurations, which in turn meant lots of ../../ paths before your images or included scripts to make things work. Now, viewing the same files in your browser is as easy as http://devsite/fancy/url and all of your paths can begin with a single slash ( / ) meaning it will still work the same when you migrate your site to the live server. Root relative paths are a life saver – and this setup makes it possible.

It’s also useful for quick access to commonly used tools, like phpMyAdmin. What I’ve done is install phpMyAdmin in /Users/me/Sites/phpMyAdmin and set up a Virtual Host like this:

<VirtualHost *:80>
DocumentRoot /Users/me/Sites/phpMyAdmin
ServerName admin

In the /etc/hosts file: admin

And I can always get to my phpMyAdmin install by simply typing http://admin into the browser.

The reason http://admin works is because most operating systems (even Windows!) will look at the local hosts file first before requesting information from DNS servers. Apache is told to handle requests to http://admin through the Virtual Host we set up. And all of this is done without www’s or .com’s.

By now you should realize that you can add as many Virtual Hosts as you like for as many sites as you need. All you need is these three commands:
$ mate /etc/httpd/users/yourname.conf
$ mate /etc/hosts
$ sudo apachectl restart

This can also be done on Windows, but it takes a little more work, and would of course work the same as described above on Linux/UNIX. If anyone would find it useful, let me know and I’ll post a new tutorial on the same method for Windows developers.

Show Hidden Files in OS X’s Finder

In web development on the Apache web server, a common configuration file used in nearly every site we build is the .htaccess file. But in OS X, you can’t see it in the Finder – hidden files (files which start with a dot “.”) are unavailable unless you use the Unix command line. I did some digging around and found a way to enable hidden files in the Finder – which, ironically involves using the command line to get there.

Open the Terminal application (or, I much prefer iTerm) and type the following:
defaults write AppleShowAllFiles TRUE
and after hitting return, follow it up with
killall Finder
which restarts the Finder and shows all files.


To revert back to hiding those files, simply run the same command above again but change TRUE to FALSE

Tell Your iPhone to Stop Opening iPhoto!

Every time I plugged in my iPhone, it had this nasty habit of opening iPhoto for me. Not because it wanted to drive me to drink, but because iPhoto is set to open any time a digital camera is connected to my computer – which, technically, an iPhone is.

To stop this behavior, you won’t find any preference in iTunes or iPhoto, where you would normally think to look. This little gem can be found in a separate application in your Applications folder called Image Capture.

Open Image Capture and go to the Preferences menu (under the Image Capture menu item). Under the General tab, change the option for “When a camera is connected…” to “No Application” instead of “iPhoto”.


This means you’ll have to manually start iPhoto when you connect your digital camera, but you won’t have to CLOSE iPhoto every time you plug in your iPhone (which, for me, is a heck of a lot more often than plugging in a camera!)

Enable mod_rewrite on OS X 10.4 (Tiger)

Tiger has introduced a new super-confusion level to the stock configuration of Apache. In addition to the httpd.conf file in the /etc/httpd directory, there’s now a new users directory as well. That directory holds unique config files for each user of the machine. So, if you were to enable mod_rewrite or AllowOverrides in httpd.conf, you may find that it doesn’t quite cut the mustard in your personal Sites directory. Let’s take a look:

To enable mod_rewrite:

  1. Open /etc/httpd/httpd.conf
    (I highly recommend TextMate – from the command line you can simply type this:
    $ mate /etc/httpd/httpd.conf
    or use the old standards: vi, vim, whathaveyou)
  2. Go to line 223 (if your config file just so happens to jive with mine) and uncomment the following line:
    LoadModule rewrite_module libexec/httpd/
    (mind the wrap)
  3. Go to line 267 and uncomment the following line:
    AddModule mod_rewrite.c
  4. Scroll down to line 408 and change the line to read:
    AllowOverride All
    (Some server admins will tell you this may not be the best idea for hosting a live site, but I’m assuming you’re using this for local development only, right?)
  5. Uncomment line 454:
    AccessFileName .htaccess
  6. Restart Apache:
    $ sudo apachectl restart

At this point you should have mod_rewrite happily fixing your ugly URL’s in the /Library/WebServer/Documents directory, but it’s not working in your /Users/you/Sites directory. What gives? Here’s the trick:

  1. Open the yourname.conf file in the /etc/httpd/users folder.
  2. Change the first two lines to this:
    Options All
    AllowOverride All
  3. Give Apache another bounce:
    $ sudo apachectl restart

You should now be seeing friendly url’s in your very own Sites directory.