Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

buZz buzztiaan

🌴
On vacation
View GitHub Profile
@buzztiaan
buzztiaan / foreverjune.ino
Created Nov 22, 2020
ESP8266 with relay, following sunset-sunrise times of a hardcoded month
View foreverjune.ino
#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 / speld.py
Created Oct 24, 2020
rss roulette function
View speld.py
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 / grab_infohashes.pl
Created Oct 21, 2020
parse big .torrent directories and only grab infohash and name
View grab_infohashes.pl
#!/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/";
View torrentroulette.py
import time
import btdht
import binascii
import random
dht = btdht.DHT()
dht.start()
time.sleep(15)
@buzztiaan
buzztiaan / gist:5b79a56802f990114290d2b09fc9dd01
Created Mar 4, 2020
chisight's serialport locking fifo bash oneliner
View gist:5b79a56802f990114290d2b09fc9dd01
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 Feb 27, 2020
tank bash controller
View interactive.sh
#!/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 Feb 26, 2020
updated minitankpi code
View minitankpi.ino
int motorspeedA;
int motorspeedB;
// connections to DRV8833
int AIN1pin = 9;
int AIN2pin = 10;
int BIN1pin = 14;
int BIN2pin = 15;
View drv8833function.cpp
// 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 Nov 5, 2019
esp8266 pixelflut server with a SSD1306 oled 128x64 screen
View esp8266-ssd1306-i2c-pixelflut.ino
// 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
View 5mm-3dhark.stl
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.