Skip to content

Instantly share code, notes, and snippets.

@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active May 6, 2024 13:26
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@galexrt
galexrt / node_exporter.sh
Last active February 26, 2024 20:33
Simple Prometheus node_exporter install script (Updated for 1.0.1)
#!/bin/bash
version="${VERSION:-1.0.1}"
arch="${ARCH:-linux-amd64}"
bin_dir="${BIN_DIR:-/usr/local/bin}"
wget "https://github.com/prometheus/node_exporter/releases/download/v$version/node_exporter-$version.$arch.tar.gz" \
-O /tmp/node_exporter.tar.gz
mkdir -p /tmp/node_exporter
<?php
/**
* Coin Dashboard by Christian Haschek
* https://blog.haschek.at
*
* Donations always welcome
* BTC: 1ChrisHMgr4DvEVXzAv1vamkviZNLPS7yx
* ETH: 0x1337C2F18e54d72d696005d030B8eF168a4C0d95
*
* Read more at
@adamstauffer
adamstauffer / delete_ecs_services.py
Last active February 26, 2020 07:55
Delete all services in an ECS cluster using boto3
"""Delete all services in an ECS Cluster using boto3.
Requires listing all services in a cluster, setting their desired tasks to 0,
then deleting the service.
"""
import boto3
CLUSTER_NAME = 'your-cluster-here'
@mgoodness
mgoodness / k8s-svc-annotations.md
Last active March 11, 2024 16:24
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
#!/bin/bash
pkcs7=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/pkcs7 | paste -s -d '')
result=$(curl -X POST "http://10.0.1.130:8200/v1/auth/aws-ec2/login" -d '{"role":"myapp","pkcs7":"'"$pkcs7"'","nonce":"vault-client-nonce"}')
token=$( jq -r .auth.client_token <<< "$result" )
policies=$( jq -r .auth.policies[] <<< "$result" )
ami_id=$( jq -r .auth.metadata.ami_id <<< "$result" )
[[ -n $token ]] || exit 1
#!/bin/bash
set -e
# Those should be JENKINS vars
NAME=nginx-deployment-3
PODS_COUNT=3
CONTAINER_NAME=nginx
DOCKER_IMAGE='nginx:1.8'
# Template can be copied from deploy.tmp.yaml to update jenkins var
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import re
import signal
import sys
import time
@ianblenke
ianblenke / consul_blocking_query.sh
Last active July 23, 2017 09:18
Consul blocking queries using X-Consul-Index via curl
#!/bin/bash
while true; do
INDEX_FILE="$(mktemp -t consul_index_XXX)"
CONSUL_INDEX=$(
curl -isL -H "X-Auth-Token: $CONSUL_TOKEN" \
-H 'X-Consul-Index: 1' \
--cacert /etc/consul/ssl/ca.cert "https://consul.service.consul:8500/v1/event/list?index=$CONSUL_INDEX&wait=1m" | \
tee "$INDEX_FILE" | \
grep X-Consul-Index | \
sed -e 's/^.*: *//' | \