Skip to content

Instantly share code, notes, and snippets.

@arckid
arckid / .ignore
Created August 1, 2023 17:10 — forked from NahuLD/.ignore
Restic backup script (S3 compatible Wasabi)
# Empty
# MUST BE LOCATED IN /etc/restic
@arckid
arckid / Readme.md
Created May 20, 2023 20:31 — forked from paskal/Readme.md
How to set up the Percona Monitoring and Management (PMM) v2 with docker-compose

Set up PMM Server v2

Let's start by creating entry for server in docker-compose.yaml:

version: '2'
# version 2 of docker-compose is not "old" version, it's the actual version,
# see below for explanation:
# https://stackoverflow.com/a/53636006/961092
services:
@arckid
arckid / tables-without-indexes.sql
Created May 20, 2023 19:04 — forked from rponte/tables-without-indexes.sql
Finding all tables without PK (Primary Key) or indexes on PostgreSQL
SELECT
c.table_schema,
c.table_name,
c.table_type
FROM
information_schema.tables c
WHERE
c.table_schema NOT IN('information_schema', 'pg_catalog') AND c.table_type = 'BASE TABLE'
AND NOT EXISTS(SELECT i.tablename
FROM pg_catalog.pg_indexes i
@arckid
arckid / run-xtrabackup.sh
Created April 22, 2023 13:01 — forked from jmfederico/run-xtrabackup.sh
Script to create full/incremental backups with xtrabackup.
#!/bin/sh
TMPFILE="/tmp/xtrabackup-runner.$$.tmp"
USEROPTIONS="--user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --host=${MYSQL_HOST}"
BACKDIR=/srv/mysql-bak
BASEBACKDIR=$BACKDIR/base
INCRBACKDIR=$BACKDIR/incr
FULLBACKUPCYCLE=604800 # Create a new full backup every X seconds
KEEP=1 # Number of additional backups cycles a backup should kept for.
START=`date +%s`