This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
name=`echo $1 | tr -d '.pfx'` | |
read -s -p "Enter PFX Password: " password | |
openssl pkcs12 -in $1 -nocerts -nodes -out $name-key.pem -passin pass:$password | |
echo "Exporting $name.key" | |
openssl rsa -in $name-key.pem -out $name.key | |
rm -rf $name-key.pem | |
echo "Exporting $name-cert.pem" | |
openssl pkcs12 -in $1 -clcerts -nokeys -out $name-cert.pem -passin pass:$password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Number of pods not in Running state | |
kubectl get pods --all-namespaces | sed 's/\s\s*/ /g' | awk '{if(NR>1)print}' | cut -d ' ' -f4 | grep -vx 'Running' | wc -l | |
# Number of Nodes not in Ready state. | |
kubectl get nodes | sed 's/\s\s*/ /g' | awk '{if(NR>1)print}' | cut -d ' ' -f2 | grep -xv 'Ready' | wc -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces | |
kubectl get pods --all-namespaces | grep -E 'ImagePullBackOff|ErrImagePull|Evicted' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod -n 15below |