Skip to content

Instantly share code, notes, and snippets.

View Steve-Tech's full-sized avatar
📚
Studying

Stephen Horvath Steve-Tech

📚
Studying
  • Queensland University of Technology
  • Brisbane, Australia
  • 16:25 (UTC +10:00)
View GitHub Profile
@Steve-Tech
Steve-Tech / Piano_for_Arduino.ino
Last active August 4, 2018 12:31
A piano made with buttons written for Arduino.
/*
* Steve's Piano even though it's more of a keyboard.
* Wiring Diagram at https://steve.jas-team.net/howto/arduino/piano/
* By Steve
*/
#include "pitches.h" //Got this from https://www.arduino.cc/en/Tutorial/ToneMelody but should be included here
//Declaring Variables although they don't vary
const int KeyPins[] = {2, 3, 4, 5, 6, 7, 8, 9}; //An Array for the pins of the keys
@Steve-Tech
Steve-Tech / TelstraAirConnect.py
Last active August 22, 2020 01:24
Python Telstra Air Connector
import requests
import re
session = requests.Session()
# This isn't your Telstra ID but rather the Fon credentials found in the Telstra Air app, you can also find this in the network tab of inspect element when logging in normally.
anid = "m61400000000@wifi.telstra.com"
anidpassword = ""
try: login = re.findall(r'<LoginURL>(.*)</LoginURL>', session.get("http://msftconnecttest.com/redirect").text)[0] # Get the Telstra Air login URL
import os
import subprocess
dirs = []
for i in os.listdir('.'):
if os.path.isdir(i):
dirs += [i]
for i in dirs:
@Steve-Tech
Steve-Tech / Modem-InfluxDB.py
Last active June 28, 2020 06:41
Telstra Smart Modem Stats to InfluxDB
import telstra_smart_modem
from telstra_smart_modem.base import ModemBase, HTTP_TIMEOUT
import bs4
import re
import json
from time import sleep
from datetime import datetime
from influxdb import InfluxDBClient
IP = "192.168.0.1"
@Steve-Tech
Steve-Tech / gpt_2_simple.py
Created June 15, 2020 10:44
A gpt_2_simple script for finishing a paragraph.
import gpt_2_simple as gpt2
choose_model = int(input("Choose Model 0 - 124M, 1 - 335M, 2 - 774M, 3 - 1158M: "))
model_name = ["124M", "355M", "774M", "1558M"][choose_model]
if input("Download Model [y/N]: ").lower() == 'y':
gpt2.download_gpt2(model_name=model_name)
if input("Use CPU [y/N]: ").lower() == 'y':
from os import environ
@Steve-Tech
Steve-Tech / TASS_Scraper.py
Last active August 13, 2021 07:59
Python TASS Scraper
import requests
class TASS:
def __init__(self, baseurl):
self.baseurl = baseurl
self.session = requests.Session()
def login(self, username, password):
url = self.baseurl + "remote-json.cfm?do=ui.web.user.loginAttempt"
@Steve-Tech
Steve-Tech / QSS_API.py
Last active August 24, 2021 10:04
QNAP Switch System Python API Query
import requests
from base64 import b64encode
class QSS:
def __init__(self, baseurl, **kwargs):
self.baseurl = baseurl
self.session = requests.Session()
self.autologin = kwargs.get('autologin', False) # Keyword to check every request if logged in
self.username = kwargs.get('username', None) # Can be used instead of login function
self.password = kwargs.get('password', None)
@Steve-Tech
Steve-Tech / cloudflare-ddns-upnp.py
Created July 1, 2021 13:25
Cloudflare DDNS with UPnP support
#!/usr/bin/python3
#
# Original Code: https://github.com/timothymiller/cloudflare-ddns
# Cloudflare DDNS with UPnP Support
# Tested on a Telstra Smart Modem, will most likely need configuration on other modems.
# upnpclient could possibly be used to find the location/url and things
#
import requests, json, sys, signal, os, time, threading
from xml.etree import ElementTree
@Steve-Tech
Steve-Tech / README.md
Last active March 4, 2022 10:42
Python Gaugan Web API

Interact with the GauGAN2 web demo using python

Inspired by DoodleChaos who would've made something similar for this video.

Usage

Import with from gaugan import gaugan

<> = optional argument

gaugan(input png name, <output jpg name>, <caption>)

@Steve-Tech
Steve-Tech / ESP32-MCPWM.ino
Created June 22, 2022 01:23
ESP32 MCPWM Timer Sync Offset
/*
* ESP32 MCPWM Timer Sync Offset
* by Steve-Tech
* Creates an output like
* _ _
* TIMER0: | |___| |___|; or 10001000
* _ _ | | | |
* TIMER1: ___| |___| |_; or 00100010
*
* Sources: