Skip to content

Instantly share code, notes, and snippets.

View dogtopus's full-sized avatar
🦄
Unicorn!

dogtopus

🦄
Unicorn!
View GitHub Profile
@dogtopus
dogtopus / wsltqlbot.py
Created February 4, 2019 01:49
tql, wsl
#!/usr/bin/env python3
import json
import os
import pyrogram
import sys
from collections import OrderedDict
def make_bot(session, persistent_path):
app = pyrogram.Client(session)
@dogtopus
dogtopus / qcarfm.py
Created January 22, 2019 18:29
Vuforia Frame Marker generator (legacy code)
from PIL import Image, ImageDraw
DEFAULT_NESW = (292, 246, 177, 472)
OFFSETS_NESW = ((1, 0), (19, 1), (2, 19), (0, 2))
class common(object):
def __init__(self, fmid = 0):
self.fmid = fmid
@dogtopus
dogtopus / Pipfile
Last active April 12, 2025 22:28 — forked from stecman/_readme.md
Brother P-Touch PT-P300BT bluetooth driver python
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
pybluez = "*"
pillow = "*"
packbits = "*"
@dogtopus
dogtopus / csrotau.py
Created December 12, 2018 20:37
CSR OTAU binary parser
#!/usr/bin/env python3
# CSR OTAU binary parser
# https://developer.qualcomm.com/qfile/34081/csr102x_otau_overview.pdf
# For use with test and demonstration only. This is obviously not official and
# is not affiliated with Qualcomm.
import io
import os
import sys
@dogtopus
dogtopus / invoke.md
Last active November 5, 2018 21:03
Washing Machine Video generator

Washing Machine Video generator

>Why is she in a washing machine?
>No anon, YOU are in the washing machine

wmv

(Not actual output)

@dogtopus
dogtopus / fetchbib.sh
Last active September 25, 2018 23:19
Resolve DOI references and print bibliography in BibTeX format
#!/bin/bash
if [[ $# -lt 1 ]]; then
echo "Usage ${0} <doi> ..."
exit 1
fi
for doi in "${@}"; do
ref="$(curl -sSf -H 'Accept: application/x-bibtex' -L "http://dx.doi.org/${doi}")" && { \
head -n1 <<< "${ref}" | egrep -q '^@[a-zA-Z]+'
if [[ $? != 0 ]]; then
@dogtopus
dogtopus / 99-opkg-macros.sh
Last active September 6, 2020 05:56
The missing upgrade-all feature for opkg. Drop into /etc/profile.d/ re-login and use `opkg update && opkg upgrade-all` to upgrade all packages
#!/bin/sh
__opkgx_append_to_list() {
local _listfile="${1}"
shift
cp "${_listfile}" "${_listfile}.bak"
for pkg in "$@"; do
echo "${pkg}" >> "${_listfile}"
done
diff -u "${_listfile}.bak" "${_listfile}"
@dogtopus
dogtopus / ds4poke.py
Last active July 21, 2024 07:32
Mock authenticator/counterfeit detector for DualShock4 controllers. Does basic detection for banned keys through SHA256 fingerprint (fingerprint database required). Does not include CA public key for obvious reason.
#!/usr/bin/env python3
# Credits to:
# - Eleccelerator and PS4 Developer Wiki for the HID report format used in
# authentication procedure.
# - Author of jedi_crypto.py who provides detailed information on the basic
# building blocks used by the authentication scheme (and the Jedi CA
# certificate).
#
# This tool is for education and demonstration purpose only. Use it at your own
# risk.
@dogtopus
dogtopus / fsck2pack.py
Created February 8, 2018 05:25
Fix RGSS3A headers scrambled by Fux2Pack
#!/usr/bin/env python3
import sys
import struct
if __name__ == '__main__':
if len(sys.argv) < 2:
print('Usage:', sys.argv[0], '<fux2packedrgss3a>')
sys.exit(1)
hdr = struct.Struct('<8sI')
@dogtopus
dogtopus / exception_dump_parser_rasm2.py
Created October 17, 2016 04:41
Luma3DS exception dump parser, modified to use rasm2 as disassembler
#!/usr/bin/env python
# Requires Python >= 3.2 or >= 2.7
# This file is part of Luma3DS
# Copyright (C) 2016 Aurora Wright, TuxSH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.