Skip to content

Instantly share code, notes, and snippets.

View buzztiaan's full-sized avatar
🍑
peachy

buZz buzztiaan

🍑
peachy
View GitHub Profile
@buzztiaan
buzztiaan / torrentroulette.py
Created October 11, 2020 15:06
torrent roulette!
import time
import btdht
import binascii
import random
dht = btdht.DHT()
dht.start()
time.sleep(15)
@buzztiaan
buzztiaan / gist:5b79a56802f990114290d2b09fc9dd01
Created March 4, 2020 23:10
chisight's serialport locking fifo bash oneliner
USB=ACM0; FILE=$(mktemp -u -t $USB_XXXXXXXXXX); mkfifo $FILE; stty -F /dev/tty$USB cs8 115200; tail -f $FILE > /dev/tty$USB &
@buzztiaan
buzztiaan / interactive.sh
Created February 27, 2020 10:54
tank bash controller
#!/bin/bash
while true; do
read -n 1 key
case "$key" in
w)
echo 'F' > /dev/ttyACM0
;;
# s)
# echo 'B' > /dev/ttyACM0
@buzztiaan
buzztiaan / minitankpi.ino
Last active February 26, 2020 15:27
updated minitankpi code
int motorspeedA;
int motorspeedB;
// connections to DRV8833
int AIN1pin = 9;
int AIN2pin = 10;
int BIN1pin = 14;
int BIN2pin = 15;
@buzztiaan
buzztiaan / drv8833function.cpp
Created February 14, 2020 01:08
arduino DRV8833 code
// connections to DRV8833
int AIN1pin = 9;
int AIN2pin = 10;
int BIN1pin = 14;
int BIN2pin = 15;
#define motorA 1
#define motorB 2
@buzztiaan
buzztiaan / esp8266-ssd1306-i2c-pixelflut.ino
Created November 5, 2019 18:19
esp8266 pixelflut server with a SSD1306 oled 128x64 screen
// esp8266 pixelflut server with a SSD1306 oled 128x64 screen
// only ascii PX x y RRGGBB\n supported for now, no SIZE or RRGGBBAA or binary protocol
#include <Wire.h>
#include "SSD1306Wire.h"
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#define MAXBUF 4096
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@buzztiaan
buzztiaan / 24hr.sh
Created September 21, 2019 00:28
Battery discharge and backlight power logging for zipit z2
#!/bin/sh
now=$(date +%s)
dayago=$(( $now - 86400 ))
prevstate="banana";
totaldischargetime=0;
while read -r line; do
@buzztiaan
buzztiaan / esp8266-hd44780-i2c-pixelflut.ino
Created September 18, 2019 02:43
Pixelflut on a ESP8266 with a HD44780 on a PCF8574 'i2c lcd backpack'
// Pixelflut on a ESP8266 with a HD44780 on a PCF8574 'i2c lcd backpack'
// yeah pretty silly :)
// 2019-09-18 buZz NURDspace.nl
#include <LiquidCrystal_PCF8574.h>
#include <Wire.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#define MAXBUF 4096
@buzztiaan
buzztiaan / plasma-v1.pl
Created September 14, 2019 23:48
pixelflut plasma for @NURDspace
#!/usr/bin/perl -w
use IO::Socket::INET;
use Time::HiRes qw( gettimeofday tv_interval usleep );
my $sock = new IO::Socket::INET(PeerAddr => '10.208.42.159',
PeerPort => 5003,
Proto => 'udp', Timeout => 1) or die('Error opening socket.');
my $x;