How To: Install SVN on Mac

If you’ve open the terminal and run the “svn” command just to be told “-bash: svn: command not found” then do the following:

1) Install XCode
2) Open “Preferences” and click the “Accounts tab”
3) Add your Apple ID
4) Open the “Downloads” tab
5) Click the download link next to “Command Line Tools”
6) You  have SVN!

XCode Downloads

How-To: Preview Signature is Sideways

Preview IconThe signature function in Mac OSX Preview is awesome. Easy to use, easy to generate, its a great way to “digitally” sign documents. However there is a problem when people send you portrait documents that have been saved in landscape. When you try to sign them, the signature appears sideways!

Here’s how to solve it:
1) Open the PDF is Preview
2) Choose “File -> Print” from the Menu
3) Save as “PDF”:

Save as PDF4) Close the document
5) Open the newly created PDF
6) Choose the signature option – and it will appear the right way up!

How-To: Force VMWare Restart/Shutdown (Mac)

I love using VMWare Fusion on Mac, it’s perfect as I can run everything I need on one machine, and minimise my exposure to windows.  However, sometimes things go astray – windows “goes to sleep” and won’t come back to allow me to restart or shutdown the virtual machine.  How do you fix this?

Screen shot 2010-02-12 at 9.04.33 AM

Hold down the “option” key and then go to the “Virtual Machine” menu option. You’ll notice that the options switch from “Shutdown” to “Force Shutdown” when you hold down the “option” key.  Simply choose your required “Force” option and you should be back in business!

Objective-C: Calculating Days, Minutes, Hours from seconds

If you need to convert a total number of seconds into specific components (days, hours, minutes and seconds) in Objective-C, you can use this code snippet.  You can probably do this a million other ways, but this works beautifully for me:

    NSNumber *valueForDisplay = [NSNumber numberWithDouble:
              [self valueForDisplay:clockName]];

    NSNumber *totalDays = [NSNumber numberWithDouble:
             ([valueForDisplay doubleValue] / 86400)];
    NSNumber *totalHours = [NSNumber numberWithDouble:
             (([valueForDisplay doubleValue] / 3600) -
              ([totalDays intValue] * 24))];
    NSNumber *totalMinutes = [NSNumber numberWithDouble:
             (([valueForDisplay doubleValue] / 60) -
             ([totalDays intValue] * 24 * 60) -
             ([totalHours intValue] * 60))];
    NSNumber *totalSeconds = [NSNumber numberWithInt:
             ([valueForDisplay intValue] % 60)];

The above assumes that valueForDisplay contains the total value in seconds.  Enjoy.

How-To: Automatically sync your iTunes library with all your computers

I’ve come across a problem – my main computer (a MacBook Pro) has all my music on it, and is hooked up to my iPhone. But I’ve just got a nice big flat screen TV and its connected to my stereo. So I want to be able to play music/movies I buy on iTunes through my stereo and on my shiny new TV.

Unfortunately my laptop is used for work and isn’t always at home, so I can’t just share my library and play music etc over the air (this doesn’t work for movies anyway).  So I’ve come up with a solution that works really well, and is completely automated.

Continue reading “How-To: Automatically sync your iTunes library with all your computers”

OS X: Mail Tip – Speedy filing of emails from your inbox

In Mac Mail, I like to file all emails out of inbox when processed. But I have a huge folder tree to traverse to find where to move a messg to. I liked the right-click Move To menu, but its not fast enough.

My newly discovered solution:

1. Select message(s) to move
2. Click on the Help menu in menubar
3. In Search (which is selected already) just type some letters of the folder I want to move it to
4. Because of super-cool menu-search built into help, it it finds my folders matching, and down-arrow+enter does the move

Its fast. And faster if you use Help’s shortcut key (shift+command+?).

(Thanks to John C for this tip!)

How-to Fix: An invalid public movie atom was found in the movie.

Recently I’ve had a problem with Quicktime throwing up the following error when trying to play a video:

“An invalid public movie atom was found in the movie.”

I’ve searched everywhere for a solution, and couldn’t find one in forums or tech hint sites.  However I think i’ve just solved it – for me atleast.  I just installed VLC Media Player for Mac OS X.  Upon installation, my movies work!  I couldn’t be happier – I think VLC is a little more forgiving if your media format is malformed.

Either way, I can now watch my videos – so I’m a happy camper.