Skip to content

Instantly share code, notes, and snippets.

@jjones646
jjones646 / dce-sdn-setup.sh
Last active July 9, 2016 19:21
Basic setup script for downloading & compiling ns-3 modules using bake
#!/bin/bash
# Simple setup script for dce-python-sdn
#
# Use 'chmod +x dce-sdn-setup.sh' then run using './dce-sdn-setup.sh'
echo "installing mandatory packages"
sudo apt-get update
sudo apt-get install -y git hg python

Keybase proof

I hereby claim:

  • I am jjones646 on github.
  • I am jjones646 (https://keybase.io/jjones646) on keybase.
  • I have a public key whose fingerprint is 183F 365D E76C 5234 8B98 58B5 EF89 C0B1 B11F 9932

To claim this, I am signing this object:

@jjones646
jjones646 / MLX90614-example.cpp
Last active May 11, 2016 17:19
Example program showing how to get the temperature readings from an MLX90614 infrared temperature sensor using an mbed.
/*
* Example program showing how to get the temperature readings from
* an MLX90614 infrared temperature sensor using an mbed.
* http://www.haoyuelectronics.com/Attachment/GY-906/MLX90614.pdf
*
* Jonathan Jones
*/
#include "mbed.h"
#include "gy-906.h"
@jjones646
jjones646 / keylog_parse.py
Created May 10, 2016 17:02
Python script that prints out json formatted stats from log files of the logkeys program on linux. https://apps.ubuntu.com/cat/applications/logkeys
#!/usr/bin/env python
"""
Basic script that parses the default formatted log files from the
logkeys program on linux. Prints out json formatted stats.
https://apps.ubuntu.com/cat/applications/logkeys
"""
import re
import argparse
@jjones646
jjones646 / git-big-objects.sh
Created April 26, 2016 07:39
Shows a sorted list (decreasing by size) of objects in a repository's full commit history.
#!/bin/bash
# Shows you the largest objects in your repo's entire history. Just call this script after
# you cd into the repo you'd like to run it on.
#
# To save the results to a file, just redirect stderr to /dev/null, and then redirect
# stdout to the filename of your choice. Here's an example:
#
# ./git-big-objects.sh 2>/dev/null > sorted-git-objects.txt
@jjones646
jjones646 / 70-yubikey-u2f.rules
Last active May 21, 2016 00:15
Configuration examples for setting up a Yubikey for OTP+U2F+CCID and storing GPG keys for use with Ubuntu.
# Put this file in /etc/udev/rules.d/ and run this command:
# $ /etc/init.d/udev restart
# This file contains the udev rule for allowing access to a Yubikey for U2F authentication.
ACTION!="add|change", GOTO="yubikey_u2f_end"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0113|0114|0115|0116|0120|0402|0403|0406|0407|0410", TAG+="uaccess"
LABEL="yubikey_u2f_end"
@jjones646
jjones646 / git-tweaks.sh
Last active April 29, 2016 05:18
Basic shell script to set a few global git configurations for easier log filtering. After running, use the `git graph` command for viewing a repository's merge history.
#!/bin/bash
# git-tweaks.sh
# Setup a slick default 'git log' display
git config --global log.date relative
git config --global log.abbrevCommit true
git config --global format.pretty 'format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset"'
# Alias for 'git graph' since log.graph isn't a valid config
@jjones646
jjones646 / sphere-metadata.py
Last active March 31, 2016 02:11
Set an image's metadata for panoramic viewing using a different image as reference.
#!/usr/bin/env python2
import re
import struct
import argparse
import StringIO
import pyexiv2 as pe
from pprint import PrettyPrinter
from os.path import abspath, isfile
@jjones646
jjones646 / mksites.sh
Last active April 29, 2016 05:59
A bare-bones setup that generates the NGINX configurations needed for hosting multiple WordPress websites on a single host. Supports individual SSL control.
#!/usr/bin/env python2
import os
import re
import sys
import argparse
import configparser
import pystache
from os.path import abspath, isfile, islink, join