Skip to content

Instantly share code, notes, and snippets.

View Methimpact's full-sized avatar

methimpact Methimpact

View GitHub Profile
@revolunet
revolunet / xor.py
Created April 18, 2012 09:14
Simple python XOR encrypt/decrypt
#
# NB : this is not secure
# from http://code.activestate.com/recipes/266586-simple-xor-keyword-encryption/
# added base64 encoding for simple querystring :)
#
def xor_crypt_string(data, key='awesomepassword', encode=False, decode=False):
from itertools import izip, cycle
import base64
if decode:
@bussiere
bussiere / feneter.py
Created March 13, 2012 22:19
generate feneter in hacker style rulez
# todo :
# Pouvoir doubler les bords ou le haut ex : **
# Parser le html pour prendre que le affiché ex <a href="">titi</a> ne prendre que titi.
# ou encore recupérer la taille d'un formulaire.
# prevoir un systeme de ligne ou colonne aussi.
# Bussiere
string = ["totosdjfsdfsdfdsfsdfsdfsdfsdfsdft","titigsgsgsgsgsgsgs","tata"]
texte = """Qui n’a jamais eu besoin d’un coup de main, et aucune idée d’où trouver de l’aide ?
@mumrah
mumrah / http.awk
Created September 30, 2011 20:33
Incomplete HTTP server in Awk
BEGIN {
RS = ORS = "\r\n"
HttpService = "/inet/tcp/8000/0/0"
while(1) {
_NR = 0
while((HttpService |& getline) > 0) {
_NR += 1
handle_header($0)
}
close(HttpService)
@mumrah
mumrah / aggregate.awk
Created September 28, 2011 15:51
Use associative arrays to aggregate data with Awk
BEGIN {
FS=",";
OFS=",";
}
{
COUNTS[$1] += 1;
TOTALS[$1] += $2;
}
@e000
e000 / donotuse.py
Created June 13, 2011 23:30
How to NEVER use lambdas.
##########################################################
# How to NEVER use Lambdas. An inneficient and yet educa-#
# tonal guide to the proper misuse of the lambda constru-#
# ct in Python 2.x. [DO NOT USE ANY OF THIS EVER] #
# by: e000 (13/6/11) #
##########################################################
## Part 1. Basic LAMBDA Introduction ##
# Well, it's worth diving straight into what lambdas are.
# Lambdas are pretty much anonymous "one line" functions
@mumrah
mumrah / websocketserver.py
Created August 7, 2010 17:01
Simple WebSockets in Python
import time
import struct
import socket
import hashlib
import sys
from select import select
import re
import logging
from threading import Thread
import signal