Ip-Generator

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml312-2024; pyv: 3.12.7 | packaged by Anaconda, Inc. | (main, Oct  4 2024, 13:27:36) [GCC 11.2.0]'
# public ip

import random

def generate_public_ip():
    # Exclude private IP ranges
    excluded_ranges = [
        (10, 10),  # 10.0.0.0 - 10.255.255.255
        (172, 172),  # 172.16.0.0 - 172.31.255.255
        (192, 192),  # 192.168.0.0 - 192.168.255.255
    ]

    while True:
        # Generate random first octet
        first = random.randint(1, 223)

        # Ensure it's not a private IP range
        if not any(start <= first <= end for start, end in excluded_ranges):
            break

    # Generate the other octets (2-4)
    second = random.randint(0, 255)
    third = random.randint(0, 255)
    fourth = random.randint(0, 255)

    # Combine to create the IP
    return f"{first}.{second}.{third}.{fourth}"

# Generate multiple public IPs
public_ips = [generate_public_ip() for _ in range(10)]

# Print the generated IPs
print("Random Public IP Addresses:")
for ip in public_ips:
    print(ip)
Random Public IP Addresses:
223.59.16.209
88.224.147.129
144.148.121.177
90.210.54.132
143.64.56.165
176.220.110.253
55.141.50.54
168.71.210.26
127.184.181.104
116.199.204.222


Score: 0

Category: ip


Ip-Generator-With-Faker

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml312-2024; pyv: 3.12.7 | packaged by Anaconda, Inc. | (main, Oct  4 2024, 13:27:36) [GCC 11.2.0]'
!pip install faker
Collecting faker
  Using cached Faker-33.1.0-py3-none-any.whl.metadata (15 kB)
Requirement already satisfied …

Category: ip

Read More

Ip2Long-7114

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml312-2024; pyv: 3.12.7 | packaged by Anaconda, Inc. | (main, Oct  4 2024, 13:27:36) [GCC 11.2.0]'
import ipaddress

def ip_to_long(ip):
    # Convert IP string to a long integer
    return int(ipaddress.IPv4Address(ip))

# Example usage
ip = "192 …

Category: ip

Read More

Long2Ip

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml312-2024; pyv: 3.12.7 | packaged by Anaconda, Inc. | (main, Oct  4 2024, 13:27:36) [GCC 11.2.0]'
import ipaddress

def long_to_ip(ip_long):
    # Convert long integer to IPv4 string
    return str(ipaddress.IPv4Address(ip_long))

# Example usage
ip_long = 3232235777
ip …

Category: ip

Read More

Zzemp-9002

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml312-2024; pyv: 3.12.7 | packaged by Anaconda, Inc. | (main, Oct  4 2024, 13:27:36) [GCC 11.2.0]'


Score: 0

Category: ip

Read More
Page 1 of 1