Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few fixes! #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bash_scripts/ec2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi
# Can't proceed if jq still not detected
if [ -z `which jq` ]; then
echo "'jq' was still not detected. We use 'jq' to create the 'agile_data_science' key and to get the external hostname of the ec2 instance we create."
echo "Please install jq, or open the script './ec2.sh' and use manually, creating the file './agile_data_science.pem' manually."
echo "Please install jq, or open the script './ec2.sh' and use manually, creating the file './datawizard.pem' manually."
echo "'jq' install instructions are available at https://github.com/stedolan/jq/wiki/Installation"
echo ""
echo "Goodbye!"
Expand Down
14 changes: 7 additions & 7 deletions bash_scripts/ec2_create_tunnel.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

EC2_HOSTNAME=ec2-52-25-21-103.us-west-2.compute.amazonaws.com
EC2_HOSTNAME=`cat ./.ec2_hostname`
if [ -z $EC2_HOSTNAME ]; then
echo ""
echo "No hostname detected in '.ec2_hostname' :( Exiting!"
Expand All @@ -19,20 +19,20 @@ echo ""
# Create a tunnel to our ssh instance, port 5000 and map it to localhost:5000
echo "First we will forward the port the web appliations use..."
echo "Forwarding the remote machine's port 5000 to the local port 5000, which you can then access at http://localhost:5000"
echo 'Executing: ssh -N -i ./agile_data_science.pem -o StrictHostKeyChecking=no -L 5000:localhost:5000 ubuntu@$EC2_HOSTNAME &'
ssh -N -i ./agile_data_science.pem -o StrictHostKeyChecking=no -L 5000:localhost:5000 ubuntu@$EC2_HOSTNAME &
echo 'Executing: ssh -N -i ./datawizard.pem -o StrictHostKeyChecking=no -L 5000:localhost:5000 ubuntu@$EC2_HOSTNAME &'
ssh -N -i ./datawizard.pem -o StrictHostKeyChecking=no -L 5000:localhost:5000 ubuntu@$EC2_HOSTNAME &
echo ""

# Create a tunnel for port 8888 for Jupyter notebooks
echo "Next we will forward the port the Jupyter Notebooks use..."
echo "Forwarding the remote machine's port 8888 to the local port 8888, which you can then access at http://localhost:8888"
echo 'Executing: ssh -N -i ./agile_data_science.pem -o StrictHostKeyChecking=no -L 8888:localhost:8888 ubuntu@$EC2_HOSTNAME &'
ssh -N -i ./agile_data_science.pem -o StrictHostKeyChecking=no -L 8888:localhost:8888 ubuntu@$EC2_HOSTNAME &
echo 'Executing: ssh -N -i ./datawizard.pem -o StrictHostKeyChecking=no -L 8888:localhost:8888 ubuntu@$EC2_HOSTNAME &'
ssh -N -i ./datawizard.pem -o StrictHostKeyChecking=no -L 8888:localhost:8888 ubuntu@$EC2_HOSTNAME &
echo ""

# Create a tunnel for port 8080 for Airflow
echo "Next we will forward the port that Airflow uses..."
echo "Forwarding the remote machine's port 8080 to the local port 8080, which you can then access at http://localhost:8080"
echo 'Executing: ssh -N -i ./agile_data_science.pem -o StrictHostKeyChecking=no -L 8080:localhost:8080 ubuntu@$EC2_HOSTNAME &'
ssh -N -i ./agile_data_science.pem -o StrictHostKeyChecking=no -L 8080:localhost:8080 ubuntu@$EC2_HOSTNAME &
echo 'Executing: ssh -N -i ./datawizard.pem -o StrictHostKeyChecking=no -L 8080:localhost:8080 ubuntu@$EC2_HOSTNAME &'
ssh -N -i ./datawizard.pem -o StrictHostKeyChecking=no -L 8080:localhost:8080 ubuntu@$EC2_HOSTNAME &
echo ""
2 changes: 1 addition & 1 deletion bash_scripts/ec2_kill_tunnel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

echo ""
echo "Killing all ssh tunnels!"
ps aux|grep 'ssh -N -i ./agile_data_science.pem'|grep -v grep|tr -s ' '|cut -d ' ' -f2|xargs kill
ps aux|grep 'ssh -N -i ./datawizard.pem'|grep -v grep|tr -s ' '|cut -d ' ' -f2|xargs kill
echo "All ssh tunnels killed..."
echo ""
2 changes: 1 addition & 1 deletion bash_scripts/ssh_ec2.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cd ~/desktop/projects/Agile_Data_Code_2
ssh -i agile_data_science.pem [email protected]
ssh -i datawizard.pem [email protected]