| Variable | Meaning |
|---|---|
METRIC |
Metric name (i.e. cpu_usage_system) |
NAME |
Name for the metric value (corresponds to AS "NAME" in SQL) |
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/sed -f | |
| # anna - Annonymize IPv4 and IPv6 addresses | |
| # Copyright (2020) Matous Jan Fialka, <https://mjf.cz/> | |
| # Released under the terms of the "MIT License" | |
| # See RFC 5737 for the replacements explanation. | |
| s/\(\(\([0-9]\|[1-9][0-9]\|1[0-9]\{2\}\|2[0-4][0-9]\|25[0-5]\)\.\)\{3\}\([0-9]\|[1-9][0-9]\|1[0-9]\{2\}\|2[0-4][0-9]\|25[0-5]\)\)/192.0.2.1/g | |
| s/\(\([0-9a-f]\{1,4\}:\)\{6\}\(\([0-9a-f]\{1,4\}:[0-9a-f]\{1,4\}\)\|\(\([0-9]\|[1-9][0-9]\|1[0-9]\{2\}\|2[0-4][0-9]\|25[0-5]\)[.]\)\{3\}\([0-9]\|[1-9][0-9]\|1[0-9]\{2\}\|2[0-4][0-9]\|25[0-5]\)\)\|::\([0-9a-f]\{1,4\}:\)\{5\}\(\([0-9a-f]\{1,4\}:[0-9a-f]\{1,4\}\)\|\(\([0-9]\|[1-9][0-9]\|1[0-9]\{2\}\|2[0-4][0-9]\|25[0-5]\)[.]\)\{3\}\([0-9]\|[1-9][0-9]\|1[0-9]\{2\}\|2[0-4][0-9]\|25[0-5]\)\)\|\([0-9a-f]\{1,4\}\)\?::\([0-9a-f]\{1,4\}:\)\{4\}\(\([0-9a-f]\{1,4\}:[0-9a-f]\{1,4\}\)\|\(\([0-9]\|[1-9][0-9]\|1[0-9]\{2\}\|2[0-4][0-9]\|25[0-5]\)[.]\)\{3\}\([0-9]\|[1-9][0-9]\|1[0-9]\{2\}\|2[0-4][0-9]\|25[0-5]\)\)\|\(\([0-9a-f]\{1,4\}:\)\?[0-9a-f]\{1,4\}\)\?::\([0-9a-f]\{1,4\}:\ |
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
| # HAProxy TCP Binary Check for Postgres Replica Instance | |
| # Copyright (C) "2021" Matous Jan Fialka, <https://mjf.cz/> | |
| # Released under the terms of "The MIT License" | |
| # https://www.postgresql.org/docs/current/protocol-message-formats.html | |
| backend postgres | |
| bind :5432 |
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/sh | |
| # dockercat - Print Docker config or secret object | |
| # Copyright (C) 2021 Matous Jan Fialka, <https://mjf.cz/> | |
| # Released under the terms of the "MIT License" | |
| PROGRAM="${0##*/}" | |
| if [ $# -eq 0 -o $# -ne 2 ]; then | |
| echo "Usage: $PROGRAM { config | secret } OBJECT" >&2 |
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/sh | |
| [ $# -eq 1 ] && { | |
| grep -B 11 'KernelPageSize' "/proc/$1/smaps" | | |
| awk '/^Size:/ { sum += $2 } END { printf("%.2F GiB\n", sum / 1024 / 1024) }' | |
| } || { | |
| printf "Usage: %s PID\n" "${0##*/}" >&2 | |
| exit 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
| -- PL/PgSQL Functions for Promscale API Schema | |
| -- Copyright (C) 2021 Matous Jan Fialka, <https://mjf.cz/> | |
| -- Released under the terms of "The MIT License" | |
| -- LABEL VALUES FUNCTIONS | |
| -- | |
| -- label_values([<metric>,] <label>[, <time from>[, <time to>]]) | |
| -- | |
| -- Where: | |
| -- <metric> is name of a metric |
How to Upgrade PostgreSQL 12 with TimescaleDB Extension Cluster Managed by Patroni to PostgreSQL 13 on CentOS 8 Stream
| Flag | Meaning |
|---|---|
[---] |
Holds for nothing (i.e. work in progress) |
[M--] |
Holds exclusively for master |
[-S-] |
Holds exclusively for slave |
[--C] |
Holds exclusively for cluster management |
[MS-] |
Holds for both master and slave |
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/sh | |
| # haproxy-pgsql-tcp-check - Generate HAProxy PostgreSQL TCP Check | |
| # Copyright (C) 2021 Matous Jan Fialka, <https://mjf.cz/> | |
| # Released under the terms of "The MIT License" | |
| # | |
| # See https://www.postgresql.org/docs/current/protocol-message-formats.html | |
| if [ $# -lt 2 -o $# -gt 3 ]; then | |
| printf -- 'Usage: %s USER DATABASE ["leader"]\n' "${0##*/}" >&2 |
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/awk --exec | |
| # pingfmt - Format output of the ping(1) program | |
| # Copyright (C) 2012, 2021 Matouš J. Fialka, <https://mjf.cz/> | |
| # Released under the terms of The MIT License | |
| BEGIN { | |
| # ----- HELP SCREEN ----- | |
| help = help "Usage: pingfmt [-h|-help|-usage] [+[no][show]<opt>[=<val>]]\n" |
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/sh | |
| # Script "memo" to move CentOS 8 to AppStream | |
| # Copyright (C) 2021 Matous Jan Fialka, <https://mjf.cz/> | |
| # Released under the terms of "The MIT License" | |
| dnf update -y && \ | |
| dnf install -y centos-release-stream && \ | |
| dnf distro-sync -y |