aly / lookingglass.py
0 likes
0 forks
1 files
Last active
A Looking Glass implementation in Python3 and Flask. Vet code for security concerns before deploying, this isn't tested for vulnerabilities in any way
| 1 | #!/usr/bin/env python3 |
| 2 | from flask import Flask,request,make_response |
| 3 | from shlex import quote |
| 4 | from subprocess import check_output |
| 5 | import socket |
| 6 | from requests import post |
| 7 | |
| 8 | app = Flask(__name__) |
| 9 | |
| 10 | @app.route('/') |
aly / lyrics2ptr.py
0 likes
0 forks
1 files
Last active
Takes lyrics and a subnet, returns djbdns PTR records for those lyrics
| 1 | #!/usr/bin/env python |
| 2 | # v4 |
| 3 | # known bugs: |
| 4 | # * very long words may break all the things or end up longer than the maximum limit |
| 5 | |
| 6 | __usage__ = "{} $network <lyrics" |
| 7 | __example__ = """ |
| 8 | $ {} 172.16.1.0/30 <<EOF |
| 9 | this is a test |
| 10 | this is only a test |
aly / get_world_quests.py
0 likes
0 forks
1 files
Last active
Gets current world quests active in NA and returns json. Doesn't get zone info yet
| 1 | #!/usr/bin/env python3 |
| 2 | import requests,json |
| 3 | |
| 4 | page = requests.get("http://www.wowhead.com/world-quests/na").text |
| 5 | datasets,worldquest_raw = page.split("});\n\n//]]>")[0].split("\nvar lvWorldQuests") |
| 6 | datasets = [n.strip() for n in datasets.split("var _ = {};")][1:] |
| 7 | worldquests = json.loads(worldquest_raw.split("parent: 'list', data: ",1)[1].split("});\n\n//]]>",1)[0]) |
| 8 | |
| 9 | wq_items, wq_quests, wq_factions = {},{},{} |
| 10 | wq_types = {1: "Profession Quest", 2: "World Quest", 3: "PVP World Quest", 4: "Pet Battle", 5: "Emissary (Faction) Quest", 6: "Dungeon World Quest", 7: "?? Maybe world boss", 8: "Raid World Quest"} |
aly / toornamenter.py
0 likes
0 forks
1 files
Last active
A scriptable program to add fields to a toornament
| 1 | #!/usr/bin/env python3 |
| 2 | # $ python3 toornamenter.py '1349047821760815104,Test label,test_label,1,1,1 |
| 3 | # 1262174713922625536,Test label,test_label,1,1,1' |
| 4 | # yes that's a newline in there. takes csv as long as it's purely comma separated values, |
| 5 | # no quotes or escaped commas supported, sorry |
| 6 | import requests |
| 7 | from argparse import ArgumentParser |
| 8 | from os import environ |
| 9 | |
| 10 | x = "custom_field_create[{}]"# |
aly / gmusicplay.py
0 likes
0 forks
1 files
Last active
Google Music player in the terminal woopwoop | Individual song playback implemented, album support coming soon?
| 1 | #!/usr/bin/env python3 |
| 2 | from gmusicapi import Mobileclient |
| 3 | import os |
| 4 | from json import load |
| 5 | import sys |
| 6 | |
| 7 | def mkdir_p(path): |
| 8 | import errno |
| 9 | try: |
| 10 | os.makedirs(path) |
aly / toornament_customfield.py
0 likes
0 forks
1 files
Last active
Creating a custom field in Toornament (Python3+requests)
| 1 | #!/usr/bin/env python3 |
| 2 | import requests |
| 3 | toornament_id = input("Toornament ID: ")# "1262174713922625536" |
| 4 | email_addr = input("Email address: ")# "stevensmith.ome@gmail.com" |
| 5 | password = input("Password: ") |
| 6 | customfield = { |
| 7 | x.format("label"): "Discord UN", |
| 8 | x.format("machineName"): "discord_un", |
| 9 | x.format("position"): 2, |
| 10 | x.format("required"): 1, |
aly / fixagent.sh
0 likes
0 forks
1 files
Last active
A script to fix the Battle.Net Agent crashing constantly on OSX with no warning or error. The elevated instance of Agent dies suddenly, leaving the user-level version doing nothing, with the frozen download meter being the only indication to users
| 1 | #!/bin/bash |
| 2 | while true; do |
| 3 | ps aux | grep Battle.net | grep Agent | grep root >/dev/null |
| 4 | if [[ "$?" -eq "1" ]]; then |
| 5 | echo "Fixing Agent at "`date +%H:%M:%S` |
| 6 | kill -9 `ps aux | grep Battle.net | grep Agent | grep $USER | awk '{print $2}'` |
| 7 | fi |
| 8 | sleep 5 |
| 9 | done |
aly / megathread.py
0 likes
0 forks
1 files
Last active
VOD thread favorite runs megathread https://www.reddit.com/r/speedrun/comments/7qdpgr/agdq_favorite_runs_megathread_2018/
| 1 | #!/var/www/html/gdq/newpraw/bin/python |
| 2 | import praw, json |
| 3 | with open("/home/steven/gdqauth.json") as f: |
| 4 | auth = json.load(f) |
| 5 | |
| 6 | r = praw.Reddit(user_agent='GDQ thread autoupdater by /u/suudo', refresh_token=auth["token"], **auth["login"]) |
| 7 | with open("/var/www/html/gdq/schedule.json") as f: |
| 8 | data = json.load(f) |
| 9 | |
| 10 | if not hasattr(__builtins__, "raw_input"): |