Skip to content

Instantly share code, notes, and snippets.

@naure
Last active August 16, 2017 11:03
Show Gist options
  • Save naure/56728e0757225b5fe53d0473e6662e84 to your computer and use it in GitHub Desktop.
Save naure/56728e0757225b5fe53d0473e6662e84 to your computer and use it in GitHub Desktop.
Interactive work on remote server
# 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