Commit 0247a504b6e512babb251bbc620b81fff6541801
Commits[COMMIT BEGIN]commit 0247a504b6e512babb251bbc620b81fff6541801 Author: 0x4248 <[email protected]> Date: Fri Apr 17 23:47:34 2026 +0100 usr/qsend: init diff --git a/usr/qsend/install.sh b/usr/qsend/install.sh new file mode 100644 index 0000000..877c71a --- /dev/null +++ b/usr/qsend/install.sh @@ -0,0 +1,2 @@ +cp qsend ~/.local/bin +chmod +x ~/.local/bin/qsend \ No newline at end of file diff --git a/usr/qsend/qsend b/usr/qsend/qsend new file mode 100644 index 0000000..bb6090f --- /dev/null +++ b/usr/qsend/qsend @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 + +import http.server +import socketserver +import sys +import subprocess + +def get_ip_addresses(): + ip_addresses = [] + local_ip = subprocess.check_output("hostname -I", shell=True).decode().strip() + ip_addresses.extend(local_ip.split(" ")) + return ip_addresses + +if __name__ == "__main__": + if len(sys.argv) != 2: + print("Usage: python -m qsend <file>") + sys.exit(1) + + file_to_send = sys.argv[1] + ip_addresses = get_ip_addresses() + + for ip in ip_addresses: + print(f"curl -O http://{ip}:8000/{file_to_send}") + + handler = http.server.SimpleHTTPRequestHandler + with socketserver.TCPServer(("", 8000), handler) as httpd: + print("Serving at port 8000") + httpd.serve_forever() + \ No newline at end of file[COMMIT END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.