Lilith depends via packages' );
my @depends = (
'TOML', 'DBI', 'JSON', 'File::ReadBackwards',
'Digest::SHA', 'POE', 'File::Slurp', '
N
This conversion is between objects defined in Wikibase::Datatype and structures
serialized via JSON to MediaWiki.
=head1 SUBROUTINES
=head2 C<obj2struct>
my $struct_hr = obj2struct($obj, $base_
File::Slurp;
use Exporter 'import';
our @EXPORT = qw(github_releases);
use LWP::UserAgent ();
use JSON;
=head1 NAME
Ixchel::functions::github_releases - Fetches release information for the specified
repo :: Repo to fetch the releases for.
The following are optional.
- raw :: Return the raw JSON and don't decode it.
Default :: 0
If the $ENV variables below are set, they will be used
{
return $content;
}
my $json;
eval { $json = decode_json($content); };
if ($@) {
die( 'Decoding JSON from "' . $url . '" failed... ' . $@ );
}
return $json;
} ## end sub github_releases
Layout;
use 5.006;
use strict;
use warnings;
our $VERSION = '0.06';
use Mojo::Log;
use Config::JSON::Enhanced;
use XML::XPath;
use XML::LibXML;
use Data::Roundtrip qw/perl2dump no-unicode-escape-p
return perl2dump($_[0]->{'data'}, {terse=>1,pretty=>1});
}
sub toJSON { return perl2json($_[0]->{'data'}, {pretty=>1}); }
sub TO_JSON { return $_[0]->{'data'} }
sub log { return $_[0]->{'_private'}-
passed JSON data, using the Procedural interface.
=cut
use strict;
use warnings;
use Data::Dumper;
use IO::File;
use Getopt::Long;
#use lib './lib'; # development use only
use Data::Ref::JSON qw(wal
> \$tcFile,
"h|help!" => \$help
) or die usage(1);
if ($help) {
usage();
exit;
}
Data::Ref::JSON::setDebugLevel($debugLevel);
my $fh = new IO::File;
$fh->open($tcFile,'r') || die "cannot open
h>;
$/ = $slurpSave;
# read a perl script, and getting the JSON from it
# the hash is $tc in the script
my $tc;
eval $tcStr;
Data::Ref::JSON::pdebug(1,'Test Data tc: ' , Dumper($tc));
walk($tc);
su
200 100
use 5.006;
use strict;
use warnings;
our $VERSION = '0.04';
use Mojo::Log;
use Config::JSON::Enhanced;
use File::Temp qw/tempfile/;
use Cwd;
use FindBin;
use Data::Roundtrip qw/perl2dump n
efined $ch ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, call to ".'Config::JSON::Enhanced::config2perl()'." has failed for configuration file '$infile'."); return undef }
# se
nfighash()'." has failed.\n"; return 1 }
} else {
# use default config
$confighash = Config::JSON::Enhanced::config2perl({
'string' => $_DEFAULT_CONFIG,
'commentstyle' => 'custom(</*)(*/>)'
l not work when passed JSON data
=cut
use strict;
use warnings;
use Data::Dumper;
use IO::File;
use Getopt::Long;
#use lib './lib'; # development use only
use Data::Ref::JSON;
my $debugLevel=0;
#
= $slurpSave;
# read a perl script, and getting the JSON from it
# the hash is $tc in the script
my $tc;
eval $tcStr;
my $dr = Data::Ref::JSON->new (
{
DEBUG => $debugLevel,
DATA => $tc
}
);
erties;
use 5.006;
use strict;
use warnings;
our $VERSION = '0.06';
use Mojo::Log;
use Config::JSON::Enhanced;
use XML::XPath;
use XML::LibXML;
use Data::Roundtrip qw/perl2dump no-unicode-escape-p
? $v : '['.join(',', @$v).']')."\n";
# }
# return $ret;
}
sub toJSON { return perl2json($_[0]->{'data'}, {pretty=>1}); }
sub TO_JSON { return $_[0]->{'data'} }
sub log { return $_[0]->{'_private'}
!/usr/bin/env perl
# using object interface
# read JSON, create Perl Data Structure and print references
=head1 drp.pl
This script reads in JSON from a file.
The script then prints the values an
f::JSON;
eval { require JSON::Parse };
if ($@) {
die "The JSON::Parse Module must be installed\n";
} else {
JSON::Parse->import( qw(parse_json) );
}
my $debugLevel=0;
# test case file
my $jsonFil
e = 'test-files/adobe-example-5.json';
my $help=0;
GetOptions (
"l|debug-level=i" => \$debugLevel,
"f|test-file=s" => \$jsonFile,
"h|help!" => \$help
) or die usage(1);
if ($help) {
usage();
ex
erties;
use 5.006;
use strict;
use warnings;
our $VERSION = '0.06';
use Mojo::Log;
use Config::JSON::Enhanced;
use XML::XPath;
use XML::LibXML;
use Data::Roundtrip qw/perl2dump no-unicode-escape-p
return perl2dump($_[0]->{'data'}, {terse=>1,pretty=>1});
}
sub toJSON { return perl2json($_[0]->{'data'}, {pretty=>1}); }
sub TO_JSON { return $_[0]->{'data'} }
sub log { return $_[0]->{'_private'}-
('blib/lib');
use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;
use Android::ElectricSheep::Automator;
my $VERBOSITY = 0; # we
to dump current location." }
my $jsonstr = perl2json($geo);
if( ! defined $jsonstr ){ die perl2dump($geo)."$0 : failed to convert above Perl data structure to JSON." }
if( defined $OUTFILE ){
my $F
e "$0 : failed to open output file '$OUTFILE' for writing, $!";
print $FH $jsonstr;
close $FH;
} else { print STDOUT $jsonstr }
print STDOUT "$0 : done, success!".(defined($OUTFILE)?" Output writte
w(github_fetch_release_asset);
use Ixchel::functions::github_releases;
use LWP::UserAgent ();
use JSON;
=head1 NAME
Ixchel::functions::github_fetch_release_asset - Fetches a release asset from a Git
200 100
use 5.006;
use strict;
use warnings;
our $VERSION = '0.06';
use Mojo::Log;
use Config::JSON::Enhanced;
# it requires v0.002 (which is with my modifications)
#use Android::ADB;
# issue filed
bXML;
use XML::LibXML::XPathContext;
use Text::ParseWords;
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;
use Android::ElectricSheep::Automator::DeviceProperties;
use And
running processes on device (using a `ps`),
# optionally can save the (parsed) `ps`
# results as JSON to the specified 'filename'.
# It needs that connect_device() to have been called prior to this c
('blib/lib');
use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;
use Android::ElectricSheep::Automator;
my $VERBOSITY = 0; # we
e, success!".(defined($OUTFILE)?" Output JSON written to file '$OUTFILE'.\n":"\n");
sub usage {
return "Usage $0 --configfile CONFIGFILE [--output procs.json] [--device DEVICE] [--verbosity v]\n"
l 'ps' output), optionally saving a JSON version of the parsed 'ps' output to file.\n"
. "\nExample:\n"
. "$0 --configfile config/myapp.conf --output procs.json\n"
. "\nProgram by Andreas Hadjip
('blib/lib');
use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;
use Android::ElectricSheep::Automator;
my $VERBOSITY = 0; # we
('blib/lib');
use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;
use Android::ElectricSheep::Automator;
my $VERBOSITY = 0; # we
('blib/lib');
use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;
use Android::ElectricSheep::Automator;
my $VERBOSITY = 0; # we
sed and TO_JSON!
my $jsonstr = perl2json($apps, {terse=>1, pretty=>1, convert_blessed=>1});
if( ! defined $jsonstr ){ print STDERR "$0 : error, failed to convert perl data structure to JSON.\n"; exit
e "$0 : failed to open output file '$OUTFILE' for writing, $!";
print $FH $jsonstr;
close $FH;
} else { print STDOUT $jsonstr }
print STDOUT "$0 : done, success!".(defined($OUTFILE)?" Output writte
s are now available as e.g., B<PG_JSONB>
(the B<PG_> prefix is I<not> removed):
@fields = xFIELDS(
segment => INTEGER,
pars => PG_JSONB,
);
The generated field objec
re available with an added prefix of B<DBD_TYPE_>, e.g.
the L<DBD::Pg>'s B<PG_JSON> is made available as B<DBD_TYPE_PG_JSON>.
=head1 SUBROUTINES
=head2 SQL_TYPE_NAMES
=head2 SQL_TYPE_VALUES
@typ
pes provided by this package, e.g. do this:
use CXC::DB::DDL::Util 'DBD_TYPE_PG_JSONB';
xTYPE( DBD_TYPE_PG_JSONB, ... );
=head2 xFIELDS
@field_spec = xFIELDS( array of Tuple[ NonEmptyStr,
('blib/lib');
use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;
use Android::ElectricSheep::Automator;
my $VERBOSITY = 0; # we
ie -> /var/log/suricata/alert.json
Sagan -> $hostname-lae -> /var/log/sagan/alert.json
CAPEv2 -> $hostname-malware -> /opt/CAPEv2/log/eve.json
For multi-instance it is done as
log/suricata/alert-$instance.json
Sagan -> $hostname-$instance -> /var/log/sagan/alert-$instance.json
CAPEv2 -> $hostname-malware -> /opt/CAPEv2/log/eve.json (or wherever .cape.eve set
',
eve => '/var/log/suricata/alert.json',
};
$self->status_add( status => $instance_name . ': type=suricata, eve="/var/log/suricata/alert.json"', );
} elsif ( $self->{config}{suricata