This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple Pi Pico/RP2040 touch interface | |
# This implements a capacitive touch interface using two GPIO pins and just one external resistor. | |
# It work by using the user's body as a capacitor to ground; the output GPIO pin goes through the | |
# resistor to the touch point, which is connected directly to the input GPIO pin. A PIO program | |
# periodically toggels the output pin and then counts the number of cycles until the input pin | |
# changes level. The time constant for the response is proportional to both the fixed resistor | |
# value and the capacitance at the touch point, which varies depending on if the user is touching | |
# or not. With the default setting a 2.2 megaohm resistor works well. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from random import shuffle | |
from sys import exit, stderr | |
from urllib.request import urlopen | |
from urllib.error import URLError | |
urls = [ | |
"ifconfig.me", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Build an AWS Lambda zip file containing git and its dependencies | |
cat <<\EOF > tmp_build.sh | |
#!/bin/bash | |
# Comment this out if you want to see all the actions. | |
quiet=-q | |
# List of main executables from /usr/bin to copy into layer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# A simply tool for receiving water meter readings from a Badger ORION water meter. | |
# Device radio details can be found at https://fccid.io/GIF2006B | |
# Requires rtl_433 to be installed. See https://github.com/merbanan/rtl_433 | |
import sys | |
import json | |
import subprocess | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A script for mounting a host directory into a running Docker container | |
if [ "$#" -ne 3 ]; then | |
echo "Usage: $0 <container> <host path> <target path>" | |
exit 1 | |
fi | |
CONTAINER=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Clear out old images | |
[ -d "lib" ] && rm -r lib | |
cat <<EOF > tmp_recipe.sh | |
# This is the actual container-side recipe | |
yum groupinstall -y "Development Tools" | |
cd /root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A pure Python implementation of Curve25519 | |
This module supports both a low-level interface through curve25519(base_point, secret) | |
and curve25519_base(secret) that take 32-byte blocks of data as inputs and a higher | |
level interface using the X25519PrivateKey and X25519PublicKey classes that are | |
compatible with the classes in cryptography.hazmat.primitives.asymmetric.x25519 with | |
the same names. | |
""" | |
# By Nicko van Someren, 2021. This code is released into the public domain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stepper.py | |
# A micropython driver for 4-phase, unipolar stepper motors such as | |
# the 28BYJ-48 | |
# Relesed to the Public Domain by Nicko van Someren, 2020 | |
# The constructor for the Stepper class takes as arguments the four | |
# pins for driving the motor phases, in phase order, and optionally a | |
# timer. The pins can be passed as pin numbers or machine.Pin objects |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder