Navigation
Subscribe
Twitter

Blog

Friday
Nov252011

Slow Startup in Mac OS X

So for some time now whenever I start up my MacBook Pro everything took a long time to be ready to do what I told it. It would just sit there thinking for quite a while before it would accept any input or respond.

I only had one application start at login and that was Skype. The reason for this is because it is not an app I use, but one I want to have open in case someone wants to call me.

Anyway, I tried an experiment where I turned off Skype launching at start up and difference was amazing. I don't know if they have bad memory code on start up or what.

I still wanted to Skype to start up automatically, but wanted a faster start up time. The answer, as usual for me, was AppleScript, and it is a super simple one:

tell application "Skype"

delay 30

activate

end tell

Basically it just sits there for thirty seconds and then starts Skype. So copy and paste this into AppleScript Editor and save it somewhere out of the way. I put mine at /Applications/Scripts/LaunchSkype.scpt.

The next step is to automatically trigger the script. I use Lingon to create launchd scripts but you can also write them manually.

For example, create a file called say, com.liamhughes.LaunchSkype.plist, in ~/Library/LaunchAgents/ with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.liamhughes.LaunchSkype</string>
<key>ProgramArguments</key>
<array>
<string>osascript</string>
<string>/Applications/Scripts/LaunchSkype.scpt</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

This will cause your script to be run whenever you login to your computer.

Best of both worlds: fast start up time and automatic launch of Skype (or whatever application you want).

Wednesday
Jul202011

Preparing for Lion

We now have official word that Mac OS X Lion is launching "tomorrow" (likely tonight Australian time).

A big decision to make every time a new OS comes out is clean install vs upgrade install. 

