Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import threading
def do_sql_injection(charset, length, function):
"""Uses *many* threads to conduct a blind SQL injection attack as fast as
possible.
Positional arguments:
@Grezzo
Grezzo / reddit-appropriate-check-bot.py
Last active May 16, 2017 20:13
Bot script to aid in automatic removal of inappropriate reddit submissions based on user's votes on a bot's comment
#! /usr/bin/env python3
#TODO: Check for post limit
#TODO: Check for moderator restriction
import datetime
import urllib
import praw
@Grezzo
Grezzo / Filter DT Grid.py
Created April 13, 2017 15:29
Useful for filling D/T Grid. Takes a finds.gpx, and a caches.gpx and spits out a caches.gpx containing only caches needed to get D/T grid
#! /usr/bin/env python3.4
import xml.etree.cElementTree as ET
namespaces = {
'xmlns': 'http://www.topografix.com/GPX/1/0',
'groundspeak': 'http://www.groundspeak.com/cache/1/0/1'
}
def d_t_grid(gpx):
@Grezzo
Grezzo / fcpxml_transcoded_media.py
Last active August 20, 2017 19:57
Changes paths in an fcpxml to point to transcoded media (proxy and high quality media) if it can be found.
#! /usr/bin/env python
import os
import urllib
import re
import logging
import argparse
import sys
from urlparse import urlparse, urljoin
import xml.etree.ElementTree as ET
#! /usr/bin/env python
import logging
def main():
import argparse, os, codecs, sys
from xml.dom.minidom import parse
#Set up argument parser
parser = argparse.ArgumentParser(description="Remove elements from an fcpxml",
epilog="Latest version available at https://gist.github.com/Grezzo/92cf94c8e1e1f1a58d3e2c1a4098fcaf")
@Grezzo
Grezzo / enable_all_angles.py
Last active October 10, 2016 12:34
Opens an fcpxml (from Apple FCP X) and modifies the multicam clips to add all audio angles. It doesn't really work very well, and I've run out of time/inclination to get it working properly
#! /usr/bin/env python
#Todo:
#Update link to latest version
#check that video only angles are changed to all
#check that video only is "vidoe" and audio only is "audio" and both is "all
#check that angles with no audio are not added
import logging
@Grezzo
Grezzo / GC5Z9V4_Solution.html
Created May 10, 2016 13:11
Draws the solution to GC5Z9V4 in an HTML canvas using JavaScript
<!DOCTYPE html>
<html>
<body>
<canvas id="canv" width="200" height="130" style="border:solid; border-width:1px;"></canvas>
</body>
<script>
var instructions = "00006333 22533133 13323323 36223331 53333623 15362231 35332332 33133133 63133225 33133133 13323323 36233331 31536223
13153333 62353323 32336223 32533233 22633331 53333622 33132253 32336113 33332333 00000000 00000000 33333333 31536231 53333613 31533336 23332253
/*
* Sketch for DigiSpark that will change display orientation by using usb
* keyboard emulation to press Ctrl+Alt+Up-Arrow or Ctrl+Alt+Left-Arrow
* (which are the default hotkeys to rotate the display on windows systems
* with Intel graphics drivers) when it senses (using a tilt switch) that
* the monitor has been physically rotated.
*
* It also illuminates the onboard LED when it thinks the monitor should
* be in portrait mode
*
/*
* Monitor-Auto-Rotate v1
*
* Sketch that will change display orientation by using usb keyboard emultaion to
* press Ctrl+Alt+Up-Arrow or Ctrl+Alt+Right-Arrow (which are the default hotkeys
* to rotate the display on windows systems with Intel graphics drivers) when it
* senses (using a reed switch and a magnet) that the monitor has been physically
* rotated.
*
* Requires updating the Arduino's atmega8u2 USB firmware so that it can emulate
@Grezzo
Grezzo / fixfcpxml.py
Last active March 29, 2017 13:05
Opens an fcpxml (from Apple FCP X) and modifies the asset elements to contain enough audio information to be used properly by any audio elements
#! /usr/bin/env python
import logging
def get_assets_dict(asset_elements):
#Create dictionary
asset_elements_dict = {}
#Add each asset to dictionary with id as key
for asset_element in asset_elements:
asset_id = asset_element.get("id")