24 January 2017

Setting a default shell to bash

Add this command to .profile

export SHELL=/bin/bash
[ -z "$BASH_VERSION" ] && exec /bin/bash -l

SSH to server without password

  • Create public and private keys using ssh-key-gen on local-host

Reference: http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id

Setting up R library directories

  • Install R (R-3.1.1 in my case)
# basic development packages
install.packages("devtools")  
install.packages("roxygen2")  
install.packages("testthat")  
install.packages("knitr")

# key packages data wrangling and visualization
install.packages("dplyr")  
install.packages("tidyr")  
install.packages("plyr")  
install.packages("stringr")  
install.packages("ggplot2") 

install.packages("ScottKnottESD", dependencies=TRUE)
devtools::install_github('klainfo/DefectData')
install.packages("rms")
install.packages("caret", dependencies=TRUE)
install.packages("ggplot2")
install.packages("gridExtra")
install.packages("pROC")
install.packages("psych")
install.packages("reshape2")
install.packages("randomForest")
install.packages("e1071")
install.packages("RWeka", dep=TRUE)
install.packages("foreign")
install.packages("gridExtra")
install.packages("boot")
install.packages("beanplot")
install.packages("bigrf")
install.packages("BMA")
install.packages("psych")
install.packages("mclust")
install.packages("gbm")
install.packages("vcd")
  • Test loading all libraries to check if there is any error.

Reference: https://blog.terminal.com/getting-an-up-to-date-r-and-rstudio-installation-on-ubuntu/

Setting up Java environment and Installing rJava without root privileges

  • Create new directory
mkdir -p ~/local/lib
  • Download Oracle a JDK package (jdk-8u121-linux-x64.tar.gz) from here (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

  • Unpack it to /home/user/local/lib

  • Run R CMD javareconf -e in console to ensure that all is correct.

R CMD javareconf
  • Install rJava
curl -#ROL https://www.rforge.net/rJava/snapshot/rJava_0.9-8.tar.gz
R CMD INSTALL rJava_0.9-8.tar.gz
  • Run a quick check
R --quiet -e 'library("rJava"); .jinit(); .jcall("java/lang/System", "S", "getProperty", "java.runtime.version")'
> library("rJava"); .jinit(); .jcall("java/lang/System", "S", "getProperty", "java.runtime.version")
[1] "1.8.0_66-b17"

Reference: http://charlotte-ngs.github.io/2016/01/MacOsXrJavaProblem.html

  • Add these two lines to ~/.Rprofile
Sys.setenv(JAVA_HOME = '/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home') 
dyn.load('/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/server/libjvm.dylib')
print("load java libraries")

Reference: https://yetanotherbiochemblog.wordpress.com/2014/11/07/install-rjava-for-local-java-installation/



blog comments powered by Disqus