Zabbix is a great open source tool to monitor operating system and application metrics. You can install it on your web server and out of the box, it is able to show you fancy graphs for things like: Memory availability CPU usage Disk space usage Network bandwidth Free swap space In this guide, I will show you how to create a dashboard widget that displays the response time for a specific URL over time. You can use this to monitor ...

Learn how to add HTTPS encryption to your Spring Boot application running inside a Docker container. Since the arrival of free Let’s Encrypt certificates, there is really no excuse not to use HTTPS for encrypting your application traffic. Obtaining and integrating a free HTTPS certificate is easy and only requires three simple steps. This article shows the integration for a CentOS 8 web server with a Dockerized Spring Boot application. Registering a Certificate On your web server, obtain certbot, the ...

Ignoring the semantics of HTTP methods such as GET and POST can have disastrous security repercussions. You might think that using GET methods for deleting entities is fine since you only need to pass a single identifier and do not want to set up its own HTML form for doing so. Please let me convince you of the opposite. HTTP Semantics Before we can go into detail why this distinction matters for web application security, we need to grasp the ...

In this article, I will demonstrate how to install Java OpenJDK 14 on macOS Catalina in 2020. If you are interested in installing OpenJDK 15 (which is the newest version as of this writing), please see this article: How to Install Java OpenJDK 15 on macOS Catalina Download and Install OpenJDK 14 Download the .tar.gz version of OpenJDK 14 from jdk.java.net/14/. sudo mv openjdk-14.0.1_osx-x64_bin.tar.gz /Library/Java/JavaVirtualMachines/ cd /Library/Java/JavaVirtualMachines/ sudo tar -xzf openjdk-14.0.1_osx-x64_bin.tar.gz sudo rm openjdk-14.0.1_osx-x64_bin.tar.gz Next, execute the following command to ...

In this post, I am showing you how to use the freely available Open Weather Map API to retrieve hourly weather forecasts 48 hours into the future for a given place using Python without external packages. Continue reading if you need an easy and flexible way to obtain weather data in your python application and you want to avoid using third-party dependencies for the task. You will use the free tier of the Open Weather Map API. The resulting weather ...

Flash messages (one-time notifications) are commonly used to display the result of an operation to your users: Spring Boot offers this exact functionality in the RedirectAttributes interface. It uses the FlashMap data structure to store the flash messages as key-value pairs. Thymeleaf automatically supports reading those attributes in the template files the same way it handles ordinary model attributes. One handy feature of flash messages is that they survive redirects (in contrast to normal model attributes). Have a look at ...

Spring Sessions allows you to persist user sessions into a database. Combined with Spring Security, it is easy to create a setup where each logged in user is represented by a row in a SPRING_SESSION table. Externalising sessions into a database is also a prerequisite for a zero-downtime deployment strategy where users can stay logged in while a new application version is deployed. On paper, the integration of those two Spring components is very easy. Assuming you have a working ...

Different deployment environments (e.g., development, testing, staging and production) often require that different pieces of code are switched on and off. For example, you only want to send real emails in production and write to an email log in all other environments instead. Or your code to initialise the database should only run in the staging environment. A simple but hard to maintain way for such conditional code executions is to define a globally available variable such as isProductionSystem and write ...

Stop repeating yourself. Emails and messages in general often consist of repeated content blocks that never change. Greetings and signatures are perfect examples: some people even try to eliminate such “noise” from messages (for example, the “nohello”-movement). While it is unrealistic that such changes to the human interaction protocol will ever be universally accepted, there is something else a productivity-minded person can do in order to lose less time each day typing the same phrases over and over again. Outlook ...

Measuring code execution times is hard. Learn how to eliminate systematic and random measurement errors and obtain more reliable results. We often need to measure how long a specific part of code takes to execute. Unfortunately, simply measuring the system time before and after a function call is not very robust and susceptible to systematic and random measurement errors. This is especially true for measuring very short intervals (< 100 milliseconds). Systematic and Random Errors So what is wrong with ...

Bernhard Knasmüller on Software Development