Skip to content

Instantly share code, notes, and snippets.

Christopher Peplin peplin

View GitHub Profile
@peplin
peplin / recipe.rb
Created Jul 10, 2010
S3 File Resource for Chef
View recipe.rb
# 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 / dupes.pl
Created Jun 16, 2014
Perl script to find duplicate filenames
View dupes.pl
#!/usr/bin/perl -w
use File::Find;
my %files;
my @dirs;
foreach $argnum (0 .. $#ARGV) {
push(@dirs, $ARGV[$argnum]);
}
@peplin
peplin / gist:2483204
Created Apr 24, 2012 — forked from agriffis/gist:2481292
.bashrc.virtualenvwrapper
View gist:2483204
# 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 Sep 10, 2016
A quick test for running the 2 pygatt backends in a coffee shop, connecting to any device we can and reading one characteristic
View pygatt_test.py
#!/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 / Makefile
Created Dec 4, 2010
Installation script for PyLucene
View Makefile
# 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 / combined_3des_key.py
Created Oct 9, 2015
Generate a combined 3DES key for DUKPT from two components
View combined_3des_key.py
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 Sep 27, 2013
Ford APA OpenXC Training Sessions
View training.mkd

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 Dec 16, 2015
Complete example "Hello Car" app for OpenXC
View AndroidManifest.xml
<?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 Mar 8, 2013
Fixed PKGBUILD for dl-fldigi-git package in Arch AUR - https://aur.archlinux.org/packages/dl-fldigi-git/
View gist:5114028
# 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"
You can’t perform that action at this time.