Skip to content

Instantly share code, notes, and snippets.

@thanatos
thanatos / grub-upgrade.md
Created September 12, 2023 00:07
Arch: post Grub upgrade instructions

Install Grub:

See: https://wiki.archlinux.org/title/GRUB#Installation — for me, that command is:

grub-install --target=x86_64-efi --efi-directory=/esp --bootloader-id=Grub

--efi-directory is where the ESP partition is mounted. For me, /esp. --bootloader-id corresponds to the directory under /esp/EFI where Grub is, so just Grub as we put Grub at /esp/EFI/Grub.

@thanatos
thanatos / mbp-thermals.md
Last active July 7, 2023 19:41
MBP Thermals

MacBook Pros have garbage thermals.

Essentially, the fan at the back is unable to effectively move heat sufficiently to sustain any real workload on a MBP, particularly on older MBPs. All machines — laptops and desktops alike — are natural air purifiers, in that they tend to collect dust out of the air. This isn't good for them, and in particular, a heat vent clogged with dust is less efficient at cooling than one not clogged with dust.

On my personal laptops and desktops, this is a relatively minor issue: open the case, blow some canned air over things to dislodge the dust paying attention to the vents and fans, close the case. I.e., you clean it.

MBPs have several issues that compound here, though: first, they cannot be reasonably opened. Only asshats put torx screws into something, to make sure that it is as painful as possible to disassemble, and to force you into an "Authorized Repair Shop". Apple put pentalobe screws in, which is like next-level asshattery. The only reasonable options were flathead

@thanatos
thanatos / howto-k8s.md
Created December 7, 2019 19:12
How to init k8s cluster on Gentoo

Install Stuff

Emerge kubelet, kubeadm, kubectl, all the same version. For some reason, Gentoo stablized kubelet and kubectl but not kubeadm.

I'm using Calico, so also emerge net-misc/calico-cni-plugin.

Correct Stuff

@thanatos
thanatos / key-file-formats.md
Last active June 8, 2022 22:40
key-file-formats

PKCS#1 (OpenSSL RSA keys, old OpenSSH RSA keys)

Starts with:

-----BEGIN RSA PRIVATE KEY-----

OpenSSL RSA key. Decode w/ openssl rsa -in $FILENAME -noout -text

Internal format is ASN.1, and can be viewed with openssl asn1parse.

@thanatos
thanatos / Cargo.lock
Created February 14, 2021 22:27
Broken Cargo.lock
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "atty"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi",
"libc",
@thanatos
thanatos / wrist-slapping.md
Created February 5, 2021 03:25
Slap on the Wrist

Corporations are supposedly like people. So, when they do something bad, do we punish them like people?

The following is a collection of articles reporting on corporations that have done something bad, and what the conclusion of that was. Any penalty the corporation faced is listed, both in its absolute value, and scaled relative to that company's revanue to that of a "normal" household income. For the purposes of this Gist, the value $65,000/year is chose as "normal":

According to the ACS, the U.S. median household income in 2018 was $61,937.

Household income in the United State

That is, the fine is scaled by scaled_fine = fine / corporate_revanue * median_household_income, where median_household_income is $65,000 for simplicity. The other two varaibles depend.

@thanatos
thanatos / test-suite.md
Created March 12, 2020 01:31
The Ultimate HTTP Test Suite

Server-side

  • After request to which the Expect: 100-continue is met w/ a non-100 response (i.e., the client is never told to send the body) does the client send the body and does the server spool through it? (Presuming the server is not taking the option of closing the server.)

  • Does a malformed request target get rejected? Malformed includes:

    • not-a-path — there should be a starting /
    • /foo% — the URL encoding should have two hex chars following the %
    • /foo%f — similar.
  • /foo%gg — similar.

@thanatos
thanatos / instructions.md
Created November 26, 2019 05:39
Kubernetes on Gentoo
  1. Create a working systemd unit file for kubelet, and override the Gentoo one by placing it at /etc/systemd/system/kubelet.service; the Gentoo one is flat out broken. Content:
    [Unit]
    Description=Kubernetes Kubelet Server
    Documentation=https://kubernetes.io/docs/concepts/overview/components/#kubelet https://kubernetes.io/docs/reference/generated/kubelet/
    After=docker.service
    Requires=docker.service
    
    

[Service]

@thanatos
thanatos / real-audio-player.rst
Last active July 23, 2018 04:17
A real audio player

Some notes on what an audio player (somewhat targeted at dancers / DJs) should support:

This is a side project I'd like to try my own hand at some time. If you want ultimate, I've got a few requirements from an interesting angle for you: I'm both a dancer, and in some regards a DJ. Specifically, I tend to play music for dancers. iTunes absolutely falls down here.

  • Replay gain: Replay gain is an amazing feature, and once you have it, you never want to be without it.
  • Do not trust duration tags. They lie. A lot of media players (Foobar2000 included!) trust these. Or assume MP3s are CBR, and that the remainder is the same bit-rate as the rest. It greatly affects usability too, when the player thinks a 3 minute song is 30 minutes, and scales the seeking bar to that point.
  • Robust codec support ogg and flac are a must, as they're the two best formats out there. (ogg beats the pants off mp3, and it beats mp4 by virtue of no patents; flac is the only good lossless codec I know of, which is important¹.)
@thanatos
thanatos / agile.rst
Last active July 18, 2018 01:39
Stuff I like

On Agile

From https://tech.labs.oliverwyman.com/blog/2018/05/16/acephalic-agile/:

But I was suddenly seized by a horrible thought: what if this new-found agility was used, not teleologically to approach the right outcome over the course of a project, but simply to enshrine the right of middle management to change their minds, to provide a methodological license for arbitrary management? At least under a Waterfall regime they had to apologise when they departed from the plan. With Agile they are allowed, in principle, to make as many changes of direction as they like. But what if Agile was used merely as a license to justify keeping the team in the office night after night in a never-ending saga of rapidly accumulating requirements and dizzying changes of direction? And what if the talk of developer ‘agility’ was just a way of softening up developers for a life of methodologically sanctioned pliability?