This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
require 'yajl/json_gem' | |
post '/' do | |
@push = Yajl::Parser.new(:symbolize_keys => true).parse(params[:payload]) | |
appdir="/home/blackflag/app" | |
@output= Kernel.system("cd #{appdir}/shared/cached-copy && git pull origin master && cap deploy") | |
puts "\n output = #{@output} \n" | |
puts "I got some JSON: #{@push.inspect}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
# | |
# Install Ubuntu desktop (Gnome) | |
# Based on http://run.alestic.com/install/desktop | |
# Tested on: | |
# | |
# | |
export DEBIAN_FRONTEND=noninteractive | |
sudo -E apt-get update | |
sudo -E apt-get upgrade -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
# install cloudkick agent | |
# generate and/or get your key and secret from https://www.cloudkick.com/a/username/oauth/apps/ | |
OAUTH_KEY='key' | |
OAUTH_SECRET='secret' | |
APP_NAME='example2' | |
NAME=`curl 169.254.169.254/latest/meta-data/local-hostname` | |
echo "oauth_key $OAUTH_KEY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
require 'yajl/json_gem' | |
# Very simple git post-receive hook service to update and deploy a capistrano enabled rails app | |
post '/' do | |
@push = Yajl::Parser.new(:symbolize_keys => true).parse(params[:payload]) | |
puts "I got some JSON: #{@push.inspect}" | |
Kernel.system("cd ~/app/shared/cached-copy && git pull origin master && cap deploy") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allow the metal piece to run in isolation | |
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails) | |
class Authentication | |
def self.call(env) | |
#bypass auth for now | |
return [404, {"Content-Type" => "text/html"}, ['authorized']] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# =========================================================== | |
# = configuration variables = | |
export EXT_IFACE='eth1' | |
export EXT_NET='10.211.55.0/24' | |
export EXT_IP='10.211.55.12/32' | |
export OPEN_TCP_PORTS="22,25,80,443" | |
export INT_IFACE='eth0' | |
export INT_NET='192.168.4.74/24' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ $# != 5 ]; then | |
echo "Utility for setting up NAT forwarding to VBox guests" | |
echo "Usage: $0 GUEST SERVICE PROTOCOL GUESTPORT HOSTPORT" | |
echo "E.g. $0 \"Linux Guest\" guestssh TCP 22 2222" | |
echo "NOTE: Port forwarding will only affect stopped VMs" | |
exit 1 | |
fi | |
guest=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install | |
url --url http://10.15.0.50/centos/5/os/x86_64/ | |
lang en_US.UTF-8 | |
rootpw --iscrypted $1$Hi/9xDlZ$nrLa2780lRFXv4QPEK./I0 | |
firewall --disabled | |
authconfig --enableshadow --enablemd5 | |
selinux --permissive | |
timezone America/Los_Angeles | |
bootloader --location=mbr --driveorder=xvda --append="console=xvc0" | |
clearpart --all --initlabel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#tar -zxvf ubuntu-9.10-server-uec-amd64.tar.gz | |
# loopback mount, and chmod 444 loop/etc/init.d/ec2* | |
kvm -kernel karmic-server-uec-amd64-vmlinuz-virtual -initrd karmic-server-uec-amd64-initrd-virtual -m 256 -append root=/dev/sda -enable-kvm -k en-us -drive file=karmic-server-uec-amd64.img,if=scsi,media=disk,boot=on -snapshot -net user |