From edad47742caef09b589fceceea18e5d18bbffd4b Mon Sep 17 00:00:00 2001 From: Neil Douglas Date: Wed, 15 May 2024 11:33:31 +0100 Subject: [PATCH] add port finding tip on Jupyter page --- docs/source/applications/jupyter.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/source/applications/jupyter.rst b/docs/source/applications/jupyter.rst index 2050882..54d2025 100644 --- a/docs/source/applications/jupyter.rst +++ b/docs/source/applications/jupyter.rst @@ -62,6 +62,16 @@ Finally ``Ctrl + left mouse click`` on the link from the first terminal session ssh -L 8888:localhost:8889 abc123@viking.york.ac.uk ssh -N -L 8889:localhost:8888 node112 +.. tip:: + + To help find an open port you can try running this command: + + .. code-block:: console + + for p in {8000..9000}; do m=$(netstat -l|grep -c localhost:${p}); if [[ $m == 0 ]]; then echo "try $p"; break; fi; done + + *Thanks to Felix Ulrich-Oltean for this suggestion* + .. FIXME: below method not working. ..