Skip to content

Instantly share code, notes, and snippets.

View sigh, again
### Keybase proof
I hereby claim:
* I am jbdatko on github.
* I am jbdatko ( on keybase.
* I have a public key whose fingerprint is 6F33 342B C6CF D0C8 4DA0 C7CA F7C6 0BFB B3B9 9FA3
To claim this, I am signing this object:
jbdatko / totp.c
Last active Mar 22, 2017 — forked from syzdek/totp.c
View totp.c
* TOTP: Time-Based One-Time Password Algorithm
* Copyright (c) 2015, David M. Syzdek <>
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* 1. Redistributions of source code must retain the above copyright
jbdatko / cryptoshield_rfid.ino
Created Apr 6, 2015
RFID example for CryptoShield
View cryptoshield_rfid.ino
const int TAG_LENGTH = 13;
char tag[TAG_LENGTH + 2];
int index = 0;
void setup(){
memset(tag, 0, sizeof(tag));
void loop(){
jbdatko / cylon.ino
Created Oct 21, 2014
Cylon SAINTCON Blinky
View cylon.ino
#include <tlc_shifts.h>
#include <tlc_config.h>
#include <tlc_animations.h>
#include <tlc_fades.h>
#include <tlc_servos.h>
#include <Tlc5940.h>
#include <tlc_progmem_utils.h>
Blinky code for SAINTcon 2014
jbdatko / bbfsa.tex
Created Sep 21, 2014
BeagleBone for Secret Agents BibTeX entry
View bbfsa.tex
author = "Josh Datko",
title = "BeagleBone for Secret Agents",
publisher = "Packt Publishing",
year = 2014,
address = "Birmingham, UK",
month = "September",
url = ""
jbdatko /
Created Aug 29, 2014
Script to change hostnames on debian systems
if [[ "$#" -ne 1 ]]; then
echo "$0 usage: newhostname (run as root)"
exit 1
hostname $1
jbdatko / tpm_assertpp.c
Last active Aug 29, 2015
Asserts physical presence on the Atmel I2C TPM. Stop tcsd, send the command, and restart tcsd. Thanks to @theopolis for initial version of this code!
View tpm_assertpp.c
/* -*- mode: c; c-file-style: "gnu" -*-
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

Keybase proof

I hereby claim:

  • I am jbdatko on github.
  • I am jbdatko ( on keybase.
  • I have a public key whose fingerprint is B591 9B1A C713 5905 F466 9C84 7BFA 5031 BD2E DEA6

To claim this, I am signing this object:

jbdatko /
Created Nov 12, 2013
Example of pycrypto CCM mode
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
hdr = b'To your eyes only'
plaintext = b'Attack at dawn'
key = b'Sixteen byte key'
nonce = get_random_bytes(11)
cipher =, AES.MODE_CCM, nonce)
msg = nonce, hdr, cipher.encrypt(plaintext), cipher.digest()
jbdatko / fortune-message.el
Created Jul 9, 2013
Snippet to display a fortune in the mini-buffer
View fortune-message.el
(require 'fortune)
;; Be sure to set the following to your specific fortune files
(setq fortune-dir "~/.fortunes"
fortune-file "~/.fortunes/fortunes")
(defun fortune-message (&optional file)
"Display a fortune cookie to the mini-buffer.
If called with a prefix, it has the same behavior as `fortune'.
Optional FILE is a fortune file from which a cookie will be selected."
You can’t perform that action at this time.