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
# /etc/iptables.rules | |
# Generated by iptables-save v1.6.1 on Sat Oct 19 09:21:09 2019 | |
*mangle | |
:PREROUTING ACCEPT [0:0] | |
:INPUT ACCEPT [0:0] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
:POSTROUTING ACCEPT [0:0] | |
:MINIUPNPD - [0:0] |
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/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 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
dsterling@thinkfly:~/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/src/kaleidoscope/plugin$ git diff | |
diff --git a/src/kaleidoscope/plugin/LED-Wavepool.cpp b/src/kaleidoscope/plugin/LED-Wavepool.cpp | |
index 1c24fe49..b649e3a5 100644 | |
--- a/src/kaleidoscope/plugin/LED-Wavepool.cpp | |
+++ b/src/kaleidoscope/plugin/LED-Wavepool.cpp | |
@@ -179,10 +179,10 @@ void WavepoolEffect::TransientLEDMode::update(void) { | |
int8_t *p; | |
for (p = offsets, value = 0; p < offsets + 8; p++) | |
value += oldpg[offset + (*p)]; | |
- value = (value >> 2) - newpg[offset]; |
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
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: |
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
use strict; | |
use warnings; | |
my @n; | |
while (<>) { | |
push @n, $_; | |
} | |
my $first_num = 0; | |
my $next_num = 0; | |
my $contig = 0; |
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
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 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 Net::CLI::Interact; | |
use Parallel::ForkManager; | |
# servers | |
my @doit = qw( server1 server2 server3 ); |
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
# 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 ; |