This file contains 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
import time | |
import pandas as pd | |
def pretty_time(sec: int) -> str: | |
return time.strftime("%H:%M:%S", time.gmtime(sec)) | |
This file contains 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
import time | |
import pandas as pd | |
def pretty_time(sec: int) -> str: | |
return time.strftime("%H:%M:%S", time.gmtime(sec)) | |
This file contains 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
import time | |
import pandas as pd | |
def pretty_time(sec: int) -> str: | |
return time.strftime("%H:%M:%S", time.gmtime(sec)) | |
This file contains 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
import time | |
import pandas as pd | |
def pretty_time(sec: int) -> str: | |
return time.strftime("%H:%M:%S", time.gmtime(sec)) | |
This file contains 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
import time | |
import pandas as pd | |
def pretty_time(sec: int) -> str: | |
return time.strftime("%H:%M:%S", time.gmtime(sec)) | |
This file contains 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
#! /usr/bin/python3.10 | |
""" | |
This module is used for checking excessive use by V2Ray users. | |
Install Pandas beforehand via: `pip install pandas` | |
Sample Command: | |
$ journalctl -u v2ray --since "72 h ago" | grep email | cut -d " " -f 6,7,8,13 | python abnormal.py - | |
GitHub: https://github.com/Mahyar24/V2Conf |
This file contains 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
import math | |
from concurrent.futures import ProcessPoolExecutor, as_completed | |
from typing import Callable | |
def cut_list(data: list, n: int): | |
for i in range(1, math.ceil(len(data) / n) + 1): | |
yield data[(i - 1) * n: i * n] | |
def parallelize(func: Callable, inputs: list, n: int): |
This file contains 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
import math | |
from functools import cache | |
from typing import Optional | |
@cache | |
def is_prime(n: int, primes: tuple[int]) -> bool: | |
sqrt = math.floor(math.sqrt(n)) | |
for i in primes: |
This file contains 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
#! /usr/bin/env python3.10 | |
""" | |
This module is used for checking excessive use by V2Ray users. | |
Install Polars beforehand via: `pip install polars` | |
Sample Command: | |
$ journalctl -u v2ray --since "72 h ago" | grep email | cut -d " " -f 6,7,8,13 | python abnormal.py - | |
GitHub: https://github.com/Mahyar24/V2Conf | |
[email protected], Mon 28 Nov 2022 | |
""" |
This file contains 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
#! /usr/bin/env python3.10 | |
""" | |
This module is used for checking V2Ray traffic consumption. | |
Install Pandas beforehand via: `pip install pandas` | |
Sample Command: | |
$ xray api statsquery --server="127.0.0.1:10085" -pattern '' | python3 traffic.py - | |
GitHub: https://github.com/Mahyar24/V2Conf |
OlderNewer