Skip to content

Instantly share code, notes, and snippets.

View tcprescott's full-sized avatar

Thomas Prescott tcprescott

  • Des Moines, Iowa
View GitHub Profile
@tcprescott
tcprescott / gist:42eb94d0172b2bc04a0db25b0a93db59
Created November 29, 2018 03:08
GDQ registration scraper
#in the "cookie" variable, replace remember_abc123456 with the name of your remember_* cookie in your browser
#and remembertokenhere with the token for that cookie
#you can find the cookie in chrome by going into the developer tools while on the page (Control-Shift-I in Windows)
#go to Application tab, choose Cookies
#uses python 3.6
#pip3 install requests
#pip3 install BeautifulSoup4
#pip3 install lxml
import requests
import json
req = requests.post(
url="https://alttpr.com/seed",
data=json.dumps({
"difficulty": "normal",
"enemizer": "false",
"logic": "NoGlitches",
"mode": "open",
change the bytes at 0x180215
!ALPHA_BOW = "#$0000"
!ALPHA_BOOM = "#$0001"
!ALPHA_HOOK = "#$0002"
!ALPHA_BOMB = "#$0003"
!ALPHA_SHROOM = "#$0004"
!ALPHA_POWDER = "#$0005"
!ALPHA_ROD = "#$0006"
!ALPHA_PENDANT = "#$0007"
2018-12-23T11:32:08 WSServer - Debug: "Websocket 7ffd52a58690" received "{\"Opcode\": \"PutFile\", \"Space\": \"SNES\", \"Flags\": null, \"Operands\": [\"/romloader/VLDC9.sfc\", \"600000\"]}" (:0, )
2018-12-23T11:32:08 WSServer - Debug: Request is USB2SnesWS::opcode(PutFile) (:0, )
2018-12-23T11:32:08 WSServer - Debug: Device is ADevice::State(READY) (:0, )
2018-12-23T11:32:08 WSServer - Debug: Executing request : 5 Created at QTime("11:32:08.695") - USB2SnesWS::opcode(PutFile) SD2Snes::space(SNES) () ("/romloader/VLDC9.sfc", "600000") WSServer::RequestState(NEW) for "Websocket 7ffd52a58690" (:0, )
2018-12-23T11:32:08 USBCO - Debug: convertir numnber 6291456 to bitarray : "00600000" (:0, )
2018-12-23T11:32:08 USBCO - Debug: CMD : SD2Snes::opcode(PUT) SD2Snes::space(FILE) 0 "/romloader/VLDC9.sfc" (:0, )
2018-12-23T11:32:08 USBCO - Debug: >> "5553424101000000" - 252-272 : "006000002f726f6d
@tcprescott
tcprescott / alttpr_patcher.py
Last active April 19, 2020 02:04
POC for a ROM patcher for the ALTTPR website, is a complete mess and needs to be cleaned before being used in a real project
import requests
import json
import itertools
import time
start_time = time.time()
def get_hash(patches):
seek = '1573395'
for patch in patches:
import pyz3r
import tkinter as tk
import sys
from tkinter.filedialog import askopenfilename, asksaveasfilename
from tkinter import messagebox
from tkinter import simpledialog
def show_exception_and_exit(exc_type, exc_value, tb):
import traceback
traceback.print_exception(exc_type, exc_value, tb)
[root@server1 EnemizerCLI.Core]# dotnet build
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restoring packages for /root/Enemizer-6.0.32/EnemizerCLI.Core/EnemizerCLI.Core.csproj...
Restoring packages for /root/Enemizer-6.0.32/EnemizerLibrary/EnemizerLibrary.csproj...
/root/Enemizer-6.0.32/EnemizerCLI.Core/EnemizerCLI.Core.csproj : warning NU1701: Package 'CommandLineParser 1.9.71' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.
Generating MSBuild file /root/Enemizer-6.0.32/EnemizerLibrary/obj/EnemizerLibrary.csproj.nuget.g.props.
Generating MSBuild file /root/Enemizer-6.0.32/EnemizerCLI.Core/obj/EnemizerCLI.Core.csproj.nuget.g.props.
Generating MSBuild file /root/Enemizer-6.0.32/EnemizerCLI.Core/obj/EnemizerCLI.Core.csproj.nuget.g.targets.
"""models.py"""
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'tbl_user'
id = Column(Integer, primary_key=True)
{
"logic": "NoGlitches",
"difficulty": "custom",
"variation": "none",
"mode": "open",
"goal": "ganon",
"weapons": "randomized",
"tournament": true,
"name": "Open - Hints Disabled",
"notes": "SGLive Tournament Qualifier Flagset for v30",
@tcprescott
tcprescott / ec2-instance-store-init.sh
Last active February 15, 2021 15:52
ec2 format and mount ephemeral instance store disks
#!/bin/bash
#set -e
#set -o pipefail
###
# This script will strip together all disk to create a raid device at /dev/md0
# EC2 instances with a single instance store disk will instead use the raw nvme device
#
# Requires these packages: lvm2 jq mdadm nvme-cli