Skip to content

Instantly share code, notes, and snippets.

@lsongdev
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save lsongdev/0af7aeadbea766bd8a63 to your computer and use it in GitHub Desktop.

Select an option

Save lsongdev/0af7aeadbea766bd8a63 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# curl -so /usr/local/bin/fire https://gist.githubusercontent.com/song940/0af7aeadbea766bd8a63/raw/fire.sh && chmod +x /usr/local/bin/fire && echo "> DONE"
#
# usage: fire [PORT]
#
REMOTE_HOST=www.lsong.org
REMOTE_PORT=$RANDOM
REMOTE_USER="lsong"
LOCAL_HOST=`hostname`
LOCAL_PORT=$1
if [ -z "$LOCAL_PORT" ]; then
LOCAL_PORT=80
fi
echo "Start forwarding ..."
echo "open http://$REMOTE_HOST:$REMOTE_PORT"
ssh -nNTR $REMOTE_PORT:$LOCAL_HOST:$LOCAL_PORT $REMOTE_USER@$REMOTE_HOST
@lsongdev
Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment