Skip to content

Instantly share code, notes, and snippets.

@dolph
dolph / openstack-selftest.sh
Created November 7, 2011 17:43 — forked from anotherjesse/openstack.sh
OpenStack testing using devstack & openstack-integration-tests
#!/usr/bin/env bash
# perform any necessary updates
apt-get update
apt-get upgrade -y
# install git so we can download devstack & integration tests
apt-get install git -y
# download, configure, and run devstack
git clone https://github.com/cloudbuilders/devstack.git
cd devstack
echo KEYSTONE_REPO=git://github.com/openstack/keystone.git >> localrc
@dolph
dolph / yubico_demo.py
Created November 18, 2011 20:22
Yubikey Registration & Authentication Demo
# pip install yubico
from yubico import yubico
# Yubico API credentials
YUBICO_CLIENT_ID = '6634'
YUBICO_SECRET_KEY = 'HdRb8AA24+Ud8VL2E+sEEZUiySg='
# Initialize our Yubico API access
YUBICO = yubico.Yubico(YUBICO_CLIENT_ID, YUBICO_SECRET_KEY)
@dolph
dolph / config.ini
Created November 25, 2011 17:15
OpenStack Integration (Self) Test Configuration
[environment]
aki_location = include/sample_vm/natty-server-cloudimg-amd64-vmlinuz-virtual
#ari_location = include/sample_vm/natty-server-cloudimg-amd64-loader
ami_location = include/sample_vm/natty-server-cloudimg-amd64.img
[swift]
auth_host = 127.0.0.1
auth_port = 443
auth_prefix = /auth/
auth_ssl = yes
@dolph
dolph / .gvimrc
Created January 20, 2012 13:52
Vim Configuration
set guifont=Menlo\ Bold:h16
@dolph
dolph / serialize.py
Created February 10, 2012 21:10
Dict to XML serialization
"""
Dict to XML serializer.
The identity API prefers attributes over elements, so we serialize that way
by convention, and TODO(dolph): configure exceptions.
"""
from lxml import etree
@dolph
dolph / .vimrc
Created August 28, 2012 12:09
vim config
" set color theme
colorscheme ir_black
" change the leader to be a comma vs slash
let mapleader=","
" syntax highlighing
syntax on
" display line numbers
@dolph
dolph / n
Created August 28, 2012 14:35
Notify after long running script
#!/bin/bash
# Run and time the command, including arguments with spaces
time $*
# notify the user using libnotify
notify-send --icon=next "Execution Complete" "$*" &
@dolph
dolph / gist:3558879
Created August 31, 2012 20:56
Debian wheezy setup
# add yourself as a sudo user
su
apt-get update
apt-get install -V -y sudo
# username ALL=(ALL:ALL) ALL
visudo
exit
sudo apt-get update
sudo apt-get install -V -y virtualbox-guest-x11
def encode(number):
"""Converts an integer to a base36 string."""
alphabet = '0123456789abcdefghijklmnopqrstuvwxyz'
if isinstance(number, (float)) and int(number) == number:
number = int(number)
if not isinstance(number, (int, long)):
raise TypeError('number must be an integer')
@dolph
dolph / .bashrc
Created September 4, 2012 13:25
Bash Customization
source ~/Environments/os/bin/activate
alias e=gvim
export GREP_OPTIONS='--color=auto'