Skip to content

Instantly share code, notes, and snippets.

Avatar

toxicantidote

View GitHub Profile
@toxicantidote
toxicantidote / pinger.py
Last active Mar 26, 2020
Network host ping tool
View pinger.py
## Site ping check tool ##
##
## Developed and tested on Win10 with Python2.7
##
## Implemented minimal Progressbar and Notebook widgets by cutting
## down code from Guilherma Polo. This *should* let us work with even earlier
## Python versions provided that they were compiled against Tk 8.5 or later.
##
## Reads one or more files containing details of sites to ping, pings them at
## the defined frequency, and displays the result in a GUI.
@toxicantidote
toxicantidote / MCP2200 via websockets.py
Created Oct 26, 2018
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 Sep 23, 2018
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 Jul 27, 2018
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 Jun 6, 2018
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
View MCP2200 USB HID interfacing test.py
#!/usr/bin/python3
##
## Interfacing with the MCP2200 GPIO via USB HID. Plays with the first four GPIO ports.
##
## Used for controlling 4 port USB relay board from Denkovi.
##
import usb.core
import usb.util
import time
@toxicantidote
toxicantidote / dir-505 shareport download.py
Last active Sep 8, 2017
Download from Dlink DIR-505 shareport service
View dir-505 shareport download.py
## DIR-505 SharePort file download ##
##
## Written using a D-link DIR-505 running firmware version 1.09.
##
## This version seems to have a bug where read-only users can't list files in
## the 'folder view' mode. Because of this, the user specified needs to have
## read and write access.
##
## Note that this download is not recursive.
##