Skip to content

Instantly share code, notes, and snippets.

@robuye
robuye / config_local.py
Created October 17, 2024 12:18
pgadmin oauth for github
# Essential configuration for authentication with Github
MASTER_PASSWORD = True
MASTER_PASSWORD_HOOK = "/bin/echo $PGADMIN_MASTER_PASSWORD"
AUTHENTICATION_SOURCES = ["oauth2"]
ENABLE_SERVER_PASS_EXEC_CMD = True
OAUTH2_AUTO_CREATE_USER = True
OAUTH2_CONFIG = [
{
"OAUTH2_NAME": "github",
"OAUTH2_DISPLAY_NAME": "GitHub",

Configuration from https://github.com/robuye/pgbench-docker with the following parameters:

DOCKER_IMAGE=postgres:11
PGBENCH_SCALE=10    # scale factor (keep it higher or equal to concurrent clients)
PGBENCH_CLIENTS=10   # clients or concurrent db sessions
PGBENCH_RATE=1000000 # 1M rate limit, number of transactions per second
PGBENCH_THREADS=8   # number of threads to run to manage connections
require 'curb'
require 'socket'
URL = 'https://google.com'
# 0123456 default & reserved RubyVM. It will probably include 7 from Dir.glob
FDS_OPEN_BEFORE_START = Dir.glob("/proc/self/fd/*").map do |fd_path|
File.basename(fd_path).to_i
end
module Spec
module Generic
class And
def initialize(specs)
@specifications = specs
end
def is_satisfied_by?(subject)
@specifications.all? do |spec|
spec.is_satisfied_by?(subject)