Show Menu
Cheatography

devops Cheat Sheet (DRAFT) by

my cheatsheet to learn

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Dash

Install virtual enviro­nment
python3 -m venv name_f­older
Create an enviro­nment for project inside folder. If folder does not exist, create one
Flash + plotly + react = Dash

GIT

git clone link-t­o-g­it-­folder
clone code from git folder
mkdir
make directory. This command is useful for make new directory in termux.
git init
initia­lized empty git repository
touch name_file
create file
Manager code

NGINX

sudo apt install nginx
install nginx
sudo nano /etc/n­gin­x/s­ite­s-e­nab­led­/da­sh_app
create dash_app to use with nginx
172.10­5.7­2.121
IP server
80
port for incoming request
port of Gunicorn
server {
  listen 80;
  server­_name 172.10­5.7­2.121;
  location / {
 ­ ­pro­xy_pass http:/­/12­7.0.0.1­:8000;
 ­  proxy_­set­_header Host $host;
 ­  proxy_­set­_header X-Forw­ard­ed-For $proxy­_add_x_
 ­  forwar­ded­_for;
  }
}
 

SSH

ls
list out
rm
remove
sudo
super user do
cat
concat­enate

WSGI-g­unicorn

gunicorn name_p­yth­on_­app­:se­rve­r_n­ame­_in­_py­tho­n_app
run app by gunicorn
gunicorn --work­ers=9 --thre­ads=4 name_p­yth­on_­app:app
create 9 workers and 4 threads for each worker
Bọc app python để mong muốn có thể nhân đôi nhiều phiên bản của app python, để có thể thực hiện nhiều yêu cầu cùng lúc

wrap python app to multi versions to implement many requests

Flask

@app.r­out­e("/­cha­nge­_im­g_c­olo­r", method­s=[­"­POS­T"])

docker

docker file
docker image
docker build -t myimage .
build and tag an image from a Dockerfile
docker images
show a list of all images