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 | |
# example perl code, but this should now actually work properly, even on | |
# Windows | |
# thanks to everyone who tested this, reported bugs and suggested or | |
# implemented fixes! | |
# this code is licensed under GPL 2 and/or Artistic license; | |
# aka free perl software |
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
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 |
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 | |
# 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 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
Big Data on Little Linux |
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 IPC::Run qw/start pump finish timeout/; | |
use Parallel::ForkManager; | |
use Getopt::Long; |
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/env perl | |
use strict; | |
use warnings; | |
# apt-get install apache2-utils libyaml-syck-perl libtimedate-perl | |
use YAML::Syck; | |
use IO::File; | |
use Date::Parse; | |
use Time::Piece; |
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
# 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 ; |
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 @n; | |
while (<>) { | |
push @n, $_; | |
} | |
my $first_num = 0; | |
my $next_num = 0; | |
my $contig = 0; |
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
slightly-less-insecure-docker | |
wrapper around docker that perhaps makes it slightly less insecure | |
example usage: | |
DOCKER=/path/to/docker-wrapper | |
sudo $DOCKER run -it -v /etc/passwd:/etc/passwd -v /tmp:/tmp ubuntu | |
NOTE: |
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
How to run "ls" in docker | |
--- | |
Run "ls" in docker, handling various possible environmental issues that the shell normally directly handles. | |
That is, the below docker command is similar to simply issuing "ls" at a shell prompt, or adding an "ls" command to a shell script. | |
Without docker: |