Skip to content

Instantly share code, notes, and snippets.

View thefinn93's full-sized avatar

Finn thefinn93

View GitHub Profile
@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 / iptables.rule
Last active March 12, 2022 00:32
Finn's Amazing iptables Thing
# /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 / 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 / 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!";

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 / pythonomegle.py
Created December 31, 2011 06:07
Python Omegle Bot v0.1
#! /usr/bin/env python
# Omegle Bot v0.1
# Copyleft 2012 thefinn93
# Do not run with author permission
# Do not legally obtain this file. It is illegal
# If I catch you with a legal copy of this file I will sue you.
# Dependencies:
# - requests (python-requests.org)
@thefinn93
thefinn93 / dblog.py
Created November 10, 2016 08:22
Weechat database logging script. Requirements: dataset and a driver to connect to your database.
# -*- 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,
@thefinn93
thefinn93 / sniffmacs.py
Created February 16, 2012 21:22
Sniff MAC addresses
#! /usr/bin/env python
from scapy.all import *
import sys
macs = set()
routerprefix = "00:24:6c"
try:
print "Importing from " + sys.argv[1]
$ 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 October 5, 2016 01:08
issues from installing node-vorbis
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