Setting up a new VPS server

These are the things I did to setup new VPS instances on Digital Ocean and ChicagoVPS

Update the machine

sudo apt-get update
sudo apt-get upgrade

Set locales

sudo locale-gen
sudo dpkg-reconfigure locales

add user

sudo adduser tutysra
# give sudo previliges
sudo visudo
tutysra ALL=(ALL) ALL

Install Git

sudo apt-get install git

Install sun java

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Install Tor for screen scrapping

sudo apt-get install tor
sudo /etc/init.d/tor start

Make default directories

mkdir ~/swt
mkdir ~/bin

Install NX ( not necessary for CLI boxes)

export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get update
sudo -E apt-get install -y ubuntu-desktop
sudo apt-get install gnome-session-fallback

wget 'http://64.34.173.142/download/3.5.0/Linux/nxclient_3.5.0-7_amd64.deb'
wget 'http://64.34.173.142/download/3.5.0/Linux/nxnode_3.5.0-9_amd64.deb'
wget 'http://64.34.173.142/download/3.5.0/Linux/FE/nxserver_3.5.0-11_amd64.deb'

sudo dpkg -i *.deb
sudo /usr/NX/bin/nxserver --status

nano /usr/NX/etc/node.cfg
# Uncomment the “DefaultXSession” line and set it to :
DefaultXSession=/etc/X11/Xsession

Enable/Disable password authentication in ssh

sudo vi /etc/ssh/sshd_config
 PasswordAuthentication to "yes/no" 
 PermitRootLogin no
sudo service ssh restart

Install screen & tmux

sudo apt-get install screen
sudo apt-get install tmux

Install curl

sudo apt-get install curl

Install emacs and customize

sudo apt-get install software-properties-common # installs some python scripts necessary for these operations
sudo add-apt-repository ppa:cassou/emacs
sudo apt-get update
sudo apt-get install emacs-snapshot-el emacs-snapshot-gtk emacs-snapshot
export TERM=xterm-256color

Install lein

mkdir ~/bin && cd ~/bin
wget 'https://raw.github.com/technomancy/leiningen/stable/bin/lein'

Install JDK6 for neo4j

wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" http://download.oracle.com/otn-pub/java/jdk/6u41-b02/jdk-6u41-linux-x64.bin 

export JAVA_HOME=/home/neo4j/swt/jdk1.6/
export PATH=/home/neo4j/swt/jdk1.6/bin:$PATH

Configure swap

My ChicagoVPS runs on OpenVZ and Swap space couldn’t be enabled at VM level.

[Read More]

Correlation between INR values of different currencies

Correlation between INR values of different currencies2012-09-05 11:31 data clojure

This is an interesting take away example from the class which Anand is teaching at NIAS. Here we are trying to correlate between the INR values of various currencies like AUD, CNY (Chinese Yen), EUR, GBP (Great Britain Pound), JPY, SGD, USD and find the positive or negative correlations. The focus is on data collection and transformation.

The first part is the identification of a proper source to get the data. oanda.com is one such source from which historic currency exchange rates can be obtained.

[Read More]

Started blogging from a new place

I have been thinking about having a professional looking blog/space for some time. I noticed many people I follow on github maintaining a neat blog, I see that many of them use jekyll/ octopress and use github pages for hosting. I like the concept of static blogging and wanted to give it a try.

I gone through the process and it looks neat and clean, create a github repo with your username and drop html pages into it and github takes care of serving them, damm simple. Can't wait to write my blog and here comes the first posts. I will be tweaking my comments setup with disqus and analytics and also my blog engine using this post.

[Read More]