Skip to content

Instantly share code, notes, and snippets.

@stesie
stesie / config.m4
Last active August 29, 2015 14:08
PHP get_method/call_method leak?
PHP_ARG_ENABLE(hello, whether to enable Hello
World support,
[ --enable-hello Enable Hello World support])
if test "$PHP_HELLO" = "yes"; then
AC_DEFINE(HAVE_HELLO, 1, [Whether you have Hello World])
PHP_NEW_EXTENSION(hello, hello.c, $ext_shared)
fi
@stesie
stesie / rakia-3pcc.diff
Created September 10, 2012 22:05
Patch against telepathy rakia 0.7.4 to make it support 3pcc INVITEs
diff -ur telepathy-rakia-0.7.4.orig/rakia/call-channel.c telepathy-rakia-0.7.4/rakia/call-channel.c
--- telepathy-rakia-0.7.4.orig/rakia/call-channel.c 2012-05-08 18:51:51.000000000 +0200
+++ telepathy-rakia-0.7.4/rakia/call-channel.c 2012-09-10 23:06:47.180994786 +0200
@@ -690,6 +690,7 @@
media_added_cb (RakiaSipSession *session, RakiaSipMedia *media,
RakiaCallChannel *self)
{
+ TpBaseChannel *bc = TP_BASE_CHANNEL(self);
TpCallContentDisposition disposition;
const gchar *name;
@stesie
stesie / voipspdy.py
Created October 3, 2012 14:50
N900 DBus monitory to increase CPU speed during VoIP calls
#! /usr/bin/python
import gobject
import dbus
import pyinotify
from dbus.mainloop.glib import DBusGMainLoop
class CpufreqController(pyinotify.ProcessEvent):
minfreq = 125000
def getMinfreq(self):
@stesie
stesie / gbo-to-rss.sed
Last active December 23, 2015 01:39
german-bash.org to RSS converter written in sed
#! /bin/sed -nf
#
# Generate RSS-Feed from http://www.german-bash.org/action/latest
#
# Copyright (C) 2008,2011 by Stefan Siegl <stesie@brokenpipe.de>
# License: GPLv3+
#
# Use it like this:
# wget -U "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100618 Iceweasel/3.5.9 (like Firefox/3.5.9)" \
# -q -O- "http://www.german-bash.org/action/latest" | gbo-to-rss
@stesie
stesie / notify-spy.py
Created September 14, 2013 12:35
DBus filter to capture notifications on Nokia N900 phone
import gobject
import dbus
from dbus.mainloop.glib import DBusGMainLoop
def msg_filter(_bus, msg):
if msg.get_member() != "Notify": return
args = msg.get_args_list()
print "%s:%s" % (args[3], args[4])
if __name__ == '__main__':
@stesie
stesie / karma-compile.el
Last active December 24, 2015 00:09
Little helper for GNU Emacs to "karma run"
(require 'ansi-color)
(defvar karma-buffer
"*karma-node-specs-buffer*")
(defun karma-compile ()
"Run Karma"
(interactive)
(shell-command "karma run" (get-buffer-create karma-buffer))
(display-buffer karma-buffer)
(with-current-buffer karma-buffer
@stesie
stesie / serverless-azure-functions-auth.patch
Created October 9, 2018 11:31
Patch against serverless-azure-functions to use credentials from ~/.azure/accessTokens.json
diff -ur a/node_modules/serverless-azure-functions/provider/azureProvider.js b/node_modules/serverless-azure-functions/provider/azureProvider.js
--- a/node_modules/serverless-azure-functions/provider/azureProvider.js 2018-10-09 11:53:42.151689784 +0200
+++ b/node_modules/serverless-azure-functions/provider/azureProvider.js 2018-10-09 13:18:20.771792944 +0200
@@ -5,6 +5,8 @@
const resourceManagement = require('azure-arm-resource');
const path = require('path');
const fs = require('fs');
+const os = require('os');
+const msRestAzure = require('ms-rest-azure');
const request = require('request');
@stesie
stesie / php-doc.el
Last active April 24, 2019 19:19
php doc block generator/extractor for emacs
;;; php-doc.el --- doc block generator/extractor for php
;; Copyright (C) 2010, 2013 Stefan Siegl <stesie@brokenpipe.de>
;; Maintainer: Stefan Siegl <stesie@brokenpipe.de>
;; Author: Stefan Siegl <stesie@brokenpipe.de>
;; Keywords: php docblock
;; Created: 2010
;; Modified: 2013-09-14
;; X-URL: https://gist.github.com/stesie
{ config, lib, pkgs, ... }:
let
extlinux-conf-builder =
import <nixpkgs/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix> {
pkgs = pkgs.buildPackages;
};
in
{
imports = [
Index: batman-adv-2013.4.0/bridge_loop_avoidance.c
===================================================================
--- batman-adv-2013.4.0.orig/bridge_loop_avoidance.c
+++ batman-adv-2013.4.0/bridge_loop_avoidance.c
@@ -351,7 +351,6 @@ static void batadv_bla_send_claim(struct
batadv_inc_counter(bat_priv, BATADV_CNT_RX);
batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES,
skb->len + ETH_HLEN);
- soft_iface->last_rx = jiffies;