A Django site.
November 20, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Skype on My Mac Book Pro is the Best Conference Phone I Have

Skype Limited

Image via Wikipedia

Today I had to do a job interview with a candidate in Chile. He had Skype and wanted to use it. I was leery because I had four people on my end who needed to be in on the call, so USB headphones weren't going to cut it. We decided to press forward and try the call with the MBP's internal speakers and microphone.

It worked beautifully! We could hear him fine and he could hear us--even with some people sitting 8-10 feet from the laptop. So much so that this evening when I was getting ready to get on another call, I decided to Skype out to it rather than use my Polycom. Skype plus my Macbook Pro is the best conference phone I own.

Tags: osx macbook skype telephony

November 19, 2008

Phil Windley
pjw
Phil Windley's Technometria
» OS X Leopard Technical Details

frameless

Image via Wikipedia

Jordan Hubbard, Apple's Director of Engineering of Unix Technologies, spoke at LISA '08 last week. Most people are commenting on the date he gave for the release of Snow Leopard (10.6), the newest version of OS X. I have to admit, I'm ready for some stability improvements, but I was much more intrigued by the details of his talk (PDF).

He spent the bulk of his talk on technical features in Leopard (10.5) that many aren't aware of. He starts with a number of security improvements in Leopard: file quarantine, sandbox, package and code signing, application firewall, parental controls, non-executable (NX) data, address space layout, and randomization. I was completely unaware of most of these improvements.

Jordan also talks about the Unix improvements in Leopard. Leopard is fully Unix compliant. But more than that includes a number of additions like DTrace, Launchd (complete), ASL (replacement for syslog), a read-only version of ZFS (for future compatibility) with a read/write version available. He also talked about Apple's evolving open source strategy.

Last, he talks about improvements coming in OS X that will help developers take better advantage of the multicore chips and sophisticated GPUs that already ship with most Macs. Future kernels will provide better facilities, along with APIs, for managing multi-threaded programs. He says:

