given a database named db:
SELECT pg_terminate_backend(pid)
FROM pg_stat_activity
WHERE datname='db'
AND state = 'idle in transaction'
given a database named db:
SELECT pg_terminate_backend(pid)
FROM pg_stat_activity
WHERE datname='db'
AND state = 'idle in transaction'
I recently was able to get my Diamond-branded DisplayLink USB graphics adapter to work with a system onto which I had freshly installed Crunchbang 11 by:
udlfb
kernel modxrandr
a bit;(function($){ | |
ListFilterCollapsePrototype = { | |
bindToggle: function(){ | |
var that = this; | |
this.$filterEl.click(function(){ | |
that.$filterList.slideToggle(); | |
}); | |
}, | |
init: function(filterEl) { | |
this.$filterEl = $(filterEl).css('cursor', 'pointer'); |
"""Utilities for managing database sessions.""" | |
from __future__ import with_statement | |
import contextlib | |
import functools | |
@contextlib.contextmanager | |
def temp_session(session_cls, **kwargs): | |
"""Quick and dirty context manager that provides a temporary Session object | |
to the nested block. The session is always closed at the end of the block. |
Agenda
This document is a practical checklist for anyone who needs to provide wifi and power for medium sized (10-100 attendants) tech events where attendees will expect to be able to plug in their laptops and get on a wireless network.
Full disclosure: I'm not an expert at this, but hopefully the things I've learned will be better than nothing.
This list was originally authored by a friend who has been learning programming for some time (tuningmind)
Note: Many books may be available from a nearby public library. Check there as well!
These two are about the best I've seen for starting from scratch:
import os | |
from pyramid.config import Configurator | |
def main(global_config, **settings): | |
settings = {k: os.path.expandvars(v) for k, v in settings.items()} | |
config = Configurator(settings=settings) | |
config.include(__name__) | |
return config.make_wsgi_app() |