Using Jupyter Gracefully~

You may get your Jupyter deployed easily via conda environment,but there are multifarious commands and extensions to enhance prolificacy we barely know .We are working to integration useful Jupyter skills to make Jupyter usage gracefully.
Although it still need to be perfected,we assume that Jupyter lab will replace notebook soon. Following application are Jupyter lab working environment based,however,most of them can also used in Jupyter notebook. Modified 20-02-04

Arguments

  • jupyter lab
    • --allow-root: Allow the notebook to be run from root user.
    • --no-browser: Don't open the notebook in a browser after startup.

R installation (base on conda)

conda install R
R
>install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
>devtools::install_github('IRkernel/IRkernel')
>IRkernel::installspec()

Tips

  • If there is library dependency problem occur while R packages installing, most of them can be sloved by install packags like devtools via conda commands, like : conda install -c r r-devtools . Packages infromation can be serached in https://anaconda.org/
  • Sometims when you finished R kernel installtion, but jupyter kernel collapse all the times. Use sudo apt-get install x11vnc to overcome failed to load cairo DLL problem on Ubuntu.

Julia installation

#Julia mirror ,ZJU
https://mirrors.zju.edu.cn/julia/releases/
#Aug4,19 installed;choose your own suitable version 
wget https://mirrors.zju.edu.cn/julia/releases/v1.2/julia-1.2.0-rc3-linux-x86_64.tar.gz
tar -xvzf julia-1.2.0-rc3-linux-x86_64.tar.gz
./julia-1.2.0-rc3/bin/julia
julia > import Pkg
julia > Pkg.add("IJulia")

C installation

pip3 install jupyter-c-kernel
install_c_kernel

Deploy Jupyter on server with no permission to use web service ports

  1. Dependencies: get jupyter notebook/lab installed
  2. Activate locally Jupyter service
    nohup .../jupyter notebook --notebook-dir --port --no-browser &
  3. Construct SSH tunnel to server (execute following command on your own terminal)
    ssh -L :localhost: user@address
    This process needs to keep running in the background
  4. Use local browser to access localhost:
    If your server has it's own public IP ,you can skip step 3 and access your workplace directly via browser,with address :ip:port

Setup password for your jupyter

jupyter notebook password

Overcome plotly rendering problem

--NotebookApp.iopub_data_rate_limit=1.0e1
Does not work in jupyter lab.

Manage currently-running Jupyter

View all Jupyter current user started:jupyter notebook list
Kill specific notebook : fuser -k '8999(port)'/tcp

Clone server-side files via jupyer cell lines

Oss2 provide a convenient python SDK to manipulate oss bucket, we can utilize oss2 to backup server-side files.

  • install oss2 ! pip install oss2
  • cell running following command to upload file to your oss bucket
import oss2
auth = oss2.Auth('', '')
bucket = oss2.Bucket(auth, '', '')
bucket.put_object_from_file('', 'content of object' )

Far more oss bucket & NAS artifice will be updated separately.
Make sure you could be responsible for compliance with your own behavior.

[1] https://jupyterlab.readthedocs.io/en/latest/
[2] manipulate oss bucket via python SDK

你可能感兴趣的:(Using Jupyter Gracefully~)