Skip to content

Instantly share code, notes, and snippets.

View johanndt's full-sized avatar

Johann du Toit johanndt

  • ImpulseCloud
  • Australia
View GitHub Profile
@johanndt
johanndt / dual-axes.ipynb
Created November 4, 2015 21:42
Toyplot - Moved y axis to the right
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johanndt
johanndt / dual-axes2.ipynb
Created November 4, 2015 22:10
Toyplot combined bar and line plots
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johanndt
johanndt / upgrade-postgres-9.3-to-9.5.md
Last active July 15, 2022 12:35 — forked from dideler/upgrade-postgres-9.3-to-9.4.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johanndt
johanndt / horizontal_legend.py
Created October 21, 2016 00:26
Lay out Toyplot legends horizontally
from PIL import ImageFont
import toyplot
series_names = ["Series 1", "Series 2", "Series 3"]
canvas = toyplot.Canvas(width=300, height=300)
font = ImageFont.load_default()
next_x = 0
for legend in series_names:
canvas.legend([
@johanndt
johanndt / upgrade-postgres-9.5-to-9.6.md
Last active April 18, 2021 20:07 — forked from Prototype-X/upgrade-postgres-9.5-to-9.6.md
Upgrading PostgreSQL from 9.5 to 9.6 on Ubuntu 16.04

TL;DR

Install Postgres 9.6, and then:

sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main
@johanndt
johanndt / gist:d32f5ccd248b415c203c1fcc131f23cc
Last active May 22, 2023 05:55
run pg_repack on existing running postgresql 9.6
apt-get update
apt-get install postgresql-server-dev-11 unzip
cd /tmp
wget http://api.pgxn.org/dist/pg_repack/1.4.4/pg_repack-1.4.4.zip
unzip pg_repack-1.4.4.zip
cd pg_repack-1.4.4
make
make install
su - postgres