Skip to content

Instantly share code, notes, and snippets.

@mipearson
mipearson / remote.rb
Created March 23, 2011 04:21
Example of an API for something that allows you to run commands on a remote system
# Remote system usage
Host.new('ubuntu', 'my.host.com', :identity_file => 'key.pem').within do
# Basic usage
run "sudo stop mysqld"
# Copying files
upload 'file' 'remote_file'
download 'remote_dir', 'dir'
# Filesystem inspection
Given I have a fresh Ubuntu instance
And the security group for the instance allows HTTP requests
When I apply the node role 'passenger' to the instance
And I deploy a stub Rails application to the instance
Then the instance should serve the stub rails application
Given I have a fresh Ubuntu instance
And the security group for the instance allows MongoDB requests
When I apply the node role 'mongodb' to the instance
Then the instance should provide a MongoDB server
10:20 < Holocaine> mp: You're making my point for me.
10:20 < Holocaine> mp: You go to the guy and say "SURE, WE CAN DO THAT, HERE ARE THE ISSUES" *drops 100 page
document on desk*
10:20 < mp> yeah
10:20 < mp> but I hate doing that
10:20 < mp> I just like doing shit
10:20 < mp> and everybody should agree with me all the time
10:21 < mp> without me having to provide supporting documentation.
10:21 < mp> fuckers.
10:21 < Holocaine> * mp is now known as ZedShaw
@mipearson
mipearson / ruby-1.9.2_rubygems-1.4.2.log
Created April 11, 2011 05:29
ruby 1.9.2 and rubygems 1.4.2 are not friends
[2011-04-11 15:14:35] GEM_PATH="/Users/mipearson/.rvm/gems/ruby-1.9.2-p180@global:/Users/mipearson/.rvm/gems/ruby-1.9.2-p180@global:/Users/mipearson/.rvm/gems/ruby-1.9.2-p180@global" GEM_HOME="/Users/mipearson/.rvm/gems/ruby-1.9.2-p180@global" "/Users/mipearson/.rvm/rubies/ruby-1.9.2-p180/bin/ruby" "/Users/mipearson/.rvm/src/rubygems-1.4.2/setup.rb"
/Users/mipearson/.rvm/src/rubygems-1.4.2/lib/rubygems/source_index.rb:62:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError)
from /Users/mipearson/.rvm/src/rubygems-1.4.2/lib/rubygems/source_index.rb:52:in `from_installed_gems'
from /Users/mipearson/.rvm/src/rubygems-1.4.2/lib/rubygems.rb:914:in `source_index'
from /Users/mipearson/.rvm/src/rubygems-1.4.2/lib/rubygems/gem_path_searcher.rb:83:in `init_gemspecs'
from /Users/mipearson/.rvm/src/rubygems-1.4.2/lib/rubygems/gem_path_searcher.rb:13:in `initialize'
from /Users/mipearson/.rvm/src/rubygems-1.4.2/lib/rubygems.rb:873:in `new'
@mipearson
mipearson / bundler__lib__bundler__index.rb
Created May 23, 2011 23:49
Attempting to speed up bundler's index.rb
module Bundler
class Index
include Enumerable
def self.build
i = new
yield i
i
end
@mipearson
mipearson / gist:987942
Created May 24, 2011 00:47
stop breaking shit, ruby devs
L1204AP-MICHAELP:gofer mipearson$ rake release --trace
rake aborted!
undefined method `desc' for #<Bundler::GemHelper:0x00000100b01b38>
/Users/mipearson/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/gem_helper.rb:24:in `install'
/Users/mipearson/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/gem_helper.rb:9:in `install_tasks'
/Users/mipearson/git/gofer/Rakefile:2:in `<top (required)>'
/Users/mipearson/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load'
/Users/mipearson/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/mipearson/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/application.rb:495:in `raw_load_rakefile'
/Users/mipearson/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/application.rb:78:in `block in load_rakefile'
@mipearson
mipearson / gist:992489
Created May 26, 2011 03:27
Failed migrate-3.2.7 run on ubuntu 11.04
buntu@ip-10-131-18-9:~/migrate-3.2.7/src$ ./configure --enable-sse2 && make -k
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
./configure: line 1912: svn: command not found
./configure: line 1913: svn: command not found
checking for gmake... make
Linux
===============================
@mipearson
mipearson / string3.h
Created May 26, 2011 03:31
/usr/include/bits/string3.h from ubuntu 11.04
/* Copyright (C) 2004, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@mipearson
mipearson / migrate-bootstrap.sh
Created July 24, 2011 07:35
Bootstrap migrate-n on a fresh ubuntu 10.04 system
#!/usr/bin/bash
set -e
set -v
sudo apt-get update
sudo apt-get install -y libopenmpi-dev build-essential openmpi-bin screen sendmail
sudo apt-get upgrade
wget http://popgen.sc.fsu.edu/currentversions/migrate-3.2.15.linuxubuntu.tar.gz
tar -xzvf migrate-3.2.15.linuxubuntu.tar.gz
@mipearson
mipearson / ruby19.spec
Created August 2, 2011 07:35
Ruby 1.9.2 specfile
Summary: Ruby 1.9.2
Name: ruby19
Version: 1.9.2p290
Release: 1
Source0: ruby-1.9.2-p290.tar.gz
License: GPL
Group: PlayUp
BuildArch: x86_64
BuildRoot: %{_tmppath}/%{name}-buildroot
%description