This file contains hidden or 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
#!/usr/bin/env bash | |
for region in us-east-1 us-east-2; do | |
aws eks list-clusters --region $region --query 'clusters' --output text | tr '\t' '\n' \ | |
| while IFS= read -r line; do | |
aws eks --region $region update-kubeconfig \ | |
--name "${line}" \ | |
--alias "${line}" \ | |
--profile default | |
done |
This file contains hidden or 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 | |
# Author: [email protected] | |
# gofmt -s -w . | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
echo "run tests:" |
This file contains hidden or 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 app | |
import ( | |
"fmt" | |
"strings" | |
) | |
// See: https://github.com/spf13/pflag/issues/129 | |
// $ mycommand --string-map-option "a=b,c=d" |
This file contains hidden or 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
#!/usr/bin/env bash | |
PROJ=your-image-name | |
TAG=${1:-latest} | |
HASH=`date +%s` | |
BUILD_NAME=${PROJ}-build-${HASH} | |
rm -rf target |
This file contains hidden or 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
#set history size | |
export HISTSIZE=5000 | |
#save history after logout | |
export SAVEHIST=5000 | |
#history file | |
export HISTFILE=~/.zhistory | |
#append into history file | |
setopt INC_APPEND_HISTORY | |
#save only one command if 2 common are same and consistent | |
setopt HIST_IGNORE_DUPS |
This file contains hidden or 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 | |
# tar.gz the config files. Store them as a kubernetes secret in namespace kube-system | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
KCTL="kubectl --kubeconfig=/your/kubeconfig.json --namespace=kube-system" | |
SECRET="my-fancy-configs" |
This file contains hidden or 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 | |
# change your /etc/postfix/main.cf | |
# always_bcc = [email protected] | |
DOMAIN=example.com | |
ARCHIVE=archive@$DOMAIN | |
getemail() { | |
doveadm fetch -u $ARCHIVE hdr mailbox-guid $1 uid $2 | grep "$3" | cut -f 2 -d "<" | cut -f 1 -d ">" | |
} |