Last active
August 29, 2015 14:19
-
-
Save jcpst/e573a1da1ba15ccd4e27 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Colors | |
GREEN='\e[0;32m' | |
LIGHT_GREY='\e[0;37m' | |
RED='\e[0;31m' | |
END_COLOR='\e[m' | |
### 'dstop' | |
function docker_stop_all_containers { | |
echo -e "${RED}Stopping all Docker containers...i${END_COLOR}" | |
docker stop $(docker ps -a -q) | |
} | |
### 'drmc' | |
function docker_rm_all_containers { | |
echo -e "${RED}Removing all Docker containers...${END_COLOR}" | |
docker rm $(docker ps -a -q) | |
} | |
### 'dmri' | |
function docker_rm_all_images { | |
read -ep "${RED}Are you sure you want to remove all Docker images? (y/n)${END_COLOR}" | |
if [ $REPLY = "y" ]; then | |
echo -e "${RED}Removing all Docker containers...${END_COLOR}" | |
docker rmi $(docker images -q) | |
fi | |
} | |
### 'temp' | |
function average_tempurature { | |
sensors | awk '/^Core /{++r; gsub(/[^[:digit:]]+/, "", $3); s+=$3} END{print s/(10*r) "°C"}' | |
} | |
########################################################### | |
### Generally useful | |
########################################################### | |
alias aliases="colorize ~/.oh-my-zsh/custom/aliases.zsh | grep --color='never' alias | cut -d' ' -f2-" | |
alias c="colorize" | |
alias clean="sudo pkgcacheclean -v" | |
alias decode="for i in *.mp3; do lame --decode $i; done" | |
alias dstop=docker_stop_all_containers | |
alias drmc=docker_rm_all_containers | |
alias drmi=docker_rm_all_images | |
alias fig="docker-compose" | |
alias mirror="reflector --verbose -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist" | |
alias reload=". ~/.zshrc && echo 'Your zshrc file has been reloaded'" | |
alias repos="find ~ -type d -name .git | xargs -n 1 dirname" | |
alias s="screen -r" | |
alias serve="http-server" | |
alias temp="average_tempurature" | |
alias update="yaourt -Syua" | |
alias VIALIAS="vim ~/.oh-my-zsh/custom/aliases.zsh" | |
### 2nd displays for i3 | |
############################################### | |
alias hdmi="xrandr --output HDMI1 --auto --above LVDS1" | |
alias vga="xrandr --output VGA1 --auto --left-of LVDS1" | |
alias work="/home/joe/.i3/load_layout.sh" | |
### Lowes | |
############################################### | |
alias i2p="cd /home/joe/git/lowes/i2platform" | |
alias i2s="cd /home/joe/git/lowes/i2support" | |
alias i2sf="cd ~/git/lowes/i2support/flst-containers/flst-server" | |
alias i2so="cd ~/git/lowes/i2support/flst-containers/operations-console" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment