Skip to content

Instantly share code, notes, and snippets.

View DavidWittman's full-sized avatar

David Wittman DavidWittman

View GitHub Profile
@DavidWittman
DavidWittman / default.vcl
Created June 1, 2012 19:46
Varnish VCL to detect and redirect file uploads
backend default {
.host = "127.0.0.1";
.port = "8080";
}
backend master {
.host = "10.x.x.x";
.port = "80";
}
sub vcl_recv {
# Any uploads or restarts should go to the master backend
@DavidWittman
DavidWittman / lsyncd.lua
Created June 21, 2012 00:14
Lsyncd alternate SSH key
settings = {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd-status.log",
statusInterval = 20
}
servers = {
"web02",
"web03"
}
@DavidWittman
DavidWittman / 1z0873-notes.md
Last active December 10, 2015 04:48
MySQL DBA exam 1Z0-873 Notes

Notes from the DBA Exam (Part 1)

Note: for questions where you can select multiple answers, it will tell you how many to choose.

Overview

  • Lots of InnoDB and transactional stuff
  • Understand everything about locking

Specific questions

OpenStack Summit Images Talk

Who we are

Rackspace Private Cloud. We install and operate Openstack clusters, both locally in our datacenters, and remotely in customer datacenters.

Reference Alamo v3?

What are we talking about?

Automating base image builds for OpenStack private clouds.

@DavidWittman
DavidWittman / tokenreaper.sql
Last active December 14, 2015 09:08
MySQL scheduled event to remove Keystone authentication tokens expired for over one week.
USE keystone
-- This needs to be set in the my.cnf to persist
SET GLOBAL event_scheduler = 1;
DELIMITER $$
CREATE EVENT tokenreaper
ON SCHEDULE EVERY 1 WEEK
DO BEGIN
DELETE FROM `token` WHERE expires <= DATE_SUB(NOW(), INTERVAL 1 WEEK);
END $$
DELIMITER ;
@DavidWittman
DavidWittman / neutron-scope
Last active December 20, 2015 00:39
neutron-scope: Run a command in the network namespace of an OpenStack server by name or ID
#!/bin/bash
# neutron-scope
#
# Run a command in the network namespace of an OpenStack server
#
# Pro-tip: The string _IP_ is replaced with the first IP address of the server
# e.g. neutron-scope my-server ssh root@_IP_
set -e
@DavidWittman
DavidWittman / keystone-update-password.sh
Last active December 21, 2015 08:08
Allows a non-admin OpenStack user to update their password using Keystone's User CRUD extensions
#!/usr/bin/env bash
#
# Allows a non-admin OpenStack user to update their password using
# Keystone's User CRUD extensions
#
# Usage: keystone-update-password.sh <new password>
#
# Requires curl, python-keystoneclient to fetch the auth tokens,
# and expects the user's OS_* environment variables to be exported
# in the current environment.
DEPLOY_SCRIPT_URL = "https://github.com/rsoprivatecloud/openstack-chef-deploy/raw/master/deploy.sh"
Vagrant.configure("2") do |config|
config.vm.box = "dummy"
config.vm.synced_folder './vagrant', '/vagrant'
config.ssh.private_key_path = File.expand_path("~/.ssh/id_rsa")
ENV['VAGRANT_DEFAULT_PROVIDER'] = "rackspace"
config.vm.provider :rackspace do |rs, override|
@DavidWittman
DavidWittman / quantum-ovs-bridges.conf
Last active December 24, 2015 03:49
Upstart job to automatically bring up OVS bridges at boot time
description "Quantum Open vSwitch bridge ifup"
author "David Wittman <david.wittman@rackspace.com>"
start on started quantum-plugin-openvswitch-agent
console log
# Use post-start script instead of script so it only runs once
post-start script
SLEEP=10
@DavidWittman
DavidWittman / openvswitch-bridges
Last active December 24, 2015 08:19
Init script to bring up Open vSwitch bridges at boot time on Ubuntu/Debian
#!/bin/bash
#
# openvswitch-bridges
#
# Brings up Open vSwitch bridges at boot time on Ubuntu/Debian.
# Needs to start _after_ the OVS services. This usually works:
#
# update-rc.d openvswitch-bridges defaults 21
#
### BEGIN INIT INFO