Skip to content

Instantly share code, notes, and snippets.

View thefinn93's full-sized avatar

Finn thefinn93

View GitHub Profile
@thefinn93
thefinn93 / conffinder.py
Last active December 12, 2015 01:48
Frontier FiOS related stuff.
#!/usr/bin/env python
import telnetlib
import getpass
import ConfigParser
import os
import sys
## Configuration ##
# The default values are probably good

Graphs the number of active users on a subreddit. I just wrote this. You need add a list of subreddits you want graphed to your munin-node file (on debian/ubuntu it's in /etc/munin/plugin-conf.d/munin-node, probably other places on other distros), like such:

[reddit-usersonsub]
env.subs AdviceANimals,announcements,AskREddit,atheism,aww,bestof,blog,funny,gaming,IAmA,movies,Music,pics,politics,science,technology,todayilearned,videos,worldnews,WTF
@thefinn93
thefinn93 / 4exif.js
Created October 28, 2012 20:04
4chan find EXIF data
function exifcb(src, i, data) {
waitingon.pop(src);
if(waitingon.length) {
EXIFstatus.innerHTML = "Waiting on " + waitingon.length + " images...";
} else {
EXIFstatus.innerHTML = "";
}
if(data.length) {
showbutton = false
EXIFstatus.innerHTML += "<br />Found some EXIF data!";
@thefinn93
thefinn93 / cb.php
Created September 20, 2012 18:52
Reddit Oauth in PHP
<?
session_start();
if(isset($_REQUEST['state'])) {
if($_REQUEST['state'] != $_SESSION['state']) {
die("Oy, <a href=\"/reddit\">get yourself a proper state token, noob</a>");
}
} else {
die("Oy, <a href=\"/reddit\">get yourself a state token, noob</a>");
}
@thefinn93
thefinn93 / main.md
Created September 10, 2012 20:25 — forked from campadrenalin/main.md
Getting started with Meshnet

Getting started with Meshnet

This document is for people who want to help but have no technical knowledge. It assumes you won't be getting involved in squabbles over which relay technology to use, etc.

Step 1: Set up CJDNS

One of the few things widely agreed upon at the time of this writing is the use of CJDNS. Currently Windows is not supported, but if you have Linux or can run Linux in a virtual machine, you can follow the step-by-step instructions lower on that page to install and start up an instance of CJDNS on your system. If you're using Ubuntu 11.10 (latest version), you can follow these simplified instructions.

One thing you should know is cjdns currently isn't a wireless meshnet. A physical meshnet consisting of nodes geographically close to each other is a long way off. Instead, cjdns offers a "mixnet"-like system. cjdns is routable over the current Internet, so this means right now its like a giant VPN (virtu

@thefinn93
thefinn93 / callback.php
Created August 24, 2012 01:04
Reddit Oauth
<?
require_once("../requests/library/Requests.php"); // Get this from http://requests.ryanmccue.info/
Requests::register_autoloader();
$client_id = ""; // Get these from https://ssl.reddit.com/prefs/apps
$client_secret = "";
$code = $_GET['code'];
$access_token_url = "https://oauth.reddit.com/api/v1/access_token";
$options = array('auth' => array($client_id, $client_secret));
$token_request = Requests::post($access_token_url, array(), array("grant_type" => "authorization_code","code" => $code, "redirect_uri" => "https://www.thefinn93.com/reddit/cb"), $options);
$response = json_decode($token_request->body);
@thefinn93
thefinn93 / README.md
Created July 22, 2012 20:21
CJDNS Admin GUI

CJDNS Admin GUI

Allows access to the CJDNS Admin API via a GUI. Should be kept in a private, password protected location.

Dependencies

#!/usr/bin/env python
import wx
import os
class MainWindow(wx.Frame):
def __init__(self, parent, title):
self.dirname = ''
# A "-1" in the size parameter instructs wxWidgets to use the default size.
@thefinn93
thefinn93 / README.md
Last active October 22, 2015 10:08
Hyperboira Init Script

Note: This is old, sysvinit sucks. There used to be an updated version of this in the cjdns git, but it's gone now. Use systemd or upstart

Installation:

  1. Place hyperboria.sh in /etc/init.d/hyperboria
  2. chmod +x /etc/init.d/hyperboria
  3. update-rc.d hyperboria defaults

This will cause it to automatically start with your computer. You can control it with /etc/init.d/hyperboria . Some systems (Ubuntu, not sure about others) allow you to use the service command, which shortens the command to `service hyperboria

@thefinn93
thefinn93 / current.css
Created June 27, 2012 19:08
DarkNetPlan
.res-nightmode .usertext-body ul li p strong {color:navy;}
.res-nightmode .linkinfo * {color:white;}
.res-nightmode .linkinfo .upvotes * {color:orangeRed!important;}
.res-nightmode .linkinfo .downvotes * {color:#5f99cf!important;}
.res-nightmode label[for="subRedditStyleCheckbox"] {color:#ccc!important;}
/* Sets background of the header to maroon, removes the light blue bottom border */
#header {
background: #0064cd url(%%grid%%) top left repeat;
}
#sr-header-area {