Skip to content

Instantly share code, notes, and snippets.

PS1="˹${debian_chroot:+($debian_chroot)}\[\033[92m\]\w\[\033[00m\]\[\033[91m\]\$(__git_ps1)\[\033[00m\]\n˻ \[\033[01;34m\]$\[\033[00m\] "
@ubergesundheit
ubergesundheit / ssh_config
Last active June 20, 2022 15:14
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
@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 / readme.md
Last active February 5, 2024 10:46
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 / 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 / 000-tunneld-server.md
Last active September 21, 2021 00:14
Ngrok alternative with mmatczuk/go-http-tunnel server
@ubergesundheit
ubergesundheit / main.go
Created January 7, 2018 15:06 — forked from enricofoltran/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"
ssh user@host -C 'docker save <image> | bzip2' | bunzip2 | docker load
docker save <image> | bzip2 | pv | ssh user@host 'bunzip2 | docker load'
@ubergesundheit
ubergesundheit / index.md
Created November 6, 2017 13:19
ngrok on raspberrypi on systemd
  • Download ngrok binary
  • Create /etc/systemd/system/ngrok.service
  • Create /opt/ngrok/ngrok.yml