-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_jupyter.sh
executable file
·35 lines (25 loc) · 1.08 KB
/
run_jupyter.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
#SBATCH --job-name=preprocess_metabolites
#SBATCH -p benos
#SBATCH -t 8:00:00
#SBATCH --gres=gpu:0
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=1
#SBATCH --output sbatch.stdout
# GET TUNNELING INFO====
XDG_RUNTIME_DIR=""
ipnport=$(shuf -i8000-9999 -n1)
ipnip=$(hostname -i)
token=$(xxd -l 32 -c 32 -p < /dev/random)
# PRINT TUNNELING INSTRUCTIONS====
echo -e "
Copy/Paste this in your local terminal to ssh tunnel with remote
-----------------------------------------------------------------
ssh -N -L $ipnport:$ipnip:$ipnport [email protected]
-----------------------------------------------------------------
Then open a browser on your local machine to the following address
------------------------------------------------------------------
http://localhost:$ipnport?token=$token
------------------------------------------------------------------
"
jupyter lab --ServerApp.iopub_data_rate_limit=100000000000000 --port=$ipnport --ip=$ipnip --ServerApp.password='' --ServerApp.token="$token" --no-browser