Das Programm »restic« ist ein modernes Backup-Programm, welches als Ziel lokal gemountete Verzeichnisse verwenden kann. Darüber hinaus unterstützt es einige ausgewählte Protokolle, um direkt auf Cloud-Speicher zugreifen zu können (SFTP, S3, OpenStack Swift, Google Cloud Storage u.a.). Im Folgenden soll gezeigt werden, wie man unter Linux automatische Backups konfigurieren kann. Als Ziel wird in diesem Beispiel der S3-kompatible »Object Storage Service« (TelekomCLOUD) benutzt. Sinngemäß lassen sich die folgenden Angaben auch auf andere Backup-Ziele (z.B. NFS-Mounts) anwenden. Getestet wurde
This file contains 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
# Many of these are obvious and stupidly simple, but for your reference and copy-pasting pleasure… | |
# Mextify all (with workaround for pesky samples that contain multi-line RSA key that breaks pt-mext) | |
for i in $(ls $1/*-mysqladmin); do { (cat $i | sed -e '/\-\-\-\-\-BEGIN\ PUBLIC\ KEY/,+9d' | pt-mext -r -- cat -) > $i.mext && echo $i.mext;} done; | |
# Inspect given variable through multiple mext samples (revealing ;-)) | |
grep Table_locks_waited *.mext |less -S | |
#Find contentious tables |
This file contains 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
function! Sort(type, ...) | |
'[,']sort | |
endfunction | |
nmap <silent> <key> :set opfunc=Sort<CR>g@ | |
" usage: | |
" <key>ip | |
" <key>G |
This file contains 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 | |
# convert video files into the WebM format in batches using ffmpeg (and preferrably GNU parallel) | |
# exit on error or use of undeclared variable or pipe error: | |
set -o errexit -o nounset -o pipefail | |
# -crf 10 : Constant Rate Factor (crf) gives video quality from 0 (lossless) to 63 (worst); default is 23. | |
# -c:a/v ... = transform the audio/video data using ... | |
# -b:a/v ... = audio/video bitrate is ... |
This file contains 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
version: '3.4' | |
services: | |
main: | |
# Makefile fills PROJECT_NAME to current directory name. | |
# add UID to allow multiple users run this in parallel | |
container_name: ${PROJECT_NAME}_${HOST_UID:-4000} | |
hostname: ${PROJECT_NAME} | |
# These variables are passed into the container. | |
environment: | |
- UID=${HOST_UID:-4000} |
This file contains 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
# -------------------------------------------------------------------- | |
# Copyright (c) 2019 LINKIT, The Netherlands. All Rights Reserved. | |
# Author(s): Anthony Potappel | |
# | |
# This software may be modified and distributed under the terms of the | |
# MIT license. See the LICENSE file for details. | |
# -------------------------------------------------------------------- | |
# If you see pwd_unknown showing up, this is why. Re-calibrate your system. | |
PWD ?= pwd_unknown |
This file contains 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
FROM alpine as base | |
RUN apk update \ | |
&& apk add --no-cache \ | |
bash | |
FROM scratch as user | |
COPY --from=base . . | |
ARG HOST_UID=${HOST_UID:-4000} |
This file contains 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 -f | |
# Source: http://c2.com/doc/expense/ | |
/^[A-Z]+[A-Z0-9]*$/ { | |
if (sums[$1] == "" || $1 == "SUM") { | |
sums[$1] = sum # Define Symbol | |
$1 = sum | |
sum = 0 | |
} |
This file contains 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
autocmd BufNewFile,BufRead * call <SID>DetectFrontEndFramework() | |
function! s:DetectFrontEndFramework() | |
if v:version >= 801 && has('patch1803') | |
let package_json = findfile('package.json', '.;') | |
if len(package_json) | |
let dependencies = readfile(package_json) | |
\ ->join() | |
\ ->json_decode() |