Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View toxicantidote's full-sized avatar

toxicantidote

View GitHub Profile
@toxicantidote
toxicantidote / fridge_gui.py
Last active March 27, 2024 10:56
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 March 8, 2024 10:25
Compressor interfacing for new fridge controller
// pins where things are connected
#define PIN_INTERRUPT 2
#define PIN_LED_R 11
#define PIN_LED_G 10
#define PIN_LED_B 9
#define PIN_STATUS 13
#define PIN_RELAY_1 A0
@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 November 7, 2023 22:48
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 / 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
@toxicantidote
toxicantidote / esp32_st7735s.py
Created July 13, 2023 23:38
ST7735S display test - CircuitPython (ESP32)
# 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
@toxicantidote
toxicantidote / wifi_select.ino
Last active May 22, 2023 01:08
ESP32 Wi-Fi search and connect to saved
#include <WiFi.h>
#include <Preferences.h>
#include <esp_task_wdt.h>
#define CMDPROMPT "ESP32> "
#define TIMEOUT 10000
// cmd line vars
char cmdBuffer[32];
int cmdBufferPosition = 0;
@toxicantidote
toxicantidote / foxhunter.py
Created August 5, 2021 04:53
Finds Fieldfox units on the LAN
import socket
import threading
import re
class FoxHunter(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.name = 'thread_FoxHunter'
self.units = []
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@toxicantidote
toxicantidote / Network device scan.py
Last active February 1, 2023 14:52
Network device scanner with DNS, UniFi query and switch port/PoE query
#!/usr/bin/python3
##
## Network device scanner with HTML output, DNS resolution, UniFi info and
## PoE/port info.
##
## Required commands: arping, snmpwalk, host
## Required Python3 libraries: requests, Python Imaging Library
## Required infrastructure and services: UniFi controller, PoE switch with SNMP,
## dnsmasq (DHCP and DNS)
## Also requires ieee-data package installed.
@toxicantidote
toxicantidote / Nayax VPOS serial check.py
Created June 6, 2018 22:32
Checks Nayax for VPOS serials not assigned to the current user
## Gets VPOS serials not owned by the current account. Copy in your auth
## parameters for an existing valid session below.
## Nayax preset ID
preset_id = ''
## Auth cookie value
auth_cookie = ''
## RVC cookie value