Skip to content

Instantly share code, notes, and snippets.

@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: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: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 / 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: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
#!/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: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
@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:3056161
Created July 5, 2012 20:11
Create an X.509 Signing Cert for AWS IAM User
# Generate the csr / key
openssl genrsa -des3 -out server.key 1024
# Generate the CSR
openssl req -new -key server.key -out server.csr
# Remove the password from the key
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
@weavenet
weavenet / README.md
Last active December 18, 2015 09:39
Rails Vendor Mime Types

Example of using Vendor MIME Types to determine how to route a request coming into a Rails application.