croc – another file transfer method

Fitzcarraldo
, 17/06/2021 | Source: Fitzcarraldo's Blog

I have lost count of the number of times I have had to send a large file to someone at work, usually in a hurry. I’ve used Dropbox, ownCloud, Firefox Send (no longer available) etc. Transferring large files became a bit easier when e-mail service providers increased the size limit for attachments, but that is […]

Quick templating with gmaven and GStringTemplateEngine

Dirk Olmes
, 15/06/2021 | Source: Infoschnipsel und Wissenswertes

At work I have come across the requirement to generate some files based on the info in a pom.xml. Maven’s resource filtering feature would be the first thing that comes to mind but unfortunately it’s not powerful enough for my use case. I had to generate a file based on the dependencies that are referenced in the project.

A bit of googling found all kinds of outdated or unsupported maven plugins but nothing that would fit my use case directly. Finally I gave up and started to hack something together in groovy.

As it turns out groovy comes with a templating engine built in: groovy.text.GStringTemplateEngine. Using it is fairly straightforward from Maven:

....
<plugin>
    <groupId>org.codehaus.gmaven</groupId>
    <artifactId>groovy-maven-plugin</artifactId>
    <version>2.1.1</version>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <goals>
                <goal>execute</goal>
            </goals>
            <configuration>
                <source>${project.basedir}/templateGenerator.groovy</source>
            </configuration>
        </execution>
    </executions>
</plugin>

The templateGenerator.groovy Script is only a few lines long:

import java.io.File
import groovy.text.GStringTemplateEngine

def templateFile = "${project.basedir}/template.file" as File
def outputFile = "${project.build.directory}/dependencies.html" as File
outputFile.newWriter("UTF-8").withCloseable { writer ->
    def engine = new GStringTemplateEngine()
    def replacements = [ dependencies: project.dependencies ]
    engine.createTemplate(templateFile).make(replacements).writeTo(writer)
}

The template file can contain any syntax that the GStringTemplate supports.

IMHO this approach supports the best of both worlds: with only a little groovy scripting magic you get the maximum flexibility of a templating engine that has access to all the internals of your project.

Using adb tools in Linux to remove bloatware from my Samsung Galaxy Note 20 Ultra

Fitzcarraldo
, 13/06/2021 | Source: Fitzcarraldo's Blog

Samsung included a lot of bloatware on my Galaxy Note 20 Ultra 5G, and it is not possible to uninstall it using Play Store. However, it is possible to remove this stuff using adb tools. I got rid of the bloatware I don’t want very easily using the Linux version of the adb tools. I […]

Is Gentoo Linux an anachronism?

Fitzcarraldo
, 29/05/2021 | Source: Fitzcarraldo's Blog

When I started visiting the Gentoo Linux discussion forums in 2007 there were at least three pages of posts daily, if not more. These days there is usually one page. I’m sure the number of Gentoo Linux users has dropped significantly since then. Interest in the distribution has certainly decreased since its heyday: Google Trends […]

That's the end.

Menelkir
, 27/05/2021 | Source: Daniel Menelkir

So.. the time has come..

I've used to think that the one of the last bastions of purism and quality in linux world will live in gentoo. Most distributions have different contraptions that, let's say, gives more trouble underground with a problem costumed of a solution. Then the systemd arrived and make this even bigger. Fine, gentoo offer the choice of systemd, it was a matter of not using at all (even so, at this day, openrc is the default option). Then, in the last years something was happening that wasn't good. I had to change meaningful things in the system to work as expected, but that's another subject.

Then they deleted consolekit because "everyone expects elogind". Cmon.. elogind is just a band-aid because you're lazy to not patch things to work as expected. I don't see a single fucking reason to ditch consolekit. And elogind brings a different animal to the scenario, you don't have systemd but you have the systemd problems, customed as "just elogind, so the modern software will work properly", say that to the BSD userland then.

Last weeks I've noticed that portage have a new "thing" now: git-r3 is acting different and is undocumented what changed, but changed, and to the worst aspect. I don't want to talk about that because I gave up explaining this shit over and over. 

My wild guess is that they'll link bin and sbin to /usr/bin and /usr/sbin too? 

The simplicity and functionality of Gentoo has fallen. There's no such thing of seriousness on this, it's just a children's desktop playground. There's not even consistency anymore, so after those last 20 years, it's time to let it go.

Review of an MT-ViKI 2-port automatic KVM switch

Fitzcarraldo
, 26/05/2021 | Source: Fitzcarraldo's Blog

Three years ago I bought a two-port KVM (keyboard, video and mouse) switch with the intention of using it to connect my keyboard and monitor to my headless server to investigate a boot-up problem. But I found the cause of the problem quickly and never needed to use the KVM switch, which was sitting on […]

Digital audio fidelity

Fitzcarraldo
, 18/05/2021 | Source: Fitzcarraldo's Blog

Take the following two hearing tests while wearing high-quality over-ear headphones connected to a high-quality sound card: Hearing Test – Can You Hear This? How Well Can You Hear Audio Quality? The first tests your ability to hear sound of different frequencies. Older people will be doing well if they can hear up to 15 […]

Configuration of the APC UPS Daemon on my Linux server

Fitzcarraldo
, 10/05/2021 | Source: Fitzcarraldo's Blog

  For obvious reasons my Linux home server supplying NAS and Web services 24/7 is connected to a UPS. The UPS model (now discontinued) I use is a 700VA 230V APC Back-UPS ES-BE700G-UK. It is connected to one of the server’s USB ports via an APC-supplied cable so that the server can interrogate the UPS […]

How to prevent CUPS omitting the bottom of the CUPS Printer test page

Fitzcarraldo
, 28/04/2021 | Source: Fitzcarraldo's Blog

This is something that has been bugging me for years but I never bothered to look into it until now. When I set up a printer using CUPS Administration and then print a test page, for some printers the bottom of the test page image is cut off, as shown in the scanned image below. […]

Implementing a quick and easy way to check from the Linux Desktop Environment if the ClamAV signatures database is up-to-date

Fitzcarraldo
, 27/04/2021 | Source: Fitzcarraldo's Blog

If you use ClamAV with the Freshclam daemon and your Linux installation does not hide the console output during boot, you might see a message similar to the following on the console briefly during boot if the signatures database has not been updated recently: LibClamAV Warning: ************************************************** LibClamAV Warning: *** The virus database is older […]