Skip to content

Instantly share code, notes, and snippets.

@iamsaso
iamsaso / post-commit
Last active December 29, 2017 07:29
.git/hooks/post-commit
#!/usr/bin/env bash
branch_name=`git symbolic-ref --short HEAD`
retcode=$?
non_push_suffix="_local"
# Only push if branch_name was found (my be empty if in detached head state)
if [ $retcode = 0 ] ; then
#Only push if branch_name does not end with the non-push suffix
@iamsaso
iamsaso / gist:143692180c2a313eb5777a6152222445
Created October 8, 2018 17:45
Kubernetes delete evicted pods
kubectl get po -a --all-namespaces -o json | jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete po \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c