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 / 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 / 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 / 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 / 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 / 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?
@thanatos
thanatos / common-bugs.rst
Created July 14, 2017 16:53
Python bugs I see all the time

Failure to close resources

Don't:

fobj = open('myfile.txt')
# tons of code
fobj.close()

"tons of code" will inevitably fail, at which point, the file descriptor is leaked, and left to be cleaned up by the GC. It is poor form to say "Python is refcounted": Python the language is not reference counted, it is garbage collected.