Skip to content

Instantly share code, notes, and snippets.

@krishnachaitanya7
Last active November 10, 2017 05:53
Show Gist options
  • Save krishnachaitanya7/fc3f97942903ae1ca881e5bff00477d6 to your computer and use it in GitHub Desktop.
Save krishnachaitanya7/fc3f97942903ae1ca881e5bff00477d6 to your computer and use it in GitHub Desktop.
Generate /etc/hosts entries by inputing ipv6 address and human readable name inside all_entries list
all_entries = [['06','0d','61','fc','moteid2'],
['06','0d','b2','8b','moteid6']]
for each_entry in all_entries:
print 'aaaa::212:4b00:'+each_entry[0]+each_entry[1]+':'+each_entry[2]+each_entry[3]+' '+each_entry[4]
print 'fe80::212:4b00:'+each_entry[0]+each_entry[1]+':'+each_entry[2]+each_entry[3]+' '+each_entry[4]
print 'fe:80:00:00:00:00:00:00:02:12:4b:00:'+each_entry[0]+':'+each_entry[1]+':'+':'+each_entry[2]+':'+each_entry[3]+' '+each_entry[4]
print '\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment