Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Mark Ayers philoserf

🏠
Working from home
View GitHub Profile
View Untitled-2
#!/bin/bash
# shellcheck disable=SC2034
set -o errexit
set -o nounset
set -o pipefail
DEBUG=${DEBUG:=0}
[[ $DEBUG -eq 1 ]] && set -o xtrace
View add-branch-commit-push-remove-branch.sh
BN="" CM="" git add -p \
&& git co -b "${BN}" \
&& git ci -m "${CM}" \
&& git push \
&& git cm \
&& git br -D "${BN}"
View git-rebase-root.sh
git rebase -i --root
View new-mac-address
printf "starting mac addr: %s\n" "$(ifconfig en0 | grep ether)"
ifconfig en0 ether "$(openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/./0/2; s/.$//")"
printf "new mac addr: %s\n" "$(ifconfig en0 | grep ether)"
View helm.md

helm list helm env helm version

helm status "${RELEASE_NAME}" helm test "${RELEASE_NAME}"

helm get all "${RELEASE_NAME}" helm get hooks "${RELEASE_NAME}" helm get manifest "${RELEASE_NAME}"

View Untitled-2
# note version of control plane
k version --short
# note version of nodes
kgno
# check for error
k get psp eks.privileged
# get the update id
aws eks --region us-west-2 update-cluster-version --name ${CLUSTER} --kubernetes-version 1.15
# watch for success
watch -n 30 'aws eks --region us-west-2 describe-update --name ${CLUSTER} --update-id ${UPDATEID} | grep status'
View Untitled-1
df -hT
lsblk
# verify disk & partition
sudo growpart /dev/xvda 2
sudo resize2fs /dev/xvda2
df -hT
@philoserf
philoserf / remove-terminating-namespace.sh
Last active Feb 13, 2021
remove kubernetes namespace stuck in termiinating status
View remove-terminating-namespace.sh
for ns in $(kubectl get ns --field-selector status.phase=Terminating -o jsonpath='{.items[*].metadata.name}'); do
kubectl get ns "$ns" -ojson |
jq '.spec.finalizers = []' |
kubectl replace --raw "/api/v1/namespaces/$ns/finalize" -f -
done
@philoserf
philoserf / goline debug
Last active Oct 28, 2020
segmentio / golines | issue 21
View goline debug
> pwd
/Users/mark/source/other/golines/_fixtures
> golines -l .
binary_operators.go
binary_operators__exp.go
case_lists.go
chained_calls.go
conditionals.go
defers.go
View gist:0ec9622157ce7858b26cf9846d298115
CGO_ENABLED:=0
check:
gofmt -s -l -d .
goimports -l -d .
goreturns -l -d .
golangci-lint \
--enable-all \
./...