Skip to content

Instantly share code, notes, and snippets.

@jonathanhculver
jonathanhculver / checkmail.py
Created December 14, 2012 02:02
Python script to check gmail for new email every minute and send to Arduino over serial.
import imaplib, serial, struct, time
class Mail():
def __init__(self):
self.user= 'USER'
self.password= 'PASS'
self.ser = serial.Serial('/dev/tty.usbmodem621', 9600)
self.M = imaplib.IMAP4_SSL('imap.gmail.com', '993')
self.M.login(self.user, self.password)

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@mbenedettini
mbenedettini / key_generation.py
Created November 30, 2011 15:56
Python implementation of Mifare AES-128 simmetric key diversification, as described in document AN10922
from Crypto.Cipher import AES
from bitstring import BitArray, Bits
(key, m) = (BitArray(hex='00112233445566778899AABBCCDDEEFF'), BitArray(hex='00000000000000000000000000000000'))
const_rb = BitArray(hex='00000000000000000000000000000087')
k0 = BitArray(hex=AES.new(key.bytes).encrypt(m.bytes).encode('hex'))
@kogakure
kogakure / .gitignore
Last active November 19, 2024 13:22
Git: .gitignore file for LaTeX projects
*.acn
*.acr
*.alg
*.aux
*.bak
*.bbl
*.bcf
*.blg
*.brf
*.bst