Skip to content

Instantly share code, notes, and snippets.

View chermed's full-sized avatar

Mohamed Cherkaoui chermed

View GitHub Profile
#!/bin/bash
set -euo pipefail
# Set backup output directory
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
BACKUP_DIR="./k8s-backup-$TIMESTAMP"
GLOBAL_DIR="$BACKUP_DIR/__global"
mkdir -p "$BACKUP_DIR"
@chermed
chermed / create-kube-user.sh
Created February 29, 2020 16:05 — forked from henning/create-kube-user.sh
create k8s user, certificate, permissions and client config
#!/bin/bash
CLUSTERNAME=mycluster.mydomain
NAMESPACE=default
USERNAME=myclusteruser
GROUPNAME=mygroup
openssl genrsa -out ${USERNAME}.key 2048
CSR_FILE=$USERNAME.csr
git config --global remote.origin.prune true
git config --global core.fileMode false
git config --global core.autocrlf false
git config --global core.editor "vim"
git config --global pager.branch false
git config --global core.pager cat
git config --global alias.update-aliases '!curl https://gist.githubusercontent.com/chermed/b0bbd7fcca8f77281f2d4c8558a743aa/raw | sh - '
git config --global alias.rif '!git rm -r --cached . && git add . && git commit -m "Removing all files in .gitignore"'
git config --global alias.ignore '!function gi() { curl -L -s https://www.gitignore.io/api/$@ > .gitignore; } && gi'
git config --global alias.ignorepython '!function gi() { curl -L -s https://www.gitignore.io/api/osx,linux,python,visualstudiocode,terraform > .gitignore; } && gi'
#!/bin/bash
if [ "$1" != "" ] && [ "$1" = "-h" ]; then
echo "Shipyard Deploy uses the following environment variables:"
echo " ACTION: this is the action to use (deploy, upgrade, node, remove)"
echo " DISCOVERY: discovery system used by Swarm (only if using 'node' action)"
echo " IMAGE: this overrides the default Shipyard image"
echo " PREFIX: prefix for container names"
echo " SHIPYARD_ARGS: these are passed to the Shipyard controller container as controller args"
echo " TLS_CERT_PATH: path to certs to enable TLS for Shipyard"
#!/bin/sh
#%# family=manual
#%# capabilities=autoconf suggest
# Munin plugin for transactions/minute
case $1 in
autoconf)
exit 0
;;
suggest)