Skip to content

Instantly share code, notes, and snippets.

View arossouw's full-sized avatar

Arno Rossouw arossouw

  • Anonymous
View GitHub Profile
;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with C-x C-f and enter text in its buffer.
apt-get install libdbd-pg-perl libio-socket-ssl-perl libxml-libxml-perl \
libperl-dev libssl-dev libxml2-dev build-essential gcc make -y
[db-primary]
db-path=/var/lib/postgresql/11/main
[global]
backup-host=db-backup
backup-user=pgbackrest
@arossouw
arossouw / pgbackrest.conf
Created March 7, 2019 08:12
pgbackrest primary db
[db-primary]
db1-host=primary-host-ip
db1-path=/var/lib/postgresql/11/main
db1-user=postgres
[global]
repo-path=/var/lib/pgbackrest
retention-full=2
start-fast=y
archive_mode = on # enables archiving; off, on, or always
archive_command = 'pgbackrest - stanza=db-primary archive-push %p' 
archive_timeout = 30
#!/usr/bin/env python2.7
import os
# services=([5432]=postgresql [27017]=mongodb [11211]=memcached [8055]=gunicorn_read [8001]=gunicorn)
services = {
'gunicorn' : 8001,
'gunicorn_read' : 8055,
'postgresql' : 5432,
'memcached' : 11211,
'mongo' : 27017,
#!/bin/bash
declare -A services
services=([5432]=postgresql [27017]=mongodb [11211]=memcached [8055]=gunicorn_read [8001]=gunicorn)
host=`hostname`
# echo "connections,host=t,service=pgsql,state=time-wait value=133"|curl -i -XPOST
# 'http://129.232.243.226:8086/write?db=conn' --data-binary @-
function to_influxdb () {
echo $1|curl -i -XPOST 'http://129.232.243.226:8086/write?db=conn' --data-binary @- 1>/dev/null 2>/dev/null&
# echo $1
}
@arossouw
arossouw / pgbackrest_install.sh
Last active March 7, 2019 16:07
experimental pgbackrest install script
#!/usr/bin/env bash
pgbackrest_release=2.10
pgbackrest_reldir=pgbackrest-release-2.10
export $pgbackrest_reldir
export $pgbackrest_release
which wget 2>/dev/null 1>/dev/null
if [ $? -ne 0 ]; then
echo "Wget not installed exiting"
exit 0
fi
@arossouw
arossouw / -
Created January 18, 2019 08:25
admin_tools_dashboard_preferences
admin_tools_menu_bookmark
adminwidget_adminwidget
adminwidget_adminwidgetqueries
adminwidget_adminwidgetquerycache
adminwidget_adminwidgetusers
affiliate_account
affiliate_affiliate
affiliate_affiliatecommissionlog
affiliate_affiliatecommissionlogtest
var performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {};
var data = performance.getEntriesByType('resource').filter(item => item.name.includes("/game/ticket/quickpick"));