Skip to content

Instantly share code, notes, and snippets.

Avatar

Santiago M. Mola smola

View GitHub Profile
@smola
smola / git-cherry-list
Last active Mar 9, 2022
git-cherry-list
View 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 / docker-logs-all
Created Sep 2, 2021
Continuously tail logs for all Docker containers.
View docker-logs-all
#!/bin/bash
set -eu
_shutdown() {
for pid in $(jobs -p); do
kill $pid || true
done
}
trap _shutdown EXIT
@smola
smola / sdkman_oracle_jdk.sh
Last active Jun 2, 2022
Install Oracle JDK 8 for use with SDKMAN
View sdkman_oracle_jdk.sh
#!/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 / install_ibm_db2.sh
Last active Feb 2, 2021
Run IBM DB2 Express-C with Docker
View install_ibm_db2.sh
#!/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 / run_attachme
Created Nov 4, 2020
AttachMe helper script
View run_attachme
#!/bin/bash
# run_attachme
#
# See https://github.com/JetBrains/attachme
ATTACHME_CONF="$HOME/.attachme/conf.sh"
if [[ ! -f $ATTACHME_CONF ]]; then
echo "$ATTACHME_CONF not found."
echo "See https://github.com/JetBrains/attachme"
@smola
smola / linguist_cross_validation.rb
Last active Jul 4, 2021
Cross validation for github/linguist
View linguist_cross_validation.rb
require 'parallel'
require 'linguist'
include Linguist
all = false
if ARGV[0] == '--all'
all = true
ARGV.shift
end
@smola
smola / PHP-EOL.md
Created Jul 25, 2020
PHP End of Life Schedule
View PHP-EOL.md

PHP End of Life Schedule

This table summarizes End of Life (EOL) dates of PHP versions, including commercial vendors and Linux distributions.

Vendor Table

Version PHP Zend RHEL Ubuntu LTS Ubuntu ESM
7.4 2022-11-28
7.3 2021-12-06 LTS¹ 2025-04⁵
@smola
smola / old_openssl.sh
Last active Oct 17, 2020
Install old OpenSSL for use with PHPBrew and old PHP versions (e.g. 5.3)
View old_openssl.sh
#!/bin/sh
#
# Build old OpenSSL for usage in old PHP builds
# (e.g. PHP 5.3).
#
# This solution was originally found at:
# https://gist.github.com/marulitua/f8932064ec5bfe6a5be9fadac7c5a141
#
# Relevant discussions:
# https://github.com/phpbrew/phpbrew/issues/418
@smola
smola / run.groovy
Created Jul 8, 2020
Run a command in Groovy
View run.groovy
def run(cmd) {
// author: Bob Herrmann
// source: https://stackoverflow.com/a/159270
def sout = new StringBuilder(), serr = new StringBuilder()
def proc = cmd.execute()
proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(1000)
println "out> $sout err> $serr"
}
@smola
smola / README.md
Last active Jun 26, 2020
Quick notes on installing Ubuntu with LUKS+LVM2
View README.md

Quick notes on installing Ubuntu with LUKS+LVM2

These are just some quick notes about installing Ubuntu to an encrypted partition (LUKS) with LVM2 on top of it. The installer GUI has an advanced option to do this, but it is only available if you select the Erase disk and install Ubuntu option. I wanted to use this setup while preserving dual boot with Windows.

You should probably follow the following guide, instead of my instructions: https://help.ubuntu.com/community/Full_Disk_Encryption_Howto_2019

TODO

  • Encrypt /boot partition (see the linked guide above).
  • Fix Windows boot loader, removed from GRUB after last update-grub.