Skip to content

Instantly share code, notes, and snippets.

import random
import time
import sys
import os
# set the range for the user to guess
MIN_NUMBER = 1
MAX_NUMBER = 10000
def get_random(min, max):
@jdell64
jdell64 / Install postgres
Last active October 3, 2017 15:24
Install services without root
# from http://blog.endpoint.com/2013/06/installing-postgresql-without-root.html
# DL the source
./configure --prefix=$HOME/postgres/ --with-python PYTHON=/usr/bin/python2.7
make -j $(nproc) # or just `make`
make install
@jdell64
jdell64 / trace.txt
Created November 8, 2017 02:11
postgres trace could not accept SSL connection
LOCATION: StartupXLOG, xlog.c:6000
DEBUG: 00000: checkpoint record is at 0/167F048
LOCATION: StartupXLOG, xlog.c:6271
DEBUG: 00000: redo record is at 0/167F048; shutdown TRUE
LOCATION: StartupXLOG, xlog.c:6362
DEBUG: 00000: next transaction ID: 0:639; next OID: 24972
LOCATION: StartupXLOG, xlog.c:6366
DEBUG: 00000: next MultiXactId: 1; next MultiXactOffset: 0
LOCATION: StartupXLOG, xlog.c:6369
DEBUG: 00000: oldest unfrozen transaction ID: 579, in database 1
@jdell64
jdell64 / .git(slash)hooks(slash)pre-commit
Created January 27, 2018 19:00
pre commit check to see if version file was updated.
exec git diff --name-only origin/$(git rev-parse --abbrev-ref HEAD) | grep -v *.py | if grep --quiet version
then
echo "Version was updated in this commit"
else
echo "Version was not updated in this commit"
exit 17
fi