This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import run | |
import requests | |
INTERFACE = "enp0s6" | |
LIMIT = "500" | |
WEBHOOK_URL = '' | |
MESSAGE = 'Traffic Warning' | |
p = run(["vnstat", INTERFACE, "--alert", "0", "3", "m", "total", LIMIT, "GB"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BIT: | |
def __init__(self, n): | |
self.n = n | |
self.t = [0] * (n + 1) | |
def update(self, idx, val): | |
idx += 1 | |
while idx <= self.n: | |
self.t[idx] += val | |
idx += idx & -idx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# certbot | |
# keep 80 accessable | |
sudo apt install certbot | |
sudo certbot certonly --standalone --preferred-challenges http -d DOMAIN_NAME | |
# gost config | |
log: | |
output: stderr # none, stderr, stdout, /path/to/file | |
level: info # debug, info, warn, error, fatal |