Skip to content

Instantly share code, notes, and snippets.

@nevercast
nevercast / pixels.py
Last active November 20, 2022 17:34
Simple MicroPython ESP32 RMT NeoPixel / WS2812B driver.
# Copyright public licence and also I don't care.
# 2020 Josh "NeverCast" Lloyd.
from micropython import const
from esp32 import RMT
# The peripheral clock is 80MHz or 12.5 nanoseconds per clock.
# The smallest precision of timing requried for neopixels is
# 0.35us, but I've decided to go with 0.05 microseconds or
# 50 nanoseconds. 50 nanoseconds = 12.5 * 4 clocks.
# By dividing the 80MHz clock by 4 we get a clock every 50 nanoseconds.
@avoidik
avoidik / README.md
Last active May 22, 2025 20:29
Migrate Raspberry Pi from SD to USB

Raspberry Pi from SD to USB

How to switch over from SD-card to USB-attached device (USB thumbstick, USB enclosed SSD or HDD, etc.) to have more durable storage option.

Steps

  1. Connect USB device to your RPI

  2. Make sure USB device visible by the system

@darth-veitcher
darth-veitcher / check_throttle.sh
Created October 13, 2021 10:15
Check for throttling on RaspberryPi
#!/bin/bash
# This bash script outputs the status of your Pi and checks whether you are being throttled for undervoltage and gives you your temperature
# Article and discussion at https://jamesachambers.com/measure-raspberry-pi-undervoltage-true-clock-speeds/
# Author James A Chambers 6-6-17
# Output current configuration
vcgencmd get_config int | egrep "(arm|core|gpu|sdram)_freq|over_volt"
# Measure clock speeds
for src in arm core h264 isp v3d; do echo -e "$src:\t$(vcgencmd measure_clock $src)"; done
@klaasnicolaas
klaasnicolaas / hourly_price_charts.yaml
Last active April 23, 2025 10:50
Collecting the hourly energy prices via a service in the EnergyZero or easyEnergy integration and using them in an ApexCharts card in your dashboard.
- type: custom:apexcharts-card
graph_span: 1d
header:
show: true
title: Electriciteitsprijzen Vandaag (€/kwh)
span:
start: day
now:
show: true
label: Now
@rootiest
rootiest / SET_NEVERMORE.cfg
Last active January 31, 2025 19:30
Nevermore SET_MATERIAL
# Set Material-specific Nevermore Speed
#
# Add this immediately after your start_print line of the start gcode in Prusa/SuperSlicer:
# SET_NEVERMORE MATERIAL='{filament_type[initial_extruder]}'
#
# Add this immediately after your start_print line of the start gcode in Cura:
# SET_NEVERMORE MATERIAL='{material_type}'
#
[gcode_macro SET_NEVERMORE]
gcode:
@jauderho
jauderho / gist:6b7d42030e264a135450ecc0ba521bd8
Last active July 13, 2025 05:36
HOWTO: Upgrade Raspberry Pi OS from Bullseye to Bookworm
### WARNING: READ CAREFULLY BEFORE ATTEMPTING ###
#
# Officially, this is not recommended. YMMV
# https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/
#
# This mostly works if you are on 64bit. You are on your own if you are on 32bit or mixed 64/32bit
#
# Credit to anfractuosity and fgimenezm for figuring out additional details for kernels
#