Posts

Showing posts from October, 2020

if x: #x is treated True except for all empty data types [],{},(),'',0 False, and None

  if x: #x is treated True except for all empty data types [],{},(),'',0 False, and None https://stackoverflow.com/a/7825137
 http://xxx:8090/prometheus/api/v1/query_range?query=sum by (instanceId,instancePhase,project_id)(sum_over_time(porta_downstream_rq_5xx{instanceId="ltv-verda-porta",instancePhase="alpha",project_id="1cd9bc91b48e4d0b8c34cd6932f221a0",product_id=~".*",api_id=~".*", api_key_id=~".*"}[59s]))&start=1603436397&end=1603436657&step=60s

How to create a remote git branch

https://www.w3docs.com/snippets/git/how-to-create-a-remote-branch-in-git.html Step 1: you are on master branch then you are planning to create a new branch on the master branch use the following command git checkout -b <new-branch-name> this command is used to create a local branch on the current local branch ex:  git checkout -b feature/ixu then after that  git push -u origin your_remote_branch_name  ex:  git push -u origin feature/ixu

First step on makefile

 https://opensource.com/article/18/8/what-how-makefile https://www.tutorialspoint.com/makefile/index.htm https://makefiletutorial.com/

Docker and Docker-compose

 Docker compose: Hiểu nôm na nó là một bản soạn thảo Nó soạn thảo cái gì? -> Nó soạn thảo một danh mục các Docker image cần khởi tạo thành container Ví dụ bình thường bạn có 1 restful service, service dùng redis để cache và dùng mysql để lưu dữ liệu, và dùng kafka hoặc rabbitMQ để dùng Message Như vậy bạn hoàn toàn có thể tạo docker file cho service rồi build thành image và chạy manual thành container Bạn cũng có thể kéo Redis image về và chạy thành docker container Tương tự Mysql, hoặc Kafka hoặc rabbitMQ --> Việc cài đặt bằng tay thủ công cho các thành phần trên là khá ok, nhưng đó k phải là 1 cách hoàn hảo để deploy trên docker --> dẫn đến khái niệm docker-compose  Nó là 1 file định nghĩa các image cùng nhau được khởi tạo thành các docker trong một mạng network riêng --> với cách này bạn chỉ cần soạn thảo file docker-compose  cho các docker đó rôì dùng lệnh docker-compose up -d để build và run containers  Với cách này chỉ cần cài đặt docker trên môi t...

First steps for learning python

https://realpython.com/intro-to-pyenv/  for ubuntu  https://opensource.com/article/19/5/python-3-default-mac  for macos You should install python, and pip by pyenv , it is easy to install several versions of python on your machine and it is so easy to switch each version -------------------- install RUST and Cargo  and apply  Rust has multiple compilers and nightly contains some of the more experimental features. I was able to upgrade from stable Rust to nightly following the advice on the  Rust-Lang-Nursery GitHub Page : Install nightly toolchain: $ rustup install nightly Switch to nightly toolchain as default toolchain: $ rustup default nightly

First steps on Ansible

 https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-ubuntu https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html Ping remote server with ansible ansible all -i 122.248.226.169,  -m ping -u ubuntu 122.248.266.169 is the remote host -m ping: is ping -u ubuntu: is remote user