Skip to content

Instantly share code, notes, and snippets.

Avatar
🎏

Mark Kubacki wmark

🎏
  • Germany, European Union
View GitHub Profile
@wmark
wmark / Discord.desktop
Created August 11, 2022 17:36
Container Discord and its update script
View Discord.desktop
# .local/share/applications/Discord.desktop
[Desktop Entry]
Name=Discord Chat
Icon=/opt/Discord/discord.png
StartupWMClass=discord
Comment=Discord Chat
Exec=sudo /usr/bin/systemctl start discord@1000.service
Terminal=false
Type=Application
Categories=Network;InstantMessaging;
@wmark
wmark / Dockerfile
Last active September 23, 2021 10:34
Windows in Docker
View Dockerfile
# Image meant to host Windows in QEMU, hence we install QEMU
# and everything that is needed to get the networking for it working.
FROM ubuntu:latest
RUN apt-get -q update \
&& apt-get -y install \
kvm qemu-kvm bridge-utils psmisc \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN update-alternatives --install /usr/bin/qemu qemu /usr/bin/qemu-system-x86_64-spice 10
@wmark
wmark / record-cam.service
Created September 21, 2021 13:32
webcam to gpu encoding
View record-cam.service
[Unit]
Description=Local surveillance using the webcam
Requisite=pulseaudio.service
[Service]
WorkingDirectory=%h/Aufnahmen
# Might want to skip restarting if all you need are the first 2h.
Restart=on-success
TimeoutStopSec=10s
ExecStart=%h/record-cam.sh vaapi
@wmark
wmark / scw-server-notifier.go
Last active June 12, 2021 21:02
notify me to running servers on Scaleway
View scw-server-notifier.go
package main
import (
"fmt"
"os"
notify "github.com/TheCreeper/go-notify"
instance "github.com/scaleway/scaleway-sdk-go/api/instance/v1"
"github.com/scaleway/scaleway-sdk-go/scw"
yaml "gopkg.in/yaml.v3"
@wmark
wmark / default.pa
Last active September 20, 2020 22:55
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 23:02
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 April 6, 2021 21:57
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 June 8, 2021 13:54
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 November 4, 2018 14:20
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