Skip to content

Instantly share code, notes, and snippets.

View liftoff's full-sized avatar

Dan McDougall liftoff

View GitHub Profile
@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 / xcb_screenshot.py
Last active January 21, 2021 10:51
An example of how to capture a screenshot using xpyb (xcb bindings for Python). UPDATED 2013-02-13: Now using PIL's Image.frombuffer() method on the raw image data object given by xcb. It is an order of magnitude faster than converting the xcb object to a Python string and using PIL's Image.fromstring().
#!/usr/bin/env python
"""
An example demonstrating how to use xpyb (xcb bindings for Python) to take a
full-screen screenshot.
"""
# Meta
__version__ = '1.0'
__version_info__ = (1, 0)
@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"
#!/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
@liftoff
liftoff / split_ca_cert.py
Created May 14, 2014 14:29
Split up and/or remove duplicate certificates from a PEM-formatted CA bundle (e.g. ca-bundle.crt)
#!/usr/bin/env python
"""
Split up and remove duplicate CA certificates from a bundle (e.g.
ca-bundle.crt).
.. note::
This script will preserve comments and certificate metadata at
the expense of possibly missing duplicates (that don't have the