Skip to content

Instantly share code, notes, and snippets.

View Apsu's full-sized avatar

Eve Apsu

  • Lambda Labs
  • Pittsburgh, PA
View GitHub Profile
#!/usr/bin/env bash
# Set options
set -euo pipefail
# Initial step count
STEP=0
# Handle errors
handle_error() {
@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
@Apsu
Apsu / .tmux.conf
Created January 27, 2015 17:54
vi{,m} environment config files
# Prefix and cycle
set-option -g prefix C-\\
bind C-\ last-window
# Reload config
bind r source-file ~/.tmux.conf
# Mouse mode
set -g mode-mouse on
set -g mouse-resize-pane on
---
- 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 / 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
@Apsu
Apsu / ip a
Created June 2, 2014 19:41
ML2 + LinuxBridge + VXLAN
stack@apsu-ih-dev1:~/devstack$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet 169.254.169.254/32 scope link lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
@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 / 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 / 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} ==="