How to do a healthcheck in a Docker image without curl?

There is a tendency to strip docker images from wget and curl. Luckily, perl is still available. If you have trouble configuring spring boot healthcheck, think of perl and its IO::Socket module shipped with perl core:

FROM openjdk:11-jre-slim
HEALTHCHECK --start-period=10s --timeout=3s --retries=5 \
 CMD perl -e "use IO::Socket; $sock = IO::Socket::INET->new(Proto => 'tcp', PeerAddr => 'localhost', PeerPort => '8888') or die $@; $sock->autoflush(1); print $sock 'GET /actuator/health HTTP/1.1' . chr(0x0a) . chr(0x0d) . 'Host: localhost:8888' . chr(0x0a) . chr(0x0d) . 'Connection: close' . chr(0x0a) . chr(0x0d) . chr(0x0a) . chr(0x0d); while (my $line = $sock->getline ) { if ($line =~ /UP/) {exit;} }; close $sock; exit 1;"

Using parametric equalizer with software mixer in alsa

The full contents of /etc/asound.conf:

pcm.dsp {
    type plug
    slave {
        format FLOAT
        rate unchanged
        pcm {
            type ladspa
            channels 2
            path "/usr/local/lib/ladspa"
            playback_plugins [{
                label "ladspa_dsp"
            slave.pcm {
              type plug
              slave.pcm {
                    type dmix
                    ipc_key 1234
                    # Xenix 302USB
                    slave. pcm "front:CARD=CODEC,DEV=0"
                    # built-in
                    #slave. pcm "hw:1,0"
                    bindings {
                        0 0 # from 0 => to 0
                        1 1 # from 1 => to 1
pcm.!default {
        type copy
        slave.pcm "dsp"

Composition and fading in French

There is a French expression au jour d'aujourd'hui which means "as of today", however, aujourd'hui itself means "the day of today", because hui is the Old French word for "today" and aujourd' is obviously the concatenated form of "au jour de".

But it does not end there: the Old French word hui evolved from "hoc die", which means "this day" in Latin.

At the end, the best explanation of au jour d'aujourd'hui is

     (this (day)))

which is fascinating.

How to render a tree like an HTML table: in a HTML page

This fiddle says it all, but let's go briefly over it.

Whenever you are building a table out of a tree, use <table>, <tr>, <td> tags or their CSS equivalents table, table-row and table-cell and apply display:contents to the elements that you intreleave with the table to preserve your tree without destroying the table layout.

Easy-peasy, but it took me a while to figure it out.

Несколько историй про подпольных программистов


Попал я однажды в организацию, занимающуюся организацией оффлайновых конференций. Им нужен был человек для поддержки сайта. Разговаривал со мной мужчина в пиждаке и при галстуке, представившийся начальником отдела продаж. От общих тем быстро перешли к техническим. Заглянули в код. Свой ORM, самописный шаблонизатор, немного устаревшие приёмы, но в принципе всё стройно, логично и однообразно. Я спросил, что стало с предыдущим программистом, на что собеседник рассказал мне историю.

Лет десять назад моего собеседника наняли на должность продажника. Чуть ли не в первую неделю работы он сломал ногу и сидел дома три месяца. Работать по специальности он не мог, но директор, зная что у моего собеседника инженерное образование, попросил наполнить контентом их сайт-визитку.


За три месяца тот сумел не только наполнить сайт контентом, но и создать простенькую систему управления конференциями. С напоминалками, расписанием и отзывами. Выйдя на работу, он продолжал поддерживать систему, самостоятельно заполняя её информацией о новых конференциях. Время приходилось урывать от основной работы, поэтому вскоре пришлось прикрутить учётные записи, чтобы коллеги сами поддерживали базу данных в актуальном состоянии. А там, где есть учётные записи для коллег, можно добавить и учётные записи посетителей.

Со временем он заметил, что стал проводить меньше времени на телефоне, а больше — за выборкой данных и за оформлением почтовых рассылок. Продажи организации росли, его личные — росли чуть больше, чем в среднем по организации. Да и не удивительно, ведь новые приёмы он реализовывал сперва на "своих" конференциях.

I went googleless on my phone

I have an 8-core arm64 beast called Moto X Force, it's somewhat close to Nexus 5X, so there are some LineageOS builds around.

KBC Mobile app checks for Safetynet, prints out a warning but works. Kudos to the developers. Bancontact app stops working after checking Safetynet. Whatsapp app can be downloaded from the official website. Telegram is available on F-Droid, Skype can be side-loaded as well.

What else is missing?


How to make a copy of an Eclipse update site

I'll probably never do it again, but just in case:

$ECLIPSE_HOME/eclipse -nosplash -verbose \
  -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication \
   -source \
    -destination ~/tmp/mars-mirror-meta

$ECLIPSE_HOME/eclipse -nosplash -verbose \
    -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication \
       -source \
           -destination ~/tmp/mars-mirror-arte

My fight for the best title to your story

Someone just made me a remark about the style of titles I give to bug tracker tickets. They are apparently too long and actionable, which leaves no space for the text in the description.

I am angry. If there is one area I feel being an expert, this is titles. I've been running a community website for over 15 years and it's been 10 years since my only moderation activity there is fixing titles while other people moderate comments for hate speech and obscenities.

The website is serving 600,000 page views per month, half of what it did in its heyday 6 years ago. Facebook took over its market. Still, it is one of the few websites of its kinds that survived until now.

When I started moderating titles, users took it personally, so I had to back off manual post-moderation and built a dozen pre-moderation filters that forced people to write proper titles. I blocked long sequences of uppercase letters, obscenities, too short and too long titles, duplicate postings, greetings, improper use of punctuation, series of exclamation and question marks and god knows what. It worked, but it drove away some readers from the website.

A few years later, I relaxed the pre-moderation filters and reintroduced post-moderation. This time, I sent automatic notifications to users as titles of their posts changed. I kept receiving complaints, I so I developed a few tricks that would reduce the number of complaints. Instead of rewriting a title, I took user text that represented the essence of the post and put it as the title, keeping the original spelling and even case, so that the user clearly sees that the titles come from his own post.