Visiting Gardener at Malabe

I am a busy web developer working in US and European time lines. I have little free time. I like gardening, but I am always working. A good gardner is important to keep the garden clean, dengue free, and beautiful.

With the help of a friend, mum found a new gardner. He charges Rs. 1500/day. At first I wasn’t sure but I gave him the chance. I was pleasantly surprised. In 2 days he cleared a messy 45 perch garden. About half the garden is grass which I trim. Then there are mums vegetables, fruits and flowers. He cleans and fertilizes. He comes at 8 and leaves sharp 4.

The only issue with him is that he has his own priorities. Just tell him what needs to happen and he will update your garden. He doesn’t like been chased and advised while working. That is not an issue. He knows what he is doing.

The guy is about 60 years old, but energetic. He is a cancer patient. He needs the money for his medication and food. He only works around Thalahena and Malabe because he can’t travel by bus due to his operation.

If you are interested, drop me a mail to with the address and other details. He doesn’t have a phone. But when he comes, I can tell him if you ask me.

API Choice - JSON API V1 vs JSend

I am working on 2 Rails projects with APIs. Both applications use Grape mounted on Rails and swagger for documentation. The older API uses JSend based format for responses. The newer API uses JSON API v1 compliant API. So what is the better option?


JSend dictates on the response format. It doss not provide any insight on how the API should behave or its format. One could argue its flexible. That is true. It allows you to architecture your API the way you desire.

Read more


JSON API v1 on the other hand dictates just about every thing. It is a huge document to read. At best its boring and most new developers find it confusing. But its weakness is its strength. The convention mens any developer familiar with the specification will quickly adopt to the API. There is also the possibility of automation.

Read more

Why I choose JSend

If you would have followed my posts, you will know I dislike fragmentation. A sister project of was already using JSend. Mobile developers would use both my project (Rails website) and the Java application. Since the Java developer had already implemented it and the client preferred it, I decide to follow her footsteps.

What happened…

Here is what happened. I left the team about 6 months ago. I was asked to implement some minor updates. When I came back Java Spring developer asked me a question. Following convention, I gave an answer without looking in the code. I was wrong. Had it been built on a strict set of rules, every one would know what does what.

This is exactly why I love Rails. In a well built app, you know where to find what thanks to the Rails way of doing things.


While there is no restriction. Following a recognized format is important in the long term. Think about tomorrow and implement your new API using JSON API v1. You will save your self a lot of trouble.

Ubuntu Timeout Outlook Mail

I am a freelance web developer. E Mail is a very important part of my business. But suddenly I was not able to access MS Outlook (web) in my Ubuntu machine. But then I heard the notification from my Windows box. I checked and both the Mail client and the web app were working fine.

I searched the web. A Ask Ubuntu answer said to setup the DNS server. That didn’t work for me.

Then I did a wget to find out if it was related to a browser.


The output of wget suggested that it was getting redirected to Then time outs.

Then I loaded the URL. After a few seconds of resolving domain name it redirected to the dashboard. I noticed that in the Windows machine the redirect is almost instantaneous. Not sure what is up. It looks like a DNS issue. How ever now I can check my mail.

Summary: Visit

MySQL Fix/Recover Root Password

John the CEO of asked if I would be able to help them with some updates to the site. I was previously in the team and I left there to join The app runs on MySQL. I hadn’t installed MySQL in my new computer so I did…

#~ sudo apt-get update
#~ sudo apt-get install mysql-server libmysqlclient-dev

I didn’t give a password in the installation pages. I actually didn’t even read what those messages said. When it was done, I tried to access the database and it said I couldn’t login. I red that newer version of MySQL would use the user password. So I tried my password with no luck. Then I tried the root password with no luck. I tried ‘password’ and had no luck. Then I decided to reset the password and figured some things had changed. So I thought of writing a blog post on how to.

First lets access the shell as root. We need root privileges to run the following commands.

#~ sudo -s

Then we need to start stop mysql and start it skipping auth checking.

#~ /etc/init.d/mysql stop
#~ mysql_safe --skip-grant-table &

Then we need to use the mysql database. There is a users table in it and we will update the password hash there. Now most documentation will say you need to update the password attribute but in newer versions of MySQL that is not the case. You need to update the authentication_string attribute. Also just to be safe, lets set the authentication method to use mysql_native_password. Here is how…

use mysql;
update user set authentication_string=PASSWORD('password') where user='root';
update user set plugin="mysql_native_password" where user='root';

Now that we have updated the password, we need to flush privileges and restart the server.

flush privileges;

Then in the shell…

#~ /etc/init.d/mysql stop
#~ /etc/init.d/mysql start

Now you can login with your password. Note: I used ‘password’ above for illustration purposes. Use a password of your choosing, the more secure the better.

I am 31

Birth is special, birthday isn’t, that is what I believe. What ever… it has been 31 years since a very confused me started breathing. 31 years and 9 months since I was commissioned. Here I am, wondering what the heck I am doing!

I haven’t celebrated my birthday since I turned 16. Since then I have given treats (cakes) 3 times. The first when I was an intern at Bank of Ceylon - Kurunegala. The other 2 times was my first and second year at University of Peradeniya.

Mum, S Z Bangsajayah, retired primary teacher at St. Anne’s College Kurunegala, wanted have a cake. So I got a cake, some sweets and candles ‘3’ and ‘1’. Took some photos. We had a small party and some visitors. I changed my policy, because I think it is time for me to change.