Skip to content

Instantly share code, notes, and snippets.

@dizz
dizz / gist:5310052
Created April 4, 2013 12:42
example vagrantfile
dhostname = "devstack.local"
Vagrant::Config.run do |config|
config.vm.define :devstack do |devstack_config|
devstack_config.vm.box = "precise64"
devstack_config.vm.box_url = "http://files.vagrantup.com/precise64.box"
# devstack_config.vm.boot_mode = :gui
@dizz
dizz / gist:5309928
Created April 4, 2013 12:23
vagrant help output
➜ ~ vagrant help
Usage: vagrant [-v] [-h] command [<args>]
-v, --version Print the version and exit.
-h, --help Print this help.
Available subcommands:
box
destroy
gem
@dizz
dizz / gist:3861864
Created October 9, 2012 22:30 — forked from ffeldhaus/gist:3861740
rOCCI awesomeness
irb -I lib/
1.9.3p194 :001 > require 'occi'
=> true
1.9.3p194 :002 > network=OCCI::Core::Entity.new 'http://schemas.ogf.org/occi/infrastructure#network'
=> {
"kind": "http://schemas.ogf.org/occi/infrastructure#network"
}
1.9.3p194 :003 > network.class
=> Occi::Infrastructure::Network
1.9.3p194 :004 > network.class.superclass
@dizz
dizz / register_host.sh
Created October 8, 2012 08:56
Register host with foreman
#! /bin/sh
#
FOREMAN_URL="http://192.168.56.2:3000"
NAME=$1
MAC=$2
HOSTGROUP_ID=$3 # Change this to your favorite hostgroup
curl -s -H "Accept:application/json" \
-d "host[name]=$NAME" -d "host[hostgroup_id]=$HOSTGROUP_ID" \
@dizz
dizz / simple_os.rb
Created October 8, 2012 08:55
Simple Fog.io script
require 'rubygems'
require 'fog'
conn = Fog::Compute.new({
:provider => :openstack,
:openstack_api_key => "admin",
:openstack_username => "admin",
:openstack_auth_url => "http://aio.cloudcomplab.ch:5000/v2.0/tokens"
})
@dizz
dizz / gist:3778884
Created September 24, 2012 22:37
nova::api usage
class { 'nova::api':
enabled => true,
admin_password => $nova_user_password,
enabled_apis => 'occiapi,ec2,osapi_compute,osapi_volume,metadata'
}
@dizz
dizz / gist:3720930
Created September 14, 2012 09:13
install apt-cacher-ng
sudo apt-get install apt-cacher-ng
@dizz
dizz / gist:3718175
Created September 13, 2012 22:26
create apt-cacher reports
sudo /usr/share/apt-cacher/apt-cacher-report.pl
@dizz
dizz / gist:3718171
Created September 13, 2012 22:26
apt-cacher config
interface=eth1
path_map = ubuntu ch.archive.ubuntu.com/ubuntu;
allowed_hosts = *
generate_reports = 1
@dizz
dizz / gist:3718168
Created September 13, 2012 22:26
install apt-cacher
sudo apt-get install apt-cacher