Skip to content

Instantly share code, notes, and snippets.

@ubergesundheit
ubergesundheit / main.go
Created January 7, 2018 15:06 — forked from 3n21c0/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@ubergesundheit
ubergesundheit / 000-tunneld-server.md
Last active September 21, 2021 00:14
Ngrok alternative with mmatczuk/go-http-tunnel server
@ubergesundheit
ubergesundheit / forward-postgres-socket.sh
Created June 5, 2018 14:31
Use SSH to forward Postgresql domain socket to local machine
# You can use this script to forward a postgres domain through ssh to your local machine
#
# Before you use this script, modify at least the HOST variable to specify your remote host
#
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
HOST="user@yourhost"
@ubergesundheit
ubergesundheit / readme.md
Last active January 8, 2026 18:26
systemd traefik.service

systemd Service Unit for Traefik

Adapted from caddy systemd Service Unit

The provided file should work with systemd version 219 or later. It might work with earlier versions. The easiest way to check your systemd version is to run systemctl --version.

Instructions

We will assume the following:

@ubergesundheit
ubergesundheit / pipe-to-iphone.sh
Created June 29, 2018 13:14
Script to upload directly to iOS foobar 2000 Music folder
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
URL=${1:-}
if [[ -z "$URL" ]]; then
echo "USAGE: $0 URL TARGET-IP"
exit 1
fi
@ubergesundheit
ubergesundheit / ssh_config
Last active December 12, 2024 11:07
ED25519 sshkey
KEY_NAME=MY-SECRET_KEY; ssh-keygen -t ed25519 -a 100 -N "" -f ~/.ssh/"${KEY_NAME}" -C "${KEY_NAME}"
# Explanation
KEY_NAME=MY-SECRET_KEY The name of the key, also used as filename
-t ed25519 Use a ed25519 key
-a 100 Use 100 key derivation function rounds (higher = slower)
-N "" No password
-f ~/.ssh/"${KEY_NAME}" Store the key at this location on your computer
-C "${KEY_NAME}" Set the comment to the key name
PS1="˹${debian_chroot:+($debian_chroot)}\[\033[92m\]\w\[\033[00m\]\[\033[91m\]\$(__git_ps1)\[\033[00m\]\n˻ \[\033[01;34m\]$\[\033[00m\] "

73# First steps after installing Pop!_OS 19.10

Using ansible. Installs pyenv, nvm, keybase, keeweb, vs codium, riot-web, golang

Packages

Upgrade & install basics

sudo apt-get update && sudo apt-get upgrade -y
@ubergesundheit
ubergesundheit / latest-changes.html
Created June 30, 2020 08:27
GitInfo latest changes shortcode for hugo
{{/* Serve and compile your pages with --enableGitInfo for this to work */}}
{{/* Put the following lines into layouts/shortcodes/latest-changes.html */}}
{{/* then use {{< latest-changes >}} in your documents */}}
{{/* Empty dict for change storage where key is the github link & value is a slice with changed pages */}}
{{ $latest_changes := dict }}
{{/* Slice for storing github links with date because dict iteration is not sorted */}}
{{ $latest_changes_sorted := slice }}
@ubergesundheit
ubergesundheit / index.js
Created December 15, 2020 14:13
Find station furthest from Münster on openSenseMap
// boxes.js is acquired by executing `curl "https://api.opensensemap.org/boxes?classify=true&minimal=true" > boxes.js`
// then prepend `export default ` in front of boxes.js
import { default as boxes } from "./boxes.js";
import { default as distance } from "@turf/distance";
import { default as helpers } from "@turf/helpers";
const muenster = helpers.point([7.62, 51.96]);
for (let i = 0; i < boxes.length ; i++) {