Skip to content

Instantly share code, notes, and snippets.

View TobiX's full-sized avatar

Tobias Gruetzmacher TobiX

View GitHub Profile
@TobiX
TobiX / music-dup-finder.py
Last active August 29, 2015 14:03
Music duplicate finder
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os, sys
import acoustid
import xdg.BaseDirectory
import apsw
def setwal(db):
@TobiX
TobiX / kill-mcafee.user.js
Last active August 29, 2015 14:05
Convince Flash Player download page that McAfee is already installed (only works in Firefox)
// ==UserScript==
// @name Disable Flash McAfee Offer
// @icon https://get3.adobe.com/favicon.ico
// @namespace http://flash.mustdie.de/
// @include http*://get*.adobe.com/*flashplayer*
// @downloadURL https://gist.githubusercontent.com/TobiX/289db6350f1c60edd460/raw/kill-mcafee.user.js
// @version 5
// @grant none
// ==/UserScript==
@TobiX
TobiX / pre-commit
Created September 25, 2014 12:20
SVN commit hook that denies changing of tags.
#!/bin/sh
REPOS="$1"
TXN="$2"
SVNLOOK=/usr/bin/svnlook
# Make sure that the log message contains some text.
if ! $SVNLOOK log -t "$TXN" "$REPOS" | \
grep "[a-zA-Z0-9]" > /dev/null
@TobiX
TobiX / movember-everywhere.user.js
Last active August 29, 2015 14:08
Movember Everywhere Userscript
// ==UserScript==
// @name Movember everywhere!
// @namespace http://november.mustdie.de/
// @description Replace November with Movember
// @include *
// @version 6
// @downloadURL https://gist.github.com/TobiX/69b75e601b9bc0f39adf/raw/movember-everywhere.user.js
// @grant none
// ==/UserScript==
diff --git a/bravo/protocols/beta.py b/bravo/protocols/beta.py
index 05f2969..1cef167 100644
--- a/bravo/protocols/beta.py
+++ b/bravo/protocols/beta.py
@@ -259,6 +259,10 @@ class BetaServerProtocol(Protocol):
log.err(payload)
def connectionLost(self, reason):
+ packet = make_packet("chat",
+ message="%s left the game." % self.username)
import StringIO
from construct import *
import def_cstpool as CTPoolLib
import def_member as MemberLib
import re
import os
import copy
import pprint
class ClassDef():
#include <stdio.h>
int main(int argc, char **argv)
{
int use_icmp;
switch (argv[0][0]) {
case 'I':
use_icmp = 1;
break;
}
0000000: 0a00 000a 0004 4461 7461 0100 0a74 6875 ......Data...thu
0000010: 6e64 6572 696e 6700 0400 0a4c 6173 7450 ndering....LastP
0000020: 6c61 7965 6400 0001 322b bd4f 630a 0006 layed...2+.Oc...
0000030: 506c 6179 6572 0200 0a53 6c65 6570 5469 Player...SleepTi
0000040: 6d65 7200 0009 0006 4d6f 7469 6f6e 0600 mer.....Motion..
0000050: 0000 033f 646e bd64 e3ad 5bbf b412 05c2 ...?dn.d..[.....
0000060: 8f5c 293f 4edd ba44 523d db01 0008 4f6e .\)?N..DR=....On
0000070: 4772 6f75 6e64 0102 0008 4875 7274 5469 Ground....HurtTi
0000080: 6d65 0000 0200 0648 6561 6c74 6800 1403 me.....Health...
0000090: 0009 4469 6d65 6e73 696f 6e00 0000 0002 ..Dimension.....
@TobiX
TobiX / gist:4131070
Created November 22, 2012 13:00
Bugfix for SynCrtSock (SSL/no Content-Length)
--- SynCrtSock.pas.orig 2012-11-21 08:16:54.000000000 +0100
+++ SynCrtSock.pas 2012-11-22 13:43:38.000000000 +0100
@@ -938,6 +938,8 @@
// corresponding to the file (e.g. by calling GetMimeContentType() function
// from SynCommons supplyings the file name)
HTTP_RESP_STATICFILE = '!STATICFILE';
+ // While reading an HTTP response, read it in blocks of this size. 8K for now.
+ HTTP_RESP_BLOCK_SIZE = 8*1024;
/// create a TCrtSocket, returning nil on error
@TobiX
TobiX / SynCrtSock.pas.diff
Created December 18, 2012 15:49
Patch for WinInet error handling
Index: SynCrtSock.pas
===================================================================
--- SynCrtSock.pas (revision 53301)
+++ SynCrtSock.pas (working copy)
@@ -900,9 +900,12 @@
/// WinINet exception type
EWinINet = class(Exception)
+ private
+ fCode: Cardinal;