Skip to content

Instantly share code, notes, and snippets.

View zepptron's full-sized avatar
🌴
On vacation

zepptron

🌴
On vacation
View GitHub Profile
@zepptron
zepptron / .zshrc
Created April 10, 2019 10:26
azure switch subscriptions
azure-subscription () {
local get_subs=$(az account list | jq ".[].name" | sed 's/"//g' | fzf)
az account set --subscription ${get_subs}
}
@zepptron
zepptron / .zshrc
Last active February 4, 2019 14:40
azure get ip function => .zshrc / .bashrc
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[@]}")
@zepptron
zepptron / gist:9635568b9d90d858daca7780feb8c4b7
Created June 19, 2018 08:34
.bashrc & .zshrc: usefull kubectl + fzf
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"}
@zepptron
zepptron / .bashrc
Created January 4, 2018 14:52
bashrc for faster interaction with kubernetes
## 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)