Skip to content

Instantly share code, notes, and snippets.

View buzztiaan's full-sized avatar
🍑
peachy

buZz buzztiaan

🍑
peachy
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / grab_infohashes.pl
Created October 21, 2020 11:06
parse big .torrent directories and only grab infohash and name
#!/usr/bin/perl
use warnings;
use Net::BitTorrent::File;
$directory = "./yts.am_26.01.2019/yts.am_torrents_26.01.2019";
#$directory = "./mac-torrents.com_23.01.2019/torrents";
$directory = "./eztv.io_27.01.2019/eztv.io_torrents_27.01.2019";
$directory = "./nostalgic.is_19.12.2019/nostalgic.is_public_torrents/";
@buzztiaan
buzztiaan / speld.py
Created October 24, 2020 20:06
rss roulette function
import feedparser
import random
NewsFeed = feedparser.parse("https://speld.nl/feed/")
numberofentries = len(NewsFeed.entries)
pickedentry = random.randint(0,numberofentries-1)
entry = NewsFeed.entries[pickedentry];
print entry.title
@buzztiaan
buzztiaan / foreverjune.ino
Created November 22, 2020 14:37
ESP8266 with relay, following sunset-sunrise times of a hardcoded month
#include <math.h>
#define PI 3.1415926
#define ZENITH -.83
#include <NTPClient.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <TimeLib.h>
const char *ssid = "xxx";
@buzztiaan
buzztiaan / telegraf.conf
Created June 22, 2021 11:59
Telegraf config for IdleRPG
[[inputs.http]]
urls = [ "https://idlerpg.lolhosting.net/xml.php?player=buZz" ]
data_format = "xml"
[[inputs.http.xml]]
[inputs.http.xml.tags]
username = "/player/username"
[inputs.http.xml.fields_int]
level = "/player/level"
@buzztiaan
buzztiaan / metalshelving-hook-baseballcap.scad
Created January 20, 2022 15:25
metalshelving-hook-baseballcap.scad
// hook for 'keyhole' metal shelving units
// single 'keyhole' grabbed, just for hanging baseball caps
// buZz 2021
difference() {
linear_extrude(6) {
translate([-1,0,0]) square([3,10]);
translate([3,0,0]) square([3,10]);
translate([-1,-1,0]) square([7,3]);
translate([5.5,11,0]) rotate(-90-50) square([3,25]);