This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"net/http" | |
"os" | |
"time" | |
vegeta "github.com/tsenart/vegeta/lib" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Generate a `:something-intensifies:` Slack emoji, given a reasonable image | |
# input. I recommend grabbing an emoji from https://emojipedia.org/ | |
set -euo pipefail | |
if ! command -v identify &> /dev/null | |
then | |
if [ "$(uname)" == "Darwin" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module simple-k8s-client | |
go 1.15 | |
require ( | |
github.com/golang/protobuf v1.4.2 // indirect | |
github.com/imdario/mergo v0.3.11 // indirect | |
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de // indirect | |
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc // indirect | |
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.8" | |
services: | |
front-envoy: | |
build: | |
context: . | |
dockerfile: envoy.Dockerfile | |
args: | |
ENVOY_NAME: front-envoy | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"os" | |
"os/signal" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# aws-vault function | |
function av() { | |
if [[ $# -ge 2 ]]; then | |
case $1 in | |
ap-admin) | |
aws-vault exec --session-ttl=4h ap-admin -- ${@:2} | |
;; | |
us-admin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This hacky script will read the migration JSON file you provide as argument 1 and execute the reassignemnt up to the partition you specify as argument 2. | |
# This is useful if you don't want to migrate all paritions at once but not have to re-create the reassignment plan everytime | |
# and keep the reassignments consistent across the whole topic. | |
# Will work with any properly formatted kafka parition reassignment JSON file. | |
# Recommended to use with https://github.com/SiftScience/kafka-assigner to give you more control over the reassignemnt. | |
# will migrate up to the partition you specify | |
# Example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# one function per cluster/region | |
function kus() { | |
case $1 in | |
# set namespace based on first arg | |
red) | |
kubectl --context=kube-prod-us --namespace=red ${@:2} | |
;; | |
green) | |
kubectl --context=kube-prod-us --namespace=green ${@:2} |