zoukankan      html  css  js  c++  java
  • jupyter

    • 查看token
      jupyter notebook list

    • ascii 报错
      LANG=zn jupyter notebook --ip spark004 --port 8123

    pip 安装复杂的lib

    pip install --ignore-installed imageio

    • 禁用下载

    密码

    $ python
    
    > from notebook.auth import passwd
    > passwd()
    

    如下是设置禁止下载文件的一个功能(根据需要配置)

    
    c.NotebookApp.ip = '172.23.10.254’    ##设置访问notebook的ip,*表示所有ip
     
    c.NotebookApp.port = 8886    ##指定访问的端口,默认是8888;
     
    c.NotebookApp.password = 'sha1:3c5ff94afafb:4daf378e7404a52e7b1a2823095b912aaa84e55c’    ##填写刚刚第2步生成的密钥
    
    import os, sys
     
    sys.path.append('/home/winco_jkjr/.jupyter/')
     
    import files_handlers
     
    c.ContentsManager.files_handler_class = 'files_handlers.ForbidDownloadingFilesHandler'
     
    c.ContentsManager.files_handler_params = {}
    
    from tornado import web
     
    from notebook.base.handlers import IPythonHandler
     
     
    class ForbidDownloadingFilesHandler(IPythonHandler):
     
        @web.authenticated
     
        def head(self, path):
     
            self.log.info("对不起,禁止下载文件!!!")
     
            raise web.HTTPError(403)
     
        @web.authenticated
     
        def get(self, path, include_body=True):
     
            self.log.info("对不起,禁止下载文件!!!")
     
            raise web.HTTPError(403)
    

    nohup jupyter notebook > /home/winco_jkjr/software/jupyter.log 2>&1 &

    • 定时重启

    #!/bin/sh
    
    . /etc/profile
    . ~/.bash_profile
    
    #/usr/sbin/fuser -k 8889/tcp 
    /usr/local/anaconda2/bin/jupyter notebook stop 8889
    /usr/local/anaconda2/bin/jupyter notebook >> .logs/jupyter.log 2>&1 &
    
  • 相关阅读:
    JAVA HttpsURLConnection 忽略对SSL valid 的验证
    IntellJ 13.x JPA Persistence Sample
    IntelliJ IDEA 13.x 下使用Hibernate + Spring MVC + JBoss 7.1.1
    Entity Framework + WCF REST JSON Service
    WCF Membership and Role Provider
    ASP.NET MVC 4 SimpleMembership Provider (1)
    Centos7下安装Nginx
    Centos7下部署docker
    centos 6.5将系统语言改为中文
    ensp配置DHCP实例
  • 原文地址:https://www.cnblogs.com/dzhs/p/14603532.html
Copyright © 2011-2022 走看看