The other day, I was trying to build a simple batch upload interface for a Java web application running Spring Boot with Spring MVC on Apache Tomcat. But when I tried reading the
InputStream in my controller, it was always empty. Fortunately, this turned out to be quite easy to fix.
Posted in java
Tagged java, server, web
On Linux/Unix systems, there’s occasionally the need to check whether a process is running. Some people use it for simple status checks or when building their own lifecycle scripts for startup and shutdown. I don’t think it’s a particularly good practice these days because all of this can be achieved with tools like systemd, supervisord, JavaServiceWrapper, or even Docker. But if you can’t use these for some reason, read on.
Posted in linux
Tagged linux, scripting
In my article on unattended upgrades I described how to set up an Ubuntu system to install security upgrades automatically. This is convenient for small setups, but in an enterprise environment you typically want to perform some QA before applying the change. A better solution is to have your monitoring system generate an alert if security upgrades are available. In this article, we’re going to build an Icinga plugin to hook into your monitoring/alerting system.
Thanks to Ubuntu 16.04 which includes a fairly recent Nginx version, I have now enabled HTTP/2 on my private server. Of course, I also wanted to verify whether my configuration change had any effect – after all, there is no visible change (except for a little speed-up). One option that works really well is the HTTP/2 and SPDY indicator Chrome extension. But after some playing around with Python, I also found an easy way to detect HTTP/2 support using just Python’s standard library.
Posted in python
Tagged python, server, web
There’s more to migrating a complex site to HTTPS than just enabling TLS in your web server or reverse proxy. All links to embedded resources like style sheets, images, or scripts need to be served via HTTPS and potentially have to be rewritten. In a well-designed site that’s not an issue, but in most peoples’ organically grown setups it can be a huge effort.
Posted in misc
Tagged security, server, web
Sometimes it’s useful to check whether a local JAR file is available from Maven Central, for example when converting an old build system to Maven. In many old systems, JARs aren’t named consistently and versioning info isn’t available. Fortunately, Maven Central has a search interface that supports lookup by a JAR file’s SHA-1 checksum. And even better, there is a REST API to automate things.