Skip to content

Instantly share code, notes, and snippets.

View guilhem's full-sized avatar
Ohai!

Guilhem Lettron guilhem

Ohai!
View GitHub Profile
[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 / 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
@guilhem
guilhem / gist:8600683
Created January 24, 2014 16:25
Use pritunl API with ruby rest-client
auth = JSON.parse(RestClient.post "http://10.0.3.2:9700/auth/token", { 'username' => "admin", "password" => "admin"}.to_json, :content_type => :json, :accept => :json)
org = JSON.parse(RestClient.post "http://10.0.3.2:9700/organization", { 'name' => 'test'}.to_json , :auth_token => auth['auth_token'], :content_type => :json, :accept => :json)
JSON.parse(RestClient.get "http://10.0.3.2:9700/status", { :auth_token => auth['auth_token'], :content_type => :json})
@guilhem
guilhem / lxc-ubuntu
Last active December 28, 2015 05:29
lxc ubuntu template for /usr/local ?!?!!! change it
#!/bin/bash
#
# template script for generating ubuntu container for LXC
#
# This script consolidates and extends the existing lxc ubuntu scripts
#
# Copyright © 2011 Serge Hallyn <[email protected]>
# Copyright © 2010 Wilhelm Meier
[2013-10-11T16:57:08+00:00] INFO: service[tftpd-hpa] restarted
[2013-10-11T16:57:08+00:00] INFO: git[/opt/razor] sending restart action to service[razor] (delayed)
[2013-10-11T16:57:08+00:00] INFO: service[razor] restarted
[2013-10-11T16:57:08+00:00] INFO: template[/etc/init/razor.conf] sending stop action to service[razor] (delayed)
[2013-10-11T16:57:08+00:00] INFO: service[razor] stopped
[2013-10-11T16:57:08+00:00] INFO: template[/etc/init/razor.conf] sending start action to service[razor] (delayed)
[2013-10-11T16:57:08+00:00] INFO: service[razor] started
@guilhem
guilhem / gist:4964818
Created February 16, 2013 00:32
Nginx for radosgw
server {
listen 80;
server_name _;
client_max_body_size 100m;
location / {
fastcgi_pass_header Authorization;
fastcgi_pass_request_headers on;
@guilhem
guilhem / osd stacktrace
Created January 17, 2013 10:36
Ceph #2843
2013-01-17 11:25:43.017199 7fec1ff6e780 0 filestore(/var/lib/ceph/osd/ceph-2) mount FIEMAP ioctl is supported and appears to work
2013-01-17 11:25:43.017236 7fec1ff6e780 0 filestore(/var/lib/ceph/osd/ceph-2) mount FIEMAP ioctl is disabled via 'filestore fiemap' config option
2013-01-17 11:25:43.018036 7fec1ff6e780 0 filestore(/var/lib/ceph/osd/ceph-2) mount did NOT detect btrfs
2013-01-17 11:25:43.043559 7fec1ff6e780 0 filestore(/var/lib/ceph/osd/ceph-2) mount syncfs(2) syscall fully supported (by glibc and kernel)
2013-01-17 11:25:43.044050 7fec1ff6e780 0 filestore(/var/lib/ceph/osd/ceph-2) mount found snaps <>
2013-01-17 11:25:43.055493 7fec1ff6e780 0 filestore(/var/lib/ceph/osd/ceph-2) mount: enabling WRITEAHEAD journal mode: btrfs not detected
2013-01-17 11:25:43.148956 7fec1ff6e780 1 journal _open /dev/vdb fd 24: 10485760000 bytes, block size 4096 bytes, directio = 1, aio = 0
2013-01-17 11:25:43.154841 7fec1ff6e780 1 journal _open /dev/vdb fd 24: 10485760000 bytes, block size 4096 bytes, directio
@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'))
@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 [email protected]: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 / 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'