Tuesday, May 26, 2015

Setting up hadoop

1. Extract hadoop tar.gz file
tar zxf hadoop-2.7.0.tar.gz

2. Finding the env.sh file
find hadoop-2.7.0/  -name hadoop-env.sh

3. Changing the JAVA_HOME directory in hadoop-env.sh
% export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre

4. Creating an environment variable that points to the hadoop installation directory
% export HADOOP_HOME=$(pwd)/hadoop-2.7.0
% PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin

5. If everything is done correctly, type
% hadoop version

and you should get the following:

Hadoop 2.7.0
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r d4c8d4d4d203c934e8074b31289a28724c0842cf
Compiled by jenkins on 2015-04-10T18:40Z
Compiled with protoc 2.5.0
From source with checksum a9e90912c37a35c3195d23951fd18f
This command was run using /home/justin/hadoop-2.7.0/share/hadoop/common/hadoop-common-2.7.0.jar

Tuesday, December 23, 2014

Installing GSL on Linux

Setting up GSL
1. Downloading gsl library
wget ftp://ftp.gnu.org/gnu/gsl/gsl-1.7.tar.gz

2. Unpack file, this create a new directory called gsl-1.7 in your home directory
tar -zxvf gsl-1.7.tar.gz

3. Create a new directory
mkdir /home/justin/dev

4. Configure the installation and tell it to use your new directory
./configure --prefix=/home/justin/dev

5. Actual installation
make
make check
make install

Linking libraries
1) C
gcc -Wall -I/home/justin/dev/include -c example.c
gcc -L/home/justin/dev/lib example.o -lgsl -lgslcblas -lm

2) Similarly, C++
g++ -Wall -I/home/justin/dev/include -c example.cpp
g++ -L/home/justin/dev/lib example.o -lgsl -lgslcblas -lm

Then proceed to run program with
./a.out

Installing Sublime Text 2 on Linux

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

sudo: super user do
ppa:webupd8team/sublime-text-2: adding unsupported packages with this PPA (Personal Package Archive)
apt-get: get a package from the Advance Packing Tool
update: to synchronize the package index file from the source