Skip to content

Instantly share code, notes, and snippets.

@azam
Last active January 29, 2016 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azam/93390fdca1a7c5ecce4c to your computer and use it in GitHub Desktop.
Save azam/93390fdca1a7c5ecce4c to your computer and use it in GitHub Desktop.
Mac OSX Bash Profile
### 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 "azam@users.noreply.github.com"
git config push.default simple
git config core.precomposeunicode true
git remote add origin git@github.com:$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