Skip to content

Instantly share code, notes, and snippets.

@phihag
phihag / gist:1859087
Created February 18, 2012 12:29
Thread safety demo
#!/usr/bin/env python
import os
import subprocess
import sys
from threading import Thread
from time import sleep
@phihag
phihag / thread-safety-debian.py
Created February 19, 2012 17:44
Thread safety demo on debian
#!/usr/bin/env python
import os
import subprocess
import sys
from threading import Event, Thread
from time import sleep
@phihag
phihag / emptyfile.js
Created March 20, 2012 12:35
Empty file written - demo code
var fs = require('fs');
var file_tree = ['test1.txt', 'test2.txt'];
var data = ['d1', 'd2'];
for(i in file_tree) {
fp = fs.createWriteStream(file_tree[i]);
for(i in data) {
@phihag
phihag / chroot-breakout.py
Created April 5, 2012 17:36
Break out of chroot - Demo
import os
os.chroot('/tmp')
os.chroot('../../')
print(os.listdir('/'))
14x arduino uno Rev3
24,40€ http://www.watterott.com/de/Arduino-Uno
15x arduino Proto Shield - Wireless SD Shield
23,68€ http://www.watterott.com/de/Shield-Wireless-SD-Shield
14x Digi XB24-AWI-001
25,95€ http://www.reichelt.de/Bausaetze-Module/ZIGBEE-XBEE-D/index.html?ACTION=3&GROUPID=3636&ARTICLE=108350&SHOW=1&START=0&OFFSET=16&
arduino-Netzworkemulator
Entwickeln eines Emulators für <a
href="http://arduino.cc/">arduino</a> und IEEE 802.15.4-Netzwerke
<p><a href="http://arduino.cc/">arduino</a> ist eine
Hardware-Plattform für einfache Computer, z.B. Sensorknoten,
diff -r 9d3609c787c4 build_debian.sh
--- a/build_debian.sh Tue May 08 12:35:21 2012 +0200
+++ b/build_debian.sh Tue May 08 13:32:19 2012 +0200
@@ -144,6 +144,11 @@
bin/python bootstrap.py -c buildout_${buildout_variant}.cfg
bin/buildout -Nc buildout_${buildout_variant}.cfg
+# Pull and update adhocracy changes.
+# Since this script is targeting test users / new developers, we do want this.
+# Because experienced developers may not want the behavior, we do *not* set always-update = true for all users in buildout_development.cfg
@phihag
phihag / gist:3171335
Created July 24, 2012 17:25
diff -u sudo-1.8.4p4 sudo-1.8.4p5
For more context, see http://www.sudo.ws/sudo/alerts/netmask.html .
diff -u -r sudo-1.8.4p4/plugins/sudoers/match_addr.c sudo-1.8.4p5/plugins/sudoers/match_addr.c
--- sudo-1.8.4p4/plugins/sudoers/match_addr.c 2012-03-12 19:02:11.000000000 +0100
+++ sudo-1.8.4p5/plugins/sudoers/match_addr.c 2012-05-11 21:47:59.000000000 +0200
@@ -92,6 +92,7 @@
}
if (j == sizeof(addr.ip6.s6_addr))
debug_return_bool(true);
+ break;
@phihag
phihag / ssp-simplify-cookie-parsing.diff
Created August 8, 2012 15:46
Fix cookie parsing in socialshareprivacy.js
@phihag
phihag / gist:3304262
Created August 9, 2012 13:41
buildout log
While:
Installing.
Getting section sphinxbuilder.
Initializing section sphinxbuilder.
Installing recipe collective.recipe.sphinxbuilder.
Error: There is a version conflict.
We already have: Jinja2 2.6
*************** PICKED VERSIONS ****************
[versions]
collective.recipe.sphinxbuilder = 0.7.1