Initial contribution of R, scipy, minimal notebook stacks

This commit is contained in:
Peter Parente
2015-07-19 23:20:27 -04:00
parent e3ef913ff8
commit 8ab2e0ed8f
11 changed files with 316 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
import subprocess
import os
PEM_FILE = os.path.join(os.path.dirname(__file__), 'security/notebook.pem')
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
# Set a certificate if USE_HTTPS is set to any value
if 'USE_HTTPS' in os.environ:
if not os.path.isfile(PEM_FILE):
# Generate a certificate if one doesn't exist on disk
subprocess.check_call(['openssl', 'req', '-new',
'-newkey', 'rsa:2048', '-days', '365', '-nodes', '-x509',
'-subj', '/C=XX/ST=XX/L=XX/O=generated/CN=generated',
'-keyout', PEM_FILE, '-out', PEM_FILE])
c.NotebookApp.certfile = PEM_FILE
# Set a password if PASSWORD is set
if 'PASSWORD' in os.environ:
from IPython.lib import passwd
c.NotebookApp.password = passwd(os.environ['PASSWORD'])
del os.environ['PASSWORD']