Skip to content

Instantly share code, notes, and snippets.

@scheng123 scheng123/runFull
Last active Oct 10, 2019

Embed
What would you like to do?
Install wstun, anyproxy, and essentials for aws vm
#!/bin/bash
#AWS User Data: sudo -H -u ubuntu bash -c 'curl -o- https://gist.githubusercontent.com/scheng123/06c2123650bbd2872ab9c253557a0dc1/raw/runFull | bash'
#EXECUTE COMMAND: curl -o- https://gist.githubusercontent.com/scheng123/06c2123650bbd2872ab9c253557a0dc1/raw/runFull | bash
touch ~/.bashrc
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
. ~/.nvm/nvm.sh
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.