Last active
September 11, 2018 13:01
-
-
Save sirtawast/c105572a8713a83167c526592c805716 to your computer and use it in GitHub Desktop.
bash_profile and functions
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
repeat() { | |
echo Repeating \"$1\" for every $2 sec | |
while true | |
do | |
eval $1 | |
if [ -n $2 ]; then | |
sleep $2 | |
else | |
sleep 5 | |
fi | |
done | |
} | |
cryptFile() { | |
openssl des3 -in $1 -out $1.crypted; | |
} | |
decryptFile() { | |
openssl des3 -d -in $1 -out $1.decrypted; | |
} | |
cryptFileAES() { | |
openssl enc -aes-256-cbc -salt -in $1 -out $1.crypted; | |
} | |
decryptFileAES() { | |
openssl enc -d -aes-256-cbc -in $1 -out $1.decrypted | |
} | |
de() { | |
if [[ -z $1 ]]; then | |
docker ps | |
else | |
docker exec -it $1 bash | |
fi | |
} | |
# Git branch in prompt. | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/' | |
} |
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
export LC_ALL=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
source ~/.bash_functions | |
alias bashprofile="subl ~/.bash_profile" | |
alias bashfunc="subl ~/.bash_functions" | |
alias bashsource="source ~/.bash_profile" | |
alias g="git"; | |
alias d="docker"; | |
alias dc="docker-compose"; | |
alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" | |
alias serve="python -m SimpleHTTPServer" | |
alias knownhosts="subl ~/.ssh/known_hosts" | |
alias renew="sudo ipconfig set en0 BOOTP && sudo ipconfig set en0 DHCP" | |
alias crypt-old=cryptFile; | |
alias decrypt-old=decryptFile; | |
alias crypt=cryptFileAES; | |
alias decrypt=decryptFileAES; | |
alias composer="php /usr/local/bin/composer" | |
alias eslint="./node_modules/.bin/eslint" | |
alias gitfucked="git fetch origin; git reset --hard origin/master;" | |
alias stashdiff="git stash show -p" | |
alias dockerfucked="docker rm $(docker ps -a -q); docker rmi -f $(docker images -q); docker volume ls -qf dangling=true;docker volume rm $(docker volume ls -qf dangling=true);" | |
alias hours="git reflog --date=local --all" | |
alias npm2=/Users/sampoh/.nodenv/shims/npm | |
alias npm="echo Are you sure\? Y/n && read && npm2" | |
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-gpu --headless --dump-dom" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment