Image for post
Image for post
Photo by Luke Chesser on Unsplash

Originally published at https://www.handracs.info.

In this post, we are going to learn how can we monitor an application developed using the SpringBoot framework using Prometheus and Grafana. We will deploy all the components using docker for simplicity. We will start the blog with a simple, non-exhaustive, introduction to the components that we’re going to use for this post. I’ll provide links as well to where you can go to get more information on the related component.

Background

Monitoring is undeniably one of the important items to have when dealing with applications. It has become even more prevalent in the age of microservices, whereby the team needs to have visibility on what is going on with the multitude of microservices they are operating. …


Image for post
Image for post
Photo by Kelvin Ang on Unsplash

In this post, we are going to run through the process of creating gRPC client/server that is secured using mutual TLS authentication (mTLS). We will start with a little bit of introduction on mTLS and gRPC, that is just enough for the sake of understanding this post. A more detailed discussion on both is outside the scope of this post.

Brief introduction to mTLS

In today’s web, it is very rare to see a website that is not secured at least using HTTPS (HTTP over TLS). It has been a norm in the industry that websites are ought to use HTTPS instead of just using plain HTTP. …


Image for post
Image for post
Photo by Clément H on Unsplash

Originally published at https://www.handracs.info.

In this post, we are going to do a comparison between Hotspot and OpenJ9. For those of you who are already familiar with Java, you must already be familiar with the term Hotspot as well. Hotspot is the Java Virtual Machine (JVM) implementation developed by Oracle (before this was Sun Microsystem). However, OpenJ9 might be less known JVM implementation among the community, especially newcomers to the Java ecosystem. Nowadays, it gains more traction due to the cloud native movement.

A brief history of OpenJ9

OpenJ9 is yet another JVM implementation, originally owned and developed by IBM, which then contributed to Eclipse Foundation on 2017, hence the naming Eclipse OpenJ9. Built to run on mobile devices with very limited memory, OpenJ9 is a suitable solution to be used on the cloud. With high optimisation for fast startup, lower memory footprint, quick ramp-up, and excellent throughput performance, applications deployed using OpenJ9 claimed to be more cost-effective, especially when deployed in the cloud. Some people has claimed that by just replacing their JVM from Hotspot to OpenJ9, their memory consumption has been reduced quite significantly. …


Image for post
Image for post
Photo by Kelly Sikkema on Unsplash

In this post, we are going to run through the steps necessary to extract a PKCS#12 digital certificate to TWO (2) separate files. At the end, we will have a pem file that contains the public certificate and a key file that contains the private key of the certificate.

Before continuing, you have to ensure that you have openssl command installed in your system. You may visit this link https://www.openssl.org/source/ in order to download OpenSSL if you have not had one.

In this post, I will be using OpenSSL version 1.1.1f that has been installed in my system.

handra@nebula  ~/Downloads/demop12  openssl version
OpenSSL 1.1.1f …

Image for post
Image for post
Photo by Rahul Chakraborty on Unsplash

Sometimes, there can be a need to pull the latest images of all the docker images that we have in our installation. Unfortunately, docker does not provide a simple command for us to be able to update all the pulled docker images.

Luckily, with the power of bash, we will be able to accomplish this task. The command below will retrieve the images that we have in our installation and pull the latest images from the docker repository.

docker images | grep -v REPOSITORY | awk '{print $1}' | xargs -L1 docker pull

Now, let’s break down what this command actually does. I’m not going to discuss in detail what the | character is used for. …


Image for post
Image for post
Photo by vipul uthaiah on Unsplash

A new vulnerability discovered by Promon named StrandHogg has been actively attacking Android devices. The bad thing is, it has capability to attack both rooted and un-rooted devices.

This vulnerability is so dangerous that even knowledgeable users can be tricked to submit their credentials, which will then be stolen and used for malicious purposes. …


Image for post
Image for post
Photo by Andrew Ridley on Unsplash

String tokenisation or sometimes called string splitting is one of the most common string operations to be performed when we are doing programming. Take a CSV (Comma Separated Value) for example, which practically separates content based on the use of comma (,) character as separator.

Java makes it very easy to do string tokenisation. The most commonly used method to do string tokenisation is by utilising the split method provided by the String class. Besides utilising the built-in split method, we can as well utilise a class named StringTokenizer provided by the Apache Commons (commons-text) library.

Using built-in split function

Let’s say we have a string with the following…


Image for post
Image for post
Photo by Shahadat Rahman on Unsplash

Introduction

Java stream API is not a really new API. This API has been introduced by Oracle since Java version 8. As specified inside the JDK documentation, Java stream is A sequence of elements supporting sequential and parallel aggregate operations (source: https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html).

Stream API, when used properly, can help the use of collections simpler and easier, following the way of doing functional programming. Java stream API has plenty of operations available.

In today’s post, we are going to run through some of the available operations provided by the stream API, including the sample source code and output from it. …


Digital Signing with Java

Image for post
Image for post
Photo by Eugene Chystiakov on Unsplash

In today’s post, we are going to see how easy it is to do digital signing using Java programming language. Java has provided libraries that you can use out of the box to produce digital signature. Let’s get started.

A little bit of theory

For those of you who do not know yet about digital signature, this is basically a process that ensures that the content that you sent has not been altered in any way. Digital signature is one of the most important things to do in this digital world. Without it, it will be hard to verify data integrity.

Relationship with Hashing

At this stage, one must have noticed that to check data integrity, you can actually use a hashing algorithm. For example, when you download a file from the internet, they usually provide the hash (be it MD5 or SHA1 or higher) for you to check the integrity of the downloaded file. …


Image for post
Image for post

Hong Kong is one of the most vibrant places in Asia. Just recently, I had a chance to visit Hong Kong. During my free time, I took a time to visit a museum called Hong Kong Museum of History. This museum contains the history of Hong Kong, from pre-historic until the more modern Hong Kong. Through this article, I’ll bring you inside the Museum through a brief summary.

The First Gate of History

About

Handra

I am a software engineer focusing on Java programming language and Public Key Infrastructure (PKI). Loves Linux and open-source technology.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store