Skip to content

Instantly share code, notes, and snippets.

View discordianfish's full-sized avatar

Johannes 'fish' Ziemke discordianfish

View GitHub Profile
version: '3'
services:
app:
image: latencyat/dashboard-static-metrics
ports:
- "3000:3000"
- "9090:9090"
@discordianfish
discordianfish / manifest-split.py
Created June 8, 2017 12:23
manifest-split extracts all documents in a kubernetes manifest to their own files
#!/usr/bin/env python
"""manifest-split extracts all documents in a kubernetes manifest to their own
files
Usage:
manifest-split [manifest.yaml]
If manifest is omitted, read from stdin and use 'default' as file prefix."""
statically linked strace for amd64
@discordianfish
discordianfish / upgrade.md
Created May 25, 2017 11:51
k8s: Upgrade StatefulSet
  1. modify your container so you can signal it somehow to disable writes
  2. update the containers with that change
  3. copy existing stateful set and give it a new name
  4. create a new stateful set from that
  5. for each replica
    1. exec into old container, stop writes
    2. exec into new container, stop writes
    3. copy over data
    4. enable writes in new container
  6. delete old stateful set
@discordianfish
discordianfish / master_state.json
Last active November 5, 2015 23:38 — forked from berngp/master_state.json
Example of the of Mesos Monitor Statistics JSON (monitor/statistics.json)
{
"activated_slaves": 1,
"build_date": "2013-11-07 10:40:03",
"build_time": 1383849603,
"build_user": "bernardo",
"completed_frameworks": [
{
"active": 1,
"completed_tasks": [
@discordianfish
discordianfish / ec2-update-known-hosts
Created March 12, 2015 13:54
Tool to update your ssh's known_hosts based on the cloud-init output on AWS EC2
#!/bin/bash
set -e
readonly TMP=$(mktemp)
trap "rm $TMP" EXIT
aws ec2 describe-instances | \
jq -r '.Reservations|map(.Instances)|map(.[])|map([.PrivateIpAddress,.InstanceId])[]|join(",")' | \
while read l
do
ip=$(echo $l | cut -d, -f1)
@discordianfish
discordianfish / prometheus
Created February 6, 2015 14:43
sysvinit prometheus init script
#!/bin/sh
### BEGIN INIT INFO
# Provides: prometheus
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start:
# Should-Stop:
# Default-Start: S
# Default-Stop:
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define CANARY "in_the_coal_mine"
struct {
char buffer[1024];
sudo apt-get install docker
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
aufs-tools cgroup-lite graphicsmagick libgraphicsmagick3 openjdk-7-jre-lib
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
lxc-docker lxc-docker-0.11.1
The following NEW packages will be installed:

Keybase proof

I hereby claim:

  • I am discordianfish on github.
  • I am fish (https://keybase.io/fish) on keybase.
  • I have a public key whose fingerprint is B76D 2104 35D6 1EA7 7FE2 300F B4D9 1A65 83F0 CA1C

To claim this, I am signing this object: