Wednesday, December 17, 2014

Swift Shell / Swift Console

Very much like Python, including its syntax, Swift programming language actually has a shell. Isn't that cool?

From your terminal, type:

# xcrun swift

You will then see

Welcome to Swift!  Type :help for assistance.
  1>

Enjoy!

Thursday, September 18, 2014

Install MongooseIM on Ubuntu

Ever wondered what awesome technology is used behind WhatsApp which was sold at $10B? It's MongooseIM. And here's how to get you started using it, in Ubuntu..

Install the Pre-Built Package:

wget http://packages.erlang-solutions.com/site/esl/mongooseim/FLAVOUR_1_main/mongooseim_1.4.0-1~ubuntu~trusty_amd64.deb

dpkg -i mongooseim_1.4.0-1~ubuntu~trusty_amd64.deb

Configure it

cd /usr/lib/mongooseim/etc
vim ejabberd.cfg

Run it

mongooseimctl live

Monday, June 30, 2014

Linux: Deleted a File and Its NOT Freeing Up Space?


There is only one reason for it - the file is held by a process.

To fix the issue:

1) Find which process is holding it.

Check open files and return the process using an unlinked file (deleted file)
# lsof +L1

2) Kill the process

# kill -9 <pid>

For a graceful kill but can/may take a while.

# kill -15 <pid>

Friday, May 30, 2014

PayPal: You must specify valid values for the A3, P3, and T3 parameters


When you the error "You must specify valid values for the A3, P3, and T3 parameters" it means that the values you sent to PayPal are invalid.

It could mean that,

1) A3 is not a number
2) P3 is beyond the acceptable limits
3) T3 is not valid.

Usually, the problem is a combination of P3 and T3 issue.

In my case, it was sending more than 24 mos for P3. The solution is to convert T3=M to T3=Y and change the P3 to rounded up years, so P3=3. This solve the issue. I wasn't able to find any documentation associated with the acceptable ranges and user inputs to these 3 required parameters for integration recurring payment button.

Sunday, May 18, 2014

Install Jenkins on Ubuntu/Debian

If you wish to install Jenkins (fork of Hudson, maintained by original developers), do the following:

sudo -i
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
apt-get update
apt-get install jenkins


Note: make sure JAVA is installed.

Install ElasticSearch 1.0.x on Ubuntu/Debian

ES released an apt-get repo for ElasticSearch. It is the recommended package-driven deployment.

sudo -i
apt-get install openjdk-7-jre-headless -y
wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add -

vim /etc/apt/sources.list

#Append the following, then save

deb http://packages.elasticsearch.org/elasticsearch/1.0/debian stable main



apt-get update
apt-get install elasticsearch


service elasticsearch start

Thursday, May 15, 2014

Yum Install ElasticSearch 1.x

Note: Works for CentOS/RHEL/Fedora.
rpm --import http://packages.elasticsearch.org/GPG-KEY-elasticsearch
vim /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-1.0]
name=Elasticsearch repository for 1.0.x packages
baseurl=http://packages.elasticsearch.org/elasticsearch/1.0/centos
gpgcheck=1
gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch
enabled=1
yum update
yum install java-1.7.0-openjdk.i686 -y
yum install elasticsearch

Start ElasticSearch

/etc/init.d/elasticsearch start

If you are wondering where the data directory is for this installations steps, it is stored at:

/var/lib/elasticsearch/elasticsearch