Skip to content

Instantly share code, notes, and snippets.

@sjcoder
Last active October 13, 2021 08:33
Show Gist options
  • Save sjcoder/473ef98228f8922953ca40dac30f586f to your computer and use it in GitHub Desktop.
Save sjcoder/473ef98228f8922953ca40dac30f586f to your computer and use it in GitHub Desktop.
helpful aliases
export RXPLATFORM_DIR=$HOME/Projects
docker-enter() {
if [[ $# == 0 ]]
then
echo "Which container? Provide 1 argument."
return 0
fi
docker exec -ti -e "COLUMNS=200 LINES=51" $1 bash
}
get_pods() {
if [[ $# == 0 ]]
then
echo "$0 <namespace>"
return 0
fi
kubectl get pods -n $1
}
enter_pod() {
if [[ $# < 2 ]]
then
echo "$0 <namespace> <pod>"
return 0
fi
kubectl exec --stdin --tty -n $1 $2 -- /bin/bash
}
tinker_pod() {
if [[ $# < 2 ]]
then
echo "$0 <namespace> <pod>"
return 0
fi
kubectl exec --stdin --tty -n $1 $2 -- /usr/local/bin/php artisan tinker
}
alias kept='tinker_pod'
alias kep='enter_pod'
alias kpg='get_pods'
alias de='docker-enter'
alias dc="docker-compose -f ~/Projects/Docker/rxplatform/docker-compose.yml"
alias dcupf='docker-compose -f ~/Projects/Docker/rxplatform/docker-compose.yml up'
export UID="$(id -u)"
export GID="$(id -g)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment