Skip to content

Instantly share code, notes, and snippets.

View 33eyes's full-sized avatar

Arina 33eyes

View GitHub Profile
33eyes /
Last active March 22, 2022 02:50
How to render Plotly in Jupyterlab on SageMaker
from IPython.display import HTML
import as px
# Create Plotly fig objects in plotly as usual, and then use HTML(fig.to_html()) to render them in Jupyterlab on SageMaker.
# Or just write to html file: fig.write_html("fig.html") and view it.
33eyes /
Last active May 27, 2024 13:13
How to commit jupyter notebooks without output to git while keeping the notebooks outputs intact locally

Commit jupyter notebooks code to git and keep output locally

  1. Add a filter to git config by running the following command in bash inside the repo:
git config filter.strip-notebook-output.clean 'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR'  
  1. Create a .gitattributes file inside the directory with the notebooks

  2. Add the following to that file:

33eyes /
Last active April 9, 2024 08:56
Jupyter notebook with nohup

Running jupyter notebook with nohup

This is helpful when running jupyter notebook on remote server (AWS) and tunneling into it, because with nohup the notebook process continues to run on the server even if you get disconnected from it (any running notebook code continues to run on the server without interruption, and just needs to be re-tunneled into).

Start jupyter notebook on remote server

In the remote server terminal, run:

nohup jupyter notebook &
33eyes /
Last active January 5, 2018 05:04
Setting up Ubuntu Vitrual Machine on Windows 10 64-bit host PC