Skip to content

Instantly share code, notes, and snippets.

@seva-ramin
seva-ramin / eks_node_add_public_key.yaml
Last active March 18, 2021 04:23
How to add SSH public key to EKS Worker Node after cluster is created
# This DaemonSet basically adds your id_rsa.pub to the authorized_keys on the EKS Worker Node EC2.
# Just save this as a yaml file, replace your public key below and run
# $ kubectl apply -f eks_node_add_public_key.yaml
# Check all the pods are running and as soon as they are running, you can remove the set:
# $ kubectl delete -f eks_node_add_public_key.yaml
#
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
@seva-ramin
seva-ramin / kubeshell.sh
Last active November 15, 2020 17:17
Unix like shell for Kubernetes resources; view your Kubernetes resources using commands like "ls", or "cat" with tab completion.
#!/bin/bash
# set prompt color to blue
CB=$'\e[35m'
CE=$'\e[0m'
es=$'\e' # read escape characters, $'\033' works too
back=$'\033[1D' # move curser back
eof=$'\004' # read end of file, Ctrl-D
tab=$'\t'
eol=$'\n' # end of line
@seva-ramin
seva-ramin / jwt-decode.sh
Last active March 25, 2021 15:12
JWT Decoder using bash
#!/bin/bash
# pad base64URL encoded to base64
paddit() {
input=$1
l=`echo -n $input | wc -c`
while [ `expr $l % 4` -ne 0 ]
do
input="${input}="
l=`echo -n $input | wc -c`