레이블이 Language인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Language인 게시물을 표시합니다. 모든 게시물 표시

2016년 10월 25일 화요일

Bash shell

1. Bash Brace Expansion
# touch test{1,3,5,7,9,11}
# ls test{1,3,5,7,9,11}
=> test1  test11  test3  test5  test7  test9

# ls test{1,7}
=> test1  test7

# ls test{1..7}
=> test1  test3  test5  test7

# ls test{1..11..4}  // 1부터 11까지 4씩 증감
test1  test5  test9

# echo /dev/sd{a..z}
=> /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi /dev/sdj /dev/sdk /dev/sdl /dev/sdm /dev/sdn /dev/sdo /dev/sdp /dev/sdq /dev/sdr /dev/sds /dev/sdt /dev/sdu /dev/sdv /dev/sdw /dev/sdx /dev/sdy /dev/sdz

# echo /dev/sd{z..x}
/dev/sdz /dev/sdy /dev/sdx

2. 문자열 치환
# sed -i 's/SET_IPOIB_CM=auto/SET_IPOIB_CM=no/g' /etc/infiniband/openib.conf

2016년 10월 24일 월요일

Install JDK 7

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

# cd /usr/local/src
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.rpm"

rpm -ivh jdk-7u79-linux-x64.rpm
# vi /etc/profile
~~~~~
export JAVA_HOME=/usr/java/default
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar

# source /etc/profile
# alternatives --config java
There is 1 program that provides 'java'.

  Selection    Command
-----------------------------------------------
*+ 1               /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91-2.6.2.3.el7.x86_64/jre/bin/java

Enter to keep the current selection[+], or type selection number: 1

# java -version
java version "1.7.0_91"
OpenJDK Runtime Environment (rhel-2.6.2.3.el7-x86_64 u91-b00)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)

2016년 10월 19일 수요일

Install JDK 8

# cd /usr/local/src
# curl -LO -H "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u71-b15/jdk-8u71-linux-x64.rpm"

# rpm -Uvh jdk-8u71-linux-x64.rpm
# vi /etc/profile
~~~~~
export JAVA_HOME=/usr/java/default
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar

# source /etc/profile
# alternatives --config java
There is 1 program that provides 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/java/jdk1.8.0_71/jre/bin/java

Enter to keep the current selection[+], or type selection number: 1

# java -version
java version "1.8.0_71"
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)

2016년 10월 15일 토요일

R 설치

# yum -y install libpng libpng-devel libtiff libtiff-devel libjpeg-turbo libjpeg-turbo-devel readline-devel bzip2-devel libcurl-devel cairo-devel

# cd /BiO/src
# wget http://cran.nexr.com/src/base/R-3/R-3.3.0.tar.gz
# tar zxvfp R-3.3.0.tar.gz
# cd R-3.3.0/
# ./configure --prefix=/BiO/R-3.3.0 --enable-R-shlib --with-libpng --with-jpeglib --with-libtiff --with-x
# make && make install
# /BiO/R-3.3.0/bin/R
> capabilities()
       jpeg         png        tiff       tcltk         X11        aqua 
       TRUE        TRUE        TRUE       FALSE        TRUE       FALSE 
   http/ftp     sockets      libxml        fifo      cledit       iconv 
       TRUE        TRUE        TRUE        TRUE        TRUE        TRUE 
        NLS     profmem       cairo         ICU long.double     libcurl 
       TRUE       FALSE       FALSE       FALSE        TRUE        TRUE