- Download release 2.1 for your architecture https://github.com/mmatczuk/go-http-tunnel/releases/tag/2.1
- Move
tunneldto/usr/local/bin/tunneld - Create user
useradd -r tunneld - Create
/etc/tunneld - Install Certstrap 1.1.1 to
/usr/local/bin/certstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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" |
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.
We will assume the following:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| URL=${1:-} | |
| if [[ -z "$URL" ]]; then | |
| echo "USAGE: $0 URL TARGET-IP" | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PS1="˹${debian_chroot:+($debian_chroot)}\[\033[92m\]\w\[\033[00m\]\[\033[91m\]\$(__git_ps1)\[\033[00m\]\n˻ \[\033[01;34m\]$\[\033[00m\] " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {{/* 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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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++) { |