docker-compose exec mariadb sh -c \
'exec mysqldump --all-databases -uroot -p"$MYSQL_ROOT_PASSWORD"' \
____encoding____
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This was used to deploy Certificates during CI deployments from GitLab CI | |
# You need files at HTTPS_KEY and HTTPS_CERT (easily done with GitLab Variables of type file) | |
# HTTPS_CERT is expected to contain a chain | |
Task::deploy_cert () { | |
: @desc "Deploy certificate from GitLab runner to its designated position" | |
: @param target_dir="$HOME/ilias" | |
: @param cert_dir_name="certs-$(date +'%Y-%m-%d_%H-%M-%S%z')" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
if [ -z "${1+x}" ] || [ -z "${2+x}" ] | |
then | |
echo "Check a leaf ssl server certificate presented by a specified host" | |
echo "on a specified port." | |
echo "Expect exit code 0 upon success, non-zero otherwise." | |
echo "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Yes, you are an nginx. But do not tell everyone your version. | |
server_tokens off; | |
# Cache definition; used for proxying to Jetty | |
# This defines a chache stored at /tmp/nginx/cache with only | |
# one hierarchy level, no additional temp path, a key (used for | |
# matching requests to cache entries) zone in RAM which is 10M, | |
# schedules entries older than 2h for deletion and a maximum size | |
# of 160M | |
proxy_cache_path /tmp/nginx/cache levels=1 use_temp_path=off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let balance = 0; | |
let transactions = []; | |
for (elem of document.querySelectorAll('a[href^="/transactions"]')) { | |
console.log(Array(20).join('-')); | |
const parent = elem.parentNode; | |
if (!parent) { | |
console.warn('skip [parent]', elem, elem.innerText); | |
continue; | |
} | |
const amountNode = parent.nextSibling; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Given the 4 tables, each containing items and representing one set, | |
-- I'd like to get the count of the items in each compartment required | |
-- to draw a Venn diagram as shown below. The calculation should take | |
-- place in the MySQL server since I do not want to transmit the single | |
-- items to the application server. | |
-- https://stackoverflow.com/q/53234943/2683737 | |
-- Copyright 2018 Rainer Rillke | |
-- Permission is hereby granted, free of charge, to any person obtaining a copy | |
-- of this software and associated documentation files (the "Software"), to deal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Linux: ~/.ssh/config: | |
<code> | |
Host SHORTCUT | |
Hostname FULLURL_OR_IP_TARGET_HOST | |
User USERNAME | |
Host FULLURL_OR_IP_TARGET_HOST | |
ProxyCommand ssh -a -W %h:%p BASTION_HOST | |
Port NUMBER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then | |
echo 'Script must be sourced' | |
exit -1 | |
fi | |
cwd=$(pwd) | |
cd /INSTALLDIR/emsdk-portable | |
source emsdk_env.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, make sure you're using systemd and | |
# the prerequisites are fulfilled: | |
# https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/#prerequisites | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
mkdir -p /etc/systemd/system/docker.service.d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
ECHO Setting up or shutting down a hosted network | |
SET /P ACTION="ENABLE [E] DISABLE [D] INFO[I]: " | |
IF /I "%ACTION:~,1%" EQU "E" GOTO enable | |
IF /I "%ACTION:~,1%" EQU "D" GOTO disable | |
IF /I "%ACTION:~,1%" EQU "I" GOTO info | |
GOTO unknown | |
:enable | |
SET DEFAULT_SSID=rillke's hotspot |
NewerOlder