Un naufragio personal

Ángel Ortega

Single-primitive authenticated encryption for fun

Another interesting blog entry by Christopher Wellons:

Just as a fun exercise, I designed and implemented from scratch a standalone, authenticated encryption tool, including key derivation with stretching, using a single cryptographic primitive. Or, more specifically, half of a primitive. That primitive is the encryption function of the XXTEA block cipher.

https://nullprogram.com/blog/2021/01/30/

What are X-macros?

Arthur O'Dwayer:

"X-macros" is a neat C and C++ technique that doesn’t get enough advertisement. Here’s the basic idea:

Suppose we have a table of similar records, each with the same schema. In games, this might be our collection of monster types (each with a display name, a representative icon, a dungeon level, a bitmask of special attack types, etc). In networking, this might be our collection of error codes (each with an integer value, a message string, etc).

We could encode that information into a data structure that we traverse at runtime to produce interesting effects — for example, an array of structs that we index into or loop over to answer a question like “What is the error string for this enumerator?” or “How many monsters have dungeon level 3?”.

https://quuxplusone.github.io/blog/2021/02/01/x-macros/

Historical Dictionary of Science Fiction

Welcome to the Historical Dictionary of Science Fiction. This work-in-progress is a comprehensive quotation-based dictionary of the language of science fiction.

Most terms defined here feature the first year they were used.

https://sfdictionary.com/

Debian official installer images that include non-free firmware

XTerm: It's Better Than You Thought

Some info and tweaks for xterm by Bruno Garcia. Summary:

xterm*faceName: Monospace
xterm*faceSize: 13
xterm*utf8: true
xterm.vt100.translations: #override \n\
    Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n\
    Ctrl Shift <Key>V: insert-selection(CLIPBOARD)
xterm*background: rgb:1a/1a/1a
xterm*foreground: rgb:d6/d6/d6

As usual, write this in ~/.Xresources and update it by running xrdb ~/.Xresources.

https://aduros.com/blog/xterm-its-better-than-you-thought/

Remotely Installing OpenBSD on a Headless Linux Server

Plaintext HTTP in a Modern World

An interesting solution by Joshua Stein that implements HTTPS redirections only for modern browsers while still serving plaintext HTTP for older ones. Here is an nginx configuration snippet:

server {
    server_name example.com;
    listen *:80;
    listen *:443 ssl http2;

    set $need_http_upgrade "$https$http_upgrade_insecure_requests";
    location / {
        if ($need_http_upgrade = "1") {
            add_header Vary Upgrade-Insecure-Requests;
            return 301 https://$host$request_uri;
        }
     }

     ...
}

The Upgrade-Insecure-Requests HTTP header (with a value of 1) is sent by modern browsers when they connect through non-encrypted connections.

https://jcs.org/2021/01/06/plaintext

State machines are wonderful tools

Chris Wellons:

I love when my current problem can be solved with a state machine. They’re fun to design and implement, and I have high confidence about correctness [...]

Inspired by a puzzle, I came up with this deterministic state machine for decoding Morse code. It accepts a dot ('.'), dash ('-'), or terminator (0) one at a time, advancing through a state machine step by step [...]

https://nullprogram.com/blog/2020/12/31/

Scroll Back: The Theory and Practice of Cameras in Side-Scrollers

The 2020 Linux Foundation annual report

The Linux Foundation 2020 Report document was written on a Mac with MacOS. Why are you a fucking lie, Linux Foundation?

https://daniel-lange.com/archives/166-No-dog-food-today-the-Linux-Foundation-annual-report.html