Skip to content

Instantly share code, notes, and snippets.

View rfinnie's full-sized avatar

Ryan Finnie rfinnie

View GitHub Profile
#!/usr/bin/env python3
import socketserver
import socket
import time
import struct
class MCastUDPServer(socketserver.UDPServer):
# Usage:

Keybase proof

I hereby claim:

  • I am rfinnie on github.
  • I am rfinnie (https://keybase.io/rfinnie) on keybase.
  • I have a public key whose fingerprint is 42E2 C8DE 8C17 3AB1 02F5 2C6E 7E60 A3A6 86AE 8D98

To claim this, I am signing this object:

#!/usr/bin/python3
import os
import glob
TARGET_SIZE = (1024**4) * 3
COLLECTION_CONFIGS = {
'cam1': {
'glob': '/media/camera/streams/cam1/cam1_*.mp4',
'weight': 0.2,
# smwrand
# Ryan Finnie <ryan@finnie.org>
# Based on deconstruction by Retro Game Mechanics Explained
# https://www.youtube.com/watch?v=q15yNrJHOak
class SMWRand:
seed_1 = 0
seed_2 = 0
def _rand(self):

vanityhash brag list

vanityhash has become an accidental benchmark.

git clone https://github.com/rfinnie/vanityhash
vanityhash/vanityhash benchmark
  • Benchmark mode takes 60 seconds to complete.
#!/usr/bin/env python3
# auto_pager.py
# Copyright (C) 2018 Ryan Finnie
#
# 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 2
# of the License, or (at your option) any later version.
#

Remote and local servers

mkdir -p /srv/doh-proxy/git /srv/doh-proxy/venv
python3 -mvirtualenv /srv/doh-proxy/venv

# Fork of https://github.com/facebookexperimental/doh-proxy - functionality additions
git clone https://github.com/rfinnie/doh-proxy /srv/doh-proxy/git/doh-proxy

# Fork of https://github.com/decentfox/aioh2 - Python 3.6/3.8 fixes
@rfinnie
rfinnie / logger.py
Created March 11, 2021 04:06
Python logging precursor, circa 2001
#!/usr/bin/env python
"""A centralized abstraction layer for logging via facilities.
log = LogObj()
log.nothing = Nolog()
log.debug = File(file='debuglog.txt', flags='w', bufsize=0, longlog=1)
log.info = File(sys.stdout)
log.info.deps.append('debug')
log.error = Syslog(LOG_LOCAL5|LOG_ERR)
{
"platforms" : [
{
"platform_id" : 1,
"platform_name" : "Linux"
},
{
"platform_id" : 2,
"platform_name" : "DOS"
},
8 RANDOMIZE
14 LET X=INT(RND(X)*39)+1
18 LET Y=INT(RND(X)*24)+1
30 PRINT "MISS CLEO HAS PUT EMAD IN A MINDJAIL,"
47 PRINT "WHICH IS A PRISON FOR YOUR MIND."
60 PRINT "IT IS YOUR JOB TO GET HIM OUT!"
69 PRINT ""
85 IF Y = 1 GOTO 594
104 IF Y = 25 GOTO 612
111 IF X = 1 GOTO 637