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/python3 | |
# Thing for making up a valid (ish) driving licence number | |
# https://www.drivercheck.co.uk/find-out-more/photocard-driving-licence-explained/ | |
# Note checksum is just dumped on there, not generated cos IDK how it's calculated | |
import argparse | |
from datetime import date | |
from typing import Tuple |
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 ruby | |
# | |
require 'rmodbus' | |
status_labels = [ | |
['Drive not ready', 'Ready for operation (READY)'], | |
['Stop', 'Running operation message (RUN)'], | |
['Clockwise rotating field (FWD)', 'Anticlockwise rotating field (REV)'], | |
['No fault', 'Fault detected (FAULT)'], | |
['No warning', 'Warning active (ALARM)'], |
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/sh | |
RANGE=$1 | |
echo "Looking for Pis in 10.193.${RANGE:-9}.0/24" | |
sudo nmap -sP "10.193.${RANGE:-9}.0/24" | grep "B8:27" -B 2 |
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
// Control a 4 phase stepper motor with an Arduino | |
// Controls a 28BYJ-48 stepper motor, via some digital pins an an LM2003 driver | |
// Uses direct port manipulation for fast concurrent pin state changes | |
// https://en.wikipedia.org/wiki/Stepper_motor#/media/File:Drive.png | |
int motorSpeed = 1000; | |
int count = 0; | |
int countsperrev = 32*16; | |
// can do > 1100 uS |
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
#include <TinyWireS.h> | |
// MAX INT 32767 | |
#ifndef TWI_RX_BUFFER_SIZE | |
#define TWI_RX_BUFFER_SIZE (16) | |
#endif | |
#define ADDR 0x11 |
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
// readCapacitivePin | |
// Input: Arduino pin number | |
// Output: A number, from 0 to 17 expressing | |
// how much capacitance is on the pin | |
// When you touch the pin, or whatever you have | |
// attached to it, the number will get higher | |
uint8_t readCapacitivePin(int pinToMeasure) { | |
// Variables used to translate from Arduino to AVR pin naming | |
volatile uint8_t* port; |
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
eyJzdiI6eyJjIjoiMzFkNjMiLCJjcyI6ImkyYmwiLCJ3IjoiY2Y5IiwiY2wiOiJjMTowfGMyOjF8YzM6MHxjNDoxfGM1OjF8YzY6MSIsInNsIjoiczE6MnxzMjozfHMzOjF8czQ6NXxzNToyfHM2OjF8czc6MCIsImJuIjoiYjE6MHxiMjozfGIzOjJ8YjQ6MnxiNTowIiwidSI6InUwMXx1MDJ8dTAzfHUwNHx1MDV8dTA2fHUwN3x1MDl8dTEwfHUxMXx1MTJ8dTEzfHUxNHx1MTV8dTE2fHUxN3x1MjZ8dTI3fHUyOHx1Mjl8dTMwfHUzMXx1MzJ8dTMzfHUzNHx1MzV8dTM2fHUzN3x1MzgiLCJzIjoic2VsbGVyX3JwczoxODd8Y2xpY2tlcl9ycHM6MTIyfGJhbmtfcnBzOjVnY3xjaGVhdGVkX3dpZGdldHM6MHxjaGVhdGVkX2Nhc2g6MHxoYW5kX21hZGVfd2lkZ2V0czpmNjU0fG1hZGVfd2lkZ2V0czoxZGJjai5mazNrM2JhM2cwaXxzb2xkX3dpZGdldHM6MWNtbGEuYjBuMG4wNjdlZzN8aGFuZF9zb2xkX3dpZGdldHM6NWNiYy5uMG4wbjEwODI5MjZ8c2Vjb25kc19wbGF5ZWQ6NWFofGJvdWdodF91cGdyYWRlczoxNXx0b3RhbF9jYXNoOjEyaGprbi5rOWU5ZWNoZGx8c3RhcnRfdGltZTpjZGoxZ2RoZGYifSwiYWMiOiJhMDF8YTAyfGEwM3xhMDR8YTA3fGEwOHxhMTR8YTE4fGEyMnxhMjMifQ |
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
// See http://www.fanjita.org/serendipity/archives/53-Interfacing-with-radio-controlled-mains-sockets-part-2.html | |
#define PAYLOAD_SIZE 48 | |
#define DATA_PIN A4 | |
#define VCC_PIN A5 | |
#define GND_PIN A3 | |
#define LED_PIN 13 | |
#define CHANNEL 1 | |
#define TURNON 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
#include <SPI.h> | |
#include <Ethernet.h> | |
#include <PusherClient.h> | |
byte mac[] = { | |
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; | |
PusherClient client; | |
IPAddress ip(192,168,1,101); | |
const int parrot = 3; |
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
avconv -i input.mp4 -f image2 frames/f_%00d.jpg | |
for F in $(ls frames/) | |
do | |
composite -compose atop -gravity SouthWest overlay_frame.png frames/$F out/$F | |
done | |
avconv -f image2 -i out/f_%00d.jpg out.mpeg -b 2400kb |
NewerOlder