Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew Booth mdbooth

  • Red Hat
  • Warwick, UK
View GitHub Profile
View atop.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: atop-debug
namespace: default
spec:
selector:
matchLabels:
app: atop-debug
template:
@mdbooth
mdbooth / clouds-to-env.sh
Last active May 7, 2021
Convert an entry in clouds.yaml to OS_* environment variables
View clouds-to-env.sh
#!/bin/sh
exec yq -r '.clouds.'$1'
| paths(scalars) as $p
| "export OS_" + ($p|last|ascii_upcase) + "=\"" + (getpath($p)|tostring) + "\""' \
< ~/.config/openstack/clouds.yaml
View keybase.md

Keybase proof

I hereby claim:

  • I am mdbooth on github.
  • I am mdbooth (https://keybase.io/mdbooth) on keybase.
  • I have a public key whose fingerprint is AC03 E8DF 13C9 2ED8 A4D8 7E47 A91B AB3C 70FE 6769

To claim this, I am signing this object:

View python-osc-placement.spec
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
# Python3 support in OpenStack starts with version 3.5,
# which is only in Fedora 24+
%if 0%{?fedora} >= 24
%global with_python3 1
%endif
%global library osc-placement
View update-devstack.sh
#!/bin/sh
find ~/devstack ~/openstack -name .git -type d | while read dir; do
working=$(dirname "$dir")
pushd "$working" >/dev/null
# Don't update if we're not on the master branch
if [ $(git rev-parse HEAD master | uniq | wc -l) != "1" ]; then
echo "Skipping $working: not on master branch"
continue
View khaleesi-unittests.sh
#!/bin/bash
# A script to run tests using khaleesi
# Usage:
#
# Run tests using a RHOS 7/RHEL 7 environment
# ./tools/khaleesi.sh
#
# Run tests using a RHOS 5/RHEL 7 environment
@mdbooth
mdbooth / nova-compute-maintenance.py
Last active Oct 2, 2017
Put a nova compute node into 'maintenance mode'. Disable its service, and attempt to migrate all instances on it to other nodes.
View nova-compute-maintenance.py
#!/usr/bin/env python
import argparse
from collections import defaultdict
import os
import sys
import time
from novaclient import client
from novaclient import exceptions
@mdbooth
mdbooth / log_merge.sh
Created Jul 17, 2015
Merge sort openstack log files
View log_merge.sh
#!/bin/bash
# Merge all given openstack log files into a single, sorted output stream. Each
# output line has the source filename prepended, e.g.:
# screen-n-cond.txt: 2015-07-14 16:33:24.669 DEBUG nova.o...
# screen-n-cond.txt: 2015-07-14 16:33:24.669 DEBUG nova.o...
# screen-n-cond.txt: 2015-07-14 16:33:24.670 DEBUG nova.o...
# screen-n-cell-child.txt: 2015-07-14 16:33:24.708 DEBUG ...
# screen-n-cond.txt: 2015-07-14 16:33:24.710 DEBUG nova.o...