Skip to content

Instantly share code, notes, and snippets.

View thefinn93's full-sized avatar

Finn thefinn93

View GitHub Profile

Keybase proof

I hereby claim:

  • I am thefinn93 on github.
  • I am finn (https://keybase.io/finn) on keybase.
  • I have a public key whose fingerprint is 39B2 9193 8DDA 08CB 7FD8 B848 319D B1ED 6874 2E2C

To claim this, I am signing this object:

@thefinn93
thefinn93 / getfbtoken.sh
Created March 5, 2014 03:50
Bash script to get Facespace login token
#!/bin/bash
# FILL THIS IN! Find or create your app at https://developers.facebook.com/apps
APP_ID=
# We output status to stderr so that the token can be piped in
output() { echo -e "$@" 1>&2; }
URL="https://www.facebook.com/dialog/oauth?client_id=$APP_ID"
@thefinn93
thefinn93 / dyndns.sh
Created January 7, 2015 06:40
Dynamic DNS Updater for Hurricane Electric with full v6 support and shit
#!/bin/bash
HOSTNAME=...
USERNAME=$HOSTNAME # Hurricane Electric expects the username to be the hostname
PASSWORD=...
DEVICE=eth0
SAVEFILE=/var/run/ddns-lastip
function update {
@thefinn93
thefinn93 / getAvailability.py
Created January 29, 2015 20:36
Check kimsufi's availability and emails you when they've got open slots. one argument, the sort code or identifier they use for the type of server. To get it, inspect their HTML, the <tr> has a property of data-ref with the value you need. It changes sometimes too
#!/usr/bin/env python
## Usage: ./getAvailability.py 150sk20
## Remember to fill in that shit down there first
import sys
import json
import requests
import time
import smtplib
SMTP_USERNAME = 'yep@lol.net'
@thefinn93
thefinn93 / exporter.py
Created May 4, 2015 23:52
Rivendell Exporter (and converter and ID3 tagger)
#!/usr/bin/env python
# Rivendell Exporter
# Copyright (C) 2015 Finn Herzfeld
#
# Rivendell Exporter is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rivendell Exporter is distributed in the hope that it will be useful,
@thefinn93
thefinn93 / hypedns.py
Created February 15, 2012 03:17
Update nodeinfo.hype from a text based interface
#!/usr/bin/env python
import httplib2
import sys
import json
from urllib import urlencode
h = httplib2.Http(".cache")
print "Please hold while we retrive your IP address..."
r,ip = h.request("http://[fc72:6c3b:8c74:68a7:d8c3:b4e0:6cbd:9588]/ip/","GET")
url = "http://[fc5d:baa5:61fc:6ffd:9554:67f0:e290:7535]/node/details/" + ip + "/save"
print "Looks like your IP is " + ip
@thefinn93
thefinn93 / IRC.java
Created February 16, 2012 04:38
Simple Java IRC bawt
package irc;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
public class IRC {
package portscanner;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Scanner;
public class PortScanner {
@thefinn93
thefinn93 / xkcd.xml
Created March 12, 2012 19:56
HTTPS everywhere ruleset
<ruleset name="xkcd">
<target host="xkcd.com" />
<target host="xkcd.org" />
<target host="*.xkcd.com" />
<target host="*.xkcd.org" />
<target host="www.store.xkcd.com" />
<rule from="^http://(www\.|m\.)?xkcd\.(?:com|org)/"
to="https://$1xkcd.com/" />
<rule from="^http://(?:www\.)?store\.xkcd\.com/"
@thefinn93
thefinn93 / cfddns.py
Created April 17, 2012 18:57
Cloudflare DDNS
#!/usr/bin/env python
import sys
try:
import requests
except:
"Install python requests asshole!"
sys.exit()
import json