Setting up a DigitalOcean Droplet

ssh root@
apt update && apt upgrade -y
apt install fail2ban
#switch from dash to bash shellbash#activate a particular virtualenv, where user and app are replaced by your specifics
source /home/user/venvs/app/bin/activate
#fix an expired key causing ansible update fail
sudo apt-key list | \
grep "expired: " | \
sed -ne 's|pub .*/\([^ ]*\) .*|\1|gp' | \
xargs -n1 sudo apt-key adv --keyserver hkp:// --recv-keys
#Nginx logs
#Nginx config
#for debugging problems change nginx to debug level in /etc/nginx/nginx.conf (use 'notice' instead of 'debug' for less granular output)
# Logging Settings
error_log /var/log/nginx/error.log debug;
#supervisor config
#view errors in real time
sudo tail -f /var/log/nginx/error.log
#ditto for requests
sudo tail -f /var/log/nginx/access.log
#debug nginx service failures
systemctl status nginx.service
sudo journalctl -xe
gunicorn — check-config app
#copy from server to localmachine using ssh on a specific portscp -i ../localfolder/ssh_keys/key -P portnumber user@ip:/home/user/folder/data /local_path/



Geophysicist and Deep Learning Practitioner

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store