gunicorn run:app --workers=9
gunicorn run:app --workers=9 --worker-class=meinheld.gmeinheld.MeinheldWorker
Macbook Pro 2015 Python 3.7
Framework | Server | Req/s | Max latency | +/- Stdev |
---|
Чеклист для собеседования | |
Общее | |
[] SOLID, расшифровка каждой буквы + примеры из го | |
[] Паттерны из Gang of Four, мочь сказать какие виды + 3-4 запомнить и как их использовать | |
[] Что такое хеш таблица, сет, стек, очередь и для чего нужны | |
[] Что такое TPC/IP, в чем отличия с UDP? | |
[] Как работает http запрос? Коды ошибок, http методы. | |
[] Отличия http и https. Как работает https? | |
[] http/1 и http/2 в чем отличия? |
gunicorn run:app --workers=9
gunicorn run:app --workers=9 --worker-class=meinheld.gmeinheld.MeinheldWorker
Macbook Pro 2015 Python 3.7
Framework | Server | Req/s | Max latency | +/- Stdev |
---|
#!/bin/bash | |
# Do not run if removal already in progress. | |
pgrep "docker rm" && exit 0 | |
# Remove Dead and Exited containers. | |
docker rm $(docker ps -a | grep "Dead\|Exited" | awk '{print $1}'); true | |
# It will fail to remove images currently in use. | |
docker rmi $(docker images -qf dangling=true); true |
Hi there! Since this post was originally written, nvm
has gained some new tools, and some people have suggested alternative (and potentially better) approaches for modern systems. Make sure to have a look at the comments to this article, before following this guide!
Trickier than it seems.
import urllib.parse | |
url = "http://stackoverflow.com/search?q=question" | |
params = {'lang':'en','tag':'python'} | |
url_parts = list(urllib.parse.urlparse(url)) | |
query = dict(urllib.parse.parse_qsl(url_parts[4])) | |
query.update(params) | |
url_parts[4] = urllib.parse.urlencode(query) |
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
# This is a really old post, in the comments (and stackoverflow too) you'll find better solutions. | |
def find(key, dictionary): | |
for k, v in dictionary.iteritems(): | |
if k == key: | |
yield v | |
elif isinstance(v, dict): | |
for result in find(key, v): | |
yield result | |
elif isinstance(v, list): |