Dotfiles.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

51 lines
944 B

alias ls='ls -lGhpv --color=always --group-directories-first' #noindex
alias lsl='ls -L' #noindex
alias lst='ls -al --time-style=+%D | grep $(\date +%D)' #noindex
alias ps="ps aux" #noindex
dropdns() {
DNS_RESPONDER=$(ps | grep [_]mdnsresponder | awk '{ print $2 }')
sudo kill "$DNS_RESPONDER"
}
#- Kubernetes noindex
k_set_ps1() {
set | grep '^PS1=' | grep 'k8s' >&-
if [ "$?" != 0 ]; then
export PS1="\033[1;32m[\033[1;31mk8s:\$K_NS\033[1;32m]-\033[00m$PS1"
fi
}
#- kubectl++ noindex
k() {
if [ "$1" == "use" ]; then
NS="$2"
kubectl get namespaces | grep "$2" >&-
if [ "$?" == 0 ]; then
echo k use "$NS"
export K_NS="$NS"
k_set_ps1
else
echo ERROR: namespace "$NS" not found
fi
else
if [ -z "$K_NS" ]; then
echo kubectl --all-namespaces $@
kubectl $@ --all-namespaces
else
echo kubectl -n "$K_NS" $@
kubectl $@ -n "$K_NS"
fi
fi
}
if [ ! -z "$K_NS" ]; then
k_set_ps1
fi