Skip to content

Instantly share code, notes, and snippets.

View emersion's full-sized avatar

Simon Ser emersion

View GitHub Profile
@emersion
emersion / download-pipermail.sh
Created June 5, 2018 16:05
Download a whole pipermail archive into a single mbox file
wget -r -np -l 1 -n d -A gz https://lists.freedesktop.org/archives/wayland-devel/
gunzip *.gz
cat * > all.mbox
@emersion
emersion / debian-mips64el-on-qemu.md
Last active January 7, 2023 12:01 — forked from extremecoders-re/debian-mipsel-on-qemu.md
Installing debian stretch mips64el on qemu
@emersion
emersion / Makefile
Created December 24, 2017 10:47
Fuck GOPATH
PKGNAME = github.com/emersion/fuckgopath
GOPATH = $(realpath .go)
PKGPATH = .go/src/$(PKGNAME)
all: fuckgopath
.go:
mkdir -p $(dir $(PKGPATH))
ln -fTrs $(realpath .) $(PKGPATH)
@emersion
emersion / security-headers.conf
Created July 30, 2018 12:45
Caddy strict security headers
header / {
X-XSS-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
Referrer-Policy "no-referrer"
Content-Security-Policy "default-src 'none'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; img-src https:; font-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'none'; form-action 'self'; worker-src 'none'; frame-src https://youtube-nocookie.com;"
Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; autoplay 'none'; camera 'none'; encrypted-media 'none'; fullscreen 'self'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; midi 'none'; payment 'none'; picture-in-picture 'self'; speaker 'none'; usb 'none'; vr 'none';"
}
static void tracef(const char *fmt, ...)
{
static int first = 1;
static FILE *trace_file = NULL;
if (first) {
trace_file = fopen("/sys/kernel/tracing/trace_marker", "w");
first = 0;
}
if (trace_file) {
va_list args;
@emersion
emersion / hw-limitations.md
Last active February 26, 2021 08:52
GPU hardware limitations

Intel

  • Enabling some modifiers can lead to hitting bandwidth limitations (not being able to light up a CRTC).
  • With YUV buffers, planes can only have a position with even coordinates (or odd?).

AMD

  • There's no real cursor plane, instead the hardware draws it on the top-most plane (overlay if enabled, otherwise primary). Thus the cursor composition properties (scaling, rotation, blend mode, etc) must match the underlying plane's. An RGB cursor buffer can't be used if the underlying plane uses a YUV format.
  • 90-degree and 270-degree rotations are not supported for linear buffers. Tiled buffers are required.
  • The primary plane needs to be enabled to allow any other plane to be enabled.
@emersion
emersion / arch-install.sh
Last active January 6, 2021 08:13
Arch Linux installation
# Arch Linux installation
# - EFI with systemd-boot
# - LUKS encryption
# - BTRFS with two subvolumes: @root and @home
# - Intel/AMD ucode
# See https://wiki.archlinux.org/index.php/Installation_guide
# Connect to the Internet
ls /sys/firmware/efi/efivars # Check EFI
timedatectl set-ntp true
@emersion
emersion / imap-capability.md
Last active February 12, 2020 04:01
Common IMAP servers CAPABILITY responses

FastMail

* CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ MAILBOX-REFERRALS NAMESPACE UIDPLUS ID NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE IDLE AUTH=OTP SASL-IR
* CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE IDLE URLAUTH

Gandi.net

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv)
{
char buf[256], *mem;
const char *range_name;
FILE *rd, *wr;
long long start_addr, end_addr;

What does a mailing list need to do to reflect a message?

Method 1

Keep the original From header. Add a Sender header field with the list's address. Broadcast message with MAIL FROM set to the list's address.

Issues: