常用Notebook使用笔记

基础备忘

jupyter

常用命令

  • 安装

    1
    pip install jupyterthemes
  • 列出主题

    1
    jt -l
  • 选择主题

    1
    2
    3
    4
    5
    6
    7
    8
    9
    jt -t grade3     #白
    jt -t solarizedl #浅土黄
    jt -t gruvboxl #深土黄
    jt -t chesterish #深蓝
    jt -t solarizedd #深绿
    jt -t oceans16 #深灰
    jt -t monokai #黑白
    jt -t gruvboxd #黑黄
    jt -t onedork #黑灰
  • 代码转PPT

    1
    jupyter nbconvert *.ipynb --to slides --post serve
  • 绑定IP端口启动服务

    1
    jupyter notebook --ip=10.0.0.1 --port=10001
  • 指定目录

    1
    jupyter notebook --ip=10.0.0.1 --port=10001 nibilaoyedenotebook
  • 创建密码

    1
    2
    jupyter notebook --generate-config
    jupyter notebook password --ip=10.0.0.1 --port=10001
  • 插件

    1
    2
    3
    4
    5
    6
    7
    debugger
    jupyterlab-chart-editor
    toc
    jupyterlab-drawio
    jupyterlab-execute-time
    jupyterlab_filetree
    jupyterlab_go_to_definition

    列出插件列表

    1
    2
    3
    jupyter --version

    jupyter labextension list

zeppelin

ldap 认证

  • userDnTemplate中的{0}表示登录时输入的用户名,
  • conf/zeppelin-site.xml修改zeppelin.anonymous.allowed属性为false
  • ldapRealm.contextFactory.authenticationMechanism后面的赋值选项

nginx代理关键配置

  • zeppelin

    1
    2
    3
    4
    5
    6
    7
    cat conf/zeppelin-site.xml
    <property>
    <name>zeppelin.server.context.path</name>
    <value>/zeppelin/</value>
    <description>Context Path of the Web Application</description>
    </property>

  • nginx

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    upstream zeppelin {
    server 10.0.0.1:8080;
    }

    location /zeppelin
    {
    proxy_pass http://zeppelin;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    location /zeppelin/ws { # For websocket support
    proxy_pass http://zeppelin;
    proxy_http_version 1.1;
    proxy_set_header Upgrade websocket;
    proxy_set_header Connection upgrade;
    proxy_read_timeout 86400;
    }

相关资料

-upyter Notebooks 共享社区