Featured post

Startup Gear for Indoor Rock Climbing

I’ve been fascinated with climbing for a long time. In college, I took a rock climbing class with my best friend. We were too broke to buy gear, so we ended up sitting in the cafeteria and dreaming big.

Fast-forward to having just turned 40. I realized that my body was converting itself into fat. I wasn’t overweight, but I no longer felt fit. My lifelong passion, snowboarding, didn’t keep me physically active year-round, and in Maryland the season was short. My wife and I talked about rebalancing our lives, like we rebalanced our spending every year. We decided to put more time into taking care of ourselves and less time into working overtime. (Hopefully nobody from my workplace will read this).

I took the kids to the local rock climbing gym, Earth Treks in Rockville, Maryland. The kids were instantly hooked and I was, too. A few weeks later I convinced my wife to try it, and although she resisted at first, she became hooked. It’s been four years, and we’ve never looked back.

Soon, we started buying our own gear. I scoured product reviews on Amazon, REI, Backcountry, Moosejaw, evo, and OutdoorGearLab. We’ve made some buying choices that turned out to be good, and others that turned out to be a waste of money.

I’ve explained here what worked for us and what didn’t. This is based on our experience and what we learned from our climbing friends. We don’t do systematic analyses like OutdoorGearLab. We don’t have the hundreds of reviews that Amazon has. But we will tell you what gear is like for us in real life.

1. Climbing Harness

Harnesses cost about $50. If you are set on saving $50, I know people who tie temporary harnesses with tubular webbing. But that’s time consuming, those harnesses are really uncomfortable and it’s hard to even go to the bathroom. Let’s not go there.

Harnesses come in two general flavors: padded, and unpadded. Padded are more comfortable, even on a top-rope. Because gyms use static ropes, even a short fall on a foot or two of slack is jarring. Padded harnesses are slightly more expensive and heavier than unpadded, and they are bulkier to store in your backpack, but weight and bulk are unimportant for indoor climbing.

The cheapest harnesses, and certain old-fashioned harnesses need for the strap to be double-backed through the buckle to create a secure lock. Double-backed harnesses are rare now since they’re being replaced by harnesses that don’t require double-backing, but there are still some around.

My family owns two Black Diamond Momentum harnesses and two Black Diamond Wiz Kid harnesses, which we’ve been perfectly happy with. These are inexpensive, padded harnesses that don’t need double-backing.


The kids getting their first harnesses. Making them smile like this is priceless. 10/6/12

We’ve seen many makes and models of harnesses in the gym. Nobody talks about their harness (although I have a friend who complains that his isn’t double-backed).

Buy any padded, double-backed harness that you like and don’t sweat your decision.

No matter what, you will need to replace your harness every 4-5 years, since the nylon eventually breaks down. Nylon breaks down faster if you let it get dirty, because dirt particles work their way into the nylon where they abrade the fibers. Nylon also breaks down if you leave it outside in the sun, because ultraviolet radiation yellows and damages plastics. Don’t store your harness or your other rock climbing gear near gasoline or paint thinner since the vapors  will dissolve nylon.

2. Locking Carabiner

You’ll need a pear-shaped locking carabiner for belaying. Biners last forever, so don’t be cheap.

Also, don’t bother comparing strength measurements, because all carabiners and other gear marked for rock climbing are designed to withstand at least 3,000 pounds of force or 15,000 newtons. At this amount of force the human body breaks into pieces. There’s no point to making gear stronger than this.

I really like the Black Diamond Magnetron VaporLock because it automatically locks when the gate closes and it’s very light due to its H-construction.

Another great choice that we’ve seen but don’t own is the Edelrid HMS Strike Screwlock which is a screwgate locking carabiner with a special clip that keeps your biner always in the correct orientation while belaying. Biners sometimes rotate during belaying, causing the stress to cross-load against the gate. Not only is the biner much weaker when cross-loaded, but in rare cases, the rope can rub against the gate and unscrew the carabiner.

