Author Archives: cyberaka

About cyberaka

I am an experienced Senior Solution Architect with proven history of designing robust and highly available Java based solutions. I am skilled in architecting designing and developing scalable, highly available, fault tolerant and concurrent systems which can serve high volume traffic. I have hands on experience in designing RESTful MicroServices architecture using Spring Boot, Spring Cloud, MongoDB, Java 8, Redis and Kafka. I like TDD (JUnit), BDD (Cucumber) and DDD based development as required for my projects. I have used AWS primarily for cloud based deployment and I like developing cloud enabled POC as a hobby in my spare time. I have deigned and developed CI/CD pipeline using Jenkins and leveraged Docker, Kubernetes for containerizing and deploying some of my applications. I am highly experienced in creating high performing technical teams from scratch. As an ex-entrepreneur I am very much involved in the business side of the IT industry. I love interacting with clients to understand their requirements and get the job done.

Subversion Branch and Trunk Sync – Hands On

Subversion has got concept of branches and trunk. Usually the accepted approach is to keep the trunk stable and do all unstable work on the branch. I am going to document how you can create a branch from a workspace using the trunk of a subversion repository. Further I will show how to pull changes done on the branch back into the trunk and vice-versa.

Please replace the localhost:8443 with your subversion URL, the /svn/cjpcs_repo/trunk with your trunk folder and the /svn/cjpc_repo/branches/temp/abhinav with your intended branch folder.

First we create a branch from a workspace checked out to trunk. In this snippet we are creating a shallow copy of the trunk into a branch.
svn copy https://localhost:8443/svn/cjpc_repo/trunk https://localhost:8443/svn/cjpc_repo/branches/temp/abhinav -m "Created a personal branch for abhinav"

In order to start using the branch we need to checkout the branch into a workspace. In this snippet are checking out the branch into the current folder.
svn checkout https://localhost:8443/svn/cjpc_repo/branches/temp/abhinav .

Now you can make some changes on the branch workspace and commit it. Now we need to merge the changes done on branch into the trunk. So go to the trunk workspace and execute the following command. The first command updates the trunk. The second command pulls in all the changes from the branch into the current workspace. If the merge causes some conflicts you need to resolve it manually.
svn update
svn merge https://localhost:8443/svn/cjpc_repo/branches/temp/abhinav

Now commit the merged changes into the trunk. The first command commits the merges done into the trunk and the second command basically confirms the merge.
svn commit -m "Merging changes from the branch"
svn log

That’s it. Your trunk is updated with the changes done on the branch. The same approach can be applied for updating the branch with all the changes on the trunk. The following short snippet summarizes the commands you should execute in your branch workspace to achieve a sync with trunk. If there are conflicts in the merge you need to resolve that manually.
svn update
svn merge https://localhost:8443/svn/cjpc_repo/trunk
svn commit -m "Merging changes from the trunk"

See hidden files in Mac OS Finder

I like to see all the files in the project folder where I am working. So it is inconvenient not being able to see “.gitignore” and “.git” inside the folder where I have git repository. On a brief lookup of the internet I found this article which proposes two approach of making hidden files visible in finder.

Approach #1: Using Terminal

To show hidden files
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

To turn off showing of hidden files
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

Approach #2: Using an App
Funter is a small app which allows the user to toggle the hidden file visibility on and off at the click of a button which is quite convenient.

What I used?
I preferred the terminal approach as I am fairly comfortable with it and I didn’t want to add a new application into my mac’s start-up and menu bar.

How to find Linux distribution and kernel version

In order find out what version of Linux you are running you can execute either of the following commands:

  • cat /etc/*-release
  • lsb_release -a
  • cat /proc/version
  • dmesg | head -1

To find out the kernel version of Linux you can execute either of the following commands:

  • uname -a
  • uname -mrs

Disclaimer: These commands worked for me on Debian Linux.

Update for Oracle Linux

The following commands gave accurate information about OS and release numbers on Oracle Linux.

rpm -qf /etc/redhat-release

oraclelinux-release-6Server-8.0.3.x86_64
cat /etc/issue.net | head -1

Oracle Linux Server release 6.8

 

Multi tabbed windows explorer

In this world of multi-tabbed browsing I find it inconvenient that Windows Explorer has no multi tabbed support. I did some search and found out Clover. I downloaded and installed this tool and voila my Windows Explorer has got tabs. The tool itself is simple and integrates seamlessly with Windows Explorer in Windows 8. I have not had time to check it on my Windows 7 laptop, maybe sometime soon I will post an update.

Creating console based applications in Java

Writing a console based app might sound strange to some Java programmers but for some specific purposes writing a console based application is a necessity. For example let’s say I have write an application which needs to be monitored via SSH. In that either we have to come up with some elaborate command line arguments or special purpose log files. However another approach is write the application and give it a text based GUI which is accessible via textual console like putty, konsole, xterm, gnome-terminal etc. The closes thing that comes to mind is ncurses coming from the C world. We have something similar for Java also available and based on some reports I feel that they are stable enough to be used in any production environment which have need for a light weight, low bandwidth textual client.

  1. Lanterna – 100% Java solution. Very interesting.
  2. Blacken – Not a curses library an has it’s own renderer. The API is however curses-like.
  3. Java Curses Library – It’s built upon the Unix curses windowing system.
  4. Charva – A reliable tool that allows rapid building of UI using OOP approach. Existing UI programmers will definitely like it. It however uses JNI.

 

Production helper utility for Java team

I have been thinking about going through some of these tools to get more productive in deploying / delivering Java based web apps to the team:

Drop Jar is a helpful tool to share jar files.

Drop Wizard is a helpful tool for delivering production read jar files.

Spring Boot allows developers to create web apps easily using convention over configuration.

Shade Plugin allows a Maven based build to overcome duplicate / incompatible versions of libraries. If you have been bitten by incompatible log files you know what I mean.

Open IoT Stack (Internet of Things)

I came across this article on DZone which talks about Open IoT Stack for Java. This stack is envisioned to allow developers to make apps on light weight devices to build IoT solutions. This press release from Eclipse drives home the point as to why IoT is no longer a hype and much more of an imminent reality in the near future. Another report from Vision Mobile talks about how a network of app entrepreneurs might push IoT to unprecedented heights.

Akka for Reactive Programming

As I mentioned in my previous post reactive programming has a compelling reason for adoption as it allows developers to focus on their data flow and business logic. Akka has come across as a tool to enforce reactive programming. It allows you to create distributed and concurrent applications of high complexity in shorter and more manageable time frame.

Reactive programming

Reactive Programming seems to be the rage nowadays (as observed in blogs and newsletter). Out of curiosity I looked it up and was impressed with what it is capable of. Turns out that this is a declarative approach which allow code to react to changes in referenced values.

Let’s understand it from the perspective of a spread sheet. Lets say cell A1 has the formula “=B1+C1”. Now typically we expect that if we change the value in B1 or C1 then the value of cell A1 will be updated automatically.

Keeping this example in mind now lets see how  this can work in programming world. Lets say we have an expression that says A = B + C. When this expression is executed in our code then the value of A is updated whenever this expression is ‘executed’. Once this is done the value of B can be changed or the value of C can be changed without reflecting on the value of A. To enforce a ripple effect back to A like we observed for cell A1 in spreadsheet we have to devise elaborate observers / listeners on the values of B and C to update A whenever the value of B or C change. In a real life production environment this simple expression can be replaced with more complex algorithm or data flow and you have a situation which can quickly get out of hand and might be difficult if not impossible to debug.

In reactive programming we react to changes. So in the above situation the value of variable A will be updated as and when the value of B or C changes.

This concept has been well explained in a dzone article.

FireFox OS

I have heard some good things about FireFox OS and with recent launches for ultra cheap FireFox OS based handsets in India I think that HTML based development of apps for this OS will be a different experience. I have had some reserved feelings about HTML5 development on Android and iOS platform. Somehow I felt that HTML5 development was feature limited on the mobile platform. However with FireFox OS I think I would definitely give it a try and post my experience on this blog.