Skip to content

Instantly share code, notes, and snippets.

View dogtopus's full-sized avatar
🦄
Unicorn!

dogtopus

🦄
Unicorn!
View GitHub Profile
@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 / 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 / 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 / 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 / Pipfile
Last active March 25, 2024 20:44 — 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 / 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 / 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 / ps4cse_public.md
Last active March 14, 2024 03:32
Licensed PS4 Controller "Security Chip" Secure Element

SE for PS4 Licensed Controllers

Disclaimer

This documentation is provided solely for education and interoperability purposes (aka persons who are tired of proprietary non-customizable hardware and want to use their own hardware for DIY controllers). It enables neither chip-cloning nor controller counterfeiting which would violate copyright and/or any other applicable laws. This documentation also comes without warranty. Use it at your own risk.

Basic info

  • Model: NXP A710x series, possibly semi-customized (Label says 7105 - A7105 does not exist)
  • Protocol: I2C
@dogtopus
dogtopus / error-success.c
Created February 13, 2019 05:37
Make memes by abusing perror()
#include <errno.h>
#include <stdio.h>
int main(void) {
errno = 0;
perror("Error");
return 0;
}
@dogtopus
dogtopus / crc_v3.gfm.md
Created March 19, 2019 03:08
Ross Williams' CRC guide, reformatted in Markdown. No change made to the original text besides formatting.

A PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS

"Everything you wanted to know about CRC algorithms, but were afraid to ask for fear that errors in your understanding might be detected."

Version : 3.
Date    : 19 August 1993.
Author  : Ross N. Williams.
Net     : ross@guest.adelaide.edu.au.