Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl -w
use strict;
use Asterisk::AGI;
my $a = new Asterisk::AGI;
$a->answer();
$a->verbose($a->get_variable('fuflo'));
$a->stream_file('goodbye');
$a->hangup();
@dynax60
dynax60 / gist:9321013
Last active August 29, 2015 13:56
Shredder for backup script (Masterhost)
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
our $m;
run($_) for @{[
[ '/mnt/fs_admin/BACKUP/masterhost/u11111/backup_u11111', 'domain\.ru' ],
[ '/mnt/fs_admin/BACKUP/masterhost/u11111/backup_u11111/mysql', 'u11111\_domain\_'],
]};
@dynax60
dynax60 / gist:9827363
Created March 28, 2014 07:42
snmptable -c public -v 2c -Os -Ciw 150 192.168.0.24 IF-MIB:ifTable
SNMP table: ifTable
index ifIndex ifDescr ifType ifMtu ifSpeed ifPhysAddress ifAdminStatus ifOperStatus ifLastChange ifInOctets
1 1 "Vlan1" 53 1500 1000000000 "00 21 1C 8F 57 C0 " up up 33:3:51:19.32 170764860
5 5 "Vlan5" 53 1500 1000000000 "00 21 1C 8F 57 C1 " up up 33:3:51:19.32 647560393
6 6 "Vlan6" 53 1500 1000000000 "00 21 1C 8F 57 C2 " up up 0:0:01:17.45 1047530953
7 7 "Vlan7" 53 1500 1000000000 "00 21 1C 8F 57 C3 " up up 33:3:51:19.32 482233936
5023 5023 "Port-channel23" 53 1500 2000000000 "00 21 1C 8F 57 97 " up up 33:3:51:21.28 1377784949
10101 10101 "GigabitEthernet0/1" ethernet-csmacd 1500 10000000 "00 21 1C 8F 57 81 " up down 0:0:01:09.94
# ps -ylC httpd --sort:rss
S UID PID PPID C PRI NI RSS SZ WCHAN TTY TIME CMD
S 48 12279 1432 0 80 0 5076 4071 - ? 00:00:00 httpd
S 48 11996 1432 0 80 0 5096 4074 - ? 00:00:00 httpd
S 48 11998 1432 0 80 0 5116 4074 - ? 00:00:00 httpd
S 48 11999 1432 0 80 0 5116 4074 - ? 00:00:00 httpd
S 48 10235 1432 0 80 0 5124 4074 - ? 00:00:00 httpd
S 48 7275 1432 0 80 0 5136 4074 - ? 00:00:00 httpd
S 48 7353 1432 0 80 0 5136 4071 - ? 00:00:00 httpd
S 48 8730 1432 0 80 0 5148 4074 - ? 00:00:00 httpd
@dynax60
dynax60 / gist:94618e3407a6f180baf8
Created October 30, 2014 06:15
What sender was for specified recipient? (need amavis)
# find . -name "mail.log*" -mtime -90 | xargs grep amavis | grep myaddr@mydomain.ru | perl -MData::Dumper -ne '/\[([^\]]+)\] \<([^\>]+)\>/; ++$a->{$2}->{$1}; }{ print Dumper($a)'
$VAR1 = {
'sock@test.domain.ru' => {
'192.168.116.2' => 27
},
'vcenter@domain.ru' => {
'192.168.130.110' => 11
},
'satisfactoryr@mail.ru' => {
'186.118.238.61' => 1
.ia-fixed-sidebar div.plugin_pagetree ul.plugin_pagetree_children_list>li>div.plugin_pagetree_childtoggle_container {
height: 20px; /*normally 30*/
}
.ia-fixed-sidebar .plugin_pagetree_children_span {
height: 10px; /*normally 20*/
line-height: 10px; /*normally 20*/
}
@dynax60
dynax60 / genpas.pl
Created June 18, 2010 09:43
Password generation tool
#!/usr/bin/perl
use common::sense;
use Text::Password::Pronounceable;
printf "%s\n", Text::Password::Pronounceable->generate(6,10);
@dynax60
dynax60 / gvrpad.c
Created June 18, 2010 12:14
gvrpad - GVRP Announcement Daemon. http://www.knossos.net.nz/gvrpad.html
--- gvrpad.c 2007-06-12 04:28:04.000000000 +0400
+++ gvrpad.c.orig 2010-06-21 12:21:54.000000000 +0400
@@ -417,6 +417,7 @@
int exclude = 0;
int interval = 0;
int leaveint = 0;
+ ether_addr addr;
FILE *f;
/*
@dynax60
dynax60 / MyMail.pm
Created June 23, 2010 11:06
Simple mail sender on perl :)
package MyMail;
use common::sense;
use MIME::Lite;
use MIME::Words qw(:all);
use Data::Dumper;
use Carp qw(croak);
sub _defaults {
@dynax60
dynax60 / guess.pl
Created July 7, 2010 06:05
Mikrotik and Nano stations detector
#!/usr/bin/perl
use Mojo::Client;
BEGIN {
my %nano;
my %mktk;
my %failed;
}
my $client = Mojo::Client->new;