Skip to content

Instantly share code, notes, and snippets.

@maxmacstn
maxmacstn / main.py
Last active January 11, 2024 19:23
Raspberry Pi Pico - CircuitPython volume knob
import digitalio
import board
import usb_hid
import time
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.mouse import Mouse
from adafruit_hid.keycode import Keycode
from adafruit_hid.consumer_control import ConsumerControl
from adafruit_hid.consumer_control_code import ConsumerControlCode
@enlavin
enlavin / main.py
Last active August 19, 2022 06:23
KMK circuitpython macropad firmware
import board
#from kmk.kmk_keyboard import KMKKeyboard
#from kmk.matrix import DiodeOrientation
#from kmk.keys import KC
# Updated to be compatible with the latest KMK release (which requires CircuitPython >= 7.0)
from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC
from kmk.scanners import DiodeOrientation
@AloisJanicek
AloisJanicek / org-protocol-to-wsl-emacs.reg
Created November 29, 2020 22:44
Org-protocol setup with emacs inside WSL
REGEDIT4
[HKEY_CLASSES_ROOT\org-protocol]
@="URL:Org Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\org-protocol\shell]
[HKEY_CLASSES_ROOT\org-protocol\shell\open]
[HKEY_CLASSES_ROOT\org-protocol\shell\open\command]
@="\"C:\\BIN\\org-protocol-to-wsl-helper.bat\" \"%1\""
@ednisley
ednisley / Helmet Mirror Mount - Ball.scad
Created September 13, 2020 17:45
OpenSCAD source code: Bike helmet mirror mount with ball clamp
// Bike helmet mirror mount - ball joint
// Ed Nisley KE4ZNU 2020-09
/* [Layout options] */
Layout = "Build"; // [Build, Show, Plate, Base, Clamp]
//-- Extrusion parameters
// Extrusion parameters
@kopwei
kopwei / k3s-cluster.md
Last active April 15, 2024 15:57
K3s and Rancher on Raspberry Pi 4 Cluster

Deploy K3s and Rancher on Raspberry Pi 4 cluster

Today I tried to setup a small Kubernetes cluster on top of 3 Raspberry Pi 4 (4GB Memory). Here is the steps to install the cluster.

IMG_3817

Preparation

I have 3 Raspberry Pi 4 stacked with PoE headers and connected to a PoE switch at home. The are connected to Internet through a home router. All Pis are equipped with a 64GB Samsung SDXC card flushed with Ubuntu 20.04 image.

@mill1000
mill1000 / README.md
Last active February 20, 2023 09:03
PPS-GPIO on Rock64 with Armbian legacy (4.4.X) kernel

PPS-GPIO on Rock64 with Armbian legacy (4.4.X) kernel

About

This gist covers how to enable PPS input via GPIO for Rock64 SBCs running Armbian legacy (4.4.X) kernels. It may also be applicable to Pine64 SBCs and other kernel versions but I have not personally tested them.

This gist will not cover configuring ntpd or gpsd to utilize the PPS signal, only enabling pps-gpio via modifying the device tree. For help configuring ntpd or gpsd I recommend the links under Motivation

Motivation

A PPS (Pulse Per Second) signal allows a time server to improve its clock accuracy and therefore achieve Stratum 1 status. Typically a PPS signal is provided via a GPS receiver attached to the server. The GPS receiver also provides a coarse time via USB or serial connection.

@pixelsnafu
pixelsnafu / CloudsResources.md
Last active May 2, 2024 13:46
Useful Resources for Rendering Volumetric Clouds

Volumetric Clouds Resources List

  1. A. Schneider, "Real-Time Volumetric Cloudscapes," in GPU Pro 7: Advanced Rendering Techniques, 2016, pp. 97-127. (Follow up presentations here, and here.)

  2. S. Hillaire, "Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite" in Physically Based Shading in Theory and Practice course, SIGGRAPH 2016. [video] [course notes] [scatter integral shadertoy]

  3. [R. Högfeldt, "Convincing Cloud Rendering – An Implementation of Real-Time Dynamic Volumetric Clouds in Frostbite"](https://odr.chalmers.se/hand

@abachman
abachman / python-io-image-client.py
Created July 3, 2019 15:56
Publishing Raspberry Pi image data to Adafruit IO from Python
#!/usr/bin/env python
# based on https://github.com/adafruit/io-client-python/blob/master/examples/mqtt_client.py
import io
import time
import os
# Camera setup guide: https://learn.adafruit.com/cloud-cam-connected-raspberry-pi-security-camera/pi-camera-setup
import picamera
import base64
@alexellis
alexellis / GUIDE.md
Last active July 2, 2020 02:25
Customise OpenFaaS helm chart for Raspberry Pi / ARM

Guide

You can use the OpenFaaS helm chart to generate custom YAML files for your OpenFaaS installation on ARMHF and ARM64.

Why? tiller is not available for ARM so we cannot customize the chart that way. So instead we ship some defaults for the community which you can then tweak as you see fit.

But what might you want to change?

  • httpProbe - this is a much faster way to check functions are healthy than the default execProbe
@eli9000
eli9000 / bookworm.md
Last active May 5, 2024 05:09
Change your Raspberry Pi scrolling to Natural Scrolling - NEW Bookworm hack!

Bookworm OS (Debian 12)

While this method is indeed a bit hacky, it does work! Perhaps in due course wayfire will make this a bit more straight forward...

🚨 🚨 For some reason wayfire will (occasionally) add back in the <min>0.0</min> line and will also remove the <max>1.0</max> (see Step 2. If you notice natural scroll not working, this is most likely the cause. Just repeat this step and sudo reboot... hey I said it was hacky 🤷🏻‍♂️

Step 1

vi ~/.config/wayfire.ini