This file contains hidden or 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
#!/bin/bash | |
# Connects to remote server, mounts its file system or attaches to a tmux session. | |
USER="tom" | |
SERVER="[email protected]:8989" | |
LOCAL_KEY_PATH="/Users/tom/ssh_keys/key" | |
LOCAL_MOUNT_PATH="/Users/tom/mount/" | |
if [ $# -eq 0 ]; then |
This file contains hidden or 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
#!/bin/bash | |
# Checks current AWS instance state and stops it if it's running. | |
AWS_INSTANCE_ID="<Your instance ID here>" | |
AWS_STATE=$(aws ec2 describe-instances --instance-ids $AWS_INSTANCE_ID --query "Reservations[*].Instances[*].State.Name" --output text) | |
if [ "$AWS_STATE" == "running" ]; then | |
aws ec2 stop-instances --instance-ids $AWS_INSTANCE_ID >/dev/null | |
echo -n "The AWS instance is now stopping. It usually takes a while, so feel free to CTRL+C if you don't want to wait till the instance has fully stopped." |
This file contains hidden or 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
#!/bin/bash | |
# Starts your AWS instance, connects via SSH and launches Chrome with the remote Jupyter Notebook page open. | |
# Usage is as follows: | |
# 1. Run this script, so that Chrome has launched and SSH connection is established. | |
# 2. Execute 'jupyter notebook' on the AWS instance. | |
# 3. Reload the page in Chrome and log in to Jupyter Notebook. | |
# | |
# Note: we use Chrome, as there's a known issue with Safari that won't let Jupyter Notebook connect to a remote kernel. | |
# |