That UPS you bought for your home server may not be as useful as you think

, 09/08/2020 | Source: Fitzcarraldo's Blog

Some years ago I decided to install a server at home for use as a NAS (network-attached storage) in my home network, and for an Internet-facing server. I live in a place where blackouts are very infrequent (perhaps a couple per year), but occasionally the mains drops out for only a second or two. I […]

How to edit your music data tags using the command-line

The command-line tool Audiotag is an easy to use Perl-script for editing the data tags in your music files. It supports the formats MP3, OGG Vorbis, MP4, M4A and FLAC.

Example usage

To print information about a track you use the flag -l, --list-info:

$ audiotag -l 01_Claustrophobic_Amnesia.ogg

*** `01_Claustrophobic_Amnesia.ogg'
=== ALBUMARTIST: Ter Ziele
=== ARTIST: Ter Ziele
=== COMMENT: Visit
=== DATE: 2018
=== TITLE: Claustrophobic Amnesia

I noticed that the track is missing a genre, let’s set the genre for all the tracks of that album:

$ audiotag -g "Depressive suicidal black metal" *.ogg

It’s simple as that. To list all available features just use the flag -h, --help. I also highly recommend using the flag -p, --pretend to dry run the command if you’re not 100% sure about what you’re about to do.


The easiest option is probably to clone the Git-repository on GitHub and copy the script to your $PATH. Just make sure that you have installed Perl (version 5.6 or newer) and:

  • For MP3-support: id3tag or id3lib.
  • For OGG Vorbis-support: vorbiscomment from vorbis-tools.
  • For FLAC-support: metaflac from flac.

If you’re using Gentoo, these are packages you might be looking for:

  • MP3: media-libs/id3lib
  • OGG Vorbis: media-sound/vorbis-tools
  • FLAC: media-libs/flac
  • MP4/M4A: media-video/atomicparsley

If you don’t have support for a format it might annoyingly remind you about it every time you use the tool:

$ audiotag -h                                                                                           -- INSERT --
WARNING: `AtomicParsley' not found in path, required for mp4 support!
WARNING: `AtomicParsley' not found in path, required for m4a support!

As you can see I don’t have support for MP4 or M4A and I don’t care. I fixed this issue by commenting out two parts of the script between the lines 473-491:

# MCM - handle mp4 and m4a using AtomicParsley
elsif ($file =~ /\.mp4$/i or $file =~ /\.m4a$/i) {
	push @cmd, "AtomicParsley";
	push @cmd, $file;
	foreach (sort { $a cmp $b } keys %$info) {
		# don't need extra track num field
		/TRACKNUMBER/ && next;
		$plus_tags{$_} ||= "===";
		push @result, "$plus_tags{$_} $_: $info->{$_}";
	if ($genre   ) { push @cmd, ("--genre", uc $genre);		}
	if ($artist  ) { push @cmd, ("--artist", $artist);		}
	if ($album   ) { push @cmd, ("--album", $album);		}
	if ($title   ) { push @cmd, ("--title", $title);		}
	if ($track   ) { push @cmd, ("--track", $track);		}
	if ($year    ) { push @cmd, ("--year", $year);			}
	if ($comments) { push @cmd, ("--comment", $comments);	}
	push @cmd, ("--overWrite", "--gapless", "true");

And the lines 663-664:

check_for_prog(\@filetypes, \@missing, "mp4", "AtomicParsley"     );
check_for_prog(\@filetypes, \@missing, "m4a", "AtomicParsley"     );

It then stopped complaining about it.

Re-enabling OpenGL compositing automatically after it crashes KWin at login to KDE Plasma

, 05/08/2020 | Source: Fitzcarraldo's Blog

One of my laptops has NVIDIA Optimus hardware and runs Gentoo Linux with the closed-source NVIDIA driver. Almost every time I logged-in to KDE Plasma for the first time after booting, OpenGL and compositing would be disabled (see screenshot below), and the usual methods of toggling compositing on/off would not work. I had to perform […]

My text-based media center

It’s been more than 4 years since I wrote about my text-based media center over at my Swedish weblog. I was thinking it’s time to make a post about it here in English and perhaps make some sort of follow up on it.

Like most other people I have my TV connected to a computer so I can play my local media on the TV. I used to have a dedicated computer for it with the ever so popular software Kodi and the ridiculously tiny wireless keyboard Logitech DiNovo Mini. It was a solution that worked fine for about a decade or so before I decided it was time for a change.

Kodi, version 17. Source:

My issues with Kodi

While the setup was good enough, I had two issues with it. One was the Bluetooth keyboard, it was regularly—several times per week—dropping the connection and the only way to get it to connect was to remove the battery for a few seconds. I eventually got tired of it and started looking for a new Bluetooth keyboard, but I couldn’t find anything that I liked. This is when I was starting to considering the option to just get a proper wired mechanical keyboard for a lot less money.

The second issue was the YouTube workflow with Kodi. I have never had any TV-channels (by choice), I instead ended up watching various content makers on YouTube, which is kind of ironic considering that I’m generally the last person to adopt anything remotely new or modern.

Back then I was following a crazy amount of channels. The YouTube-client for Kodi was perfectly fine for my needs at the time, at first at least. It had all the basic features one would expect of an Kodi-addon back then. You where able to login to your Google-account, view and subscribe to channels and all that. And it was all fine until one day when my list of subscriptions started queueing up and I ran into an unpleasant issue.

It turned out that the client had a pretty low cap on how many videos it would show in the subscription list with all new videos. It meant that if I wasn’t obsessively bench watching videos I would miss out on them. Well. Unless if I visited all the channels manually, one by one.. At this time I was following around 100 channels.

The solution

While I was looking for a solution to my issue I happened to read about YouTube secretly supporting web feeds. As a long time user and an advocate of web feeds I got exited and I instantly knew that this was something I wanted to explore! I tried to find a solution that would involve web feeds and while I was doing it I had this fun idea of setting up an UNIX-like media center. I was already using Newsboat and I thought it would be cool to use it in some workflow on my media computer as well.

I ended up with a text-based media center based on my back then number one Linux based operating system; Arch Linux, which was later replaced with Gentoo.

I didn’t have to think this through for very long. I instantly knew what I wanted and how I wanted it. I installed my favourite window manager i3, the terminal emulator URxvt, the file manager Ranger, the media player mpv (with youtube-dl), livestreamer-curses and a few other things. I didn’t really have to make any major changes to anything other than changing a few keybindings to better fit a workflow that would not require me to use both my hands. I know how lazy I can be when I’m laying down in the sofa and I also use blank keycaps, so I need to be able to use my muscle memory.

My current text-based media center.

With Newsboat as my new ‘YouTube-client’ I was in full control of the content. I didn’t have to worry about missing videos and I could easily filter out content that I didn’t want to see. I could also easily mark any videos as seen, a process that was utterly complicated in Kodi. To mark a video as seen in Kodi I had to either watch the whole video or fast forward to the end for it to mark it as seen.

And then it was the quality! With Kodi I was stuck at low resolution videos at 720p with 30 FPS. With mpv (and with the help of youtube-dl) I could watch videos in any quality I wanted. Almost.. My media computer was over a decade old and it turned out that I was limited to 1440p at 60 FPS if I wanted a smooth video without audio sync issues. This turned out to be just fine as well. I could not see any differences in the qulity with a slightly higher bitrate from my sofa a few meters away from the TV.

My new setup also improved my workflow by a lot. With Kodi I had to close whatever application I was using and then browse to the next thing, which always required far too many steps and a lot of time. In i3 I can just leave it in the background and instantly switch to anything else on another workspace with the keys Alt+<N>.

The only downside with my text-based setup is the movie part. I don’t have access to fancy covers, metadata and things like that, but that’s okay since I don’t have a huge movie collection or anything.

Some changes happened to my setup back in 2019

Exactly one year ago I moved to the big city into a new and smaller apartment. I brought both my full-size desktop computer with me, but after a few months I decided that they took up way too much space and that I had to do something about it.

I also liked the idea of having just one computer, so I decided I wanted to try using my desktop computer as my media computer as well.

Here’s what I did:

  • I kept both keyboards so I don’t have to run around with a keyboard whenever I want to either sit at my computer or watch anything on my TV.
  • I’m only using one workspace on my TV. I find my workflow fast enough that if I want to switch from say Newsboat to Ranger I can just press q to exit Newsboat and then run the command jo movies to open Ranger in the movies directory on my storage.
  • I have bound the keys <Super>+<Enter> to focus workspace 10 on my TV and then spawn URxvt with alternative settings.

    Here’s the config for i3:

    bindsym $super+Return workspace 10; $exec "tvterm"

    The script tvterm looks like this:

    urxvt -name URxvt-tv -hold -e sh -c 'printf "\33]2;%s\007" "tvterm"; zsh'

    The “TV settings” for URxvt looks like this:

    URxvt-tv.font: xft:Monospace:pixelsize=40
    URxvt-tv.background: #000000
    URxvt-tv.foreground: #FFFFFF
    ! black dark/light
    URxvt-tv.color0:             #2e3436
    URxvt-tv.color8:             #6e706b
    ! red dark/light
    URxvt-tv.color1:             #cc0000
    URxvt-tv.color9:             #ef2929
    ! green dark/light
    URxvt-tv.color2:             #4e9a06
    URxvt-tv.color10:            #8ae234
    ! yellow dark/light
    URxvt-tv.color3:             #edd400
    URxvt-tv.color11:            #fce94f
    ! blue dark/light
    URxvt-tv.color4:             #3465a4
    URxvt-tv.color12:            #729fcf
    ! magenta dark/light
    URxvt-tv.color5:             #92659a
    URxvt-tv.color13:            #c19fbe
    ! cyan dark/light
    URxvt-tv.color6:             #07c7ca
    URxvt-tv.color14:            #63e9e9
    ! white dark/light
    URxvt-tv.color7:             #d3d7cf
    URxvt-tv.color15:            #eeeeec

    I wrote about using URxvt with alternative settings before if you want to read more about it.

Even more changes are expected

It looks like I’m moving again very soon and this time I’m not going to have my computer near my TV anymore. I know for sure that I don’t want a full-size computer as my media center anymore. I might end up getting a Raspberry Pi or something similar. I would highly appreciate any ideas or recommendations for a cheap, tiny and low consumption setup!

And that’s it I guess. My setup is not crazy in any way, but I like it!

How to visually hide files and folders in Ranger

Most users are probably already familiar with the common way to hide files and folders in Linux based operating systems, which is by adding a dot to the beginning of the file or the folder.

That is not always a desirable solution and sometimes not even an option. One example would be the folder ~/Desktop for me, it’s a folder that I never use. I don’t even have a “desktop” to begin with, but I can’t just hide it by renaming it to “.Desktop”. If I did it would just be recreated.

With the help of the plugin it’s possible to visually hide files and folders you don’t want to see. If you want to temporarily view the hidden files and/or folders again you can just temporarly set the setting show_hidden to true.


Start by creating the folder ~/.config/ranger/plugins/:

$ mkdir ~/.config/ranger/plugins/

Save the script to the newly created folder. In the script you then have this part:

HIDE_FILES = ("/boot", "/sbin", "/proc", "/sys")

Edit that part to your liking and just restart Ranger for the changes to take effect.

An introduction to the web feed client Newsboat

This article was originally included in the article “An introduction to web feeds”, but it turned out the be a bit too long so I split them up in two parts.

So. I’m pretty sure that it comes to no ones surprice that Newsboat is my web feed reader client of choice. If you happen to have missed out on this client, then you’re in for a treat! Newsboat is a feature rich text-based client that makes reading news more enjoyable.

I like Newsboat for multiple reasons, some of them are because it’s a client that’s keyboard driven, highly customizable, has support for regular expression filters, macros, running multiple instances (at the same time with different settings/feeds!) and because it even let’s me execute shell scripts.

I have two different profiles of Newsboat with different settings and feeds to separate my regular news from my video content subscriptions, which mainly is YouTube, even though I have at least one channel from PeerTube now!

How to get started with Newsboat

After you have installed Newsboat you should probably tweak a few settings and add at least one feed before you run it for the first time. If you don’t you will be greeted with this message:

Error: no URLs configured. Please fill the file /home/<user>/.newsboat/urls with RSS feed URLs or import an OPML file.

Add your feed(s) to the file $HOME/.config/newsboat/urls (one feed per line):

It should be noted that Newsboat supports cloud based services like The Old Reader, NewsBlur, FeedHQ, Bazqux, Tiny Tiny RSS and nextCloud News. You can read more about that in the chapter “Newsboat as a Client for Newsreading Services”.

I also recommend changing the default browser to your browser of choice in the file $HOME/.config/newsboat/config?. For Firefox it would be something like:

browser "firefox --new-tab %u"

For a complete documentation about the configuration options check out their website. My current setup looks like this.


A basic ignore-filter that hides articles based on keywords in the title looks like this:

ignore-article "" "title =~ \"<keyword>|<another keyword>\""

It’s also possible to filter articles based on keywords from the link, author, content, date, age and so on. It can actually get quite advanced if you would like to.

It’s also possible to create dynamic feeds based on certain filters. One examples would be to list all unread articles in one feed:

"query:> \Fresh Articles:age < \"1\" and title !~ \"trailers|trailer|\" and link !~ \"r\/gentoo\""

Another one would be to only show articles newer than N days. In this example it will only show articles that’s 48 hours old or newer:

"query:> \Fresh Articles:age < \"2\" and unread = \"yes\""

It’s also possible to combine multiple filters with each other. In this example I created a dynamic feed that only lists unread articles that has the keyword “trailer” in the title:

"query:> \Trailers:unread =\"yes\" and title =~ \"trailer\""

You can read more about filters in their documentation.


Macros is another feature that I really like about Newsboat. Even though I might only use some very basic macros myself, I find them very valuable.

I use mainly three macros. One that lets me open the article in my readability-script:

macro r set browser " %u | fold -s -w 115 | less" ; open-in-browser ; set browser "`echo $BROWSER`"

Another one that opens the article in Firefox via its reader view mode:

macro R set browser "firefox --new-tab about:reader?url=%u" ; open-in-browser ; set browser "`echo $BROWSER`"

And a third one that opens the articles (with videos) in my media player:

macro m set browser "mpv %u" ; open-in-browser ; set browser "`echo $BROWSER`"

You run a macro with the key , followed by the key you assigned the macro to. You can read more about macros here.

How my readability script works

With the help of my good friend Ghosty, I managed to create a Python-script that fetches the articles and presents them to me in a more readable way. I use this script when the feed only publish an excerpt and not the whole article.

Here’s what some articles looks like when they want to force you to their websites:

It works pretty much flawlessly, except for one little detail; there’s no images. If the article includes images I have no way of knowing it.

A workaround to this issue for me was to involve another web browser. I happen to have Firefox installed for websites that I don’t really trust. When I come across a image heavy article I just open the article in Firefox using my previously mentioned macro:

macro R set browser "firefox --new-tab about:reader?url=%u" ; open-in-browser ; set browser "`echo $BROWSER`"

Setting up the script

This is the script:

#!/usr/bin/env python3

from newspaper import Article
import sys

url = sys.argv[1]
a = Article(url)

c = a.title.count("",1)


For the script to work you need the Python-package called newspaper3k. Save the script, make it executable and then use it like this:

$ <URL>

If you want decent folding of words and pagination I highly recommend you piping the output via the tools fold and less like this: %u | fold -s -w 115 | less

That’s it for now! I hope you liked my introductory post to Newsboat enough to give it a try.

An introduction to web feeds

Web feeds is an easy way for users to stay up to date with websites and other services without even visiting them. If a website offers a web feed you can get notified whenever they publish an article (or perhaps an update of some sort) and you can then read the content in the comfort of your own client.

This goes for news articles, weblog posts, software releases, submissions from a subreddit on Reddit, toots from users on Mastodon, new videos from YouTube-channels and so on. Pretty much everything supports web feeds these days! You can even automatically download torrent files using web feeds via clients like Flexget, but that’s an article for another time.

Firefox with my own web feed visible. To get a pretty formatting like this you need the addon "RSSPreview".

You could say it kind off works like an e-mail newsletter, but in a much less broken and annoying way! With web feeds you don’t need to give out any information about you at all[1], you’re in 100% control and you can at any time easily end your subscription on your own terms.

  1. Well. They will see your IP-address and what client you’re using, but if that’s an issue just hide behind a VPN-connection or a Tor-relay.

I have about 50 feeds—not counting the YouTube-channels—in my client, it’s mainly news sites, weblogs, projects and feeds for software releases. It makes life so much easier to just open my client, quickly glance at what’s new, perhaps read a few articles and then go on with my life.

Without web feeds I would have to manually visit all those ≈50 websites and look for any new content on them. I can only image the amount of time I would have wasted doing that over the years.

Reading the articles via my client comes with several benefits, the largest one is the fact that I can read the content in the comfort of my own desktop and in a consistent way. I don’t have to care about navigating poorly designed websites with unreadable typefaces and colours take make my eyes bleed.

And let’s not forget that I don’t have to worry about malicious ads or trackers! If you didn’t know; Google alone is tracking you on 86% of the top 50 000 websites today. And as we all know, Google is far from the only malicious company out there spying on you.

Another benefit with web feed readers is the ability to filter out content that you don’t want to see. I follow a lot of YouTube-channels using web feeds and some of them post daily content with various gameplay videos. If I don’t like some video game I can just add a filter that hides all the articles with those games.

Web feeds is not all good though. There’s one thing I don’t like with some websites though and that’s some websites do not publish the whole article in their web feed, for the simple reason that they want you to visit their website directly. They do so in an attempt to both track you and expose you to their ads. My way around this is a neat little Python-script that fetches the article and formats the content in a readable way for me. More about this later.

How to subscribe to YouTube-channels

A hidden gem with YouTube is the fact that there’s a web feed for every channel on YouTube. A highly appreciated feature by people like me who tend to avoid the ‘modern’ web as much as possible.

There’s unfortunately no magic button to find the feed, what you need to do is to visit a channel and make sure the address looks like something like this:

If the address ends with the channel name like this:

Then you need to visit one of their videos and click your way back to the channel via the channel name under the video title.

Step two is to copy the last part of the address that looks like this:


And append it to this address:

So it looks like this:

This is the address that you add to your web feed reader. There’s one thing to note here though; the article is missing all the descriptive text for the video. If you really want the description you can subscribe to the channels via an Invidious-instance. Invidious also adds several other features that regular YouTube doesn’t have, like showing you an icon for every web feed and letting you subscribe to playlists.

A screenshot of Invidious showing where to find the web feed icon on the channel pages.

If you’re paying attention to the links you might have noticed that the YouTube-links and the Invidious-links have the same ending. This makes it easy to convert the links between them if you choose to migrate to any other instance or perhaps just want to go back to the default YouTube-links.

Here’s an example of the Never Too Small-channel:


I tend to favour text-based applications and tools simply for the reason that they often get the job done in the most effcient way possible. I do understand that’s not the case for everyone and if you’re someone who prefers graphical applications there’s a lot good clients for you as well.

To name a few popular clients:

There’s also several cloud based web feed services that let’s you read news via the web and even syncing your data across clients on various devices. I’m not that up to date with that though. I used to self-host a server using something called Tiny Tiny RSS, but I have since then shut the whole server down in my road to depending less on the cloud.

I hope I managed to spark some interest for web feeds with this introductionary post. If you liked it I would highly recommend you reading my post about my all time favourite web feed reader client called Newsboat.

Creating a plain Eclipse project using JPMS and JUnit tests

Dirk Olmes
, 26/07/2020 | Source: Infoschnipsel und Wissenswertes

I use the Eclipse IDE as my daily driver for development. For a long time I have ignored the Java Platform Module System (JPMS) which was introduced in Java 9 and I’m still ignoring it today. If you want a proper module system simply use the better one that has existed for many, many years.

One point I’ve always put forward when arguing against the use of JPMS is that there is no way to create a simple project in Eclipse that uses the JPMS and has unit tests as part of the same project - much like the project setup that Maven uses. Only today I found out that this is indeed possible if you know how to configure your project and hack your way with the module system.

Let’s start by creating a plain Java project in Eclipse. Make sure you have a JDK configured that supports JPMS and create separate output folders for sources and class files. Eclipse new project wizard, first step

On the next page of the wizard make sure that “Create” is checked.

Eclipse new project wizard, second step

When you hit Finish Eclipse will ask you for the module name of the project. Give your module a friendly name and start hacking away at your sources. Rather sooner than later you’ll get to the point where you want to add tests for your code. Add a new source folder that will contain your tests. Configure the source folder for your tests to generate its class files into a different folder and make sure you trigger Contains tests sources.

Eclipse new project wizard, second step

In the Libraries tab add the JUnit library to Classpath section, not to the Modulepath section. This hack enables the JUnit classes to be found for compiling and running the unit tests. But you’re not required to put the JUnit module into, leaking the JUnit dependency out into the module path.

Updating the Powerline adapters in my home network

, 22/07/2020 | Source: Fitzcarraldo's Blog

I have blogged previously about a couple of problems with using Powerline adapters in my home network: ‘Waiting for…’ (Why I could not access a home hub’s management page) Powerline adapters and IPv6 As my NETGEAR XAV1301 (200 Mbps) Powerline adapters bought in 2012 apparently do not fully support IPv6, and as my NETGEAR […]

Why I follow few users and why it’s not personal

For some reason I ended up with a lot of followers on Mastodon and I don’t know why to be honest. Every time someone follows me and I don’t follow them back I honestly feel bad about it. It’s not that I find most people boring or anything, it’s just that.. well. life. I guess.

Something unexpected happened to me recently, I was away from my computer for almost three weeks straight. Well. It’s perhaps not that unexpected—it’s not the first time I’ve been away from my computer (or even my phone) for longer periods of times—most of the times it’s only for a few days to a week or so though.

In periods I can sometime spend quite a lot of time on my computer. I really enjoy tinkering with my computer, Linux and open source software! I’m that person who sometimes gets a bit too obsessed about particular things and I can’t really let anything go before I’m done with it. This behaviour has actually led to a few years of some unhealthy multiplayer gaming about a decade ago, so it’s not something I take lightly on, even though I might sometimes joke about it.

This time away from my computer it felt extra good. I was partly busy with vacation for about one and a half weeks and partly just being home relaxing and watching movies with my girlfriend. I could have spent time with my computer as well, but I choose not to. I instead spent the time thinking about how I use my computer (and my phone), how I perhaps consume and process more information than I really want to and what the long term effects of that does to a person.

As an introverted perfectionist with a ever so slight touch of OCD, I’m really good at obsessively thinking about the same things over and over again. This is especially true for things that I find extra interesting. I’m constantly thinking about all the information I expose myself to via various ways that no one today is really used to. I also think a lot about what news feeds I follow, who I follow on social media, if I use social media too much and what all this does to our short term memory and our attention span.

Removing two of my three monitors over a year ago was a big step into the right direction for me in de-cluttering my life. It has honestly made some huge positive improvements on my productivity and what I like to call my hyper focus. I also recently realised that while my workflow had improved a lot, I still did some really weird things that younger me would never have approved. One of those things is leaving the web browser always running in the background even when I’m not using it. I know it might sound silly, but closing any application when I don’t use it does help me focus on what I’m currently doing. This is partly why I like minimal desktop setups, it’s just not exclusively about scoring Internet points amongst my fellow dorks.

When it comes to the news feeds I’m that person who can’t just leave them unread. I must read them to be able to relax and put them behind me so to speak. That’s actually why I’m very picky about what feeds I choose to subscribe to. I’m also that person who must read every single status message by the users I follow on social media. This is partly why I follow very few people on social media.

After my three week long break from my computer I realised that I didn’t really had any desire to read all the potentially new and fancy articles. I enjoyed the nothingness and all the extra time I had on my hands more than anything. I did eventually launch my feed reader Newsboat, but I closed it moments later after a quick glance of the new articles. I instead fired up my text editor Neovim with all my news feeds and I thoughtfully reviewed all of my feeds.

I have about 50 feeds in total, so it didn’t take that long. The feeds I have subscribed to are mostly weblogs and various tech and/or open source related projects and news sites. One of the first feeds that I removed was a Swedish news site that posts daily—multiple times per day—about everything from movie trailers, science and tech to politics. It was my one and only source to the ‘real’ world outside of my happy little ignorant eggshell.

I never really liked the amount of articles they managed to publish in a day and my filter for that particular feed had grown enormous over the years in an attempt to filter out uninteresting news that seemed even remotely recurring. I don’t have any TV-channels, I don’t read any newspaper (not even online) and I don’t listen to any radio, this source was therefor pretty good at giving me various highlights about the world and what was going on, but in the end I decided that it took more than what I gave back to keep up with them.

Since we have a limited quota of both time and focus to spend per day, I rather spend my valuable time on things that I find fun, that brings me joy and that keeps me productive!

So. I hope you don’t feel offended If I don’t follow you on social media as it’s nothing personal.