Skip to content

Instantly share code, notes, and snippets.

Rusty's API Design Manifesto

The idea

Application Programming Interface (API) design is hard. But it's even harder to change once you get it wrong. So what you should do is to spend the effort to get it right the first time around.

In the Linux Kernel community Rusty Russell came up with a API rating scheme to help us determine if our API is sensible, or not. It's a rating from -10 to 10, where 10 is perfect is -10 is hell. Unfortunately there are too many examples at the wrong end of the scale.

Rusty's original descriptions

@michaelbutler
michaelbutler / Steam_Proton_Exe.md
Last active April 23, 2025 15:57
How to run another .exe in an existing proton wine prefix

Running games through Steam's Proton is great. But what if there is a secondary exe or configuration application bundled with the game? How can you launch it if Steam itself only launches the game?

Simply run this command in a terminal:

cd /path/to/steam/steamapps/compatdata/20920/pfx

STEAM_COMPAT_DATA_PATH="/path/to/steam/steamapps/compatdata/20920" WINEPREFIX=$PWD \
    "$HOME/.steam/root/steamapps/common/Proton 5.0/proton" run ./drive_c/path/to/custom_application.exe

Rusty's API Design Manifesto

The idea

Application Programming Interface (API) design is hard. But it's even harder to change once you get it wrong. So what you should do is to spend the effort to get it right the first time around.

In the Linux Kernel community Rusty Russell came up with a API rating scheme to help us determine if our API is sensible, or not. It's a rating from -10 to 10, where 10 is perfect is -10 is hell. Unfortunately there are too many examples at the wrong end of the scale.

Rusty's original descriptions

@ChaosEngine
ChaosEngine / Samsung_SCX-3400_Series.ppd
Created September 2, 2018 11:13
Samsung SCX-3405W Cups PPD file
*PPD-Adobe: "4.3"
*%%%% PPD file for SCX-3200 with CUPS.
*%%%% Created by the CUPS PPD Compiler CUPS v1.5.0.
*FormatVersion: "4.3"
*FileVersion: "2.0.0"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "scx3200.ppd"
*Product: "(SCX-3200)"
*Manufacturer: "Samsung"
@Kenny-MWI
Kenny-MWI / slack_tweaks.md
Last active April 23, 2025 15:56
Slack Tweaks

Slack Tweaks

In Fall 2023, Slack introduced an updated client with some unpopular UI changes. The tweaks in this document can be used to revert to the old client or hide the new side bar. These will reset every time you fully close Slack but they are easy to re-apply once you get the hang of it.

(Cross Platform) Open Dev Tools [Preferred Option]

To run any of these scripts, you'll need to open the Dev Tools (or Console). You can do this by typing /slackdevtools in a Slack channel or direct message. These are the same Dev Tools you'd get in Chrome if you hit F12. Along the top are tabs for Elements, Console, Sources, Network, etc. You'll want to paste these scripts into the Console tab at the > prompt.

If Slack disables this command, then you can open Dev Tools by setting a system-wide environment variable and using a keyboard shortcut to open the console. If /slackdevtools worked for you then you can skip these next two sections.

(Mac OS) Enable Dev Mode

@emilf
emilf / Instructions.md
Created March 31, 2025 23:23
Updated install install-linux.sh for opkssh for use on Arch Linux servers

This is a guide to install opkssh on Arch Linux and as valid as of 31. march 2025

Installing

I use yay to install AUR packages, but installing packages using the AUR is beyond the scope of this guide.

You need to install one of the following AUR packages:

  • opkssh
  • opkssh-bin
  • opkssh-git
@akaihola
akaihola / nixos-x1.rst
Last active April 23, 2025 15:56
Installing NixOS on a Lenovo ThinkPad Carbon X1 Gen 9
@albinowax
albinowax / race-condition-probe.java
Last active April 23, 2025 15:55
Race condition custom action for Burp Repeater
// This will use the single-packet attack for HTTP/2, and last-byte synchronisation for HTTP/1
int NUMBER_OF_REQUESTS = 10;
var reqs = new ArrayList<HttpRequest>();
for (int i = 0; i < NUMBER_OF_REQUESTS; i++) {
reqs.add(requestResponse.request());
}
var responses = api().http().sendRequests(reqs);
var codes = responses.stream().map(HttpRequestResponse::response).map(HttpResponse::statusCode).toList();
logging().logToOutput(codes);
@vanodevium
vanodevium / Caddyfile
Created December 8, 2023 11:20
Caddy server: enable CORS for any domain
(cors) {
@cors_preflight method OPTIONS
header {
Access-Control-Allow-Origin "{header.origin}"
Vary Origin
Access-Control-Expose-Headers "Authorization"
Access-Control-Allow-Credentials "true"
}
{
"input": {
"blocklist": [],
"compressor#0": {
"attack": 5.0,
"boost-amount": 6.0,
"boost-threshold": -72.0,
"bypass": false,
"dry": -100.0,
"hpf-frequency": 10.0,