# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # Running Jupyter Notebook on EC2

# ### <font color = 'blue'> This Tutorial is for running Jupyter Notebook on Amazon EC2 instance. This is not a beginner's tutorial but I will be explaining every step so that everyone can follow. </font>

# ### Step 1 - Launch your EC2 by following the steps in this blog - :
#
#

# ### <font color = 'red'> When Instance is launched, make sure you have something like the following screen: </font>
#
#
# ![title](Capture1.PNG)

# ### <font color = 'red'> Also make sure that Anaconda is installed on your instance by typing: </font>
# #### - "which python /home/ubuntu/anaconda3/bin/python" on the terminal
# #### It will show you the following output
#
#
# ![title](Capture2.PNG)

# ### Step 2 - Now follow the following steps for creating password of your Jupyter Notebook:
# #### - run these commands one by one on the terminal:
# #### - ipython
# #### - from IPython.lib import passwd
# #### - passwd()
# #### - Enter password: (Write your password here)
# #### - Verify your password
# #### - <font color = 'red'> Terminal will show something like this - 'sha1:98ff0e580111:12798c72623a6eecd54b51c006b1050f0ac1a62d' [save this output somewhere else] </font>
# #### - exit

# ### Step 3 - Create a config file by running following command on terminal:
#
# #### - jupyter notebook --generate-config
#
# ### <font color = 'blue'> Now lets create http certificates by runing following commands one by one on terminal: </font>
#
# #### - mkdir certs
# #### - cd certs
# #### - sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
# #### - Now few questions will be asked from you, answer them as you want
#

# ### Step 4 - Configuring Jupyter
#
# #### - Go to "cd ~/.jupyter" using terminal
# #### - edit it by using "vi jupyter_notebook.config.py" on terminal or copy this file to your computer for editing using any online software such as FileZilla
# #### - <font color = 'blue'> Insert following lines at the top of the document: </font>
# #### - c = get_config() 
# #### - c.IPKernelApp.pylab = 'inline'  # if you want plotting support always in your notebook
# #### - c.NotebookApp.certfile = u'/home/ubuntu/certs/mycert.pem' #location of your certificate file
# #### - c.NotebookApp.ip = '0.0.0.0'
# #### - c.NotebookApp.open_browser = False  #so that the ipython notebook does not opens up a browser by default
# #### - c.NotebookApp.password = u'<PASSWORD>:<PASSWORD>'  [change this with your password that you saved in Step 2]
# #### - c.NotebookApp.port = 8888
#
# ### <font color = 'red'> Exit the file </font>

# ### Step 5 - Starting Jupyter Notebook
#
# #### <font color = 'blue'> Create folder for your notebooks by writing following commands on terminal: </font
# #### - cd ~
# #### - mkdir Notebooks
# #### - cd Notebooks
#
# ### <font color = 'red'> Now just write "jupyter notebook" on the terminal </font>
#
# #### - Terminal will look something like this:
#
# ![title](Capture3.PNG)
#

# ### <font color = 'blue'> Now open a browser and write: </font>
# #### - https://[Your Public DNS]:8888/ [change your public DNS here] 
# #### - It will end up looking like this - https://ec2-54-160-17-108.compute-1.amazonaws.com:8888/
# #### - You can get your public DNS from your instance page while it is running, shown as follows:
#
# ![title](Capture4.PNG)

# ### <font color = 'green'> Now you will be able to use Jupyter Notebook on EC2 instance - Congrats :) </font>



StarcoderdataJupyterScriptsDedupFiltered