This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this should go into a directory called "Tools/Database" and be called "Client.pm" | |
package Tools::Database::Client; | |
use strict; | |
use warnings FATAL => 'all'; | |
use Try::Tiny; | |
use Tools::Database; | |
use Carp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright © 2009 Adrian Perez <[email protected]> | |
# | |
# Distributed under terms of the GPLv2 license. | |
# | |
# Updated by Rami Sayar for Collectd 5.1. Added DERIVE handling. | |
# Updated by Grégory Starck with few enhancements. | |
# Updated by Paul Lockaby with only cosmetic changes. | |
import logging | |
import struct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import psycopg2 | |
from psycopg2.extras import RealDictCursor | |
from psycopg2.extensions import TRANSACTION_STATUS_UNKNOWN, TRANSACTION_STATUS_IDLE | |
from flask import g | |
import threading | |
import tenacity | |
import uuid | |
import pwd | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0. pxname [LFBS]: proxy name | |
1. svname [LFBS]: service name (FRONTEND for frontend, BACKEND for backend, | |
any name for server/listener) | |
2. qcur [..BS]: current queued requests. For the backend this reports the | |
number queued without a server assigned. | |
3. qmax [..BS]: max value of qcur | |
4. scur [LFBS]: current sessions | |
5. smax [LFBS]: max sessions | |
6. slim [LFBS]: configured session limit | |
7. stot [LFBS]: cumulative number of connections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script require the following EC2 APIs: | |
# DescribeSnapshots | |
# CreateSnapshot | |
# RegisterImage | |
# runtime overridable defaults: | |
AMI_VIRT_TYPE=hvm | |
AMI_ARCH=x86_64 | |
AMI_RELEASE=buster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import io | |
import sys | |
import logging | |
import select | |
from threading import Event | |
import signal | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this configuration file was originally provided to me by Lloyd Albin | |
# from Fred Hutch. he runs the SEAPUG Seattle PostgreSQL Users Group. | |
# thanks Lloyd! | |
LoadPlugin postgresql | |
<Plugin postgresql> | |
<Query connections> | |
Statement "SELECT count(*) AS connections FROM pg_stat_activity;" | |
<Result> | |
Type pg_conns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT z.schema, | |
z.name, | |
z.owner, | |
z.type, | |
z.objuser, | |
z.privilege_aggregate, | |
z.privilege, | |
CASE z.privilege | |
WHEN '*'::text THEN 'GRANT'::text | |
WHEN 'r'::text THEN 'SELECT'::text |