Published May-13-2020
sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
# Set the maximum number of open file descriptors
ulimit -n 20000000
# Set the memory size for TCP with minimum, default and maximum thresholds
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
| resolver 8.8.8.8; | |
| location /video/ { | |
| if ($request_uri ~ "^/video/(.+?)/.+") { | |
| set $upstream_host $1.googlevideo.com; | |
| add_header Content-Disposition "attachment; filename=video.mp4;"; | |
| } | |
| rewrite /video/.+?/(.+)$ /$1 break; | |
| proxy_buffering off; | |
| proxy_pass https://$upstream_host; | |
| proxy_set_header Host $upstream_host; |
| import functools | |
| def force_async(fn): | |
| ''' | |
| turns a sync function to async function using threads | |
| ''' | |
| from concurrent.futures import ThreadPoolExecutor | |
| import asyncio | |
| pool = ThreadPoolExecutor() |
Last major update: 21.10.2019
Аутентификация(authentication, от греч. αὐθεντικός [authentikos] – реальный, подлинный; от αὐθέντης [authentes] – автор) - это процесс проверки учётных данных пользователя (логин/пароль). Проверка подлинности пользователя путём сравнения введённого им логина/пароля с данными сохранёнными в базе данных.
Авторизация(authorization — разрешение, уполномочивание) - это проверка прав пользователя на доступ к определенным ресурсам.
Например после аутентификации юзер sasha получает право обращатся и получать от ресурса "super.com/vip" некие данные. Во время обращения юзера sasha к ресурсу vip система авторизации проверит имеет ли право юзер обращатся к этому ресурсу (проще говоря переходить по неким разрешенным ссылкам)
| #!/bin/bash | |
| ## Install Golang 1.13.4 64Bits on Linux (Debian|Ubuntu|OpenSUSE|CentOS) | |
| ## http://www.linuxpro.com.br/2015/06/golang-aula-1-instalacao-da-linguagem-no-linux.html | |
| ## Run as root (sudo su) | |
| ## Thank's @geosoft1 | @gwmoura | |
| GO_URL="https://storage.googleapis.com/golang" | |
| GO_VERSION=${1:-"1.13.4"} | |
| GO_FILE="go$GO_VERSION.linux-amd64.tar.gz" |
https://realpython.com/blog/python/asynchronous-tasks-with-django-and-celery/
$ pip install celery
$ sudo apt-get install rabbitmq-server