3. ATC Belay Device

For an indoor gym with burly static ropes, you will want the original Black Diamond ATC.

OutdoorGearLab recommends the Black Diamond ATC-XP based on an over-cooked analysis. I believed them and bought an ATC-XP, but it’s too narrow, and pulling a burly (11+ mm) gym rope through it is exhausting. For outdoor climbing, the Black Diamond ATC-Guide is a more versatile choice because it can be used for multi-pitch routes.

Common sense says that a Petzl GriGri 2 should be a safer belay device than an ATC because it auto-cams. This is helpful if you don’t trust your belayer, or if you take huge leader falls, or if your friend hangdogs for hours on end. We own one, but again, with a 11+ mm gym rope, the GriGri is so tight that we almost can’t get our kids down from the climbing wall.

4. Climbing Shoes

For climbing shoes, I immediately recommend the super-comfortable, moderately high performance La Sportiva Mythos which come in a wider men’s Mythos and a narrower women’s Mythos.

Shoes come in three materials: old-fashioned unlined leather, synthetic, and lined leather. Old-fashioned unlined leather shoes are the most comfortable and, after they break in, they fit like gloves. They also breathe well. But, they stretch terribly, so they are difficult to size correctly at the store, and you can’t return stinky shoes six months later and explain that they didn’t break in as expected. Synthetic shoes don’t stretch at all so they are easy to fit at the store, but they quickly develop an ungodly stench that will clear your home of friends and family (sadly, the cockroaches will stay, and the stink bugs will try to mate with your shoes). Lined leather shoes are the best of both worlds and are the most expensive: they stretch less than unlined leather and are easier to size, but they do stretch just enough to offer a customized fit. They also breathe and don’t smell like death, at least not quickly.

Shoes come in two shapes, called ‘trad’ and ‘aggressive’. Trad shoes, named for trad climbing where they are most popular, are flat-footed and more comfortable. Outdoor climbers need to keep their shoes on for long periods of time, especially if they are climbing multi-pitch. Aggressive shoes have a pointy toe, downturned sole and a narrow fit. They are usually uncomfortable if not downright painful, and are used for competitive climbing or bouldering.

You don’t want to start climbing with aggressive shoes. They can turn people off from the sport and make going to the gym a miserable experience. I’ve bought uncomfortable shoes and hated them, and I’ve watched my wife and daughter complain that their feet hurt. Every complaint caused me to experience pangs of sympathetic pain. You won’t need aggressive shoes until you are reliably sending at least 5.10a, if not higher. I know people who are sending 5.11s in comfortable trad shoes.

For a beginning indoor climber, I can’t recommend the men’s Mythos or the women’s Mythos enough. OutdoorGearLab rated these the most comfortable shoes on the market and they are good performers. Look around at the gym and you will see Mythos everywhere. These are shoes that most people can leave on their feet for hours, and they don’t build up stink too quickly. Even after you’ve advanced to aggressive shoes, you’ll want to keep your old Mythos for outdoor climbs.

Our family owns three pairs of Mythos. We’ve resoled two of these pairs.

The hardest thing about Mythos is sizing them. They are unlined leather, so they will stretch up to a full size. They also come in European sizes, and the conversion between European sizes and US sizes is inexact. This is what I recommend:

First, find your size on the ruler below from La Sportiva, which is more exact than using a table. Are you tight or loose in your typical US size? I am a little tight in a US size 10, and a little loose in a US size 10.5. Using this ruler I can see that my exact European size is close to 43.5.


Second, subtract up to (but not more than) one European size from this size.

If you are a woman with wide feet, you might want to order the men’s Mythos, which are a little wider than the women’s.

One last word on the topic of shoe stink. Even with leather shoes, you will have some stink. You could wear thin socks, which would help. We wear our shoes barefoot, like most climbers. We spray our shoes after every climbing with the enzyme-based McNett Mirazyme Odor Eliminator and that works well. We pour this into a cheap spray bottle that we bought from Amazon. I think that any enzyme-based pet store odor eliminator would probably also work, although the McNett products are geared toward exercise equipment and may contain different enzymes.

