Skip to content

Instantly share code, notes, and snippets.

View smola's full-sized avatar

Santiago M. Mola smola

View GitHub Profile
@smola
smola / install_ibm_db2.sh
Last active February 2, 2021 10:21
Run IBM DB2 Express-C with Docker
#!/bin/bash
set -eux
#
# Just give up on using packages from IBM.com and their nighmare setup process.
#
# Use Docker: https://hub.docker.com/r/ibmcom/db2
#
CONTAINER=mydb2
@smola
smola / sdkman_oracle_jdk.sh
Last active March 14, 2024 12:07
Install Oracle JDK 8 for use with SDKMAN
#!/bin/bash
#
# Install Oracle JDK 8 for use with SDKMAN
#
set -eu
# This URL can be discovered using https://sites.google.com/view/java-se-download-url-converter
DOWNLOAD_URL="https://javadl.oracle.com/webapps/download/GetFile/1.8.0_331-b09/165374ff4ea84ef0bbd821706e29b123/linux-i586/jdk-8u331-linux-x64.tar.gz"
TARBALL="jdk-8u331-linux-x64.tar.gz"
@smola
smola / docker-logs-all
Created September 2, 2021 11:43
Continuously tail logs for all Docker containers.
#!/bin/bash
set -eu
_shutdown() {
for pid in $(jobs -p); do
kill $pid || true
done
}
trap _shutdown EXIT
@smola
smola / git-cherry-list
Last active March 9, 2022 12:00
git-cherry-list
#!/usr/bin/env bash
set -eu
PROG_NAME="$(basename -- "${BASH_SOURCE[0]}")"
print_usage() {
echo "Usage: $PROG_NAME [-i <ignored pattern>] <SOURCE> <TARGET>"
echo ""
echo "Examples:"
echo " # Compare master to branch v1.x"
@smola
smola / watchdog_polling_repro.py
Last active June 30, 2023 06:15
Issue with watchdog PollingObserver missing events when removing files
# Reproduction for https://github.com/gorakhargosh/watchdog/issues/992
from tempfile import TemporaryDirectory
import time
import os
import os.path
from multiprocessing import Process, Queue
from pathlib import Path
from watchdog.observers.polling import PollingObserver