forked from thunder-project/thunder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-notebook-ec2
executable file
·28 lines (24 loc) · 1.1 KB
/
setup-notebook-ec2
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
#!/usr/bin/env bash
cd /root
mkdir certificates
cd certificates
openssl req -x509 -nodes -days 365 -subj "/C=XX/ST=XX/L=XX/O=XX/CN=XX" -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
ipython profile create default
python -c "from IPython.lib import passwd; print passwd()" > /root/.ipython/profile_default/nbpasswd.txt
echo "# Configuration file for ipython-notebook.
c = get_config()
# Notebook config
c.NotebookApp.certfile = u'/root/certificates/mycert.pem'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
# It is a good idea to put it on a known, fixed port
c.NotebookApp.port = 8888
PWDFILE='/root/.ipython/profile_default/nbpasswd.txt'
c.NotebookApp.password = open(PWDFILE).read().strip()" >> /root/.ipython/profile_default/ipython_notebook_config.py
echo 'export IPYTHON_OPTS="notebook"' >> /root/.bash_profile
echo -e "\n\n\n"
echo "-----------------------------------------------------------------"
echo "iPython notebook successfully set up!"
echo "Access at https://$(cat /root/spark-ec2/masters):8888"
echo "-----------------------------------------------------------------"
echo -e "\n\n\n"