Skip to content

Instantly share code, notes, and snippets.

View rakhbari's full-sized avatar

Ramin Akhbari rakhbari

  • Salesforce
  • San Jose, CA
View GitHub Profile
@rakhbari
rakhbari / extract_kubecfg_cert.sh
Last active December 1, 2022 06:23 — forked from xueshanf/extract_kubecfg_cert.sh
Extract kubernetes cluster credentials from kubecfg
#!/bin/bash
# Input: ./extract_kubecfg_cert.sh my-cluster-name username
# Output: ./my-cluster-name-ca.crt ./username.crt ./username.key
# Exit on error
abort(){
echo $1 && exit 1
}
# Prerequistes
if ! command -v envsubst &> /dev/null
then
echo "ERROR: envsubst isn't installed/can't be found. Get it installed on your machine before proceeding. https://www.google.com/search?q=envsubst+command+not+found"
exit 2
fi
@rakhbari
rakhbari / .bashrc
Created November 26, 2022 07:06
Portion of .bashrc (or .profile) to create colored prompt with git status
################################################################
# store colors
MAGENTA="\[\033[0;35m\]"
YELLOW="\[\033[01;33m\]"
BLUE="\[\033[00;34m\]"
LIGHT_GRAY="\[\033[0;37m\]"
DARK_GRAY="\[\033[0;90m\]"
CYAN="\[\033[0;36m\]"
GREEN="\[\033[00;32m\]"
RED="\[\033[0;31m\]"