Daniel S. Sterling eqhmcow

View multi-routes.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
 
# This script lets you use multiple internet connections, both simultaneously and transparently,
# both from the router itself and via boxes behind the router through NAT. For this to actually
# work with NAT, you most definitely need to recompile your linux kernel with the "Routing and
# Netfilter" patches from http://www.ssi.bg/~ja/#routes . (Using the latest full patchset is fine.)
 
# See also http://lartc.org/howto/lartc.rpdb.multiple-links.html
 
# You will need to modify this script so it actually works in your environment. Specifically,
View reload_iptables.sh
1 2 3 4 5 6 7 8 9 10
IPTABLES=iptables
IPV=${IPTABLES%tables} # ip for ipv4 | ip6 for ipv6
PROC_IPTABLES_NAMES=/proc/net/${IPV}_tables_names
 
/sbin/modprobe --version 2>&1 | grep -q module-init-tools \
&& NEW_MODUTILS=1 \
|| NEW_MODUTILS=0
 
# Do not stop if iptables module is not loaded.
[ -e "$PROC_IPTABLES_NAMES" ] || exit 1
View unzip.pl
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/perl
# example perl code, this may not actually run without tweaking, especially on Windows
 
use strict;
use warnings;
 
=pod
 
IO::Uncompress::Unzip works great to process zip files; but, it doesn't include a routine to actually
extract an entire zip file.
View backup.sh
1 2 3 4 5 6 7 8 9
#!/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.
View apache-preconnect-workaround-README
1 2 3 4 5 6 7 8 9
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.
View kill_idle_cms_httpd.pl
1 2 3 4 5 6 7 8 9
#!/bin/env perl
 
# kill_idle_cms_httpd.pl - kill idle httpd connections
# $Id$
 
use strict;
use warnings;
 
use Time::HiRes 'time';
View irc-espeak-README
1 2 3 4 5 6 7 8 9 10
$ 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
View find_timeouts.sh
1
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
View parse_db.pl
1 2 3 4 5 6 7 8 9 10
use strict;
use warnings;
 
my @element;
my @element_ids;
my @element_index;
while (<>) {
if (m/INSERT INTO `element` /) {
parse_element($_);
next;
View iscsi-blockdev-uid.pl
1 2 3 4 5 6 7 8 9
#!/usr/bin/perl
use strict;
use warnings;
 
use Getopt::Long;
use Digest::SHA1 qw(sha1_base64);
 
my $hash;
GetOptions("hash" => \$hash);
Something went wrong with that request. Please try again.