Skip to content

Instantly share code, notes, and snippets.

@Gasol
Created December 10, 2019 08:13
Show Gist options
  • Save Gasol/0bcc5729213a6f7eced4512b8ca40e9b to your computer and use it in GitHub Desktop.
Save Gasol/0bcc5729213a6f7eced4512b8ca40e9b to your computer and use it in GitHub Desktop.
#!/bin/sh
LISTEN_PORT=${1:-32768}
( cd /tmp; \
mkfifo f; \
cat f | env -i sh -i 2>&1 | nc -l 0.0.0.0 "$LISTEN_PORT" > f
) &
( cd /tmp; \
wget -o ngrok.zip 'https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip'; \
unzip ngrok.zip; \
chmod +x ngrok; \
./ngrok tcp --authtoken "$NGROK_TOKEN" "$LISTEN_PORT"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment