File size: 776 Bytes
e9d4572
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
lines = []

for _ in range(50, 66):
    lines.append("screen -dmS \"server.80"+str(_)+"\" bash -c \'while : ;do python3 server.py 80"+str(_)+"; done;\'\n")

with open('run.bash', 'wt') as f:
    f.writelines(lines)

lines = []

for _ in range(50, 66):
    lines.append("screen -S \"server.80"+str(_)+"\" -X quit\n")

with open('kill.bash', 'wt') as f:
    f.writelines(lines)

lines = []

for _ in range(50, 66):
    lines.append("server 127.0.0.1:80"+str(_)+" weight=4 max_fails=2 fail_timeout=600s;\n")

with open('nginx.txt', 'wt') as f:
    f.writelines(lines)

lines = ["ufw allow 80/tcp\n"]

for _ in range(50, 66):
    lines.append("ufw allow 80"+str(_)+"/tcp\n")

with open('tcp.bash', 'wt') as f:
    f.writelines(lines)

#/etc/nginx/sites-available
#/var/log/nginx