Last active
November 18, 2019 17:30
-
-
Save LiutongZhou/b06ae9e87aba3a7518e6a16240e7a79f to your computer and use it in GitHub Desktop.
Start Remote Jupyter on Boot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add to ~/.bash_aliases | |
alias port_forward='nohup ssh -N -f -L localhost:8889:localhost:8889 username:password@remote_server_ip' | |
alias remote_notebook_start='nohup ssh -f username:password@remote_server_ip "cd rne; conda activate env_name; jupyter notebook --no-browser --port=8889"; port_forward' | |
alias remote_notebook_stop='ssh username:password@remote_server_ip "pkill -u username jupyter"' | |
# Add this to crontab -e | |
@reboot cd /home/{username}; source ./.bashrc; ./miniconda3/envs/{env_name}/bin/jupyter-lab >> ./cronrun.log 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment