It's on the public web. Anyone can get access to the private key. Do not use this for anything.
...I'm just testing stuff and it's an easy little hack.
| #!/usr/bin/env bash | |
| for test in "bare file" "directory"; do | |
| prefix="" | |
| container_path="/foo" | |
| if [ "$test" = "directory" ]; then | |
| mkdir -p "/tmp/foodir" | |
| prefix="/foodir" | |
| container_path="/foodir" | |
| fi |
| #!/usr/bin/env bash | |
| x=$(mktemp --suffix=.py) | |
| curl -L https://github.com/9001/copyparty/releases/latest/download/copyparty-sfx.py -o "$x" | |
| python "$x" | |
| rm -i "$x" |
| #!/bin/sh | |
| set -eu | |
| # DEBUG=true | |
| DEBUG=false | |
| if $DEBUG; then | |
| trap 'echo "# $BASH_COMMAND";read' DEBUG | |
| fi |
| #!/usr/bin/env bash | |
| sudo kill -SIGQUIT $(systemctl show gitlab-runner.service -p MainPID | cut -d= -f2) && \ | |
| while systemctl is-active gitlab-runner.service ; do sleep 2; done |
| #!/bin/sh | |
| set -eu | |
| tmp_file=$(mktemp) && echo -e '#!/bin/sh\nexit 0' > "$tmp_file" && chmod +x "$tmp_file" && "$tmp_file" || tmp_file=$(mktemp -p "$HOME") || exit 1 | |
| gists=$(curl -s https://api.github.com/users/VSharapov/gists | jq -r '.[].files[].raw_url') | |
| [ -z "$gists" ] && exit 1 | |
| selected_gist=$(echo "$gists" | fzf) || select selected_gist in $gists; do break; done | |
| curl -s "$selected_gist" -o "$tmp_file" && chmod +x "$tmp_file" && "$tmp_file" "@" | |
| rm -i "$tmp_file" |
| #!/usr/bin/env bash | |
| sudo systemd-inhibit --what=handle-lid-switch --mode=block sleep 9999d & disown |
| #!/usr/bin/env bash | |
| echo "$USER ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/$USER > /dev/null |
| #!/usr/bin/env bash | |
| ### recommended usage is something like: | |
| ### export PARAM_SUBNETS="10.69.0.0/16 192.168.1.0/24"; export PARAM_USERNAME=ubuntu; [ -z "$PARAM_PASSWORD" ] && { read -s ; export PARAM_PASSWORD="$REPLY" ; } ; ./listAccessibleMachines.sh | |
| set -Eeuo pipefail | |
| trap cleanup SIGINT SIGTERM ERR EXIT | |
| script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) |
This unit file, if enabled on boot, will attempt to connect to a remote server and establish a reverse tunnel.
It uses StrictHostKeyChecking=accept-new for the ssh connection, so if you want to make sure the host you're connecting to is the right one, carry out the first connection manually and check the key.
REMOTE is considered a remote server that's available over ssh
LOCAL is considered the device initiating the remote tunnel. This will likely be a device dropped behind a NAT with no option of portforwarding
To use it, copy this multiline command somewhere to edit the configs and run it as root on the device: