Skip to content

Instantly share code, notes, and snippets.

View geerlingguy's full-sized avatar
Tea, Earl Grey, hot.

Jeff Geerling geerlingguy

Tea, Earl Grey, hot.
View GitHub Profile
Coreforge / memcpy_unaligned.c
Last active April 20, 2023 18:41
A simple (and not optimal) library to fulfill memory access requirements for BCM2711 PCIe
#include <stddef.h>
#include <stdio.h>
#include <stdint.h>
//#include <stdlib.h>
void* memcpy(void* dst, const void* src, size_t n){
volatile char* vc_src = (char*)src;
volatile char* vc_dst = (char*)dst;
// copy byte by byte, hopefully avoiding any alignment issues
size_t pos = 0;
aussielunix /
Last active July 29, 2023 21:32
Runsheet for bootstrapping a clean MacOS M1 using

Day 0 - Bootstrap MacOS with Ansible

After factory resetting the maching you will need to do the following things to bootstrap it with Ansible.

  • Set default shell to bash chsh -s /bin/bash (optional)
  • Open the App Store and sign in (but do not install anything)
  • Install command line tools
    • xcode-select --install
  • Add Python 3.8 to the $PATH
  • export PATH="$HOME/Library/Python/3.8/bin:$PATH"
geerlingguy /
Last active February 14, 2024 09:47
Photogrammetry automation script using COLMAP and OpenMVS
# Photogrammety automation script.
# Based on
# Adapted from
# See full guide on Jeff Geerling's blog:
# Usage:
docdyhr /
Last active April 13, 2021 15:54
Notes, snippets and one-liners from the Ansible 101 YouTube series based on Jeff Geerling's book Ansible for DevOps
alwynallan / Makefile
Last active June 21, 2024 18:53
Hardware PWM Controller for the Raspberry Pi 4 Case Fan
CC = gcc
RM = rm -f
LIBS = -lbcm2835 -lprom -lpromhttp -lmicrohttpd
CFLAGS = -Wall
Deprecated, see
If you have to use software PWM, it's still here.
geerlingguy /
Last active July 14, 2024 02:06
Increase the BAR memory address space for PCIe devices on the Raspberry Pi Compute Module 4
# The default BAR address space available on the CM4 may be too small to allow
# some devices to initialize correctly. To avoid 'failed to assign memory'
# errors on boot, you can increase the range of the PCIe bus in the Raspberry
# Pi's Device Tree (a .dtb file specific to each Pi model).
# You should probably read up on Device Trees if you don't know what they are:
geerlingguy /
Last active April 14, 2024 16:26
Set up the Nvidia GeForce GT 710 on Raspberry Pi Compute Module 4
# Attempt to set up the Nvidia GeForce GT 710 on a Pi CM4.
# I have tried both armv7l and aarch64 versions of the proprietary driver, in
# addition to the nouveau open source driver (which needs to be compiled into
# a custom Raspberry Pi kernel).
# tl;dr - None of the drivers worked :P
geerlingguy /
Last active June 9, 2024 06:34
Raspberry Pi Benchmark Suite - Phoronix
# Benchmark script for Raspberry Pi OS.
# WARNING: This script is meant to be run as the root user.
# This script should never be run on a system/partition you
# care about. You should only run this on a system that you
# intend to use only for benchmarking and can reinstall or
# re-flash easily.
geerlingguy /
Last active June 12, 2024 21:51
Raspberry Pi CPU temperature and throttling test script
# Raspberry Pi stress CPU temperature measurement script.
# Download this script (e.g. with wget) and give it execute permissions (chmod +x).
# Then run it with ./
# NOTE: In recent years, I've switched to using s-tui. See:
# Variables.