Forget everything you thought you knew about multi-threaded programming (and, as it turns out, most developers didn't know much anyway). The kernel is the only one who really knows the right mix of cores and power states to use at any given time - this can't be a pure app-driven decision

I don't know if there's audio or video of the talk available, but it would be very good to hear firsthand.

BTW, anyone know what "LWFLAF" stands for? Jordan uses it as some kind of metric in discussion the various versions of OS X, but I couldn't figure out what it meant.

Tags: osx apple unix security

October 27, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Reloading OS X Using AppFresh

Last week I went to the Apple store and looked at the new Macbook Pro (MBP). I liked the keyboard and think the one-piece construction makes the overall design really slick. I especially like the fact that you can change out the hard drive without unbolting the case. I'm always changing out hard drives on my MBPs and after a while the cases don't quite fit together like they should.

But what I really noticed was that it was fast. But my MBP should be almost as fast. I determined that I was suffering from OS rot and that a complete fresh reload was in order. I noticed that @jessestay and @qwade were doing the same thing this weekend.

I like to not reload the applications from my old disk since I usually end up with a lot I don't use. But that means a week of finding an app I need and don't have loaded yet and them hunting down the disks or downloading it. Not this time. I discovered AppFresh.

AppFresh is an application updater like the built in Software Updater, but for all your apps. Before I wiped my MBP clean, I installed AppFresh. But AppFresh's secret weapon is i use this, a handy Web site that let's you mark applications as something you use.

After I'd wiped the disk and reloaded the OS, I did the following:

  • Load the User info from my Time Machine backup
  • Load XCode tools
  • Perform a standard OS X software update
  • Start AppFresh and use the "Used but not installed" function to find all the applications I use and install them.

That's it. I quickly found and loaded all the apps I use regularly. AppFresh needs help with the download or installation process. For example sometimes, the dowload or update site needs manual intervention or the download happens, but the install needs to be run manually. Even so AppFresh makes the entire thing nearly painless. Highly recommended.

And finally, a note about Time Machine: I always use CarbonCopy Cloner to make a clone of the original disk for use later after the reload. In the past, I've reloaded User data from that disk. This time I used my Time Machine backup since it's on a RAID 0 disk with a Frewire 800 interface. It worked fine and was very fast.

Tags: osx macbook+pro sysadmin

October 26, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Uninstalling Adobe Air on OS X

I was reloading my Macbook Pro tonight and something when wrong with the installation of Adobe Air. When I tried to use it, it failed. I tried to reinstall the application, but that didn't work because the installer says "This version of Adobe Air is already installed." But, of course it was corrupted. There was no uninstaller in the /Applications director like there should have been because the application wasn't really installed.

Turns out you can run the installer from the command line with the -uninstall switch and it uninstalls nicely. Do this:

cd /Volumes/Adobe AIR/Adobe AIR Installer.app/Contents/MacOS
sudo ./Adobe\ AIR\ Installer -uninstall

And the rerun the installation. Air now works.

Tags: osx adobe air sysadmin

October 21, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Making Screencasts in OS X

I've been creating screencasts to show what Kynetx does for VCs and business development. Using screencasts is a quick, easy way to do a demo that doesn't fail and is self contained. I can email the link to a screencast to someone and they get a good idea what I want them to know.

I've been using SnapZPro to record browser sessions and then using iMovie to create the actual movie. SnapZPro works great, but I'm not as impressed with iMovie. Maybe it's just me, but I find it inflexible and hard to use. If you've got suggestions on better programs, I'd love to hear them. I'm interested in

  • Cheap -- we're a startup, after all.
  • Ability to easiliy lay in audio after the fact. I like to script and record the browser interaction and then add the explanation.
  • Good title slide capability. This is one place iMovie left me cold. I wanted to add what amounted to slides, and the internal capabilities were scare. I had to create slides, export them, and then use those pictures.
  • Easy to understand and use--I'm not a video editor.

Tags: osx screencasting imovie kynetx

October 10, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Tunneling SSH Through Screensharing in OS X

I overhead an exchange between two friends that I thought was interesting. One needed help from the other and asked him to SSH into a machine. The place where the second friend works blocks outgoing port 22, the port SSH lives on. Don't ask me why. The solution? Friend one does a screenshare to friend two who uses the shared machine to SSH. First time I've seen screensharing being used to tunnel SSH.

Tags: osx screenshare leopard ssh networking

September 30, 2008

Scott Paul Robertson
spr
Spr: The Ramblings
» Building Cocoa GUIs in Python with PyObjC, Part Five

Adding Python Modules to the Bundle

If you try to use Python modules on the standard OS X Python path import statements will work fine. However, if you have non-standard modules that might be in a different location, or ones that you want to ship with, you will notice you can't just import them.

To bring them into the application bundle you'll have to go through a couple steps, but when it is all done the application will be able to use the modules, and you don't have to require the end user to install anything extra.

  1. Add the files to the Xcode project.

    • Select 'Project -> Add to Project' (option-command-a)
    • Select the Python module (directory) that you want to add.
    • On the next screen select "Copy items into destination group's folder (if needed) Add to Project dialog
    • Select the correct targets in 'Add to Targets'
    • Select "Create Folder References for any added folders"

And you're done. Nothing to difficult, but it does take some getting used to. Don't forget to import the module in the main.py file so you can use it.

<< Part4: Creating an Open Dialog

July 5, 2008

Scott Paul Robertson
spr
Spr: The Ramblings
» Building Cocoa GUIs in Python with PyObjC, Part Four

Creating an Open Dialog

Our controller doesn't really do anything at this point. We'll begin by adding an open dialog for the user. This will require us to really delve into the Objective C bridge provided by PyObjC. We'll start by reading some documentation that ships with Xcode.

Let's launch the local documentation browser in Xcode. Under "Help" click "Documentation". In the newly opened documentation browser select the "Mac OS X 10.5" documentation set and search for NSOpenPanel. This is the class we'll be working with to create our open dialog. Have a look through the documentation, then let's code.

First we do some basic stuff, creating the object and setting some permissions. A modified open method on our controller.py looks like this:

filetypes = ('mp3', 'ogg', 'mp4', 'flac', 'm4a', 'm4p')

@IBAction
def open_(self, sender):
    panel = NSOpenPanel.openPanel()
    panel.setCanChooseDirectories_(NO)
    panel.setAllowsMultipleSelection_(NO)

This gives us an NSOpenPanel object, turns off directory selection and multiple selections. The filetypes tuple contains the extensions that we allow the user to select, which will be used when we start the dialog.

The first open dialog we'll write will be modal. Modal dialogs block other actions in the application until the window finishes. It is the easiest way to do an open dialog. Have a look at the function runModalFortypes: in the documentation. Now to add to the open method:

    ret_value = panel.runModalForTypes_(self.filetypes)
    if ret_value:
        print "Open %s" % panel.filenames()
    else:
        print "Canceled"

Go ahead and run this code.

open window

A few things to note:

  • The only files that could be selected are contained in the filetypes tuple.
  • The return value is not the button clicked, rather it is 1 on "Open" and 0 on "Cancel".

Since our app really doesn't need to take up so much screen real estate we'll use a sheet instead. This is attached to the window that creates it, and looks a whole lot cooler. Unfortunately it is more difficult to use. Have a look at beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo: in the documentation. Now put in this code in place of what we just added:

    panel.beginSheetForDirectory_file_types_modalForWindow_modalDelegate_didEndSelector_contextInfo_(
            os.getcwd(), None, self.filetypes, NSApp().mainWindow(),
            self, 'openPanelDidEnd:panel:returnCode:contextInfo:', 0)

We'll need a new method on the class controller:

@AppHelper.endSheetMethod
def openPanelDidEnd_panel_returnCode_contextInfo_(self, panel, returnCode,
        contextInfo):
    if returnCode:
        print "Open: %s" % panel.filenames()
    else:
        print "Cancel"

Run this and you'll see the lovely open sheet that behaves like our previous modal dialog.

open sheet

Items of note:

  • This really demonstrates "replace : with _" for method names. Method names get really long very quickly.

  • The @AppHelper.endSheetMethod decorator is a convience shortcut for the type signature decorator @signature('v@:@ii').

  • The SEL type converts to a correctly formatted string. The Objective C

    @selector(openPanelDidEnd:panel:returnCode:contextInfo:)
    

    becomes

    'openPanelDidEnd:panel:returnCode:contextInfo:'
    

By looking through the official documentation on NSOpenPanel and this you should be able to get a very good feeling for how to translate between Objective C and PyObjC. The code for this step is available in git as always.

In the next installment we'll get QuickTag reading and writing audio tags, finishing the controller.

References

<< Part3: Writing A Python Controller

June 24, 2008

Scott Paul Robertson
spr
Spr: The Ramblings
» Building Cocoa GUIs in Python with PyObjC, Part Three

Writing A Python Controller

First let's add your new controller into the GUI. Add an object from "Objects & Controllers" into your GUI. Now click on it and bring up the "Identity" tab in the inspector. The first drop-down lets you select a class, find "controller" and pick it.

Now Open up your newly created controller.py with your favorite text editor, and we'll begin.

#
#  controller.py
#  QuickTag
#
#  Created by Scott Paul Robertson on 6/11/08.
#  Copyright (c) 2008 __MyCompanyName__. All rights reserved.
#

from objc import YES, NO, IBAction, IBOutlet
from Foundation import *
from AppKit import *

class controller(NSWindowController):
    pass

There are two parts we will be adding, the Outlets (variables) and Actions (methods). first lets add a few outlets to the class controller.

    name = IBOutlet()
    artist = IBOutlet()
    albumArtist = IBOutlet()
    album = IBOutlet()
    ...

These class variables can now be connected to various fields in your GUI. In Interface Builder you simply control-click your controller object and drag to the text field that you want to attach that variable to. Wire up the fields as you would expect.

Next we start by adding some actions to the controller. First we add the method awakeFromNib which is called at window creation, allowing us to act at application start time.

    def awakeFromNib(self):
        print "awake"

Now let's write a method that we will wire the "Save & Close" button to.

    @IBAction
    def save_(self, sender):
        print "Save"

    @IBAction
    def saveClose_(self, sender):
        print "Saving and Closing"
        self.save_(sender)

Connect these to buttons or menu entries by control-clicking the button and dragging to the controller. Now if we run the application the console will print messages every time we hit a connected button.

We'll go ahead and write similar functions for our other actions and wire them up. controller.py is the final result of this process.

In the next part we'll look into doing something useful with our controller.

<< Part 2: Starting A Cocoa-Python Application | Part 4: Creating an Open Dialog >>

June 17, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Tracking Time? Try Chronosx

A good friend of mine, Nathan Sandland, has written a time tracking applications for the Mac called ChronosX. He says:

I came up with the idea for the project when I switched from being a PC user to a Mac user last year. The one application on the PC I couldn't find a good replacement for on the Mac was my time tracking app. There are many such apps out there for OS X, but none of them was as convenient to use as the one I had on the PC. This new app solves that problem, and also adds some nifty features, such as direct integration with Apple's iCal calendaring application, so you can see your working time logged right alongside your regular calendars.

I really like that it published an iCalendar feed that you can access as a URL. I don't need to track time for projects right now, but seeing Nathan's program almost makes me wish I did!

Tags: osx software

June 12, 2008

Scott Paul Robertson
spr
Spr: The Ramblings
» Building Cocoa GUIs in Python with PyObjC, Part Two

Starting A Cocoa-Python Application

Getting started is easy. First, install the Developer Tools if you haven't yet. Now launch Xcode and start a new project. Select "Cocoa-Python Application". You'll be presented with the following window.

xcode project window

Before we begin, go ahead and double-click on "MainMenu.xib (English)" and put together your interface. We're going to make a tag editor, so give yourself a window with:

  1. Text fields for things like: Name, Artist, Album, Track Number, Genre.
  2. Buttons for two actions: Revert and Save & Close.
  3. Menu items for: Open, Save, Revert to Saved, Close. Keep the edit menu, window menu, and help.

If you prefer, use mine. It already as all the needed connections made, the code is all that is missing.

Now we will start the controller. Create a new file for the project of the type "Python NSWindowController subclass". Name it something like "controller.py".

To tell the system to actually use our controller code we need to make a quick edit. Our first edit will be to main.py. Add the following where the other import statements are:

import controller

Some PyObjC Basics

We're ready to start building our controller. But first let's go over a few basics.

  1. Outlets. If we want to attach values to variables we need to have outlets. You add these as class variables to the controller and assign them the value returned from the function IBOutlet:

    form_field = IBOutlet()
    
  2. Actions. If we want to attach actions to functions we need to inform the system what methods are eligible. This is done by adding the IBAction decorator to a method:

    @IBAction
    def clickButton_(self, sender):
    
  3. Colons. Objective C loves colons. It uses them to separate return values, method names, and arguments. The method:

     - (IBAction)convert:(id)sender;
    

    becomes

    @IBAction
    def sender_(self, sender):
    

    So we simply change colons to underscores. Easy.

Part 3: Writing A Python Controller >>

» Building Cocoa GUIs in Python with PyObjC, Part One

Introduction

Building GUIs for Apple OS X traditionally meant you would code in Objective C. To overcome this issue people have made programming bridges to allow development in other languages. PyObjC is the project that enables Python programmers to take advantage of Cocoa, Apple's development environment. I recently began learning how to use PyObjC, and how to make (almost) pure Python GUI applications.

PyObjC isn't new, it has been around for a while, and there is actually a pretty good tutorial for wiring an interface up with Python. Leopard (10.5) ships with Python 2.5 and PyObjC 2.0, meaning there is nothing we need to install. Additionally Apple has also shipped support for Python in Xcode. This makes certain things much easier.

The current tutorial directs a user to build an interface, and then take the generated Nib file* and run a script that generates the appropriate controller. From here the user can create a fully working app bundle without needing Objective C. There are a few annoying things:

  • To get your various view to controller connections you have to create Objective C header files and wire with that. Those then are translated to the generated Python file where you implement them.
  • Every time you change the way the interface is wired to the controller, you need to re-generate the Python file, and merge in your changes.

Xcode 3.0, which ships with Leopard, provides support for Python, allowing the controller to be developed completely in the language. Interface Builder knows how to understand Python files, so you can attach actions and variables directly, with only a few necessary tricks.

In this series I will go through the steps to build a simple, but useful, application. There will be no Objective C written, only Python.

* Xcode 3.0 defaults to version 3 Nib files, which will not work with the PyObjC tutorial. You'll have to Save As a version 2 Nib file.

Part 2: Starting A Cocoa-Python Application >>

» Build Cocoa GUIs in Python with PyObjC, Part Two

Starting A Cocoa-Python Application, the basics of PyObjC

Getting started is pretty easy. First, install the Developer Tools if you haven't yet. Now launch Xcode and start a new project. Select a "Cocoa-Python Application". You'll be presented with the following window.

xcode project window

Before we begin, go ahead and double-click on "MainMenu.xib (English)" and put together your interface. If you prefer, use mine.

Now we will start the controller, create a new file for the project of the type "Python NSWindowController subclass". Name it something like "controller.py". Our first edit is to main.py, add the following where the other import statements are:

import controller

We're ready to start building our controller. But first let's go over a few basics.

  1. Outlets. If we want to attach values to variables we need to have outlets. You add these as class variables to the controller and assign them the value of IBOutlet:

    form_field = IBOutlet
    
  2. Actions. If we want to attach actions to functions we need to inform the system what methods are eligible. This is done by added the IBAction decorator to a method:

    @IBAction
    def clickButton_(self, sender):
    
  3. Colons. Objective C loves colons. It uses them to separate return values, method names, and arguments. The method:

     - (IBAction)convert:(id)sender;
    

    becomes

    @IBAction
    def sender_(self, sender):
    

    So we simply change colons to underscores. Easy.

» Build Cocoa GUIs in Python with PyObjC, Part One

Introduction

Building GUIs for Apple OS X traditionally means you will code in Objective C. To overcome this issue people have made programming bridges to allow development in other languages. PyObjC is the project that enables Python programmers to take advantage of Cocoa, Apple's development environment. I recently began learning how to use PyObjC, and how to make (almost) pure Python GUI applications.

PyObjC isn't news. It has been around for a while, and there is actually a pretty good tutorial for wiring an interface up with Python. Of course with OS X Leopard (10.5) Apple has shipped with Python 2.5, and the latest version of PyObjC. With that, they have also shipped with support for Python in Xcode. This allows the programmer to more easily develop in Python, skipping a few tedious steps.

The current tutorial directs a user to build an interface, and then take the generated Nib file (a version 2.0 save which is not the default in Leopard) and run a script that generates the appropriate controller. From here the user can create a fully working app bundle without needing Objective C. Except for building the interface. To attach methods to actions you have to make an Objective C header. That's not so bad, but it can be annoying. Additionally if you change things in the interface, or add actions you will have to regenerate the Python controller and merge it with your previous version.

Xcode 3.0, which ships with Leopard, provides support for Python, allowing the controller to be developed completely in the language. Interface Builder knows how to understand Python files, so you can attach actions and variables directly, with only a few necessary tricks.

In this series I will go through the steps to build a simple, but useful, application. There will be no Objective C written, only Python.

Part 2: Starting A Cocoa-Python Application, the basics of PyObjC

April 23, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Runaway Daemons in OS X

Apple Logo

This morning, my MacBook Pro was hot--the fan was running--and sluggish. A look at the activity monitor revealed that syslogd was consuming all of one CPU (apparently it's not threaded) and the other CPU was taking all the load. A reboot would have fixed it, of course, but I like to find ways to fix what's wrong without resorting to restarting the machine when I can.

First thing to try: just kill the process. OS X is pretty good about recognizing when critical processes are down and restarting them. Unfortunately, simply restarting syslogd didn't solve the problem. There was something causing it to run.

A little searching revealed that sometimes Time Machine will cause this problem. Time Machine logs information and there's apparently something wrong with how it does it under certain circumstances. So, the fix is this:

  1. Disable Time Machine in the System Preferences
  2. Kill syslogd from the command line (killall syslogd) or using activity monitor--OS X will automatically restart it
  3. Re-enable Time Machine

After that things were normal. I'll note for the record that my Time Machine drive wasn't connected at the time and hadn't been for days since I'm in China. Maybe that's part of the problem. I'm not sure. In any event, all's well now.

Tags: osx operating+system fixes

April 18, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Following Up on MacBook Pro Memory and Freezing

Apple Logo

Almost two weeks ago, I wrote that I suspected that a memory issue was causing my MacBook Pro stability issues. I bought a new 2Gb memory stick ($70) and haven't a single problem with my MBP freezing. Maybe the old memory was bad, maybe it just wasn't working well with the MBP (memory can be finicky), or maybe it was running hot and causing a thermal problem. I don't know. But for now, replacing a single memory stick seems to have solved the problem.

Tags: osx gear

April 7, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Belay My Last! Parallels Found Innocent!

Apple Logo

Well, maybe not completely innocent. Here's the story: A little bit ago, I claimed that uninstalling Parallels from my system had solved some instability problems I was having. Not so fast. I'd gone five days when I wrote that post without seeing any evidence of the instability after removing the drivers. The next day they came back.

What did change was that my erratic mouse problem went a way permanently, so I still believe that vmmain.kext was the cause of that. But it wasn't causing the freezing. As I said, that returned and kept happening.

I began to suspect that it was a memory issue since there were no third party kernel extensions left to uninstall and the visible behavior was not something I'd attribute to a application (overall system hanging with frequent accompanying high CPU load). It felt like a tight loop in privileged code.

So, my latest theory is that it's related to memory. I've now gone a week without a problem after pulling the memory and replacing it with new DIMMs. The only problem is that I only had 3Gb of replacement RAM so I went from 4 to 3Gb. If this really does solve my instability problem, then I will have to determine whether the memory is really bad or if it's something to do with having 4Gb in my machine. Another option is that it's thermal and having 4Gb of memory pushes it over the top on temperature. Isn't this fun?

Tags: virtualization osx gear

April 4, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Is Office 2007 a Pig or What?

Update: Its really Office 2008...

Microsoft Office 2007 on OS X is a complete pig. I was so looking forward to finally having an Intel native version of Office so I wouldn't have to put up with long start times and the SBOD (spinning beach ball of death). With Office 2007, they're worse! I've rarely been as disappointed in a software product. Office 2004 is a better Office--even in Rosetta. Heck, Office on XP running in Parallels is a better Office. I'm glad BYU has a site license because I'd be really mad if I'd actually paid for this.

Tags: microsoft osx software

March 27, 2008

Hans Fugal
no nic
The Fugue :
» What was that macro?

I find myself asking this question a lot: "Now what was that define that detects annoying platform that makes porting otherwise perfectly-portable code difficult?"

This will narrow your search down to something useful:

echo | cpp -dM

Go ahead, try it. I wish I'd known this one earlier.

March 24, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Parallels and OS X Instability

VMWare Fusion

Lately, I've had a very rocky relationship with my Mac Book Pro. One of the things that attracted me to OS X was its stability. Over the past several months (before and after Leopard) my MBP has had trouble with sleeping, waking, and weird, inexplicable freezing. Often when the machine woke up, it would the screen would be black and never come back. The machine would freeze at odd times and nothing would unstick it. I couldn't even log in remotely using SSH, so it was pretty stuck.

The final straw was erratic mouse behavior. The mouse seemed sluggish and wouldn't follow the track. Only a reboot would cure it and the it would deteriorate over the next 5-10 hours.

I considered an OS reload, but didn't really expect that would solve the problem since these issues had persisted through reloads before. I suspected, but didn't have much evidence that it has something to do with a kernel extension because the locking up was occurring at a deep level.

The good news is that OS X some new tools for exploring what kernel extensions are loaded. I used the following command to see what (besides Apple extensions) were loaded:

kextfind -loaded -not -bundle-id -substring 'com.apple' -print 

Doing so revealed about five extensions. I started Google each one and discovered that vmmain.kext was suspected in at least one other case of causing erratic mouse behavior. I didn't want to uninstall Parallels to test this, so I just renamed the plist file in StartupItems so it wouldn't load.

mv /Library/StartupItems/Parallels/StartupParameters.plist foo.plist

Now, after a reboot, Parallels doesn't load and looking at the loaded kernel extensions shows that in particular vmmain.kext hasn't loaded.

I did this five days ago and my machine has been remarkably stable. It feels like my old Mac again. I don't know that it's a Parallels problem--at least not exclusively. I suspect that its an interaction with other things. In particular, I run Parallels and Fusion both and there may be some weird interaction going on there.

I like Parallels. I like Coherence better than Unity. I like the snapshot feature in Parallels because it allows multiple snapshots of the same image. But I need Fusion for running Fedora (Parallels didn't work so well for me there). Fusion also wins on the performance front--particularly with multiple cores.

There are ways to load and unload kernel extensions and that may be a better solution, but for now, I'm just using Fusion to see what happens. I'll let you know if my experiment turns up anything else.

Tags: osx parallels virtualization debugging fusion vmware

March 6, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Complete Solution for Unmounting Time Machine Drives

Apple Logo

A few weeks ago, I wrote about forcing Time Machine drives to unmount. From a comment to that post by bil_kleb, I learned about Bernhard Baehr's SleepWatcher program that provided a way to create a complete solution. Here's what I did.

Download and install SleepWatcher. There are two installs that have to be done in the right order (StartupItem last). Now whenever you restart SleepWatcher will start as well.

Modifiy your sudoers list. This allows umount to run as the superuser without a password (otherwise you have to type the superuser password everytime you put your Mac to sleep). Use the command sudo visudo to edit the sudoers file. If you don't know vi, get someone to help with this step. You want to add the following line to the end of the sudoers file:

%admin  ALL= NOPASSWD: /sbin/umount

This tells the sudo program to allow everyone in the %admin group to execute the umount command as the superuser without a password.

Create a .sleep file. This is where you actually unmount the drive. Put the following in a .sleep account in your home directory (you'll have to create this file)

#/bin/bash

# always unmount the drive before sleep
sudo /sbin/umount -f /Volumes/Phil\ Backup

You'll want to change /Volumes/Phil\ Backup to whatever the name of your backup drive is (look in /Volumes to find it). Make sure you make the .sleep file executable:

chmod u+x $HOME/.sleep

You can test it by executing the .sleep file from the command line. Your disk should unmount without asking for a password if you've done these steps correctly.

That's it. Now when you sleep your machine the Time Machine drive will unmount automatically. You can add other things to the .sleep file if you like to accomplish anything else you'd like done before the machine sleeps. SleepWatcher will also execute a .wakeup file for things you want done when the machine wakes up.

I've been using this for a few weeks now and it seems to work fine. Every time I sleep my machine, the drive unmounts cleanly as part of the sleeping process.

Anyone have good ideas for other things to do automatically on sleeping and waking? Now that I've got a new hammer, I've looking for new nails!

Tags: osx gear lifehacks

March 4, 2008

Phil Windley
pjw
Phil Windley's Technometria
» More Macbook Sleep Problems?

I have a suspicion that the most recent OS X (10.5.2) update caused a spate of problems with MacBook Pro's refusing to wake up after sleeping. I base this on two pieces of evidence:

  • I've experienced this after months of not having any problem at all.
  • An earlier article I wrote on Fixing MacBook pro sleep problems is the number one hit on Google for that search right now and I'm seeing that page referenced at 3 to 4 times the rate is was a few weeks ago.

Anyone else experiencing this?

Tags: osx gear

February 22, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Inside the MacBook Air

Apple Logo

Have you wondered what it takes to take a MacBook Air apart and what it looks like when you do? Look no further. Here's a step-by-step with high-res photos from iFixIt. The battery isn't trivial to replace, but it's definitely easier than replacing the hard drive on an iMac. I'd do it.

Unfortunately, the 80Gb drive is the largest one that will fit. I wondered about that because often Apple's top choice is one size smaller than the current leader in terms of space. I regularly crack open my new MacBook Pros before I've even turned them on to replace the drive. Looks like Apple had to go state-of-the-art here to save the 3mm that the larger drives would have cost.

Tags: osx gear apple

February 21, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Unmounting Time Machine Drives

Apple Logo

I love Time Machine. I've been in the habit of doing full disk backups, but that won't save me from accidentally deleting a file unless I notice before the full disk backup is made. With time machine I'm protected. I still do a full disk back up from time to time so that I have something to boot from and then restore from Time Machine on if my main drive goes belly up.

One thing I've noticed: most mornings when I close up my laptop and take it with me for the day, the Time Machine backup disk won't eject. I get the standard "this disk is in use and cannot be ejected" warning. I'm confident the only thing using the disk is Time Machine. It seems that Time Machine makes it hard to eject disks.

This wouldn't be so bad on a desktop, but on a laptop, it's a pain. I hate just unplugging and getting the red stop sign warning about damaging the disk. Maybe more my paranoia than anything, but I like to avoid it.

I've found that forcing an unmount after trying the regular eject always works:

sudo umount -f /Volume/Phil\ Backup

Obviously your volume name is probably different and no, I didn't forget the "n" in "umount". Note that name of my backup drive is "Phil Backup". Why it doesn't work before an eject, I'm not sure. Still, it avoids the warning.

To make this easier, I made an alias for it in my .bashrc file:

alias u="sudo umount -f /Volume/Phil\ Backup"

Now, just typing "u" at the command prompt (which I've almost always got ready) will unmount the disk. Anyone have a better solution or am I the only one dealing with this problem?

Tags: osx apple howto

February 13, 2008

Hans Fugal
no nic
The Fugue :
» OS X Terminal Emulation Woes

OS X's Termina.app is the terminal I've been using since I switched to Leopard, because it has tabs now and it's beautiful. Oh, and iTerm gave me too much grief with odd, illogical and unpredictable bugs.

One of the drawbacks to Terminal.app is that it's broken. This is what Aptitude looks like with TERM=xterm (I think this is the default):

TERM=xterm

This is what it should look like:

TERM=dtterm

How to get from there to here? The short answer is to choose dtterm as your terminal emulation (in Preferences, on the Advanced tab).

The long answer is that the problem here is that xterm supports this capability called back-color-erase (bce). If you tell programs that you are an xterm (with TERM=xterm), they will assume you support bce. The same goes for rxvt and xterm-color and even vt100 (even though that one doesn't seem to support color). bce isn't the only problem, either. There's also redraw problems that are difficult to show with a screenshot.

Setting TERM=dtterm seems to get rid of at least the major breakage. It would seem that the actual capabilities of Terminal.app are closest to dtterm, or at least closer to dtterm than to xterm or rxvt. It solves all the issues I've been having with aptitude, mutt, and screen locally and on remote linux boxes. But there's a caveat—not all remote systems will have the dtterm entry in their terminfo databases. Ubuntu 7.10 didn't by default, for example. The package you want on Debian-based systems (like Ubuntu) is ncurses-term.

Alternatively, you can install it in your home directory. To do this, on OS X type

infocmp > /tmp/dtterm
scp /tmp/dtterm username@example.com:/tmp
ssh example.com tic /tmp/dtterm

tic (terminfo compiler) will create a terminfo database entry in ~/.terminfo/d/dtterm, and you should be good to go.

February 7, 2008

Phil Windley
pjw
Phil Windley's Technometria
» MacBook Air SSD - Uncertain Performance Gain

Apple Logo

One of the things that interested me about the Mac Book Air with the solid state drive was the hope that it might give better performance than a standard HDD and even better battery life.

According to this review from Ars Technica, the performance gains mixed:

[T]he summary is: the SSD does worse in sequential disk tests and writing in general, but spanks the HDD in random disk tests and reading from the disk.
From No spin: Ars reviews the MacBook Air with solid state drive
Referenced Wed Feb 06 2008 20:58:53 GMT-0700 (MST)

What does that translate into?

  • Booting is no faster
  • Exporting a Quicktime movie is slower
  • Building software is faster
  • Unzipping an archive is faster

Most applications won't seem much different. In short: don't spend the $1300 in hopes of getting increased performance. You won't see much.

Tags: apple osx gear

January 22, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Managing Spotlight and Memory Usage

Apple Logo

Over the weekend, I reloaded Leopard. If you remember, I was forced to upgrade to Leopard by a bad Tiger update a few months ago. My preferred method of upgrading is to wipe the disk, do a fresh install, and then restore my applications and personal files from backup. Due to the circumstances of the situation I was in, I didn't get to do that. I decided that the three day weekend presented the perfect opportunity.

The install and restore went fine and I was soon running a squeaky fresh copy of Leopard.

I'm in the habit of running Activity Monitor to see where the CPU and memory are being used and I noticed that mds, the utility that manages Spotlight, was taking almost 250Mb of RAM. Now, I don't use Spotlight enough to justify it taking one quarter of a Gig of memory, so I investigated. Here's what I did.

First, since I'd just reinstalled, I decided to blow away the old index and do a new one. I did this at the terminal:

bash> sudo mdutil -i off /Volumes/Windley

bash> sudo mdutil -E /Volumes/Windley

bash> sudo mdutil -i on /Volumes/Windley

The first command turns indexing off for a given volume--in this case my boot volume. The last command turns it back on. The middle command erases the index for the named volume. As soon as I issued the last command, the system started rebuilding the index. That took a few hours.

Once the index was rebuilt, I restarted mds with the following commands:

bash> sudo launchctl unload \\
      /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

bash> sudo launchctl load \\
      /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

When mds restarted it didn't use much memory at all. Each call to Spotlight increased its memory usage, but it's no where near 250Mb. I've noticed that OSX applications tend to hold memory until another application needs it, so sometimes you can look full, but still have plenty of memory.

mds is fluctuating between 30 and 100Mb now. That's still a lot of memory for something I rarely use, but it's manageable. If you want to completely disable Spotlight in Leopard, add the -w switch to the launchctl unload command in the last code block to write the configuration back out to disk. Then don't run the launchctl load command. That turns off mds completely.

As an aside, the reason I don't use Spotlight much is because I love Quicksilver. Here's a brief tutorial on Quicksilver.

Tags: osx gear

January 17, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Passing on the Macbook Air

A number of people have given various objections to the Macbook Air (MBA): small drive, no firewire, no ethernet port, and so on. I can live with all of those. I'd get one primarily for travel, so I don't mind the small drive. I've been using disks over 801.11N with my MBP for months and won't miss an ethernet or firewire port. Further, I'm intrigued by the solid state drive.

So, the MBA looks like the perfect travel machine with one exception: there's no 3G card. Huh!?! Further, because there's no Express/34 slot, I can't use the card I already have. I'd have to go get one of those USB soap-on-a-rope aircards. Ugh!

Now, if I could tether to my iPhone and use the network from there--I'd be OK. But, alas, you can't do that without jailbreaking the iPhone. So, for now, I'm passing on the MBA.

Tags: osx gear

January 2, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Good News and Bad News: Office 2008

Gizmondo has a hands on report about Office 2008 for the Mac. The good news: it's Intel native, as you'd expect. The bad news: they've "updated" the user interface, as you'd expect.

The old Office running under Rosetta is definitely a pig, but having used Office 2007 on Windows, I shudder at what's going to change in the interface. Office 2004 is by no means perfect, but it's the devil I know. Fortunately the screenshots for O'08 don't seem to be as radical a departure from the old scheme as O'07 was. I'm crossing my fingers.

Tags: osx microsoft

December 31, 2007

Phil Windley
pjw
Phil Windley's Technometria
» Family Information Center from an Old iMac

iMac as family information
center
iMac as family information center
(click to enlarge)

I have an old 17 inch iMac G5 that I'm not using. After I installed Leopard on it, it just didn't cut it anymore, so it had been retired. I decided it would be fun to experiment with it as a "special purpose computer." That is, one that has limited duty.

A while ago I read an article in Macworld on making a family message center from an old iMac and decided to give that a go. You can see from the picture how it turned out.

I already had a VESA mount adapter for the iMac that I'd bought when it was new. I got a small VESA mount from Circuit City. The biggest problem I had was that this doesn't tighten enough to keep the panel straight. I stripped the bolt trying. I put a small piece of metal in the tilt stop slot with a glue gun to fix it in the position I wanted.

The next problem was how to mount a keyboard and mouse platform. I originally was going to put one on the wall, but that seemed kludgy, so I bought some 1 inch strap metal at Home Depot and bent it into brackets that attach to the VESA mount and hold the keyboard tray.

I opted for a Bluetooth wireless keyboard because its small. I'd like to get a track ball to replace the mouse since it's awkward to moves around on the small inclined platform. I'd rather have a tethered keyboard so I'll keep looking for something small and wired.

Now that every computer I own has a built-in iSight camera, I also have a few spare cameras floating around, so I added that (not pictured). The VESA adapter offered some nice slots for tucking in the mouse and firewire cables for a neat installation. I also wrapped the power cord around the mount to keep it out of the way.

On the software side, I reinstalled 10.4 (Tiger) since it does everything I need and is much more responsive on this machine. I set up an account to launch Sticky Notes, iCal, iChat, and FlickrFan at launch. I also configured this account to autostart on boot.

I also made it so that Dashboard widgets can be kept on the screen. Here's how. Run this command on the terminal:

defaults write com.apple.Dashboard devmode YES

Then log out and back in to restart Dashboard. Then use F12 to expose Dashboard, click and hold the widget you want on the desktop and press F12 again. I found I had to move the widget a little after click and before pressing F12 to get it to stick. This let me put the weather widget on the desktop permanently.

iCal is subscribed to everyone's calendars now, so there's one place that shows everyone's schedule. I already had a WebDAV server set up, so that wasn't an issue. You could use a .Mac account or something else if you don't have a WebDAV server handy.

I created an account on AIM for the computer and added myself and other family members to it so you can IM family members from the message center. I also added our cell numbers so you can SMS from iChat. To do this, add a new buddy and for the account, type the 10-digit cell number preceded by a +1.

I didn't put any phone features on it since I'm not anxious to spend $130 to get a voicemail box system like Phone Valet Message Center. If anyone knows of something simpler that works with the internal modem, I'd love to hear about it.

As I mentioned I installed FlickrFan to get FLickr pictures on the machine and then set up the screen saver to come on after 3 minutes, so the computer is constantly showing us interesting pictures. The kids have been mesmerized by it at times.

All in all, this was a fun, simple project. Now we'll see if the family will use it or if it is just an expensive electronic picture frame. Even at that, it's a nice use for an old flat iMac.

Tags: gear osx

December 14, 2007

Phil Windley
pjw
Phil Windley's Technometria
» Taking an iMac Apart

I wanted a bigger hard drive in an Intel (Core Duo) 20 inch iMac than the one it had and took advantage of CompUSA's clearance sale to pick up a 750Gb drive. I'd taken the cover off of my G5 iMac plenty of times and it's dirt simple, so I thought I was in for an easy time. I was very wrong.

My first clue should have been the separate RAM bay door on the bottom of the machine. No one puts a RAM bay door on a machine that's easy to crack open. Where the back simple lifts off the G5 iMac after loosening 4 captured screws, removing the screws from the Intel iMac didn't loosen the back at all, rather, it allows the front to be taken off.

After that, to get to the drive, you have to remove the LCD screen, which requires pealing away some black sticky stuff that I assume is shielding and removing four torx screws that are recessed about an inch below the surface. Ugh. I didn't even try to remove the whole panel, just took the screws out and had my son hold it up while I changed out the drive. These instructions were helpful in knowing what to expect, but my unit was slightly different.

After I put it all together, it still worked. I was glad--I didn't want to have to take it apart. After seeing how hard it is, I'm glad I got the 750Gb drive--I almost got the 500Gb thinking it would be easy to upgrade later. Whew! I can tell you I'm glad there's a RAM bay door. I want to upgrade the RAM with a spare stick I've got and if I had to remove the LCD panel again, I'd just say "forget it."

Tags: gear osx apple

December 10, 2007

Phil Windley
pjw
Phil Windley's Technometria
» Quicklook From the Command Line

This Mac OS X hint shows how to use Quicklook from inside Quicksilver. I'm a big Quicksilver fan, but frankly didn't get very excited since just hitting "return" launches Preview as fast as hitting "tab->q" and then waiting for the AppleScript to run. But, along the way, part of the hint involved creating a small shell script:

#!/bin/bash
qlmanage -p "$@" >& /dev/null &

Using the script, you can launch QuickLook from the command line. Now that's handy!

qlmanage is a very chatty program that performs operations on the QuickLook cache and generators. I saved the above script as ql.

Tags: osx quicksilver

December 14, 2007

Phil Windley
pjw
Phil Windley's Technometria
» Taking an iMac Apart

I wanted a bigger hard drive in an Intel (Core Duo) 20 inch iMac than the one it had and took advantage of CompUSA's clearance sale to pick up a 750Gb drive. I'd taken the cover off of my G5 iMac plenty of times and it's dirt simple, so I thought I was in for an easy time. I was very wrong.

My first clue should have been the separate RAM bay door on the bottom of the machine. No one puts a RAM bay door on a machine that's easy to crack open. Where the back simple lifts off the G5 iMac after loosening 4 captured screws, removing the screws from the Intel iMac didn't loosen the back at all, rather, it allows the front to be taken off.

After that, to get to the drive, you have to remove the LCD screen, which requires pealing away some black sticky stuff that I assume is shielding and removing four torx screws that are recessed about an inch below the surface. Ugh. I didn't even try to remove the whole panel, just took the screws out and had my son hold it up while I changed out the drive. These instructions were helpful in knowing what to expect, but my unit was slightly different.

After I put it all together, it still worked. I was glad--I didn't want to have to take it apart. After seeing how hard it is, I'm glad I got the 750Gb drive--I almost got the 500Gb thinking it would be easy to upgrade later. Whew! I can tell you I'm glad there's a RAM bay door. I want to upgrade the RAM with a spare stick I've got and if I had to remove the LCD panel again, I'd just say "forget it."

Tags: gear osx apple

December 10, 2007

Phil Windley
pjw
Phil Windley's Technometria
» Quicklook From the Command Line

This Mac OS X hint shows how to use Quicklook from inside Quicksilver. I'm a big Quicksilver fan, but frankly didn't get very excited since just hitting "return" launches Preview as fast as hitting "tab->q" and then waiting for the AppleScript to run. But, along the way, part of the hint involved creating a small shell script:

#!/bin/bash
qlmanage -p "$@" >& /dev/null &

Using the script, you can launch QuickLook from the command line. Now that's handy!

qlmanage is a very chatty program that performs operations on the QuickLook cache and generators. I saved the above script as ql.

Tags: osx quicksilver

December 6, 2007

Phil Windley
pjw
Phil Windley's Technometria
» The Optical Disk is Dead

My recent travels had me wishing for a lighter bag--that implies a smaller laptop--or no laptop. I'm not ready for the latter, but I'd be happy to give up the optical drive on my laptop to get it. I never use it on the road. I'm willing to plug one in for the rare cases where I use it. I'm ready to jettison optical drives on all portable computers.

Tags: apple gear osx

November 19, 2007

Phil Windley
pjw
Phil Windley's Technometria
» Leopard and Mail

Apple Logo

I was forced to upgrade to Leopard last week by a Tiger update gone bad. I'm not convinced I can blame Apple--I've updated my machine hundreds of times before with nary a fault and I was, without thinking about what was going on, installing a monitor and plugging and unplugging USB devices while the update was underway. I might have messed something up.

In any event, I had a problem that I couldn't find enough information to fix (something to do with a file locking problem in the IPv6 code, but I couldn't figure out the file name). Reinstalling the update didn't work. I could only boot into single user mode. So, since I wanted to upgrade to Leopard anyway and 10.5.1, the first Leopard update, had just been released, I decided to just upgrade to Leopard.

Normally I'd have done a fresh install, using a back up image as the machine to restore apps and users, but because I had a machine that wouldn't boot and my image was a few days out of date, I decided to just upgrade. Seemed to work fine--I've been using Leopard now for 4 or 5 days without noticing anything untoward. Things are speedy and stable.

Mail.app, Apple's mail application was significantly upgraded and so several add-on bundles I've come to rely on broke. MiniMail had an update that worked fine.

MailTags has a beta that kept hanging Mail.app, so I've uninstalled that for now. I'm hoping a working version is out soon since tags are my security blanket for finding email in the one-big-pile-of-old-email scheme I use for filing archived messages.

Letterbox was the mail bundle I've used the longest. It displays a three-pane mail view of mail with the selected message to the right of the message list rather than under it. I had no idea how much I'd come to like it. A Letterbox still isn't available and I was really hating email with the standard over-under configuration. Fortunately, I found a replacement: Widemail. I've only been using it for a few days, but so far, so good.

Tags: apple osx mail productivity

November 17, 2007

Scott Paul Robertson
spr
Spr: The Ramblings
» Quicklook on the Command-Line

(via) Okay, now I can lauch Leopard's Quicklook from the command-line. That's really quite handy for pdf, doc, and other similar files.

October 30, 2007

Scott Paul Robertson
spr
Spr: The Ramblings
» Early Gripes About Leopard

So I've listed my favorable first impressions about Leopard. Unfortunately Leopard isn't perfect, and there are a few things that really bug me.

  • .Mac seems to have taken a stronger role. By default the .Mac sync icon was stuck in my menu bar, even though .Mac was turned off. cmd-drag got rid of it. The problem? I still get .Mac errors about syncing my address book and things. I really could do without the random dialog.

  • Firefox menus. The bookmarks sub folders get more out of line as you go down. As in the little arrow points to empty space, and the box is below the line you've highlighted. This is likely more on Firefox's side, but it is kind of a strange thing to break. While I'm at it, Firefox sure didn't handle the upgrade well. Quicktime videos don't play with audio, Flash is acting "funky", and it crashes as frequently as even. If only I wasn't addicted to Quick Searches.

  • Terminal tabs are moved between with cmd-shift-] (ie cmd-}). Awkward.

  • Cover flow in finder gets a big "meh." The load time on my mini for a folder of pictures makes it less than stellar. Much like when I cover flow all of my albums in iTunes.

  • The way stacks show what is in them can be a little weird. To someone who isn't me (like the Ars Technica guy) this would be frustrating.

On the note the Ars Technica Review, I have to say I'm indifferent about the dock. I might change it, but I don't really care. The new folder icons I think are quite clear even in column view in Finder in contrast to his opinion.

October 28, 2007

Scott Paul Robertson
spr
Spr: The Ramblings
» OS X Leopard First Impressions

So my copy of Leopard came yesterday. I promptly installed it and I've been poking at it since. I've come up with a little list of the things that have impressed me thus far.

  • Terminal.app is now a first class terminal. I has all the useful features of Gnome Terminal, with OS X styling. Tabs, a full list of terminals to emulate (even ddterm), and a usable preference dialog.

  • Vim 7.0 installed by default. Along with the most recent version of many other handy things.

  • Spaces is nothing new to the Linux desktop user, but is implemented very well. The animations between desktops aren't distracting, and moving apps around is fun. Simple to set an app to a default space. Bonus: when I open a URL from the terminal or other app it moves me to the space my browser is in to view it. Handy.

  • Time Machine is running on my external drive, taking up about 30 GB of space. It doesn't need the whole drive, so my other stuff is fine. I really don't have a big need yet, but I'm sure it'll come in handy.

  • Stacks are a useful addition, gives me a nice quick way to get to often used folders without opening finder.

  • Quick preview in finder with the spacebar is amazing. Very fast to load, and is really quite handy.

  • Overall the look has been brought together well, and it is very polished. A lot of little things in preferences and dialogs have been improved to make everything just flow better.

I'm very impressed thus far.

October 17, 2007

Phil Windley
pjw
Phil Windley's Technometria
» Fixing MacBook Pro Sleep Problems

Apple Logo

One of the things I loved about my Powerbook was that it slept--and woke--reliably. I would go weeks without rebooting my machine and I bragged about it often to the poor saps who had to use XP on their laptops. I haven't been singing the praises of OS X stability as loudly lately because ever since I went to the Mac Book Pro (MBP), my machine has had issues with sleeping and waking to the point that it probably got rebooted once a day.

Well, no more! I tried something a few weeks ago that has made my MBP into a machine I can love again. Here's what I did.

When Apple shipped the MBP, they changed how sleep works. What? Mess with perfection? Yup, that's what they did, although they had a reason (I'm not saying it's a good one). The old Powerbooks could tolerate a battery switch when they were asleep without losing state. The MBPs can't. If you put your MBP to sleep, switch batteries, and then wake it, you'll note you've see a whited-out screen and a progress bar at the bottom. The machine is waking from hibernation. If you pop a battery out of a sleeping MBP, it automatically hibernates.

In order support this automatic hibernation, the machine has to write the contents of RAM to disk every time it goes to sleep. This is called "SafeSleep" by Apple. I call it "SureDeath." That's why putting a MBP to sleep takes to long. For whatever reason, that process seemed to be causing problems for me. Maybe because I've frequently got almost 4Gb of RAM in use with virtual machines, and so on. Often my machine would refuse to sleep or never wake up once it got there.

Here's the good news: Apple left the old mode in the OS and you can activate it if you want. You can also switch back to SafeSleep anytime you like. According to this MacWorld article, OS X supports five different sleep modes:

  • 0 - Old style sleep mode, with RAM powered on while sleeping, safe sleep disabled, and super-fast wake.
  • 1 - Hibernation mode, with RAM contents written to disk, system totally shut down while "sleeping," and slower wake up, due to reading the contents of RAM off the hard drive.
  • 3 - The default mode on machines introduced since about fall 2005. RAM is powered on while sleeping, but RAM contents are also written to disk before sleeping. In the event of total power loss, the system enters hibernation mode automatically.
  • 5 - This is the same as mode 1, but it's for those using secure virtual memory (in System Preferences -> Security).
  • 7 - This is the same as mode 3, but it's for those using secure virtual memory.
From Macworld: Mac OS X Hints: Set newer portable Macs' sleep mode
Referenced Wed Oct 17 2007 09:58:31 GMT-0600 (MDT)

The first step is to check which mode you're in now. Use this command from the terminal:

pmset -g | grep hibernatemode

Make a note of which mode it is (probably 3) so that you can return to it if you want.

Now, set your MBP to use mode 0:

sudo pmset -a hibernatemode 0

That's it. I rebooted. Not sure it that's necessary, but what the heck.

Now, you may be wondering...if my MBP was writing memory out to disk, is that stored somewhere, taking up precious disk space? Yes! Here's how to recover it:

sudo rm /var/vm/sleepimage 

My sleep image was 4Gb since that's how much memory I have. Nice to have it back.

Now, a word of warning: if you change to sleep mode 0 on a MBP, you lose the ability to do a battery swap without plugging the machine in. I only do that occasionally, so I'm happy to forego the feature if my machine works more reliably every day.

As I said, I made this change two weeks ago and my machine has been as stable as my old Powerbook every since. I'm happy to have solved one of the annoyances of my computing life. As always...YMMV.

Update: Bryan Morse made me aware of this Tidbits article that contains a script you can run as a cron job that will put you in hibernate mode when your battery gets low. Some people have reported that occasionally OS X will switch the mode back to 3 so you have to check to make sure you're still in 0 (and delete the sleepimage file). This script does that as well.

Tags: howto osx

October 16, 2007

Phil Windley
pjw
Phil Windley's Technometria
» Mini Mail is Very Useful

Getting control of email so it doesn't control you, is easier said than done. One of the problems I run into is having the email client open on my desktop all the time. When I'm coding, I frequently just close it all together.

Sometimes though I want it open and want to delete things that can be deleted and reply to things that need to be to be replied to and ignore the rest. Mini Mail is an application helper for Mail.app that shows a tiny window with just enough information.

The best way to describe it is to compare it to iTunes. When you click the green window decoration, iTunes shows a full window, or a tiny control panel. Mini Mail does the same thing.

MiniMail for OS X gives a reduced view of Mail.app

At first I was skeptical that I'd like it or use it, but now I love it. You can try for free for 30 days, so there's little risk.

Tags: osx email

October 3, 2007

Phil Windley
pjw
Phil Windley's Technometria
» Microsoft Keeps Plugging Away

Microsoft release the next Zune to very little fanfare compared with what Jobs generated with even the most recent iPod refresh.

For all the crap Microsoft took over the Zune ("oh look! it comes in brown!"), you have to admire the perseverance. The fact is that this is how Microsoft wins lots of battles: "release, watch, redesign, lather, repeat." Office, Outlook/Exchange, and the XBox are all examples of Microsoft powerhouses that were less than exciting in version one. Heck, can you remember Windows 1.0? What a dog.

Microsoft has the affluence and smarts to have a long range attitude about new products and in the end, it's one of the company's biggest assets.

Scoble makes a nice distinction between products where you have to win and defensive products. I'd add that many of Microsoft's defensive products do become winners simply because the product people refuse to just mark time.

Tags: microsoft osx apple iphone ipod

October 1, 2007

Phil Windley
pjw
Phil Windley's Technometria
» Think Similarly

This post at CrunchGear showing a 1989 Apple ad encouraging people to "think different" by challenging the status quo, followed by a video about Apple not allowing third party apps on the iPhone touched a nerve following the most recent iPhone update.

The latest iPhone update is the first that's fixed anything more than security flaws. There were some minor UI changes--nice to have--and a new icon for the iTunes music store. Besides ruining the symmetry of the application list, the addition really rubbed my nose in the fact that this is a walled garden. "Hey, buy some music from us!"

The update also "reactivated" the phone, meaning that iTunes went off to check that the phone had a valid account and had a good SIM, etc. For people who'd hacked their phones, the process did not go smoothly, to say the least.

I'm not saying that Apple doesn't have the right to sell any product they like or that we were forced in any way to take the iPhone. I still love mine and will continue to use it. Apple was also upfront in saying that modifications voided the warranty--that's standard. The first rule of hacking is: hack at your own risk.

Still, we're seeing a real clash of expectations here that could have significant repercussions. People have long accepted that consumer devices (like an MP3 player) would be single purpose and locked down. We've also expected that computers would be extensible and modifiable.