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
azure-subscription () { | |
local get_subs=$(az account list | jq ".[].name" | sed 's/"//g' | fzf) | |
az account set --subscription ${get_subs} | |
} |
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
azure-ips () { | |
local rgp=$(az group list | jq '.[].name' | sed 's/"//g' | fzf ) | |
local check_vm=($(az vm list -g ${rgp} | jq '.[].name' | sed 's/"//g')) | |
local check_vmss=($(az vmss list -g ${rgp} | jq '.[].name' | sed 's/"//g')) | |
local array=() | |
if [[ $check_vm ]]; then array+=$check_vm fi | |
if [[ $check_vmss ]]; then array+=($check_vmss) fi | |
local count=$(echo "${#array[@]}") |
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
podlog () { | |
local pod=($(kubectl get pods --all-namespaces -o wide | fzf | awk '{print $1, $2}')) | |
echo kubectl logs -n ${pod[1]} ${pod[2]} | |
kubectl logs -n ${pod[1]} ${pod[2]} | |
} | |
podexec () { | |
local pod=($(kubectl get pods --all-namespaces -o wide | fzf | awk '{print $1, $2}')) | |
local cmd=${@:-"/bin/sh"} |
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
## ENVs ## | |
red=`tput setaf 1` | |
green=`tput setaf 2` | |
yellow=`tput setaf 3` | |
reset=`tput sgr0` | |
alias ll="ls -lah" | |
alias k="kubectl" | |
source <(kubectl completion bash) |