O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  



How do these hacks stand up? Comment on a hack from the book by choosing the associated "Discuss" link below. You can also view the code from any of the hacks by clicking on the "Listing" or "Code" links. A number of hacks have been selected to be featured online in their entirety; you may view those hacks by clicking on the hack titles that are linked.

You can also download all the scripts and other files for this book here.

Jump to: Files  | Startup  | Multimedia and the iApps  | The User Interface  | Unix and the Terminal  | Networking  | Email  | The Web  | Databases

Files

HACK
#1

Understanding and Hacking Your User Account
Before Mac OS X was released, there wasn't really a concept of a user or account in the Macintosh environment. This hack introduces you to what it means to have an account and what this business of a Home directory is all about. We'll also show you how to rename an account — a nonobvious task indeed.
[Discuss (174) | Link to this hack]

HACK
#2

Taking the Bite Out of Backup
With a confusing array of backup solutions for Mac OS X, we pick out a couple of our favorites: Apple's Backup and the open source, Perl-based psync.
[Discuss (4) | Link to this hack]

HACK
#3

Backing Up on the Go
Combining .Mac services with 802.11b connectivity provides some vital protection for current projects while on the road.
[Discuss (0) | Link to this hack]

HACK
#4

Dealing with Archives of Many Colors: .img, .sit, .tar, .gz
Back in the innocent days of OS 9, one compression format reigned supreme: Stuffit from Aladdin Systems. With OS X and its BSD Unix foundation, there's a whole slew of compression technologies available, all built into your default installation.
[Discuss (0) | Link to this hack]

HACK
#5

A Line Break Is a Line Break
A line break is a line break is a line break, except when it's not. Surprisingly, there are three different types of line breaks in the modern computing world, and OS X uses two of the three.
[Discuss (0) | Link to this hack]

HACK
#6

Fiddling with Type/Creator Codes and File Extensions
Mac OS X uses a combination of type and creator codes and file extensions to determine the application with which a file is associated.
[Discuss (0) | Link to this hack]

HACK
#7

Locking and Unlocking Files
For years, the Macintosh operating system has allowed you to lock a file or folder to protect against accidental deletion or modification. In OS X, you have that same ability, either through the Finder or the shell.
[Discuss (1) | Link to this hack]

HACK
#8

Stubborn Trash, Stuck Images, and Jammed CDs
Every so often it takes a little know-how to empty the Trash or eject a CD; learn when and how.
[Discuss (1) | Link to this hack]

HACK
#9

Aliases, Symlinks, and Hard Links
Poking about with aliases, symlinks, and hard links reveals some interesting entanglements in the merging of the Mac GUI and its Unix underpinnings.
[Discuss (0) | Link to this hack]

HACK
#10

Recent Filenames
Mac OS X has some tricky ways of remembering which files were used recently.
[Discuss (0) | Link to this hack]

HACK
#11

Inspecting the Contents of an .app Package
If you were an OS 9 fiddler, tweaker, or deviant, there was one piece of software you simply had to have: ResEdit, Apple's venerable, unsupported, use-at-your-own risk utility. ResEdit is no longer applicable under OS X, but package editing is.
[Discuss (0) | Link to this hack]

HACK
#12

Opening Microsoft Word Documents Without Microsoft Word
The text of any Microsoft Word document is readable with the greatest of ease thanks to a tiny, free utility and a little open source know-how.
[Discuss (1) | Link to this hack]

Startup

HACK
#13

Getting a Glimpse of the Boot Process
A lot goes on behind the scenes whenever you restart your Macintosh; verbose booting provides a unique glimpse of the Unix underpinnings of Mac OS X.
[Discuss (0) | Link to this hack]

HACK
#14

Booting from Another Device
Boot and run your Mac from another device, whether it's an internal hard drive or an external FireWire drive.
[Discuss (0) | Link to this hack]

HACK
#15

Turning Your Mac into a Hard Drive
Boot your Mac in target mode and treat it like just another FireWire drive.
[Discuss (11) | Link to this hack]

HACK
#16

Using Open Firmware Password Protection
Password-protect your Mac, blocking circumvention by booting from another device, booting into single-user mode, and more.
[Discuss (1) | Link to this hack]

HACK
#17

OS X for This Old Mac
Give your legacy Mac hardware a nudge into OS X with the XPostFacto hack.
[Discuss (0) | Link to this hack]

Multimedia and the iApps

HACK
#18

Top iChat Tips
iChat is more than just a great instant messenger client. Here is a collection of tips to get the most out of this fabulous addition to the iApp family.
[Discuss (0) | Link to this hack]

HACK
#19

AIM Alternatives
There are various feature-packed alternatives to the default AOL Instant Messenger client for Mac OS X.
[Discuss (0) | Link to this hack]

HACK
#20

Printing to PDF or Bitmapped Image
Printing to PDF or bitmapped TIFF image under OS X is built right in, available to almost any application with Print functionality.
[Discuss (0) | Link to this hack]

HACK
#21

Image Conversion in a Pinch
The ability to convert images from one format to another with minimal retouching and manipulation is built right into Mac OS X.
[Discuss (0) | Link to this hack]

HACK
#22

Top 10 iPhoto Tips
Yes, at first glance, iPhoto appears deceptively simple. But there's a Unix-compatible database lurking beneath that beautiful Aqua surface.
[Discuss (0) | Link to this hack]

HACK
#23

Make Your Own Documentary
Using only digital photographs, music, a $10 app, and what the iApps provide, you can put together a rather nice documentary.
[Discuss (0) | Link to this hack]

HACK
#24

From Slideshow to Video Presentation
Make a slideshow into a video presentation using the combined power of iMovie, iPhoto, and iTunes.
[Discuss (0) | Link to this hack]

HACK
#25

Hijacking Audio from Mac Apps
Audio Hijack grabs the audio output of any Mac OS X Cocoa or Carbon application for your listening pleasure.
[Discuss (1) | Link to this hack]

HACK
#26

Running Your Own Web Radio Station
Create private playlists you can stream 24/7 to almost any web-enabled device, inside or outside the home.
[Discuss (1) | Link to this hack]

HACK
#27

Sharing Your Listening Preferences
iTunes and a little hackery make sharing your currently playing track a snap.
[Discuss (0) | Link to this hack]

HACK
#28

Controlling iTunes with Perl
The Mac::iTunes module means that controlling iTunes from across the room or across the world is only a Perl script away.
[Discuss (1) | Link to this hack]

HACK
#29

iCal Calling iTunes
Wouldn't it be nice to choose tracks from iCal, reminding yourself to exercise with the inspiring theme from Flashdance?
[Discuss (0) | Link to this hack]

HACK
#30

Publishing and Subscribing to iCal Calendars
Publish your own iCal calendars on .Mac or any WebDAV-enabled web server for subscription.
[Discuss (0) | Link to this hack]

HACK
#31

Using Bluetooth for SMS and Phone-Call Handling
With Bluetooth-enabled cell phones and Mac OS X's Bluetooth support, you can send and receive SMS messages and handle cellphone calls right from your keyboard.
[Discuss (2) | Link to this hack]

HACK
#32

iSync via Bluetooth
Bluetooth means never having to plug in a cable when synchronizing your phone or PDA with your Mac.
[Discuss (0) | Link to this hack]

The User Interface

HACK
#33

Finding Your Way Back to the Desktop
Push that clutter of windows aside and get yourself back to your Desktop.
[Discuss (0) | Link to this hack]

HACK
#34

Alt-Tab Alt-Ternatives
While Mac OS X Jaguar markedly improved &command;-Tabbing your way between applications, there's still plenty of room for enhancement.
[Discuss (0) | Link to this hack]

HACK
#35

Putting Things in the Apple Menu
The FruitMenu haxie restores the ability to add favorite applications, folders, and other things to the Apple menu — and more.
[Discuss (0) | Link to this hack]

HACK
#36

Keeping Your Snippets Organized
DropDrawers is one of those applications you have to try to believe. It'll keep all those bits and bobs littering your Desktop neatly tucked away until you need them and helps stamp out stickies proliferation.
[Discuss (0) | Link to this hack]

HACK
#37

LaunchBar, a Dock Alternative
LaunchBar puts just about anything else you might want within easy reach from your keyboard.
[Discuss (0) | Link to this hack]

HACK
#38

DockSwap, Another Dock Alternative
Avoid Dock bloat with multiple configurable Docks.
[Discuss (0) | Link to this hack]

HACK
#39

Tinkering with Your User Interface
Beautify your Mac's look-and-feel with the freeware TinkerTool Preference Pane.
[Discuss (0) | Link to this hack]

HACK
#40

Extending Your Screen Real Estate with Virtual Desktops
Stretch your screen real estate up to 100 times its size and organize different views of your workspace with virtual desktop software.
[Discuss (1) | Link to this hack]

HACK
#41

Top Screenshot Tips
These screen-capture tips provide built-in and add-on solutions to just about anything you might wish to snap.
[Discuss (4) | Link to this hack]

HACK
#42

Checking Your Mac's Pulse
iPulse provides a quick, colorful overview of what's going on with your Mac's CPU, memory, drives, and network activity under the hood.
[Discuss (0) | Link to this hack]

HACK
#43

Screensaver as Desktop
Drive yourself to distraction by turning your Desktop into a flurry of color or an active slideshow.
[Discuss (2) | Link to this hack]

HACK
#44

Dipping Your Pen into Inkwell
Inkwell, Apple's handwriting-recognition technology, has the potential to put some of the joy back into writing by hand.
[Discuss (0) | Link to this hack]

HACK
#45

Speakable Web Services
Explore Mac OS X's speech recognition and its suitability for building useful, voice-driven commands that invoke external as well as local web services.
[Discuss (0) | Link to this hack]

HACK
#46

Using AppleScript in Contextual Menus
Ranchero's BigCat is a plug-in to Mac OS X, allowing you to run AppleScripts via a new Scripts item in your contextual menus.
[Discuss (0) | Link to this hack]

HACK
#47

Prying the Chrome Off Cocoa Applications
Metallifizer paints and strips the brushed-metal appearance of any Cocoa application.
[Discuss (0) | Link to this hack]

Unix and the Terminal

HACK
#48

Introducing the Terminal
This brief tour of the Terminal introduces you to some of the more basic commands required to find out where you are, move about, manipulate files and directories, and get back out again when you've had enough.
[Discuss (1) | Link to this hack]

HACK
#49

More Terminal Tricks and Tips
So many commands, so little time to learn them all. Here are a few more command-line tips and tricks that you are sure to find useful.
[Discuss (0) | Link to this hack]

HACK
#50

Becoming an Administrator for a Moment
Your Mac does its best to protect you from yourself and your family by requiring authentication, both in the GUI and on the command line, when you're about to do something potentially problematic.
[Discuss (17) | Link to this hack]

HACK
#51

Editing Special Unix Files
Special Unix files need special handling. You can't simply edit them in Word and expect things to work. Here's a crash course in editing using the pico command-line editor and TextEdit GUI editor.
[Discuss (0) | Link to this hack]

HACK
#52

Setting Shell Environment Variables
An environment variable is a magical piece of invisible data that is acted upon by shell programs and utilities that look for its existence. They're innocent enough and you rarely interact with them, but they can prove to be quite powerful and time saving when used as part of your daily lifestyle.
[Discuss (0) | Link to this hack]

HACK
#53

Scheduling with System Tasks and Other Events
The cron utility runs continuously in the background, taking care of scheduled system tasks and user requests at the appropriate time.
[Discuss (0) | Link to this hack]

HACK
#54

Opening Things from the Command Line
Why should you have to pop on up to the GUI to open applications, files, directories, and URLs when it's just as easy from the command line?
[Discuss (0) | Link to this hack]

HACK
#55

Introducing and Installing the Mac OS X Developer Tools
The Mac OS X Developer Tools are a treasure trove of developer applications, utilities, tools, and scripts vital to both developing for OS X and building open source applications from source.
[Discuss (0) | Link to this hack]

HACK
#56

Top 10 Mac OS X Tips for Unix Geeks
Author Brian Jepson offers the top 10 tips he gathered while working on O'Reilly's s.
[Discuss (1) | Link to this hack]

HACK
#57

Turning a Command-Line Script into an Application
What do you get when you combine the power of Unix scripting with the simplicity of the OS X GUI? A powerful droplet application limited only by your scripting prowess.
[Discuss (2) | Link to this hack]

HACK
#58

Installing Unix Applications with Fink
Apple's latest OS now gives you a wide range of software from two different worlds: our beloved Mac and open source. Thanks to utilities like Fink, installation is about as simple on the command line as it is in the GUI.
[Discuss (1) | Link to this hack]

HACK
#59

Mirroring Files and Directories with rsync
With rsync, supplied by default on OS X, quick mirrors and backups are a command line away.
[Discuss (1) | Link to this hack]

HACK
#60

Using CVS to Manage Data on Multiple Machines
Work with your data wherever you are without fear of getting out of sync with your home machine.
[Discuss (0) | Link to this hack]

HACK
#61

Downloading Files from the Command Line
Few Mac users know of the utility named curl, shipped with every 10.2 Macintosh, or of the easily installed wget. Both allow you to download from the command line — and with a little magic to boot.
[Discuss (0) | Link to this hack]

HACK
#62

Software Update on the Command Line
Just like it's pretty GUI counterpart, the command-line softwareupdate checks for updates to OS X itself and other associated applications, installing them upon approval.
[Discuss (1) | Link to this hack]

HACK
#63

Interacting with the Unix Shell from AppleScript
Via the do shell script AppleScript command or scripting the Terminal application itself, you can talk to the command line from inside AppleScript.
[Discuss (0) | Link to this hack]

HACK
#64

Running AppleScripts on a Regular Basis Automatically
Automating tasks with AppleScript has always been a powerful feature of the Macintosh operating system; but, until recently, automating tasks repetitively required new software. With OS X, repetitious automation is built in.
[Discuss (0) | Link to this hack]

HACK
#65

Running Linux on an iBook
This hack tells the story of a switch to Mac hardware without switching operating systems. It includes some handy hints and tricks picked up along the way while installing Debian Linux on an iBook.
[Discuss (0) | Link to this hack]

Networking

HACK
#66

Anatomy of an Internet Shortcut
Under the covers, an Internet Shortcut is a perfectly ordinary text file with little in the way of magic.
[Discuss (0) | Link to this hack]

HACK
#67

Renewing Your DHCP-Assigned IP address
On occasion, while ostensibly assigned an IP address by a local DHCP server, OS X doesn't appear to actually be on the network. Renewing your IP address often does the trick.
[Discuss (0) | Link to this hack]

HACK
#68

Sharing an Internet Connection
Turn your Mac into an Internet lifeline for those unwired systems around you.
[Discuss (0) | Link to this hack]

HACK
#69

Creating a One-Wire Network
A one-wire network can be a salvation when you're in need of a quick file transfer between laptops with incompatible parts.
[Discuss (2) | Link to this hack]

HACK
#70

Secure Tunneling with VPN or SSH
Mac OS X's built-in Virtual Private Network client and SSH offer two secure ways to tunnel in to your company or organization.
[Discuss (0) | Link to this hack]

HACK
#71

Remotely Log In to Another Machine via SSH
Interact with a remote machine from the command line via SSH, the Secure Shell.
[Discuss (2) | Link to this hack]

HACK
#72

Running Windows on and from a Mac
If you just can't do without running a piece of Windows software, there are a couple of options open to you: remote control and virtual PC emulation.
[Discuss (0) | Link to this hack]

HACK
#73

Sharing Files Between Mac and Windows PCs
Apple has incorporated technologies into Mac OS X that allow easy file sharing across platforms.
[Discuss (0) | Link to this hack]

HACK
#74

Mounting a WebDAV Share
Connect to a WebDAV-based network drive and work with remote content just as if it were on a local drive.
[Discuss (0) | Link to this hack]

HACK
#75

Mounting a Remote FTP Directory
Mount an FTP site right on your Desktop for perusal and easy downloading of files and turn on remote FTP access to your own Mac.
[Discuss (0) | Link to this hack]

HACK
#76

Exchanging a File via Bluetooth
Mac OS X 10.2's built-in support for Bluetooth wireless data means you have yet another way to exchange data with another Macintosh, PC, or mobile device.
[Discuss (0) | Link to this hack]

HACK
#77

Using Your Cell Phone as a Bluetooth Modem
Get online via your Bluetooth-enabled cellphone and AT&T's GPRS service with these comprehensive instructions.
[Discuss (1) | Link to this hack]

HACK
#78

Setting Up Domain Name Service
The most important step in bringing an Internet server online is making sure it can be found from the outside world.
[Discuss (0) | Link to this hack]

Email

HACK
#79

Taming the Entourage Database
Lurking beneath Entourage X's Aqua interface is a complex database handling all your mail and contact info. And, as with any other DB, you should back up and optimize on a regular schedule. Here's how to prevent email disaster on your Mac.
[Discuss (0) | Link to this hack]

HACK
#80

Using IMAP with Apple's Mail Application
Set up and use an IMAP-enabled mail account through Mac OS X's Mail application.
[Discuss (0) | Link to this hack]

HACK
#81

Setting Up IMAP and POP Mail Servers
There's tremendous value in having all your email with you at all times. Unfortunately, this usually means being tied to a particular mail client. IMAP allows you to have this particular cake and eat it too. This hack focuses on IMAP but installs POP along the way, since it's just so simple to do.
[Discuss (10) | Link to this hack]

HACK
#82

Getting sendmail Up and Running
sendmail is powerful, but at times it appears complicated too. Unravel the sendmail knot and you can configure this awesome mail server on your Mac OS X system.
[Discuss (3) | Link to this hack]

HACK
#83

Downloading POP Mail with fetchmail
You're running your own POP or IMAP mail server but don't have any way of getting your mail from your ISP to your local machine. fetchmail, a popular Unix utility, will fetch your mail for you.
[Discuss (0) | Link to this hack]

HACK
#84

Creating Mail Aliases
Email aliases direct mail sent to webmaster@, me@, and so forth to the right email address.
[Discuss (0) | Link to this hack]

The Web

HACK
#85

Searching the Internet from Your Desktop
Thanks to a collection of freeware and shareware apps and a few clever hacks, you can weave Internet search into the fabric of your Mac computing experience.
[Discuss (0) | Link to this hack]

HACK
#86

Saving Web Pages for Offline Reading
Save a single web page or even clusters of web pages in their entirety for reading on public transportation, at 35,000 feet, or anywhere else you happen to be.
[Discuss (0) | Link to this hack]

HACK
#87

Reading Syndicated Online Content
NetNewsWire is to syndicated content from weblogs, web sites, and online magazines as newsreaders are to Usenet news of old.
[Discuss (0) | Link to this hack]

HACK
#88

Serving Up a Web Site with the Built-In Apache Server
With the Apache web server under the hood, OS X is a web powerhouse right at your very fingertips.
[Discuss (0) | Link to this hack]

HACK
#89

Editing the Apache Web Server's Configuration
Wading through Apache's long configuration file isn't as hard as it seems when you know what to look for.
[Discuss (0) | Link to this hack]

HACK
#90

Build Your Own Apache Server with mod_perl
Go beyond the capabilities of the Apple-supplied Apache web server, building your own version with mod_perl for scalable web applications built in Perl.
[Discuss (0) | Link to this hack]

HACK
#91

AppleScript CGI with ACGI Dispatcher
It'd be a shame if you couldn't use AppleScript to automate web-serving tasks with Apache. 'Tis no shame; you can.
[Discuss (0) | Link to this hack]

HACK
#92

Turning on CGI
CGI scripts allow you to serve up dynamic content on your web site using a Unix-based scripting language like Perl.
[Discuss (0) | Link to this hack]

HACK
#93

Turning on PHP
PHP is a fabulous scripting language for beginners to try their hands at serving up dynamic web content.
[Discuss (0) | Link to this hack]

HACK
#94

Turning on Server-Side Includes (SSI)
Server-side includes (SSIs) allow you to include other files or dynamic content in your garden variety HTML document.
[Discuss (0) | Link to this hack]

HACK
#95

Turning on WebDAV
Share a space on your web server for remote file sharing and collaboration.
[Discuss (0) | Link to this hack]

HACK
#96

Controlling Web-Server Access by Hostname or IP Address
It's easy as pie to get Apache serving something exciting, but at times, the joy of a running web server needs to be curbed by the stern eye of security. We'll take a quick look at how to enable hostname or IP access control, creating a set of acceptance or denial rules for content we want restricted.
[Discuss (0) | Link to this hack]

HACK
#97

Controlling Web-Server Access by Username and Group
Controlling access by hostname or IP is great when you want to ensure that only a network or machine you recognize is accessing your site or to block that pesky web spider that rudely ignores your robots.txt file. It is, however, used less often than user-based authentication.
[Discuss (0) | Link to this hack]

HACK
#98

Directory Aliasing, Indexing, and Autoindexing
A few more Apache configuration hacks involving creating an alias to a file outside the normal Apache document hierarchy and customizing the look-and-feel of directory listings.
[Discuss (0) | Link to this hack]

Databases

HACK
#99

Installing the MySQL Database
Add the functionality of the most popular open source database server to the underpinnings of your Mac-powered web site.
[Discuss (1) | Link to this hack]

HACK
#100

Installing the PostgreSQL Database
The PostgreSQL database has good third-party support from developers and passes the ACID (Atomicity, Consistency, Isolation, and Durability) test. What more could you want from an open source database?
[Discuss (0) | Link to this hack]


O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.