Skip to content

Instantly share code, notes, and snippets.

Ryan Govostes rgov

Block or report user

Report or block rgov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View subliminal_messaging.py
import math
import random
import sys
import time
nsymbols = int(sys.argv[1]) if len(sys.argv) == 2 else 26
nbits_per_symbol = math.ceil(math.log(nsymbols, 2))
ntotal_values = 2**nbits_per_symbol
ninvalid_values = ntotal_values - nsymbols
View lazy_debug.py
class DebugMeta(type):
def __bool__(self):
global is_debug
return is_debug
class DEBUG(object, metaclass=DebugMeta):
def __init__(self, message):
if not type(self):
return
print(message() if callable(message) else message)
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Map demo</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css" />
<script src="https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw-src.js"></script>
View shelldiff.sh
#!/bin/sh
TMPDIR="$(mktemp -d)"
# Capture the default shell options, before we enter POSIX mode
set +o | sort > "$TMPDIR/shellopts.old"
echo "set -$-" >> "$TMPDIR/shellopts.old"
set -o posix
# Capture global variables
View dockerize.py
#!/usr/bin/env python
# Copyright (C) 2019 Woods Hole Oceanographic Institution
#
# This file is part of the CGSN Mooring Project ("cgsn-mooring").
#
# cgsn-mooring 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.
#
View cryptoscope-crack.py
#!/usr/bin/env python
import random
# Here is our plaintext message
message = 'THISISATESTITISONLYATEST'
# Insert random spaces into the message
while len(message) < 72:
i = random.randrange(len(message))
@rgov
rgov / gist:77d71681ae3a9cee6792d90fb490dd16
Created Apr 16, 2019
crash course in managing a database with django-admin
View gist:77d71681ae3a9cee6792d90fb490dd16
# See also:
# https://docs.djangoproject.com/en/2.2/intro/tutorial01/
# Install Django
python -m pip install django
# This creates a blank new Django project in mysite/
django-admin startproject mysite
cd mysite/
@rgov
rgov / gist:32acd7005c175fed68e86a82d58d5b81
Created Apr 16, 2019
crash course in managing a database with django-admin
View gist:32acd7005c175fed68e86a82d58d5b81
# See also:
# https://docs.djangoproject.com/en/2.2/intro/tutorial01/
# Install Django
python -m pip install django
# This creates a blank new Django project in mysite/
django-admin startproject mysite
cd mysite/
@rgov
rgov / tc32-asm.py
Created Apr 13, 2019
Telink TC32 instructions
View tc32-asm.py
'''
This is a list of opcodes for the TC32 MCU, as disassembled by the objdump
binary provided (without source) with the Telink IDE.
The format is (value, mask, assembly).
See
http://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=opcodes/arm-dis.c;hb=HEAD#l2508
'''
[
@rgov
rgov / gist:f1fb93a34a6ec30fe88cf6602776b620
Created Apr 13, 2019
Ghidra - Dump array of structures
View gist:f1fb93a34a6ec30fe88cf6602776b620
# Quickly written script to enumerate an array of structures and dump them
# as a Python object for further processing.
#
# This is NOT a good example of Ghidra scripting; I basically figured out
# the API by brute force. Hopefully there is a more elegant way to do this.
#@author Ryan Govostes
#@category Data
#@keybinding
#@menupath
You can’t perform that action at this time.