Sunday, April 29, 2012

Change the default Java installation used by Ubuntu


Though you have installed and using a particular Java installation (E.g. Oracle Java 7), sometimes when you install some other softwares they might change the default to other Java installations (E.g. OpenJDK)

In such situations to change the default version, run the following commands and chose the appropriate selection when prompted.

For Java :
update-alternatives --config java
For Java compiler :
update-alternatives --config javac
For Java web start :
update-alternatives --config javaws

How to instal Java in Ubuntu

Now, Java is installed and we need to set the JAVA_HOME.
Visit How to set JAVA_HOME in Ubuntu post to get to know how you can appropriately set JAVA_HOME and PATH.

Saturday, April 28, 2012

Apache MeetUp held in Hill Country




The students of University of Peradeniya did a great job organizing an amazing Apache meet up at Kandy, Sri Lanka. This was the second major event in Sri Lanka next to the Apache Bar Camp Colombo that was held this year.

Here the first talk was on "FOSS in Kandy" by Dr. Nimal Rathnayaka, followed by Dr. Srinath Perera explaining "The Apache Way" of managing projects, how the communities work together and how they resolve conflicts using the voting system with the -1 veto. 

After the introduction of open source and Apache, Nandika Jayawardrdana gave an inspiring speech on "Open source and your career" giving out some valuable informations to the audience how one can use open source to become much better at his career. Here he explained how open source can improve your communication skills, writing skills - where you have to convince and argue on your ideas via the mailing list, and how your participation on open source makes you famous - which indeed will be eye catching even at the selection phase for a grad school, and most importantly he also expressed how we get a self satisfaction when so many people are using the product that you have build. This also falls according to the famous saying "A project without users (means, it) does not exist".  

Following this, Sagara Gunathunga gave a good briefing on how you can "Find your way to Apache Contribution", Here he not only stressed on coding but also mentions some other great ways of contributing, like writing technical blogs on the project, helping with documentation and testing the project. He continued explaining how these are extremely valuable to do when you are a newbie and gain recognition from your project community. 

After lunch, we had two practical sessions, the first one is on how to configure and use Apache Web Server in an efficient manner - by Anuradha Ratnaweera, and the second was on "Apache build projects" - by Prabath Abeysekara and myself, where we demonstrated Apache Subversion, Maven and Ant. 

Finally the session was concluded with Pradeeban's lighting talk on how to build a community for your project.

Sunday, February 26, 2012

Apache BarCamp Colombo


We just had a wonderful Apache BarCamp here in Colombo at the UCSC Auditorium. The main motivation behind this activity is to promote open source contribution and give an inside into "Apache Way" of software development. Here I'm sharing some bits and pieces that stick to my mind.

The session kicked off with an excellent keynote by Dr. Sanjiva Weerawarana, where he was talking on the interesting point on how Sri lanka eventually became the third largest contributor to Apache Software Foundation (ASF). There he mentioned how they initiated the first ever Sri Lankan open source development at a UCSC lab with four C++ programmers and how they were able to come up with AxisC++ which was then been shipped by IBM.

Following Sanjiva, Ross Gardler took the floor and went on explaining “The Apache Way”, from what ASF is and how we could start and become a long term contributor. He clarified all important small words thats binds ASF like, Meritocracy where the action should speak louder than words, Lazy Consensus where “when you are convinced that you know what the community would like to see happening you can simply assume that you already have its support unless someone says otherwise” and the use of -1's where one should be opposing the arguments with valid points.

The final key note was by Nick Burch, who did a wonderful job sharing his experience on what a pain he went through to apply his first patch, explaining how open source communities work and why we should not take things personally when they did not apply your patch or response to your queries. He gave a strong point on how developers might be busy on some other projects and in open source if you want things to happen the way you want you have to "Just F****** Do It" (JFDI). He ended up his great talk with the final touch by saying how open source development could be very fun and how it might even end up as an addiction.

With all these three key notes we too had two other sessions where in one, Sagara Gunathunga was presenting they key steps that you will need when you "Find your way to Apache contribution" by giving some clear idea for all newbies to get a kickoff start.

Finally we had an interesting session on  "How to prepare to Google Summer of Code 2012 with Apache projects" motivating young undergraduates to take off the fear of open source and accept the challenge on doing GSOC 2012! Thanks Pradeeban for presiding the sessions and Nirmal and Eranda for sharing your experience with me to all the enthusiastic ordinance.

We thank WSO2, Vertusa, ASF and UCSC for your help in sponsoring this great event.



Sunday, February 19, 2012

Installing Apache Thrift in Ubuntu


Apache Thrift is a RPC framework for scalable cross-language services development which in simpler words allows easy exchange of data such as variables, objects between applications written in different languages. Thrift offers seamless cross language serialization between languages like C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk and OCaml, through Code generation. The advantage of Thrift is that it’s faster than using SOAP since it’s using a binary protocol.

For better understanding of Thrift's architecture which consists of Transports, Protocols and Processors I recommend you to go through the paper I found [1].
Thrift was initially developed at Facebook, and now open sourced as an Apache project. Since I found Thrift is less documented, in this post I'll try to walk through the installation steps in Ubuntu.

I have tested this on Ubuntu 11.11 and 12.04

To install Thrift

Step 1.
First install
sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev

Step 2.
Then Download tar.gz archive from the download site, decompress archive in your home directory:
tar -xvzf thrift-0.8.0.tar.gz

Step 3.
Go to the installation root directory  and run
$ ./configure

Step 4.
A the end of the output you will find something like this

thrift 0.8.0
Building code generators ..... :
Building C++ Library ......... : yes
Building C (GLib) Library .... : no
Building Java Library ........ : yes
Building C# Library .......... : no
Building Python Library ...... : yes
Building Ruby Library ........ : no
Building Haskell Library ..... : no
Building Perl Library ........ : no
Building PHP Library ......... : no
Building Erlang Library ...... : no
Building Go Library .......... : no
Building TZlibTransport ...... : yes
Building TNonblockingServer .. : yes
Using javac .................. : javac
Using java ................... : java
Using ant .................... : /usr/bin/ant
Using Python ................. : /usr/bin/python

Check whether the libraries for your development environment have been code generated. If something is missing skim through the output of configure to find the missing component and install that, and then again run step 3.

Step 5.
Finally from the same directory run
$ make

Step 6.
Now run
$ sudo make install

Now your done

To check whether Thrift is working, run;
$ thrift -version

[1] http://thrift.apache.org/static/thrift-20070401.pdf