BOC Changes Internet Banking System

BOC, the oldest and largest bank in Sri Lanka, makes updates to its Internet and Mobile Banking System. The old system had its fair share of issues.

Online is the way to go

I used to visit the bank quite often. 2 years ago, things changed. I stopped (to a great extent) using cash and transit to an almost all digital economy. I paid my bills online. I used debit/credit cards for purchases. Rarely would I cash money to use.

Online banking issues

I found the BOC online payment system very well featured. But I found it not very reliable. I didn’t make any errors, but the service is often un available.

One day I transferred money from my savings to my current account and wrote 2 cheques. Later that day I went to Keels to buy some goods and dang I didn’t have funds. I checked my phone and my balance was just a couple thousand rupees. The transaction had happened “offline”. But fortunately before the cheques were cashed, the transaction went through.

This is not isolated. There are many times that I couldn’t even access the web portal.

Oracle Banking or Shitty Banking!

It appears as though the BOC has invested in Oracle. I thought it was a great idea, until I used the app for the first time.

All my hopes melted away when I opened the new portal in my browser. It was ugly at best and not responsive (for mobile use) at all. I know, I am a high end web application developer using cutting if not bleeding edge tech. My expectations are high. But I have been building responsive applications for 7+ years now.

Then it was time to change the password. I quite literally cursed the mother of the idiot who coded it.

The password is set to be between 8-10 characters. This is 2000 standard. Current day passwords need to be longer. Some of my passwords go to 20+ characters.

There is a password strength meter that will give show how good your password is. The funny thing is, at its character limit of 10, it never goes beyond ‘medium’.

If the idiot who made the form was under my supervision, he would have lost his job!


In an overall fashion, I can’t say it is an improvement. I hope this is work in progress and that they will make improvements in the coming months.

If not, then this could be the next scandal to rock the papers.

Free News Papers Delivered to Home

This incidence relates to a Wijaya Newspapers. Wijya are to deliver news papers to your door step if you pay up front (3 months, 6 months or 12 months). The provided pricing is as such, you will get a 20% discount. So if you are an avid news paper reader, you can call them up and setup delivery.

I woke up early. I went to my office room and continued some work that was bugging me last night. While I was at it and sipping a cup of tea I heard some thing landing on my garden. It was a bunch of papers. I was unusual, but I thought it would be for mum, and got it inside.

She was her self puzzled. I suggested asking our neighbors if it was theirs. After I had finished work on the issue I got dressed and head out to ask about the papers.

For my surprise, I found out that the whole lane was supplied with news papers, wroth about Rs. 150. No one seemed to know why.

I had a hypothesis that there would be some advertisements related to the up coming elections. I checked but there were no advertisements. There was no common denominator when it came to front page news to suggest some one wanted to make a point.

Why those papers were delivered remains a mystery. Have you also received such?

Setup Local Dev with DOT Test

This is not Rails tutorial, but i use Rails references. Swap it with what ever the framework you use. How ever this setup is for Linux.

Not every project can simply rely on rails s for local development. This is specially true if you are working on a SaaS application that is using sub-domains for tenants. Today I am going to share with you how I have configured my local development environment to serve project using .test TLD.

The setup is as follows…

I assume you have a (Rails) project in /home/user/client/project.

DOT Test to localhost

There are many ways you can do this. But I believe the easiest way is to use dnsmasq.

#~ sudo apt-get install dnsmasq

If you are in Ubuntu you would need to update NetworkManager config. This is because NetworkManager it self uses dnsmasq which conflicts with our interests. Open up /etc/NetworkManager/NetworkManager.conf and comment out the line that reads dns=dnsmasq. Then restart the service

#~ sudo restart network-manager

Then you need to configure dnsmasq to listen to local DNS queries. Edit /etc/dnsmasq.conf and add listen-address= to the file.

Next we need to tell dnsmasq to resolve .test to localhost. To do this create a new file /etc/dnsmasq.d/test with content address=/test/

Now we are good. What we need to do is to install and setup Nginx.

Nginx Reverse Proxy

If you wanted to setup local environment to host .test domains, the chances are you need to configure Nginx or Apache for the task as well. I don’t use Apache. So here is an example how to install and configure Nginx to serve a Rails application.

Many developers I know already know how to setup and configure Nginx, so I kept it for last.


First of all, lets install it!

#~ sudo apt-get install nginx

Can’t get any simple than that, could it!

Project Configuration

I am assuming your project uses sub-domains. Some thing like a SaaS application with tenants served through sub-domains.

Create a file in

upstream projecttest {
  server localhost:3000 max_fails=3 fail_timeout=600;

server {
  listen 80;
  server_name *.project.test;

  root /home/user/client/project/public;

  try_files $uri/index.html $uri @projecttest;

  location @projecttest {
    proxy_pass http://projecttest;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;

  error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;

Here projecttest can be what ever you like. I use the naming format <project-name><tld>. Some use app. Its up to you!


Thats it… no cd to your project folder and run rails s and visit your app… www.project.test or any of its sub domains.

Chrome Kills DOT Dev - Use DOT Test

Last night I was involved with some refactoring in I went to bed following a dist-upgrade in Ubuntu. This morning when I fired up rails s and opened the project in Chrome I was greeted with an error. It was an issue about the certificate. FireFox was unaffected by this.

Google nabs dot-dev

Google had acquired the rights for the .dev domain in 2015. But until recently using .dev for local development wasn’t an issue. I didn’t use .test because most of my clients had their projects configured to use .dev for local environment.

This is a total dick move by Google.

Time to change

I would recommend the use of dot-test (.test). It is a reserved name by the IETF (Internet Engineering Task Force). A list of domain names you can use are as follows…

  • dot-test (.test)
  • dot-example (.example)
  • dot-invalid (.invalid) - wtf! exactly :P
  • dot-localhost (.localhost)

In addition, I think you can also use .local. It is generally used in private networks for networking devices.

When you change, you may need to…

  • re-gen your self-signed certs if in use
  • update session store config (Rails) and similar in other frameworks


It was time to move away from .dev 2 years ago. But since Google is forcing you out, you have to either ditch chrome or move to some thing like .test.

In my side, I think it is time to publish some new tutorials on how to configure local development using .test.

Implement Rails Views with Common Code

Proper structuring of views in an application is important. It helps minimize code redundancy. For components you can use partials. If the common code applies in the scale of layouts its best you use nested layouts. In addition to using nested layouts, you have the option to use partials that accept blocks.

Nested Layouts

Nested layouts are best when the common code applies in a layout level. For example think about a blog section. It will be different from the main layout in a way there will be a sidebar and a header. In ways layouts/application.html.slim will have additions to it. This is when you should use nested layouts.

You will have to modify your layouts/application.html.slim to accept a content_for block. This is where we will add the nested layouts content in to.

    = content_for?(:content) ? yield(:content) : yield

Then you can write a nested layout as follows. Lets say it is layouts/blog.html.slim.

- content_for :content do
    h1 My Cool Blog
    = yield
    = render 'layouts/blog/sidebar'

= render template: 'layouts/application'

Partials Accepting Blocks

The other way to share layout code is through partials that accept blocks. Think about a page referencing a blog post. Rather than just having a link, you make a little drama adding the blog title, featured image etc.

In the page, we desire some thing like…

/ views/pages/products/web-crawlers-and-scrapers.html.slim
h1 Web Crawlers and Scrapers
p Lorem ipsum...
p Lorem ipsum...

= render partial: 'blogs/embed', locals: { blog: Blog.find(1) } do
    li Point 1
    li Point 2
  p Lorem ipsum...

Here we can customize each embed in the page by adding some extra slim to describe the context.

In the blogs embed view partial, we can do some thing like this.

/ views/blogs/_embed.html.slim
h3 blog.title
= image_tag blog.image.url
= yield

While this is a basic example, I believe you get the point.


Rails allows you to neatly structure your views reducing code duplication. While it is easy I have seen some projects with views that can only be described as a nightmare. A word of advice, don’t leave them a all over the place and and DRY (do not repeat your self) things up.

While I believe modern applications should be built separately as an API (Rails API, Grape or in node LoopBack) and client-side app using some thing like React JS or Angular, the Rails view layer will stay alive for a good 10 years to come. Hence my contribution on the topic.