Thursday, August 8, 2013

Tear down and Rebuilding Mac OS X

I recently decided that I needed to reinstall OS X on my iMac. I have been upgrading for years, and I just wanted to have a clean slate. This didn't mean that I wanted to have to a new home directory or anything. I just wanted to clean up after using ports, homebrew, manual installs, etc...

So, to start this project, I decided I would restore my home directory from a time machine back up. That was the easy part. The second part, how will I get Python, Ruby, Git, Vagrant, etc installed and configured quickly... and most importantly if I wanted to do this again how would I go about automating. Enter Boxen. I had read about this and used Puppet to manage farms of Linux servers so it felt like a good fit. After reading the docs... looking at the code... I decided to trust it to rebuild my iMac.

The results? AWESOME! 

I now store my configuration on GitHub... 
My home directory is safe through time machine...

I can rebuild my entire system without worrying about the final state. The coolest thing, is that I can manage pretty much everything I want through Boxen. 

I highly recommend taking a look.

Monday, May 13, 2013

Installing RVM on OS X

I have been dabbling in Ruby development recently and found that it would be handy to use a tool similar to Python Virtualenv. I feel that this makes for a cleaner development environment. After years of tutorials and miscellaneous O'Reilly book examples my Site and Gems are a bit of a mess. So after looking around on Google rvm seemed like a great choice.

Install(From RVM homepage):

 curl -L https://get.rvm.io | bash -s stable --autolibs=3  

Source RVM

 . ~/.rvm/profile or ~/.rvm/bash_profile

Depending on where the installation process put the RVM path.

 NOTE - I had run the command with brew in /usr/local/bin and it kept complaining that it couldn't do the symlink.
Next run:

 rvm requirements  

Then install a version of Ruby. I used 1.9.3 and to do that, I entered the following command:

 rvm install 1.9.3  

Once that was completed, start using your new version by issuing this command:

 rvm use 1.9.3  
Then create a gemset that can be used for a specific project or type of project by typing:
 
 rvm gemset create demonstration  
 rvm gemset use demonstration  

Hopefully you find this useful. I have done the installation twice... and ended up with different install paths. I also found this blog post by Stewgleadlow to be helpful.

Saturday, February 23, 2013

App Engine Puppet Module

I took the Udacity Web Development course over the last couple months. I have been a big fan of Udacity since I read about it last Spring. The course uses Google App Engine to demonstrate building and hosting a web application. The platform is really simple to use and the SDK provides a very easy way to get up and running. I did most of my development on Mac OS X during the course, but since I started using Ubuntu and LXC I wanted a way to quickly build App Engine containers. So I built a Puppet module to do so.

The module can be found at:

http://github.com/cloudnautique/puppet-appengine-python

Hopefully others will find it useful.

Saturday, January 5, 2013

Bootable USB Stick from OS X

Today I got an awesome new toy, a shiny Samsung 840 Pro SSD drive for my super cheap laptop. I decided to do a fresh install of Ubuntu since that is what I had been running. I essentially use my laptop as a stateless device so there was no data to backup. My thinking was that I would shutdown laptop and swap the drive while I created a new bootable USB drive on my Mac desktop.

 Canonical has a nice set of instructions linked off the download page that tell you how to create said USB boot stick from the image. These can be found:

 http://www.ubuntu.com/download/help/create-a-usb-stick-on-mac-osx

These instructions are absolutely 100% correct, but there is a subtlety that caused me to waste an hour. I  kept using the partition and not the disk:

 /dev/disk4s1 instead of /dev/disk4

I had looked at: df /Volumes/<Mounted partition>

and of course that showed the slice. So I write this:

1. So I won't forget =D
2. Someone else might stumble upon it and find it helpful.

Also, the instructions say "using rdisk might be faster" I have found it to be significantly faster.