Skip to content

Instantly share code, notes, and snippets.

View derpeter's full-sized avatar
🖖

derpeter derpeter

🖖
  • planet earth, milkiway
View GitHub Profile
@geerlingguy
geerlingguy / cm4-fan.sh
Last active November 23, 2024 07:54
Fan controller script for the CM4 IO Board EMC2301 and PWM fans
#!/bin/bash
#
# Jeff Geerling's super-rudimentary fan controller script for the CM4.
#
# Use:
# 1. Download this script to a path like `/opt/cm4-fan.sh`
# 2. Run it with: `nohup bash /opt/cm4-fan.sh`
# 3. Profit!
#
# You should wrap it in a systemd unit file if you want it to persist and come
@satmandu
satmandu / make_current_arm64_rpi_kernel_debs.sh
Last active September 25, 2024 03:44
Make arm64 deb packages for the offical Raspberry Pi Foundation arm64 kernels, tested with ubuntu 23.04
#!/bin/bash -x
# make_arm64_rpi_kernel_debs.sh
# Builds arm64 debian packages from the CURRENT rpi firmware repository kernel which is installed by:
# sudo rpi-update
# This runs on an arm64 host with arm64 compilation tools...
# or with some sort of cross-compilation setup.
# Debs are put in $workdir/build
#
# This will NOT work in Raspbian unless you have an arm64 compilation
# environment setup. Appears to work on
@nezza
nezza / peak.py
Created December 10, 2019 13:01
#!/usr/bin/env python3
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
import sys
imagename = sys.argv[1]
imgcol = cv.imread(imagename)
@joshskidmore
joshskidmore / gpd-micropc-keyboard.sh
Created July 5, 2019 14:56
Uses xmodmap + xcape to use the MicroPC's bottom row a bit more efficiently
#!/usr/bin/env bash
# resets keyboard; kills all running instances of xcape
reset_kbd () {
local xcape_cnt=$(pgrep xcape | wc -l)
echo " - reset_kbd"
echo " - killing $xcape_cnt instances of xcape"
setxkbmap -layout us
@joshskidmore
joshskidmore / ubuntu-mate-gpd-micropc.sh
Created June 28, 2019 10:43
ubuntu-mate-gpd-micropc.sh
#!/usr/bin/env bash
# update
apt -y update
apt -y upgrade
apt -y dist-upgrade
# 5.2 mainline kernel
cd /tmp
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.2-rc6/linux-headers-5.2.0-050200rc6_5.2.0-050200rc6.201906222033_all.deb
@jeez
jeez / Scheduled Tx Tools
Last active March 20, 2025 07:07
[TSN] Scheduled Tx Tools - Examples and Helpers for testing SO_TXTIME, and the etf and taprio qdiscs
We couldn’t find that file to show.
@Brainiarc7
Brainiarc7 / ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
Last active August 18, 2024 02:58
ffmpeg livestreaming to youtube via Nvidia's NVENC and Intel's VAAPI on supported hardware

Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:

Considerations to take when live streaming:

The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:

  1. Set the buffer size (-bufsize:v) equal to the target bitrate (-b:v). You want to ensure that you're encoding in CBR mode.

  2. Set up the encoders as shown: