This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
$ cat test.txt | |
18:36 <@Dop> also fox_1: the scottish accent isn't too bad but you need to slow it down quite a bit to get the full effect | |
18:37 <@fox_1> still need to tweak a little | |
18:37 <@fox_1> right now you're a female scot for example I think | |
18:37 <@Dop> och aye? rofl | |
18:38 <@fox_1> ;) | |
18:55 <@ytz> lol | |
18:56 <@fox_1> that was the facebook fight | |
18:56 <@ytz> time to assemble coffee before the main card | |
18:56 <@fox_1> yeah I got rockstar |
This file contains hidden or 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/env perl | |
# kill_idle_cms_httpd.pl - kill idle httpd connections | |
# $Id$ | |
use strict; | |
use warnings; | |
use Time::HiRes 'time'; |
This file contains hidden or 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
script to kill apache 1.3 / 2.x prefork httpd processes serving preconnect connections, in an attempt to prevent chrome from causing a DoS against the httpd | |
This is version 2 of https://gist.github.com/eqhmcow/4774549 | |
The major change is the use of two processes instead of one: | |
One process makes server-status requests, the other kills idle prefork processes. | |
This allows the kill script to continue killing idle processes even when Chrome has effectively DoS'd the apache server. When this happens, the check script can't get an updated status response back immediately, but the kill script can hopefully free up a slot by killing some processes. Having an uninterrupted request in the socket queue allows us to get an updated response after killing the Chrome preconnections are killed. |
This file contains hidden or 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 | |
# backup mysql tables - does an initial dump and then backs up to final | |
# location using rdiff-backup | |
# NOTE: do NOT manually edit or update the rdiff-backup managed final backup | |
# location. ONLY use rdiff-backup to update files in that backup directory. if | |
# the files are changed directly, the historical backups that rdiff-backup | |
# maintains will be corrupted. |