Author Archives: cyberaka

About cyberaka

My name is Abhinav Anand and I am an ex entrepreneur. I am currently working as a Solution Architect. My roles are managing the team and project design/architecture development. I started working in the year 2001 as a freelancer and developed softwares for local business houses. During this stint I developed accounting, payroll, inventory, institute management softwares for multiple firms. The crowning achievement during this period was Cash Master and Visual Accounts which were highly used by their respective customers. I did this for almost 3 full years and I learnt from experience that it is difficult for a single person to design big product although you have more control but you are limited to your talent only. You need preferably a small talented team if you want to do anything big. From 2004 I started working in process automation and visualization (HMI) related software. This was a rewarding experience and I developed core competence at many interesting concepts and technology. I got a great deal of experience in team based development and got a very knowledge rewarding technical sales support experience. It is unfortunate that the company I work for and the company for whom they designed the product have both closed their business within 4 years of my leaving. I did this for around 3 years and I learnt from this experience that you cannot focus on a single customer and grow. As a consulting firm you have to hedge your risk on multiple customers and accounts. Whereas as a product firm you need to have a very solid financial backing to break into a market and keep yourself afloat. The most important lesson I personally learnt was to keep clear of products which take better portion of a decade to become successful. From 2007 onwards my focus narrowed down to mobile and web integrated projects. I worked on multiple projects in J2ME (Symbian, Blackberry) and Android. I saw Android’s first release and I loved the power it gave to developers in comparison to iPhone ecosystem. I think the coming of Android changed the game and gave way to the opening up of the iOS development environment to average joe developer. I knew the coming decade was going to be a mesh of mobile and web based solution. The future is all about combining consumer electronics and software for a compelling product. From 2010 onwards I finally got fully involved with my own venture and my focus was developing Android and iOS apps. My goal was to be identified as a dependable mobile based product maker with a solid portfolio of mobile based software. Till date my company has developed Blackberry, iOS and Android apps in variety of small to medium domains. From 2014 onwards I got back into a Job and shutdown my venture. I did this as I had become bored and wanted to work in a bigger team and project. I worked for a while in a Big Data analytics company. Finally I moved to a new company which wanted me to hire a team and write a Retail ERP software from scratch. It has been a very challenging experience and I had to relearn a number of things to get things done. I am still not fully done with this ERP but the end is in sight. It has been a very rewarding experience to work with AngularJS, Spring Boot, Docker, Mockito etc. which were totally new to me. But the technology choices have paid back handsomely.

Spring Certification

We can now do Spring certification without going for Pivotal training. It was long due and here it is finally!

Can you take Spring certification without Pivotal Training Course?

Read more: http://javarevisited.blogspot.com/2017/05/can-you-take-spring-certification-without-training-course.html#ixzz4hVUNb9fW

5 Spring Framework Books for Java developers (Includes Spring Security and Spring Boot) – Best of lot

Read more: http://www.java67.com/2016/12/5-spring-framework-books-for-java-programmers.html#ixzz4hVU7visy

List of good Curl commands

I use CURL for debugging my REST endpoints every now and then if I don’t want to use Postman or DHC clients. I usually like to copy paste results / statistics from command line into emails to my colleagues. This gives them a plain jane command which they can use to test themselves as well as compare their results with mine. The following article has some good pointers on how to use CURL and some very practical examples have been provided.

15 Practical Linux cURL Command Examples (cURL Download Examples)

Displaying memory statistics along with hostname and war files

I recently got into a situation where I had to debug around 10 servers all of which were suffering from memory issues. My java applications were slowing down after a day or so. Although its is difficult to diagnose this kind of issues which span across multiple VMs (welcome to Micro Services!) but with some little bit of scripting it is possible to see in real time the actual numbers if you manage to use tmux to multiplex multiple shell sessions stacked together. I hacked up the following command to display hostname, running war files as well as the memory statistics refreshed every 1 second on screen.

watch -d -n 1 "hostname | tr '\r\n' ' ' && printf \" \" && jps -l | grep .war | tr '\r\n' ' ' && echo "" && free -h"

Linux Disk Usage

I found a good link which lists good usages of the Linux command “du”.

This command allows me to see the usage in a ascending sort which is really helpful.

Tested on Linux.
du -h / | sort -h

Tested on Mac OS.
du -hs * | gsort -h

In case you don’t have gsort install coreutils.
brew install coreutils

This variation allows me to see any line which has the text “G” in it which basically allows me to see folders using space in GBs. Agreed it might give some folder names as well with “G” in it but I can bear with it.

Tested on Linux.
du -h /the/path | sort -h | grep "G"

Tested on Mac OS.
du -h /the/path | gsort -h | grep "G" 

Setting up Sonarqube docker instance

In order to setup a fully functional Sonarqube server via docker I use the following consolidated command:


docker run \
--detach \
--name=sonarqube \
--publish 9000:9000 \
--publish 9092:9092 \
--env="SONARQUBE_JDBC_USERNAME=sonar" \
--env="SONARQUBE_JDBC_PASSWORD=sonar" \
--env="SONARQUBE_JDBC_URL=jdbc:mysql://mysql:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true" \
--link mysql:mysql \
sonarqube:5.1

This connects my dockerized mysql instance with sonar and it is able to create tables and start using MySQL properly for storing all it’s data.

Setting up MySQL docker instance

In order to setup a fully functional MySQL server via docker I use the following consolidated command:

docker run \
--detach \
--name=mysql \
--env="MYSQL_ROOT_PASSWORD=abcd1234" \
--publish 6603:3306 \
--volume=~/Docker/mysql/conf.d:/etc/mysql/conf.d \
--volume=~/Docker/mysql/mysql-datadir:/var/lib/mysql \
mysql

The advantage of the above approach is that the configuration files can be defined under ~/Docker/mysql/conf.d folder on my system and it will be picked up whenever I bootup this instance. The second thing is that all information written by this instance will be stored outside of VM in the path ~/Docker/mysql/mysql-datadir on my system. So In case this VM goes away due to some unexplained reasons I can still bootup another docker instance of MySQL and point it to this data directory.

Maven: Installing / adding local jar into your local maven repository

I needed to install a local jar file into my laptop’s local maven repository and found this article. I used this approach to install this jar file in my repo:

mvn install:install-file -Dfile=my-model-1.2.1.jar -DgroupId=com.cyberaka.my.package -DartifactId=my-model -Dversion=1.2.1 -Dpackaging=jar -DgeneratePom=true

This duly added the local jar file under appropriate group id and artifact id inside my maven repository and I was able to refer to this dependency through my project’s pom.