Skip to content

Instantly share code, notes, and snippets.

View guilhem's full-sized avatar
Ohai!

Guilhem Lettron guilhem

Ohai!
View GitHub Profile
@guilhem
guilhem / settings.py
Created December 16, 2014 11:20
Load django settings from environment variables
ENV_PREFIX = 'PREFIX_'
# Load settings from environment variables
for key, value in os.environ.iteritems():
if key.startswith(ENV_PREFIX):
globals()[key.split(ENV_PREFIX)[1]] = value
[uwsgi]
virtualenv = /usr/share/python/virtualenv
module = app.wsgi:application
if-env = SUDO_USER
shared-socket = :80
http = =0
end-if =
if-not-env = SUDO_USER
@guilhem
guilhem / dh-venv
Created May 6, 2015 14:16
dh-venv vs dh-virtualenv
$ git ls-files | xargs wc -l
18 Makefile.PL
56 README.md
4 autoscripts/postinst-venv-compile
4 autoscripts/prerm-venv-clean
54 debian/changelog
1 debian/compat
22 debian/control
38 debian/copyright
13 debian/rules
@guilhem
guilhem / patch.diff
Created July 26, 2011 13:52
Patch dumpentity to specify entity
diff -urB -x .svn branches/upstream/branches/1.1-bugfixes//front/plugin_dumpentity.getcsv.php trunk//front/plugin_dumpentity.getcsv.php
--- branches/upstream/branches/1.1-bugfixes//front/plugin_dumpentity.getcsv.php 2011-07-12 18:28:18.318642139 +0200
+++ trunk//front/plugin_dumpentity.getcsv.php 2011-07-05 18:07:35.000000000 +0200
@@ -57,6 +57,10 @@
$table="";
}
+if (isset($_GET["entity"])) {
+ $entity = $_GET["entity"];
+}
@guilhem
guilhem / patch.diff
Created July 26, 2011 13:59
Big patch to plugin imp
diff -urB -x .svn branches/forge/trunk//hook.php trunk//hook.php
--- branches/forge/trunk//hook.php 2011-07-07 10:41:20.765282080 +0200
+++ trunk//hook.php 2011-07-07 10:41:20.755282080 +0200
@@ -58,7 +58,10 @@
"`update_computer_type` bool NOT NULL DEFAULT 1, ".
"`update_software_name` bool NOT NULL DEFAULT 1, ".
"`update_software_category` bool NOT NULL DEFAULT 1, ".
- " PRIMARY KEY (`ID`)) ENGINE=MyISAM DEFAULT CHARSET=utf8";
+ "`flat_entities` bool NOT NULL DEFAULT 0, ".
+ "`recursive` bool NOT NULL DEFAULT 1, ".
@guilhem
guilhem / gist:1443804
Created December 7, 2011 17:50
bug with disconnect
2011-12-07 18:41:36.758 Cappuccino [trace]: <iq xmlns='jabber:client' from='admin@************' to='admin@*****************/ArchipelController' id='3535' type='result'/>
4Unsafe JavaScript attempt to access frame with URL http://app.archipelproject.org/ from frame with URL http://welcome.archipelproject.org/?lang=en. Domains, protocols and ports must match.
Objective-J.js:3532011-12-07 18:41:57.810 Cappuccino [info]: avatars.plist recovered
POST http://****************:5280/http-bind 404 (Not Found)
Objective-J.js:3532011-12-07 18:41:57.938 Cappuccino [info]: XMPP is disconnecting
Objective-J.js:3532011-12-07 18:41:57.940 Cappuccino [info]: disconnecting...
Objective-J.js:3532011-12-07 18:41:57.952 Cappuccino [info]: XMPP connection is now disconnected
Objective-J.js:3532011-12-07 18:41:57.954 Cappuccino [info]: Successfuly disconnected.
[..]
[598294.583175] type=1400 audit(1323959419.654:215): apparmor="DENIED" operation="open" parent=8337 profile="/usr/lib/libvirt/virt-aa-helper" name="/data/vm/drives/17a2a2ac-2521-11e1-87f6-00259052a9b2/vm-137-disk-1.raw" pid=8815 comm="virt-aa-helper" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[598294.815450] type=1400 audit(1323959419.890:216): apparmor="STATUS" operation="profile_load" name="libvirt-17a2a2ac-2521-11e1-87f6-00259052a9b2" pid=8816 comm="apparmor_parser"
[598295.239032] device vnet2 entered promiscuous mode
[598295.241070] brVpnVm: port 3(vnet2) entering forwarding state
[598295.241074] brVpnVm: port 3(vnet2) entering forwarding state
[598295.244447] device vnet3 entered promiscuous mode
[598295.246645] brVpnVm: port 4(vnet3) entering forwarding state
[598295.246650] brVpnVm: port 4(vnet3) entering forwarding state
[598295.461507] brVpnVm: port 3(vnet2) entering forwarding state
@guilhem
guilhem / etcconfignetwork.example
Created April 10, 2012 08:54
add 2 Wan port to dir300 (ramips arch)
config interface 'wan'
option ifname 'eth0.2'
option proto 'dhcp'
option macaddr '14:d6:4d:bb:04:67'
config interface 'wan2'
option ifname 'eth0.3'
option proto 'dhcp'
option macaddr '14:d6:4d:bb:04:68'
@guilhem
guilhem / gist:3619010
Created September 4, 2012 09:17
#14 selenium plugin
** selenium log
2012-09-04 10:47:59.922:INFO:osjs.AbstractConnector:Started SocketConnector@0.0.0.0:4444
Sep 4, 2012 10:58:57 AM org.openqa.grid.internal.Registry removeIfPresent
WARNING: Proxy 'host :http://192.168.122.1:4444 time out : 300000' was previously registered. Cleaning up any stale test sessions.
Sep 4, 2012 10:58:57 AM org.openqa.grid.internal.Registry removeIfPresent
WARNING: Proxy 'host :http://192.168.122.1:4444 time out : 300000' was previously registered. Cleaning up any stale test sessions.
Sep 4, 2012 10:59:41 AM org.openqa.grid.internal.Registry removeIfPresent
WARNING: Proxy 'host :http://192.168.122.1:4444 time out : 300000' was previously registered. Cleaning up any stale test sessions.
@guilhem
guilhem / part.quake.py
Created October 5, 2012 14:01
Update guake function to manage unity
def get_final_window_rect(self):
"""Gets the final size of the main window of guake. The height
is the window_height property, width is window_width and the
horizontal alignment is given by window_alignment.
"""
screen = self.window.get_screen()
height = self.client.get_int(KEY('/general/window_height'))
width = 100
halignment = self.client.get_int(KEY('/general/window_halignment'))