Plurrrr

week 16, 2023

Bare Metal Vi, boot into Vi without an OS!

This guide shows you how to run Vi without an operating system, bare metal. This is a follow up on my article from 2014 where I made a custom linux distro that would Boot to Vim, VIM as PID 1. This time we go further, we boot into Vi without an operating system. This is made possible by Cosmopolitan, a libc that outputs a POSIX-approved polyglot format that runs natively on Linux + Mac + Windows + FreeBSD + OpenBSD + NetBSD + BIOS with the best possible performance and the tiniest footprint imaginable.

Source: Bare Metal Vi, boot into Vi without an OS!, an article by Remy van Elst.

All That Remains

A killer is stalking young lovers. Taking their lives . . . and leaving just one tantalising clue . . .

When the bodies of young courting couples start turning up in remote woodlands areas, Dr Kay Scarpetta's task as Chief Medical Examiner is made more difficult by the effects of the elements. Eight times she must write that the cause of death is undetermined.

But when the latest girl goes missing turns out to be the daughter of one of the most powerful women in America, Kay finds herself prey to political pressure and press harassment. As she starts to investigate, she finds that vital evidence is being withheld from her - or even faked. And all the time a cunning, sadistic killer is still at large . . .

In the evening I started in All That Remains, Scarpetta 3, by Patricia Cornwell.

Zero-Downtime Deployments with Docker Compose

Some months ago, inspired by prior art, I cobbled together Docker Compose, Traefik, and some good old Bash scripting to implement a basic blue-green deployment process. It wasn't perfect, but it got the job done.

Recently I've been working on a new project and in the midst of migrating it to a virtual private server (VPS) dusted off this old implementation, making a few improvements along the way.

In this article we look more closely at how you might approach implementing zero-downtime deployments via blue-green deploys with Docker Compose.

Source: Zero-Downtime Deployments with Docker Compose, an article by Max Countryman.

The Menu (2022)

A young couple travels to a remote island to eat at an exclusive restaurant where the chef has prepared a lavish menu, with some shocking surprises.

In the evening Alice, Esme, and I watched The Menu. I liked the movie somewhat and give it a 6 out of 10.

Unlock the Power of Asynchronous Programming in Python with asyncio

Asynchronous programming has become a fundamental skill for modern software development, enabling developers to create more efficient and responsive applications. In this blog post, we will explore the advantages of asynchronous programming and demonstrate how to harness the power of Python’s asyncio library to write high-quality asynchronous code. This post is designed for intermediate and advanced developers who are ready to elevate their understanding of asynchronous programming in Python.

Source: Unlock the Power of Asynchronous Programming in Python with asyncio, an article by Muhammad Raza.

Emacs Comes to Android

Here’s some good news: The F-Droid site now has a more or less complete implementation of GNU Emacs for the Android platform. I’m not sure Emacs on a phone is all that useful other than for dealing with Org files and there are several apps already available for that on both the Android and iOS platforms. On a tablet, though, it could be a real game changer. Emacs on a tablet—perhaps with a real keyboard—would enable truly remote work. Yes, you can carry your laptop around as many of us do but a tablet is much easier especially in situations such as air travel.

Source: Emacs Comes to Android.

Why Perl?

I sometimes get asked why I use Perl so much. Am I not a fan of strongly typed functional programming? Yeah, I am. Ask me to write something that is known, for sure, to become a big system and I’ll pick strongly typed functional programming without hesitation. But most of the software I write is not for sure going to become a big system. Here’s what Perl does well:

  1. It is installed by default everywhere. I don’t need administrative privileges to deploy Perl code almost anywhere. That is extremely empowering.
  2. With a great amount of discipline, Perl scripts can be successfully scaled up into large, complex systems.
  3. I can be confident that a Perl script I write today will run unaltered 10 years from now, modulo external collaborators.
  4. Perl can be used nearly as a shell replacement for very quick scripting.
  5. Perl has a small set of core syntax and is very extensible and flexible in adopting new paradigms.

Source: Why Perl?, an article by Christoffer Stjernlöf.

The Nix, OpenGL and Ubuntu Integration Nightmare

In this article, we’re about to dive into the uncharted OpenGL on Linux waters. After briefly explaining how the OpenGL calls are routed from your application to the GPU, we’ll look at the NixOS special case. We’ll then explore how we can run the OpenGL programs built by Nix on a foreign distribution, such as Ubuntu or Fedora. Finally, we’ll introduce NixGLHost a new approach to solve this problem.

Source: The Nix, OpenGL and Ubuntu Integration Nightmare, an article by Ninja Trappeur.

Finding large files

Today I used the following snippet to find files larger than 1G in my home directory:

find ~ -type f -size +1G -exec \
     du -hs {} \; | sort -rh

The find command calls (-exec) the du command for each file (-type f) that is larger than 1G (-size +1G). The option -hs shows the size in human readable format for each file. The result is piped to sort which sorts on the human readable format (-h) in reverse order (-r).

Note that the backslash in the snippet is used to continue the current line on the next one due to the width restriction of this blog. It should be immediately followed by a new line. Feel free to type the snippet on a single line, without the backslash.

Reasons to avoid Javascript CDNs

Many javascript projects have install instructions recommending that people use a CDN like jsdelivr or unpkg to include the code on their website. This has the advantage that it's quicker to get started with, and it's often claimed to load faster. However, it also has downsides when it comes to privacy, security, and systemic risk, and it may actually be slower in some common cases. Here are some reasons not to use a javascript CDN, and some alternatives to consider instead.

Source: Reasons to avoid Javascript CDNs, an article by Wesley Aptekar-Cassels.

Improving messages and types in GDB’s Python API

As a winter associate at Trail of Bits, my goal was to make two improvements to the GNU Project Debugger (GDB): make it run faster and improve its Python API to support and improve tools that rely on it, like Pwndbg. The main goal was to run symbol parsing in parallel and better use all available CPU cores. I ultimately implemented three changes that enhanced GDB’s Python API.

Source: A Winter’s Tale: Improving messages and types in GDB’s Python API, an article by Matheus Branco Borella.

How to create a bar chart from a CSV file with Haskell

Today I wanted to create a bar chart for a new blog post on blog.airsequel.com. It was supposed to show the number of days between each SQLite release. I decided to use Haskell, but I couldn't find any good code examples out there. So, I went ahead and wrote the code from scratch. 😮‍💨 I'm sharing it here in hopes of sparing the next person the time and effort. 😅

Source: How to create a bar chart from a CSV file with Haskell, an article by Adrian Sieber.

What is a Go function variable?

In Go as it is presently…

  1. Function variables are pointers
  2. They point to small structs
  3. Those structs contain either
    1. just the pointer to the function code for simple functions
    2. or to pointers to autogenerated wrapper functions and receivers &/or function parameters in the case of method calls and closures.

And why can’t you compare them? I expect it was just too hard to agree to a convention about which pointers would be considered equal when there are closures and method calls and function wrappers around.

Source: What is a Go function variable?, an article by Phil Pearl.

Everything you never knew about NATs and wish you hadn't asked

The Internet is a mess, and one of the biggest parts of that mess is Network Address Translation (NAT), a technique which allows multiple devices to share the same network address. In this series of posts, we'll be looking at NATs and NAT traversal. This post is on NATs and the next one will be on NAT traversal techniques.

Source: Everything you never knew about NATs and wish you hadn't asked, an article by Eric Rescorla.