Skip to content

Instantly share code, notes, and snippets.

View toxicantidote's full-sized avatar
🫠

toxicantidote

🫠
View GitHub Profile
@toxicantidote
toxicantidote / aht20_softwire_example.ino
Created June 7, 2026 10:48
Arduino ESP32 AHT20 SoftWire example with two sensors
/*
Example code to read two I2C AHT20 sensors connected to different pins
and print their temperature to the serial terminal using the SoftWire
software I2C library.
Based on ChatGPT generated code, but modified to allow two sensors.
Tested with ESP32-C3 board and two AHT20 breakouts from AliExpress.
*/
@toxicantidote
toxicantidote / Network device scan.py
Last active May 2, 2026 12:55
Network device scanner with DNS, UniFi query and switch port/PoE query
#!/usr/bin/python3
##
## Network device scanner with HTML & JSON output, DNS resolution, UniFi info and
## PoE/port info.
##
## Required commands: arping, snmpwalk, host, ip (systemd networking), sshpass
## Required Python3 libraries: requests, netaddr
## Required infrastructure and services: UniFi controller, PoE switch with SNMP
## Also requires ieee-data package installed. MRTG needs to be running too.
## Needs to have SSH key of switches in SSH known hosts.
@toxicantidote
toxicantidote / User_Setup.h
Last active April 14, 2026 07:29
(Arduino) Loading an animated GIF from an SD card to display on CYD using TFT_eSPI
/*
Rui Santos & Sara Santos - Random Nerd Tutorials
Install the "TFT_eSPI" lbirary by Bodmer to interface with the TFT Display - https://github.com/Bodmer/TFT_eSPI
*** IMPORTANT: User_Setup.h available on the internet will probably NOT work with the examples available at Random Nerd Tutorials ***
*** YOU MUST USE THIS User_Setup.h FILE, CHECK FOR THE LATEST VERSION IN THE LINK BELOW IN ORDER TO USE THE EXAMPLES FROM RANDOM NERD TUTORIALS ***
https://RandomNerdTutorials.com/cyd/
https://RandomNerdTutorials.com/esp32-tft/
FULL INSTRUCTIONS AVAILABLE ON HOW CONFIGURE THE LIBRARY: https://RandomNerdTutorials.com/cyd/ or https://RandomNerdTutorials.com/esp32-tft/
*/
@toxicantidote
toxicantidote / lancache.py
Last active January 23, 2026 02:23
Uses LANcache DNS lists to create a DNSmasq compatible config file to redirect DNS queries to an existing LANcache server
## LANcache server IP
cache_ip = '192.168.118.5'
## DNSmasq output file (don't overwrite main config)
output_file = '/etc/dnsmasq.lancache'
###
import requests
import os
import datetime
@toxicantidote
toxicantidote / Nayax sales reporting.py
Created June 28, 2022 08:18
Nayax sales reporting
## standard libraries
import re
import time
import queue
import threading
import json
from tkinter import *
from tkinter import ttk, font, messagebox, filedialog
import datetime
import os
@toxicantidote
toxicantidote / Nayax login and XML machine list.py
Last active July 26, 2025 19:42
Proof of concept for logging in to Nayax and getting the XML machine list
###
username = input('Username? ')
password = input('Password? ')
import requests
import re
import sqlite3
import json
@toxicantidote
toxicantidote / macro_pad.ino
Created August 7, 2024 11:10
Media key macro pad
#include "HID-Project.h"
#define PIN_BTN_PREV 11
#define PIN_BTN_PAUSE A1
#define PIN_BTN_NEXT A0
#define PIN_BTN_VOL_DOWN A2
#define PIN_BTN_VOL_MUTE 10
#define PIN_BTN_VOL_UP 9
@toxicantidote
toxicantidote / fridge_gui.py
Last active August 5, 2024 12:17
Fridge GUI/control
import board
from micropython import const as S
## Screen parameters
LCD_WIDTH = S(130)
LCD_HEIGHT = S(64)
LCD_ROTATION = S(0)
## Button thresholds
THRESHOLD_BLUE = S(8000)
@toxicantidote
toxicantidote / fridge_fault_bridge.ino
Last active August 5, 2024 11:54
Compressor interfacing for new fridge controller
#include <avr/wdt.h>
// how long to wait after a UART command before considering the link dead and
// resetting self (ms)
#define KEEPALIVE_WAIT 10000
// pins where things are connected
#define PIN_INTERRUPT 2
#define PIN_LED_R 11
@toxicantidote
toxicantidote / picow_st7735s.py
Created July 13, 2023 23:53
ST7735S display test - CircuitPython (Pico W) - NOT WORKING
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
This test will initialize the display using displayio and draw a solid green
background, a smaller purple rectangle, and some yellow text.
"""
import board
import terminalio