Skip to content

Instantly share code, notes, and snippets.

View derlinkshaender's full-sized avatar

Armin Hanisch derlinkshaender

View GitHub Profile
@derlinkshaender
derlinkshaender / groupme.py
Last active January 31, 2018 13:09
Group a list of numbers
from random import shuffle
def partition(lst, n):
division = len(lst) / float(n)
shuffle(lst)
return [ lst[int(round(division * i)): int(round(division * (i + 1)))] for i in range(n) ]
startnumber = 1
stopnumber = 24
@derlinkshaender
derlinkshaender / README.rst
Created July 14, 2013 20:16
Log message to graylog using Python and the graypy package.

graylogger

Introduction

graylogger is a python script born out of necessity. Use graylogger.py to send GELF-formatted messages to a graylog host. You may log string messages, file contents or read from stdin, add additional fields. Host name and timestamp will be provided