Skip to content

Instantly share code, notes, and snippets.

View fuglede's full-sized avatar
🥔

Søren Fuglede Jørgensen fuglede

🥔
View GitHub Profile

Keybase proof

I hereby claim:

  • I am fuglede on github.
  • I am fuglede (https://keybase.io/fuglede) on keybase.
  • I have a public key whose fingerprint is 4560 36D0 6FED EABD 4357 FBEB EFCA 098B EBC6 A163

To claim this, I am signing this object:

@fuglede
fuglede / gist:0ad462ab5ccb59509f05
Created March 7, 2015 19:24
Doubling and adding 1
# Implementation of this algorithm:
# https://www.reddit.com/r/mathriddles/comments/2v6eaj/doubling_and_adding_1/coey1j7
#
# Save the code as filename.py. Then run something like
# python filename.py 8 1
import sys
def getL(k):
L=1
@fuglede
fuglede / fifteen.py
Last active August 29, 2015 14:22
15 the game
"""
A game where two players take turns choosing different numbers in
1, ..., 9 until one player has chosen three numbers that sum to 15,
thereby winning the game. If all numbers are chosen without any player
winning, the game is declared a tie.
"""
import itertools
@fuglede
fuglede / agarWithFriends.js
Created June 20, 2015 20:54
Agar with friends
// How to play with your friends on agar:
// 1) Paste the script below into the console.
// 2) Find some entries with the same IP.
// 3) Run one of the commands yourself and give the
// others to the people you want to play with
// 4) Repeat until you end up on the same server.
function makeServerList() {
jQuery.ajax("https://m.agar.io/", {
success: function(a) {
@fuglede
fuglede / kommuner
Last active August 29, 2015 14:24
Danske kommunale hjemmesider vs. SSLv3
aabenraa.dk
aalborg.dk
aarhus.dk
aeroekommune.dk
albertslund.dk
alleroedkommune.dk
assens.dk
ballerup.dk
billund.dk
brk.dk
@fuglede
fuglede / _revocation-plot.md
Last active August 29, 2015 14:26
Plot number of revoked Nets certs

Nets certificate revocation plot

This creates a plot of the number of revoked Nets certificates over time, getting the data from the revocation lists themselves. Run getdata.sh to get the data and crl.py to plot it.

@fuglede
fuglede / _https-e-count.md
Last active February 18, 2016 17:30
HTTPS Everywhere ruleset count

HTTPS Everywhere ruleset count

Creating

Put all files in the HTTPS Everywhere git repository. Run get_count.sh, then plot_count.py.

@fuglede
fuglede / sillycerts.py
Last active August 29, 2015 14:27
Create RSA keys containing given strings
#!/usr/bin/env python
"""
This script contains a function to create RSA key pairs whose base64
representation contains a prescribed string. I can't claim originality of
the idea behind this as I discovered it originally on /r/crypto some time
ago. I wish I remembered who the original author was, so I could give credit
where it is due: please let me know if you know about the original.
The keys can then be embedded into X.509 certificates for use in SSL
@fuglede
fuglede / fetchoces.sh
Last active October 3, 2015 21:06
Fetch OCES certificates
#!/bin/bash
LDAPSERVER="ldap://crtdir.certifikat.dk";
OUTPUTFILE="nemidcert.cer";
INTERMEDIATEFILE="intermediate.cer";
COMBINEDFILE="combined.cer";
# Check for ldapsearch and curl
command -v ldapsearch >/dev/null 2>&1 || {
echo "This script needs ldapsearch. In Debian 8, you can get this through 'apt install ldapscripts'." >&2;
@fuglede
fuglede / _jones_polynomial_comparison.md
Last active September 17, 2015 09:20
Jones polynomial algorithm comparison

Jones polynomial algorithm comparison

We compare the run times of two algorithms for calculating Jones polynomials, as currently contained in sage. One goes through computing Markov traces of the Jones representation of braids whose trace closures are the relevant links. This is contained in braid.py. The other uses the Kauffman bracket of a PD code of the link. This is contained in link.py. We will refer to these two algorithms as the "Jones representation" and the "State sum" algorithm respectively.

At the end of the day, we want a decision algorithm which takes a link, given either by its PD code or as the closure of a braid, and tells us which of the two algorithms one should use. Below we illustrate that in the case of braid closures, the output of this decision should depend on the number of crossings in the braid, the number of strands, as well as the dynamical complexity of the braid.

Methodology