Skip to content

Instantly share code, notes, and snippets.

View gertvdijk's full-sized avatar

Gert van Dijk gertvdijk

View GitHub Profile
@gertvdijk
gertvdijk / conftest.py
Created March 15, 2021 13:39
PyTest PostgreSQL Docker image fixture
import time
from typing import Optional
import docker
import pytest
class PostgresImage:
_container_id: Optional[str] = None
_container_obj: Optional[docker.models.containers.Container] = None
@gertvdijk
gertvdijk / gist:8f6e6c7b12b5f16a1cd70f757b147b93
Last active July 27, 2018 20:57
Demonstrating Gerrit issue 9498: Trigger Gerrit server error on diff
# 0) Create Gerrit dev instance, create project 'foo', clone it, etc.
export GERRIT_PROJECT=foo
# Have set up a ~/.ssh/config with 'Host ${GERRIT_HOST}' configuration that sets
# user and port.
export GERRIT_HOST=testgerrit
git clone ssh://${GERRIT_HOST}/$GERRIT_PROJECT
cd $GERRIT_PROJECT
scp -p ${GERRIT_HOST}:hooks/commit-msg .git/hooks/
@gertvdijk
gertvdijk / init_and_start_gerrit.sh
Created July 27, 2018 11:13
Init and start Gerrit in a single shell script example
#!/bin/sh -ex
SITE_PATH="${HOME}/site"
GERRIT_WAR="/path/to/gerrit.war"
# Because Gerrit's "daemon --init" can't take init options we will do this
# separately. Feature request filed:
# https://bugs.chromium.org/p/gerrit/issues/detail?id=9004
# Init site (provision). Note that the GERRIT_WAR may be a different version
@gertvdijk
gertvdijk / install-rkt.sh
Last active January 26, 2017 18:42
Create rkt package for Debian/Ubuntu using checkinstall
#!/bin/bash
# Based on https://github.com/coreos/rkt/blob/v1.15.0/scripts/install-rkt.sh
#
# Pre-requirement: install the packages:
# - ca-certificates
# - curl
# - gnupg2
# - bash-completion
# - checkinstall

Keybase proof

I hereby claim:

  • I am gertvdijk on github.
  • I am gertvdijk (https://keybase.io/gertvdijk) on keybase.
  • I have a public key whose fingerprint is BB0F CCD1 00FB 082F D67E FBF9 B90E 30CB A08C 9903

To claim this, I am signing this object: