Skip to content

Instantly share code, notes, and snippets.

View agranig's full-sized avatar

Andreas Granig agranig

View GitHub Profile
@agranig
agranig / sip-client-auth.js
Created May 15, 2012 15:21
demo for client-side SIP digest response generation
// load extern script crypto-md5.js from https://code.google.com/p/crypto-js/ project here
// socket.io callback for SIP digest authentication request
// it passes the full SIP header www-authenticate or proxy-authenticate as json object,
// one might want to construct the ctx differently though, depending on the data format
socket.on('authentication-request', function (data) {
console.log('received authentication request', data);
var ctx;
if(data.response.status == 401)
ctx = data.response.headers['www-authenticate'][0];
@agranig
agranig / setup-gluster-sp1.sh
Created May 6, 2013 09:15
Bootstrap glusterfs on sp1
#!/bin/sh -ex
DIR1=/var/lib/glusterfs/export
DIR2=/tmp/export-tmp
VOL=ngcp
rm -rf $DIR1 $DIR2
mkdir -p $DIR1 $DIR2
umount /mnt/glusterfs 1>/dev/null 2>/dev/null || true
@agranig
agranig / setup-gluster-sp2.sh
Created May 6, 2013 09:16
Bootstrap glusterfs on sp2
#!/bin/sh -ex
DIR1=/var/lib/glusterfs/export
DIR2=/tmp/export-tmp
VOL=ngcp
rm -rf $DIR1 $DIR2
mkdir -p $DIR1 $DIR2
umount /mnt/glusterfs 1>/dev/null 2>/dev/null || true
@agranig
agranig / hitbox-stream
Created July 28, 2014 11:11
stream to hitbox.tv from your linux command line
# the key you get from http://www.hitbox.tv/settings/youruser/livestreams
HITBOX_KEY="youruser?key=xxxxx"
# top-left corner of capture window
CAPTURE_POS="250,200"
# width/height of capture window
CAPTURE_SIZE="1050x600"
# make sure to have a really recent ffmpeg version (0.10.12 works fine)
ffmpeg -f x11grab -show_region 1 \
-s ${CAPTURE_SIZE} -r 25 -i :0.0+${CAPTURE_POS} \

Keybase proof

I hereby claim:

  • I am agranig on github.
  • I am agranig (https://keybase.io/agranig) on keybase.
  • I have a public key whose fingerprint is C0ED 4FBF 6E1B 276A 2811 756F F06B 75A0 C504 5E98

To claim this, I am signing this object: