Last active
July 29, 2018 20:25
-
-
Save aksakalli/59b3f0282eaced6c60a795f841099a8f to your computer and use it in GitHub Desktop.
Makefile for managing the Jupyter Notebook EC2
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
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