Skip to content

Instantly share code, notes, and snippets.

herrfz

Block or report user

Report or block herrfz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View starwars.py
import socket
addr_info = socket.getaddrinfo("towel.blinkenlights.nl", 23)
addr = addr_info[0][-1]
s = socket.socket()
s.connect(addr)
while True:
data = s.recv(500)
print(str(data, 'utf8'), end='')
View reverse_ipv6.py
# Python 3
def reverse_dotted_ipv6(address):
ADDR_HEX_LEN = 32
GROUP_LEN = 4
try:
splitted = address.replace('::', ':0000:').split(':') # check for grouping format
if len([x for x in splitted if len(x) != GROUP_LEN]) != 0:
return '(╯°□°)╯︵ ┻━┻)'
bytearray.fromhex(address.replace(':', '')) # check for non-hex character
@herrfz
herrfz / graphapi
Created May 27, 2014
toying around with graph api
View graphapi
{
"metadata": {
"name": "",
"signature": "sha256:05422648a49f22daa0f624f940cf7c2a837c449095c78bce172b4a5073a0084c"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
View keybase.md

Keybase proof

I hereby claim:

  • I am herrfz on github.
  • I am herrfz (https://keybase.io/herrfz) on keybase.
  • I have a public key whose fingerprint is 76B8 3730 D93D 983E 887F 109E 9E04 2CAA 0416 640D

To claim this, I am signing this object:

View nMAP_tests
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
View sklearn_stacking.py
from sklearn.base import BaseEstimator, TransformerMixin
class Transformer(BaseEstimator, TransformerMixin):
def __init__(self, fn):
self.fn = fn
def fit(self, X, y):
return self
def transform(self, X):
@herrfz
herrfz / Reuters.py
Last active Dec 18, 2017
Reuters-21578 keyword extraction
View Reuters.py
# Reuters-21578 dataset downloader and parser
#
# Author: Eustache Diemert <eustache@diemert.fr>
# http://scikit-learn.org/stable/auto_examples/applications/plot_out_of_core_classification.html
#
# Modified by @herrfz, get pandas DataFrame from the orig SGML
# License: BSD 3 clause
from __future__ import print_function
View AES.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* MCrypt API available online:
* http://linux.die.net/man/3/mcrypt
*/
#include <mcrypt.h>
@herrfz
herrfz / DMS tester
Created Jul 16, 2013
DMS test case example
View DMS tester
package com.triagnosys.dms.tester;
import one_thousand_things;
public class TestCases extends TestCase {
private static final String SOME_CONSTANTS;
public void testGetSession() throws AxisFault {
System.out.println("Testing DMS getSession");
@herrfz
herrfz / SOAP
Last active Dec 19, 2015
suds Python SOAP client
View SOAP
{
"metadata": {
"name": "soap_client"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
You can’t perform that action at this time.