Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer
Thanks for stopping by!
var net = require("net"); | |
require("log4js"); | |
var trafficLeft = 0; | |
var monthlyTraffic = 13 * 1024 * 1024 * 1024; //13GB | |
var targetHost = "www.youtube.com"; | |
var connectionCounter = 0; | |
function forwardOnPort(port){ | |
var server = net.createServer(function(inCon){ |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer
Thanks for stopping by!
- name: Group by Distribution | |
hosts: all | |
tasks: | |
- group_by: key=${ansible_distribution} | |
- name: Set Time Zone | |
hosts: Ubuntu | |
gather_facts: False | |
tasks: | |
- name: Set timezone variables |
# | |
# Name: nginx-tls.conf | |
# Auth: Gavin Lloyd <gavinhungry@gmail.com> | |
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating | |
# | |
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related | |
# to SSL/TLS are not included here. | |
# | |
# Additional tips: | |
# |
#!/usr/bin/python2 | |
# setup: pip install requests beautifulsoup4 | |
from decimal import Decimal | |
import requests | |
from bs4 import BeautifulSoup | |
import sys | |
# Session setup |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: dockercompose | |
# Required-Start: $docker | |
# Required-Stop: $docker | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Docker Services | |
### END INIT INFO |
#!/usr/bin/env python2 | |
from argparse import ArgumentParser | |
parser = ArgumentParser( | |
description='Profile loading a model\'s data for a specific view in order ' | |
'to find bottlenecks') | |
parser.add_argument('odoo_basedir') | |
parser.add_argument('odoo_cfg') | |
parser.add_argument('odoo_db') |
#!/usr/bin/env python | |
# | |
# I tested by Python 3.4.3 on Windows 8.1 | |
# Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32 | |
import urllib.request | |
import getpass | |
# If you access to url below via Proxy, | |
# set environment variable 'http_proxy' before execute this. |
#!/usr/bin/env python2 | |
from argparse import ArgumentParser | |
parser = ArgumentParser() | |
parser.add_argument('odoo_basedir') | |
parser.add_argument('odoo_cfg') | |
parser.add_argument('odoo_db') | |
parser.add_argument('model') | |
args = parser.parse_args() |