Skip to content

Instantly share code, notes, and snippets.

@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"
@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
#!/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 / 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/
@hhoover
hhoover / Berksfile
Last active December 25, 2015 17:09
Copy/paste for chef class
site :opscode
cookbook 'apt'
cookbook 'build-essential'
cookbook 'python'
metadata
@hhoover
hhoover / Vagrantfile
Last active January 3, 2016 22:29
Vagrantfile for Chef Dev Bastion
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure('2') do |config|
config.vm.box = 'dummy'
config.vm.box_url = 'https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box'
config.vm.provision 'shell', inline: <<-EOF
apt-get update
apt-get -y install curl git vim zlib1g-dev libssl-dev libreadline6-dev libyaml-dev libxml2-dev libxslt-dev build-essential
@hhoover
hhoover / .kitchen.local.yml
Created January 20, 2014 22:02
Test-Kitchen files for Rackspace (chef training)
driver_config:
rackspace_username: USERNAME
rackspace_api_key: APIKEY
public_key_path: /root/.ssh/id_rsa.pub
@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
case node['recipes']
when 'cookbook::recipe'
take some action
when 'cookbook::other_recipe'
take other action
end
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