Skip to content

Instantly share code, notes, and snippets.

View altaurog's full-sized avatar

Aryeh Leib Taurog altaurog

View GitHub Profile
@altaurog
altaurog / droprace.py
Created July 10, 2014 05:52
PostgreSQL drop/rename race condition
import logging
import os
import sys
import time
import threading
import psycopg2
"""
This script demonstrates the following race condition under PostgreSQL:
One connection, in transaction, drops table "mytable," then renames
@altaurog
altaurog / docker_descendants.py
Last active May 29, 2023 04:11
Python3 script to find descendants of one or more docker images
#!/usr/bin/python3
#
# usage: python3 docker_descendants.py <image_id> ...
import sys
from subprocess import check_output
def main(images):
image_ids = set(images)