Skip to content

Instantly share code, notes, and snippets.

@tlamer
tlamer / factory.py
Last active August 1, 2017 14:15
factory example
#!/usr/bin/env python3
import abc
from abc import ABCMeta
class FactoryItem(metaclass=ABCMeta):
def __init__(self, data):
self.arg1 = int(data.split()[0])
self.arg2 = int(data.split()[2])
@tlamer
tlamer / test_vectors.py
Created September 26, 2014 14:28
aes test vectors
#!/bin/env python3
from Crypto.Cipher import AES
from binascii import hexlify, unhexlify
# test vectors
tv = [
{'src':'http://www.inconteam.com/software-development/41-encryption/55-aes-test-vectors#aes-cbc-128',
'key':b'2b7e151628aed2a6abf7158809cf4f3c',
'iv': b'000102030405060708090A0B0C0D0E0F',
#!/usr/bin/env bash
# tunnel browser to another box
# Copyright (c) 2013 Jason W Ryan
# The MIT License (MIT) http://opensource.org/licenses/MIT
user="<your_name>"
exip="XXX.XXX.XXX.XXX"
tunnel_id="$HOME/.local/tmp/tunnel_id"
-- Structure:
-- src_customers: id, name, address
-- dim_customers: id, name, address
-- Find new records
DROP TABLE IF EXISTS tmp_new;
CREATE TABLE tmp_new AS
@tlamer
tlamer / README.md
Last active August 29, 2015 13:58
[bash] General purpose Yes/No function

This is a general-purpose function to ask Yes/No questions in Bash, either with or without a default answer. It keeps repeating the question until it gets a valid answer.