February 5, 2012

Home Lab Tip: TextExpander

TextExpander is a tool I’ve had installed on my Macbook Pro for awhile now, but never really utilized it all that often (other than the built-in spelling corrections I only had 1 or two custom expansions configured).  Recently I started using it more and I think it can be very helpful in home lab environments where you are constantly configuring things over and over with the same (or similar) settings.  I’ve configured a few NetApp simulators in my home lab and rather than remember what settings I apply each time to the simulator and configure them, I have it all configured within TextExpander so that when I type /ntapsim it will replace that line with everything I want set.  In my case it will then run the following:

options security.passwd.rules.enable off
snap reserve -A aggr0 0
snap sched -A aggr0 0
options autosupport.enable off
aggr options aggr0 raidsize 28
disk assign all
license add DZDACHD
license add PZKEAZL
yes
license add NAZOMKC
license add ANLEAZL
license add BSLRLTG
license add NQBYFJJ
license add ELNRLTG
license add MTVVGAF
license add BQOEAZL
license add RKBAFSN
license add HNGEAZL
license add BCJEAZL
license add DFVXFJJ
license add XJQIVFK
license add DNDCBQH
license add JQAACHD
license add ZYICXLC
license add PVOIVFK
license add PDXMQMI
license add RQAYBFE
license add ZOFNMID
license add ZOPRKAM
license add RIQTKCL
aggr add aggr0 24
ndmpd on
options nfs.export.auto-update off

You get the idea, but that will automatically disable AutoSupport, disable the aggregate snapshot reserve and increase the default RAID group size to squeeze a little extra usable space out of the sim, and apply all the simulator license keys for me.  I also have snippets set up for applying a default Cisco switch/router config for me which has been extremely helpful when initially configuring everything in a GNS lab.  I also have one for ESXi hosts that will tweak a couple of settings for my lab such as allowing ESXi to use less RAM.  In that case, the specific tweak was mentioned here and I just chose to insert it via the echo command instead of using vi manually.

That’s just some lab examples of what I use it for, but in reality there are tons of uses for this – almost every file on my machine is date stamped in the format yyyy-mm-dd and I have a quick two character snippet setup to automatically insert the current date in that format for when I’m creating a new folder/file.  Other examples that I use are for inserting my work phone number (I can never remember it), my address, an email signature, and a few for web addresses that I frequent.

If you aren’t willing to shell out the $35 for TextExpander (which, in my opinion, is a little high for a utility app – though it is incredibly useful), there are other ways to accomplish this.  Built in to OSX (and iOS 5 for that matter) is native text expansion, the downside is that it isn’t quite as easy to quickly add in new snippets, or modify old ones.  However, it’s free and as long as you are running OSX 10.6 or later – you already have it.  Just go to System Preferences –> Language & Text to create your snippets.

Anyone using TextExpander and have some other snippet examples?  I’d love to hear them.

Popularity: 4% [?]

Deploying Apple OS X virtual machines in vSphere 5

When I saw the announcement that OSX would be an officially supported guest OS for vSphere 5, I was pretty excited.  Being an Apple fan and a home lab guy, my first thought was I could run Snow Leopard as a VM and treat it as a centralized iTunes server.  It was announced that it would only run on the (now retired) Xserve hardware, but I figured for home lab purposes I could at least create the VM to test things out.

I quickly realized it wasn’t going to happen, my home lab does not contain any Xserve servers to use as vSphere hosts, they are whitebox ESXi hosts.  I was able to create the VM with a guest type of OS X 10.6 (64-bit) but as soon as I tried to power it on I was greeted with the following message:

Error when booting VM with guest type of OS X on non-Apple hardware

So there is some type of checking that happens to ensure that Apple virtual machines will only run on Apple hardware.  The other thing I found interesting is that virtual machines with a guest type of OSX don’t migrate off the host when going into maintenance mode.

Popularity: 6% [?]

Replacing Optical Drive with Second Hard Drive on MacBook Pro

Previously I had blogged about replacing my 7200 RPM SATA drive in my MBP with an Intel X25M-G2 80GB SSD.  So far it’s been great and I have no doubt it’s extended the lifespan of my laptop (MacBook Pro 2,2).  Being a digital pack-rat the hardest thing has been going from a 500GB drive to 80GB, I can no longer keep my virtual machines, Music, Pictures etc on my internal drive.  My solution at the time was to use my 500GB drive in an external FW800 enclosure, it works ok but the FW800 cable is pretty large and also needs a USB connection for additional power.  Considering I only have 2 USB ports and one is in use by my Logitech receiver this was a pain as well.  Basically I was sick of doing this all the time:

Adding second hard drive to MacBook Pro

Performance wasn’t an issue for me (I do have Xbench results below) convenience was the only thing I was after.  I picked up an OptiBay from MCEtech, it was $99 which at first I thought was a bit high for just a piece of metal to fit another drive in there.  However it also comes with a case/cables to turn the SuperDrive into an external DVD drive.

The adapter is the size of the DVD drive and has the same back end connector:

Adding second hard drive to MacBook Pro

The inside has a SATA connector as well as a piece to make sure the drive is snug (part that says “SATA HDD”):

Adding second hard drive to MacBook Pro

Here is before I yanked out the optical drive on the right, you can also tell I’m trying to take a picture while holding up the keyboard on my MBP and it didn’t turn out so great.

Adding second hard drive to MacBook Pro

Connector:

Adding second hard drive to MacBook Pro

Drive in the OptiBay:

Adding second hard drive to MacBook Pro

Side note:  The manual for this comes on a CD, I didn’t realize this until I already had my MBP apart.  The whole process was simple and took me less then 15 minutes but might want to keep that in mind if like me you only have access to the computer you are working on.

I used Xbench on this 500gb 7200 RPM drive when I had it in my FW800 enclosure and these were the results:

Results 35.39

System Info

Xbench Version 1.3

System Version 10.6.3 (10D573)

Physical RAM 4096 MB

Model MacBookPro2,2

Drive Type Ext Hard Disk

Disk Test 35.39

Sequential 65.70

Uncached Write 70.17 43.08 MB/sec [4K blocks]

Uncached Write 85.04 48.12 MB/sec [256K blocks]

Uncached Read 37.54 10.99 MB/sec [4K blocks]

Uncached Read 121.45 61.04 MB/sec [256K blocks]

Random 24.22

Uncached Write 7.97 0.84 MB/sec [4K blocks]

Uncached Write 82.54 26.42 MB/sec [256K blocks]

Uncached Read 56.97 0.40 MB/sec [4K blocks]

Uncached Read 99.56 18.47 MB/sec [256K blocks]

With the same drive now as an internal:

Results 37.55

System Info

Xbench Version 1.3

System Version 10.6.4 (10F569)

Physical RAM 4096 MB

Model MacBookPro2,2

Drive Type SAMSUNG HM500LI SAMSUNG HM500LI

Disk Test 37.55

Sequential 72.40

Uncached Write 89.13 54.73 MB/sec [4K blocks]

Uncached Write 88.31 49.97 MB/sec [256K blocks]

Uncached Read 41.47 12.14 MB/sec [4K blocks]

Uncached Read 116.40 58.50 MB/sec [256K blocks]

Random 25.35

Uncached Write 8.39 0.89 MB/sec [4K blocks]

Uncached Write 90.11 28.85 MB/sec [256K blocks]

Uncached Read 58.94 0.42 MB/sec [4K blocks]

Uncached Read 95.15 17.66 MB/sec [256K blocks]

Seems like small block performance is about the same or slightly better as an internal drive and large block is better as FW800.  I suppose it is also worth noting that some time had passed between these benchmarks (note 10.6.3 vs 10.6.4)  I originally ran the FW800 test when I first got the enclosure and did the internal test now – about 4 months later.

Popularity: 4% [?]

Adding SSD to MacBook Pro – before and after

I have an older MacBook Pro (Model 2,2 or about 3 years old now, I had upgraded the hard drive awhile back from the stock 120gb drive to a Samsung 500gb drive.  The drive was nice for being able to keep my iTunes library as well as my pictures (I have a SLR camera so lots and lots of RAW images) with me but I would get the “spinning beach ball” a lot and having VMware Fusion open would almost make the whole computer unusable.

I started looking at replacing the Samsung with a solid state drive, Chad Sakac had a really good blog post including some performance numbers on various SSD drives, I was originally leaning towards the 128gb Kingston SSDnow drive as it seemed to be one of the better price/gb SSD’s on the market.

I ended up going with an Intel one however, I really think Intel makes some of the best consumer SSD’s on the market right now.  I picked up the 80gb X25-M G2 and had it installed in no time.

One thing to be aware of:  My MBP is pretty old as I mentioned, and only supports SATA I.

I did a few before and after tests, one using Xbench for disk performance, and a few others simply documenting the boot up time as well as time to open Safari.  Here were my results:

This is Xbench with my old hard drive, you can see random small block reads/writes were awful – both well below 1MB/sec

And now the Xbench results after installing the SSD

Pretty impressive improvement for the random reads/writes I would say but this was more impressive to me:

I ran 3 tests booting up my computer with my old hard drive, each time stopping it once the dock/system menu/desktop icons were loaded.  During the 3 tests I recorded results of 58, 53 and 48 seconds for an average of about 53 seconds from pressing the power button to being fully booted.

I also ran a few tests with Safari, rebooting/clearing cache each time and seeing how long before it opened and was loaded on google.  My results were 7, 17 and 12 seconds for an average of 12 seconds.

I ran the same tests after installing the SSD, for booting up I now was at 22, 21 and 21 seconds for an average of 21.3 seconds, almost 2.5 times faster!

The Safari test was quite a bit harder, basically I would say it started in 1 second each of the 3 times which would be 12 times faster then before.

And perhaps the most important thing, I can now easily run Fusion and all my Mac apps at the same time and still have a responsive system, just need to figure out how to store less junk on the drive now!

Popularity: 16% [?]

Error opening NZB files in Snow Leopard

For some reason in Snow Leopard when you open a .nzb file in Safari it is marked as a quarantined file and gives the error “<filename>.nzb is an application downloaded from the Internet.  Are you sure you want to open it?”

Annoying, I searched a bit for how to get rid of it – I assumed it would be easy, an option to allow *.nzb but it is not.  The two main options I found were to run an Automator script on the Downloads folder (this didn’t work for me) or edit a .plist file which also didn’t work.

Since I already use Hazel (great app btw) I made a script that can handle this for me, it marks the file as safe, opens it automatically with the default application, moves the .nzb file to the trash and makes a growl notification for me.

Screen shot 2009-11-08 at 1.12.21 PM

Popularity: 2% [?]

Must have Mac Software

A friend of mine was asking me what software I am using on my Mac as he is looking to switch from Windows as well, so here is my list:

  • 1Password – Password management app
  • Adium – Trillian like IM client
  • AppZapper – Coming from Windows I was used to having to use a program to uninstall things
  • Blogo – Best blog editor I have found so far
  • ChronoSync – Keep files/folders in sync across computers
  • Dropbox – Sync folders across computers/platforms
  • Evernote – Sync notes across platforms (Mac/Windows/iPhone)
  • Hex Fiend – Hex editor
  • Isolator – Allows me to “dim” all screens but the one I am working in, helps for concentration
  • Jungle Disk – Backing up data to Amazon S3 service
  • Little Snitch – Control incoming/outgoing network connections
  • OmniFocus – GTD app
  • OmniGraffle – Visio alternative for OSX
  • OmniOutliner – Note taking
  • Skim – PDF viewer that lets you take notes within PDF
  • TextMate – Textpad/Ultraedit type text editor
  • Transmit – FTP/sFTP client
  • VMware Fusion
  • Yep – PDF manager, like iPhoto for PDF files


Popularity: 2% [?]