Skip to content

Instantly share code, notes, and snippets.

Avatar

Emmanuel Goossaert goossaert

View GitHub Profile
View knock-knock.c
/******************************************************
* 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
Module that requires testing
View mainprogram.py
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
Wrapper module which caches data and runs the module to test
View wrapper.py
import sys
import traceback
import mainprogram
if __name__=='__main__':
cache = None
is_first_iteration = True