Skip to content

Instantly share code, notes, and snippets.

View goossaert's full-sized avatar

Emmanuel Goossaert goossaert

View GitHub Profile
/******************************************************
* knock-knock 0.1 - GPL License v3.0
* Copyright (c) 2010 Emmanuel Goossaert
* emmanuel at goossaert dot com
*
* See also:
* - https://github.com/goossaert/algorithms/tree/master/port-knocking
* - http://codecapsule.com/2010/07/06/knock-knock-secure-your-ssh-server-using-port-knocking/
*
* Knock-knock is a daemon that implements port knocking
@goossaert
goossaert / mainprogram.py
Created May 24, 2012 17:59
Module that requires testing
def initialize():
# Create initialization data and take a lot of time
data = ...
return data
def method_to_test( data ):
# Code to test
...
@goossaert
goossaert / wrapper.py
Created May 24, 2012 17:57
Wrapper module which caches data and runs the module to test
import sys
import traceback
import mainprogram
if __name__=='__main__':
cache = None
is_first_iteration = True