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 | |
# usage {{{1 ------------------------------------------------------------------ | |
#/ Usage: | |
#/ -h|-?|--help) | |
#/ show this help and exit | |
#/ | |
# 1}}} ------------------------------------------------------------------------ | |
# environment {{{1 ------------------------------------------------------------ | |
# 1}}} ------------------------------------------------------------------------ | |
# functions {{{1 -------------------------------------------------------------- |
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
WITH src AS ( | |
UPDATE serial_rate | |
SET rate = 22.53, serial_key = '0002' | |
WHERE serial_key = '002' AND id = '01' | |
RETURNING * | |
) | |
UPDATE serial_table dst | |
SET serial_key = src.serial_key | |
FROM src | |
-- WHERE dst.id = src.id AND dst.serial_key = '002' |
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
ssh -L 8112:localhost:8112 bryan@remotehost -p 22 |
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
ssh -L 11111:localhost:11111 user@loginserver -t ssh -L 11111:localhost:443 remoteserver | |
I connected to 03, tunneling 11111 to 11111, forcing TTY, connecting to 23, tunneling 11111 to 443. The web UI is working. |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
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
mnamer --test -rb --no-guess --no-overwrite --media=movie --movie-directory="/Movies/{name} ({year})" --movie-format="{name} ({year}){extension}" /Movies |
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 | |
# ex: set fdm=marker | |
# usage {{{1 | |
#/ Usage: | |
#/ ./build.sh [OPTIONS] | |
#/ | |
#/ -t|--tag) | |
#/ the tag to assign the docker image | |
#/ | |
#/ -n|--no-cache) |
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
# using ubuntu LTS version | |
FROM ubuntu:20.04 AS builder-image | |
# avoid stuck build due to user prompt | |
ARG DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update && apt-get install --no-install-recommends -y python3.9 python3.9-dev python3.9-venv python3-pip python3-wheel build-essential && \ | |
apt-get clean && rm -rf /var/lib/apt/lists/* | |
# create and activate virtual environment |
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
#!/bin/bash | |
export PGPASSWORD='SparklyBannana86' && psql -h gistnebula -p 5501 -d wstamp_staging -U worker -c "SELECT | |
pid, | |
now() - pg_stat_activity.query_start AS duration, | |
query, | |
state | |
FROM pg_stat_activity | |
WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes'; |
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 | |
# ex: set fdm=marker | |
# usage {{{1 | |
#/ Usage: | |
#/ ./build.sh -r "REGISTRY/NAME" [OPTIONS] | |
#/ | |
#/ -r|--registry) | |
#/ the name of the image or registry to push to [required] | |
#/ | |
#/ -t|--tag) |