Last active
June 17, 2018 15:22
-
-
Save mndrake/3b34e0410476ee7a021085bd6b6b743d to your computer and use it in GitHub Desktop.
domino start script for jupyterlab
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 | |
set -o nounset -o errexit -o pipefail | |
IP_ADDR=$(/sbin/ifconfig eth0 | grep "inet addr" | cut -d ":" -f2 | cut -d " " -f1) | |
CONF_DIR="$HOME/.ipython/profile_default" | |
CONF_FILE="${CONF_DIR}/ipython_notebook_config.py" | |
mkdir -p "${CONF_DIR}" | |
cat <<EOF >>"${CONF_FILE}" | |
c = get_config() | |
#c.NotebookApp.notebook_dir = '${DRT_WORKING_DIR:-"/"}' | |
c.NotebookApp.tornado_settings = {'headers': {'Content-Security-Policy': 'frame-ancestors *'}} | |
#c.NotebookApp.default_url = 'lab${DOMINO_WORKING_DIR}' | |
EOF | |
COMMAND='cd ${DOMINO_WORKING_DIR}; jupyter-lab --config="$CONF_FILE" --no-browser --ip=* 2>&1' | |
FINAL_COMMAND=$(echo "${COMMAND}" | sed "s/--ip=\\*/--ip=${IP_ADDR}/") | |
eval ${FINAL_COMMAND} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment