Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View thefinn93's full-sized avatar

Finn thefinn93

View GitHub Profile
@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"

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 / README.md
Last active November 21, 2021 21:13
This is a simple scraper for https://chat.meatspac.es

Meatspaces Chat Scraper

This is a quick scraper I threw together for Meatspaces Chat. The database is likely the least efficient way of doing it, but that's what pull requests are for. You need python-mysqldb (in the debian repos under that name, here's the official page) and socketIO-client (install with pip/easy_install: sudo pip install socketIO-client). Fill in the save path to the place you want the images saved and the database credentials.

@thefinn93
thefinn93 / listpeers.py
Created September 11, 2013 01:56
List cjdns peers connected.
#!/usr/bin/env python
import sys
import subprocess
try:
import cjdnsadmin
except:
print "Failed to find cjdnsadmin in the normal search path. Hax in progress..."
sys.path.append("/opt/cjdns/contrib/python/cjdnsadmin")
@thefinn93
thefinn93 / updategit.sh
Created September 8, 2013 23:47
git updater.
#! /bin/bash
TOKEN=xxx
cd $1
branch=$(git describe --contains --all HEAD)
if [ "`git ls-remote origin -h refs/heads/$branch | cut -c1-40`" != "`cat .git/refs/heads/$branch`" ];
then
BASENAME=$(basename $1)
HOSTNAME=$(hostname)
git pull
curl "https://www.thefinn93.com/push/send?token=$TOKEN&title=Updated%20$BASENAME%20on%20$HOSTNAME&message=Updated%20$BASENAME%20on%20%$HOSTNAME%20to%20$(cat .git/refs/heads/$branch)"
@thefinn93
thefinn93 / rebuild-openwrt.sh
Last active December 21, 2015 10:09
If ran from an openwrt buildroot, will rebuild openwrt and launch it in qemu. Don't forget to Target System → MIPS Malta CoreLV board (qemu). And of course change the paths in lines 2 and 3
#!/bin/bash
disk="/home/finn/openwrt/bin/malta/openwrt-malta-be-vmlinux-initramfs.elf"
cd ~/openwrt
git pull
scripts/feeds update
scripts/feeds install -a
make -j3 V=s || exit 1
sudo qemu-system-mips -kernel $disk -nographic -m 256 -append "init=/sbin/init" -net nic
@thefinn93
thefinn93 / yubikeychecker.py
Created August 20, 2013 16:00
A simple script to check the validity of a Yubikey OTP
#!/usr/bin/env python
import sys
import os
import ConfigParser
try:
import yubico_client
except:
print "Whoops! Missing yubikey library."
@thefinn93
thefinn93 / installtor.sh
Last active December 21, 2015 06:38
Tor Browser Bundle installer
#!/bin/bash
version=2.3.25-12-dev
locale=en-US
arch=$(uname -p)
url=https://www.torproject.org/dist/torbrowser/linux/tor-browser-gnu-linux-$arch-$version-$locale.tar.gz
@thefinn93
thefinn93 / cjdnsadminmaker.py
Last active December 20, 2015 06:29
.cjdnsadmin creator
#!/usr/bin/env python
import json
import os
import sys
import subprocess
# possibly search for running cjdroute processes and check the same folder as they're in
# and/or running find on the home folder
@thefinn93
thefinn93 / github.php
Created May 17, 2013 04:06
A php script to pull from git whenever it is called (from approved IPs). It's meant to be a github service hook.
<?
$github_ips = array("207.97.227.253/32", "50.57.128.197/32", "108.171.174.178/32", "50.57.231.61/32", "204.232.175.64/27", "192.30.252.0/22");
function cidr_match($ip, $cidr) {
list($subnet, $mask) = explode('/', $cidr);
if ((ip2long($ip) & ~((1 << (32 - $mask)) - 1) ) == ip2long($subnet))
{
return true;
}