My roommate, Monica, introduced me to Jupyter Notebooks last year. And since then, I’ve been addicted to them for any Python coding I do, so much that I’m considering recreating this entire blog in Jupyter instead of WordPress.

I’m not going to get into the details of what Jupyter is, and why you should consider using it. However, to give you a broad picture, Jupyter uses the Literate Programming style pioneered by Stanford’s Donald Kunth. In this, you can have human friendly text, mathematical equations (with full LaTeX support), images or diagrams, punctuated by cells with code blocks in them. There are a lot of example notebooks available online that can be found easily, with their subjects ranging from Computer Vision, to Machine Learning, to LIGO’s dataset, and more.

However, recently I found myself trying to run a lot of Python scripts via SSH on a remote server. And while executing them in Shell has it’s pros, it was annoying when I had to make minor multiline edits earlier on in the code, because re-executing everything from scratch takes me as long as 2-3 hrs for my current project. I found myself wishing that Jupyter on my local machine could run a kernel on my server. Turns out that’s really easy to do!

Step 1: On your Remote Computer

SSH into your remote server/machine. Open a Jupyter Notebook using the no-browser option (since we don’t need the browser just yet) on the Terminal.

sasha@remote $ jupyter notebook --no-browser --port=8887

I’ve changed the port to 8887 just to make it easier to explain the next step.

Jupyter generally returns to you a token with the URL for your browser for the first time you login to it. If you get one, store this somewhere for later.

Step 2: On your Local Computer

Start an SSH Tunnel, and connect it to the Jupyter notebook you just started on the server.

ssh -N -L localhost:8888:localhost:8887 sasha@remote

-L binds the local_address:port1 to a remote_address:port2. To be specific, it specifies that the connections for the socket on the local host are to be forwarded to the remote host. The socket then listens to the specified bind address.

-N specifies not to execute a remote command. This is useful when forwarding ports.

On your local computer, navigate to localhost:8888. The browser will probably ask you for a token. Put the token the Remote Computer returned to you in the earlier step.

And that’s it!

Source: https://techtalktone.wordpress.com/2017/03/28/running-jupyter-notebooks-on-a-remote-server-via-ssh/

RUNNING JUPYTER NOTEBOOKS ON A REMOTE SERVER VIA SSH相关推荐

  1. jupyter 写sql_了解适用于SQL Server的Jupyter Notebooks

    jupyter 写sql 介绍 (Introduction) The Jupyter notebook is a powerful and interactive tool that supports ...

  2. 萌新向Python数据分析及数据挖掘 第二章 pandas 第二节 Python Language Basics, IPython, and Jupyter Notebooks...

    Python Language Basics, IPython, and Jupyter Notebooks In [5]: import numpy as np #导入numpy np.random ...

  3. 第02章 Python语法基础,IPython和Jupyter Notebooks

    第2章 Python语法基础,IPython和Jupyter Notebooks 当我在2011年和2012年写作本书的第一版时,可用的学习Python数据分析的资源很少.这部分上是一个鸡和蛋的问题: ...

  4. (数据分析)第02章 Python语法基础,IPython和Jupyter Notebooks.md

    第2章 Python语法基础,IPython和Jupyter Notebooks 当我在2011年和2012年写作本书的第一版时,可用的学习Python数据分析的资源很少.这部分上是一个鸡和蛋的问题: ...

  5. 《利用Python进行数据分析·第2版》第2章 Python语法基础,IPython和Jupyter Notebooks

    第 1 章 准备工作 第 2 章 Python 语法基础,IPython 和 Jupyter Notebooks 第 3 章 Python 的数据结构.函数和文件 第 4 章 NumPy 基础:数组和 ...

  6. 《利用Python进行数据分析·第2版》第2章 Python语法基础,IPython和Jupyter Notebooks...

    第1章 准备工作 第2章 Python语法基础,IPython和Jupyter Notebooks 第3章 Python的数据结构.函数和文件 第4章 NumPy基础:数组和矢量计算 第5章 pand ...

  7. 独家|手把手教你赋能Jupyter Notebooks!(附代码)

    作者:Pranjal Chaubey 翻译:宋文伯 校对:丁楠雅 本文约1700字,建议阅读5分钟. 本文将通过介绍Jupyter Notebook的附加扩展组件和指令,为Jupyter Notebo ...

  8. Jupyter Notebooks的安装和使用介绍

    最近又开始重新学习Python,学习中使用到了一款编辑器Jupyter Notebooks ,非常想安利给初学python的同学. 注:本文内容仅针对windows环境下安装和配置Jupyter No ...

  9. Jupyter Notebooks学习分享

    Jupyter Notebooks 是数据科学/机器学习社区内一款非常流行的工具.Analytics Vidhya 的 Pranav Dar 近日发表了一篇上手使用 Jupyter Notebooks ...

最新文章

  1. 转载:linux+arm 网卡故障调试:ethtoolphy寄存器读写
  2. 二叉树的先序遍历和非递归遍历
  3. 前端打印第三方插件_vscode mock服务插件amock教程
  4. Spring Boot,@ EnableWebMvc和常见用例
  5. 重读《从菜鸟到测试架构师》--黑色的盒子里有什么(中)
  6. 新颖的自我介绍_公众场合,如何做一个吸睛的自我介绍?
  7. GIS二次开发之上一个视图/下一个视图
  8. 若依前后端分离版本如何使用Swagger
  9. linux0.11 init函数,linux0.11启动与初始化
  10. 红帽(redhat linux) 初级认证(RHCSA)考点详解
  11. 【玩儿法】真不是装X 为了不加班我一直用这些小众软件
  12. python复数类型的虚部通过_Python 复数数据类型详解(complex)[学习 Python 必备基础知识][看此一篇就够了]...
  13. OJ每日一练——过滤多余的空格
  14. CentOS yum方式升级内核kernel
  15. MATLAB永久常数
  16. c35是什么意思_什么是C35混凝土?
  17. 头的各个部位示意图_牛肉的部位图解与做法+牛肉各个部位分布图及质地简介...
  18. Excel教程:Excel中最强大的快捷键你知道吗
  19. NYOJ-20 吝啬的国度 AC
  20. 继承----有关虚函数和虚拟继承

热门文章

  1. [iphone]XML 解析 之 TBXML 介绍
  2. Win10: tensorflow 学习笔记(3)
  3. linux开启内部路由转发功能
  4. 关于Linux的缓存内存 Cache Memory详解
  5. matlab图像处理——平滑滤波
  6. C++需要输出一个参数的地址时可能达不到预期的效果
  7. 起风了2019-12-26
  8. 机械错题集锦2017-12-21
  9. ajax隐藏button,jquery下的ajax应用-form和button触发
  10. 定义咯一个枚举变量枚举变量怎么打印出来 linux c,以C语言的字符串形式输出枚举变量...