Skip to content

Instantly share code, notes, and snippets.

@scheng123 scheng123/runFull
Last active Oct 10, 2019

What would you like to do?
Install wstun, anyproxy, and essentials for aws vm
#AWS User Data: sudo -H -u ubuntu bash -c 'curl -o- | bash'
#EXECUTE COMMAND: curl -o- | bash
touch ~/.bashrc
curl -o- | bash
. ~/.nvm/
nvm install 10.16.3
npm install -g anyproxy MDSLab/wstun
sudo bash -c "printf \"@reboot tmux new-session -d -s pRunner 'sudo /home/ubuntu/.nvm/versions/node/v10.16.3/bin/node /home/ubuntu/.nvm/versions/node/v10.16.3/bin/anyproxy -p 1935 -w 9999'\\n@reboot tmux new-session -d -s sshSecondStage 'sudo /home/ubuntu/.nvm/versions/node/v10.16.3/bin/node /home/ubuntu/.nvm/versions/node/v10.16.3/bin/wstun -s 443'\\n@reboot tmux new-session -d -s portFowrd 'sudo /home/ubuntu/.nvm/versions/node/v10.16.3/bin/node /home/ubuntu/.nvm/versions/node/v10.16.3/bin/wstun -r -s 8443'\" > /var/spool/cron/crontabs/ubuntu"
sudo chmod go=,+rw /var/spool/cron/crontabs/ubuntu
sudo chown ubuntu:crontab /var/spool/cron/crontabs/ubuntu
tmux new-session -d -s pRunner 'sudo /home/ubuntu/.nvm/versions/node/v10.16.3/bin/node /home/ubuntu/.nvm/versions/node/v10.16.3/bin/anyproxy -p 1935 -w 9999' && tmux new-session -d -s sshSecondStage 'sudo /home/ubuntu/.nvm/versions/node/v10.16.3/bin/node /home/ubuntu/.nvm/versions/node/v10.16.3/bin/wstun -s 443' && tmux new-session -d -s portFowrd 'sudo /home/ubuntu/.nvm/versions/node/v10.16.3/bin/node /home/ubuntu/.nvm/versions/node/v10.16.3/bin/wstun -r -s 8443'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.