Skip to content

Instantly share code, notes, and snippets.

@weavenet
weavenet / gist:3055651
Created July 5, 2012 18:50
Example of using FPM to build an ec2-tools RPM.
cd /tmp
umask 022
wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip
unzip ec2-api-tools.zip
fpm -s dir -t rpm -n intu-amzn-ec2-tools -v 1.5.5.0 -p /tmp/intu-amzn-ec2-tools-1.5.5.0.rpm --prefix=/usr -C /tmp/ec2-api-tools-1.5.5.0 lib bin
@weavenet
weavenet / gist:2844210
Created May 31, 2012 15:36
Update Git Submodule
cd chef-repo
git submodule init ; git submodule update
cd cookbooks
git checkout master
git pull
#!/bin/bash
#---------------------------------------------------------------
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
@weavenet
weavenet / gist:1683492
Created January 26, 2012 16:03
Pull Metadata From Cloud Formation And Run Chef
#!/bin/bash
if [ `whoami` != root ]; then
echo "---- Please run this as the 'root' user";
exit 1
fi
# Static settings
dir=/etc/chef/lwe-repo
md_file=/etc/chef/metadata.json
@weavenet
weavenet / ssh_wrapper.sh.erb
Created January 17, 2012 06:15 — forked from cwjohnston/ssh_wrapper.sh.erb
an example ssh wrapper script to be used with the chef deploy resource
#!/bin/bash
ssh -i<%= @node[:deploy][:key_path] %>/<%= @appname %>_deploy_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $1 $2
@weavenet
weavenet / gist:1621166
Created January 16, 2012 14:41
Install AWS Cloud Init On RHEL 6u2
#!/bin/bash
# For latest cloud init source see
# http://aws.amazon.com/developertools/4026240853893296
# Download archive
wget https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-1.0-6.zip
# Unzip archive
unzip aws-cfn-*.zip
@weavenet
weavenet / gist:1607226
Created January 13, 2012 16:07
Create x.509 Cert To Upload To AWS IAM Account
#!/bin/bash
# Create an open ssl cert and key to upload to IAM account
NAME=$1
if [ -z $1 ]; then
echo 'Plese provide a cert name.'
exit 1
fi
@weavenet
weavenet / gist:1603442
Created January 12, 2012 22:07
Build Libevent RPM using FPM
yum -y install rpm-build
wget http://monkey.org/~provos/libevent-1.3e.tar.gz
tar zxpfv libevent*
cd libevent* ; ./configure; make ; make install DESTDIR=/tmp/intu-rhel5-libevent-1.3e
fpm --prefix=/ -s dir -t rpm -n intu-libevent -v 1.3e -C /tmp/intu-rhel5-libevent-1.3e -p /tmp/intu-rhel5-libevent-1.3e.rpm
@weavenet
weavenet / gist:1601349
Created January 12, 2012 16:09
Build Image Magick RPM on RHEL5 using FPM
#!/bin/bash
# Fucking umask!!!
umask 022
# Get image magic source
cd /var/tmp
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
# Extract source
@weavenet
weavenet / gist:1597127
Created January 11, 2012 22:20
Build Ruby 1.8.7p174 RPM on RHEL5u6 using FPM
#!/bin/bash
# Fucking umask!!!
umask 022
# Install epel yum repo
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# Install deps for ruby build
yum install -y gcc rpm-build readline-devel.x86_64 libffi-devel.x86_64 libyaml-devel.x86_64 zlib-devel.x86_64 openssl-devel.x86_64 wget