18 lines
574 B
Python
Executable File
18 lines
574 B
Python
Executable File
#!/usr/bin/python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Required parameters:
|
|
# @raycast.schemaVersion 1
|
|
# @raycast.title Generate RFC 4193 ULA Locally Assigned Address Block /64
|
|
# @raycast.mode silent
|
|
# @raycast.packageName Developer Utilities
|
|
|
|
# Optional parameters:
|
|
# @raycast.icon 💻
|
|
|
|
import os, binascii, subprocess
|
|
prefix = "fd" + binascii.b2a_hex( os.urandom( 7 ) ).decode( "utf-8" )
|
|
prefix = prefix[ 0:4 ] + ":" + prefix[ 4:8 ] + ":" + prefix[ 8:12 ] + ":" + prefix[ 12:16 ] + "::/64"
|
|
subprocess.run( [ "/usr/bin/pbcopy" ], input = prefix.encode( "utf-8" ) )
|
|
print( prefix )
|