Throw out those Product Manuals!

I used to have a couple of boxes worth of product manuals stashed away in my house. I kept them just in case I needed had a problem and needed to look up the answer.

This eventually became unmanageable so I decide that I could easily do this more effectively on my Mac. Now, when I buy something that comes with the manual here’s what I do.

I search for the manual on Google. Try this search

kind:PDF BRAND and MODEL of your product

I download the manual to a folder on my Mac. For all PDF files I download it to a folder named 1 Scans. Why “1 Scans?” That folder is stored on Dropbox and I use it in a number of places. Putting a 1 in the filename ensures that it ends up at the top of a sorted list.

When I download the file, I give it a special name. I use the format YYYY-MM-DD Product Brand Name Manual.pdf

Then, I use the awesome application Hazel to process the file. It looks for any files in the 1Scans folder labeled “Manual”  and automatically file it away to a “Manuals” folder in my paperless office.

Finally, I toss the paper manual. Obviously, if you can’t find the manual online you should scan the manual.

Since I’ve done this I’ve rid myself of maybe a hundred different product manuals I accumulated over ten years and when I need to find something I search Spotlight rather than dig through a box in my garage. It’s a huge timesaver.

Re-run the Setup Assistant on OS X Mavericks

I recently needed to install OS X Mavericks on an old iMac. To make sure that everything was fine I ran the machine through the full Setup Assistant — setting up a user with my name in the process. Rather than reloading Mavericks on the iMac to clean it off, I did a quick Google search on how to get Mavericks to re-run the Setup Assistant, and I was lucky to find a post on the now defunct TUAW that describes the process.

If you hate using the command line it might be easier to reload OS X. If you’re feeling brave or do understand the CLI here’s how you can clean up your Mac and start back at the Setup Assistant:

Boot into single-user mode by holding down Command-S on the keyboard during startup

At the command-line prompt,

type mount -uw /
 rm -R /Library/Preferences
 rm -R /Users/YOURUSERNAME/  cd /var/db/dslocal/nodes/Default
 ls (to list the files)

Delete the file that is named after your user account with a .plist extension. For example, for user name “joe” you’d type rm joe.plist

rm /private/var/db/.AppleSetupDone

At this point, OS X restarts and the Setup Assistant launches automatically, initially asking you what language you want to set up the Mac in. Since you’re going through this entire dog-and-pony show to set up the Mac for a new user, you don’t want to run Setup Assistant again, so just press Command-Q at the language screen, then click the Shut Down button.

When the new owner boots up their shiny “new to them” Mac, they’re greeted with the Setup Assistant just as if they’d picked up the device at their local Apple Store.

How do I export images from Evernote and Skitch

Skitch is a Mac application that will let you quickly take screen shots of your screen. When Skitch first came out it was a brilliant application and made my life a lot easier. A few years ago Skitch was purchased by Evernote and ever since then I think it’s gone down hill.

I was an early Evernote adopter when I purchased my iPhone. The idea of having notes that would synchronize across my iPhone, desktop and laptop was really appealing to me. Overtime though I came to loathe it mainly because it’s a walled garden that doesn’t easily allow you to get your files out. Anything saved to Evernote from Skitch can’t be easily exported back to an image format from within Evernote.

Luckily, the one saving grace with Evernote is rich support for Apple Script. After a little Googling, I found a script by developer Chris Sauvé that goes through Evernote and extracts all of the images. The script itself had a bug in it, so like any self respecting hacker I cloned the Git repo and fixed it.

If you want to export your images here’s what you need to do.

Download the script from here. If you don’t use git, don’t worry, just click the “Download Zip” button

Extract the Zip file somewhere.

Open up a Terminal window and change directory to the evernote-extractor directory

Run the following command: osacompile -o "Evernote Image Extractor.scpt" "Evernote Image Extractor.applescript"

This will turn the applescript into a binary that you can then run in order to extract your images.

Now, run the compiled binary by typing osascript "Evernote Image Extractor.scpt"

Fixing AppleTV Jailbreak playback errors

apple-tv-overview-4I love my 2nd Generation AppleTV. Sure, it doesn’t have 1080p but for the money (it was a gift) it sure is awesome.

The first thing I did with my AppleTV was jailbreak it. Once jailbroken I could install the PlexTV client. This allows me to stream any content from my Mac to the AppleTV. What I do with this is the subject of another post.

However, the AppleTV isn’t perfect. Recent versions of either the AppleTV software or the Jailbreak software causes periodic playback errors when playing back content from Netflix or the PlexTV client.

The only way to fix these errors is to reboot the AppleTV. This is a pain to do when ready to sit down and watch something. The obvious solution? Schedule reboots with launchctl.

Launchctl is a swiss army knife utility that replaces a number of Unix utilities including CRON.

LaunchCtl Script

LaunchCtl scripts are Property List files. These are just specially formatted XML files saved with the extension .plist

Navigate to your /Library/LaunchDaemons folder on your AppleTV, open up the nano editor and type the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

<!-- reboot every day at 3:12am -->

If you’ve never seen a launchctl script before this might seem like gibberish.

LaunchCtl scripts consist of key value pairs indicated with . Most of it is boilerplate. I’ll talk about the ones relevant to us here.

  • Label – this argument matches the name of the plist file. You can call it whatever you want, you just need to give the plist file the same name. In this example, the plist file name is com.joe.reboot.plist
  • ProgramArguments – this takes a string indicating the path and filename of the program that needs to run.
  • StartCalendarInterval – this takes a dictionary with date and time information. In this example I set Hour and Minute and ignore any of the other date keys.

Save all of this as a plist file.

Load the plist file

The next step is to load the plist file into launchctl. Type the following in the console:

launchctl load /Library/LaunchDaemons/com.joe.reboot.plist

Then, if you want to test your plist file you can type:

launchctl start com.joe.reboot

If everything works, you should get disconnected from the console as your AppleTV reboots.

There are a lot more things you can do with launchctl. This solved my network error problems while I wait for an update to the jailbrake tools.

If you have any cool uses for a jailbroken AppleTV, share them in the comments.

Never hunt for another OS X hidden setting or tweak again

One of the top posts on this site describes how you can adjust hidden Mac setttings using the command line. The problem with any type of article like this is it becomes grossly out of date soon after it’s written.

I stumbled across an application called Secrets today. With it, I’ll never need to search for another set of command-line tweaks again.

Secrets is a combination online database and OS X Preferences pane that has every possible OS Tweak that you might want to do to your system. A screen shot of it is here.

mac hidden settings tool

Cool app and database for all OS X hidden settings

Go to the Secrets website and check it out. If you’ve discovered a cool Tweak that you didn’t know about, let me know in the comments.

Of course, it goes without saying that mucking around with the hidden undocumented settings on your Mac could cause things to go bad real fast for you. Make sure you understand what you are doing before you start flipping switches!

Tweak on!