Pros for Clean Install
Crud left lying around: While Mac OS X may not be plagued with the dreaded Windows registry, that does not mean that application developers don't leave files all over your system that don't go away when you remove the app in question (although AppZapper can help with that.

A fresh start: I have over 100 applications on my computer. I doubt I use all of them. A clean install lets me just add the applications back as I need them.

Pros for Upgrade Install
Really easy: No chasing up preference files. No going to use App X in a week's time and not finding it, having to download a 100MB+ file from the Internet and then finding my serial number for it.
Really quick: You will probably be all done in about an hour, start to finish.

On Time Machine
I love Time Machine. Between my wife and my laptops we've had a few hard drive failures and a Time Machine restore makes it as though nothing happened at all. In this context, though, that means that all those left over preference files and caches are also restored, quickly turning your freshly installed OS into a one or two year old system.

When you go to restore from Time Machine using the Migration Assistant you have the option of migrating the following files:
 - Users
 - Applications
 - Settings
 - Other files and folders
 
Now, you could only restore the Users option, which would mean that your Applications, Settings and the Local Library will not be restored. However, not only does this mean that your Local Library might be lost with important data before you realise it (due to Time Machine deleting older backups), but also your User Library, which stores a lot of application data, will be restored.

My Solution (use at your own risk)
I have come up with a solution that I think provides you with the benefits of a clean install, but reduces the risk of losing any of your important data.

Here's the process:
1. Back up with Time Machine.
But you were doing this already, right?

2. Do a static back up of your Applications and Libraries.
Create a folder on your external harddrive called 'Static Backup'.
Inside that folder create folders called 'Applications', 'Library' and 'Users'.
Inside 'Users' create one folder for each of the Users on your computer.
Inside each of those user folders create a folder called 'Library'.
Copy and paste the following into the AppleScript Editor:
set myPassword to "password"
set myHarddrive to "harddrive"
do shell script "rsync -a --delete /Applications/ /Volumes/" & myHarddrive & "/StaticBackup/Applications/" password myPassword with administrator privileges
do shell script "rsync -a --delete /Library/ /Volumes/" & myHarddrive & "/StaticBackup/Library/" password myPassword with administrator privileges
set myUsername to "username"
do shell script "rsync -a --delete /Users/" & myUsername & "/Library/ /Volumes/" & myHarddrive & "/StaticBackup/Users/" & myUsername & "/Library/" password myPassword with administrator privileges
Replace password with your admin password. (Don't save the file with your password entered, but set back to password before saving.)
Replace harddrive with the name of your external hard drive.
Make copies of the last two lines for each of the users on your system. Set username for each accordingly.
Run the script.
You will now have a back up of your Applications, your Local Library and all of your User Libraries.
You can run this script at any time and then again just before doing the OS install and it will just update the files already backed up.

3. Install the OS
Do one final Time Machine backup.
Do the fresh install.
When the system asks if you would like to migrate data from Time Machine, say no.
Create the users from your old system.

4. Restore your user data
Once the OS install has finished, enter Time Machine and browse to your user directory.
Select all the folders, except for the Library, and select Restore.
Repeat for each user on the system.

5. That's it (for now)
You now have a completely clean system, but still have all of your user data, including iTunes and iPhoto libraries.
If you install an application and realise that some important data is missing, there is a 99% chance you will find it in your static backup.
After some time (maybe six months) you can probably just delete your static backup.

Conclusion
It certainly does not have the simplicity of a Time Machine restore, but a new version of OS X only comes out less than once per year. I think it is probably worth it for that fresh new car smell.

Oh, yeah, and don't forget to check Roaring Apps to see if your mission critical apps are stable in Lion.
Monday
Jul042011

A Quick Update

Haven't blogged for a while, so here's a quick update.

Last week I took a week of annual leave to spend time with family.

The two weeks before that I began work on an iOS specific library to wrap around the official Evernote API. The idea is to get a library to the point where an iOS developer could add Evernote capability to a range of different apps as quickly as possible. This includes adding client-side storage and validation of data, along with a bunch of other things.

All of this will replace a chunk of code from QuickText which should allow me to add new features a bit easier as well as develop new apps using a common base.

I'll post more on the library when it is closer to being finished. At this stage I am thinking I might open source the lot of it, but who knows.

I'm also getting stuck in to the WWDC 2011 session videos to learn all what's new about iOS 5. Unfortunately I can't talk about any of it due to the NDA...

So, that's me from the last three weeks. More to come...

Tuesday
Jun072011

iOS5 and iCloud: A Follow-up

Here is my wishlist of what would be announced today.

Let's see if Apple likes me...

Notifications
Check!

iCloud: Better Not Just Be MobileMe + Music
Check! The built-in sync across apps and devices is definitely a noteable improvement. Also, free.

iCloud: Better Not Just Be Dropbox
Check, again! When I stop to think about it, there was nothing that I wanted iCloud to do that developers couldn't have done with Dropbox. But, much like Game Center when there was already OpenFeint, I'm sure we will see a slew of updates in "the fall" which will introduce over the air syncing of our favourite apps. Although there is one thing that iCloud will be able to do that Dropbox can't: background syncing!

Wi-Fi Sync to iTunes
Check! Funnily enough, as someone who syncs their iPhone every day, I'm almost most excited about this than anything else. Pair that with over the air backups and my iOS devices and my MacBook Pro will barely have to ever meet.

So, four out of four. Thanks Uncle Apple! 

Tuesday
Jun072011

Rhinote - QuickText v1.0.4

Despite all the WWDC news, looks like Apple still had time to approve some app submissions, and as a result v1.0.4 of QuickText is out.

As a result of user requests, the ability to delete notes rose to the top of the features list. So you can now delete individual notes (by tapping the trash can icon) or all the notes at once (in the settings).

TextExpander is a tool that I've seen around for quite some time now, integrated into a bunch of different productivity apps, including Appigo's Todo. I have never really got into using it myself. That is until I decided to add it to QuickText. After just a few minutes of playing around with it I can see why it is so popular. So definitely go ahead and try out TextExpander Touch and then turn on the snippet sharing option in QuickText's settings.

This version of QuickText also has a fair amount of behind the scenes work, most of which you won't notice. What you might notice is that indenting is now preserved and the location tracking for geodata is more frugal when exiting the app.

Anyway, hit up the link to download the update.

iTunes Link