My approach to Inbox Zero with Mail.app

Thursday, March 5th, 2009

My setup is pretty straightforward, Mail.app speaking IMAP to our company Zimbra server.

I wanted to do Inbox Zero because I was sick of losing track of things in the backlog, trying to be clever with flags and “mark as unread”, etc.

My workflow now is to process my inbox down to zero, pulling the information I need to take actions on out with this omnifocus technique.

However, when I’ve processed a message, I don’t want to trash it. I needed a way to archive them for later searching. So, I applescripted it.

I created this script in the script editor:

tell application "Mail"
	set theSelectedMessages to selection
	set myAccount to "zimbra"
	set myMailbox to "Archive"
	repeat with theMessage in theSelectedMessages
		move theMessage to mailbox myMailbox of account myAccount
	end repeat
end tell

then placed it into the ~/Library/Application Support/Quicksilver/Scripts directory.

I refreshed the catalog, then headed to the triggers view.

Quicksilver Triggers

So, after processing a bunch of mail, I can select them all with ⌘-A, or just pick the ones I want normally (clicking, Shift-clicking, or ⌘-clicking).

Then I Shift-⌘-A, and boom, they get moved to my /Archive folder, where they sit, ready for me to search them if I need to. I do still delete messages that I’m really quite sure I won’t be needing again.

The littlest Thumper: OpenSolaris NAS on an MSI Wind PC

Thursday, February 26th, 2009

I recently started to really need more disk around the house. More specifically, reliable disk.
Now that we’re starting to take photos of our son, and to shoot video, and do to all of this at
relatively high resolution (I love our 30D in RAW, but those files aren’t small) I wanted storage and I wanted it RAID’ed.

My network at the moment consists of:

  • 2 laptops
  • a Mac Mini working as a media center
  • an airport extreme

Very clean and simple. Currently, I have quite a few disks dangling off the back of the Mac Mini. One of them will be staying, we time machine remotely to it. The rest were being used for our media
archives — both media generated by us, and media purchased by us. And they weren’t RAID’ed, which meant I wasn’t comfortable not leaving copies on my laptop(s) as well, which of course have finite
drives. And since my space needs were growing rather than shrinking, this needed to change.

The options as I saw them:

  • Get more external drives and some USB hubs, and use the Mac Mini to RAID attached devices
  • Get a RAIDed enclosure (like a Drobo)
  • Build a small server that can have a lot of disk on board, but not use much power otherwise

I went for option 3, because I wanted to use ZFS — we use it at work and I’m a big fan of it. I’m also a big fan of using what I use at work, at home, so I can get more “in my bones” experience with
those technologies. (Still haven’t figured out a good in-home use for LVS, Varnish, or Memcached, but I’m sure they’re out there.)

That’s where the title came from: we use ‘Thumpers’ a lot at work (actually, Thors now, but the same idea.) Sun’s X4540 and X4500 are 48 SATA Disks in 4 Rack units and they run Solaris and use ZFS to do the magic. This is going to be a teensy little version of the same idea.

So, what’s the solution. MSI is a well-known maker of ‘netbooks’, those tiny, battery sipping, low priced laptops. It turns out they made a desktop based on the same Intel Processor, the Atom. It’s the “MSI Wind PC Barebones” and it has a lot of appealing attributes.

  1. Price: It’s $155 (but you need to add RAM and disks.)
  2. Power usage: I haven’t hooked up a Kill-a-watt yet but this should be quite efficient.
  3. CF Card slot on board: you can install an 8GB card on board, use that for your OS, and use the drive slots for nice clean data. This helps with power usage, since we can spin down our data drives
    more often than system drives.
  4. USB ports: it’s got a ton, and since I plan to expand via USB drives, this is nice.
  5. 2x internal SATA bays: I can install 2 drives onboard to start with.
  6. OpenSolaris, my operating system of choice for this application, is 100% supported. (Well, at least the parts I care about. I did not test the sound driver.)

Here’s the parts and prices:

Part Quantity Price
MSI Wind PC 1 $155.99
2 GB RAM 1 $24.95
8 GB CF Card 1 $22.08
1.5 TB SATA Drive 2 $126.98 ea

Total Price: $456.98. (No tax or shipping from Amazon, since I am a Prime Kind Of Guy.)
Compare that to a Drobo for $424.49.
For an extra $32 I have a full, 3TB raw storage system instead of just an empty enclosure to start sticking drives into. And the benefits of having a server online, as well — a drobo’s not that fun
unless you plug it into something.

So how do I expand if I need to? Simple! Start adding in USB drives as needed! There is a great guide to doing just this on one of the Sun blogs, which includes some nice pointers about how to set this up.

The install was CAKE, the hardest part was finding a monitor and keyboard as I am only laptopped at home. Well, the hardest part was making an install USB device, but you already known how to do that.

Also, to install the CF card into the Wind, I had to remove the motherboard — that’s the only way you can slide it in. Minor annoyance but worth noting.

After that it was a simple matter of setting up the zpool with my new drives, and exporting the filesystem to my other devices.

# Use the format tool to find the disk ID's in the system
jbarratt@rothko:/$ pfexec format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c5d0 
          /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0
       1. c6d0 
          /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
       2. c7d0 
          /pci@0,0/pci-ide@1f,2/ide@1/cmdk@0,0
Specify disk (enter its number): ^C

# Create the pool as a mirror between my 2 1.5TB drives
$ zpool create apool mirror c6d0 c7d0

# Create a filesystem
zfs create apool/archive

# Share that over NFS
zfs set sharenfs=rw apool/archive

And now the contents are flying over my network and filling it up. I’m excited to do a few more things soonish:

  • Get the FMA (Fault Management) set up so I get emailed/SMS’d when alerts about hardware glitches happen
  • Get mdnsd correctly broadcasting the host’s name on the LAN so I can use that for services
  • Migrate my existing data onto the server and add the now liberated USB disks to the pool
  • Set up automatic scrubs and snapshots
  • Designate a ‘critical’ area of the disk and rsync that subset of the data out into a ‘cloud storage’ service
  • Figure out what my power usage is under load and when the disks are spun down
  • Put the system on a UPS

On the other hand, it already works pretty great and I can probably survive with it as is for quite some time. Now, to free up some of my precious laptop hard drive space without worrying about a drive crashing.

Getting an OpenSolaris bootable USB drive

Tuesday, February 24th, 2009

This was not a straightforward process.

What I would have loved would be a ‘dd’able image. That way, from a linux server I could (as far as I know) write the image out and be done.

In any case, this was not to be.
First problem, I needed a Solaris system to create the USB image from.
For this I figured I could use Virtualbox, which I upgraded before starting.

I’m not sure if I needed to upgrade 2008.05 to 2008.11, but I figured I’d do it while I was at it. I found good instructions on the OpenSolaris site: Basically,

$ BUILD=`uname -v | sed -e "s/snv_//" -e "s/[a-z]//"`
$ pfexec pkg refresh
$ pfexec pkg install entire@0.5.11-0.${BUILD}
$ pfexec pkg install SUNWipkg@0.5.11-0.${BUILD}
$ pfexec pkg install SUNWinstall-libs
$ pfexec pkg image-update

This took a LONG TIME in VirtualBox (running on a pretty new MacBook Pro even) and my whole machine wasn’t all that usable during the process, but hey.

Then I rebooted into the new OS (and it looks shiny!) which this time detected the windows-formatted partition on my USB disk, a convenient improvement.

I then shortcutted one of the steps in this article about building distros on USB sticks by downloading a canned image from genunix.org: Specifically http://www.genunix.org/distributions/indiana/osol-0811.usb

I unmounted the USB device, and then installed the new-ish Sun “dist build” tools:

pkg install SUNWdistro-const

And then ran the newly-installed ‘usbcopy’ tool:

/usr/bin/usbcopy osol-0811.usb

And, about 20 minutes later, it was done!

I have now tested it by booting from it on an eeePC 1000HA and it worked great. I’ve ripped the image in linux with dd, and we’ll be testing it to see if it’s portable that way. (Surely would be a lot less work than my way.)