setup https for wordpress with docker

1. install docker-ce

2. install docker-compose

sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

3. setup domain name, and link it to the node you are setting up your web server; install letsencrypt on the webserver

git clone
cd certbot
sudo -H ./letsencrypt-auto certonly --standalone -d -d --email

4. install wordpress using docker with the docker-compose.yml below; and do “sudo docker-compose up -d”

version: '3.3'

     image: mysql:5.7
       - db_data:/var/lib/mysql
     restart: always
       MYSQL_ROOT_PASSWORD: somewordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress

       - db
     image: wordpress:latest
       - "80:80"
       - "443:443"
     restart: always
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpress
       WORDPRESS_DB_NAME: wordpress
    db_data: {}

5. after start the wordpress docker container,

mkdir -p blog/etc sudo docker cp wordpress_wordpress_1:/etc/apache2 ~/blog/etc/

6. login to the wordpress docker container and do following

a2enmod ssl
service apache2 restart

7. shutdown the container and put the letsencrypt key and certificate combo to the ~/blog/etc/apache2 folder

cd ~/blog/etc/apache2/sites-enabled
sudo cp /etc/letsencrypt/live/*.pem .
sudo ln -s ../sites-available/default-ssl.conf .
# modify the following two lines of default-ssl.conf
SSLCertificateFile      /etc/apache2/sites-enable/fullchain.pem
SSLCertificateKeyFile /etc/apache2/sites-enabled/privkey.pem
cd ~/blog/etc/apache2/mods-enabled
sudo ln -s ../mods-available/socache_shmcb.load .

8. modify the docker-compose.yml file add the following two lines

    - /home/tbjc1magic/blog/etc/apache2:/etc/apache2

9. start docker containers again and turn on the ssl redirect plugin

sudo docker-compose up -d

Multiprocessing 1

I have been using python multiprocessing for quite a bit time, but it was all simple pool and I would like to understand deeper than just blindly using the multiprocessing package.

  1. given a list of word and start two process to print out the list in sequence

The same functionality can also be achieved using pipe

Google Compute Engine enable ssh using password

Find Nearest K points

Efficiently find nearest points KD tree

The basic idea is illustrated here

k-d Tree and Nearest Neighbor Search

though I don’t think the pruned areas are plotted correctly.

This algorithms are used for KNN

Similar tree structure quad-tree/octree are explained here