Ganteng Doang Upload Shell Gak Bisa


Linux server.jmdstrack.com 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
/ scripts/

//scripts/import_exim_data

#!/usr/local/cpanel/3rdparty/bin/perl

# cpanel - scripts/import_exim_data                Copyright 2022 cPanel, L.L.C.
#                                                           All rights reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

package scripts::import_exim_data;

=encoding utf-8

=head1 NAME

import_exim_data

=head1 SYNOPSIS

    import_exim_data ( --help | <logfile1> [ <logfile2> .. ] )

=head1 DESCRIPTION

This command re-populates the email statistics database based on the contents
of the log files at the given paths.

The format of the data in each exim log file should conform to the data format
of F</var/log/exim_mainlog>. Any of the files may be in gzip format, in which
case the filename must end with C<.gz>.

=cut

use strict;
use warnings;

use parent qw( Cpanel::HelpfulScript );

use Cpanel::Config::LoadCpConf          ();
use Cpanel::EximStats::ImportInProgress ();
use Cpanel::Finally                     ();
use Cpanel::IONice                      ();
use Cpanel::IP::Loopback                ();
use Cpanel::Locale                      ();
use Cpanel::PIDFile                     ();
use Cpanel::Sys::Load                   ();
use Cpanel::TailWatch                   ();    # PPI USE OK - inline below
use Cpanel::TailWatch::Eximstats        ();
use Cpanel::TimeHiRes                   ();
use Cpanel::IO                          ();
use Cpanel::Timezones                   ();

use Try::Tiny;

use constant _OPTIONS => ();

use constant _ACCEPT_UNNAMED => 1;

{

    package FakeTailWatch;    # Because Cpanel::TailWatch::Eximstats::process_line()
                              # thinks it needs a tailwatch obj

    use parent 'Cpanel::TailWatch';    # PPI USE OK - needed to mock this properly

    sub new {
        my ($class) = @_;
        return bless {}, $class;
    }

    sub register_module        { }
    sub register_reload_module { }
    sub register_action_module { }
    *_is_loopback = sub {
        my $self = shift;

        goto \&Cpanel::IP::Loopback::is_loopback;
    };
    sub log              { shift @_; printf STDERR "@_\n" }
    sub log_sql          { shift @_; printf STDERR "@_\n" }
    sub debug            { shift @_; printf STDERR "@_\n" }
    sub error            { shift @_; printf STDERR "@_\n" }
    sub clear_data_cache { }
    {
        no warnings 'once';
        no warnings 'redefine';
        *Cpanel::TailWatch::Eximstats::_send_limit_exceeded_notification = sub { return 1; };
        *Cpanel::TailWatch::Eximstats::_validate_email_limits_data       = sub { return 1; };
    }
}

$Cpanel::TailWatch::Eximstats::LOG_DUPLICATES = 0;

# Our for tests
our $LOOP_SIZE = 10000;

our $MAX_SLEEP_TIME = 120;    # seconds

__PACKAGE__->new(@ARGV)->run() unless caller();

sub run {
    my ($self) = @_;

    Cpanel::PIDFile->do(
        $Cpanel::EximStats::ImportInProgress::PATH,
        sub { $self->script( $self->getopt_unnamed() ) },
    );

    return;
}

sub script {
    my ( $self, @infiles ) = @_;

    local $ENV{'TZ'} = Cpanel::Timezones::calculate_TZ_env();

    if ( !@infiles ) {
        die $self->help( Cpanel::Locale->get_handle()->maketext('Give at least one filesystem path.') );
    }

    my $tailwatch_obj = FakeTailWatch->new;
    $tailwatch_obj->init_global_share();
    my $logfile = '/dev/null';
    my $now     = time;

    Cpanel::TailWatch::Eximstats->init($tailwatch_obj);

    my $eximstats = Cpanel::TailWatch::Eximstats->new( $tailwatch_obj, 'buffered_sql' => 1, 'import' => 1 );

    my $cpconf_ref = Cpanel::Config::LoadCpConf::loadcpconf();

    if ( Cpanel::IONice::ionice( 'best-effort', exists $cpconf_ref->{'ionice_import_exim_data'} ? $cpconf_ref->{'ionice_import_exim_data'} : 6 ) ) {
        print "[import_exim_data] Setting I/O priority to reduce system load: " . Cpanel::IONice::get_ionice() . "\n";
    }

    setpriority( 0, 0, 19 );

    $eximstats->_ensure_dbh();

    $eximstats->{'dbh'}->do('PRAGMA synchronous = OFF;');
    my $finally = Cpanel::Finally->new( sub { $eximstats->{'dbh'}->do('PRAGMA synchronous = ON;'); } );

  INFILE: for my $infile (@infiles) {
        print "$0: Processing input infile: $infile\n";
        local $0 = "$0 - processing input file: $infile";

        if ( !-f $infile ) {
            warn "Skipping input file $infile, file does not exist or is not a regular file";
            next INFILE;
        }

        my $fh;

        if ( $infile =~ /[.]gz$/ ) {
            my @cmd = ( qw[ gunzip -c -f ], $infile );
            if ( !open $fh, '-|', @cmd ) {
                warn "Skipping $infile: Cannot open pipe to read stdout from command '@{ [ join ' ', @cmd ] }' : $!";
                next INFILE;
            }
        }
        else {
            if ( !open $fh, '<', $infile ) {
                warn "Skipping $infile: Cannot open $infile for reading: $!";
                next INFILE;
            }
        }

        my $loop_count = 0;
        my $lasttime   = $now = [ Cpanel::TimeHiRes::gettimeofday() ];
        my ( $load_one, $load_five, $load_fifteen ) = Cpanel::Sys::Load::getloadavg($Cpanel::Sys::Load::ForceFloat);

        $load_one = sprintf( "%.01f", $load_one );    # Reduce precision on load_one to avoid divide by zero below (FPU fun)

        my ( $post_load_one, $post_load_five, $post_load_fifteen );

        my $process_line_regex = $eximstats->{'process_line_regex'}->{'/var/log/exim/mainlog'};

        while ( my $block = Cpanel::IO::read_bytes_to_end_of_line( $fh, 65_535 ) ) {
            foreach my $line ( grep { m{$process_line_regex}o } split( m{\n}, $block ) ) {
                if ( ++$loop_count % $LOOP_SIZE == 0 ) {
                    $eximstats->commit_buffer();

                    ( $post_load_one, $post_load_five, $post_load_fifteen ) = Cpanel::Sys::Load::getloadavg($Cpanel::Sys::Load::ForceFloat);
                    $lasttime = $now;
                    $now      = [ Cpanel::TimeHiRes::gettimeofday() ];
                    print(
                        "($loop_count) Processed " . sprintf(
                            '%0.2f',
                            (
                                $LOOP_SIZE / (
                                    (

                                        ( $now->[0] - $lasttime->[0] ) + ( ( $now->[1] - $lasttime->[1] ) / 1000000 )
                                    )
                                      || 1
                                )
                            )
                          )
                          . " records per second\n"
                    );
                    if ( $loop_count > 75000 ) {
                        $eximstats->{'quote_cache'} = {};
                    }
                    if ( $post_load_one > 1 && $post_load_one > ( $load_one * 1.1 ) ) {
                        my $sleep_time = calculate_sleep_time( $load_one, $post_load_one );

                        print "Load before import: $load_one, Load after import: $post_load_one.   Waiting ${sleep_time}s for load to decrease.\n";

                        sleep($sleep_time);

                        # We want to sleep a bit for disk i/o to catch up.   The idea here is to
                        # prevent this process for hogging the disk and create a large wait backlog.

                        # The goal is to still complete the optimization, however prevent the user
                        # from having the desire to kill off import_exim_data

                        # If we have driven up the load a bit we sleep in the end as well in order
                        # to give the system time to return to normal before upcp proceeds to
                        # prevent normal operations from being slowed down too much.
                        ( $load_one, $load_five, $load_fifteen ) = Cpanel::Sys::Load::getloadavg($Cpanel::Sys::Load::ForceFloat);
                    }

                }

                #next if $line !~ m{$process_line_regex}o;

                $eximstats->process_line( $line, $tailwatch_obj, $logfile, $now->[0] );
            }
        }

        $eximstats->commit_buffer();
        close $fh;

        print "Data has been imported to the database from the exim log.\n";
    }

    return 1;
}

sub calculate_sleep_time {
    my ( $load_one, $post_load_one ) = @_;

    # adding .00001 to avoid dividing by 0.0
    my $sleep = $load_one ? int( 60 * ( $post_load_one / ( $load_one + 0.00001 ) ) ) : 60;
    return $sleep > $MAX_SLEEP_TIME ? $MAX_SLEEP_TIME : $sleep;
}

1;
			
			


Thanks For 0xGh05T - DSRF14 - Mr.Dan07 - Leri01 - FxshX7 - AlkaExploiter - xLoveSyndrome'z - Acep Gans'z

JMDS TRACK – Just Another Diagnostics Lab Site

Home

JMDS TRACK Cameroon

Boost the productivity of your mobile ressources


Make An Appointment


Fleet management

  1. Reduce the operting cost and the unavailability of your vehicles
  2. reduce the fuel consumption of your fleet
  3. Improve the driving dehavior and safety of your drivers
  4. optimize the utilization rate of your equipment 
  5. protect your vehicle against theft
  6. Improve the quality of your customer service


Find out more

Assets management

  1. Track the roaming of your equipment
  2. Optimise the management of your assets on site and during transport
  3. Secure the transport of your goods
  4. Make your team responsible for preventing the loss of tools, equipment
  5. Take a real-time inventory of your equipment on site
  6. Easily find your mobile objects or equipment



Find out more



Find out more

Antitheft solutions

  1. Secure your vehicles and machinery and increase your chances of recovering them in the event of theft
  2. Protect your assets and reduce the costs associated with their loss
  3. Combine immobiliser and driver identification and limit the risk of theft
  4. Identify fuel theft and reduce costs
  5. Protect your goods and take no more risks
  6. Be alerted to abnormal events

Our Location

 Douala BP cité 

     and

Yaoundé Total Essos


Make An Appointment


Get Directions

682230363/ 677481892

What makes us different from others

  • young and dynamic team
  • call center 24/24 7/7
  • roaming throughout Africa
  • team of developers who can develop customer-specific solutions
  • diversity of services
  • reactive and prompt after-sales service when soliciting a customer or a malfunction
  • Free Maintenance and installation in the cities of Douala and Yaounde

https://youtu.be/xI1cz_Jh2x8

15+
years of experience in GPS system development, production and deployment.

15 Collaborators

More than 15 employees dedicated to the research and development of new applications and to customer care

5 000 Vehicles and mobile assets

5 000 vehicles and mobile assets under management, in Africa

Our Partners










Latest Case Studies

Our current projects 

5/5
Bon SAV , SATISFAIT DU TRAITEMENT DES REQUETES

M DIPITA CHRISTIAN
Logistic Safety Manager Road Safety Manager
5/5
La réactivité de JMDS est excellente
Nous restons satisfait dans l’ensemble des prestations relatives a la couverture de notre parc automobile

Hervé Frédéric NDENGUE
Chef Service Adjoint de la Sécurité Générale (CNPS)
5/5
L’APPLICATION EMIXIS est convivial A L’utilisation
BEIG-3 SARL
DIRECTOR GENERAL
5/5
Nevertheless I am delighted with the service
MR. BISSE BENJAMIN
CUSTOMER

Subsribe To Our Newsletter

Stay in touch with us to get latest news and special offers.



Address JMDS TRACK

Douala bp cité



and

YAOUNDE Total Essos

Call Us

+237682230363



Email Us


info@jmdstrack.cm