Snippets

# Linux : generate high cpu load

  dd if=/dev/urandom | bzip2 -9 >> /dev/null
watch the load value for 4min while running the dd command in background for 60s:

[root@quarz ~]# timeout 240s  perl -e 'while(1) {`uptime` =~ /average: ([\d.]+)/; printf("% 5s %s\n", $1, "#" x ($1 * 10)); sleep 10 }'
 0.00
 0.00
 0.15 #
 0.28 ##
 0.47 ####
 0.55 #####
 0.62 ######
 0.83 ########
 0.78 #######
 0.66 ######
 0.56 #####
 0.47 ####
 0.40 ####
 0.34 ###
 0.28 ##
 0.24 ##
 0.20 ##
 0.17 #
 0.14 #
 0.12 #
 0.10 #
 0.09
 0.07
 0.06
[root@quarz ~]#

# Networking : ping hosts in subnet

  for i in $( seq 1 254 ); do ping -c 1 172.16.1.$i | grep "bytes from" ; done
# Perl : list installed Perl modules
  perl -MCPAN -e 'print CPAN::Shell->r '
perl -MFile::Find=find -MFile::Spec::Functions -Tlw -e 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'
# Perl : Hello World!
  perl -e "print \"Hello World\!\n\";"  # Win32+Linux
  perl -e "print \"Hello World!\n\";"   # Win32
  perl -e 'print "Hello World!\n;"'     # Linux
# Perl : print O/S name
  perl -e "print $^O"
# Perl : print UNIX time
  perl -e 'print time();'
# Perl : print UTC time in standard format
  use POSIX;
  my $datetime = strftime( '%Y-%m-%dT%H:%M:%SZ', gmtime);  
  print $datetime."\n";
# Perl : generate big file
  perl -e "open(F, '>10MiB.txt'); print F '0' x (1024*1024*10);"
  perl -e "open(F, '>10MB.txt');  print F '0' x (1000*1000*10);"
# Perl : decode base64 encoded file
  perl -MMIME::Base64 -ne 'print decode_base64($_)' <file
# Perl : remove trailing CRLF by removing white spaces and the end of line
  line =~ s/\s+$//g;
# Perl : md5 of string
  perl -MDigest::MD5=md5_hex -e 'print md5_hex("0") . "\n";'

cfcd208495d565ef66e7dff9f98764da

# ESXI : list top 10 utilized volumes

[root@host-esxi:/vmfs/volumes]# df -k | grep VMFS | sort -nrk 5 | head -10 

ads

startpage ixquick

motd

todays motd is a quote from rfc865 qotd server djxmmx.net

“I Wish that we could do it again. Cuz you never took the time to know me, you never took the time to understand. Said you never took the time to know me, cuz loving you is all I ever had… Because of you now I'm just a lonely man…” - Akon (Never Took The Time)


monitoring graphs

traditional mrtg i/f stats graph

interface stats

read here how to create these graphs
cpu

cpu stats

httpd / apache2

apache 1min stats

bind rtt

bind rtt 1day stats


  © VONWANGELIN.com 2002-2017 · page creation 0.096s · running DokuWiki - It's better when it's simple ·