xpam.pl

Author: cen

  • Updating server from Debian Stretch to Buster

    Not the most pleasant experience.. I expected a smoother upgrade from Debian team. Upgrading from 8 to 9 was a walk in the park compared to this. 1. MySQL silently fails to start after upgrade MySQL was left behind at version 5.5 after upgrade and would just not start anymore, probably segfaulting. There is no…

  • HTPP Accept-Language request header to ResourceBundle

    HTTP Accept-Language header is specified by the client to inform the backend what the preferred language for the response is. In Java, the go-to utility for handling localization is ResourceBundle. What is missing is a standard way to properly convert the input header to the correct ResourceBundle. Specifically, ResourceBundle i18n = ResourceBundle.getBundle("bundles/translations", request.getLocale()); is insufficient.…

  • resize Fedora root partition

    Default root partition size on my Fedora installs usually becomes too small down the line to the point I can no longer install packages or perform the upgrades without removing packages or clearing dnf cache. Therefore I wanted to shrink my home partition and add that space to root. We can’t perform the resize while…

  • That moment when you need to look up definition of C++ for loop

    I was getting a segfault on an old piece of code which I maintain. The culprit was pinpointed to this: bool found = false; vector<string> :: iterator i; for (i = v.begin(); !found && i != v.end(); ++i) { if (name == *i) { found = true; } } if (found) { v.erase( i );…

  • Tenant resource authorization in JAX-RS

    You have a book REST resource and each book has an owner. Only the owner of the book can access an owned book. JAX-RS specification has no answer to this problem since it only provides a role based security with @RolesAllowed annotation. It is unfortunate JavaEE spec does not offer at last some interfaces which…

  • Creating a new torrent and seeding with Transmission

    You have setup a Transmission server on your Linux box together with Transmisison Web or something along those lines and now you are wondering.. how can I actually seed a NEW file? I couldn’t find a straightforward answer on the web so here is the short tutorial: Upload your file to your transmission download directory…

  • Ubuntu 18.04 on MacBook Pro 11.5 – a sad state of affairs

    There was an extra MacBook Pro 11.5 lurking around so I decided to install Ubuntu 18.04 on it and try to setup a usable workstation. A culmination of several issues prompted me to not pursue this setup further. Linux drivers and MacBook hardware just don’t play along very well. Display flickering/corruption on main display The…

  • Xrandr framebuffer and per-display scaling

    Ubuntu 18.04 LTS came out recently with Gnome desktop as default. Unfortunately even in 2018, it won’t remember the external monitor positioning after reboot and has no support in display settings to set per-display scaling. Year of the Linux desktop, anyone? Xrandr is a powerful Linux tool to manipulate displays. Unfortunately, the man page is…

  • Can JPA @Version column be nullable?

    When using @Version with yor JPA entities you might be wondering, should you make the column nullable or not? There is no answer to this question in the documentation or the internet in general. The only way to find out was to test it. The answer is: column has to be not-null, at least for…

  • Running multiple PHP versions and compiling from source

    We had a peculiar situation where both PHP5 and PHP7 were needed at the same time on a FreeBSD server. It was also prohibitive to get root or sudo access on the managing account. The solution was to compile PHP from source with fpm, run fpm on a UNIX socket and wire the specific domain…