Skip to content

Instantly share code, notes, and snippets.

View lusis's full-sized avatar

John E. Vincent lusis

View GitHub Profile
#! /usr/bin/env python
import fileinput
import argparse
from operator import itemgetter
parser = argparse.ArgumentParser()
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int)
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+')
args = parser.parse_args()
# If x86
if node[:kernel][:machine] =~ /^(x|i[3456])86$/i
# Do something
end
# If amd64/x86_64 (same thing)
if node[:kernel][:machine] =~ /^(x86_|amd)64$/i
# Do something
end
@lusis
lusis / knife.json
Created July 21, 2011 02:00
knife node edit stagingutil
1 {
2 "normal": {
"myapp": {
"myattr":"node specific value"
},
3 "tags": [
4
5 ]
6 },
7 "name": "stagingutil",
@lusis
lusis / gist:1047214
Created June 26, 2011 03:58 — forked from rowan-m/gist:1026918
update jenkins Updatecenter from CLI
$ java -jar jenkins-cli.jar -s http://localhost:9000 install-plugin findbugs
findbugs is neither a valid file, URL, nor a plugin artifact name in the update center
No update center data is retrieved yet from: http://updates.jenkins-ci.org/update-center.json
findbugs looks like a short plugin name. Did you mean 'null'?
# Specifying a full URL works!
$ java -jar jenkins-cli.jar -s http://localhost:9020 install-plugin http://updates.jenkins-ci.org/download/plugins/AdaptivePlugin/0.1/AdaptivePlugin.hpi
# Get the update center ourself
class Attendee < Ohm::Model
attribute :email
attribute :hash
attribute :group
attribute :prefix
attribute :ami_instance
attribute :confirmed
index :hash
index :confirmed
#!/usr/bin/env bash
set -e
builddir="build/monolithic"
mkdir -p $builddir
# Copy gems
for path in $(echo "$GEM_PATH" | tr ":" " "); do
echo "Copying $path"
rsync -a "$GEM_HOME/" $builddir/gem
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# download the Node source, compile and install it
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
# install the Node package manager for later use
bash -c '
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
yum install -q -y sudo gcc gcc-c++ automake autoconf make readline-devel.x86_64 libffi-devel.x86_64 libyaml-devel.x86_64 zlib-devel.x86_64 openssl-devel.x86_64 wget
# This may not be necessary for you
yum remove -q -y ruby-libs ec2-ami-tools
wget http://someurl.domain.com/ruby-1.9.2p180_x86_64.rpm -O /tmp/ruby-1.9.2p180_x86_64.rpm
yum localinstall --nogpgcheck -q -y /tmp/ruby-1.9.2p180_x86_64.rpm
" Vim color file
" Converted from Textmate theme Twilight using Coloration v0.2.5 (http://github.com/sickill/coloration)
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
files = directory.files.all
truncated = files.is_truncated
while truncated
set = directory.files.all( :marker => files.last.key )
truncated = set.is_truncated
files = files + set
end