#!/bin/bash #PBS -P SHORTNAME #PBS -q gpu_1 #PBS -l select=1:ncpus=1:ngpus=1 #PBS -l walltime=8:00:00 #PBS -N Jupyter #PBS -m abe #PBS -M YOUR@EMAIL.ADDRESS module purge module add chpc/python/anaconda/3-2019.10 # Go to your directory cd /mnt/lustre/users/username/jupyter_notebook ## get tunneling info XDG_RUNTIME_DIR="" ipnport=$(shuf -i8000-9999 -n1) ipnip=$(hostname -i) ## print tunneling instructions to an output file echo -e " Copy/Paste this in your local terminal to ssh tunnel with remote ----------------------------------------------------------------- ssh -N -L $ipnport:$ipnip:$ipnport user@host ----------------------------------------------------------------- Then open a browser on your local machine to the following address ------------------------------------------------------------------ localhost:$ipnport ------------------------------------------------------------------ " > tunnel.out ## start an ipcluster instance and launch jupyter server jupyter-notebook --NotebookApp.token='' --no-browser --port=$ipnport --ip=$ipnip sleep 8h