Last active
January 29, 2016 03:18
-
-
Save azam/93390fdca1a7c5ecce4c to your computer and use it in GitHub Desktop.
Mac OSX Bash Profile
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
### Java | |
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) | |
### Maven | |
export MAVEN_HOME="$HOME/Applications/apache-maven-3.3.3" | |
export M3=$MAVEN_HOME | |
export M3_HOME=$M3 | |
export PATH=$PATH:$M3_HOME/bin | |
### Android | |
export ANDROID_HOME="$HOME/Applications/android-sdk-macosx" | |
export ADT_HOME=$ANDROID_HOME | |
export ANDROID_TOOLS="$ANDROID_HOME/tools" | |
export ANDROID_PLATFORM_TOOLS="$ANDROID_HOME/platform-tools" | |
export PATH=$PATH:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS | |
### NPM | |
export PATH=$PATH:./node_modules/.bin | |
### Azam | |
alias ll='ls -alG' | |
alias flushdns='sudo killall -HUP mDNSResponder' | |
export PS1="\D{%T} \W$ " | |
alias servehere="python -c 'import BaseHTTPServer as bhs, SimpleHTTPServer as shs; bhs.HTTPServer((\"0.0.0.0\", 8888), shs.SimpleHTTPRequestHandler).serve_forever()'" | |
alias gitlinestats="git log --pretty=format:%an | awk '{ ++c[$0]; } END { for(cc in c) printf \"%5d %s\\n\",c[cc],cc; }' | sort -rn" | |
#alias gitblamestats="export LC_ALL=C;git ls-tree -r HEAD|gsed -re 's/^.{53}//'|while read filename; do file \"$filename\"; done|grep -E ': .*text'|gsed -r -e 's/: .*//'|while read filename; do git blame -w \"$filename\"; done|gsed -r -e 's/.*\((.*)[0-9]{4}-[0-9]{2}-[0-9]{2} .*/\1/' -e 's/ +$//'|sort|uniq -c;export LC_ALL" | |
#alias gitblamestats="git ls-tree -r HEAD" | |
alias mroe=more | |
alias chromedev="open /Applications/Google\ Chrome.app --args --disable-web-security" | |
alias st="open -a /Applications/Sublime\ Text.app $1" | |
gitstats() { | |
export LC_ALL=C | |
git ls-tree -r HEAD | gsed -re 's/^.{53}//' | while read filename; do file "$filename"; done | grep -E ': .*text' | gsed -r -e 's/: .*//' | while read filename; do git blame -w "$filename"; done | gsed -r -e 's/.*\((.*)[0-9]{4}-[0-9]{2}-[0-9]{2} .*/\1/' -e 's/ +$//' | sort | uniq -c | |
export LC_ALL= | |
} | |
gitprep() { | |
if [ -z "$2" ] | |
then | |
echo "gitprep: illegal arguments" | |
echo "usage: gitprep [dirname] [reponame]" | |
return -1 | |
else | |
mkdir $1 | |
cd $1 | |
git init | |
git config user.name "azam" | |
git config user.email "[email protected]" | |
git config push.default simple | |
git config core.precomposeunicode true | |
git remote add origin [email protected]:$2 | |
git remote update | |
return 0 | |
fi | |
} | |
randpass() { | |
cat /dev/urandom | env LC_CTYPE=C tr -dc "a-zA-Z0-9" | head -c 16 | |
echo | |
return 0 | |
} | |
run() { | |
local n=$1 | |
shift | |
for i in `seq $n`; do | |
nohup $@ &> nohup.out.$i & | |
done | |
} | |
zipall() { | |
for i in */; do zip -r "${i%/}.zip" "$i"; done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment