Last active
August 29, 2015 14:23
-
-
Save lsongdev/0af7aeadbea766bd8a63 to your computer and use it in GitHub Desktop.
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
| #!/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 |
Author
lsongdev
commented
Jun 17, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
