• 通过SSH远程使用ipython notebook


     本文讲述如何在本地用浏览器运行远程服务器上的iPython notebook服务。


    在远程机器上,启动IPython notebooks服务:

    remote_user@remote_host$ ipython notebook --no-browser --port=8889

    在本地机器上,打开一个可以SSH登录的工具:

    local_user@local_host$ ssh -N -f -L localhost:8888:localhost:8889 remote_user@remote_host

    第一个 -N 参数告诉SSH没有命令要被远程执行,对于port forwarding很有用。第二个参数 -f 告诉SSH在后台执行,因此本地终端就能一直保持有效能用。最后的参数 -L 是指定port forwarding的配置,远端端口是8889,本地的端口号的8888.

    我是用Xshell远程登录的,另外也有人推荐Putty之类的。XShell的配置如下:

    然后,在本地用浏览器打开localhost:8888,就会看到熟悉的IPython notebooks界面啦。

    远程服务器上会显示这些

    local_user@local_host$ ps aux | grep localhost:8889
    local_user 18418  0.0  0.0  41488   684 ?        Ss   17:27   0:00 ssh -N -f -L localhost:8888:localhost:8889 remote_user@remote_host
    local_user 18424  0.0  0.0  11572   932 pts/6    S+   17:27   0:00 grep localhost:8889
    
    local_user@local_host$ kill -15 18418

    若是想关闭任务,在远程服务器执行两次 ctrl-c即可。

    参考资料:

    https://coderwall.com/p/ohk6cg/remote-access-to-ipython-notebooks-via-ssh

  • 相关阅读:
    Linux网络编程必看书籍推荐
    SpringMVC DispatcherServlet初始化过程
    freemarker写select组件(五)
    hdu 1009 FatMouse' Trade
    新IOS编程语言 Swift 新编译器Xcode6
    NoSQL数据库:数据的一致性
    POJ 3041 Asteroids
    POJ 3342 Party at Hali-Bula (树形dp 树的最大独立集 判多解 好题)
    __repr__与__str__
    HDU 4950 Monster(公式)
  • 原文地址:https://www.cnblogs.com/naive/p/4877435.html
Copyright © 2020-2023  润新知