{**a, **b, **c}
result = []
for c in collections:
inced = 0
for n, collection in enumerate(result):
if collection["href"] == c["href"]:
result[n]["wait"] += c["wait"]
inced = 1
if inced == 0: result.append(c)
result = []
for c in collections:
for n, collection in enumerate(result):
if collection["href"] == c["href"]:
result[n]["wait"] += c["wait"]
break
else: result.append(c)
iptables -F
sudo apt-get install nginx
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
multi_accept on;
}
http {
sendfile on;
keepalive_timeout 15;
proxy_buffers 8 64k;
proxy_intercept_errors on;
proxy_connect_timeout 1s;
proxy_read_timeout 3s;
proxy_send_timeout 3s;
server {
listen 80;
server_name a.ru b.ru;
access_log /var/log/nginx/1.access_log;
error_log /var/log/nginx/1.error_log warn;
charset utf-8;
ssi on;
ssi_value_length 1024;
location / {
proxy_pass http://10.8.0.6:9000;
proxy_set_header X-Real-IP $remote_addr;
proxy_intercept_errors off;
proxy_read_timeout 5s;
proxy_send_timeout 3s;
gzip on;
gzip_min_length 1024;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/xml;
}
}
}
import requests
proxies = {
'http': 'http://10.10.1.10:3128',
'https': 'http://10.10.1.10:1080',
}
requests.get('http://example.org', proxies=proxies)
f = lambda text, command: text[text.rfind(command)+len(command):].strip()
>>> f('/play 20', '/play')
'20'