Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for pow (0.15 sec)

  1. common/scripts/kind_provisioner.sh

        python3 - <<EOF
    from ipaddress import ip_network, IPv6Network;
    from itertools import islice;
    
    net = ip_network('$CIDR')
    net_bits = 128 if type(net) == IPv6Network else 32;
    net_len = pow(2, net_bits - net.prefixlen)
    start, end = int(net_len / 4 * 3), net_len
    if net_len > 2000:
      start, end = 1000, 2000
    
    [print(str(ip) + "/" + str(ip.max_prefixlen)) for ip in islice(ip_network('$CIDR').hosts(), start, end)]
    Shell Script
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Mon Apr 08 19:12:55 GMT 2024
    - 17.3K bytes
    - Viewed (1)
Back to top