Skip to content

Instantly share code, notes, and snippets.

@joubin
Last active February 25, 2018 21:01
Show Gist options
  • Save joubin/2228b97d21df9fd38d0f to your computer and use it in GitHub Desktop.
Save joubin/2228b97d21df9fd38d0f to your computer and use it in GitHub Desktop.
# __ .__
# _______/ |_ ___.__.| | ____
# / ___/\ __< | || | _/ __ \
# \___ \ | | \___ || |_\ ___/
# /____ > |__| / ____||____/\___ >
# \/ \/ \/
export COLOR_NC='\e[0m' # No Color
export COLOR_WHITE='\e[1;37m'
export COLOR_BLACK='\e[0;30m'
export COLOR_BLUE='\e[0;34m'
export COLOR_LIGHT_BLUE='\e[1;34m'
export COLOR_GREEN='\e[0;32m'
export COLOR_LIGHT_GREEN='\e[1;32m'
export COLOR_CYAN='\e[0;36m'
export COLOR_LIGHT_CYAN='\e[1;36m'
export COLOR_RED='\e[0;31m'
export COLOR_LIGHT_RED='\e[1;31m'
export COLOR_PURPLE='\e[0;35m'
export COLOR_LIGHT_PURPLE='\e[1;35m'
export COLOR_BROWN='\e[0;33m'
export COLOR_YELLOW='\e[1;33m'
export COLOR_GRAY='\e[0;30m'
export COLOR_LIGHT_GRAY='\e[0;37m'
case $TERM in
xterm*|rxvt*)
TITLEBAR='\[\033]0;\u ${NEW_PWD}\007\]'
;;
*)
TITLEBAR=""
;;
esac
UC=$COLOR_WHITE # user's color
[ $UID -eq "0" ] && UC=$COLOR_RED # root's color
PS1="$TITLEBAR\n\[${UC}\]\u \[${COLOR_LIGHT_GREEN}\]\${PWD} \[${COLOR_BLACK}\]\$(vcprompt) \n\[${COLOR_LIGHT_GREEN}\]→\[${COLOR_NC}\] "
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# __ .__
# ______ ___.__._/ |_| |__ ____ ____
# \____ < | |\ __\ | \ / _ \ / \
# | |_> >___ | | | | Y ( <_> ) | \
# | __// ____| |__| |___| /\____/|___| /
# |__| \/ \/ \/
export PYTHONSTARTUP=~/.pythonrc.py
export PATH=~/Library/Python/3.6/bin:$PATH
export PATH=/usr/local/bin/Cellar/python3/3.6.3/bin/python3.6:$PATH
# .__ .__
# _____ | | |__|____ ______
# \__ \ | | | \__ \ / ___/
# / __ \| |_| |/ __ \_\___ \
# (____ /____/__(____ /____ >
# \/ \/ \/
alias airport='/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport'
alias grep='grep --color=auto'
alias rsyncp='rsync -avz --no-perms --no-owner --no-group --progress'
alias perm='stat -f "%p"'
# _____ __ .__
# _/ ____\_ __ ____ _____/ |_|__| ____ ____ ______
# \ __\ | \/ \_/ ___\ __\ |/ _ \ / \ / ___/
# | | | | / | \ \___| | | ( <_> ) | \\___ \
# |__| |____/|___| /\___ >__| |__|\____/|___| /____ >
# \/ \/ \/ \/
gproxy(){
sudo networksetup -setsecurewebproxystate wi-fi $1
sudo networksetup -setwebproxystate wi-fi $1
}
dns(){
case $1 in
9)
dserver=9.9.9.9
;;
8)
dserver=8.8.8.8
;;
h)
dserver=192.168.2.1
;;
*)
dserver=empty
;;
esac
networksetup -setdnsservers Wi-Fi $dserver
}
setmacwifi(){
if [ $# -eq 0 ]
then
sudo ifconfig en0 ether `openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
else
sudo ifconfig en0 ether "$1"
fi
sudo ifconfig en0 down
sudo ifconfig en0 up
}
getip(){
nslookup $1 | grep -i address | tail -n 1 | awk 'BEGIN{FS=": "}{print $2}'
}
myip(){
curl https://jabbari.io/ip.php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment