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
| #!/bin/bash | |
| # uWSGI & nginx installation script | |
| # Created at 2017-06-27 by Frank Yang (https://github.com/puilp0502) | |
| # Tested on Ubuntu Server 16.04 LTS | |
| # Check if user is root | |
| if [[ $UID -ne '0' ]]; then | |
| echo "This script needs to be run as root; exiting..." | |
| exit 0 |
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
| [uwsgi] | |
| # Django-related settings | |
| # the base directory (full path) | |
| chdir = /home/ubuntu/(project-dir) | |
| # Django's wsgi file | |
| module = (project-name).wsgi:application | |
| # the virtualenv (full path) | |
| home = /home/ubuntu/.venv/(venv-name)/ |
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
| [Unit] | |
| Description=uWSGI Emperor service | |
| [Service] | |
| RuntimeDirectory=uwsgi | |
| RuntimeDirectoryMode=755 | |
| User=emperor | |
| Group=www-data | |
| ExecStart=/usr/local/bin/uwsgi --emperor /etc/uwsgi/sites | |
| Restart=always |
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
| import random | |
| import string | |
| print("".join([random.SystemRandom().choice(string.digits + string.ascii_letters + string.punctuation) for i in range(50)])) |
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
| #Assuming you followed the guide at https://github.com/jupyterhub/jupyterhub/wiki/Using-sudo-to-run-JupyterHub-without-root-privileges | |
| [Unit] | |
| Description=JupyterHub Server | |
| [Service] | |
| #replace with your jupyterhub running user | |
| User=rhea | |
| Group=rhea | |
| WorkingDirectory=/etc/jupyterhub/ | |
| ExecStart=/usr/local/bin/jupyterhub --JupyterHub.spawner_class=sudospawner.SudoSpawner |
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
| echo "#### Installing setuptools... ####" | |
| wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python > /dev/null | |
| if [[ ! $? ]]; then | |
| echo "Failed!" | |
| exit 1 | |
| fi | |
| echo "#### Installing pip... ####" | |
| wget https://bootstrap.pypa.io/get-pip.py -O - | sudo python > /dev/null | |
| if [[ ! $? ]]; then |
NewerOlder