This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Cwd; | |
use Data::Dumper; | |
my $DEBUG = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
# 222.169.193.162 - - [15/Dec/2017:07:24:34 -0500] "GET / HTTP/1.0" 302 483 "-" "Mozilla/5.0 (BlackBerry; U; BlackBerry 9850; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.254 Mobile Safari/534.11+" | |
my %ips; | |
my $cnt = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Time::HiRes qw(setitimer ITIMER_REAL); | |
# Задаём все переменные | |
# Команда, которую нужно запускать |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
open LOG, '-|', 'tail -f /var/log/apache2/_________.su.access.log'; | |
while( my $line = <LOG> ) { | |
if ( $line =~ /WordPress/ ) { | |
my @fields = split( /\s+/, $line ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# Script to monitor top senders via your exim server in realtime | |
use strict; | |
no warnings; | |
use Text::Table; | |
# Default amount of top senders, may be overriden by commandline argument | |
my $default_top = 40; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# /etc/rc.d/init.d/exim-qtmpfs | |
# | |
# <description of the *service*> | |
# <any general comments about this init script> | |
# | |
# chkconfig: 2345 60 40 | |
# | |
# Tested on CentOS release 6.6 (Final) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
path=$1 | |
if [ -d $path ] | |
then | |
dirs=$(ls -1 $path | grep -v home) | |
for i in $dirs | |
do | |
if [ -d $path$i ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
my $path = $ARGV[0]; | |
if ( -d $path ) { | |
if ( opendir DIR, $path ) { | |
my @dirs; | |
for my $item ( readdir DIR ) { | |
if ( -d $path.$item ) { | |
next if $item =~ m|^home|; | |
next if $item =~ m|^..$|; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
d = sys.argv[1] | |
subdirs = [] | |
for o in os.listdir( d ): | |
if os.path.isdir( os.path.join( d, o )): | |
subdirs.append( os.path.join( d, o ) ) | |
if '/home' in subdirs: | |
subdirs.remove( '/home' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# Perl Array vs Hash (using hash like an array) | |
# Script measures filling and fetching speeds of arrays and hashes in Perl 5 | |
use strict; | |
use warnings; | |
use Time::HiRes qw( time ); |
NewerOlder