Skip to content

Instantly share code, notes, and snippets.

View zimolzak's full-sized avatar

Andy Zimolzak zimolzak

View GitHub Profile
# Print a user-specified number of variates from distribution I just
# made up (which is kind of like an upside down V). I like it better
# than the boring old uniform distribution and friends.
# 0.075 **
# * *
# * *
# * *
# * *
# * *
@zimolzak
zimolzak / cut.pl
Created December 29, 2016 03:01
What is the distribution of common passwords?
#!/usr/bin/perl -w
use strict;
while(<>){
chomp;
my @f = split(/\t/);
print $f[1]."\n" if not /[^[:ascii:]]/
}
from random import uniform
 
def next_state(start_state):
r = uniform(0,1)
if start_state == 'E':
if r > 0.3:
return 'A'
else:
return 'E'
elif start_state == 'A':
from random import randint
 
for i in range(20):
c = 10
while c > 0:
print c,
r = randint(1,7)
if r <= 4:
c -= r
elif r == 5 or r == 6:
@zimolzak
zimolzak / csv2wiki.pl
Created June 13, 2016 15:01
Real dumb script to turn a CSV into MediaWiki wikitable
#!/usr/bin/perl -w
use strict;
print '{| class="wikitable sortable"' . "\n";
while(<>){
print "|-\n";
my $separator;
if ($. == 1){
$separator = "!";
}
else {

Keybase proof

I hereby claim:

  • I am zimolzak on github.
  • I am andrewzimolzak (https://keybase.io/andrewzimolzak) on keybase.
  • I have a public key whose fingerprint is 6A51 5CD7 8038 FCE0 E630 12B6 3C06 12CF 1FCC D9EC

To claim this, I am signing this object: