Author: marjavamitjava

How to detect a VM

In Java, you can check if the current system is running on a virtual machine (VM) by inspecting certain system properties or by checking for specific indicators in the environment. While there’s no direct...

Using docker API to listen to stop event in java

This code snippet is a great approach to listen for Docker events, particularly the stop events, using the HttpClient in Java without relying on a Docker client library. The code makes use of the...

How to detect system clock skew in java

Here’s a simple Java code example to detect clock skew by comparing your system’s current time with the time from an NTP server. Java Code to Detect Clock Skew Using an NTP Server You’ll...

DNS resolution in depth

Let’s walk through the scenario where you bought a domain from GoDaddy, host your website content on host.com, and map your domain to the website content. 1. You Buy a Domain from GoDaddy 2....

Optimizing Solr Client Usage by Caching for Each Collection

Introduction When working with Apache Solr, especially in applications with multiple collections, it’s common to create a new Solr client instance for each connection. While this may seem straightforward, it can lead to performance...