Thursday, May 23, 2013

Install Oracle GlassFish 3.1.2.2 on Mac OS X 10.7 or later

#Update Java from Apple Software Update, currently its version Java 6

#Set JAVA_HOME depending on current java version installed
vi ~/.bash_profile

export JAVA_HOME=`/usr/libexec/java_home -v 1.6`
 
#or
#export JAVA_HOME=`/usr/libexec/java_home -v 1.7` 

# Download Oracle GlassFish 3.1.2

# Add executable permission to run GlassFish
chmod +x ./ogs-3.1.2.2-unix.sh
 
# Run Installer 
sh ./ogs-3.1.2.2-unix.sh

Wednesday, May 15, 2013

Install PDT (PHP Development Tools) on Eclipse Juno

Eclipse->Help->Install New Software...

Add site:
http://download.eclipse.org/tools/pdt/updates/nightly

Sunday, May 5, 2013

Installing Oracle Java binaries on Debian Linux

#Check Linux version
uname -a

#Download appropriate binaries from Oracle site
#http://www.oracle.com/technetwork/java/javase/downloads/index.html
#Choose Linux x64 e.g. jdk-6u45-linux-x64.bin

#Remove java
sudo apt-get purge openjdk-\*
sudo apt-get remove --purge sun-java6-jdk

#Create java dir
sudo mkdir -p /usr/local/java

#Copy java to the newly created java dir
chmod a+x jdk-XuYY-linux-x64.bin

#extract
./jdk1.6.0_45-linux-x64.bin


#include java in system environment
vi /etc/profile
JAVA_HOME=/usr/local/java/jdk1.6.0_45
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH

#
update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.6.0_45/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.6.0_45/bin/javac" 1

#reload environment
./etc/profile

#Check version
java -version
javac -version

Saturday, May 4, 2013

Install Cassandra on Debian Linux

#Install Debian

#Install Java

#Install JNA
apt-get install libjna-java

#Install Cassandra
sh -c 'echo deb http://www.apache.org/dist/cassandra/debian 12x main >> /etc/apt/sources.list.d/cassandra-stable.list'
sh -c 'echo deb-src http://www.apache.org/dist/cassandra/debian 12x main >> /etc/apt/sources.list.d/cassandra-stable.list'


#Add GPG Keys
gpg --keyserver pgp.mit.edu --recv-keys 4BD736A82B5C1B00
gpg --export --armor 4BD736A82B5C1B00 | sudo apt-key add -
gpg --keyserver pgp.mit.edu --recv-keys 2B5C1B00
gpg --export --armor 2B5C1B00 | sudo apt-key add -

sudo apt-get update
sudo apt-get install cassandra

#Configure Cassandra
/etc/cassandra

#Configure defaults
/etc/default/cassandra

#configure node 1
listen_address:  ip-address-of-node-1
rpc_address:  ip-address-of-node-1
seeds: ip-address-of-node-1

#configure node 2
listen_address:  ip-address-of-node-2
rpc_address:  ip-address-of-node-2
seeds: ip-address-of-node-1

#=====
setup
#create keyspace
 create keyspace MyKeyspace1 with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options = {replication_factor:1};

#use keyspace
use MyKeyspace1;

#describe keyspace
describe MyKeyspace1;