Un naufragio personal

Ángel Ortega

Three wrappers to run commands without impacting the rest of the system

François Marier names 3 tools to execute other commands with lower priorities on a Linux system:

Runs at a "nicer" (i.e. lower) CPU priority (a UNIX classic that everybody knows).
Sets the I/O priority. Interesting options are -c3 (needs root) or -n7. Only useful if you are using the CFQ scheduler.
Avoids storing files into the file cache, leaving it ready for other running processes.

Example in a crontab:

0 0 * * * nocache ionice nice /path/to/backup.sh


Sending data in a signal

Craig said on sending additional data or context in a UNIX signal:

"[...] One thing that isn’t as well known is besides sending a signal to a process, you can send some data to it. This can either be an integer or a pointer and uses similar semantics to the known kill and signal handler. [...]"

The key is using sigqueue() instead of signal() and a signal handler like:

void signal_handler(int signum, siginfo_t *siginfo, void *ucontext)
    if (signum != SIGUSR1) return;
    if (siginfo->si_code != SI_QUEUE) return;
    printf("receiver: Got value %d\n", siginfo->si_int);


Using GnuPG for SSH authentication

The GnuPG agent can be used as an SSH agent:


Gimme gimme gimme

If you execute the Linux man command without arguments, it returns:

What manual page do you want?

But, if you do the same exactly at 00:30, the returned message is:

gimme gimme gimme

Of course, this is after ABBA's song Gimme Gimme Gimme A Man After Midnight.

In defence of swap: common misconceptions

Chris Down says (on anonymous, i.e. allocated memory pages):

"[...] Swap is a storage area for these seemingly "unreclaimable" pages that allows us to page them out to a storage device on demand. This means that they can now be considered as equally eligible for reclaim as their more trivially reclaimable friends, like clean file pages, allowing more efficient use of available physical memory.

Swap is primarily a mechanism for equality of reclamation, not for emergency "extra memory". Swap is not what makes your application slow – entering overall memory contention is what makes your application slow."


Remarkable StackExchange subdomains

The ReiserFS filesystem

"This document describes the ReiserFS filesystem structures on disk. It was created while writing a ReiserFS reader for Windows NT. I was unsatisfied with the documentation available over at the official URL, www.namesys.com, so I wrote my own. But, since this is my first contact with ReiserFS, it does contain errors, so if in doubt, please consult the original spec first."

"This document is copyrighted by Gerson Kurz and licensed by the GPL."


Convert your ASCII diagram scribbles into happy little SVG

"Svgbob Editor - Convert your ASCII diagram scribbles into happy little SVG"

Not really limited to ASCII; Unicode is also supported (including special support for line drawing characters).


An implementation of the ChaCha20 algorithm in Bash

This is an implementation of DJB's ChaCha20 algorithm in Bash script.

by zx2c4
You probably shouldn't use this for anything."


Old Book Illustrations

"Old Book Illustrations was born of the desire to share illustrations from a modest collection of books, which we set out to scan and publish."


Web Demo of the Voxel Space Engine

"Comanche uses a technique called Voxel Space, which is based on the same ideas like ray casting."


The Voluntary Human Extinction Movement

"Phasing out the human race by voluntarily ceasing to breed will allow Earth’s biosphere to return to good health. Crowded conditions and resource shortages will improve as we become less dense.


Thank you for not breeding."


Kahan summation algorithm


In numerical analysis, the Kahan summation algorithm, also known as compensated summation, significantly reduces the numerical error in the total obtained by adding a sequence of finite-precision floating-point numbers, compared to the obvious approach. This is done by keeping a separate running compensation (a variable to accumulate small errors).


Stuff in Space

This site shows in real-time 3D the location of satellites and other celestial bodies:


You can search for specific units, like


Sweden Solar System

"The Sweden Solar System is the world's largest permanent scale model of the Solar System. The Sun is represented by the Ericsson Globe in Stockholm, the largest hemispherical building in the world. The inner planets can also be found in Stockholm but the outer planets are situated northward in other cities along the Baltic Sea."


A DOT file to ASCII converter

Rebuilding target files when source files have changed

Genius Daniel J. Bernstein wrote an extremely simple but brilliant specification for a make-like build system:


He didn't release an implementation, but somebody apparently named apenwarr did it:


Thanks to my friend @crappo for bringing this to my attention.

What Every Programmer Should Know About Floating-Point Arithmetic

A simple and to-the-point guide to floating point arithmetic and the crazy but genius IEEE-754 standard:

Well, this site is here to:

  • Explain concisely why you get that unexpected result
  • Tell you how to deal with this problem
  • If you’re interested, provide in-depth explanations of why floating-point numbers have to work like that and what other problems can arise


The book is also on github.

Telegram Bot - how to get a group chat id?

apadana explains how to get a Telegram group chat id:

Here is the sequence that worked for me after struggling for several hours:

Assume the bot name is my_bot.

1- Add the bot to the group. Go to the group, click on group name, click on Add members, in the searchbox search for your bot like this: @my_bot, select your bot and click add.

2- Send a dummy message to the bot. You can use this example: /my_id @my_bot (I tried a few messages, not all the messages work. The example above works fine. Maybe the message should start with /)

3- Go to following url: https://api.telegram.org/botXXX:YYYY/getUpdates replace XXX:YYYY with your bot token

4- Look for "chat":{"id":-zzzzzzzzzz, -zzzzzzzzzz is your chat id (with the negative sign).

5- Testing: You can test sending a message to the group with a curl:

curl -X POST "https://api.telegram.org/botXXX:YYYY/sendMessage"
  -d "chat_id=-zzzzzzzzzz&text=my sample text"

If you miss step 2, there would be no update for the group you are looking for. Also if there are multiple groups, you can look for the group name in the response ("title":"group_name").

Hope this helps.


systemd now includes its own ntp service


Uninstall ntp or chrony and do

sudo timedatectl set-ntp true