Wednesday, 9 May 2018

Backward compatibility in user experience

Gmail recently launched a new design. I tried it out of curiousity. The first thing I noticed was that my muscle memory started failing me. Every time a new design comes, people focus on the look and feel of the design, its intuitiveness and other such factors but its compatibility with old design is not taken into account ever.

Power users tend to build muscle memory even for UIs. I tend to move my mouse to a particular location on the screen for the delete button for example.

With a product that has so many existing users, I think GMail should pay attention to these details as well when planning a new design. So, should other companies with similar products. An epic failure in the same lines is removal of start button by Microsoft. Of course a button position is not as critical; but the point is to have this criterion included in the design process.

Wednesday, 31 January 2018

Testing filebeat

For testing codecs like multiline, the recommendation is to try the Go playground website. However, before making a config live, it can be tested locally also; using input from stdin and printing output to the console. The following config can be used as skeleton.

- input_type: stdin

    pretty: true

Friday, 12 January 2018

Ola does not support Amex

As per their FAQs, Ola claims to support Amex cards.

However, when an attempt is made to add an Amex card, an error is shown as following.

The explanation provided by Ola is as follows.

I don't understand why is this clarity is not provided in the FAQ.

Tuesday, 2 January 2018

KActivityManager blocking unmounting

While un-mounting a partition to safely remove the external hard drive, I got an error about the device being busy. Both Dolphin and the command line said the same thing.

umount /run/media/myuser/New\ Volume/
umount: /run/media/myuser/New Volume: target is busy.

It seems kactivitymanagerd was using it.

[root@clown myuser]# fuser -vm /run/media/myuser/New\ Volume/
                    USER        PID ACCESS COMMAND
/run/media/myuser/New Volume:
                     myuser     612 ..c.. kactivitymanage

I tried to stop the daemon but I got the following error.

root@clown myuser]# /usr/bin/kactivitymanagerd
QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0

After some discussion on Freenode, I got to know that when graphical apps are run with escalated priviledges, similar error is found. I guessed I was getting the error because I was trying to stop the daemon as root user. I tried changing back to my regular user and stopping the daemon. It worked  and I was able to unmount the drive after that.

/usr/bin/kactivitymanagerd stop
Service stopped
Cleaning up...

Tuesday, 5 December 2017

Benchmarking elasticsearch and logstash pipeline

Elasticsearch and logstash pipelines can be elaborate or simple. Depending upon the setup, end to end benchmarking should be done time to time. One way to do it is to have a marker document (log line). We need to track when the marker is introduced into the pipeline and finally when it becomes available to query.

import urllib2

import json

from datetime import datetime

import sys

import time

print "Started at " + str(
if len(sys.argv) < 2:
   print "URL not specified.\nUsage: "

count = 0
while count < 1:
    resp = urllib2.urlopen(sys.argv[1]).read()
    count = json.loads(resp)["hits"]["total"]
    if count > 0:
        print "Found at " + str(

The above script can be used as follows:

python <script_file> "http://<host_name>:<port_number>/_search?q=message:<markerMessage>"

Thursday, 16 November 2017

Toggle Read-only behaviour of buffer in Emacs

When a file to which you have read access as regular user is opened in emacs, the buffer is marked read-only. If the user escalates to root and opens the same file in emacs, the buffer still remains read-only. To modify the file, the user needs to toggle the read-only behaviour of the buffer (for which the default key binding is C-x C-q) first.

Increasing the maximum number of file descriptors allowed per user on Cent OS 6

For some applications like elasticsearch, the maximum number of file descriptors needs to quite high. The way of modifying the value varies from distro to distro. In Cent OS6, the following did not work.

1. Using sysctl as root
sysctl -w fs.file-max=100000

2. Using ulimit as root

After the above approaches, when you check the value using the following, the value will show up.

cat /proc/sys/fs/file-max

However, setting the values as root, does not change the values for other regular users. To set it specifically for any user, change the value in /etc/security/limits.conf file. Setting only the soft or hard limit will not be sufficient. Therefore, the following lines should be added.

<user> soft nofile <value>

<user> hard nofile <value>

After the modifications, it is required to logout and log back into the system.

Monday, 30 October 2017

Manually install maven dependency

Error messages from Maven are often useless. The root cause is mostly never captured. Debugging issues might require manually installing a dependency. The way to do it is as follows:

mvn install:install-file -DgroupId=jnuit -DartifactId=junit -Dversion=3.8.1 -Dpackaging=jar -Dfile=/path/to/file

Sunday, 15 October 2017

Correct do...while in Ruby

Rubyists use the .each or .map way of looping frequently. However, when there is a need of a while loop, the following is the correct way.
loop do
    # statements
    break if condition