MarcoPolo is a very cool little GPL-licensed application that allows you to define different contexts (which are often locations) and switch between them based on fuzzy rule matching. The rules are based on evidence like what WiFi access points are nearby, what monitor your are connected to, what USB devices are attached, etc. When switching to a context, MarcoPolo can perform a variety of actions, like changing the default printer, changing your iChat status message, etc.
So the most common usage pattern is to create contexts for the different locations you use your computer, use the rules to detect your location, and then set up actions you want to take when you arrive or leave a location. Very cool stuff, and it’s open source too boot!