Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
executing

Mark Kubacki‮ wmark

🎯
executing
View GitHub Profile
@wmark
wmark / default.pa
Last active Sep 20, 2020
mpv config
View default.pa
#!/usr/bin/pulseaudio -nF
# This is: .config/pulse/default.pa
load-module module-alsa-card device_id="1" name="pci-0000_04_00.6" card_name="alsa_card.pci-0000_04_00.6" namereg_fail=false ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1" tsched=no fixed_latency_range=yes fragments=32 fragment_size=128
set-sink-volume 0 32768
.include /etc/pulse/default.pa
# Default devices. `pacmd list-sinks` and `… list-sources` lists them.
.nofail
@wmark
wmark / storage-counter.go
Last active May 4, 2020
count bytes per storage class
View storage-counter.go
package main
import (
"context"
"io"
"log"
"net/url"
"os"
"strings"
View keyboard-layout.diff
 --- /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)"
@wmark
wmark / merge-repos.sh
Last active Jan 10, 2020
Collect a set of repositories, each in its own subdir, into one mono-repo.
View merge-repos.sh
#!/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"
@wmark
wmark / update-go.sh
Last active Feb 28, 2020
Updates your local Golang to the latest stable version
View update-go.sh
#!/bin/bash
# Will update your Golang.
# Needs: curl jq tar
set -eupo pipefail
if [[ -t 1 ]] && command -v '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
@wmark
wmark / docker-gc.service
Created Nov 4, 2018
systemd timer that runs only if another service is active (running)
View docker-gc.service
[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
@wmark
wmark / 00-reflinks-supported.sh
Last active Aug 14, 2018
file-level deduplication in O(n) utilizing reflinks
View 00-reflinks-supported.sh
@wmark
wmark / docker-gitlab-runner.service
Created Jan 31, 2018
run the latest Docker image, and upgrade it using systemd timers (example for Gitlab-CI Runner)
View docker-gitlab-runner.service
[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
@wmark
wmark / netboot-server.service
Created Aug 13, 2017
boot CoreOS and other images over the network, utilizing iPXE
View netboot-server.service
[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
View godoc-create-index.service
[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 \
You can’t perform that action at this time.