Skip to content

Instantly share code, notes, and snippets.

def run_pg_fouine():
info = host_info[env.host_string]
db_name = info.tags.get('Name')
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 0/" /etc/postgresql/9.*/main/postgresql.conf')
sudo('/etc/init.d/postgresql reload')
time.sleep(30)
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 500/" /etc/postgresql/9.*/main/postgresql.conf')
sudo('/etc/init.d/postgresql reload')
run('tail -n 100000 /var/log/postgresql/postgresql-9.*-main.log > /tmp/pgfouine.txt')
run('gzip -f /tmp/pgfouine.txt')
@jpetazzo
jpetazzo / README
Created November 9, 2012 22:37
autobahn websocket on dotCloud
Autobahn on dotCloud!
This code is 99% Autobah example code, 1% dotCloud adaptation.
To test this on dotCloud:
- create a dotCloud account at http://www.dotcloud.com/
(free, no credit card)
- install dotCloud CLI, see http://docs.dotcloud.com/
@tomschlick
tomschlick / gist:3984898
Created October 31, 2012 05:02
Sublime Text 2 Keybindings to Resize Split Panes
[
{
"keys": ["super+alt+left"],
"command": "set_layout",
"args":
{
"cols": [0.0, 0.33, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
}
@haschek
haschek / .jshintrc
Created May 4, 2012 16:08
JSHint Configuration, Strict Edition
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@ligfx
ligfx / gist:1366208
Created November 15, 2011 05:05 — forked from miyagawa/gist:1227494
monkeypatch socket.io to work with nginx with buffering on (e.g. dotcloud)
var monkeypatch = function(io) {
io.configure(function(){
io.set("transports", ["xhr-polling"]);
io.set("polling duration", 10);
});
io.handleRequest = _.wrap(io.handleRequest, function(next, req, res) {
res.writeHead = _.wrap(res.writeHead, function(next, status, headers) {
if (headers) { delete headers.Connection; }
return next.call(this, status, headers);
});
@virtualstaticvoid
virtualstaticvoid / iptables_rules.sh
Created June 14, 2011 08:58
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP