-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLOG.jhub
169 lines (138 loc) · 5.45 KB
/
LOG.jhub
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
debootstrap --variant=minbase buster /opt/chroot/buster http://ftp.hu.debian.org/debian
## SCHROOT
cat <<. >>/etc/schroot.conf
[buster]
type=directory
description=Debian buster (testing)
directory=/opt/chroot/buster
groups=labor,master,tanszek
profile=desktop
.
schroot -b -c buster -n buster-dir
schroot -r -c buster-dir
> apt install python3-pip acl git nano sudo man-db pwgen #python3-matplotlib ?
> apt install octave gnuplot dvipng inkscape #scilab gcc maxima
> apt install texlive-xetex texlive-pstricks texlive-lang-european pandoc
# https://jupyterhub.readthedocs.io/en/stable/quickstart.html
#
> curl -sL https://deb.nodesource.com/setup_10.x > setup_10.x
> sh setup_10.x
> apt-get install nodejs
> npm install -g configurable-http-proxy
> pip3 install jupyterhub jupyterlab
> pip3 install matplotlib scipy sympy ipyparallel
> pip3 install octave_kernel gnuplot_kernel scilab_kernel jupyter_c_kernel
> jupyter labextension install @jupyterlab/hub-extension
> echo "c.Spawner.cmd = ['jupyter-labhub']" >>jupyterhub_config.py
> jupyter-labextension install @jupyterlab/latex
> jupyter-labextension install @jupyterlab/git
> pip3 install jupyterlab-latex jupyterlab-git
> jupyter-serverextension enable --py jupyterlab_git --sys-prefix
> sed -ri '/^FIRST_[UG]ID/s/1000/3000/' /etc/adduser.conf
jupyterhub --ip 152.66.33.249 --port 8080 &>> /var/log/jupyterhub.log &
# https://rise.readthedocs.io/en/stable/ # was not ported to jupyterlab
> pip3 install RISE
#
# installing latex_envs
#
pip3 install jupyter_latex_envs
jupyter-nbextension install --py latex_envs
jupyter-nbextension enable --py latex_envs
## SSL CERT
apt install certbot
certbot certonly
echo " && rsync -avHSx /etc/letsencrypt /opt/chroot/buster/etc/" >>/etc/cron.d/certbot
## SHARING
# https://github.com/Calysto/notebook-extensions
cd /opt/src
git clone https://github.com/Calysto/notebook-extensions.git
schroot -r -c buster-dir
> cd /opt/src/notebook-extensions
> jupyter-nbextension install calysto --system
> jupyter nbextension enable calysto/document-tools/main --system
> jupyter nbextension enable calysto/cell-tools/main --system
> jupyter nbextension enable calysto/spell-check/main --system
> jupyter nbextension enable calysto/publish/main --system
> jupyter nbextension enable calysto/submit/main --system
> jupyter nbextension enable calysto/annotate/main --system
## STARTING
#schroot -r -c buster-dir -- \
# jupyterhub --ip 152.66.33.249 --port 8080 &>> /var/log/jupyterhub.log &
schroot -r -c buster-dir -- \
jupyterhub -f /root/jupyterhub_config.py &>> /var/log/jupyterhub.log &
# for rotating logs:
cat <<. >/etc/logrotate.d/jupyterhub
/var/log/jupyterhub.log {
copytruncate
rotate 6
weekly
missingok
notifempty
delaycompress
compress
}
.
# create /etc/rc.boot/jupyterhub script or /etc/systemd/service/jupyterhub(?)
## MAXIMA
git clone https://github.com/robert-dodier/maxima-jupyter /opt/src
schroot -r -c buster-dir
*** ECL try: FAILED ***
> apt install maxima-sage cl-quicklisp
# (buster)szazs: ecl -load quicklisp.lisp \
# -eval "(quicklisp-quickstart:install)" \
# -eval "(ql:add-to-init-file)"
*** SBCL try: OK ***
> apt install cl-quicklisp sbcl
> cd /usr/src; apt-get source maxima
> cd maxima-5.2.41
> ./configure --enable-sbcl
> make
> make install
(buster)szazs:$ sbcl -load quicklisp.lisp \
-eval "(quicklisp-quickstart:install)" \
-eval "(ql:add-to-init-file)"
$ cp -a /opt/src/maxima-jupyter /tmp
$ cd /tmp/maxima-jupyter
$ mkdir -p binary/binary-sbcl
$ maxima -l sbcl
(%i1) :lisp (load "load-maxima-jupyter.lisp")
(%i1) :lisp (sb-ext:save-lisp-and-die #P"binary/binary-sbcl/maxima-jupyter-exec" :executable t :toplevel 'maxima-jupyter:kernel-start-exec)
> cd /tmp/maxima-jupyter
> cp -a binary/binary-sbcl/maxima-jupyter-exec /usr/local/bin
> python3 ./install-maxima-jupyter.py --exec=/usr/local/bin/maxima-jupyter-exec
> chmod 2755 /usr/local/share/jupyter/kernel/maxima
*** maxima-sbcl try: FAILED ***
# lynx https://sourceforge.net/projects/maxima/files/Maxima-Linux/5.42.0-Linux/maxima-common_5.42.0-1_all.deb
# lynx https://sourceforge.net/projects/maxima/files/Maxima-Linux/5.42.0-Linux/maxima-sbcl_5.42.0-1_amd64.deb
# dpkg -i /usr/src/maxima*deb
## JULIA
curl -O https://julialang-s3.julialang.org/bin/linux/x64/1.3/julia-1.3.1-linux-x86_64.tar.gz
# curl -O https://julialang-s3.julialang.org/bin/linux/x64/1.3/julia-1.3.1-linux-x86_64.tar.gz.asc
# gpg --fetch-keys https://julialang.org/assets/juliareleases.asc
# gpg -v julia-1.3.1-linux-x86_64.tar.gz.asc
tar -C /opt/ -xvzf julia-1.3.1-x86_64.tgz
rm -f /opt/julia && ln -s /opt/julia-1.3.1 /opt/julia
julia
> using Pkg
> ENV["JUPYTER"]="jupyter"
> Pkg.add("IJulia")
tar -C /root/.julia -cvzf /opt/julia-1.3.1/compiled-v1.3.tgz compiled/v1.3
cp -a /root/.local/share/jupyter/kernels/julia-1.3 $chroot/usr/local/share/jupyter/kernels/
cp -a /root/.julia/packages/IJulia/0cLgR/src/kernel.jl /usr/local/share/jupyter/kernels/julia-1.3/
# edit julia PATH in json:
nano /usr/local/share/jupyter/kernels/julia-1.3/kernel.json
# ez feleslegesnek / nem mukodonek tunik...
# az a biztos, ha jupyter terminalban lefuttatjuk a
# Pkg.add("IJulia") ill. Pkg.build("IJulia") parancsokat...
#
cat <<EOF >/opt/bin/julia-1.3.1.sh
#!/bin/bash --login
export JULIA_PKGDIR="/home/${USER}/.julia"
[ -d ${JULIA_PKGDIR} ] || mkdir ${JULIA_PKGDIR}
# Check if IJulia is already installed by the user
if [ ! -d "${JULIA_PKGDIR}/compiled/v1.3/IJulia" ]; then
tar -C ${JULIA_PKGDIR} -xzf /opt/julia/compiled-v1.3.tgz
chown -R ${USER}.${USER} "${JULIA_PKGDIR}/compiled"
fi
/opt/bin/julia $*
EOF