Skip to content

Instantly share code, notes, and snippets.

View pjkelly's full-sized avatar

PJ Kelly pjkelly

  • Orange County, CA
View GitHub Profile
@pjkelly
pjkelly / setup-vmware-image-with-static-IP.markdown
Created July 7, 2011 01:06
VMWare Fusion Images with a static IP Address on Mac OS X Snow Leopard

How to setup your VMWare Fusion images to use static IP addresses on Mac OS X

At Crush + Lovely, we use Railsmachine's Moonshine to automate the configuration of our servers. When writing our deployment recipes, VMWare Fusion's ability to take snapshots and rollback to these snapshots is a huge timesaver because it takes just seconds to roll a server image to it's original state.

When you're just configuring a single server, having a static IP address for your server image isn't too important, but when you're configuring multi-server setups, it can be useful to duplicate a number of server images and give each a static IP address so you can consistently deploy to them. While not documented well at all, it turns out that this is relatively easy to accomplish in four simple steps.

1. Determine the MAC address of your guest machine

Let's say you have a guest machine with the name ubuntu-lucid-lynx-base a

@pjkelly
pjkelly / install-apt-file.sh
Created July 7, 2011 01:00
Not sure what apt-get package contains a file?
# credit: http://crshlv.ly/qkAzW0
#
# I found this especially useful when trying
# to figure out equivalent apt-get packages
# for certain Perl CPAN modules.
apt-get install apt-file
apt-file update
apt-file search URI::Escape

On the iMac:

brew install --HEAD --force riak -v

On the MacBook

brew update
# get Erlang R14B03
brew install erlang

install the HEAD riak (and NOT also install HEAD Erlang.)

$('ul#quiz-answers li');
$('ul#quiz-answers li:first').animate({
top: '148px'
}, {
duration: 1000,
step: function( now, fx ){
console.log(now);
// $( "ul#quiz-answers li:gt(0)" ).css( "top", now );
}
});
@pjkelly
pjkelly / moonshine-passenger-issues.sh
Created March 16, 2011 18:28
Output occurring since upgrading to Passenger 3.0.5 even after the recent freezing of 3.0.4 in Moonshine.
** [out :: myapp.com] notice: /ApplicationManifest#37495940/Package[passenger]/ensure: ensure changed '3.0.5' to '3.0.4'
** [out :: myapp.com] err: /ApplicationManifest#37495940/Exec[build_passenger]/returns: change from notrun to 0 failed: sudo /usr/bin/ruby -S rake clean apache2 returned 1 instead of 0
** [out :: myapp.com] notice: /ApplicationManifest#37495940/File[/etc/apache2/mods-available/passenger.load]: Dependency exec[sudo /usr/bin/ruby -S rake clean apache2] has 1 failures
** [out :: myapp.com] warning: /ApplicationManifest#37495940/File[/etc/apache2/mods-available/passenger.load]: Skipping because of failed dependencies
** [out :: myapp.com] notice: /ApplicationManifest#37495940/File[/etc/apache2/mods-available/passenger.conf]: Dependency exec[sudo /usr/bin/ruby -S rake clean apache2] has 1 failures
** [out :: myapp.com] warning: /ApplicationManifest#37495940/File[/etc/apache2/mods-available/passenger.conf]: Skipping because of failed dependencies
** [out :: myapp.com] notice: /ApplicationManifest
@pjkelly
pjkelly / track-development-branch.sh
Created March 10, 2011 17:08
Track and switch to the revised-data-delivery branch of the OMN repository.
git fetch origin
git config branch.revised-data-delivery.remote origin
git config branch.revised-data-delivery.merge refs/heads/revised-data-delivery
git checkout revised-data-delivery
@pjkelly
pjkelly / liveset-link-and-button-helpers.markdown
Created February 16, 2011 19:18
Methods and example output for all four Liveset link & button helper methods.

First, let's install a new version of Ruby. You can accept the default settings it suggests

mkdir -p ~/src
cd ~/src
curl -OL http://rubyforge.org/frs/download.php/71096/ruby-enterprise-1.8.7-2010.02.tar.gz
tar xzvf ruby-enterprise-*.tar.gz
sudo ./ruby-enterprise-*/installer
@pjkelly
pjkelly / DevelopmentEnvironmentInstructions.markdown
Created December 13, 2010 17:13
Instructions for setting up a Rails development environment using Cinderella

These instructions are for Snow Leopard only.

XCode

Ensure that you have XCode for the version of OS X you're running. These are not installed by default on new machines and can be installed off the OS installation DVD. If you're not sure, run the following command. It should return something like this: /usr/bin/gcc; if it does not, you need to install XCode.

which gcc

SSH Keys

@pjkelly
pjkelly / symlink-imagemagick
Created December 11, 2010 05:46
symlink imagemagick installed via homebrew to /usr/local