Saturday, August 8, 2020

Create jupyter notebook connection using SSH

 Source: https://www.digitalocean.com/community/tutorials/how-to-install-run-connect-to-jupyter-notebook-on-remote-server



Ensure server is accessible using ssh

1.  Log in with port forwarding

ssh -L 8000:localhost:8888 sammy@your_server_ip


2. Activate environment


source ~/environments/my_env/bin/activate


3. Run jupyter notebook

jupyter notebook


4. Access jupyter from local browser

http://localhost:8000/?token=b80b0faa6be49a2b790389893bdef230dbeb7115c60f2364





Create docker image from anaconda environment

 Source:

https://haveagreatdata.com/posts/step-by-step-docker-image-for-data-science-projects/


1. Create project as follows

.
├── Dockerfile
├── environment.yml
└── src
    └── hello.py

2. Dump yml environment file

conda env export > environment.yml

3. Create Dockerfile as follows

FROM continuumio/miniconda3:4.8.2

COPY environment.yml /opt/env/
RUN conda env update -n base -f /opt/env/environment.yml \
    && conda clean -afy

4. Run Dockerfile

docker build -t stk:latest .






Install docker on Ubuntu

 Source: https://docs.docker.com/engine/install/ubuntu/

Section: Install using the convenience script

$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh

<output truncated>

If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like:

  sudo usermod -aG docker your-user

Remember to log out and back in for this to take effect!

The Docker service needs to be setup to run at startup. To do so, type in each command followed by enter:

sudo systemctl start docker
sudo systemctl enable docker


Log out


$ logout


Then run docker example

docker run -it ubuntu bash

OR

docker run hello-world








Loud fan of desktop

 Upon restart the fan of the desktop got loud again. I cleaned the desktop from the dust but it was still loud (Lower than the first sound) ...