Skip to content

Instantly share code, notes, and snippets.

Finn thefinn93

Block or report user

Report or block thefinn93

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thefinn93
thefinn93 / iptables.rule
Last active Mar 23, 2018
Finn's Amazing iptables Thing
View iptables.rule
# /etc/iptables.rules remove this line
*filter
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i enp5s0 -j DROP
-A FORWARD -i enp5s0 -p udp -m udp --dport 34197 -m state --state NEW -j ACCEPT
COMMIT
@thefinn93
thefinn93 / dblog.py
Created Nov 10, 2016
Weechat database logging script. Requirements: dataset and a driver to connect to your database.
View dblog.py
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Finn Herzfeld <finn@finn.io>
#
# This program 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
View npm-3.10.8-vorbis.txt
$ node_modules/.bin/npm install vorbis
> ogg@1.2.5 install /tmp/oggtest/node_modules/ogg
> node-gyp rebuild
make: Entering directory '/tmp/oggtest/node_modules/ogg/build'
CC(target) Release/obj.target/libogg/deps/libogg/src/framing.o
CC(target) Release/obj.target/libogg/deps/libogg/src/bitwise.o
AR(target) Release/obj.target/deps/libogg/ogg.a
COPY Release/ogg.a
@thefinn93
thefinn93 / node-debug.log
Created Oct 5, 2016
issues from installing node-vorbis
View node-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/tmp/oggtest/node_modules/.bin/npm',
1 verbose cli 'install',
1 verbose cli 'vorbis' ]
2 info using npm@3.10.8
3 info using node@v6.7.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
View vorbis-1.4.21.txt
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
View site.yml
---
# Playbook for SeaGL webserver
- hosts: all
roles:
- base
- tools
- security
- server
- role: letsencrypt
letsencrypt_webroot_path: /var/www/html
View FusionPBX non-free billing module integration.md

Pretending to be the non-free billing app

FusionPBX doesn't do billing or LCR out of the box, but one guy will sell you closed, proprietary, non-free billing and LCR modules that will integrate nicely into FusionPBX. To help with this, there are a number of places in the free FusionPBX codebase that run things that these non-free apps need. Obviously these are all completely undocumented, until now.

These work by checking for an app named "billing". Specifically, they look for the app_config.php file in the billing folder. The conditional usually looks like this:

@thefinn93
thefinn93 / exporter.py
Created May 4, 2015
Rivendell Exporter (and converter and ID3 tagger)
View exporter.py
#!/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 / getAvailability.py
Created Jan 29, 2015
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
View getAvailability.py
#!/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 / dyndns.sh
Created Jan 7, 2015
Dynamic DNS Updater for Hurricane Electric with full v6 support and shit
View dyndns.sh
#!/bin/bash
HOSTNAME=...
USERNAME=$HOSTNAME # Hurricane Electric expects the username to be the hostname
PASSWORD=...
DEVICE=eth0
SAVEFILE=/var/run/ddns-lastip
function update {
You can’t perform that action at this time.