Skip to content

Instantly share code, notes, and snippets.

@valpackett
valpackett / README.md
Last active May 21, 2026 19:23
enable-aspm.sh with args (PCIe ASPM toggle per device)

This script allows toggling ASPM at runtime per bus via raw PCI config writes.

Example for Snapdragon X series:

doas enable-aspm.sh 0006:00:00.0 0006:01:00.0 0 # SSD ASPM OFF
doas enable-aspm.sh 0006:00:00.0 0006:01:00.0 2 # SSD ASPM ON
doas enable-aspm.sh 0004:00:00.0 0004:01:00.0 0 # WiFi ASPM OFF
doas enable-aspm.sh 0004:00:00.0 0004:01:00.0 2 # WiFi ASPM ON
@x0nu11byt3
x0nu11byt3 / elf_format_cheatsheet.md
Created February 27, 2021 05:26
ELF Format Cheatsheet

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation

@coolaj86
coolaj86 / Create a Bootable MacOS Recovery USB with Linux.md
Last active May 25, 2026 21:46
How to create Apple's Bootable MacOS Rescue Image from Linux

See bootableinstaller.com

How to create a Bootable MacOS Recovery USB from Linux

If your Mac is out-of-order or you otherwise cannot download macOS from the App Store, you can still create a bootable OS X recovery USB, and you can use that to create an Installer USB.

The downloads used in this process are legal and freely avaliable - including disk images directly from Apple's IT support pages, and open source utilities for extracting and converting pkg, dmg, and HFS+.

@lpereira
lpereira / coro.c
Created March 22, 2012 01:12
Simple coroutine implementation in C
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <ucontext.h>
typedef struct coro_t_ coro_t;
typedef struct thread_t_ thread_t;
typedef int (*coro_function_t)(coro_t *coro);
typedef enum {
CORO_NEW,