Skip to content

Instantly share code, notes, and snippets.

SELECT sch.id, sch.title, shift.id, shift.begin, shift.end, shift.unwanted as w, u.username
FROM shiftmanager_schedule sc
JOIN shiftmanager_schedule_shifts sh ON (sc.id = sh.schedule_id)
JOIN shiftmanager_shift shift ON (shift.id IN (SELECT temp.shift_id FROM shiftmanager_schedule_shifts temp WHERE temp.schedule_id = sh.id)
JOIN aktive_verv ON (av.medlem_id = shift.owner_id)
JOIN auth_user u ON (av.medlem_id = u.id)
WHERE av.medlem_id = 1012912;
SELECT sc.id, sc.title, sh.id, shift.begin, shift.end, shift.unwanted as w, u.username
FROM shiftmanager_schedule sc
JOIN shiftmanager_schedule_shifts sh ON (sc.id = sh.schedule_id)
JOIN shiftmanager_shift shift ON (shift.id = sh.id)
JOIN auth_user u ON (shift.owner_id = u.id)
WHERE sc.owned_by_id IN(
SELECT sch.owned_by_id
FROM aktive_verv av
JOIN shiftmanager_schedule sch ON (sch.owned_by_id = av.gruppe_id)
WHERE av.medlem_id = 1012912) OR sc.owned_by_id IN (SELECT sc.owned_by_id FROM shiftmanager_shift shift
:1,2s/\(.*\)\(","HOVED ORD"$\)/\1 & \2/
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
36 bytes from 193.156.90.50: Communication prohibited by filter
Vr HL TOS Len ID Flg off TTL Pro cks Src Dst
4 5 00 5400 cd1d 0 0000 3a 01 24f5 192.168.95.194 160.68.205.231
@hermansc
hermansc / gist:1669227
Created January 24, 2012 09:23
Render GLUT
int SIZE = 1;
bool UP;
void Render() {
// Clean up the colour of the window and the depth buffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
2012-02-16 00:57:42.238 /kontakt/handlehealthform/ 200 1487ms 7kb Opera/9.80 (Macintosh; Intel Mac OS X 10.6.6; U; en) Presto/2.10.229 Version/11.61
129.241.159.164 - - [15/Feb/2012:15:57:42 -0800] "POST /kontakt/handlehealthform/ HTTP/1.1" 200 7906 "http://www.fornebuklinikken.no/kontakt/" "Opera/9.80 (Macintosh; Intel Mac OS X 10.6.6; U; en) Presto/2.10.229 Version/11.61" "www.fornebuklinikken.no" ms=1487 cpu_ms=838 api_cpu_ms=324 cpm_usd=0.024305 instance=00c61b117c4415adeab6728d0f46d3a04ab4
2012-02-16 00:57:42.230
Saved; key: __appstats__:060700, part: 111 bytes, full: 51593 bytes, overhead: 0.001 + 0.051; link: http://www.fornebuklinikken.no/_ah/stats/details?time=1329350260763
2012-02-16 00:57:41.441 /_ah/queue/deferred 200 150ms 0kb AppEngine-Google; (+http://code.google.com/appengine)
0.1.0.2 - - [15/Feb/2012:15:57:41 -0800] "POST /_ah/queue/deferred HTTP/1.1" 200 84 "http://www.fornebuklinikken.no/kontakt/handlehealthform/" "AppEngine-Google; (+http://code.google.com/appengine)" "www.fornebu
Counting objects: 18, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 3.75 KiB, done.
Total 11 (delta 8), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects
fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To login.iterate.no:/srv/beachfinder
@hermansc
hermansc / fabfile.py
Created October 21, 2012 12:24
fabfile.py
from fabric.api import *
import subprocess, shlex, atexit, time
@task
def deploy():
env.user = prompt('Your username at login and deployment box: ')
prod = SSHTunnel(env.user, 'loginserver', 'productionserver')
env.hosts = [prod.entrance()]
env.host_string = prod.entrance()
print "[INFO] Running SSH commands to production server through tunnel at localhost:2022"
@hermansc
hermansc / fabfile2.py
Created October 29, 2012 09:32
Fabfile
STAGING = { 'directory': '/var/www/stagingcode/',
'fcgi': 'fcgi-staging.fcgi' }
PROD = {'directory': '/var/www/productioncode/',
'fcgi': 'fcgi-prod.fcgi'}
env.hosts = ['host.domain.com']
env.user = getpass.getuser()
USER_ID = 'productionuser'
@task
def deploy():
@hermansc
hermansc / gist:4106022
Created November 18, 2012 16:09
Gunicorn config & ab-test
### /etc/gunicorn.d/ukeweb.gunicorn
CONFIG = {
'mode': 'wsgi',
'environment': {
'PYTHONPATH': '/var/www/uka.no/staging/ukeweb/',
},
'user': 'uka-web',
'group': 'uka-web',
'args': (
'--bind=0.0.0.0:5060',