2024
Dealing With LWLock:LockManager Wait Events in Aurora Postgres
Learn how Postgres’ lock manager, lightweight locks, and fast-path locking work together—and what to do when LWLock:LockManager wait events slow down your system.
How to Safely Alter a Busy Table in Postgres
When altering busy tables in Postgres, acquiring the required locks can lead to application downtime if not handled carefully. This post explains the potential pitfalls of using ALTER TABLE on high-traffic tables, and provides strategies for minimizing disruptions.
Improve the Quality of Your Tests With Mutation Testing
Ever wondered if your tests are actually catching bugs as they should? Let’s dive into mutation testing, a clever technique that helps us validate the quality of our tests.
Accessing EC2 Instances with AWS SSM
Discover how to access your EC2 instances with AWS Systems Manager (SSM), eliminating the need for complex networking setups or SSH key management.
What’s inside the Nginx Ingress Controller?
This post explores the inner workings of the Nginx Ingress Controller and provides useful insights for application developers.
2020
The Three Ways of DevOps
If you ask three people to describe DevOps, you’ll get four different answers. This post tries to shed some light on the meaning of DevOps by summarizing the key principles from The DevOps Handbook.
Pattern Matching for instanceOf in Java 14
Pattern matching capabilities added to the instanceOf operator in Java 14 is going to enhance the programming language.
Helpful NullPointerExceptions in Java 14
Helpful NullPointerExceptions in Java 14 improve NPE error messages by describing precisely which variable was null.
Java 14 Records
Java 14 introduces a new preview feature to the language—Records—with a goal to provide a compact syntax for declaring containers of shallowly immutable data.
Running Spring Boot apps as GraalVM native images
GraalVM is a high-performance polyglot virtual machine. It’s ability to create ahead-of-time compiled native images considerably speed up Spring Boot startup times.
2019
Misusing Java’s Optional type
Java’s Optional type has been criticised for its flaws. It’s also being used for things it was perhaps not designed. This post shows some situations where I think Optional is being misused.
How to Invalidate JSON Web Tokens
JWTs allow us to implement stateless authentication. We don’t have to query a central database to validate the token. But how do we invalidate them?
Rock-solid Consumer Driven Contract Testing Workflow With Pact
To make the most out of Pact, you should put some time into automation. This post will cover the steps you need to take to create a rock-solid workflow that helps you to reap the benefits of consumer driven contract testing.
Consumer Driven Contract Testing with Pact
Consumer driven contract testing is a method that can be used to verify that services speak the same language. It is an alternative to traditional integration testing that gives you faster feedback.
The Challenges of Testing Microservices
Microservices provide you with several benefits. But there’s no question that they introduce a new set of challenges, one of them being testing.
Serving React apps from Spring Boot
You’ve decided to build a wep app with React and want to use Spring Boot for the back end. This post will show you how to serve a React app from Spring Boot.
2018
Structuring packages in Java web applications
Often times in Java web applications we see that the package structure indicates that a layered architecture is used. In this post we’re going to explore the ideas around what would happen if layers were not the topmost level of organization in an application architecture.
Improvements to Optional in Java 9
Java 9 introduced three new methods to the Optional class. This post covers what they do and how to use them.
2017
Using environment variables with Spring Boot
This post will cover how you can use OS environment variables to pass configuration values to a Spring Boot application.
How to write a good commit message
Version control systems play a vital role in tracking the history of changes in a codebase. Knowing how to write good commit messages is an essential skill if you wish to have your project’s history well documented.
takeWhile and dropWhile in Java 9 Streams
Arguably one of the most noteworthy new features introduced in Java 8 was the Streams API. Java 9 offers two new stream operations—takeWhile and dropWhile.
To field inject, or not to field inject in Spring?
Nearly all Spring projects that I have worked with make heavy use of field injection. This must be a popular approach because it is concise and reads well. But have you ever considered the downsides of field injection?
Java’s While and Do-While Loops in Five Minutes
A while loop is a control flow statement that runs a piece of code multiple times. It consists of a loop condition and body. Java also has a do while loop.
Java’s Ternary Operator in Three Minutes
The ternary operator is a form of syntactic sugar for if-then-else statements. It is also known as the conditional operator, which is perhaps a more meaningful name because it evaluates conditions like if does.
Java’s If Statement in Five Minutes
The if statement is the most basic conditional statement. It checks a condition, which is any boolean expression, and runs a block of code if it is true.
Unit testing classes that depend on time
Dependency inversion principle states that we should depend upon abstractions. Taking that into account, time should also be considered as a dependency.
Type-safe configuration in Spring Boot
Spring Boot provides a type-safe way to handle configuration by allowing you to create a bean and populating it with property values from your configuration file.
Externalized configuration in Spring Boot
Externalized configuration is essential if you wish to deploy the same deployable unit to different environments without modifying the source code. Spring Boot provides several easy methods of doing that.
2016
Getting started with Dropwizard - CRUD operations
Dropwizard is a framework for building RESTful web services in Java. This tutorial shows how to create, retrieve, update, and delete resources.
5 ways to create a Stream in Java 8
Java 8 introduced the Streams API which allows developers to declaratively manipulate collections. Here are five ways to create a Stream in Java 8.
Running a Dropwizard application in IntelliJ IDEA, Eclipse and NetBeans
In addition to executing a Dropwizard application from the command line, you can increase your productivity by configuring your IDE to do that for you. This post is going to be looking at how to run a Dropwizard application in IntelliJ IDEA, Eclipse and NetBeans.
Getting started with Dropwizard
Dropwizard is a framework for building RESTful web services in Java. In this tutorial we’re going to have a look at how to get started with developing a Dropwizard application by building a new service from scratch.
Practice programming with code katas
Kata is an exercise where the novice repeatedly tries to emulate a master. In karate, these kata are a sequence of basic moves, strung together in a way that makes sense. PragDave proposes the idea of doing the same with programming.
ERR_EMPTY_RESPONSE and SSH not working
Chrome is returning ERR_EMPTY_RESPONSE, Git and SSH connection hangs at expecting SSH2_MSG_KEX_ECDH_REPLY. Seems to be an MTU/fragmentation problem.
Java, Unicode, and the Mysterious Compiler Error
This post covers how the Java compiler handles Unicode escapes and how they can cause mysterious compiler errors.
Java 8 Puzzlers: Streams
In the spirit of the book Java Puzzlers by Joshua Bloch and Neal Gafter, this post discusses a Puzzler that can be found in Java 8 Streams.
How to control an RC car over WiFi with ESP8266
ESP8266 is a low-cost WiFi chip with a full TCP/IP stack and a microcontroller capability. Here is how I used it to control an RC car.
Design patterns: Specialization of the classic observer pattern
In the typical case, the observer is responsible of getting the updated state from the subject. This means that the observer has to hold a reference to the subject (also the subject holds a reference to the observer, meaning we have created a circular reference).
Design patterns: Observer pattern implementation in Java
Observer pattern is a design pattern with an intent to define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
Ansible force remote user with Vagrant 1.8
My Ansible playbook stopped working when using Vagrant 1.8 or above. The problem seems to be with changes made in Vagrant.
Ansible skipping localhost when using Vagrant
Vagrant Ansible provisioner skips plays that are meant to be run on localhost. There’s a simple workaround for that.
Java 8: CompletableFuture
CompletableFuture is an implementation of the Future interface but with a modern twist. It takes advantage of functional operations to promote asynchronous/event-driven programming model.
Using Ansible to manage SugarCRM 7 environments and deployments
I’ve decided to use Ansible to manage SugarCRM environments and deployments. Here’s an overview of Ansible playbooks I’ve created.
Chaining Optionals in Java 8
Optionals in Java can help you to write a program without null checks. Chaining Optionals in a Stream enables to pick the first Optional which has a value and return it.
Using a serial monitor with SparkFun ESP8266 Thing on Linux
Using Arduino IDE’s serial monitor with SparkFun ESP8266 Thing does not work. In this post you’ll see how to use a serial terminal with the SparkFun ESP8266 Thing on Linux.
Optionals in Java 8
If you have had any experience with Java, then you most likely have seen the NullPointerException. Optional in Java 8 are a way to fight them.
The fork/join framework in Java
Introduced in Java 7, the fork/join framework is used to divide a parallelizable task into smaller ones and afterwards combine the intermediate results to get the end result.
Controlling an RC car with an Arduino
Looking for an easy hardware project? Controlling an RC car with an Arduino board is relatively simple. I’ll share my experience.
Version control and deployment practices for SugarCRM
This post will give you ideas on how to do version control with SugarCRM and how to manage multiple environments and deployments.
Creating a custom collector in Java 8
A collector is a recipe for how to build a summary of the elements in a Stream. In this post you’ll see how to create a custom collector in Java 8.
2015
Service won’t start when using the service utility
I debugged a service which didn’t start when using the service utility but was working fine when calling the init script directly.
Four types of method references in Java 8
Method references let you reuse existing method definitions and pass them just like lambdas. They can be useful in making the code more readable.
Blogging with Jekyll and Github
It is possible to host your blog at Github and version control your blog posts with Git. Here’s how.
Java 8: Lambda expressions
In computer programming, an anonymous function (also function literal or lambda abstraction) is a function definition that is not bound to an identifier.
Java 8: Behavior parameterization
Behavior parameterization is essentially taking a block of code and making it available without executing it. Here’s how to do it with Java.
The importance of taking a break
If you’re going to dedicate the best years of your life to work, make sure you’re doing it for the right reasons.
Setting up a reverse SSH tunnel with a Raspberry Pi part 2
In part 2 I promised to show an example use case on how to connect to a Windows Server over RDP via a reverse SSH tunnel.
Setting up a reverse SSH tunnel with a Raspberry Pi part 1
You need to access your work computer or network from your home. Maybe a Raspberry Pi can help you.
Using Joda-Time in unit tests
Joda-Time is a Java library which provides a quality replacement for the Java date and time classes.
2014
Fixing wireless on Macbook Pro with Ubuntu 13.10
Downgrading Broadcom’s proprietary driver and making sure no updates are applied to it.
NTLM authentication fails on Linux when accessing QlikView Access Point
I was unable to connect to QlikView Access Point from a Linux machine. My browser presented me with a username/password prompt and after entering the correct credentials, it seemed like no authentication was made.
Error when exporting to Excel in QlikView AccessPoint
A client of mine was unable to export data from QlikView Access Point to Excel.
5 steps to improve SSH security
SSH is something we (developers, sysadmins) use daily to connect to remote servers. Here are a few tips to keep your SSH connection secure.
Batch file in Windows Task Scheduler does not run
Creating a scheduled task in Windows Task Scheduler to run a batch file is relatively straight forward, or so I thought.
Remmina: cannot connect to Windows server over RDP
What to do when suddenly you’re unable to connecto to a Windows server with Remmina over RDP
Sharing a local folder during a remote desktop session with RDesktop
Rdesktop is an open source client for Windows Remote Desktop Services, capable of natively speaking Remote Desktop Protocol (RDP) in order to present the user’s Windows desktop
SEVERE: Error listenerStart - debugging Tomcat applications
How to debug the dreaded ‘Error listenerStart’ error message
2013
Getting started with Mockito - a tutorial for beginners
A tutorial for getting your feet of the ground with Mockito
Solving MySql JDBC CommunicationsException
I faced a com.mysql.jdbc.exceptions.jdbc4.CommunicationsException and this is how I solved it.
Character set problem when uploading a file
Non-ASCII characters in file name get garbled when uploading a file with Apache Commons and Spring CommonsMultipartResolver.
How to configure VirtualBox VM with 2 network adapters
This post describes how to create a VM which has a connection to the internet and also to other VMs in the virtual network.
Setting up Redis replication
The goal of this post is to install Redis on both of them and set up a master-slave replication configuration
Autoloading Yii application classes in external scripts
Sometimes I want to have access to all of my classes in a Yii application externally.
Background jobs with PHP part 2
In this post, as promised, we’re going to implement a queue of jobs with Resque and Redis
PHP Fatal error: Cannot redeclare class with Yii
I am fairly new to PHP and Yii. Lately i struggled with a ‘cannot redeclare class’ error.
Background jobs with PHP part 1
A background job is a task that is executed ‘behind the scenes’ and without user intervention.
Configuring Tomcat to accept Estonian ID card
In order to accept Estonian ID card, Tomcat needs to be configured to accept client side certificates.
Setting up SSL on Apache
This article explains how to create an SSL certificate, get it signed and configure Apache web server
Configure SSL on Apache Tomcat
Here we are going to have a look at how to set up SSL on Apache Tomcat 7.0.
How to enable SSL listen port in Weblogic
Where to find the option in Weblogic console to enable SSL?
Programming tips and tricks #1
These are not necessarily related to the technical aspects of programming.
How to access phpmyadmin after installation?
You’ve just installed phpmyadmin from your package manager. Here’s what you need to do in order to access it
XsltException caused by JRebel
XsltException caused by a seemingly missing stylesheet. Turns out JRebel was the culprit.
Wrong version of Ant in path
Recently, working on a Windows box, I had a problem where my ANT_HOME and ant -version result did not match.