Commits

tednaleid  committed 4ee0b7e

adding hadoop shortcuts

  • Participants
  • Parent commits 5b05fcd

Comments (0)

Files changed (1)

File zshrc_general

 
 export USER_LIB=/Users/$USER/Documents/workspace/lib
  
-# export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
 export JAVA_HOME=$(/usr/libexec/java_home)
 
 export SCALA_HOME=/usr/local/scala
 export JAVA_OPTS="-Xmx1024m -XX:MaxPermSize=512m"
 
 #export GRADLE_OPTS="-Xms2048m -Xmx2048m -XX:MaxPermSize=1024m"
-export GRADLE_HOME='/usr/local/gradle'
+#export GRADLE_HOME='/usr/local/gradle'
 export GRADLE_OPTS="-Xmx2048m -XX:MaxPermSize=1024m"
+export GRADLE_REPOSITORY="$HOME/.gradle"
 
 # for X11 forwarding, (need to have X11.app running (in applications/utilities after install))
 export DISPLAY="localhost:0.0"
 
 alias update_locate='sudo /usr/libexec/locate.updatedb'
 
+# copy the last command to your clipboard
+alias clc='fc -ln -1 | pbcopy && echo $(pbpaste)'
+
+# builtins don't have their own man page
+alias manbi='man zshbuiltins'
+
+
+alias mdf='mdfind -name'
 alias mdlocate='mdfind' # I always forget about this spotlight search from the cmd line, this'll help me remember
 alias mdfields='mdimport -X' // list the import formats 
 
 alias lcl='launchctl list'
 alias lcs='launchctl start'
 
+
+
 # print the contents of a single line (passed in as an argument)
 alias ol=onlyLine
 function onlyLine() { awk 'NR == '$1' {print;exit}'; }
 alias g135='switchGrails "groovy-1.7.5" "grails-1.3.5"'
 alias g136='switchGrails "groovy-1.8.4" "grails-1.3.6"'
 alias g136g8='switchGrails "groovy-1.8.4" "grails-1.3.6"'
+alias g137='switchGrails "groovy-1.7.5" "grails-1.3.7"'
 alias g200='switchGrails "groovy-1.8.4" "grails-2.0.0"'
+alias g201='switchGrails "groovy-1.8.6" "grails-2.0.1"'
 alias ggit='switchGrails "groovy-1.8.4" "grails-git"'
 
 function switchGrails() {
 # rvm loading
 [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
 
+
+## GRADLE ##########################################################################################################
+
+function newgradle() {
+    echo "Creating files for new gradle project"
+
+    cat <<EOF>.gitignore
+*.un~
+*.iml
+*.ipr
+*.iws
+build
+.gradle
+EOF
+    
+    cat <<EOF>build.gradle
+apply plugin: 'groovy'
+apply plugin: 'idea'
+
+repositories {
+    mavenCentral()
+}
+
+dependencies {
+    groovy 'org.codehaus.groovy:groovy:1.8.6'
+    compile 'org.apache.ivy:ivy:2.2.0'
+}
+
+task createSourceDirs(description : 'Create empty source directories for all defined sourceSets') << {
+    sourceSets*.allSource.srcDirs.flatten().each { File sourceDirectory ->
+        if (!sourceDirectory.exists()) {
+            println "Making \$sourceDirectory"
+            sourceDirectory.mkdirs()
+        }
+    }
+}
+
+idea {
+    project {
+        jdkName = '1.6'
+    }
+}
+EOF
+
+    gradle createSourceDirs
+
+    git init
+    ls -a1 && find src    # list all created assets
+}
+
+## HADOOP ##########################################################################################################
+
+export HADOOP_VERSION=hadoop-0.20.2-cdh3u3
+#export HADOOP_VERSION=hadoop-0.20.205.0
+export HADOOP_HOME="/usr/local/$HADOOP_VERSION"
+export HADOOP_INSTALL=$HADOOP_HOME
+export PATH=$PATH:$HADOOP_HOME/bin
+
+export HADOOP_HEAPSIZE=2000
+export HADOOP_OPTS="-server -Djava.security.krb5.realm=OX.AC.UK -Djava.security.krb5.kdc=kdc0.ox.ac.uk:kdc1.ox.ac.uk"
+
+alias hadoopstart='start-all.sh'
+alias hadoopstop='stop-all.sh'
+alias hadoopstatus="jps | egrep '(TaskTracker|JobTracker|DataNode|NameNode|SecondaryNameNode)'"
+
+# delete localhost entry from known hosts so we can loopback connect to various machines for hadoop
+alias dkh='wc -l ~/.ssh/known_hosts && cp ~/.ssh/known_hosts ~/.ssh/known_hosts.bak && grep -v localhost ~/.ssh/known_hosts.bak > ~/.ssh/known_hosts && wc -l ~/.ssh/known_hosts'
+
+