Skip to content

Instantly share code, notes, and snippets.

View jonbrouse's full-sized avatar

Jonathon Brouse jonbrouse

View GitHub Profile

Avocado au Chocolat

Ingredients:

¼ avocado (~2 ¼ oz)
2 tsp honey or agave syrup (~½ oz)
1 tsp raw cocoa powder

Directions:

@jonbrouse
jonbrouse / vpc-flowlog
Created November 25, 2016 16:21 — forked from brandond/vpc-flowlog
logstash-grok-pattern-vpc-flow-log
# VPC Flow Log fields
# version account-id interface-id srcaddr dstaddr srcport dstport protocol packets bytes start end action log-status
# http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/flow-logs.html#flow-log-records
%{NUMBER:version} %{NUMBER:account-id} %{NOTSPACE:interface-id} %{NOTSPACE:srcaddr} %{NOTSPACE:dstaddr} %{NOTSPACE:srcport} %{NOTSPACE:dstport} %{NOTSPACE:protocol} %{NOTSPACE:packets} %{NOTSPACE:bytes} %{NUMBER:start} %{NUMBER:end} %{NOTSPACE:action} %{NOTSPACE:log-status}
# -*- mode: ruby -*-
# vi: set ft=ruby :
#BOX = "bento/ubuntu-16.10"
BOX = "ubuntu/trusty64"
CPUS = "2"
HOST_NAME = "brousebox"
MEMORY = "1024"
PRIVATE_IP = "192.168.7.7"
USER_NAME = "jbrouse"
#!/bin/bash
USER_NAME=$1
# Software Versions
DOCKER_COMPOSE_VERSION=1.10.0
DOCKER_MACHINE_VERSION=0.9.0
PACKER_VERSION=0.12.2
TERRAFORM_VERSION=0.8.5

What You Should Do Before Every Meeting

Two main problems:

  • Too many meetings
  • Too many bad meetings
  1. Decide On a Need
  • Can this be answered with a call or an email?
  • Just like war, meetings should be a last resort.

Shipping a Docker Container's Logs to ELK

Logstash

  • Without leveraging a broker, Logstash shouldn't be used as a shipper but it still has a place in the stack.
  • Logtash acts as an ETL agent to normalize and parse your events.
  • Additionally, Logstash can be used to pull from sources such as S3 buckets and CloudWatch logs.

Sidecars, Agents, and Drivers

#!/bin/bash
# Remove old kernels and clean up inode count.
[ "$(whoami)" = root ] || { echo "Please run this script as root" && exit 1; }
CURRENT_KERNEL=$(uname -r | sed s/-generic//g)
OLD_KERNEL_LIST=$(find /usr/src -maxdepth 1 -mindepth 1 -type d -not -name "*$CURRENT_KERNEL*" -exec basename {} \;)
echo -e "Current kernel: $(uname -r)\n"
echo -e "Old kernels: \n$OLD_KERNEL_LIST\n"
def disk_usage():
cmd = "df -h | grep /mnt/log-storage"
df = subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
output = df.communicate()[0]
print output
disk_usage()
@jonbrouse
jonbrouse / kube-notes.md
Created November 7, 2017 15:13
Notes from kube research.

Kubernetes

Greek for "Helmsman"; also the root of the words "governor" and "cubernetic"

Table of Contents