view release on metacpan or search on metacpan
lib/App/DoubleUp.pm view on Meta::CPAN
my $self = shift;
return @{$self->{config}{credentials}};
}
sub connect_to_db {
my ($self, $dsn, $user, $password) = @_;
return DBI->connect($dsn, $user, $password, { RaiseError => 1, PrintError => 0 }) || croak "Error while connecting to '$dsn'";
}
sub process_querys_for_one_db {
my ($self, $db, $querys) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
script/foremost-download view on Meta::CPAN
[profile=production]
username=bar
pass=honey
When you specify C<--config-profile=dev>, C<username> will be set to C<foo> and
C<password> to C<beaver>. When you specify C<--config-profile=production>,
C<username> will be set to C<bar> and C<password> to C<honey>.
=item B<--no-config>, B<-C>
Do not use any configuration file.
view all matches for this distribution
view release on metacpan or search on metacpan
#### Logging into the VM
Once you have installed the virtual machine you should be able to start up the VM and login with the following credentials:
- **username** : `vagrant`
- **password** : `duckduckhack`
#### Cloning the repository on the VM
**The DuckPAN client has already been installed for you.** To use it, you must 1st clone your instant answer git repository.
view all matches for this distribution
view release on metacpan or search on metacpan
script/list-dist-deps view on Meta::CPAN
[profile=production]
username=bar
pass=honey
When you specify C<--config-profile=dev>, C<username> will be set to C<foo> and
C<password> to C<beaver>. When you specify C<--config-profile=production>,
C<username> will be set to C<bar> and C<password> to C<honey>.
=item B<--no-config>, B<-C>
Do not use any configuration file.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
base|index-basename=s
days=i
noop!
proto=s
http-username=s
password-exec=s
master-only|M
insecure
capath=s
cacert=s
cert=s
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
: exists $_GLOBALS{days} ? $_GLOBALS{days} : 1,
# HTTP Basic Authentication
USERNAME => exists $opts->{'http-username'} ? $opts->{'http-username'}
: exists $_GLOBALS{'http-username'} ? $_GLOBALS{'http-username'}
: $ENV{USER},
PASSEXEC => exists $opts->{'password-exec'} ? $opts->{'password-exec'}
: exists $_GLOBALS{'password-exec'} ? $_GLOBALS{'password-exec'}
: undef,
# TLS Options
INSECURE => exists $opts->{insecure} ? 1
: exists $_GLOBALS{insecure} ? $_GLOBALS{insecure}
: 0,
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
es_utils_initialize() unless keys %DEF;
$host ||= $DEF{HOST};
# Return the results if we've done this already
return @{ $_auth_cache{$host} }{qw(username password)}
if exists $_auth_cache{$host};
# Set the cached element
my %auth = ();
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
my $netrc = Net::Netrc->lookup($host);
if( $DEF{HOST} eq $host ) {
%auth = map { lc($_) => $DEF{$_} } qw(USERNAME);
}
my %meta = ();
foreach my $k (qw( http-username password-exec )) {
foreach my $name ( $DEF{INDEX}, $DEF{BASE} ) {
next unless $name;
if( my $v = es_local_index_meta($k, $name) ) {
$meta{$k} = $v;
last;
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
$auth{username} ||= $meta{'http-username'} ? $meta{'http-username'}
: defined $DEF{USERNAME} ? $DEF{USERNAME}
: defined $netrc ? $netrc->login
: $ENV{USER};
# Prompt for the password
$auth{password} ||= defined $netrc ? $netrc->password
: (es_pass_exec($host,$auth{username},$meta{'password-exec'})
|| prompt(sprintf "Password for '%s' at '%s': ", $auth{username}, $host)
);
# Store
$_auth_cache{$host} = \%auth;
return @auth{qw(username password)};
}
sub es_pass_exec {
my ($host,$username,$exec) = @_;
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
# Simplest case we can't run
$exec ||= $DEF{PASSEXEC};
return unless length $exec && -x $exec;
my(@out,@err);
# Run the password command captue out, error and RC
run3 [ $exec, $host, $username ], \undef, \@out, \@err;
my $rc = $?;
# Record the error
if( @err or $rc != 0 ) {
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
GET => sprintf "%s://%s:%d",
$conn->proto, $conn->host, $conn->port
);
# Check if we're doing auth
my @auth = $DEF{PASSEXEC} ? es_basic_auth($conn->host) : ();
# Add authentication if we get a password
$req->authorization_basic( @auth ) if @auth;
# Retry with TLS and/or Auth
my %try = map { $_ => 1 } qw( tls auth );
my $resp;
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
}
elsif( $resp->code == 401 ) {
# Retry with credentials
last unless $try{auth};
delete $try{auth};
warn "Authorization required, try setting 'password-exec: /home/user/bin/get-password.sh` in ~/.es-utils.yaml'"
unless $DEF{PASSEXEC};
$req->authorization_basic( es_basic_auth($conn->host) );
}
else {
warn "Failed getting version";
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
ssl_opts => _get_ssl_opts,
);
# Only authenticate over TLS
if( $DEF{PROTO} eq 'https' ) {
$conn{username} = $DEF{USERNAME};
$conn{password} = es_pass_exec(@DEF{qw(HOST USERNAME)}) if $DEF{PASSEXEC};
}
# If we're overriding, return a unique handle
if(defined $override_servers) {
my @overrides = is_arrayref($override_servers) ? @$override_servers : $override_servers;
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
Grab the value of the global value from the es-utils.yaml files.
=head2 es_basic_auth($host)
Get the user/password combination for this host. This is called from LWP::UserAgent if
it recieves a 401, so the auth condition must be satisfied.
Returns the username and password as a list.
=head2 es_pass_exec(host, username)
Called from es_basic_auth to exec a program, capture the password
and return it to the caller. This allows the use of password vaults
and keychains.
=head2 es_pattern
Returns a hashref of the pattern filter used to get the indexes
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
--local Use localhost as the elasticsearch host
--host ElasticSearch host to connect to
--port HTTP port for your cluster
--proto Defaults to 'http', can also be 'https'
--http-username HTTP Basic Auth username
--password-exec Script to run to get the users password
--insecure Don't verify TLS certificates
--cacert Specify the TLS CA file
--capath Specify the directory with TLS CAs
--cert Specify the path to the client certificate
--key Specify the path to the client private key file
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
host: esproxy.example.com
port: 80
timeout: 10
proto: https
http-username: bob
password-exec: /home/bob/bin/get-es-passwd.sh
=head1 CONNECTION ARGUMENTS
Arguments for establishing a connection with the cluster. Unless specified otherwise, these options
can all be set in the globals file.
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
If HTTP Basic Authentication is required, use this username.
See also the L<HTTP Basic Authentication> section for more details
=item B<password-exec>
If HTTP Basic Authentication is required, run this command, passing the arguments:
<command_to_run> <es_host> <es_username>
The script expects the last line to contain the password in plaintext.
=item B<noop>
Prevents any communication to the cluster from making changes to the settings or data contained therein.
In short, it prevents anything but HEAD and GET requests, B<except> POST requests to the _search endpoint.
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
CLI::Helpers prompt()
Once the username has been resolved, the following mechanisms are tried in order:
Netrc element matching the hostname of the request
Password executable defined by --password-exec
'password-exec' in /etc/es-utils.yml, ~/.es-utils.yml
CLI::Helpers prompt()
=head2 Password Exec
It is B<BAD> practice to specify passwords as a command line argument, or store it in a plaintext
file. There are cases where this may be necessary, but it is not recommended. The best method for securing your
password is to use the B<password-exec> option.
This option must point to an executable script. That script will be passed two arguments, the hostname and the username
for the request. It expects the password printed to STDOUT as the last line of output. Here's an example password-exec setup
using Apple Keychain:
#!/bin/sh
HOSTNAME=$1;
USERNAME=$2;
/usr/bin/security find-generic-password -w -a "$USERNAME" -s "$HOSTNAME"
If we save this to "$HOME/bin/get-passwd.sh" we can execute a script
like this:
$ es-search.pl --http-username bob --password-exec $HOME/bin/get-passwd.sh \
--base secure-data --fields
Though it's probably best to set this in your ~/.es-utils.yml file:
---
host: secured-cluster.example.org
port: 443
proto: https
http-username: bob
password-exec: /home/bob/bin/get-passwd.sh
=head3 CLI::Helpers and Password Prompting
If all the fails to yield a password, the last resort is to use CLI::Helpers::prompt() to ask the user for their
password. If the user is using version 1.1 or higher of CLI::Helpers, this call will turn off echo and readline magic
for the password prompt.
=head1 INSTALL
B<This library attempts to provide scripts compatible with version 0.19 through 1.1 of ElasticSearch>.
view all matches for this distribution
view release on metacpan or search on metacpan
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
view all matches for this distribution
view release on metacpan or search on metacpan
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Environ/Mojo/Pg.pm view on Meta::CPAN
## Non standart schema workaround
## For URI objects that do not belong to one of these, you can only use the common and generic methods.
$url->scheme('https');
$url->userinfo("$conf->{user}:$conf->{password}");
$url->host( $conf->{host} );
$url->port( $conf->{port} );
$url->path( $conf->{dbname} );
$url->query_form( %{ $conf->{options} } );
view all matches for this distribution
view release on metacpan or search on metacpan
example/pg.yml view on Meta::CPAN
connectors:
main:
host: 'db.example.com'
port: 5432
user: 'main'
password: 'main'
dbname: 'postgres'
options:
PrintWarn: 0
PrintError: 0
RaiseError: 1
view all matches for this distribution
view release on metacpan or search on metacpan
bin/station-mgr.pl view on Meta::CPAN
host => $self->{config}{mixer}{host},
port => $self->{config}{mixer}{port},
id => $id,
shost => $self->{config}{stream}{host},
sport => $self->{config}{stream}{port},
spassword => $self->{config}{stream}{password},
stream => $self->{config}{stream}{stream},
);
$command =~ s/\$(\w+)/$cmd_vars{$1}/g;
bin/station-mgr.pl view on Meta::CPAN
"run" : "0",
"stream" :
{
"host" : "",
"port" : "",
"password" : "",
"stream" : ""
}
}
CONFIG
bin/station-mgr.pl view on Meta::CPAN
'commands' => {
'alsa' => 'dvsource-alsa -h $host -p $port hw:$device',
'dv' => 'dvsource-firewire -h $host -p $port -c $device',
'record' => 'dvsink-files $device',
'v4l' => 'ffmpeg -f video4linux2 -s vga -r 25 -i $device -target pal-dv - | dvsource-file /dev/stdin -h $host -p $port',
'stream' => 'dvsink-command -- ffmpeg2theora - -f dv -F 25:2 --speedlevel 0 -v 4 --optimize -V 420 --soft-target -a 4 -c 1 -H 44100 -o - | oggfwd $host $port 8000 $password /$stream',
'file' => 'dvsource-file -l $device',
'dvswitch' => 'dvswitch -h 0.0.0.0 -p $port'
},
'config' => {
'roles' => [
view all matches for this distribution
view release on metacpan or search on metacpan
- Redo the variables used in the Perl scripts for readability, including by
separating the words in the variables by underscores.
- Corrected an instance of a duped variable in bin/nl2ftndb help message.
0.08 Sat Aug 21 20:03 2010
The default DBI user and password parameters for an SQLite database
is an empty string; change the default codeing for those in the bin/*
scripts.
0.07 Sat Aug 21 18:19 2010
- Correct script name in Makefile.PL from net2file to listftndb.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FTPThis.pm view on Meta::CPAN
"$dir/conf",
join(
"",
"root directory: $self->{root}\n",
"allow anonymous: 1\n",
"anonymous password check: none\n",
"anonymous password enforce: 0\n",
"home directory: $self->{root}\n",
"limit memory: -1\n",
"limit nr processes: -1\n",
"limit nr files: -1\n",
),
view all matches for this distribution
view release on metacpan or search on metacpan
script/reencode-video-with-libx264 view on Meta::CPAN
[profile=production]
username=bar
pass=honey
When you specify C<--config-profile=dev>, C<username> will be set to C<foo> and
C<password> to C<beaver>. When you specify C<--config-profile=production>,
C<username> will be set to C<bar> and C<password> to C<honey>.
=item B<--no-config>, B<-C>
Do not use any configuration file.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Filite/Client.pm view on Meta::CPAN
use JSON::PP qw( encode_json decode_json );
use MIME::Base64 qw( encode_base64 );
use Path::Tiny qw( path );
use Class::Tiny {
password => sub { croak "Missing option: password" },
server => sub { croak "Missing option: server" },
useragent => sub { shift->_build_useragent },
errors => sub { 0 },
};
lib/App/Filite/Client.pm view on Meta::CPAN
return $self;
}
sub _build_useragent {
my ( $self ) = ( shift );
my $auth = encode_base64( sprintf( 'admin:%s', $self->password ) );
chomp $auth;
return HTTP::Tiny->new(
agent => sprintf( '%s/%s ', __PACKAGE__, $VERSION ),
default_headers => { 'Authorization' => "Basic $auth" },
);
lib/App/Filite/Client.pm view on Meta::CPAN
=item C<< server >> B<< Str >>
The filite server to share things via. This will typically be a URL
like "https://example.com/" or "http://example.net:8080".
=item C<< password >> B<< Str >>
Filite is a single user system so has a password but no username.
=item C<< useragent >> B<< Object >>
Can be set to a custom L<HTTP::Tiny> instance. Cannot be specified in
the config file.
view all matches for this distribution
view release on metacpan or search on metacpan
script/restart-firefox view on Meta::CPAN
[profile=production]
username=bar
pass=honey
When you specify C<--config-profile=dev>, C<username> will be set to C<foo> and
C<password> to C<beaver>. When you specify C<--config-profile=production>,
C<username> will be set to C<bar> and C<password> to C<honey>.
=item B<--no-config>, B<-C>
Do not use any configuration file.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Foca/Server.pm view on Meta::CPAN
Well, lets suppose you have a log parser on all your servers and you are in
need to parse all of them, the common way would be to ssh to each host (can
be as simple as ssh'ing to each host or using a multiplex tool) and execute
your parser, but what if your SSH keys or the keys of a user are not there?
It will be a heck of pain to enter your password hundred of times or lets
imagine you want to parse your logs via some automation (like doing it from
an IRC bot or tied to your monitoring solution).. then the problem comes
more complex with SSH and private keys. With Foca you don't need to worry
about those things, the command will get executed and the output will be
returned as a HTTP response.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Followme/UploadFtp.pm view on Meta::CPAN
#----------------------------------------------------------------------
# Open the connection to the remote site
sub open {
my ($self, $user, $password) = @_;
# Open the ftp connection
my $ftp = Net::FTP->new($self->{ftp_url}, Debug => $self->{ftp_debug})
or die "Cannot connect to $self->{ftp_url}: $@";
$ftp->login($user, $password) or die "Cannot login ", $ftp->message;
$ftp->cwd($self->{remote_directory})
or die "Cannot change remote directory ", $ftp->message;
$ftp->binary();
lib/App/Followme/UploadFtp.pm view on Meta::CPAN
App::Followme::UploadFtp - Upload files using ftp
=head1 SYNOPSIS
my $ftp = App::Followme::UploadNone->new(\%configuration);
$ftp->open($user, $password);
$ftp->add_directory($dir);
$ftp->add_file($local_filename, $remote_filename);
$ftp->delete_file($filename);
$ftp->delete_dir($dir);
$ftp->close();
lib/App/Followme/UploadFtp.pm view on Meta::CPAN
=back
=head1 CONFIGURATION
The follow parameters are used from the configuration. In addition, the package
will prompt for and save the user name and password.
=over 4
=item ftp_debug
view all matches for this distribution
view release on metacpan or search on metacpan
# Channels to join on OFTC
@oftc_channels = ();
# Password to identify to NickServ with
$oftc_nickserv_password = 'asd';
# BitlBee
# =======
# Comment this out to disable the BitlBee plugin
$bitlbee_server = 'localhost';
# BitlBee server port
$bitlbee_port = 6667;
# BitlBee server password
$bitlbee_password = 'parola';
# Common
# ======
# Directory to store state in
view all matches for this distribution
view release on metacpan or search on metacpan
examples/eg-sql.pl view on Meta::CPAN
# Set up database access
$app->sql(
'database' => $opts{'database'},
'table' => $opts{'table'},
'user' => $opts{'user'},
'password' => $opts{'password'},
# Option to do some Sql debugging by tracing transactions to a file
'trace' => $opts{'debug'} ? 4 : 0,
'trace_file'=> 'logsql.log',
'debug' => $opts{'debug'},
examples/eg-sql.pl view on Meta::CPAN
-user=s User
Your MySql user
-password=s Pass
Your MySql password
__#=============================================================================================================================
__DATA__ listings2.sql
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GHPT/WorkSubmitter/Role/Question.pm view on Meta::CPAN
package App::GHPT::WorkSubitter::Question::WarnAboutPasswordFile;
use App::GHPT::Wrapper::OurMoose;
with 'App::GHPT::WorkSubmitter::Role::Question';
sub ask($self) {
# skip the question unless there's a password file
return unless $self->changed_files->changed_files_match(qr/password/);
# ask the user if that's okay
return $self->ask_question(<<'ENDOFTEXT',"I'm okay with the risk");
You've committed a file with a name matching 'password'. Are you nuts?
ENDOFTEXT
}
__PACKAGE__->meta->make_immutable;
1;
view all matches for this distribution
view release on metacpan or search on metacpan
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
view all matches for this distribution
view release on metacpan or search on metacpan
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
view all matches for this distribution
view release on metacpan or search on metacpan
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
view all matches for this distribution
view release on metacpan or search on metacpan
script/gen-pericmd-completer view on Meta::CPAN
[profile=production]
username=bar
pass=honey
When you specify C<--config-profile=dev>, C<username> will be set to C<foo> and
C<password> to C<beaver>. When you specify C<--config-profile=production>,
C<username> will be set to C<bar> and C<password> to C<honey>.
=item B<--no-config>, B<-C>
Do not use any configuration file.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Genpass/ID.pm view on Meta::CPAN
our %SPEC;
$SPEC{genpass} = {
v => 1.1,
summary => 'Generate password from combination of Indonesian words',
description => $App::Genpass::WordList::SPEC{genpass}{description},
args => {
num => {
schema => ['int*', min=>1],
default => 1,
lib/App/Genpass/ID.pm view on Meta::CPAN
wordlists => ['ID::KBBI'],
);
}
1;
# ABSTRACT: Generate password from combination of Indonesian words
__END__
=pod
=encoding UTF-8
=head1 NAME
App::Genpass::ID - Generate password from combination of Indonesian words
=head1 VERSION
This document describes version 0.003 of App::Genpass::ID (from Perl distribution App-Genpass-ID), released on 2018-01-02.
lib/App/Genpass/ID.pm view on Meta::CPAN
Usage:
genpass(%args) -> [status, msg, result, meta]
Generate password from combination of Indonesian words.
Using password from dictionary words (in this case, from WordList::*) can be
useful for humans when remembering the password. Note that using a string of
random characters is generally better because of the larger space (combination).
Using a password of two random words from a 5000-word wordlist has a space of
only ~25 million while an 8-character of random uppercase letters/lowercase
letters/numbers has a space of 62^8 = ~218 trillion. To increase the space
you'll need to use more words (e.g. 3 to 5 instead of just 2). This is important
if you are using the password for something that can be bruteforced quickly e.g.
for protecting on-disk ZIP/GnuPG file and the attacker has access to your file.
It is then recommended to use a high number of rounds for hashing to slow down
password cracking (e.g. C<--s2k-count 65011712> in GnuPG).
This function is not exported.
Arguments ('*' denotes required arguments):
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Genpass/WordList.pm view on Meta::CPAN
$pattern;
}
$SPEC{genpass} = {
v => 1.1,
summary => 'Generate password with words from WordList::*',
description => <<'_',
Using password from dictionary words (in this case, from WordList::*) can be
useful for humans when remembering the password. Note that using a string of
random characters is generally better because of the larger space (combination).
Using a password of two random words from a 5000-word wordlist has a space of
only ~25 million while an 8-character of random uppercase letters/lowercase
letters/numbers has a space of 62^8 = ~218 trillion. To increase the space
you'll need to use more words (e.g. 3 to 5 instead of just 2). This is important
if you are using the password for something that can be bruteforced quickly e.g.
for protecting on-disk ZIP/GnuPG file and the attacker has access to your file.
It is then recommended to use a high number of rounds for hashing to slow down
password cracking (e.g. `--s2k-count 65011712` in GnuPG).
_
args => {
num => {
schema => ['int*', min=>1],
lib/App/Genpass/WordList.pm view on Meta::CPAN
);
return $res unless $res->[0] == 200;
my @words = shuffle @{ $res->[2] };
my @passwords;
for my $i (1..$num) {
push @passwords,
_fill_pattern($patterns->[rand @$patterns], \@words);
}
[200, "OK", \@passwords];
}
1;
# ABSTRACT: Generate password with words from WordList::*
__END__
=pod
=encoding UTF-8
=head1 NAME
App::Genpass::WordList - Generate password with words from WordList::*
=head1 VERSION
This document describes version 0.002 of App::Genpass::WordList (from Perl distribution App-Genpass-WordList), released on 2018-01-02.
lib/App/Genpass/WordList.pm view on Meta::CPAN
Usage:
genpass(%args) -> [status, msg, result, meta]
Generate password with words from WordList::*.
Using password from dictionary words (in this case, from WordList::*) can be
useful for humans when remembering the password. Note that using a string of
random characters is generally better because of the larger space (combination).
Using a password of two random words from a 5000-word wordlist has a space of
only ~25 million while an 8-character of random uppercase letters/lowercase
letters/numbers has a space of 62^8 = ~218 trillion. To increase the space
you'll need to use more words (e.g. 3 to 5 instead of just 2). This is important
if you are using the password for something that can be bruteforced quickly e.g.
for protecting on-disk ZIP/GnuPG file and the attacker has access to your file.
It is then recommended to use a high number of rounds for hashing to slow down
password cracking (e.g. C<--s2k-count 65011712> in GnuPG).
This function is not exported.
Arguments ('*' denotes required arguments):
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Genpass.pm view on Meta::CPAN
package App::Genpass;
# ABSTRACT: Quickly and easily create secure passwords
$App::Genpass::VERSION = '2.401';
use Carp;
use Moo;
use Sub::Quote 'quote_sub';
use MooX::Types::MooseLike::Base qw/Int Str Bool ArrayRef/;
lib/App/Genpass.pm view on Meta::CPAN
sub generate {
my ( $self, $number ) = @_;
my $length;
my $verify = $self->verify;
my @passwords = ();
my @verifications = ();
my $EMPTY = q{};
my ( $char_types, @chars ) = @{ $self->_get_chars };
lib/App/Genpass.pm view on Meta::CPAN
if ( (defined($self->length) && $num_of_types > $self->length)
|| ($num_of_types > $self->minlength) ) {
$length = defined($self->length) ? $self->length : $self->minlength.' minimum';
croak <<"_DIE_MSG";
You wanted a shorter password that the variety of characters you've selected.
You requested $num_of_types types of characters but only have $length length.
_DIE_MSG
}
if ($self->minlength > $self->maxlength) {
lib/App/Genpass.pm view on Meta::CPAN
$length = $self->length
|| $self->minlength + int(_rand(abs($self->maxlength - $self->minlength) + 1));
$number ||= $self->number;
# each password iteration needed
foreach my $pass_iter ( 1 .. $number ) {
my $password = $EMPTY;
my $char_type = shift @char_types;
# generating the password
while ( $length > length $password ) {
my $char = $chars[ int _rand @chars ];
# for verifying, we just check that it has small capital letters
# if that doesn't work, we keep asking it to get a new random one
# the check if it has large capital letters and so on
lib/App/Genpass.pm view on Meta::CPAN
$char_type =
scalar @char_types > 0 ? shift @char_types : $EMPTY;
}
$password .= $char;
}
# since the verification process creates a situation of ordered types
# (lowercase, uppercase, numerical, special)
# we need to shuffle the string
$password = join $EMPTY, shuffle( split //sm, $password );
$number == 1 && return $password;
push @passwords, $password;
@char_types = @{$char_types};
}
return wantarray ? @passwords : \@passwords;
}
1;
lib/App/Genpass.pm view on Meta::CPAN
=encoding UTF-8
=head1 NAME
App::Genpass - Quickly and easily create secure passwords
=head1 VERSION
version 2.401
lib/App/Genpass.pm view on Meta::CPAN
$genpass = App::Genpass->new( readable => 0, length => 20 );
print "$_\n" for $genpass->generate(10);
=head1 DESCRIPTION
If you've ever needed to create 10 (or even 10,000) passwords on the fly with
varying preferences (lowercase, uppercase, no confusing characters, special
characters, minimum length, etc.), you know it can become a pretty pesky task.
This module makes it possible to create flexible and secure passwords, quickly
and easily.
use App::Genpass;
my $genpass = App::Genpass->new();
my $single_password = $genpass->generate(1); # returns scalar
my @single_password = $genpass->generate(1); # returns array
my @multiple_passwords = $genpass->generate(10); # returns array again
my $multiple_passwords = $genpass->generate(10); # returns arrayref
This distribution includes a program called B<genpass>, which is a command line
interface to this module. If you need a program that generates passwords, use
B<genpass>.
=for stopwords boolean DWIM DWYM arrayref perldoc Github CPAN's AnnoCPAN CPAN
=head1 SUBROUTINES/METHODS
lib/App/Genpass.pm view on Meta::CPAN
=over 4
=item number
You can decide how many passwords to create. The default is 1.
This can be overridden per I<generate> so you can have a default of 30 but in a
specific case only generate 2, if that's what you want.
=item readable
lib/App/Genpass.pm view on Meta::CPAN
Default: on.
=item verify
Verify that every type of character wanted (lowercase, uppercase, numerical,
specials, etc.) are present in the password. This makes it just a tad slower,
but it guarantees the result. Best keep it on.
To emphasize how "slower" it is: if you create 500 passwords of 500 character
length, using C<verify> off, will make it faster by 0.1 seconds.
Default: on.
=back
lib/App/Genpass.pm view on Meta::CPAN
=over 4
=item minlength
The minimum length of password to generate.
Default: 8.
=item maxlength
The maximum length of password to generate.
Default: 10.
=item length
Use this if you want to explicitly specify the length of password to generate.
=back
=head3 character attributes
lib/App/Genpass.pm view on Meta::CPAN
=back
=head2 generate
This method generates the password or passwords.
It accepts an optional parameter indicating how many passwords to generate.
$gp = App::Genpass->new();
my @passwords = $gp->generate(300); # 300 passwords to go
If you do not provide a parameter, it will use the default number of passwords
to generate, defined by the attribute B<number> explained above.
This method tries to be tricky and DWIM (or rather, DWYM). That is, if you
request it to generate only one password and use scalar context
(C<< my $p = $gp->generate(1) >>), it will return a single password.
However, if you try to generate multiple passwords and use scalar context
(C<< my $p = $gp->generate(30) >>), it will return an array reference for the
passwords.
Generating passwords with list context (C<< my @p = $gp->generate(...) >>)
will always return a list of the passwords, even if it's a single password.
=head2 get_config_from_file
Reads the configuration file using L<Config::Any>.
view all matches for this distribution
view release on metacpan or search on metacpan
bin/geoCancerPrognosticDatasetsRetriever view on Meta::CPAN
#check if current system is Ubuntu/or Ubuntu-based
my $ubuntu = qx{uname -a};
if ($ubuntu=~ /.+ubuntu.+/ig) {
print color ("red"), "curl binary was not found: follow onscreen instructions/input your password for its installation...\n\n", color("reset");
system("sudo apt -y install curl"); #install curl
print "done\n";
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
LICENSE.txt view on Meta::CPAN
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Git/Workflow/Command/Feature.pm view on Meta::CPAN
'branch|b=s',
'local|l!',
'pom|x=s',
'url|u=s',
'user|U=s',
'pass|password|P=s',
'jira|j=s',
'fetch|f!',
'new_pom|new-pom|n!',
'push|p',
) or return;
lib/App/Git/Workflow/Command/Feature.pm view on Meta::CPAN
-j --jira[=]JIRAID
Find the summary for JIRA item JIRAID and make it the
branch name for the feature.
-u --url[=]URL Use URL as the JIRA instance for looking up summaries.
-U --user[=]str JIRA user name to use when querying JIRA
-P --password[=]str
JIRA password for --user
-t --tag[=]str Specify a tag that any branch with newer commits must contain
-b --branch[=]str Similarly a branch that other branches with newer commits must
contain (Default origin/master)
-l --local Shorthand for --branch '^master$'
-p --push Push the new brach upstream
view all matches for this distribution