Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Apsu's full-sized avatar

Eve Apsu

  • Lambda Labs
  • Pittsburgh, PA
View GitHub Profile
@Apsu
Apsu / conf
Last active August 29, 2015 13:56
if [type] == "rabbitmq" {
grep {
match => ["message", "^\s*$"]
negate => true
drop => true
}
grok {
patterns_dir => ["/opt/logstash/patterns"]
match => [
"message", "=%{WORD:report_type} REPORT=+ %{RABBITMQ_DATE:timestamp} ==="
@Apsu
Apsu / cluster.py
Last active August 29, 2015 13:57
def is_master(self):
"""Return true if there's only one master and we're it"""
masters = [
key
for key in self.store.keys()
if self.store[key]["master"]
]
if len(masters) == 1 and masters[0] == self.hostname:
@Apsu
Apsu / dockerfile
Last active August 29, 2015 13:57
Keystone container from source
FROM ubuntu:12.04
# Keystone service and admin API
EXPOSE 5000 35357
# Generate locale files
RUN locale-gen en_US.UTF-8
# Export it
ENV LANG en_US.UTF-8
@Apsu
Apsu / Compute local.conf
Created June 6, 2014 16:30
devstack ML2+LB+VXLAN local.confs
# localrc compatible overrides
[[local|localrc]]
RECLONE=false
LOGFILE=/opt/stack/logs/stack.sh.log
# Secrets
ADMIN_PASSWORD=secrete
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
---
- copies:
cinder-blah: 0
neutron-agents: 6
- cidr: 10.0.0.0/24
- vip: 10.0.0.250
- infra_hosts:
- infra1:
ip: 10.0.0.1
- copies:
@Apsu
Apsu / top.txt
Last active August 29, 2015 14:18
Top configuration steps
z # colors
x # highlight sort field
i # hide idle tasks
c # toggle full commandlines
Z # enter color customization
T # target task info
4 # make blue
H # target headers
2 # make green
S # target summary data
#!/usr/bin/env bash
# Set options
set -euo pipefail
# Initial step count
STEP=0
# Handle errors
handle_error() {
@Apsu
Apsu / output.txt
Last active September 15, 2015 19:34
PLAY [Test with_items] ********************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [List with dereferencing/without nesting] *******************************
ok: [localhost] => (item=one) => {
"item": "one",
"msg": "one"
}
@Apsu
Apsu / makefloats.sh
Last active September 21, 2015 16:06
Create and associate Neutron floats with Nova instances that do not currently have floats
#!/usr/bin/env bash
if [[ $# -lt 1 ]]
then
echo "Usage: $0 <float_network>"
exit 1
fi
declare -A floats