Skip to content

Instantly share code, notes, and snippets.

View mark-kubacki's full-sized avatar
🎏

Mark Kubacki mark-kubacki

🎏
  • Germany, European Union
View GitHub Profile
@mark-kubacki
mark-kubacki / backup.sh
Last active July 4, 2016 20:28
naive multi-processing backup script in BASH
#!/bin/bash
#
# Backup script that tries to utilize all available disc spindles and cores.
# For every target archive ("sink") create a file "sink.list"
# which contains what to backup ("sources") linewise.
# (Prefer plzip to xz if you have the former at hand.)
#
# wrapper to: tar sort xargs xz
#
# run: ./backup.sh run *.list
@mark-kubacki
mark-kubacki / newrelic-sysmond.service
Created July 5, 2016 21:58
Newrelic Sysmond unit file for systemd and Docker. Works with CoreOS and --storage-driver "overlay2" and "overlay".
[Unit]
Description=newrelic-sysmond
After=docker.service
[Service]
ProtectHome=true
ProtectSystem=full
PIDFile=/run/newrelic-sysmond.pid
ExecStartPre=-/bin/bash -c "[[ -x /opt/sbin/nrsysmond ]] || (mkdir -p /opt/sbin; docker pull newrelic/nrsysmond:latest && rsync -au $(docker inspect newrelic/nrsysmond:latest | jq -r '.[0].GraphDriver.Data.UpperDir // .[0].GraphDriver.Data.RootDir')/usr/sbin/nrsysmond /opt/sbin/)"
@mark-kubacki
mark-kubacki / godoc-create-index.service
Last active June 28, 2017 16:20
godoc and systemd
[Unit]
Description=updates Golang's documentation index
ConditionFileNotEmpty=!/usr/share/go-1.6/godoc_index.db
ConditionACPower=true
AssertDirectoryNotEmpty=/usr/share/go-1.6
[Service]
Restart=on-failure
ExecStart=/usr/bin/godoc \
@mark-kubacki
mark-kubacki / netboot-server.service
Created August 13, 2017 19:49
boot CoreOS and other images over the network, utilizing iPXE
[Unit]
Description=netboot server
Wants=network-online.target
After=network-online.target sys-subsystem-net-devices-ext0.device
AssertPathExists=/srv/ftp/tftproot
[Service]
Slice=machine.slice
KillMode=mixed
Restart=on-abort
@mark-kubacki
mark-kubacki / docker-gitlab-runner.service
Created January 31, 2018 18:31
run the latest Docker image, and upgrade it using systemd timers (example for Gitlab-CI Runner)
[Unit]
Description=GITLAB Runner for Docker
Documentation=https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/docker.md
ConditionArchitecture=x86-64
ConditionACPower=true
AssertFileNotEmpty=/var/gitlab-runner/config/config.toml
After=docker.service docker-gitlab.service update-gitlab-runner.service
Requires=docker.service
Wants=update-gitlab-runner.service
@mark-kubacki
mark-kubacki / 00-reflinks-supported.sh
Last active August 14, 2018 22:00
file-level deduplication in O(n) utilizing reflinks
@mark-kubacki
mark-kubacki / docker-gc.service
Created November 4, 2018 14:20
systemd timer that runs only if another service is active (running)
[Unit]
Description=Docker garbage collection
ConditionACPower=true
ConditionDirectoryNotEmpty=/var/lib/docker
Requisite=docker.service
PartOf=docker.service
After=docker.service
[Service]
Environment=GRACE_PERIOD=1h
@mark-kubacki
mark-kubacki / update-go.sh
Last active June 14, 2023 14:56
Updates your local Golang to the latest stable version
#!/bin/bash
# Will update your Golang.
# Needs: curl tar jq procps-ng/pgrep
set -eupo pipefail
if [[ -t 1 ]] && type -p 'tput' &>/dev/null && tput colors >&/dev/null; then
V_BOLD_RED=$(tput bold; tput setaf 1)
V_BOLD_GREEN=$(tput bold; tput setaf 2)
V_VIDOFF=$(tput sgr0)
else
@mark-kubacki
mark-kubacki / merge-repos.sh
Last active April 6, 2021 21:57
Collect a set of repositories, each in its own subdir, into one mono-repo.
#!/bin/bash
# Merges a set of repositories, the “sources”, formerly hosted on “from”
# into subdirectories of one repository
# meant to be moved to a new repository hosting provider.
#
# git version: 2.24.0
# Mark Kubacki, 2020-01-08
if (( $# < 1 )); then
>&2 printf "Usage: $0 [repo | repo…]\n"
 --- /usr/share/X11/xkb/symbols/de.orig 2020-03-08 18:18:54.650875969 +0100
+++ /usr/share/X11/xkb/symbols/de 2020-03-08 18:29:08.506129310 +0100
@@ -37,6 +37,9 @@
key <AB10> { [ minus, underscore, endash, emdash ] };
key <LSGT> { [ less, greater, bar, dead_belowmacron ] };
+ // space, nobreakspace, thin non-break space, thin space
+ key <SPCE> { [ space, nobreakspace, U202F, thinspace ] };
+
include "kpdl(comma)"