Showing posts with label os x. Show all posts
Showing posts with label os x. Show all posts

Thursday, 2 July 2009

Taking a day a week for yourself

More and more people I speak to are coming up with the same idea — that working one day a week for yourself gives you a better balance and loads more creativity and fulfilment. I ran a session at BarCampLondon6 on exactly this topic and it's good to hear more people starting to make similar changes to their lifestyle.

Here's Matt Webb's take:

Here’s my challenge. Right now, put aside 100 hours over this summer. Do it right now, in your head. Put that time aside. 100 hours. 8 hours a week for the next 12 weeks. One hour a day, or one working day a week. It’s one summer out of your entire life, it’s nothing. Okay, you’ve got that 100 hours?

Now for the next two days, go to talks and start conversations with people you don’t know, and choose what to spend your 100 hours on.

I guarantee that everyone in this room can produce something or has some special skill, and maybe they’re not even aware of it.

Ask them what theirs is, find out, because you’ll get ideas about what to learn yourself, and decide what to spend your 100 hours on. Do that for me.

Because when you contribute, when you participatein culture, when you’re no longer solving problems, but inventing culture itself, that is when life starts getting interesting.

I moved from taking one day off every other week to one day off every week at the beginning of June and even that has made a big difference. My personal project has been learning to build apps for the iPhone -- starting with the Stanford iPhone Application Programming course and Aaron Hillegass's Cocoa Programming for Mac OS X.

Through evenings and snatched half hours on the train, I've got through most of the course and am starting to explore other areas, such as adding hamcrest and OCMock to the built-in OCUnit iPhone unit tests. I still plan to build and release my own apps as I get more of an understanding of what's possible.

So Matt, I've taken up your challenge before you even issued it and I look forward to others doing the same!

Thursday, 23 October 2008

Wireless Time Machine Backup instructions updated

I've updated my wireless Time Machine without Time Capsule instructions. Now there's just one place to look to find out how to get Time Machine working on non-Apple hardware -- and what the issues are and have been.

Saturday, 5 April 2008

OverTheAir: Hacking Competition & Presentations

Lots of people stayed up overnight to hack mobile applications and there were some very cool results.

I tried out building a mobile widget using the Nokia Web Runtime. This is an application environment on recent Nokia Series 60 devices that uses the WebKit browser with various extensions. You write widgets for it using JavaScript, XHTML and CSS (just like any other widget, but, as always, slightly different to the other formats). In fact, I started off building the widget using Apple’s DashCode — a web application builder for the iPhone. This comes with an interface builder that allows you to drag and drop controls onto the screen and wire them together.

Getting the control logic to work took a bit of getting used to — as with all interface frameworks, there’s a learning curve where you build up understanding of how the pieces are supposed to fit together. In the DashCode case, this isn’t helped by the lack of any documentation for the interface controls. However, the development environment more than made up for this — there’s a very capable Javascript debugger, complete with an interactive console, and it’s very easy to start and stop your widget in the iPhone emulator.

I used prototype to power up the Javascript side — making the Ajax calls to our server much easier and enabling some mucking around with the results to provide some pretty formatting.

Once I’d got the basic application working in DashCode, I took it across to the Nokia Web Runtime environment. This provided some extra features such as storing preferences between invocations so that the widget could start up straight into showing you the departures that you’d chosen previously.

I found the Web Runtime very effective, and it fills a very useful niche for simple, web-connected apps on recent S60 phones. Development time is fast and you have access to a reasonable amount of the phone features, though nothing quite as useful as location or the address book (as yet).

My hack won special mention in the “Most practical / ready for market” category — runner-up to the SNOB address book picture enricher. I’ve included a movie of the widget in action (within an iPhone environment) below.

<a href="http://cohen-rose.org/gallery2/d/7132-3/Kizoom_Team_at_OverTheAir.mp4?g2_GALLERYSID=69af5451e496bcfa9a187362a1849331">Download movie</a>