I hope this helps someone. Climb on!

Startup Gear for Outdoor Rock Climbing at Carderock and Great Falls

When I started climbing outdoors, I’d just finished Earth Treks’ Top Rope Systems I course. I was excited and wanted to start climbing outdoors right away! I didn’t know what to buy, so I just bought whatever made sense at the time.

Now I know. I want to share my personal experience, and also what I’ve learned from friends. This is stuff I wish I knew when I started out.

I climb at Carderock, MD and Great Falls, VA, where top-rope anchors are set using burly static line wrapped around trees and large boulders.

1. A 40-50 m Climbing Rope

There are a few kinds of climbing ropes. REI has a nice article about ropes. You want an all-around single climbing rope. These are dynamic ropes that are 9.5-10 mm in diameter.

Dynamic climbing ropes stretch about 30-40%  when someone falls. Obviously, this is great for lead climbing, but it’s also a good thing for top-roping. Because of the stretch, they don’t shock-load the anchor when someone falls. This means less damage to tree roots and less chance of loosening a boulder above. You can also give more slack when belaying.

Single climbing ropes come in different thicknesses from 8.9 to 11 mm. I thought that this seemed like a tiny difference in size, but a 8.9 mm rope feels like spaghetti in my hands and a 11 mm rope feels like thick steel cable. A skinny rope is somewhat lighter to carry, which is a good thing when when hiking two miles uphill to get to Annapolis Rocks. Ropes have always been the heaviest and bulkiest things in my pack! The tradeoff is that skinny ropes are slicker to belay with and they have less abrasion resistance if they rub against the rock.

How thin should you go? If you’re concerned about weight, it’s more efficient to go short, before going skinny. A rope that is 10 m shorter is going to be lighter than a longer rope, even if the longer rope is skinny. Another benefit to a shorter rope is that they don’t tangle up as much and are quick to coil and flake.

My rope is also dry-coated to resist water and dirt. Why is that important? I’ve read that when water gets inside a rope, wet ropes lose up to 70% of their strength and become damaged if you try to use them while they are wet. Sharp sand particles work their way inside and nick the fibers. So, dry ropes last longer and can be safer. They belay more smoothly. They are a little more expensive, but I think they are worth it.

My family owns the now discontinued Mammut SuperSafe, which is a 10.2 mm workhorse rope that was marketed for being resistant to cuts. It’s great, but when we bought it, it was 60 m and heavy! After climbing in this area for a while, I realized that I only needed 40 m, so I cut 10 m off of each end of the rope (to preserve the middle marking). This cut down a great deal on its bulk and weight, and it’s now faster to flake and coil, and it doesn’t tangle up as much as it did before.

I think that you will be happiest with a climbing rope that is between 9.5 and 10 mm, which is the ideal thickness for most belay devices, but isn’t too slick. If I had to do it again, I would have gotten the top-rated 9.5 mm Mammut Infinity, which is skinnier and lighter than our 10.2 mm Mammut SuperSafe.

2. A Static Rope for Tying Anchors

Any burly (10+ mm) static rope will do. Canyoneering/rappelling ropes are static so these are fine.  You will need about 100 feet of static rope for Carderock/Great Falls.

REI sells static rope by the foot. Ask a salesperson to cut the length you want. Earth Treks also usually sells pre-cut static rope. Brian tells me that Sterling sells odd ends cheaper than REI.

Don’t buy rope at the hardware store! It is not designed for mountaineering and is much weaker than UIAA rated static rope.

3. Two to Four More Carabiners

You’ll need 2 carabiners for your climbing rope to slide through your top-rope anchor. You could use up to 2 more carabiners for finishing your knots at the top, if you like to tie figure-eights instead of bowline hitches. Plus, carabiners come in handy for attaching gear to packs, and things like that, so it’s hard to go wrong.

