Skip to content

Instantly share code, notes, and snippets.

View jberkus's full-sized avatar
💭
At work on workdays at least

Josh Berkus jberkus

💭
At work on workdays at least
View GitHub Profile
@jberkus
jberkus / atomic-ks.cfg
Created August 31, 2016 00:47
Sample Kickstart for Atomic on Minnowboard
```
# install Fedora Atomic and then reboot automatically
install
reboot
# set language, keyboard and timezone
lang en_US.UTF-8
keyboard us
timezone --utc America/Los_Angeles
apiVersion: v1
kind: Pod
metadata:
name: patroni
labels:
app: postgresql
spec:
containers:
- name: postgresql
image: jberkus/patroni-node
worker.init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process
super(GeventWorker, self).init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi
self.callable = self.load()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
josh@Radegast:~/git/10stepprogram$ git merge c7a9f93
warning: refname 'c7a9f93' is ambiguous.
Already up-to-date.
josh@Radegast:~/git/10stepprogram$ ^C
josh@Radegast:~/git/10stepprogram$ git branch
c7a9f93
master
* origin/master
psql --tuples-only --no-align --command "select setting, reset_val from pg_settings where name = 'log_min_duration_statement'"
https://dl.dropboxusercontent.com/u/5132935/healthcheck.tgz
@jberkus
jberkus / badge_prefs.md
Last active December 1, 2015 04:10
badge preferences

##Badge Type

Good: Badge is plastic envelope with paper inside, has cord attachments on both corners to not flip, and is printed on both sides.

Better: Badge is a preprinted, recycleable plastic card printed on both sides (ala DockerCon).

Best: Badge is a little booklet with the summary conference schedule inside. Printed/stickered on both covers with my information.

Fun Alternative: no badges, only name stickers (PyDX).

relname <E2><94><82> relnamespace <E2><94><82> reltype <E2><94><82> reloftype <E2><94><82> relowner <E2><94><82> relam
<E2><94><82> relfilenode <E2><94><82> reltablespace <E2><94><82> relpages <E2><94><82> reltuples <E2><94><82> relallvisible <E2><94><82> reltoastrelid
<E2><94><82> relhasindex <E2><94><82> relisshared <E2><94><82> relpersistence <E2><94><82> relkind <E2><94><82> relnatts <E2><94><82> relchecks <E2><94>
<82> relhasoids <E2><94><82> relhaspkey <E2><94><82> relhasrules <E2><94><82> relhastriggers <E2><94><82> relhassubclass <E2><94><82> relispopulated <E2>
<94><82> relreplident <E2><94><82> relfrozenxid <E2><94><82> relminmxid <E2><94><82> relacl <E2><94><82> reloptions
<E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94>
<80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94>
@jberkus
jberkus / portlandhouselist.md
Created November 9, 2015 01:14
Looking for Portland House

What we're looking for in a rental house in Portland:

Most stuff below is negotiable; we figure we'll find a place which meets 7 out of 10 criteria.

  • 1400 to 1900 sq. ft.
  • 2 to 3 bedrooms, 1.5 to 2 baths
  • $2100/month or less
  • Near Max or major bus line
  • Unfinished basement or extra-large garage or large garden shed
  • Cats OK
# This dockerfile is meant to help with setup and testing of
# patroni nodes. Unlike the prior docker setup, it relies on
# docker compose to set up multiple nodes.
FROM ubuntu:trusty
ADD . /setup/
RUN /setup/package_install.sh 9.4
@jberkus
jberkus / gist:06055068f02a0eab6cd3
Last active January 13, 2018 06:50
polling pg_stat_activity
#!/bin/bash
NUMMIN=$(($1 * 2 + 10))
CURMIN=0
while [ $CURMIN -lt $NUMMIN ]
do
psql -q -t -A -c "SELECT now() as ts, state, client_addr, count(*) as num_conn, avg(now() - query_start) as avg_query, \
max(now() - query_start) as max_query, avg(now() - xact_start) as avg_xact, \