Python Script to Create XEN MAC's

 

#! /usr/bin/python

# createmacs.py (c) 2010 George Pantazis - http://ssh-lroot.blogpsot.com

# Under the GPLv2 License

#

import random,sys

 

macs = [ ]

 

for x in range(int(sys.argv[1])):

mac = [ 0x00, 0x16, 0x3e,

random.randint(0x00, 0x7f),

random.randint(0x00, 0xff),

random.randint(0x00, 0xff) ]

macs.append(':'.join(map(lambda x: "%02x" % x, mac)))

print ':'.join(map(lambda x: "%02x" % x, mac))

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

HowTo: Setup Lighttpd & MySQL 5 & PHP 5

  Light HTTP with MySQL 5 and PHP 5 (LLMP) OS: CentOS(5.2 - 5.5) by eServices GreeceAuthor:...

Rapid SSL CA Bundle

You will find the bundle here: http://www.geotrust.com/resources/root-certificates/

Set Correct Time and Timezone

For Dedicated servers & VMWare just set the time using date -s "17 JUN 2010 19:54:00"...

Mysql Optimized configuration (centos 5.2-5.5, openSUSE11.0-11.3)

==========[my.cnf]==========       [client] port        ...

Lighttpd Optimized configuration (centos 5.2-5.5, openSUSE11.0-11.3)

==========[lighttpd.conf]==========       # lighttpd configuration file # #...