Skip to content

Instantly share code, notes, and snippets.

View peplin's full-sized avatar

Christopher Peplin peplin

View GitHub Profile
@peplin
peplin / Makefile
Created December 4, 2010 23:29
Installation script for PyLucene
# Makefile for building PyLucene
#
# Supported operating systems: Mac OS X, Linux and Windows.
# See INSTALL file for requirements.
# See jcc/INSTALL for information about --shared.
#
# Steps to build
# 1. Edit the sections below as documented
# 2. make
# 3. make install
@peplin
peplin / dupes.pl
Created June 16, 2014 13:27
Perl script to find duplicate filenames
#!/usr/bin/perl -w
use File::Find;
my %files;
my @dirs;
foreach $argnum (0 .. $#ARGV) {
push(@dirs, $ARGV[$argnum]);
}
@peplin
peplin / recipe.rb
Created July 10, 2010 01:30
S3 File Resource for Chef
# Source accepts the protocol s3:// with the host as the bucket
# access_key_id and secret_access_key are just that
s3_file "/var/bulk/the_file.tar.gz" do
source "s3://your.bucket/the_file.tar.gz"
access_key_id your_key
secret_access_key your_secret
owner "root"
group "root"
mode 0644
end
@peplin
peplin / gist:2483204
Created April 24, 2012 20:05 — forked from agriffis/gist:2481292
.bashrc.virtualenvwrapper
# Dynamically load virtualenvwrapper functions to reduce shell startup
# time.
#
# Copyright 2012 Aron Griffis <aron@arongriffis.com>
# Released under the GNU GPL v3
#######################################################################
# Python virtualenvwrapper loads really slowly, so load it on demand.
if [[ $(type -w workon) != "workon: function" ]]; then
virtualenv_funcs=( workon deactivate mkvirtualenv )
@peplin
peplin / pygatt_test.py
Created September 10, 2016 17:28
A quick test for running the 2 pygatt backends in a coffee shop, connecting to any device we can and reading one characteristic
#!/usr/bin/env python
from __future__ import print_function
import logging
logging.basicConfig()
logging.getLogger('pygatt').setLevel(logging.INFO)
import binascii
import pygatt
@peplin
peplin / combined_3des_key.py
Created October 9, 2015 18:36
Generate a combined 3DES key for DUKPT from two components
from __future__ import print_function
from Crypto.Cipher import DES3
import os
import binascii
def xor_bytes(this, that):
return bytearray([ord(x) ^ ord(y) for x, y in zip(this, that)])
@peplin
peplin / training.mkd
Created September 27, 2013 15:34
Ford APA OpenXC Training Sessions

OpenXC Introduction

Length: 1 hour

OpenXC is an API to your car - by installing a small hardware module to read and translate metrics from a car's internal network, the data becomes accessible from most Android applications using the OpenXC library. You can start making vehicle-aware applications that have better interfaces based on context, can minimize distraction while driving, are integrated with other connected services, and can offer you more insight into your car's operation. This session presents a high level introduction to the OpenXC platform appropriate for engineers, business, IT, marketing, etc. The presentation will explain what OpenXC is and what was the motivation for creating the project at Ford and for releasing it as open source hardware and software. The high-level architecture of OpenXC will be detailed (Android apps, an DIY-friendly vehicle interface and a standardized data format) and some basic vehicle data concepts explained (like the CAN bus and read vs. write capabilities). The

@peplin
peplin / AndroidManifest.xml
Last active December 16, 2015 16:40
Complete example "Hello Car" app for OpenXC
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
@peplin
peplin / gist:5114028
Created March 8, 2013 03:33
Fixed PKGBUILD for dl-fldigi-git package in Arch AUR - https://aur.archlinux.org/packages/dl-fldigi-git/
# Contributor: [Philip Crump](mailto:pdc1g09@soton.ac.uk) aka M0DNY
# Maintainer: [Philip Crump](mailto:pdc1g09@soton.ac.uk) aka M0DNY
pkgname=dl-fldigi-git
#pkgver=3.21.36
pkgver=20130307
pkgrel=1
pkgdesc="Tracking Program for UK HAB Launches by James Coxon"
arch=('i686' 'x86_64')
url="https://github.com/jamescoxon/dl-fldigi"
input.png