Last active
August 16, 2017 11:03
-
-
Save naure/56728e0757225b5fe53d0473e6662e84 to your computer and use it in GitHub Desktop.
Interactive work on remote server
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
# Start a stable Jupyter server. | |
# Connect to http://localhost:9999/ with token 1234 | |
# May require: echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config | |
remote-jupyter: | |
ssh SERVER \ | |
-L 9999:localhost:9999 -t \ | |
'nohup \ | |
jupyter notebook \ | |
--port=9999 --port-retries=0 \ | |
--NotebookApp.token=1234 \ | |
< /dev/null \ | |
& bash' | |
# Send local files to the server | |
to-server: | |
rsync -vurh -e ssh . SERVER: | |
# Watch local files and keep the server in sync | |
to-server-watch: | |
fswatch --version || brew install fswatch | |
make to-server | |
fswatch -o . | xargs -n1 -I{} make to-server | |
# Download files from the server | |
from-server: | |
rsync -vurh -e ssh SERVER: . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment