use strict;
use warnings;
my @n;
while (<>) {
push @n, $_;
my $first_num = 0;
my $next_num = 0;
my $contig = 0;
View gist:886717fc3b584118c954e9be5544dc28
# remove IP / set IP to one that won't be used for other systems
# clear ssh host key
rm -rf /etc/ssh/ssh_host_*
# remove /etc/hosts entries as applicable
# remove utmp data - wtmp and btmp and lastlog
rm /var/log/{w,b}tmp /var/log/lastlog ;
touch /var/log/{w,b}tmp /var/log/lastlog ;
perl -pe '$_=(scalar localtime) . " $_"'
use strict;
use warnings;
use Net::CLI::Interact;
use Parallel::ForkManager;
# servers
my @doit = qw( server1 server2 server3 );
View multi shape
# 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.
IPV=${IPTABLES%tables} # ip for ipv4 | ip6 for ipv6
/sbin/modprobe --version 2>&1 | grep -q module-init-tools \
# Do not stop if iptables module is not loaded.
[ -e "$PROC_IPTABLES_NAMES" ] || exit 1
# example perl code, this may not actually run without tweaking, especially on Windows
use strict;
use warnings;
IO::Uncompress::Unzip works great to process zip files; but, it doesn't include a routine to actually
extract an entire zip file.
# 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
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
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.