# # password grid generator # alex hunsley # # import random import time (year, month, day, d1,d2,d3,d4,d5,d6) = time.localtime() introMsg = "This is a password grid for demo purposes only! DO NOT USE!" outroMsg = introMsg if month < 10: month = "0"+str(month) if day < 10: day = "0"+str(day) dateStr = "%s-%s-%s" % (year, month, day) print dateStr seed = int(time.time()) random.seed(seed) servers = ("server1", "server2", "server3", "server4", "server5", "server6", "server7", "server8", "server9") out = open("grid.html", "w") gridSize = 8 chars = "2345678abcdefghijkmnpqrstuvwxyz[]/" tWidth = 200 tHeight = 200 def pickChar(): return chars[random.randint(0, len(chars) - 1)] def pr(line): out.write(line) def generateGrid(): pr('
| ') pr('') pr(pickChar()) pr('') pr(' | ') pr('
%s
' % introMsg) pr('| ') pr('') pr(server) pr('') pr(' | ') pr('') pr(dateStr) pr('') pr(' |