Skip to content

Instantly share code, notes, and snippets.

@j105rob
Last active August 29, 2015 14:27
Show Gist options
  • Save j105rob/70fcb160d96e9b7baea3 to your computer and use it in GitHub Desktop.
Save j105rob/70fcb160d96e9b7baea3 to your computer and use it in GitHub Desktop.
for DA
z = "{0:0{1}x}"
fout = open('muh.rules', 'w')
with open('muh.bad.zones.txt','r') as f:
parts = f.readline().split('.')
rule = ("|%s|%s|%s|%s|%s|%s"%(z.format(len(parts[0]),2),parts[0],z.format(len(parts[1]),2),parts[1],z.format(len(parts[2]),2),parts[2]))
fout.write(rule)
fout.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment