Sunday, March 13, 2022

Adding ssh keys to github

 To authenticate a connection from repository, you need to


1. Generate ssh keys in your machine

ssh-keygen -o -t rsa -C "your@email.com"

2. Copy the keys to github

Display the key

cat ~/.ssh/id_rsa.pub

Copy it to the ssh keys in github

3. Make sure the config files have the right url. Here is how it should look like. Make sure that the url has the structure shown below


[core]

        repositoryformatversion = 0

        filemode = true

        bare = false

        logallrefupdates = true

[remote "origin"]

        url = ssh://git@github.com:22/mohamedabolfadl/dubbizle_scraper.git

        fetch = +refs/heads/*:refs/remotes/origin/*

[branch "main"]

        remote = origin


Source

https://jdblischak.github.io/2014-09-18-chicago/novice/git/05-sshkeys.html


Setup the working space

 

1. Create anaconda environment

conda create --name scrappers --clone base


2. Activate environment

conda activate scrappers


3. Install key libs

$ conda config --add channels conda-forge
$ conda install cookiecutter
sudo apt-get install tree
Docker [Unverified] https://docs.docker.com/engine/install/ubuntu/
curl -fsSL https://get.docker.com -o get-docker.sh
DRY_RUN=1 sh ./get-docker.sh
4. Create cookiecutter project
mkdir defproj
cd defproj
cookiecutter -c v1 https://github.com/drivendata/cookiecutter-data-science
mkdir project_name
cd project_name
mkdir docker
5. Download Dockerfiles
curl -o Dockerfile https://raw.githubusercontent.com/mohamedabolfadl/default_docker_datascience/main/Dockerfile
cp Dockerfile project_name/docker/Dockerfile
curl -o project_name/docker/main.py https://raw.githubusercontent.com/mohamedabolfadl/default_docker_datascience/main/main.py


6. Initialize git repository [Not working at the push stage]
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/USERNAME/REPONAME.git
git remote -v
git remote set-url origin git@github.com:USERNAME/REPONAME.git
git push -u origin main

6. Run Docker
docker build -t scrapper .

docker run -it -p 8080:8080 --mount type=bind,source=/home/mohamed/Desktop/old/defproj,target=/app  scrapper




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) ...