Skip to content

Instantly share code, notes, and snippets.

View smola's full-sized avatar

Santiago M. Mola smola

View GitHub Profile
@smola
smola / linguist_cross_validation.rb
Last active July 4, 2021 18:33
Cross validation for github/linguist
require 'parallel'
require 'linguist'
include Linguist
all = false
if ARGV[0] == '--all'
all = true
ARGV.shift
end
@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 / run_attachme
Created November 4, 2020 16:49
AttachMe helper script
#!/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 / PHP-EOL.md
Created July 25, 2020 22:49
PHP End of Life Schedule

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 / run.groovy
Created July 8, 2020 09:15
Run a command in 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 June 26, 2020 11:35
Quick notes on installing Ubuntu with LUKS+LVM2

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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smola
smola / keybase.md
Created September 19, 2018 13:49
keybase.md

Keybase proof

I hereby claim:

  • I am smola on github.
  • I am smola (https://keybase.io/smola) on keybase.
  • I have a public key whose fingerprint is C2A3 00EF 5DCA BC7E ED7F 01B6 3B05 0C2B 76AA FD1A

To claim this, I am signing this object:

@smola
smola / gitbase_reference.ipynb
Last active May 29, 2018 15:16
Gitbase reference (DRAFT)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smola
smola / README.md
Last active May 14, 2018 11:27
Get latest GitHub release from the command line (Linux, macOS, Windows)

Get latest GitHub release

These snippets can be used to retrieve the latest GitHub release from Linux, macOS and Windows. Note that other approaches involve either:

  • HTML scraping involving more dependencies or more complex code.
  • Using GitHub API, which has rate limit, so it is not suitable for all applications.

Replace the repository org/name with yours.

Bash