Biners last forever, so it doesn’t make sense to be cheap. We own and love Black Diamond Magnetron Vaporlocks. They are light and automatically lock, making them idiot-proof.

4. An Autoblock Cord

Falling from the top while setting up anchors is a common cause of death. This issue is personal for me. A friend of mine died looking over the lip before an ice climb. While finishing up your top-rope anchor, make sure you’re tied into the anchor with an autoblock cord.

Any 6-7 mm cordelette tied into a loop with a triple fisherman’s knot will work, but Brian and I both really love the pre-sewn Sterling hollow block loops in 19 in. They’re cheap, light, and do a better job of gripping the rope than cordelette.

If you buy two autoblock cords, then you’re all set for rappelling. The first cord will be your safety anchor. The second cord will be your autoblock in case you let go of your ATC during a rappel.

5. A Belay Device with Bite

It’s a little harder to stop falls outdoors than it is in the gym. You’ll be using a skinnier and probably a dry-coated rope that will want to slide through your ATC. Also, at Earth Treks, the rope wraps around the pulley at the top anchor twice, creating a hitch whenever the rope is loaded. You won’t have that extra help outdoors.

So, you will want a belay device with teeth. I think the ATC-Guide is a great choice. It’s versatile because it can also be used in guide mode for multi-pitch routes.

Another popular belay device is the Petzl GriGri 2, which automatically locks when the climber falls. My family owns one, but we never use it. It’s pretty heavy and it can’t be used in most rappelling situations. I would probably only use it if I was climbing with a friend that likes to hangdog for hours on end.

6. A Big Enough Backpack To Carry Everything

You will be carrying all of this, plus your shoes, your harness, at least a liter of water, and your lunch. Most people prefer to carry ropes inside of their bag rather than on top of it, if they can (but if their bag gets full, they secure the rope on top). This is a lot of gear, and a 15 or 20 liter backpack is not going to cut it. You will want a 30-40 liter crag pack.

A crag pack, which is usually the same thing as a summit pack, is different from a regular hiking backpack in that it is designed to be worn while climbing. Most crags involve some scrambling to access them. Crag packs are narrower than hiking backpacks and usually open only at the top.

I own the Petzl Bug, which is nice but at 18 L, it’s just too small to carry all my gear, so I don’t recommend it. (It might work if I divided the gear with a friend, though). Brian owns the Patagonia Cragsmith and says he is very happy with it. Black Diamond also carries crag packs and summit packs in different sizes.

7. Other things

I assume that you already own shoes, a harness, and a carabiner for belaying. See my post on gear for climbing indoors.

You probably want a helmet. People don’t use helmets at Great Falls and Carderock because there’s not much loose rock that could fall on climbers below, but if you move out to other crags, a helmet is a must.

I think you’d really like approach shoes, if you are willing to spend the money. These are sneakers or hiking boots with rock climbing rubber soles, so they make it easy to scramble around the crag without worrying so much about slipping. People say you can climb 5.9 in them. I’m not that awesome but I’ve climbed 5.6 outdoors in mine. La Sportiva and FiveTen are the major manufacturers of approach shoes. I have FiveTen Camp Fours and am happy with them.

You might want a rope tarp to keep your rope a little cleaner. I think these are much more useful than rope bags, because tarps are both cheaper and pack down smaller. I bought a rope bag that was well-reviewed, but I wish I hadn’t.

It’s nice to have a water bottle with a loop on it to clip into your harness.

8. What Not to Buy

Slings, runners, and tubular webbing can come in handy, but you don’t need them at this point. Tubular webbing is not as strong or abrasion-resistant as static rope.

Trad protection devices like nuts/chocks and cams/friends are often used for building anchors at other crags, but they are not a good idea at Carderock and Great Falls because the schist rock lining the Potomac is both friable and slippery. Protection either breaks out of the rock or slips out. We stick to using trees and boulders for anchors.

You don’t really need a rope bag, as I mentioned above. A tarp is both cheaper and packs down smaller.


