view release on metacpan or search on metacpan
lib/Acme/MUDLike.pm view on Meta::CPAN
#
# * Put @messages into the room ($floor). Get the chat action out of the main loop. Dispatch all
# actions. Maybe.
#
our $password; # Acme::State friendly
our $floor; # holds all other objects
our $players; # holds all players; kind of like $floor except in the future, inactive players might get removed from the floor, or there might be multiple rooms
my $continuity;
my $got_message; # diddled to wake the chat event watchers
lib/Acme/MUDLike.pm view on Meta::CPAN
my $package = shift;
my %args = @_;
die "We've already got one" if $continuity;
$password = delete $args{password} if exists $args{password};
$password ||= join('', map { $_->[int rand scalar @$_] } (['a'..'z', 'A'..'Z', '0'..'9']) x 8),
my $staticp = sub {
# warn "staticp: url->path: ``@{[ $_[0]->url->path ]}''";
return 0 if $_[0]->url->path =~ m/\.js$/;
# warn "staticp: dynamic js handling override not engaged";
lib/Acme/MUDLike.pm view on Meta::CPAN
path_session => 1,
port => 2000,
%args,
);
print "Admin:\n", $continuity->adapter->daemon->url, '?admin=', $password, '&nick=', (getpwuid $<)[0], "\n";
$floor ||= Acme::MUDLike::room->new();
$players ||= Acme::MUDLike::inventory->new();
bless { }, $package;
lib/Acme/MUDLike.pm view on Meta::CPAN
#
while(1) {
my $nick_tmp = $request->param('nick');
my $admin_tmp = $request->param('admin');
if(defined($nick_tmp) and defined($admin_tmp) and $nick_tmp =~ m/^[a-z]{2,20}$/i and $admin_tmp eq $password) {
my $nick = $nick_tmp;
$player = $players->named($nick) || $players->insert(Acme::MUDLike::player->new(name => $nick), );
$player->request = $request;
# @_ = ($player, $request,); goto &{Acme::MUDLike::player->can('command')};
$player->command($request); # doesn't return
lib/Acme/MUDLike.pm view on Meta::CPAN
$request->print(
header, # $msg,
qq{
<form method="post" action="/">
<input type="text" name="nick" value="$nick_tmp"> <-- nickname<br>
<input type="password" name="admin" value="$admin_tmp"> <-- admin password<br>
<input type="submit" value="Enter"><br>
</form>
},
footer,
);
lib/Acme/MUDLike.pm view on Meta::CPAN
}, $pack;
}
sub request :lvalue { $_[0]->{request} }
sub id { $_[0]->{name} eq $_[1] or $_[0] eq $_[1] }
sub name { $_[0]->{name} }
sub password { $_[0]->{password} }
sub x :lvalue { $_[0]->{x} }
sub y :lvalue { $_[0]->{y} }
sub xy { $_[0]->{x}, $_[0]->{y} }
sub get { 0; } # can't be picked up
sub inventory { $_[0]->{inventory} }
lib/Acme/MUDLike.pm view on Meta::CPAN
$request->print(qq{
<b>Chat/Command:</b>
<form method="post" id="f" action="/">
<input type="hidden" name="action" value="chat">
<input type="hidden" id="nick" name="nick" value="@{[ $self->name ]}">
<input type="hidden" id="admin" name="admin" value="$password">
<input type="text" id="message" name="message" size="50">
<!-- <input type="submit" name="sendbutton" value="Send" id="sendbutton"> -->
<input type="submit" name="sendbutton" value="Send" id="sendbutton">
<span id="status"></span>
</form>
lib/Acme/MUDLike.pm view on Meta::CPAN
Optional. Defaults to C<2000>.
This and other parameters, such as those documented in L<Continuity>, are passed through
to C<< Continuity->new() >>.
=item C<password>
Optional. Password to use.
Everyone gets the same password, and anyone with the password can log in with any name.
Otherwise one is pseudo-randomly generated and printed to C<stdout>.
=cut
=head1 HISTORY
lib/Acme/MUDLike.pm view on Meta::CPAN
// Form elements
text: "a.type=='text'",
radio: "a.type=='radio'",
checkbox: "a.type=='checkbox'",
file: "a.type=='file'",
password: "a.type=='password'",
submit: "a.type=='submit'",
image: "a.type=='image'",
reset: "a.type=='reset'",
button: 'a.type=="button"||jQuery.nodeName(a,"button")',
input: "/input|select|textarea|button/i.test(a.nodeName)"
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/MetaSyntactic/services.pm view on Meta::CPAN
parsec_master
parsec_peer
partimage
passgo
passgo_tivoli
password_chg
passwrd_policy
patrol
patrol_coll
patrol_ism
patrol_mq_gm
view all matches for this distribution
view release on metacpan or search on metacpan
SECURITY.md view on Meta::CPAN
issues.**
Privately report vulnerabilities to the maintainers listed at the end
of this document. Include as many details as possible to reproduce the
issue, including code samples or test cases. Check that your report
does not expose any of your sensitive data, such as passwords, tokens,
or other secrets.
You do not need to have a solution or fix. Depending on the issue,
CPANSec may be notified. Depending on the issue, CPANSec may be
notified.
view all matches for this distribution
view release on metacpan or search on metacpan
use Acme::PIA::Export;
my $pia = Acme::PIA::Export->new(
"username" => "mylogin",
"password" => "verysecret"
);
$pia->export( "contacts" );
=item new( [ key => value, ...] )
Creates and returns a new Acme::PIA::Export object.
Parameters are given as key => value pairs. The most commonly used are "username" and "password".
If you expirience problems you can also give the parameter "DEBUG" => 1
to get verbose output from all functions.
=item export( SCOPE )
my $self = shift;
my $what = shift;
if( ! $self->{"cfg"}->{"username"} ) {
die "No Username given!";
}
if( ! $self->{"cfg"}->{"password"} ) {
die "No Password given!";
}
if( ! $self->{"cfg"}->{"client"} ) {
$self->{"cfg"}->{"client"} = uc($ENV{"hostname"}) || sprintf("%s-%0.5i", "Acme-PIA-Export", rand(99999));
}
my $requestbody = "$self->{cfg}->{username}~;~$self->{cfg}->{password}~;~$self->{cfg}->{client}~;~$scopes{$what};~export~;~O~;~~#~";
my $content_length = length($requestbody);
my $request = "POST $query_url HTTP/1.1\n" .
"Pragma: no-cache\n" .
"Host: www.arcor.de\n" .
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/PM/Barcelona/12x5_ca.pod view on Meta::CPAN
d'un compte de La Caixa.
use WWW::Mechanize;
$user = 'el-teu-dni';
$password = 'contrasenya';
# fes-te passar per un iPhone
$iphone = "Mozilla/5.0 (iPhone; U; ...";
$mech = WWW::Mechanize->new(agent => $iphone);
lib/Acme/PM/Barcelona/12x5_ca.pod view on Meta::CPAN
# fes login
$mech->submit_form(
form_name => "formu",
fields => {
E => $user,
B => $password
}
);
=for ToBeUsedInTheFuture =head3 L'extracte d'un compte de La Caixa (3)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/RPC.pm view on Meta::CPAN
* Weaken references held in %registry.
* Bug: Second hit with an oid= finds the server not accepting.
* Optionally require a password... use Acme::RPC password => whatever;
* entersubs=1, enterpackages=1, etc args to control how far the recurse goes in building $tree.
* Maybe don't recurse into blessed objects, but dump them nicely upon request.
Or maybe do recurse into them and dump their instance data.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/RemoteINC.pm view on Meta::CPAN
sub new {
my($class, %args) = @_;
my $self = {};
bless $self, $class;
foreach my $k ( qw(ftp host user password perl_root) )
{ $self->{$k} = $args{$k} if $args{$k} }
unless( $self->{ftp} ) {
my $ftp = new Net::FTP($self->{host}) or return;
$ftp->login( $self->{user} => $self->{password} ) or return;
$self->{ftp} = $ftp;
}
# register ourself in @INC.
push @INC, $self;
return $self;
lib/Acme/RemoteINC.pm view on Meta::CPAN
BEGIN {
require Acme::RemoteINC;
my $rinc = new Acme::RemoteINC(
host => 'ftp.esoteric-perl.com',
user => 'anonymous',
password => 'pwd@myhost.com',
perl_root => '/usr/lib/perl5/site_perl/5.8.1'
);
}
use DBI; # load local DBI by default
lib/Acme/RemoteINC.pm view on Meta::CPAN
=head2 B<new>
my $rinc = new Acme::RemoteINC(
host => 'ftp.myserver.com',
user => 'anonymous',
password => 'pwd@myhost.com',
perl_root => [ '/usr/lib/perl5/site_perl', /usr/lib_site_perl/5.8.1 ]
);
or
my $ftp = new Net::FTP;
lib/Acme/RemoteINC.pm view on Meta::CPAN
user => $loginname
Login user name.
password => $pwd
Login password.
Two paired hash entry named arguments are optional arguments for new:
perl_root => $wdir
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/SDUM/Renew.pm view on Meta::CPAN
is sent to an email, so you can manually check (yes, manually!)
if the operation suceeded.
use Acme::SDUM::Renew;
sdum_renew($username, $password, $email, $smtp);
=head1 EXPORT
sdum_renew
lib/Acme/SDUM/Renew.pm view on Meta::CPAN
=item username
Username to SDUM (don't forget to prepend a 'A' in case you are a student like me).
=item password
Your super ultra secret password.
=item email
A valid email address to send the report.
lib/Acme/SDUM/Renew.pm view on Meta::CPAN
=back
=cut
sub sdum_renew {
my ($username, $password, $email, $smtp) = @_;
croak "Username required" unless $username;
croak "Password required" unless $password;
croak "Notification email required" unless $email;
# smtp is optional
my $browser = LWP::UserAgent->new(
requests_redirectable => ['GET', 'HEAD', 'POST']
lib/Acme/SDUM/Renew.pm view on Meta::CPAN
my @forms = HTML::Form->parse($res);
my $form = shift @forms;
$form->value('bor_id', $username);
$form->value('bor_verification', $password);
$res = $browser->request($form->click);
$res->is_success or die "Error submiting login form (Phase 4)\n";
# Fase 5: Get Area Pessoal Link
$res->content =~ /rea Pessoal/ or die "Content not expected (check username/password) (Phase 5)\n";
$res->content =~ /href\=\"([^\"]+bor\-info)\"/
or die "Can't find Area Pessoal Link (Phase 5)\n";
$res = $browser->get($1);
view all matches for this distribution
view release on metacpan or search on metacpan
}
}
=head2 pwgen
Generates random passwords.
B<Input:> 0-n args
* First arg: length of password(s), default 8
* Second arg: number of passwords, default 1
* Third arg: string containing legal chars in password, default A-Za-z0-9,-./&%_!
* Fourth to n'th arg: list of requirements for passwords, default if the third arg is false/undef (so default third arg is used) is:
sub{/^[a-zA-Z0-9].*[a-zA-Z0-9]$/ and /[a-z]/ and /[A-Z]/ and /\d/ and /[,-.\/&%_!]/}
...meaning the password should:
* start and end with: a letter a-z (lower- or uppercase) or a digit 0-9
* should contain at least one char from each of the groups lower, upper, digit and special char
To keep the default requirement-sub but add additional ones just set the fourth arg to false/undef
and add your own requirements in the fifth arg and forward (examples below). Sub pwgen uses perls
own C<rand()> internally.
C<< $Acme::Tools::Pwgen_max_sec >> and C<< $Acme::Tools::Pwgen_max_trials >> can be set to adjust for how long
pwgen tries to find a password. Defaults for those are 0.01 and 10000.
Whenever one of the two limits is reached, a first generates a croak.
Examples:
my $pw=pwgen(); # a random 8 chars password A-Z a-z 0-9 ,-./&%!_ (8 is default length)
my $pw=pwgen(12); # a random 12 chars password A-Z a-z 0-9 ,-./&%!_
my @pw=pwgen(0,10); # 10 random 8 chars passwords, containing the same possible chars
my @pw=pwgen(0,1000,'A-Z'); # 1000 random 8 chars passwords containing just uppercase letters from A to Z
pwgen(3); # dies, defaults require chars in each of 4 group (see above)
pwgen(5,1,'A-C0-9', qr/^\D{3}\d{2}$/); # a 5 char string starting with three A, B or Cs and endring with two digits
pwgen(5,1,'ABC0-9',sub{/^\D{3}\d{2}$/}); # same as above
Examples of adding additional requirements to the default ones:
my @pwreq = ( qr/^[A-C]/ );
pwgen(8,1,'','',@pwreq); # use defaults for allowed chars and the standard requirements
# but also demand that the password must start with A, B or C
push @pwreq, sub{ not /[a-z]{3}/i };
pwgen(8,1,'','',@pwreq); # as above and in addition the password should not contain three
# or more consecutive letters (to avoid "offensive" words perhaps)
=cut
our $Pwgen_max_sec=0.01; #max seconds/password before croak (for hard to find requirements)
our $Pwgen_max_trials=10000; #max trials/password before croak (for hard to find requirements)
our $Pwgen_sec=0; #seconds used in last call to pwgen()
our $Pwgen_trials=0; #trials in last call to pwgen()
sub pwgendefreq{/^[a-z].*[a-z\d]$/i and /[a-z]/ and /[A-Z]/ and /\d/ and /[,-.\/&%_!]/}
sub pwgen {
my($len,$num,$chars,@req)=@_;
my %conf = read_conf('/etc/your/thing.conf');
print $conf{sectionA}{knobble}; #prints ABC if the file is as shown below
print $conf{sectionA}{gobble}; #prints ZZZ, the last gobble
print $conf{switch}; #prints OK here as well, unsectioned value
print $conf{part2}{password}; #prints oh:no= x
File use for the above example:
switch: OK #before first section, the '' (empty) section
[sectionA]
knobble: ABC
gobble: XYZ #this gobble is overwritten by the gobble on the next line
gobble: ZZZ
[part2]
password: oh:no= x #should be better
text: { values starting with { continues
until reaching a line with }
Everything from # and behind is regarded comments and ignored. Comments can be on any line.
To keep a # char, put a \ in front of it.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acrux/DBI.pm view on Meta::CPAN
RaiseError => 0,
PrintError => 0,
PrintWarn => 0,
=head2 password
my $password = $dbi->password;
This is the L<Mojo::URL/password> that will be used for generating the connection DSN
default: none
=head2 ping
lib/Acrux/DBI.pm view on Meta::CPAN
}
sub username {
my $self = shift;
return $self->{uri}->username // '';
}
sub password {
my $self = shift;
return $self->{uri}->password // '';
}
sub userinfo {
my $self = shift;
return $self->{uri}->userinfo // '';
}
lib/Acrux/DBI.pm view on Meta::CPAN
# Database methods
sub connect {
my $self = shift;
$self->{error} = '';
my $dbh = DBI->connect($self->dsn, $self->username, $self->password, $self->options);
if ($dbh) {
$self->{dbh} = $dbh;
printf STDERR "Connected to '%s'\n", $self->dsn if DEBUG;
} else {
$self->{error} = $DBI::errstr || "DBI->connect failed";
lib/Acrux/DBI.pm view on Meta::CPAN
sub connect_cached {
my $self = shift;
$self->{error} = '';
my %opts = %{($self->options)};
$opts{private_cachekey} = $self->cachekey;
my $dbh = DBI->connect_cached($self->dsn, $self->username, $self->password, {%opts});
if ($dbh) {
$self->{dbh} = $dbh;
printf STDERR "Connected (cached) to '%s'\n", $self->dsn if DEBUG;
} else {
$self->{error} = $DBI::errstr || "DBI->connect failed";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Activator/DB.pm view on Meta::CPAN
## You must define at least one connection alias
connections:
<conn_alias>:
user: <user>
pass: <password>
dsn: '<DSN>' # MySql Example: DBI:mysql:<DBNAME>:<DBHOST>
# PostgreSQL Example: DBI:Pg:dbname=<DBNAME>
# see: perldoc DBI, perldoc DBD::Pg, perldoc DBD::mysql
# for descriptions of valid DSNs
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ActiveRecord/Simple.pm view on Meta::CPAN
$class->primary_key($primary_key) if $primary_key;
$class->columns(@columns) if @columns;
}
sub connect {
my ($class, $dsn, $username, $password, $options) = @_;
eval { require DBIx::Connector };
$options->{HandleError} = sub {
my ($error_message, $DBI_st) = @_;
lib/ActiveRecord/Simple.pm view on Meta::CPAN
croak $error_message;
} if ! exists $options->{HandleError};
if ($@) {
$connector = ActiveRecord::Simple::Connect->new($dsn, $username, $password, $options);
$connector->db_connect;
}
else {
$connector = DBIx::Connector->new($dsn, $username, $password, $options);
}
return 1;
}
lib/ActiveRecord/Simple.pm view on Meta::CPAN
=head2 connect
Connect to the database, uses DBIx::Connector if installed, if it's not - L<ActiveRecord::Simple::Connect>.
__PACKAGE__->connect($dsn, $username, $password, $options);
=head2 dbh
Access to the database handler. Undef if it's not connected.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ActiveResource.pm view on Meta::CPAN
# A class for redmine issue
package Issue;
use parent 'ActiveResource::Base';
__PACKAGE__->site("http://localhost:3000");
__PACKAGE__->user("admin");
__PACKAGE__->password("admin");
package main;
# Find existing ticket
my $issue = Issue->find(42);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Activiti/Rest/Client.pm view on Meta::CPAN
=head1 CONSTRUCTOR parameters
=head2 url
base url of the activiti rest api
activiti-rest uses basic http authentication, so username and password should be included in the url
e.g.
http://kermit:kermit@localhost:8080/activiti-rest/service
view all matches for this distribution
view release on metacpan or search on metacpan
ex/rt-plugin.pl view on Meta::CPAN
handles => { show_ticket => [ 'show', ( type => 'ticket' ) ] },
);
sub _build_rt {
my $rt = RT::Client::REST->new( server => $_[0]->server );
$rt->login( username => $_[0]->user, password => $_[0]->pass, );
return $rt;
}
sub ticket {
my ( $self, $id ) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AddressBook/Config.pm view on Meta::CPAN
hostname CDATA #IMPLIED
objectclass CDATA #IMPLIED
base CDATA #IMPLIED
dn_calculate CDATA #IMPLIED
username CDATA #IMPLIED
password CDATA #IMPLIED>
<!ATTLIST LDIF key_fields CDATA #IMPLIED
filename CDATA #IMPLIED
objectclass CDATA #IMPLIED
base CDATA #IMPLIED
lib/AddressBook/Config.pm view on Meta::CPAN
<databases>
<LDAP objectclass="inetOrgPerson"
base="o=abook"
dn_calculate="'cn='.$cn"
username="cn=Manager,o=abook"
password="secret"
key_fields="cn"
/>
</databases>
</AddressBook_config>
lib/AddressBook/Config.pm view on Meta::CPAN
hostname="server_1"
objectclass="inetOrgPerson"
base="o=abook"
dn_calculate="'cn='.$cn"
username="cn=Manager,o=abook"
password="secret"
key_fields="cn"
/>
<ldap_server_2 driver="LDAP"
hostname="server_2"
objectclass="inetOrgPerson"
base="o=abook"
dn_calculate="'cn='.$cn"
username="cn=Manager,o=abook"
password="secret"
key_fields="cn"
/>
</databases>
</AddressBook_config>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ado/Command/adduser.pm view on Meta::CPAN
#TODO: add funcionality for notifying users on account expiration
#TODO: document this
stop_date => $t + ONE_YEAR, #account expires after one year
start_date => $t,
login_password => rand($t) . $$ . {} . $t,
};
};
sub init {
my ($self, @args) = @_;
lib/Ado/Command/adduser.pm view on Meta::CPAN
unless (@args) { Carp::croak($self->usage); }
my $args = $self->args;
my $ret = GetOptionsFromArray(
\@args,
'u|login_name=s' => \$args->{login_name},
'p|login_password=s' => \$args->{login_password},
'e|email=s' => \$args->{email},
'g|ingroup=s' => \$args->{ingroup},
'd|disabled:i' => \$args->{disabled},
'f|first_name=s' => \$args->{first_name},
'l|last_name=s' => \$args->{last_name},
lib/Ado/Command/adduser.pm view on Meta::CPAN
if ($args->{login_name} && !utf8::is_utf8($args->{login_name}));
utf8::decode($args->{first_name})
if ($args->{first_name} && !utf8::is_utf8($args->{first_name}));
utf8::decode($args->{last_name})
if ($args->{last_name} && !utf8::is_utf8($args->{last_name}));
$args->{login_password} = Mojo::Util::sha1_hex($args->{login_name} . $args->{login_password});
unless ($args->{ingroup}) {
say($self->usage)
unless ($args->{first_name}
and $args->{last_name}
and $args->{login_name}
lib/Ado/Command/adduser.pm view on Meta::CPAN
--first_name John --last_name Smith
# Add a user to an additional group
ado adduser --login_name USERNAME --ingroup GROUPNAME
# Change password / disable a user
ado adduser --login_name USERNAME --login_password N3W$36RE7P1$5W
# Disable a user
ado adduser --login_name USERNAME --disabled
# Programatically
lib/Ado/Command/adduser.pm view on Meta::CPAN
=head1 OPTIONS
On the commandline C<ado adduser> accepts the following options:
'u|login_name=s' #username (mandatory)
'p|login_password=s' #the user password (optional, random is generated)
'e|email=s' #user email (mandatory)
'g|ingroup=s' #existing users can be added to other groups too
'd|disabled:i' #is user disabled? (1 by default)
'f|first_name=s' #user's first name (mandatory)
'l|last_name=s' #user's last name (mandatory)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Advanced/Config/Examples.pm view on Meta::CPAN
user = me
pwd = nope!
[ host 1 ]
abc = xyz
pwd = password1
[host 2]
abc=abc
pwd = password2
[ HOST 3 ]
abc = 123
pwd = password3
[ HOST 2 ]
efg = repeat # Section "host 2" has 3 tags in it. "abc", "efg" & "pwd".
[ Host 4 ]
lib/Advanced/Config/Examples.pm view on Meta::CPAN
=item ENCRYPTING/DECRYPTING CONFIG FILES
Sometimes you need to protect sensitive information inside your config files.
Such as the user names and passwords that your application requires to run.
This module allows this at the individual tag/value pair level. Not at the
file level!
The 1st example shows tags whose values are pending the encryption process.
While the 2nd example shows what happens after it's been encrypted. You can
lib/Advanced/Config/Examples.pm view on Meta::CPAN
as tags whose values are never encrypted. It is controlled by having the
appropriate label in the comment after the tag/value pair.
# Waiting to encrypt these values ...
my_username_1 = "anonymous" # ENCRYPT
my_password_1 = "This is too much fun!" # ENCRYPT me ...
# They've already been encypted!
my_username_2 = '4aka54D3eZ4aea5' # DECRYPT
my_password_2 = '^M^Mn1\pmeaq>n\q?Z[x537z3A' # DECRYPT me ...
# This value will never be encrytped/decrypted ...
dummy = "Just some strange value that is always in clear text."
The encrypted value is automatically decrypted for you when the config file
view all matches for this distribution
view release on metacpan or search on metacpan
bin/agent_net.pl view on Meta::CPAN
=over 12
=item B<agent_net>
B<username>S<=>I<username>
B<password>S<=>I<password>
B<domain>S<=>I<domain>
[B<resource>S<=>I<resource>]
[B<host>S<=>I<XMPP server>]
[B<help>]
[B<man>]
bin/agent_net.pl view on Meta::CPAN
=item B<username>
The XMPP user the Agent will log in as, without the domain.
Required unless the script has been edited to enable a default user.
=item B<password>
The password to be used by the Agent to log in to the XMPP server.
Required unless the script has been edited to enable a default password.
=item B<domain>
The XMPP domain of the user account of the Agent.
Required unless the script has been edited to enable a default domain.
bin/agent_net.pl view on Meta::CPAN
sub VERBOSE () { 0 }
# Process optional parameters from the command line and assign defaults.
use Getopt::Lucid qw(:all);
my ($opt, $verbose,$domain,$username,$password,$resource,$host);
eval {$opt = Getopt::Lucid->getopt([
Param("domain|d"),
Param("username|u"),
Param("password|p"),
Param("resource|r"),
Param("host"),
Param("master|m"),
Counter("verbose|v"),
Switch("help"),
bin/agent_net.pl view on Meta::CPAN
$verbose = $opt->get_verbose ? $opt->get_verbose : VERBOSE;
# Optionally set default jabber/xmpp parameters to log in with
$username = $opt->get_username ? $opt->get_username : 'agent';
$password = $opt->get_password ? $opt->get_password : 'agent';
$resource = $opt->get_resource ? $opt->get_resource : 'tcli';
$domain = $opt->get_domain ? $opt->get_domain : 'example.com';
$host = $opt->get_host ? $opt->get_host : $domain;
# Error if options not set and not provided.
bin/agent_net.pl view on Meta::CPAN
);
Agent::TCLI::Transport::XMPP->new(
'jid' => Net::XMPP::JID->new($username.'@'.$domain.'/'.$resource),
'jserver' => $host,
'jpassword'=> $password,
'peers' => \@users,
'verbose' => \$verbose, # Verbose sets level or warnings
'control_options' => {
view all matches for this distribution
view release on metacpan or search on metacpan
bin/agent_tail.pl view on Meta::CPAN
=over 12
=item B<agent_tail>
B<username>S<=>I<username>
B<password>S<=>I<password>
B<domain>S<=>I<domain>
[B<resource>S<=>I<resource>]
[B<host>S<=>I<XMPP server>]
[B<help>]
[B<man>]
bin/agent_tail.pl view on Meta::CPAN
=item B<username>
The XMPP user the Agent will log in as, without the domain.
Required unless the script has been edited to enable a default user.
=item B<password>
The password to be used by the Agent to log in to the XMPP server.
Required unless the script has been edited to enable a default password.
=item B<domain>
The XMPP domain of the user account of the Agent.
Required unless the script has been edited to enable a default domain.
bin/agent_tail.pl view on Meta::CPAN
sub VERBOSE () { 0 }
# Process optional parameters from the command line and assign defaults.
use Getopt::Lucid qw(:all);
my ($opt, $verbose,$domain,$username,$password,$resource,$host);
eval {$opt = Getopt::Lucid->getopt([
Param("domain|d"),
Param("username|u"),
Param("password|p"),
Param("resource|r"),
Param("host"),
Counter("verbose|v"),
Switch("help"),
Switch("man"),
bin/agent_tail.pl view on Meta::CPAN
$verbose = $opt->get_verbose ? $opt->get_verbose : VERBOSE;
# Optionally set default jabber/xmpp parameters to log in with
$username = $opt->get_username ? $opt->get_username : 'agent';
$password = $opt->get_password ? $opt->get_password : 'agent';
$resource = $opt->get_resource ? $opt->get_resource : 'tcli';
$domain = $opt->get_domain ? $opt->get_domain : 'example.com';
$host = $opt->get_host ? $opt->get_host : $domain;
# Error if options not set and not provided.
bin/agent_tail.pl view on Meta::CPAN
);
Agent::TCLI::Transport::XMPP->new(
'jid' => Net::XMPP::JID->new($username.'@'.$domain.'/'.$resource),
'jserver' => $host,
'jpassword'=> $password,
'peers' => \@users,
'xmpp_process_time'=> 1,
'verbose' => \$verbose, # Verbose sets level or warnings
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/Aion/Fs.pm view on Meta::CPAN
symext => '.',
regexp => qr!^
(?<dir>
(
(?<node> [^:\[\]]* )
( \[" (?<accountname> [^\s:\[\]]+ ) \s+ (?<password> [^\s:\[\]]+ ) "\] )?
:: )?
(?<volume>
(?<disk> [^\$:\[\]]* )
( \$ (?<user> [^\$:\[\]]* ) )?
: )?
lib/Aion/Fs.pm view on Meta::CPAN
)
\z!xsn,
join => sub {
_join [qw/path dir volume file/],
node => "%s",
[qw/accountname password/] => '["%s %s"]',
[qw/node accountname password/] => "::",
disk => "%s",
user => "\$%s",
[qw/disk user/] => ':',
folder => "[%s]",
name => "%s",
lib/Aion/Fs.pm view on Meta::CPAN
};
path "DISK:[DIRECTORY.SUBDIRECTORY]FILENAME.EXTENSION" # --> $path
$path = {
path => 'NODE["account password"]::DISK$USER:[DIRECTORY.SUBDIRECTORY]FILENAME.EXTENSION;7',
dir => 'NODE["account password"]::DISK$USER:[DIRECTORY.SUBDIRECTORY]',
node => "NODE",
accountname => "account",
password => "password",
volume => 'DISK$USER:',
disk => 'DISK',
user => 'USER',
folder => "DIRECTORY.SUBDIRECTORY",
card => "FILENAME.EXTENSION;7",
lib/Aion/Fs.pm view on Meta::CPAN
name => "FILENAME",
ext => "EXTENSION",
version => 7,
};
path 'NODE["account password"]::DISK$USER:[DIRECTORY.SUBDIRECTORY]FILENAME.EXTENSION;7' # --> $path
path {volume => "DISK:", file => "FILENAME.pm", ext => "EXTENSION"} # => DISK:FILENAME.EXTENSION
path {user => "USER", folder => "DIRECTORY.SUBDIRECTORY", file => "FILENAME.pm", ext => "EXTENSION"} # \> $USER:[DIRECTORY.SUBDIRECTORY]FILENAME.EXTENSION
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Aion/Query.pm view on Meta::CPAN
};
}
# ÐÐ¾Ð½Ð½ÐµÐºÑ Ðº базе и id коннекÑа
sub base_connect {
my ($dsn, $user, $password, $conn) = @_;
my $base = DBI->connect($dsn, $user, $password, {
RaiseError => 1,
PrintError => 0,
$dsn =~ /^DBI:mysql/i ? (mysql_enable_utf8 => 1): (),
}) or die "Connect to db failed";
lib/Aion/Query.pm view on Meta::CPAN
default_dsn # => DBI:SQLite:dbname=test-base.sqlite
=head2 default_connect_options()
DSN, user, password and commands after connection.
[default_connect_options] # --> ['DBI:SQLite:dbname=test-base.sqlite', 'root', 123, []]
=head2 base_connect ($dsn, $user, $password, $conn)
We connect to the database and return the connection and identify it.
my ($dbh, $connect_id) = base_connect("DBI:SQLite:dbname=base-2.sqlite", "toor", "toorpasswd", []);
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
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/Akado/Account.pm view on Meta::CPAN
sub new {
my ($class, $self) = @_;
croak 'No login specified, stopped' unless $self->{login};
croak 'No password specified, stopped' unless $self->{password};
$self->{site} ||= 'https://office.akado.ru/';
bless($self, $class);
return $self;
lib/Akado/Account.pm view on Meta::CPAN
my $browser = LWP::UserAgent->new;
$browser->agent("Akado::Account/$Akado::Account::VERSION");
$browser->cookie_jar( {} );
# At first we need to login to the site.
# Here we POST login/password and recieve session cookies that are stored
# in the UserAgent cookie_jar.
my $auth_response = $self->_get_auth_response($browser);
# Here we get account data using session cookies that we got at the
# previous step
lib/Akado/Account.pm view on Meta::CPAN
my $url = $self->{site} . "/user/login.xml";
my $request = POST($url,
Content => [
login => $self->{login},
password => $self->{password},
]
);
my $response = $browser->request($request);
$self->_check_response($response);
lib/Akado/Account.pm view on Meta::CPAN
This a constuctor. It creates object. The constractor will not access the
account site. All network interaction is made in the methods that return data.
my $aa = Akado::Account->new({
login => $login,
password => $password,
});
=head2 get_balance
It will return number. The number is the sum of money that is left on the
view all matches for this distribution
view release on metacpan or search on metacpan
DEVELOPING.md view on Meta::CPAN
dzil test --author --release
To release the module:
* update and commit `Changes`
* run `dzil release` (you'll need the PAUSE username and password)
* if the release succeeded:
* `git tag <tag>`
* `git push --tags`
* create release with the given tag on GitHub
view all matches for this distribution