Skip to content

Instantly share code, notes, and snippets.

Emil Hernvall EmilHernvall

Block or report user

Report or block EmilHernvall

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 Test1-disassembled
Compiled from ""
public class Test1 {
public Test1();
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public static void main(java.lang.String[]);
import json
import pymysql
import pymysql.cursors
import os
import csv
from datetime import datetime
with open("data/premier-league/schema.json") as fh:
schema = json.loads(
fields = schema["fields"]
# -*- coding: utf-8 -*-
def columns_to_county(foo):
county = {}
county["id"] = int(foo[0])
county["name"] = foo[1]
county["lon"] = float(foo[3])
county["lat"] = float(foo[4])
return county

Keybase proof

I hereby claim:

  • I am emilhernvall on github.
  • I am aderyn ( on keybase.
  • I have a public key whose fingerprint is 8684 23E6 23E7 9338 7711 E0E1 5537 3432 E97B 576A

To claim this, I am signing this object:


Keybase proof

I hereby claim:

  • I am EmilHernvall on github.
  • I am aderyn ( on keybase.
  • I have a public key whose fingerprint is 5B7E 106F 7A1F B3B2 8236 78E1 398A 0566 9E87 493F

To claim this, I am signing this object:

EmilHernvall /
Last active Mar 8, 2018
Transparent proxy for rewriting web pages to include The Hoff
Install twisted (pip install twisted) and PIL (pip install PIL), and run the script.
On your gateway, run the following commands:
iptables -t nat -A PREROUTING -i br0 -s ! -p tcp --dport 80 -j DNAT --to
iptables -t nat -A POSTROUTING -o br0 -s -d -j SNAT --to
iptables -A FORWARD -s -d -i br0 -o br0 -p tcp --dport 8080 -j ACCEPT
Substitute for the computer running the proxy.
EmilHernvall /
Created Apr 10, 2013
Script for dynamically updating a route53 record when your external ip changes.
import boto.route53
import os
import sys
import urllib2
import time
def get_zone_id(r53, zone_name):
zone_result = r53.get_hosted_zone_by_name(zone_name)
if not zone_result:
View gist:2332678
import urllib2
import re
import base64
def searchForNext(str, unique):
d = 10
last = str[-d:]
print "searching for continuation of " + last
matches = []
for x in unique:
EmilHernvall /
Created Sep 29, 2011
Encode data as sound, and retrieve it using a FFT
class GlobalFormat(object):
def __init__(self): = 0x46464952 # RIFF
self.size = 0
self.type = 0x45564157 # WAVE
def as_bin(self):
return struct.pack("III",, self.size, self.type)
EmilHernvall / sudoku.c
Created Jun 24, 2011
sudoku solver written in c
View sudoku.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct grid_t_ {
unsigned int grid[81];
struct grid_t_ *next;
} grid_t;
typedef struct sub_t_ {
You can’t perform that action at this time.