Some other hacks were:

  • PimPam — social BBC programmes
  • 21st Century Fridge Door — text & MMS to a shared web space
  • Location-based games w/J2ME — e.g. capture the flag
  • Social Tracker — basically just captures where you are to a database…
    • seems to use Google Maps in a browser to capture the current location
  • Flat Music Player UX design — zoomed out user experience — see the album art very small and in specific places on the screen
    • uses sense of physical location rather than words
  • Twitter client for Windows Mobile today screen
  • Browser Sync while ActiveSync’d — nice!
  • YourLocal - displays the local transport stops around Imperial College
  • FuturePlatforms — Octobastard robot — you have to see it to believe it :-)
  • SNOB: Social Network Open Butler — add pictures to your address book from social network avatars (web service outputs XML independent from social network)
  • Autowigificationizor (Owen Griffin) — click a firefox button and get a web runtime widget generated for you based on the RSS feeds for that web page
  • MixItUp — cocktails in Flash
  • Bluetooth + FOAF — unique ID from hash of bluetooth ID & device bluetooth name; can revoke it by changing your device bluetooth name; get a list of all the people you came into contact with at a conference
  • Update FireEagle location from command line, then display it on blog
  • LastMinute Labs — PhonePhight with motion detection & bluetooth — very cool!
  • Torchwood Sweded — again, I think you just had to be there…

Saturday, 8 March 2008

Time Machine Wireless Backup Continued...

This post is now out of date!

Check out the latest info on my main wireless Time Machine post.


Old stuff below for historical record only...

So I promised in my previous post that I would give an update on how I got my wireless Time Machine backups working from a Mac running 10.5.2. I’ve also found a useful utility to control how often Time Machine runs (and found out where the appropriate property list files are kept) and I understand a little more why Apple have made this whole shebang an unsupported option…

Setting up from 10.5.2

The setup process is a little convoluted, but it’s not too hard to follow. What you do need, however, is a second Mac on which you can share some space using Apple’s built-in file sharing.

The first trick is to create your initial Time Machine backup on the second Mac, and then copy that backup across to the unsupported share. Once it’s there, Time Machine will happily accept it and continue backing up.

The second trick is to make that initial backup as small as possible so you don’t have to wait for the setup or copy a huge amount from the second Mac to your wireless backup repository. Michael on pastebin came up with the idea of changing your Time Machine preferences to exclude your local hard disks, but to include a very small mounted disk image instead.

You can create this image using Disk Utility (use the “Mac OS Extended (Journaled)” format) and once mounted, go to the Time Machine preferences and remove it from the “Do not back up” list under the Options… button. While you’re here, add all your local hard disks to the list (just while you create the initial backup).

Set Time Machine going, backing up that empty disk image onto the share on the other Mac (it should only take a few minutes). When it’s done, turn Time Machine off for the moment and copy the files that Time Machine created across to your wireless backup. Be careful when you do so — if you’re copying from HFS to a different disk format, you’ll need to use tar as follows:

tar -czpf backup.tgz *.sparsebundle

This will create the file backup.tgz which you can copy across onto your wireless backup server. Once there, run:

tar -xzvf backup.tgz

…and you should end up with both the sparse bundle folder that you copied, and a ._file of the same name that gives Mac OS X some information about the directory.

Now you can go back to the Time Machine preferences and point it at your wireless server where you copied the files (you have already activated the unsupported network drives haven’t you?). Go into the options and remember to remove your local hard disks from the “Do not back up” list, and you can unmount and delete that empty disk image now as well. Your wireless Time Machine should now be ready to go — just be patient for the first backup.

Control how often Time Machine runs

I’ve finally found a utility that claims to control the frequency and times of the backup run — TimeMachineEditor. The previous application I found, Time Machine Scheduler, wouldn’t even install on my Mac, let alone run, and it seemed to be running its own scheduler rather than tweaking the settings of the existing one.

