Skip to content

Instantly share code, notes, and snippets.

View liftoff's full-sized avatar

Dan McDougall liftoff

View GitHub Profile
@liftoff
liftoff / concurrent_futures_example.py
Created August 28, 2015 13:28
Example use of concurrent.futures
#!/usr/bin/env python
"""
Example of how to use futures with ProcessPoolExecutor or ThreadPoolExecutor.
"""
from concurrent import futures
def long_running_function():
"""
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@liftoff
liftoff / oclHashcat Benchmarks
Created April 14, 2014 13:26
Benchmarks of oclHashcat on my HTPC (single Radeon R7 265 w/1280 stream processors)
oclHashcat Benchmarks
System Info:
CPU: Intel(R) Core(TM) i5-4570S CPU @ 2.90GHz (quad core)
GPU: XFX Core Edition R7-265A-CNF4 Radeon R7 265 2GB (1280 stream processors)
NetNTLMv2 Benchmark first (since I consider it the most important)
------------------------------------------------------------------
$ ./oclHashcat64.bin -b --force -m5600
@liftoff
liftoff / PeriodicTimerCallback
Created May 10, 2014 17:56
A simple periodic callback mechanism that uses the stdlib's threading.Timer
#!/usr/bin/env python3
"""
A periodic callback mechanism that uses `threading.Timer`.
"""
class PeriodicTimerCallback(object):
"""
A wrapper that uses either `threading.Timer` to call functions at a
#!/usr/bin/python
# -*- coding: utf-8 -*-
from random import Random
ⶻ=len
ج=int
ⶽ=sum
ܠ=str
ܓ=range
ش=object
import sys
@liftoff
liftoff / gist:2781721
Created May 24, 2012 14:00
Beaglebone LED blinker shell script
#!/bin/sh
LED=/sys/devices/platform/leds-gpio/leds/beaglebone\:\:usr1/brightness
while true; do
echo "1" > $LED
sleep 1
echo "0" > $LED
sleep 1
done
# Put this in /etc/init.d/ and create a link to it inside /etc/rc2.d and /etc/rc3.d as S05blinker
@liftoff
liftoff / gist:2790325
Created May 25, 2012 20:14
No recipes?
Executing: MACHINE=beagleboard bitbake cloud9-image
WARNING: /storage/beagleboard/setup-scripts/sources/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager_0.9.2.0.bb: it is recommended to set SYSTEMD_PACKAGES as <existing-package>-systemd | ETA: 00:01:40
NOTE: angstrom DOES NOT support libiconv because the eglibc provided iconv library is used############################################################################################### | ETA: 00:00:47
NOTE: angstrom DOES NOT support libiconv because the eglibc provided iconv library is used
WARNING: /storage/beagleboard/setup-scripts/sources/openembedded-core/meta/recipes-extended/lighttpd/lighttpd_1.4.30.bb: it is recommended to set SYSTEMD_PACKAGES as <existing-package>-systemd###### | ETA: 00:00:32
WARNING: /storage/beagleboard/setup-scripts/sources/meta-raspberrypi/recipes-core/systemd/rpi-zram-service.bb: it is recommended to set SYSTEMD_PACKAGES as <existing-p
@liftoff
liftoff / python-matplotlib_1.1.0.bb
Created May 30, 2012 02:15
matplotlib .bb file for OpenEmbedded/bitbake
DESCRIPTION = "matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats"
SECTION = "devel/python"
LICENSE = "PSF"
LIC_FILES_CHKSUM = "file://README.txt;md5=83c5bf8b16a5f99507f2f47a21ae3b81"
PR = "r1"
SRC_URI = "${SOURCEFORGE_MIRROR}/matplotlib/matplotlib-${PV}.tar.gz \
"
S = "${WORKDIR}/matplotlib-${PV}"
@liftoff
liftoff / collector.sh
Created August 23, 2012 18:31
A little script to catch the collectors
#!/bin/bash
#
# Description: Hello, World
# Author: Anu Bs <anu.bs@youknowwhat.com>
echo "Hello, World."
@liftoff
liftoff / htmltag.py
Last active December 16, 2015 03:49
htmltag.py - A simple module to wrap whatever string you want in HTML tags.
# -*- coding: utf-8 -*-
#
# Copyright 2013 Liftoff Software Corporation
#
# For license information see LICENSE.txt
# Meta
__version__ = '1.0.0'
__version_info__ = (1, 0, 0)
__license__ = "Apache 2.0"