Skip to content

Instantly share code, notes, and snippets.


David Vo auscompgeek

View GitHub Profile
auscompgeek /
Last active May 23, 2020
random SecSoc x Atlassian CTF solutions
#!/usr/bin/env python3
# solution for this image is blank [2/3]
from PIL import Image
from PIL.ImagePalette import ImagePalette
im ='blank.png') # <PIL.PngImagePlugin.PngImageFile image mode=P size=800x600 at 0xf00>
im.putpalette(ImagePalette('RGB', [0, 0, 0, 0xff, 0xff, 0xff], 6).getdata()[1])'blank2.png')
auscompgeek / riot-export-verified-devices.js
Created May 19, 2020
Export verified device keys from Riot
View riot-export-verified-devices.js'matrix-js-sdk:crypto').onsuccess = (e) =>'device_data').objectStore('device_data').get('-').onsuccess = (e) => {
for (let [mxid, user_devices] of Object.entries(
for (let [device_id, device] of Object.entries(user_devices))
if (device.verified === 1)
console.log('/verify', mxid, device_id, device.keys['ed25519:' + device_id]);
auscompgeek / copysign-bug.pytb
Last active Mar 6, 2020
math.copysign SystemError
View copysign-bug.pytb
>>> math.copysign((-1) ** 0.5, Fraction(-1, 1))
TypeError: can't convert complex to float
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/", line 291, in __float__
return self.numerator / self.denominator
SystemError: PyEval_EvalFrameEx returned a result with an error set
auscompgeek /
Last active Feb 12, 2021
Testing various methods of wrapping angles to [-pi,pi].
import math
import pytest
import wpimath
from hypothesis import given
from hypothesis.strategies import floats
def constrain_angle_atan(angle: float) -> float:
"""Wrap an angle to the interval [-pi,pi]."""
View netcomm-timing.console
roboRIO-5893-FRC:~$ # on a 2017 roboRIO image
roboRIO-5893-FRC:~$ cat
import hal
import sys
import time
import timeit
import threading
def timer(): return timeit.timeit(hal.observeUserProgramTest)
auscompgeek /
Created Feb 19, 2019
SPARK MAX Python Smart Motion example
#!/usr/bin/env python3
import rev
import wpilib
class Robot(wpilib.TimedRobot):
def robotInit(self):
self.motor = rev.CANSparkMax(1, rev.MotorType.kBrushless)
auscompgeek / talon_config.json
Created Nov 20, 2018
CTRE Talon SRX default config
View talon_config.json
"_base": {
"custom_param": [
"open_loop_ramp": 0,
"closed_loop_ramp": 0,
"peak_output_forward": 1,
"peak_output_reverse": -1,
#!/usr/bin/env python3
import binascii
import enum
import typing
class Mode(enum.IntEnum):
RAIL = 0
auscompgeek /
Created Jul 23, 2018
new Keybase proof (because stricter checks)

Keybase proof

I hereby claim:

  • I am auscompgeek on github.
  • I am auscompgeek ( on keybase.
  • I have a public key ASAl9lrYfmjshIR18YSkAOi3xRAdZR43EU4as9IsAvDZmwo

To claim this, I am signing this object:

auscompgeek /
Created Feb 5, 2018
Extract ap51-flash combined ext image
#!/usr/bin/env python3
import hashlib
import sys
f = open(sys.argv[1], 'rb')
ce_version =
assert ce_version == b'CE01'