Skip to content

Instantly share code, notes, and snippets.

@aksakalli
Last active July 29, 2018 20:25
Show Gist options
  • Save aksakalli/59b3f0282eaced6c60a795f841099a8f to your computer and use it in GitHub Desktop.
Save aksakalli/59b3f0282eaced6c60a795f841099a8f to your computer and use it in GitHub Desktop.
Makefile for managing the Jupyter Notebook EC2
INSTANCE_ID=i-....
INSTANCE_IP=....
.PHONY: status
status:
aws ec2 describe-instances --instance-ids ${INSTANCE_ID} --output table
.PHONY: start
start:
aws ec2 start-instances --instance-ids ${INSTANCE_ID} --output table
.PHONY: stop
stop:
aws ec2 stop-instances --instance-ids ${INSTANCE_ID} --output table
.PHONY: notebook
notebook:
ssh -t -L 8888:localhost:8888 ubuntu@${INSTANCE_IP} 'bash -l -c "jupyter notebook"'
.PHONY: connect
connect:
ssh ubuntu@${INSTANCE_IP}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment