Skip to content

Instantly share code, notes, and snippets.

@TheMoroccan09
Last active December 13, 2017 09:58
Show Gist options
  • Save TheMoroccan09/832a3fecc9d5120d3a5cefa732e6727c to your computer and use it in GitHub Desktop.
Save TheMoroccan09/832a3fecc9d5120d3a5cefa732e6727c to your computer and use it in GitHub Desktop.
alias good_night='shutdown -P 30'
alias docker_ip=fct_docker_ip
alias docker_pretty='docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Ports}}\t{{.Names}}"'
alias docker_clear=fct_docker_clear
fct_docker_ip(){
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$1"
}
fct_docker_clear(){
DOCKER_PIDS=$(docker ps -a -q)
if [ -n "$DOCKER_PIDS" ]; then
docker stop $DOCKER_PIDS && docker rm $DOCKER_PIDS
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment