-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.txt
73 lines (57 loc) · 2.36 KB
/
setup.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# HOW TO SSH TO THE PROD VERSION VIA BASTION
ssh -Y blues.prod
ssh -v 10.0.68.126
# Install git
sudo apt install git --assume-yes
# Install Emacs (optional, use nano by default)
#sudo apt install emacs --assume-yes
# Purge any old version of golang sitting on the box
sudo apt purge golang-go
sudo apt autoremove --assume-yes
# Install upgrades
sudo apt update
sudo apt upgrade
# Answer "N" to any questions about overwriting files
# Install the latest golang
sudo snap install go
#Deprecated method
#sudo add-apt-repository ppa:longsleep/golang-backports
#sudo apt update
#sudo apt install golang-go --assume-yes
# After many lessons learned about running servers in aws that
# are guaranteed to stay up for years, make sure this var is set
# correctly else the ubuntu instance WILL run out of disk space.
sudo emacs /etc/apt/apt.conf.d/50unattended-upgrades
# By default in linux, this Unattended-Upgrade is commented out,
# so make sure it is commented-in.
Unattended-Upgrade::Remove-Unused-Dependencies "true";
# Note that from time to time it is also advisable to run this,
# to clean up space. I don't normally put this in crontab. This
# generally removes vast quantities of linux-aws-headers
sudo apt-get -f install && sudo apt autoremove --purge
# Copy the 'ray mode' version of the udp-proxy code down here,
# noting that I manually keep this code up-to-date with respect
# to the code in the hub repo's udp-proxy folder.
git clone https://github.com/blues/udp-proxy.git
cd udp-proxy
go build
# Add this to the crontab so that it automatically starts on boot
crontab -e
# add this line
@reboot screen -dmS udp-proxy /home/ubuntu/udp-proxy/run.sh
# Start it up
sudo reboot
# After you come up, do this command to see if it is running in
# the background.
screen -ls
# In order to switch to it, use this command (which works because
# it should be the only screen session running). SEE NOTE BELOW.
screen -r
# NOTE that when you are in the screen session above, these are
# the absolutely essential things to remember:
ctrl-a d // Detaches the screen session and returns to bash
ctrl-a <ESC> // Allows you to use arrow keys to scroll back to
# While you are in the screen session, remember that typing
# the letter 'q' followed by <enter> will quit the session,
# re-pull the latest code from the repo, and restart the
# udp proxy server. This is the way to re-deploy updates.