Skip to content

Instantly share code, notes, and snippets.

@mr-rizwan-syed
mr-rizwan-syed / tldextractor.py
Last active April 20, 2025 18:44
The script takes list of subdomains and extracts their apex (root) domains using the tldextract library, and prints the unique set of apex domains.
import sys
import tldextract
def is_valid_domain(domain):
# Check if the domain contains only alphanumeric characters and hyphens
if not domain.replace('-', '').replace('.', '').isalnum():
return False
# Check if the domain doesn't end with a period
if domain.endswith('.'):
@tarcisio-marinho
tarcisio-marinho / change_ip.py
Created January 28, 2019 16:13
change IP address using tor with Python3
# change IP via tor with python
import requests
from stem import Signal
from stem.control import Controller
import socks, socket
import time
# tuts
# https://www.torproject.org/docs/faq.html.en#torrc
# https://stem.torproject.org/tutorials/the_little_relay_that_could.html