Skip to content

Instantly share code, notes, and snippets.

View iTrooz's full-sized avatar
💭
CODE

iTrooz

💭
CODE
View GitHub Profile
@iTrooz
iTrooz / to_tldr.py
Last active January 10, 2025 07:36
Check commands that you can add to tldr
#!/usr/bin/env python3
# This script will check for commands that you could most easily contribute to tldr (https://tldr.sh/)
# Run it in the root of the https://github.com/tldr-pages/tldr repository
import os
import sys
TLDR_DIR = sys.argv[1] if len(sys.argv) > 1 else "./"
def get_used_commands():
used_cmds = {}
@iTrooz
iTrooz / ssh_udp.py
Last active August 9, 2024 21:29
Utility to setup SSH UDP port forwarding easily
#!/usr/bin/env python3
"""
This script setups the UDP translators in order to enable UDP traffic forwarding over SSH.
-L example usage: `py ssh_udp.py -L 53000:8.8.8.8:53 your_ssh_host` an then `dig @127.0.0.1 -p 53000 google.com` locally
-R example usage: `py ssh_udp.py -R 53000:8.8.8.8:53 your_ssh_host` an then `dig @127.0.0.1 -p 53000 google.com` on the server
Note: I know this code is ugly.
Thanks to https://stackpointer.io/network/ssh-port-forwarding-tcp-udp/365/ for the help
"""
import subprocess
import time