Skip to content

Instantly share code, notes, and snippets.

View DavidWittman's full-sized avatar

David Wittman DavidWittman

View GitHub Profile
@DavidWittman
DavidWittman / vlan-check.sh
Last active January 27, 2022 20:02
Validates the VLAN configuration on an interface by creating a tagged subinterface, assigning the next available address, and sending a ping to the provided gateway IP address.
#!/usr/bin/env bash
# vlan-check.sh
#
# Validates the VLAN configuration on an interface
# by creating a tagged subinterface, assigning the
# next available address, and sending a ping to the
# provided gateway IP address.
#
# Supports Ubuntu and RHEL/CentOS. I think.
@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.
@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 / saltstack-devstack.md
Last active March 29, 2018 15:36
Automated DevStack deployments on Rackspace with salt-cloud

Automated DevStack deployments on Rackspace with salt-cloud

Preparation

Install salt-master and salt-cloud

These instructions will install salt-master and salt-cloud on recent Ubuntu releases. Consult the SaltStack Installation Documentation should you require instructions for other distributions.

echo deb http://ppa.launchpad.net/saltstack/salt/ubuntu `lsb_release -sc` main | sudo tee /etc/apt/sources.list.d/saltstack.list
@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 / wireshark-analysis.md
Last active January 4, 2024 17:14
Outline for Packet Analysis with Wireshark

Packet Analysis with Wireshark

Links

Common filters

Source IP is 192.168.1.1

ip.src == 192.168.1.1

@DavidWittman
DavidWittman / clouddns-export.py
Last active December 12, 2018 01:06
Exports all domains for a Rackspace Cloud account in BIND9 format
#!/usr/bin/env python
import json
import os
import time
import clouddns
USERNAME = ''
APIKEY = ''

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 / 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

@DavidWittman
DavidWittman / iptables-nat.md
Created September 29, 2012 20:38
iptables n'at

iptables n'at

Source NAT

Source NAT changes the source address in IP header of a packet. It may also change the source port in the TCP/UDP headers. The typical usage is to change the a private (rfc1918) address/port into a public address/port for packets leaving your network. Available only in the POSTROUTING chain in iptables.

Syntax

iptables -t nat -A POSTROUTING -i eth1 -j SNAT --to-source 1.2.3.4[:port]

Example