By looking through the binary of TimeMachineEditor, I also found the property lists that it works on: they’re at /System/Library/LaunchDaemons/com.apple.backupd-auto.plist and /System/Library/LaunchDaemons/com.apple.backupd-attach.plist. I’m not sure if this app tweaks these settings or also runs its own scheduler, but it’s happy to install and run.

Caveat Maxtor

So Felix on Apple’s discussion list has documented one reason why Apple has made backing up to an SMB share an unsupported option. When disk space runs out, Time Machine deletes old backups to make room for the new ones. This is by design — the system automatically thins out hourly backups older than a day, daily backups older than a week and weekly backups as needed to maintain space for new backups.

However, Felix noted that when Time Machine was supposed to be cleaning up space, not only could it not reclaim any space, but it then went on to delete all his old backups without telling him. He put this down to a bug in the sparse bundle space recovery code — the old backups were being deleted but the sparse bundle wasn’t getting any smaller. Indeed, when he compacted the sparse bundle by hand, he got loads more disk space back.

I’m wary of this issue as I’ve noticed exactly the same thing in my own logs. I’m going to keep checking the status of my backups as the disk fills up (though there’s plenty of space at the moment!) and will try to run hdiutil compact <sparse bundle> in time to prevent backups going missing!

Update after applying latest Time Machine system upgrade

I just ran the Time Machine and AirPort Updates v1.0 and this problem has been fixed! My logs now show that when there isn't enough space on the disk, Time Machine will delete the least important backup then eject the disk and compact it to recover the free space before trying again. This is fantastic news and the reports that Apple has enabled Time Machine on USB disks attached to Airport Extreme base stations give me much more confidence in using a third party NAS box. More details in my latest post.

Sunday, 3 February 2008

Time Machine Wireless Backup without Time Capsule

Now updated with all necessary information for 10.5.5!

I upgraded to Leopard with one of the main reasons being to take advantage of Time Machine.

My previous backup routine was to rsync important documents to a remote server on an hourly basis. Whilst this works well, it’s no good for large files like my iPhoto or iTunes libraries, and it relies on my choosing the right files to backup. It was also subject to network connectivity both on my Mac and the remote site — and keeping track of when the backup was working or failing was a pain in the butt.

Now I simply leave my Mac on for a while when I’m at home and Time Machine will make sure that everything is stored on my home network. I’m confident that the backup has worked as I can see the old data through the Time Machine interface. Large files are only copied when they’re changed and then only over my home network.

Although I’m using my wireless network for transfer (and the wireless router only does 802.11g not n), one of the surprises in this setup was that it didn’t take that long to do the first backup. I left it going overnight and it had finished another couple of backups by the following morning. This gives me confidence that if a machine goes completely dead, it won’t take more than a day to restore from scratch.

I’m using a QNAP TS-109 NAS box as my networked storage. It’s supposed to offer AFP sharing, but this doesn’t work yet with Leopard (the security requirements are stricter). Instead I use an SMB share which works fine.

Time Machine creates a sparse disk image on the NAS box, which it mounts and pretends is a local HFS+ disk. This approach has a few advantages: firstly, the Mac can use any fancy filesystem tricks it needs to in order to ensure that the backup is a true copy of what on my machine; and secondly, the image is compressed and so takes up less space on the NAS box. One disadvantage is that I can’t see the files when I log in to the NAS box directly — I have to mount the image on a Mac first. Another advantage is that Time Machine can create separate sparse images for each Mac to backup — so it’s easy to have multiple Macs backing up to the same SMB share.

I suspect that any home office NAS box would work just as well. I chose the QNAP as it has very good support (just check out their forum) and it doesn’t have a fan. Similarly, I chose a Western Digital Caviar GP 750Gb as the disk for its low noise output. When there’s nothing accessing the disk, the system is absolutely silent.

There were a few hoops to jump through to get this system to work:

  1. persuade Time Machine to see the SMB share as a Time Machine destination by activating the unsupported network drives feature -- simply open Terminal and type:
    defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
    
  2. set up the NAS box with a quota per Mac so that Time Machine would know when to trim old backups (otherwise it just fills the NAS box with backups)
  3. create an appropriate Time Machine disk image locally and copy it to the NAS box -- see below

The first step does involve using unsupported features for my backup, but I thought I’d try it to see if it works — and I’ve had absolutely no issues for several months of continuous usage.

The second step is QNAP-specific, but involves creating a new user per backed up Mac. The QNAP interface then lets you set a quota for each user, which I set to about twice the disk size that was being backed up. The size of backup space that you need depends on how big your initial data is and how much it changes over time.

I’ve found that the Mac that houses my iTunes and iPhoto libraries had a big initial state but doesn’t change much, whereas the Mac that I use to work on and check my mail had less initial state but changes much more often. The compression done by the sparse disk images means that I may have overestimated the quota for each machine — I’m nowhere near the quota on either machine after over a month of backups.

Creating the disk image

To create the disk image, you'll need to find out two pieces of information about the computer you want to backup: its Computer Name and its Ethernet ID (also known as Ethernet MAC address). The Computer Name is the one that you set in the Sharing System Preferences pane. Open it up and you'll see it at the top. For the purpose of this example, let's say you've called your computer "Adam's Mac".

You can get the Ethernet ID from the Network System Preference pane. Open it up and click on the Built-in Ethernet network adapter (one of the items on the left). Then click on the Advanced button at the bottom right. Click on the Ethernet tab at the top of the resulting dialogue and the Ethernet ID will be displayed at the top. It should look something like "00:18:b3:11:84:dd". Note that you want the wired Ethernet ID even if you'll be using Airport to back up wirelessly.

The name of the Time Machine disk image that you want to create will then be "Adam's Mac_0018b31184dd.sparsebundle", i.e. the Computer Name, followed by an underscore, followed by the Ethernet ID without the colons, followed by .sparsebundle.

You'll have decided on a maximum size for the backup in the previous step and you'll need this again here. I use about twice the size of the disk that is being backed up.

Now go to Terminal and type the following commands (based on Mac OS X Hints):

DISK_IMAGE_NAME="disk image name"
DISK_SIZE=max backup size in megabytes
hdiutil create -library SPUD -megabytes $DISK_SIZE -fs HFS+J -type SPARSEBUNDLE -volname "$DISK_IMAGE_NAME" "$DISK_IMAGE_NAME"

In our example, the commands might be as follows:

DISK_IMAGE_NAME="Adam's Mac_0018b31184dd.sparsebundle"
DISK_SIZE=200000
hdiutil create -library SPUD -megabytes $DISK_SIZE -fs HFS+J -type SPARSEBUNDLE -volname "$DISK_IMAGE_NAME" "$DISK_IMAGE_NAME"

After you've run this command, you should end up with a disk image in your home directory called something like "Adam's Mac_0018b31184dd.sparsebundle". It looks like a single file, but it's actually a directory (just like a Mac OS X application). Don't forget to copy this disk image to the appropriate share on your NAS box. Just dragging and dropping from the Finder should work fine.

Now make it work

To get Time Machine started, you follow these simple steps:

  1. connect to the NAS box share from the Finder using the machine-specific user
  2. open Time Machine Preferences and point to that drive as your backup destination
  3. make sure the "Show Time Machine status in the menu bar" option is checked
  4. click on the Options button in Time Machine Preferences and ensure that the "Back up while on battery power" checkbox is not checked (see note below as to why you want to do these last two steps)
  5. Click Done

Now sit and wait as your initial backup takes ages... You might want to let it go overnight as I did. Don't worry -- subsequent backups are much shorter as only the changed files are backed up.

There's one further step you can take to make wireless backup more effective. I tweak the Time Machine schedule so that my laptop doesn’t back up every hour — it’s not in the house all the time so I only really need it backed up once each evening. There's a really useful utility called Time Machine Editor that gives you much finer control over when backups happen. It's pretty self explanatory to use.


History and solved issues

This is the brand new updated page with all current information. Everything is currently working for me with no issues. However, there have been issues previously and if you've been searching around you may have come across them. This section is intended to put your mind to rest :-)

Creating the initial Time Machine image used to be automatic

The step to create the Time Machine disk image used to be done automatically by Time Machine itself, but something in OS X 10.5.2 stopped this. Now you have to create the image yourself as I've documented above.

Time Machine used to have problems when it ran out of space

When Time Machine fills up the backup disk it deletes the oldest backups to make room, leaving you with hourly, daily, weekly and monthly checkpoints. Until Apple released Time Machine and AirPort Updates v1.0, there was a bug that meant that all your old backups would be deleted when there was no more room on the disk. Obviously not what was intended!

See my blog entry on the Time Machine update, complete with proof from my logs showing that this issue has definitely been addressed.

Backup fails when interrupted by sleep

Five months in to using my wireless backup system, I had two backups fail on me in quick succession. It turned out that the Time Machine backup failed badly when the machine was put to sleep during the backup process. The failure was so bad that the backup image was irretrievable!

This is still an outstanding issue, as far as I'm aware, but there's a very simple workaround: don't put your machine to sleep while Time Machine is backing up. To help me in this, I've set the option to prevent backups when on battery power -- this is the most common time that I put my machine to sleep.

You can tell if a backup is progress because the little Time Machine icon in the menu bar rotates. Make it your habit to check that icon before you put your computer to sleep...

Sunday, 25 November 2007

BarCamp London: Obscure Mac Apps - Melinda & Martijn

These are a collection of the more obscure Mac apps that Melinda and Martijn find useful. Not all of them are free, but none of them are expensive. Anything that more than five people already knew was skipped…

KeyCue — hold down the apple key, and see all the commands that are available at the moment

iStat Menus (like MenuMeters & MagiCal combined) — free

Caffeine — menubar item keeps your laptop from sleeping when open (useful for presentations/videos)

NameChanger — visual file renaming

Yojimbo — stuff database

  • can sync to web/iDisk
  • also has passwords & serial numbers
  • works with tags — have smart folders that pick up tags
  • similar to DevonThink

Keyboard Cleaner — disables your keyboard so you can clean it without typing nonsense (only responds to Apple-Q)

Audio Hijack Pro — only $20

  • can record audio from old DOS games in Parallels :-)

BibDesk — can throw all your PDFs into it and can add references to them from within Textmate

Papers — iTunes for PDFs (linked to Pubmed), but no link to editors

Sim R2D2 — really annoy someone else :-)

Picturesque — adds lots of borders, shadows etc to images

  • can also batch process to lots of images
  • not free

ImageWell — batch processing & uploading of images

  • similar to Skitch but free

XLD — converts audio files between formats (esp. lossless)

ZAPMac — scan reading by flashing words large across the screen

Nocturne — for viewing screens in the dark (cuts down the glare)

Remote Buddy — controls everything with an FrontRow-like interface

  • works with wii remote over bluetooth (wii remote is about £20)
  • also works with the EyeTV remote

Open Terminal Here — on Mac Update

iSquint — video compression to iPod

Simple Movie X — simple video editing & recompression; shows keyframes

And some of my current more obscure favourites…

They’ve updated Keywurl to work with Safari 3.0 on Leopard (you’ll need SIMBL, but this is provided with the download).

I find 1password indispensable for keeping web passwords. It saves them securely in the OS X Keychain and makes them available at a keystroke for any browser.

Mini Battery Logger does a really good job keeping track of how much battery I have left — and I can use it to figure out when I need to get a new one.

For those applications that don’t include automatic self-updating using Sparkle, I use AppFresh to tell me when there’s a new version.