Skip to content

Instantly share code, notes, and snippets.

@hanxue
hanxue / install_JRE_in_Ubuntu.sh
Last active October 12, 2015 14:38
Install JRE in Debian / Ubuntu
$ sudo apt-get install default-jre scala sbt
@hanxue
hanxue / install_play_framework.sh
Last active October 12, 2015 14:38
Download and Install Play framework
$ sudo apt-get install unzip
$ wget http://downloads.typesafe.com/play/2.2.1/play-2.2.1.zip
$ unzip -d /opt play-2.2.1.zip
@hanxue
hanxue / play_shortcut.sh
Last active October 12, 2015 14:38
Set up Play shortcuts in Ubuntu
$ sudo chmod +x /opt/play-2.2.1/play
$ sudo ln -s /opt/play-2.2.1/play /usr/local/bin/play
$ play
@hanxue
hanxue / install_openjdk7.bash
Created November 23, 2012 10:19
Install openjdk-7
<div class="gistLoad" data-id="GistID" id="gist-GistID">Loading ....</div>
@hanxue
hanxue / update-alternatives_java.sh
Created November 23, 2012 10:21
Change java to another default version
$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1051 manual mode
Press enter to keep the current choice[*], or type selection number: 2
@hanxue
hanxue / update-alternatives_query_java.sh
Created November 23, 2012 10:36
update-alternatives_query_java.sh
$ update-alternatives --query java
Link: java
Status: auto
Best: /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java
Value: /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java
Alternative: /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java
Priority: 1061
Slaves:
java.1.gz /usr/lib/jvm/java-6-openjdk-amd64/jre/man/man1/java.1.gz
@hanxue
hanxue / java_incompatibility.sh
Created November 23, 2012 10:37
Java class binary incompatibility error
! @6cdp8lgno - Internal server error, for request [GET /] -&gt;
play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[UnsupportedClassVersionError: controllers/routes : Unsupported major.minor version 51.0]]
@hanxue
hanxue / play_app_9000.sh
Created November 23, 2012 15:21
Run Play app port 9000
$ play run 9000
[info] Loading project definition from /home/hanxue/Scala/myFirstApp/project
[info] Set current project to myFirstApp (in build file:/home/hanxue/Scala/myFirstApp/)
--- (Running the application from SBT, auto-reloading is enabled) ---
[info] play - Listening for HTTP on port 9000...
(Server started, use Ctrl+D to stop and go back to the console...)
@hanxue
hanxue / plugins.sbt.sh
Created November 23, 2012 15:28
Plugins Sbt file
// Comment to get more information during initialization
logLevel := Level.Warn
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.0.4")
@hanxue
hanxue / lammps-requisite.sh
Created December 2, 2012 10:56
lammps pre-requisites
$ sudo apt-get install gcc g++ make libmpich2-dev libfftw-dev libjpeg-dev