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
ls /usr/local/arcos/logs/proxy_access_log.* -t1 | head -1 | (read i; cat $i | egrep '" 40[08] ') | grep -v ' 10\.0\.30\.2 ' | perl -p -e '($vhost, $ip, $date, $method, $url, $protocol, $alt_url, $code, $bytes, $referrer, $ua) = (m/^(\S+)\s(\S+)\s\S+\s+(?:\S+\s+)+\[([^]]+)\]\s"(\S*)\s?(?:((?:[^"]*(?:\\")?)*)\s([^"]*)"\s|((?:[^"]*(?:\\")?)*)"\s)(\S+)\s(\S+)\s"((?:[^"]*(?:\\")?)*)"\s"(.*)"$/x); die "Could not match $_" unless $ip; $alt_url ||= ""; $url ||= $alt_url; $_="$ip $vhost\n"' | sort | uniq -c | sort -n |
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
use strict; | |
use warnings; | |
my @element; | |
my @element_ids; | |
my @element_index; | |
while (<>) { | |
if (m/INSERT INTO `element` /) { | |
parse_element($_); | |
next; |
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 Getopt::Long; | |
use Digest::SHA1 qw(sha1_base64); | |
my $hash; | |
GetOptions("hash" => \$hash); |
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
# This file describes the network interfaces available on your system | |
# and how to activate them. For more information, see interfaces(5). | |
# The loopback network interface | |
auto lo | |
iface lo inet loopback | |
auto bond0 | |
iface bond0 inet manual | |
# bizarre, but this works... |
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 | |
sub divide { | |
($a, $b) = @_; | |
$c = eval { $a / $b }; | |
$@ =~ m/Illegal division by zero/ && rand() > .5 ? ($b = 1) : ($b = -1); | |
$@ && ($c = $a / $b); | |
return $c; | |
} |
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
cp /bin/bash ./bash.caps; echo "this will take a while, be patient..."; strings -n 10 bash.caps | egrep -e '^.* .* .* .*$' | grep -Pv '^(_|\s)|\$|\[|;|@|\s\s' | while read i; do perl -pi -e "$/=\"\\0\";next if/ function\S|binding|^(case|select|for|trap|builtin)|_.*_/;next unless m@\\Q$i\\E@;sub b{return\$_ if/%/;uc}\$_=join' ',map{b()}split/ /" bash.caps; done; chmod a+x bash.caps; ./bash.caps |
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
DESCRIPTION | |
logstat.pl and logtop.pl | |
These scripts show current and average request-per-second counts based on | |
apache access logs in real-time. | |
You can see the total requests-per-second as well as a breakdown by: | |
* vhost | |
* URL |
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 | |
# As the "bufferbloat" folks have recently re-discovered and/or more widely | |
# publicized, congestion avoidance algorithms (such as those found in TCP) do | |
# a great job of allowing network endpoints to negotiate transfer rates that | |
# maximize a link's bandwidth usage without unduly penalizing any particular | |
# stream. This allows bulk transfer streams to use the maximum available | |
# bandwidth without affecting the latency of non-bulk (e.g. interactive) | |
# streams. |
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; | |
=pod | |
=head1 NAME | |
B<logger.pl> - a shell command interface to the syslog(3) system log module |
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
# modules/nfs/manifests/init.pp | |
class nfs_server { | |
file { "destroy_exports": | |
path => "/etc/exports.puppet", | |
ensure => present, | |
source => "puppet://$servername/modules/nfs/empty", | |
} | |
package { "portmap": |