Skip to content

Instantly share code, notes, and snippets.

@tempookian
tempookian / cidrs_to_ips.py
Last active March 12, 2023 18:27
converts a list of cidrs stored in cidrs.txt into an ip list in ips.txt
import ipaddress
if __name__ == "__main__":
with open("cidrs.txt", "r") as infile:
cidrs = [l.strip() for l in infile.readlines() if l]
ips = [ip for cidr in cidrs for ip in list(
map(str, ipaddress.ip_network(cidr, strict=False)))]
with open("ips.txt", "w") as outfile:
@tempookian
tempookian / detect_system.py
Created March 15, 2023 13:51
returns the current system to be used to download the correct version of xray
import platform
import sys
def detect_system():
current_system = platform.system().lower()
current_machine = platform.machine().lower()
if current_system == "linux":
if hasattr(sys, "getandroidapilevel"):
return ('android', 'arm64', 'v8a')
if "arm" in current_machine:
pkg update && pkg -y --force-yes upgrade
pkg install -y --force-yes git python
git clone https://github.com/MortezaBashsiz/CFSCanner.git
cd CFScanner/python
git switch py-v2
pip install -r requirements.txt
python3 cfscanner.py --threads 4 --config ../bash/ClientConfig.json --upload-test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.