Installing a MySQL server on Mac OS X 10.10 Yosemite or 10.11 El Capitan with or without Server

Apple recently phased out MySQL in favor of PostgreSQL.  There are still valid reasons why we might prefer MySQL, such as compatibility with legacy code.

Here are my instructions on how to install MySQL as a permanent service on OS X. These instructions work with or without OS X Server installed. For the most part, installation is straightforward, but read this carefully because there are gotchas where it comes to file permissions.

I’ve tested these instructions several times on OS X 10.11 El Capitan and 10.10 Yosemite. I think these instructions will probably work on 10.8 Mountain Lion and 10.9 Mavericks.

Backup your MySQL databases.

You want to back up your MySQL databases before doing a OS X upgrade. The easiest way is to create a mysqldump file. Databases can also be restored from data files, but this is harder and I don’t recommend it.

$ mysqldump -uroot --all-databases > ~/Desktop/dump_all.sql

Install or upgrade OS X.

According to your plan.

Download Xcode from the App store and install the command line tools.

Xcode is a dependency for Homebrew, which uses Xcode’s gcc compiler to compile everything from source. Once you have Xcode installed, you need to install the command line tools for the gcc compiler to work. From Terminal:

$ xcode-select --install

Check the systemwide PATH variable.

Open a Terminal window:

$ cat /etc/paths

Make sure that /usr/local/bin occurs before /usr/binIf they don’t, then you need to change this order. Edit /etc/paths using vi or your favorite text editor. I love and use TextWrangler. Close your Terminal window and open a new Terminal window for this change to take effect.

Obtain Homebrew. 

Homebrew is a great package manager for OS X that installs everything in /usr/local/bin and does not require sudo.It then symlinks to the expected locations so that the packages can find one another. Because the packages are centralized in the Cellar, they are easily updated and removed.

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Fix any problems that Homebrew detects.

$ brew update
$ brew doctor

Follow brew doctor‘s instructions. brew doctor usually complains about Xcode. If I’m guessing the error correctly, here is the solution that brew doctor will suggest (assuming OS X 10.10 – note the version since this affects what you will type into Terminal):

$ cd /Applications/Xcode.app/Contents/Developer/Toolchains/
$ sudo ln -s XcodeDefault.xctoolchain OSX10.10.xctoolchain
# note the version (10.10) and modify accordingly.

Run brew doctor again. Continue to follow brew doctor‘s instructions until it tells you that “Your system is ready to brew.”

Install MySQL.

$ brew install mysql
# ignore homebrew's instructions to symlink the .plist file!

Homebrew has just installed MySQL to run under the current user, which is not what we want for our server, but we will get to that in a moment. First, we will test the mysqld service to see if it launches. In newer versions of MySQL, the command to launch the service is $ mysql.server start.

$ mysql.server start
$ mysql.server stop 

Modify the .plist file to improve logging.

Using vi or your favorite text editor, modify the .plist file.

$ vi /usr/local/opt/mysql/homebrew.mxcl.mysql.plist
# use vi or your editor of choice 

Add these lines within the <dict> block:


Set up the MySQL service to launch at boot time as part of a server.

Homebrew’s instructions, which I asked you to ignore, would have installed a LaunchAgent for your current user account, so that the mysqld service would start whenever you logged in. This would work great for a personal development machine, but it’s not not ideal for a server.

For a server, what we want is for mysqld to start up at boot time by the root account. So, we need to make two changes:

  1. the .plist must link into /Library/LaunchDaemons and have the appropriate permissions to be launched by root.
  2. the mysql database files in /usr/local/var/mysql must all be owned by  _mysql. You might wonder why the owner must be _mysql, since the server starts up as root. This is because whenever mysqld detects that it is being run as root, the process steps down to user _mysql as a security measure. This is typical behavior for services. Apache, for example, steps down to user _www.

Open a Terminal window, and enter:

$ sudo ln -sfv /usr/local/opt/mysql/*.plist /Library/LaunchDaemons
$ sudo chown root:wheel /usr/local/opt/mysql/*.plist
$ sudo chmod 600 /usr/local/opt/mysql/*.plist
$ sudo chown -R _mysql:wheel /usr/local/var/mysql

Important: Now that mysql belongs to root, do not run the $ mysql.server command again! Don’t do it. This will result in an aborted launch with permissions errors. You will need to delete the resulting .pid files in /usr/local/var/mysql before mysqld will be able to run again, even as root. Again, don’t do it.

Verify that the MySQL service starts up at boot time.

We will reboot the server machine. At boot time, launchctl should load our modified .plist and run mysqld. We will then run the mysql command from Terminal to interface with the mysqld service and verify that it’s running.

 $ sudo shutdown -r now

After the machine restarts, re-enter Terminal and type:

<pre>$ mysql -uroot 

If the mysql command fails, then we know that either the LaunchDaemon didn’t kick in, or that mysqld failed to start successfully. Again, if this happens it is usually because of a permissions issue. To troubleshoot, check the log files at:


Restore your MySQL databases.

$ mysql -uroot < mydumpfile.sql
$ mysql_upgrade

A full dump from a recent version of MySQL should successfully restore all databases plus the privilege table, which controls users. If there are problems with the privilege table after restoring, then edit out the privilege table from your mysql dump file, and re-create your users manually using a tool like phpmyadmin.

I hope this post helped someone. Happy monkeying!

The best all-purpose snowboard wax

Snowboarders are always getting stuck on the flats and the catwalks. There’s no way around it other than hitching a pole-tow from a skier friend or bringing your own telescoping pole.

But one thing that helps, a lot, is if we have the right wax and don’t scrub speed. I have been waxing my board ever since I started riding. I started out using XXX Adult Snowboard wax, which was this awful glue that probably only sold well to impressionable early-20s males like myself who were trying too hard to look cool. I’ve used rub-on paste waxes, liquid waxes, and fluoro and unfluoridated iron-on waxes. I’ve applied wax using a heat gun based on this cool blog post.

One time, on a dare, I applied KY jelly to the bottom of my board.

After 20+ years of experimentation, I’ve found that black waxes are the ones that work the best across the most conditions.

Black waxes are regular waxes with graphite added. They were originally used for late spring snow, which is covered with pollen. The graphite prevents static cling to the pollen. Because dry powder also behaves like pollen particles, black waxes are excellent on powder days, too. In between the extremes of cold powder days and warm slushy days with pollen, the universal wax base of the black waxes has good glide.

Over the last few years, I’ve been using Swix Moly Fluoro Wax. Although technically a base wax for ski racing, it gives great glide. The toxicity of fluoro waxes bothers me, so I would like to switch to an eco wax if I can. Next season, I’m going to try an eco graphite wax like Purl to see if I can get good enough results.

By the way, the KY jelly was slick for about three minutes. Isn’t that as long as it’s supposed to last?

Fancy html mail signatures in OS X Mail

I wanted to set up a nice html signature for OS X’s Mail app, but the editing options in the Preference > Signatures pane of Mail are painfully limited. Also, even after discovering that I could use cmd-T to change fonts, I found that the fonts that I chose didn’t always display correctly. There was also no way to add <img> tags directly in the Mail app. Obviously, I needed to be able to edit the source HTML directly. Here’s how to do it.

Create a draft signature.

Open Mail. Go to Preferences > Signatures, and create a new signature. Type in some draft text. This creates a file that you can find again through Terminal.

Find your draft signature file through Terminal.

Open Terminal, and type:

$ cd ~/Library/Mail/V2/MailData/Signatures
$ ls *.mail-signature

Edit your signature file in your favorite editor.

I love and use TextWrangler, but you could use vi or any other editor.

If you have multiple signatures, you might need to open each file until you figure out which one to edit.

Consider locking your signature.

I don’t do this, but you might want to. OS X will sometimes change some aspects of your signature to match the font of the rest of your email. This might help you or hurt you, depending on how complicated your signature is. You can lock your signature either through the UI, or in Terminal with this command:

$ chflags uchg *.mailsignature

Restart mail.app.

Your signature should now work.

For including images, it’s better to load the image from a permanent location on the web using <img> tags instead of attaching an image file to each email. This cuts down on the size of each of your emails, sparing your outbox and your recipients’ inboxes. Also, it prevents your email from being flagged in recipients’ inboxes as containing an attachment when in spirit, you don’t have one.

Good luck!

I didn’t come up with all of this on my own. I acknowledge:

Our Carderock guidebook on rakkup!

Brian Florence and I recently did a first edition Carderock guidebook on rakkup as a labor of love. The rakkup app works on iPhones and Android. The app is free on the Google and Apple stores. Our guidebook is an add-on purchase for $5.99.

Check it out!

This winter, when the leaves are gone from the trees, we will be busy taking new photographs for the second edition. After that, we are debating whether we should also publish a print version.

I think rakkup has the right idea for the future. Nobody wants to throw a heavy guidebook into their crag pack, which is already full of important things. But, everyone keeps their cell phones on their body, no matter what.

And, because the rakkup app uses the phone’s GPS, it navigates to crags in a way that a print guidebook can’t.

Climb on!

Syntax highlighting for Mac OS X Mail and applications

Code is a lot harder to read without syntax highlighting, and I needed highlighting for emails and presentations. So, I cobbled this solution from what I could find on the net. This OS X service allows me to select and highlight text in many OS X applications. It works for Pages, Keynote, and Apple’s Mail. It does not work, as written, in Microsoft Office, although you can still copy highlighted text from Pages to Word or PowerPoint, or perhaps modify this script to make it work in Office.

You will need two things to get this service working on your computer. First, download and install a command-line based syntax highlighter. Second, you need to set up an Automator workflow, to enable the service itself.

Install a command-line highlighting utility.

I use highlight. A strength of Pygments is that it can auto-detect languages, while highlight does not. But, Pygments often doesn’t guess the correct language if the highlighted code is short, because today’s popular languages use highly similar syntax.

I installed highlight using Homebrew:

$ brew install highlight

To install Pygments:

$ pip install pygments

Create your Automator workflow.

Open Applications > Automator. Choose “Service” as your new workflow type. Choose “Run Applescript” as your one and only action. Above this action, you will see some options. Set this workflow to receive text in any application. Do not check the box that says ‘Output replaces selected text’ because then this script won’t work.

Copy and paste this code.

In your run Applescript box, copy and paste:

-- inspired from http://apple.stackexchange.com/questions/94222/how-to-get-automator-to-treat-text-as-rtf/94246#94246

-- limitation: does not auto-detect syntax (which is iffy with short sections of code, anyway); therefore this action is limited to Python syntax

on run {input, parameters}
        set old to the clipboard as record
    end try

-- the tr function is necessary because some applications copy rtf as OS 9 CRs instead of Unix LFs.

    do shell script "echo '" & input & "' | tr '\\r' '\\n' | /usr/local/bin/highlight --syntax=Python --out-format=rtf  --style=edit-matlab --font=courier | pbcopy"

--do shell script "echo '" & input & "' | tr '\\r' '\\n' | /usr/local/bin/pygmentize -l python -f rtf | pbcopy"

-- copying and pasting via the clipboard necessary because text replacement bypasses the word processor's automatic conversion of RTF

    tell application "System Events" to keystroke "v" using command down
    delay 0.5

        set the clipboard to old
    end try
end run

Save this service.

I use the name “Python Syntax Highlighting” but you can call your service whatever you want. Whenever you select text in any application, your new Service will appear on the menu bar as [Application] > Services > Python Syntax Highlighting [or whatever name you saved it as]

This service works well for programs that support RTF. I use it all the time in Keynote, Pages, and Apple’s Mail. It does not work in Microsoft Office, though, although it may be possible to modify the script above to make it work in Office. Good luck!