This file contains 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
function use-jdk { | |
jdk=$(/usr/libexec/java_home $1) | |
sed -i "s/^JAVA_HOME=.*/JAVA_HOME=\"$jdk\"/" "~/.zprofile" | |
source .zshrc | |
} |
This file contains 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
mkdir -p ~/bin/ | |
ln -s $(which python2) ~/bin/python | |
export PATH=~/bin/:$PATH | |
./configure | |
make |
This file contains 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
ls -d */ | sed 's/\/*$//' |
This file contains 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
# mh theme | |
# Modified by Joseph Post | |
# features: | |
# path is autoshortened to ~25 characters | |
# displays git status, short SHA, and clean/dirty | |
# displays node/npm versions | |
# displays docker machine name if active. | |
# prompt |
This file contains 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
#From: http://www.thinkplexx.com/learn/howto/security/ssl/remove-passphrase-password-from-private-rsa-key | |
openssl rsa -in ~/.ssh/id_rsa -out ~/.ssh/id_rsa_new | |
cp ~/.ssh/id_rsa ~/.ssh/id_rsa.backup | |
rm ~/.ssh/id_rsa | |
cp ~/.ssh/id_rsa_new ~/.ssh/id_rsa | |
chmod 400 ~/.ssh/id_rsa |
This file contains 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
# From here: https://wiki.archlinux.org/index.php/Full_system_backup_with_rsync | |
# One Liner: | |
rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /* /path/to/backup/folder |
This file contains 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) |
This file contains 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
# dirmngr < /dev/null |
This file contains 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
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 fig="docker-compose" | |
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 update="yaourt -Syua" | |
alias VIALIAS="vim ~/.oh-my-zsh/custom/aliases.zsh" |
This file contains 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
#from here: http://stackoverflow.com/questions/24710521/calculating-average-value-of-temp-from-lm-sensors-using-bash-script | |
sensors | awk '/^Core /{++r; gsub(/[^[:digit:]]+/, "", $3); s+=$3} END{print s/(10*r) "°C"}' |