-
Notifications
You must be signed in to change notification settings - Fork 811
/
start_jupyter.sh
executable file
·29 lines (21 loc) · 8.72 KB
/
start_jupyter.sh
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
29
#!/bin/bash
# Source the environment as the init system won't
set -a
. /etc/environment
set +a
for f in /etc/profile.d/*.sh; do source $f; done
# LS_COORS derived from ayu.sh from https://github.com/sharkdp/vivid
export LS_COLORS='ow=0:pi=0;38;2;0;0;0;48;2;27;125;196:ex=1;38;2;237;102;106:di=0;38;2;27;125;196:so=0;38;2;0;0;0;48;2;240;113;113:cd=0;38;2;0;0;0;48;2;134;179;0:tw=0:ln=0;38;2;240;113;113:mi=0;38;2;0;0;0;48;2;237;102;106:*~=0;38;2;170;170;170:bd=0;38;2;0;0;0;48;2;237;102;106:fi=0:or=0;38;2;0;0;0;48;2;237;102;106:st=0:no=0:*.o=0;38;2;170;170;170:*.c=0;38;2;49;136;102:*.r=0;38;2;49;136;102:*.t=0;38;2;49;136;102:*.h=0;38;2;49;136;102:*.z=4;38;2;134;179;0:*.m=0;38;2;49;136;102:*.a=1;38;2;237;102;106:*.p=0;38;2;49;136;102:*.d=0;38;2;49;136;102:*.rm=0;38;2;240;113;113:*.fs=0;38;2;49;136;102:*.pp=0;38;2;49;136;102:*.jl=0;38;2;49;136;102:*.hi=0;38;2;170;170;170:*.py=0;38;2;49;136;102:*.gv=0;38;2;49;136;102:*.gz=4;38;2;134;179;0:*.el=0;38;2;49;136;102:*.mn=0;38;2;49;136;102:*.sh=0;38;2;49;136;102:*.hs=0;38;2;49;136;102:*.hh=0;38;2;49;136;102:*.ps=0;38;2;237;102;106:*.so=1;38;2;237;102;106:*.7z=4;38;2;134;179;0:*.rb=0;38;2;49;136;102:*.kt=0;38;2;49;136;102:*.ko=1;38;2;237;102;106:*.js=0;38;2;49;136;102:*.ui=0;38;2;237;147;102:*.md=0;38;2;237;147;102:*.ts=0;38;2;49;136;102:*.cs=0;38;2;49;136;102:*.td=0;38;2;49;136;102:*.nb=0;38;2;49;136;102:*.di=0;38;2;49;136;102:*.bc=0;38;2;170;170;170:*.rs=0;38;2;49;136;102:*.ll=0;38;2;49;136;102:*.cr=0;38;2;49;136;102:*.ex=0;38;2;49;136;102:*.cp=0;38;2;49;136;102:*css=0;38;2;49;136;102:*.pm=0;38;2;49;136;102:*.vb=0;38;2;49;136;102:*.lo=0;38;2;170;170;170:*.as=0;38;2;49;136;102:*.xz=4;38;2;134;179;0:*.cc=0;38;2;49;136;102:*.bz=4;38;2;134;179;0:*.go=0;38;2;49;136;102:*.ml=0;38;2;49;136;102:*.pl=0;38;2;49;136;102:*.la=0;38;2;170;170;170:*.xls=0;38;2;237;102;106:*.flv=0;38;2;240;113;113:*.vcd=4;38;2;134;179;0:*.odt=0;38;2;237;102;106:*.log=0;38;2;170;170;170:*.blg=0;38;2;170;170;170:*.aux=0;38;2;170;170;170:*.toc=0;38;2;170;170;170:*.txt=0;38;2;237;147;102:*.otf=0;38;2;240;113;113:*.mov=0;38;2;240;113;113:*.kts=0;38;2;49;136;102:*.bbl=0;38;2;170;170;170:*.sql=0;38;2;49;136;102:*.ppt=0;38;2;237;102;106:*.pod=0;38;2;49;136;102:*.mp4=0;38;2;240;113;113:*.rtf=0;38;2;237;102;106:*.bak=0;38;2;170;170;170:*.cpp=0;38;2;49;136;102:*.bst=0;38;2;237;147;102:*TODO=1:*.tsx=0;38;2;49;136;102:*.iso=4;38;2;134;179;0:*.zsh=0;38;2;49;136;102:*.tif=0;38;2;240;113;113:*.ics=0;38;2;237;102;106:*.lua=0;38;2;49;136;102:*.xlr=0;38;2;237;102;106:*.tgz=4;38;2;134;179;0:*.rpm=4;38;2;134;179;0:*.dll=1;38;2;237;102;106:*.ilg=0;38;2;170;170;170:*.cfg=0;38;2;237;147;102:*.fsi=0;38;2;49;136;102:*.fon=0;38;2;240;113;113:*.elm=0;38;2;49;136;102:*.aif=0;38;2;240;113;113:*.pas=0;38;2;49;136;102:*.vim=0;38;2;49;136;102:*.avi=0;38;2;240;113;113:*.jpg=0;38;2;240;113;113:*.mli=0;38;2;49;136;102:*.cgi=0;38;2;49;136;102:*.pid=0;38;2;170;170;170:*.swf=0;38;2;240;113;113:*.swp=0;38;2;170;170;170:*.dmg=4;38;2;134;179;0:*.inl=0;38;2;49;136;102:*.bin=4;38;2;134;179;0:*.mpg=0;38;2;240;113;113:*.ltx=0;38;2;49;136;102:*.ttf=0;38;2;240;113;113:*.psd=0;38;2;240;113;113:*.tex=0;38;2;49;136;102:*.ods=0;38;2;237;102;106:*.php=0;38;2;49;136;102:*.ppm=0;38;2;240;113;113:*hgrc=0;38;2;154;232;69:*.pkg=4;38;2;134;179;0:*.pro=0;38;2;154;232;69:*.inc=0;38;2;49;136;102:*.ini=0;38;2;237;147;102:*.pdf=0;38;2;237;102;106:*.bcf=0;38;2;170;170;170:*.mp3=0;38;2;240;113;113:*.sxw=0;38;2;237;102;106:*.exs=0;38;2;49;136;102:*.zip=4;38;2;134;179;0:*.pbm=0;38;2;240;113;113:*.pgm=0;38;2;240;113;113:*.com=1;38;2;237;102;106:*.pps=0;38;2;237;102;106:*.fsx=0;38;2;49;136;102:*.vob=0;38;2;240;113;113:*.clj=0;38;2;49;136;102:*.fls=0;38;2;170;170;170:*.jar=4;38;2;134;179;0:*.eps=0;38;2;240;113;113:*.m4v=0;38;2;240;113;113:*.bz2=4;38;2;134;179;0:*.tar=4;38;2;134;179;0:*.png=0;38;2;240;113;113:*.dox=0;38;2;154;232;69:*.exe=1;38;2;237;102;106:*.yml=0;38;2;237;147;102:*.img=4;38;2;134;179;0:*.ogg=0;38;2;240;113;113:*.wmv=0;38;2;240;113;113:*.arj=4;38;2;134;179;0:*.ipp=0;38;2;49;136;102:*.deb=4;38;2;134;179;0:*.ps1=0;38;2;49;136;102:*.h++=0;38;2;49;136;102:*.bib=0;38;2;237;147;102:*.dot=0;38;2;49;136;102:*.c++=0;38;2;49;136;102:*.bat=1;38;2;237;102;106:*.tmp=0;38;2;170;170;170:*.gvy=0;38;2;49;136;102:*.nix=0;38;2;237;147;102:*.tml=0;38;2;237;147;102:*.htc=0;38;2;49;136;102:*.doc=0;38;2;237;102;106:*.out=0;38;2;170;170;170:*.hxx=0;38;2;49;136;102:*.gif=0;38;2;240;113;113:*.tbz=4;38;2;134;179;0:*.mid=0;38;2;240;113;113:*.epp=0;38;2;49;136;102:*.mir=0;38;2;49;136;102:*.ico=0;38;2;240;113;113:*.odp=0;38;2;237;102;106:*.xml=0;38;2;237;147;102:*.m4a=0;38;2;240;113;113:*.def=0;38;2;49;136;102:*.ind=0;38;2;170;170;170:*.awk=0;38;2;49;136;102:*.wav=0;38;2;240;113;113:*.svg=0;38;2;240;113;113:*.rar=4;38;2;134;179;0:*.wma=0;38;2;240;113;113:*.bag=4;38;2;134;179;0:*.fnt=0;38;2;240;113;113:*.mkv=0;38;2;240;113;113:*.asa=0;38;2;49;136;102:*.dpr=0;38;2;49;136;102:*.bsh=0;38;2;49;136;102:*.erl=0;38;2;49;136;102:*.sty=0;38;2;170;170;170:*.xmp=0;38;2;237;147;102:*.csx=0;38;2;49;136;102:*.htm=0;38;2;237;147;102:*.cxx=0;38;2;49;136;102:*.rst=0;38;2;237;147;102:*.idx=0;38;2;170;170;170:*.xcf=0;38;2;240;113;113:*.apk=4;38;2;134;179;0:*.hpp=0;38;2;49;136;102:*.bmp=0;38;2;240;113;113:*.git=0;38;2;170;170;170:*.sbt=0;38;2;49;136;102:*.kex=0;38;2;237;102;106:*.tcl=0;38;2;49;136;102:*.csv=0;38;2;237;147;102:*.sxi=0;38;2;237;102;106:*.pyc=0;38;2;170;170;170:*.html=0;38;2;237;147;102:*.pptx=0;38;2;237;102;106:*.psd1=0;38;2;49;136;102:*.h264=0;38;2;240;113;113:*.dart=0;38;2;49;136;102:*.tiff=0;38;2;240;113;113:*.epub=0;38;2;237;102;106:*.yaml=0;38;2;237;147;102:*.fish=0;38;2;49;136;102:*.less=0;38;2;49;136;102:*.tbz2=4;38;2;134;179;0:*.docx=0;38;2;237;102;106:*.make=0;38;2;154;232;69:*.purs=0;38;2;49;136;102:*.rlib=0;38;2;170;170;170:*.java=0;38;2;49;136;102:*.jpeg=0;38;2;240;113;113:*.flac=0;38;2;240;113;113:*.bash=0;38;2;49;136;102:*.toml=0;38;2;237;147;102:*.xlsx=0;38;2;237;102;106:*.lock=0;38;2;170;170;170:*.orig=0;38;2;170;170;170:*.lisp=0;38;2;49;136;102:*.conf=0;38;2;237;147;102:*.json=0;38;2;237;147;102:*.hgrc=0;38;2;154;232;69:*.psm1=0;38;2;49;136;102:*.diff=0;38;2;49;136;102:*.mpeg=0;38;2;240;113;113:*.cmake=0;38;2;154;232;69:*passwd=0;38;2;237;147;102:*README=0;38;2;0;0;0;48;2;237;147;102:*.scala=0;38;2;49;136;102:*.dyn_o=0;38;2;170;170;170:*.mdown=0;38;2;237;147;102:*.swift=0;38;2;49;136;102:*.class=0;38;2;170;170;170:*.patch=0;38;2;49;136;102:*.cabal=0;38;2;49;136;102:*shadow=0;38;2;237;147;102:*.cache=0;38;2;170;170;170:*.ipynb=0;38;2;49;136;102:*.xhtml=0;38;2;237;147;102:*.shtml=0;38;2;237;147;102:*.toast=4;38;2;134;179;0:*.groovy=0;38;2;49;136;102:*INSTALL=0;38;2;0;0;0;48;2;237;147;102:*.gradle=0;38;2;49;136;102:*TODO.md=1:*.ignore=0;38;2;154;232;69:*LICENSE=0;38;2;102;102;102:*.config=0;38;2;237;147;102:*.flake8=0;38;2;154;232;69:*.dyn_hi=0;38;2;170;170;170:*.matlab=0;38;2;49;136;102:*COPYING=0;38;2;102;102;102:*Makefile=0;38;2;154;232;69:*TODO.txt=1:*.gemspec=0;38;2;154;232;69:*setup.py=0;38;2;154;232;69:*.desktop=0;38;2;237;147;102:*Doxyfile=0;38;2;154;232;69:*COPYRIGHT=0;38;2;102;102;102:*configure=0;38;2;154;232;69:*.fdignore=0;38;2;154;232;69:*.rgignore=0;38;2;154;232;69:*.DS_Store=0;38;2;170;170;170:*.markdown=0;38;2;237;147;102:*.cmake.in=0;38;2;154;232;69:*README.md=0;38;2;0;0;0;48;2;237;147;102:*.kdevelop=0;38;2;154;232;69:*CODEOWNERS=0;38;2;154;232;69:*Dockerfile=0;38;2;237;147;102:*INSTALL.md=0;38;2;0;0;0;48;2;237;147;102:*SConstruct=0;38;2;154;232;69:*.gitconfig=0;38;2;154;232;69:*.gitignore=0;38;2;154;232;69:*SConscript=0;38;2;154;232;69:*README.txt=0;38;2;0;0;0;48;2;237;147;102:*.scons_opt=0;38;2;170;170;170:*.localized=0;38;2;170;170;170:*Makefile.in=0;38;2;170;170;170:*LICENSE-MIT=0;38;2;102;102;102:*Makefile.am=0;38;2;154;232;69:*.synctex.gz=0;38;2;170;170;170:*.travis.yml=0;38;2;49;136;102:*INSTALL.txt=0;38;2;0;0;0;48;2;237;147;102:*MANIFEST.in=0;38;2;154;232;69:*.gitmodules=0;38;2;154;232;69:*.applescript=0;38;2;49;136;102:*appveyor.yml=0;38;2;49;136;102:*configure.ac=0;38;2;154;232;69:*CONTRIBUTORS=0;38;2;0;0;0;48;2;237;147;102:*.fdb_latexmk=0;38;2;170;170;170:*.clang-format=0;38;2;154;232;69:*LICENSE-APACHE=0;38;2;102;102;102:*.gitattributes=0;38;2;154;232;69:*CMakeLists.txt=0;38;2;154;232;69:*CMakeCache.txt=0;38;2;170;170;170:*CONTRIBUTORS.md=0;38;2;0;0;0;48;2;237;147;102:*CONTRIBUTORS.txt=0;38;2;0;0;0;48;2;237;147;102:*.sconsign.dblite=0;38;2;170;170;170:*requirements.txt=0;38;2;154;232;69:*package-lock.json=0;38;2;170;170;170:*.CFUserTextEncoding=0;38;2;170;170;170'
notebook_args=--no-browser
notebook_version=$(jupyter notebook --version | grep -o '^[0-9]*')
if [ $notebook_version -ge 5 ]; then
notebook_args="$notebook_args --allow-root"
fi
export SHELL=/bin/bash
jupyter notebook $notebook_args > /var/log/jupyter.log 2>&1 &
while ! wget --no-proxy -q -O - http://localhost:9090/ > /dev/null ; do
echo "Waiting for Jupyter"
sleep 1
done
echo "Starting redirect server"
redirect_server &