Skip to content

Instantly share code, notes, and snippets.

Avatar

toxicantidote

View GitHub Profile
@toxicantidote
toxicantidote / Nayax sales reporting.py
Created June 28, 2022 08:18
Nayax sales reporting
View Nayax sales reporting.py
## 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 / wifi_select.ino
Last active May 22, 2023 01:08
ESP32 Wi-Fi search and connect to saved
View wifi_select.ino
#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 / SolarInterface.py
Created April 25, 2022 11:32
MPP solar PIP-1012-MSE interfacing
View SolarInterface.py
#!/usr/bin/python3
## which serial port the MPP Solar inverter is connected to
serial_port = '/dev/ttyS0'
###
import serial ## provided by 'pyserial' from pip
import crc16 ## provided by 'crc16' from pip
import sys ## inbuilt library
@toxicantidote
toxicantidote / foxhunter.py
Created August 5, 2021 04:53
Finds Fieldfox units on the LAN
View foxhunter.py
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 / pinger.py
Last active June 22, 2021 01:26
Network host ping tool
View pinger.py
## Site ping check tool ##
##
## Originally developed and tested on Win10 with Python 2.7. Updates made with
## Python 3.7, but should still work on Python 2.x provided the Tk install
## isn't ancient.
##
## Reads one or more files containing details of sites to ping, pings them at
## the defined frequency, and displays the result in a GUI.
##
## Within the host files, the last word on each line is considered to be the
@toxicantidote
toxicantidote / MCP2200 via websockets.py
Created October 26, 2018 11:23
Controlling MCP2200 (Denkovi relay) via Websockets and NanoPi switches
View MCP2200 via websockets.py
## Automation relay switcher server
## Allows control of MCP2200 based four port relay board via a websocket. Also interfaces with two pins
## on the NanoPi GPIO to read the state of two buttons using only two wires.
## Address to listen on. Set to 0.0.0.0 for all
listenAddress = '0.0.0.0'
## Port to listen on
listenPort = 8000
@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
View Network device scan.py
#!/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 login and XML machine list.py
Last active June 28, 2022 09:01
Proof of concept for logging in to Nayax and getting the XML machine list
View Nayax login and XML machine list.py
###
username = input('Username? ')
password = input('Password? ')
import requests
import re
import sqlite3
import json
@toxicantidote
toxicantidote / Nayax VPOS serial check.py
Created June 6, 2018 22:32
Checks Nayax for VPOS serials not assigned to the current user
View Nayax VPOS serial check.py
## 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
View Serial port logger
## Quick and dirty serial logger. Logs data received from a serial port.
## Port and baud rate selection
monitorPort = 'COM29'
monitorBaud = 115200
##
import serial
import time
import signal