Skip to content

Instantly share code, notes, and snippets.

View zone117x's full-sized avatar

Matthew Little zone117x

View GitHub Profile
@zone117x
zone117x / util.py
Created January 9, 2014 19:59
stratum-mining testing
import binascii
import struct
from hashlib import sha256
import ltc_scrypt
def ser_number(n):
# For encoding nHeight into coinbase
s = bytearray(b'\1')
while n > 127:
s[0] += 1
@zone117x
zone117x / stratum.js
Created April 11, 2014 07:07
haproxy-banning
var net = require('net');
var events = require('events');
var util = require('./util.js');
var SubscriptionCounter = function(){
var count = 0;
var padding = 'deadbeefcafebabe';
return {
@zone117x
zone117x / stats.js
Created April 11, 2014 19:04
Possible fix for when adding a new coin
var poolWorkerData = [];
var poolHashrateData = [];
var poolBlockData = [];
var poolWorkerChart;
var poolHashrateChart;
var poolBlockChart;
function buildChartData(data){
@zone117x
zone117x / mposCompatibility.js
Created April 27, 2014 19:52
mysql connection pool
var mysql = require('mysql');
var cluster = require('cluster');
module.exports = function(logger, poolConfig){
var mposConfig = poolConfig.shareProcessing.mpos;
var coin = poolConfig.coin.name;
//var connection;
@zone117x
zone117x / jackett-thepiratebay.xml
Last active August 29, 2015 14:19
Jackett torznab output for The Pirate Bay (for Sonarr)
<?xml version="1.0" encoding="UTF-8"?>
<rss version="1.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:torznab="http://torznab.com/schemas/2015/feed">
<channel>
<atom:link href="http://localhost:9117/" rel="self" type="application/rss+xml" />
<title>The Pirate Bay</title>
<description>The worlds largest bittorrent indexer</description>
<link>https://thepiratebay.se/</link>
<lanuage>en-us</lanuage>
<category>search</category>
<image>
{
"id": "121361",
"Actors": "|Emilia Clarke|Peter Dinklage|Kit Harington|Nikolaj Coster-Waldau|Lena Headey|Sophie Turner|Maisie Williams|Gwendoline Christie|Aidan Gillen|Iain Glen|Charles Dance|Jerome Flynn|Alfie Allen|Isaac Hempstead-Wright|Natalie Dormer|John Bradley|Conleth Hill|Michelle Fairley|Ed Skrein|Jonathan Pryce|Alexander Siddig|Nathalie Emmanuel|Liam Cunningham|Tom Wlaschiha|Iwan Rheon|Jacob Anderson|Gemma Whelan|Mark Addy|Indira Varma|Michiel Huisman|Nonso Anozie|Nell Tiger Free|Stephen Dillane|Rory McCann|Finn Jones|Ellie Kendrick|James Cosmo|Sibel Kekilli|Paul Kaye|Ciar\u00e1n Hinds|Thomas Sangster|Harry Lloyd|Sean Bean|Jason Momoa|Richard Madden|Jack Gleeson|Rose Leslie|Carice van Houten|Pedro Pascal|Tobias Menzies|Dean-Charles Chapman|Kerry Ingram|Michael McElhatton|Art Parkinson|Mackenzie Crook|Hannah Murray|Amrita Acharia|Aimee Richardson|Eugene Simon|Ron Donachie|Lino Facioli|Elyes Gabel|Oona Chaplin|Kate Dickie|Peter Vaughan|Patrick Malahide|Natalia Tena|Julian Glover|Joe Dempsie|Kris
@zone117x
zone117x / gist:6940205f1bb645ae4f84
Created May 17, 2015 02:40
Series Aggregation Request Tree
/*
* |- Fanart
* |- Trakt
* |- TVRage
* |- TVcom
* |- TMDB
* |- OMDB
* |- TVDB
* |- Fanart
* |- OMDB
@zone117x
zone117x / gist:c32c03a7ad42a8dcecd7
Last active August 29, 2015 14:21
Syndicate service aggregation output for "Game of Thrones"
{
"status": "success",
"data": {
"show": {
"id": {
"imdb": "tt0944947",
"tmdb": 1399,
"tvcom": "game-of-thrones",
"tvrage": 24493,
"tvdb": 121361,
@zone117x
zone117x / gist:8187500dfa777b1d527e
Created May 21, 2015 02:06
Syndicate service aggregation output for "The Flash 2014"
{
"status": "success",
"data": {
"show": {
"id": {
"imdb": "tt3107288",
"tmdb": 60735,
"tvcom": "the-flash-2014",
"tvrage": 36939,
"tvdb": 279121,
var db = knex({
client: 'pg',
connection: {
host: 'localhost',
port: 5432,
user: 'postgres',
password: 'test',
database: 'syndicate'
},
debug: true