Skip to content

Instantly share code, notes, and snippets.

View thefinn93's full-sized avatar

Finn thefinn93

View GitHub Profile
finn@wash  /tmp/oggtest  npm install vorbis
npm WARN package.json oggtest@1.0.0 No description
npm WARN package.json oggtest@1.0.0 No repository field.
npm WARN package.json oggtest@1.0.0 No README data
-
> ogg@1.2.5 install /tmp/oggtest/node_modules/vorbis/node_modules/ogg
> node-gyp rebuild
make: Entering directory '/tmp/oggtest/node_modules/vorbis/node_modules/ogg/build'
CC(target) Release/obj.target/libogg/deps/libogg/src/framing.o
---
# Playbook for SeaGL webserver
- hosts: all
roles:
- base
- tools
- security
- server
- role: letsencrypt
letsencrypt_webroot_path: /var/www/html
@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

@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;
}