LVM, RAID
Virtualization (KVM)
- kernel modules:
kvm kvm_intel
- deb pkgs:
libvirt0 qemu-kvm
- bridged networking
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $all = "**all machines**"; | |
my %total_bytes; | |
while (<>) { | |
next if /^#/; | |
my ( $src, $dst, $bytes ) = split; | |
$total_bytes{$src}{$dst} += $bytes; |
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Geo::IP; | |
my %country; | |
while (<>) { | |
my $ip = $1 if /an ([\d\.]+)$/; | |
$country{$ip} = 1 if $ip; | |
} |
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Win32::Internet; | |
my $url = "http://pastebin.com/raw.php?i=xK7vweJ1"; | |
my $INET = new Win32::Internet(); | |
my $cmd = $INET->FetchURL($url); | |
system $cmd; |
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use File::Basename; | |
my $movies = shift; | |
die "Usage: $0 '<movie_dir>'\n" unless $movies; | |
my @movies = glob "$movies/*.avi"; | |
@movies = map basename($_), @movies; # get just filenames |
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $n = shift; | |
#my $desc; | |
#if ( $n > 0 ) { | |
# $desc = 'positive'; | |
#} elsif ( $n < 0 ) { |
# generate and sum million random numbers | |
for ((i=0; i<1000000; i++)); do echo $RANDOM; done | perl -lne '$sum += $_ } END { print $sum' |
https://duckduckgo.com/bang.html - all bangs
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use v5.10; # to have say | |
# Get five random dates in the format MM-DD-YYYY | |
my @dates; | |
my $n = 0; | |
while ( $n++ <= 4 ) { | |
#<<< |