Skip to content

Instantly share code, notes, and snippets.

View dennybaa's full-sized avatar

Denis Baryshev dennybaa

View GitHub Profile
@dennybaa
dennybaa / docker-cleanup-resources.md
Last active August 6, 2018 17:20 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks #docker #cleanup #cli

Docker

exec: Preserve terminal with and colors

Exec preserving terminal options:

$ docker exec -ti --env COLUMNS=`tput cols` --env LINES=`tput lines` ...

run: Pass through SSH_AUTH_SOCK

@dennybaa
dennybaa / .bashrc.sh
Last active January 29, 2020 21:31
Helm enable TLS #helm #k8s #tls
## Enable --tls substitution for helm tls-enabled commands
#
helm() {
_context=$(kubectl config current-context)
if [ -d "${HELM_HOME:-$HOME/.helm}/tls/$_context" ]; then
export HELM_TLS_CA_CERT="${HELM_HOME:-$HOME/.helm}/tls/$_context/ca.cert.pem"
export HELM_TLS_CERT="${HELM_HOME:-$HOME/.helm}/tls/$_context/cert.pem"
export HELM_TLS_KEY="${HELM_HOME:-$HOME/.helm}/tls/$_context/key.pem"
export HELM_TLS_ENABLE="true"
fi
@dennybaa
dennybaa / dyndns_update.sh
Last active May 1, 2019 01:32
Update dyndns freedns http://freedns.afraid.org/ #dyndns #script
#!/bin/sh
#FreeDNS updater script
(which wget > /dev/null) || { echo "wget not found"; exit 1; }
(which nslookup > /dev/null) || { echo "nslookup not found"; exit 1; }
# FREEDNS_APIKEY (loginid|password -> SHA1)
DYNLIST=$(wget -qO- http://freedns.afraid.org/api/?action=getdyndns&sha=${FREEDNS_APIKEY})
NAME="$1"