E-Scribe : a programmer’s blog

About Me

PBX I'm Paul Bissex. I build web applications using open source software, especially Django. Started my career doing graphic design for newspapers and magazines in the '90s. Then wrote tech commentary and reviews for Wired, Salon, Chicago Tribune, and others you never heard of. Then I built operations software at a photography school. Then I helped big media serve 40 million pages a day. Then I worked on a translation services API doing millions of dollars of business. Now I'm building the core platform of a global startup accelerator. Feel free to email me.

Book

I co-wrote "Python Web Development with Django". It was the first book to cover the long-awaited Django 1.0. Published by Addison-Wesley and still in print!

Colophon

Built using Django, served with gunicorn and nginx. The database is SQLite. Hosted on a FreeBSD VPS at Johncompanies.com. Comment-spam protection by Akismet.

Pile o'Tags

Stuff I Use

bitbucket, Django, Emacs, FreeBSD, Git, jQuery, LaunchBar, Markdown, Mercurial, OS X, Python, Review Board, S3, SQLite, Sublime Text, Ubuntu Linux

Spam Report

At least 236507 pieces of comment spam killed since 2008, mostly via Akismet.

PowerBook "Safe Sleep"

One of the first things that won me over to OS X was the near-instantaneousness with which you could wake a machine up from sleep. For a longtime PowerBook user who had always found Sleep to be a killer feature -- even back when waking up took 30 seconds or more -- this was a great bonus.

Sleep is known as "Standby" in the Windows world, but for some reason a lot of people prefer "Hibernate," perhaps because it predates Standby or perhaps because it's safer -- all data is saved to disk, so you're covered even if you completely lose power.

With the latest round of PowerBook improvements, Apple apparently added support for a hibernation-type mode; they call it "safe sleep." It differs from Windows-style hibernation in that the disk image of your session is only used in the event of a power failure -- otherwise, it wakes normally. (This is how I understand it to work -- corrections are welcome.)

Andrew Escobar has a detailed article on enabling Safe Sleep based on a posting by Matt Johnston. According to Matt, it should work on "most G4s from September 2003 onwards." If you're interested in trying it out yourself, bear in mind two things: First, this is a hack. If you're not comfortable changing NVRAM settings using Open Firmware then it's not for you. Second, Safe Sleep understandably doesn't offer quite the same zippy performance as regular old unsafe sleep. Andrew says:

It takes about 15 seconds to enter Safe Sleep, and about 40 seconds to wake-up from it. That is way longer than the 2 seconds it takes for regular Sleep and wake-up.

That wake-up delay only happens if you have lost power, though, losing the contents of RAM and requiring restoration from the Safe Sleep image on disk. Otherwise, a normal (fast) wakeup is possible. So the real penalty in general use is just a slightly longer wait for sleep to begin.

This seems like nice insurance against unexpected power loss -- I've definitely had PowerBooks lose power during sleep, either due to tired old batteries or bad terminal connections.

A reader in Andrew's comments section also points out this can be handy when you need to move a desktop machine in the middle of a project. Sleep, unplug, move, wake. I'm sure Apple wouldn't endorse that technique, but if documents are saved the risk is relatively low.

Saturday, November 12th, 2005
+

Comments are closed for this post. But I welcome questions/comments via email or Twitter.