Skip to content

Instantly share code, notes, and snippets.

@hhoover
hhoover / Vagrantfile1
Last active December 22, 2015 20:19
Dummy Vagrantfiles
Vagrant.configure("2") do |config|
config.vm.box = "rax"
config.ssh.private_key_path = "~/.ssh/id_rsa_my_private_key"
config.vm.provider :rackspace do |rs|
rs.username = "YOUR USERNAME"
rs.api_key = "YOUR API KEY"
rs.flavor = /512MB/
rs.image = /Ubuntu 12.04/
#!/bin/bash
STOP=$(($(date +%s)+300))
COMPLETE_FILE="/tmp/automation-complete"
ME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/$( basename ${BASH_SOURCE[0]} )"
while [[ ! -f "${COMPLETE_FILE}" && $(date +%s) -lt ${STOP} ]];
do
sleep 1
done
rm -f ${ME} ${COMPLETE_FILE}
@hhoover
hhoover / gist:3761650
Created September 21, 2012 14:06
git/Jenkins setup
apt-get -y install git
su - jenkins
git config --global user.name "Jenkins"
git config --global user.email "youremail@yourbusiness.com"
ssh-keygen -t rsa # You can use the default options here. Don't set a password.
cat .ssh/id_rsa.pub # Add this key to your Github account
ssh git@github.com # Add Github to your know_hosts file
@hhoover
hhoover / lscloudkick.sh
Created August 9, 2011 20:35
lscloudkick function
#!/bin/bash
function ostype() {
if [ -e /etc/redhat-release ]; then
export distro="Redhat/CentOS"
else
if [ "$(lsb_release -d | awk '{print $2}')" == "Ubuntu" ];then
export distro="Ubuntu"
machine 'mysql-master' do
machine_options ssh_username: 'root',
bootstrap_options: {
key_name: 'id_rsa',
flavor_id: 'onmetal-io1',
image_id: 'd22ea57e-e12e-4a0a-ad6b-680dd676fd7c'
}
recipe 'apt'
recipe 'mysql::server'
tag 'database'
node.set['apt']['compile_time_update'] = true
include_recipe 'apt'
node.set['build-essential']['compile_time'] = true
include_recipe 'build-essential'
chef_gem 'chef-metal' do
version '0.11.2'
action :install
end
case node['recipes']
when 'cookbook::recipe'
take some action
when 'cookbook::other_recipe'
take other action
end
@hhoover
hhoover / django-single.yaml
Created April 7, 2014 18:32
django-single.yaml
heat_template_version: 2013-05-23
description: |
Heat template to deploy a single Django server
parameters:
database_host:
description: Cloud Database hostname.
type: string