Last active
September 22, 2017 04:43
-
-
Save aichholzer/8ca03cd89dc7f60241c40fa3ba92d9cb to your computer and use it in GitHub Desktop.
Shell
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
export PS1="\n\[\033[1;102m\]\[\033[1;30m\] \A \[\033[1;103m\]\[\033[1;30m\] \u \[\033[0;107m\]\[\033[1;30m\] \w \[\033[0m\] \[\`if [ \$? != 0 ]; then echo 😠 ' '; fi \`\]" | |
alias ls='ls -lhaG' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' | |
alias .....='cd ../../../..' | |
alias gm="grunt nodemon" | |
alias gish="ssh -T [email protected]" | |
## Swap your mac address. | |
function macswap() { | |
hexchars="0123456789abcdef"; | |
mac=$( | |
for i in {1..10}; | |
do echo -n ${hexchars:$(( $RANDOM % 16 )):1}; | |
done | sed -e 's/\(..\)/:\1/g'; | |
) | |
newMAC=00$mac; | |
if sudo ifconfig en0 ether $newMAC | |
then | |
echo -e '\n 👍🏻 Your new MAC address:' $newMAC; | |
else | |
echo -e '\n 👎🏻 I cannot change the MAC address.'; | |
fi | |
echo | |
} | |
## Git commit, with signature | |
function cosi() { | |
git commit -S -am "$1" | |
} | |
function gipu() { | |
if [ "$1" == "" || "$2" == "" ]; then | |
echo ""; | |
echo " You need to provide a remote and a branch."; | |
echo " Usage: gis {REMOTE} {BRANCH}"; | |
echo ""; | |
else | |
if [ "$3" == "f" ]; then | |
git push $1 $2 --force | |
else | |
git push $1 $2 | |
fi | |
fi | |
} | |
function gipl() { | |
if [ "$1" == "" || "$2" == "" ]; then | |
echo ""; | |
echo " You need to provide a remote and a branch."; | |
echo " Usage: gil {REMOTE} {BRANCH}"; | |
echo ""; | |
else | |
git pull $1 $2 --rebase | |
fi | |
} | |
function gir() { | |
if [ "$1" == "" ]; then | |
echo ""; | |
echo " You need to provide a revision number"; | |
echo " Usage: gir {REVISION NUMBER}"; | |
echo ""; | |
else | |
git rebase -i HEAD~$1 | |
fi | |
} | |
function gif() { | |
git fetch | |
} | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" | |
export GPG_TTY=$(tty) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment