Skip to content

Instantly share code, notes, and snippets.

View ELLIOTTCABLE's full-sized avatar
🐫

ELLIOTTCABLE

🐫
View GitHub Profile
@ELLIOTTCABLE
ELLIOTTCABLE / gist:11517
Created September 19, 2008 01:22
Things to remember to do before bundling an AMI
Things to remember to do before bundling an AMI
===============================================
rm -rf /etc/ssh/ssh_host_*
export EC2_AMITOOL_HOME=/usr/local/ec2
modprobe loop
rm -rf /mnt/arch*
rm -rf ~/.bash_history
/usr/local/ec2/bin/ec2-bundle-vol --generate-fstab --no-inherit -d /mnt -p arch -r i386 -u <your userid> -k /mnt/pk-<yourkey>.pem -c /mnt/cert-<yourcert>.pem
/usr/local/ec2/bin/ec2-upload-bundle -m /mnt/arch.manifest.xml -b <bucket name> -a <your access> -s <your secret key>
class String
alias_method :__scan__, :scan
def scan *args
res = __scan__ *args
if res.first.is_a? Array and res.first.size == 1
res.map! {|a| a.first }
end
res
end
-- git mv ./fobash: $1: unbound variable
obar/som-bash: $1: unbound variable
ething
sudo ./configure --enable-largefiles --enable-menu --enable-color-console \
--enable-apple-remote --enable-macosx-finder-support --enable-macosx-bundle \
--enable-libavutil_a --enable-libavcodec_a --enable-libavformat_a \
--enable-libavutil_so --enable-libavcodec_so --enable-libavformat_so \
--enable-theora
Checked out revision 27655.
[Mon Sep 22 - 01:25:35] [elliottcable @ Geoffrey] [/usr/local/src/]
-- sudo cp mplayer/ mp
mp2bug mpic++ mpicc mpicxx mpiexec mpif77 mpif90 mpirun mplayer/
[Mon Sep 22 - 01:25:35] [elliottcable @ Geoffrey] [/usr/local/src/]
-- sudo cp mplayer/ mplayer/
Display all 117 possibilities? (y or n)
[Mon Sep 22 - 01:25:35] [elliottcable @ Geoffrey] [/usr/local/src/]
-- sudo cp mplayer/ mplayer~
cp: mplayer/ is a directory (not copied).
Dear campus community:
As the daylight hours begin to decrease and both the human and moose traffic on campus
picks up, the Campus Response Team (CRT) would like to remind you to be aware of your
surroundings as you travel around on campus.
...
Have a safe and productive fall semester!
def x(*a); end; method(:x).arity
# => -1
lambda {}.arity
# => -1
def x; end; method(:x).arity
# => 0
lambda {|| }.arity
# => 0
# Need the space so we don't see Module#attr_*#attr_reader
describe ' #attr_reader', :shared => true do
it 'should create a reader method from a single symbol' do
@class.instance_eval do
attr_reader :foo
end
@class.new.should respond_to :foo
end
end
attr_accessor :foo
def foo
@foo ||= :default
end
class Foo
def self.inherited klass
klass.send :class_variable_set, :@@attribute_initializations, []
klass.send :define_method, :bar do
self.class.send :class_variable_get, :@@attribute_initializations
end
end
end
class A < Foo