Created
February 19, 2015 01:30
-
-
Save RickCogley/a0703e654e267f28b40a to your computer and use it in GitHub Desktop.
Rick's variation on https://www.bartbusschots.ie/s/2014/08/16/xkpasswd-2-service-with-automator/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import best-practice standard perl modules | |
use strict; | |
use warnings; | |
# import the XKPassed module | |
use lib '/usr/local/xkpasswd.pm/'; | |
use XKPasswd; | |
# create an XKPasswd password generator object with out custom config | |
my $config_overrides = { | |
num_words => 4, | |
word_length_max => 9, | |
word_length_min => 5, | |
padding_characters_before => 2, | |
padding_characters_after => 2, | |
case_transform => 'ALTERNATE', | |
padding_alphabet => ['!', '&', '?', '@', '=', '^', '~'], | |
separator_alphabet => ['-', '.', ':', ';', '_'] | |
}; | |
my $password_generator = XKPasswd->new('/usr/local/xkpasswd.pm/sample_dict.txt', 'APPLEID', $config_overrides); | |
# use our generator to create and random password and print it | |
print $password_generator->password()."\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment