Posted on February 9th, 2015
Brett Terpstra and I both worked at TUAW together, before Brett left a few years ago to do his own thing. Christina Warren had left before I started there, but we’ve “known” each other on the Internet for several years.
Around the the 4m14s mark, Brett said this:
People like TJ Luoma always wrote completely original [articles]… you wouldn’t find this kind of “how to” anywhere else, because he was insane with the stuff he could make his Mac do [with] scripting and everything. To me, that was the heart of why I would read TUAW.
The stuff Brett can do with a computer makes me feel like I’m playing with LEGO bricks and toys by comparison, so this was a nice compliment.
Reminds me of the time that I emailed Peter N Lewis (developer of Keyboard Maestro) about a Keyboard Maestro macro I had created…to backup my Keyboard Maestro macros. His email reply began with this line (shared with his permission):
Let’s start by saying that is either very impressive or completely insane.
If I ever have business cards made up, I might have to use “either very impressive or completely insane” as my tagline.
Posted on February 9th, 2015
My last article for TUAW was BitTorrent Sync gives you the flexibility to sync anything, which included a farewell Easter egg. However, I didn’t have the time to explain a lot of what I use BitTorrent Sync for, which is what I want to do now.
The first thing I did was setup syncing for the standard OS X folders:
If you’re a Mac geek of a particular type, you are probably wondering if you can sync your ~/Library/Preferences/ and ~/Library/Application Support/ folders. I definitely would not recommend that, as I think it is just begging for trouble later on. However, there are a few sub-folders in there that you might want to sync.
~/Library/LaunchAgents/ - I sync my LaunchAgents folder, but I use the .sync/IgnoreList feature to not sync any file that begins with com. That actually prevents most from syncing automatically, but the ones that I make and do want to sync I prefix with sync.com.tjluoma. so I’ll know those will sync to all of my Macs (I hinted about that in Keep Desktop Clean By Name).)
~/Library/QuickLook/ - This keeps my QuickLook
.qlgenerator files sync’d together, and I have a sync’d LaunchAgent
plist which watches ~/Library/QuickLook/ and runs
/usr/bin/qlmanage -r whenever it changes.
~/Library/Application Support/Screen Sharing/ - I sync this to keep my Screen Sharing .vncloc files in sync across my Macs.
/Library/Caches/Homebrew/ - I use Homebrew on all of my Macs and tend to install the same packages everywhere, so I sync the cache folder so I don’t have to re-download the packages for each Mac.
~/.ssh/ - This one will be controversial to some people who worry about security and who are right now terrified at the idea of someone managing to get into my ~/.ssh/ and muck about with it. But the reality is that my life is boring and no one is likely to ever try to do that, and it’s convenient to have my
authorized_keys sync’d. I added
id_rsa* to the ~/.ssh/.sync/Ignorelist so my private key doesn’t actually sync.
Folders Which Do Not Sync Well
I tried syncing ~/Library/Safari/Extensions/ to keep my Safari extensions in sync, but Safari does not like that, and seemingly refuses to recognize new extensions which are added directly to that folder. (This is probably a security feature, in that it prevents some malicious installer from putting something in there which will take over your default searches, or something like that.)
I also tried to sync /usr/local/ because I generally install the same Homebrew things on each computer. That did not work well either, and I recommend avoiding it.
If you use a database app like DEVONthink I would make sure that its database is not stored in ~/Documents/ because I am not sure that it would handle syncing well.
Likewise, I would not recommend keeping your iPhoto library in ~/Pictures/ if you are going to sync it. Ditto for iTunes in ~/Music/. I moved my iTunes files to ~/iTunes/ ages ago because it didn’t make sense to keep it in ~/Music/ when it also includes TV and Movies.
Syncing to Dropbox
I keep Dropbox running on my MacMiniColo machine, and I sync my BTS folders to that machine too, which means that I do not have to worry about my BTS folders not being available for some reason.
I use and love SendToDropbox which is a great way to email files to your Dropbox account. SendToDropbox saves those files to ~/Dropbox/Apps/Attachments/ so I sync that folder (using BTS) to my other Macs. I never really liked the name “Attachments” but using BTS I can name the folder whatever I like, so I call it ~/SendToDropbox/.
All of my Macs share a ~/BitTorrent Sync/Torrents/ folder so I can save a .torrent file to it. On my MacMiniColo machine that folder is actually ~/Dropbox/Torrents/ and I have a Hazel rule on that Mac mini which launches Transmission whenever a new .torrent file is added to that folder. Transmission looks in that folder and automatically starts sharing the torrent.
This website is run on Statamic which uses plain text files for its configuration and posts. I sync that folder to my Macs so I can write/edit to my website from any of my Macs.
I have a nice short domain name which is conducive to making short URLs, and I wanted an easy way to add those. I wrote a shell script called 302.sh which lets me automatically add those entries to my site’s .htaccess file and syncs it to my website. The short URL for that script is http://luo.ma/302, naturally.
(The short URL for this article is http://luo.ma/BitTorrentSync.)
Automatically start (or restart) BitTorrent Sync
Because BitTorrent sync is a crucial piece of my setup, I have created a
launchd plist which will not only launch BTS when my computer starts up, but will also automatically restart it if it crashes.1
To install, first launch BitTorrent Sync.app, go to preferences, and be sure to turn off the option to have the app start at login. (That will be handled by
launchd now instead.)
Quit BitTorrent Sync.app before proceeding.
Once BitTorrent Sync.app is no longer running, enter these commands in Terminal:
mkdir -p ~/Library/LaunchAgents/ cd ~/Library/LaunchAgents/ curl -sfLO http://luo.ma/sync.com.tjluoma.bittorrentsync.plist launchctl load sync.com.tjluoma.bittorrentsync.plist
None of those lines will give you any feedback, but when you enter the last one, you should notice BitTorrent Sync launch.
I hope this helps give you an idea of the ways that you can use BitTorrent Sync to keep any folder on your Mac in sync with other Macs.
This launchd technique will work for any app that you want to automatically restart after a crash. Just replace
foois the name of the app that you want to keep running if it crashes. I also have a similar one for Dropbox on my MacMiniColo machine. ↩
Posted on February 7th, 2015
Duet Display runs on the Mac and on your iPad, and allows you to use your iPad as a second monitor. Now, that might not seem very exciting, because there are lots of apps which let you use your iPad as a second display, but the Duet is different and better. Instead of using a Wi-Fi connection, like most, Duet Display uses your iPad’s USB cable (either a 30-pin or lightning cable).
The result is that the connection is very fast with no lag.
Pair it with the SideCar — a nifty little piece of plastic that holds the two of them together (see yellow arrows below) — and you get something like this:
Automating launching and quitting Duet on the Mac
Most people would probably set Duet on the Mac to simply launch when you log in, but unless you use it all of the time, that’s not necessary. I try to avoid launching apps on login unless I absolutely have to, so I do something else.
Using Keyboard Maestro I can have Duet for Mac launch whenever my iPad is connected via USB. That looks something like this:
and Keyboard Maestro will quit Duet automatically when the iPad is disconnected:
Duet Display iOS app is $15. (Well worth the price, IMO.)
Duet Display for Mac is free.
- My Keyboard Maestro macros for Duet.
The SideCar is optional. You can use whatever iPad case or stand you want.