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 | |
#usage in cron... /mysqlrouter_check cluster-hk2 mysqluser mysqlpass | |
match=$1 | |
mysqluser=$2 | |
mysqlpass=$3 | |
routerpid=$(/bin/pidof mysqlrouter) |
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/sh | |
######################################################## | |
# # | |
# www.361way.com # | |
# Useage: check_traffic -i Interface -w warn -c cirt # | |
# it's for pnp4nagios check the traffic # | |
# based on https://exchange.nagios.org/directory/Plugins/Network-Connections%2C-Stats-and-Bandwidth/check_traffic_pnp4naios/details | |
######################################################## | |
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 | |
# | |
#command[check_memory]=/usr/lib/nagios/plugins/check_memory -w 10 -c 5 | |
# | |
# | |
USAGE="`basename $0` [-w|--warning]<percent free> [-c|--critical]<percent free>" | |
THRESHOLD_USAGE="WARNING threshold must be greater than CRITICAL: `basename $0` $*" | |
calc=/tmp/memcalc | |
percent_free=/tmp/mempercent |
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/php | |
<?php | |
# tool to try and reduce the work required to add nagios plugins to servers, and their lxc client | |
# usage: log into server, and run | |
# curl http:///{the gist url}/nagios-add-stuff.php | sudo php | |
# functions | |
$GLOBALS['added_first_br'] = array(); // array of files that we have added the line break. |
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
deb http://deb.debian.org/debian bookworm main contrib | |
deb http://deb.debian.org/debian-security/ bookworm-security main contrib | |
deb http://deb.debian.org/debian bookworm-updates main contrib | |
deb http://mirrors.linode.com/debian bookworm main contrib | |
deb http://mirrors.linode.com/debian-security/ bookworm-security main contrib | |
deb http://mirrors.linode.com/debian bookworm-updates main contrib | |
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 | |
# find the last error - so it might change if we fix it... | |
# core:error - not php code related | |
# not found or unable to stat - are just hackers trying to break in.. can ignore | |
RES=$(/bin/grep PHP /var/log/apache2/error.log | /usr/bin/egrep -v 'PHP\s+[0-9]+' | /bin/grep -v 'PHP Stack' | grep -v 'Deadlock found when trying to get lock' | grep -v max_input_vars | /usr/bin/tail -1) | |
if [[ ( $RES == "" ) ]]; then | |
echo "OK" | |
else |
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
#tends to bork containers getty + just a mess | |
apt install -y sysvinit-core systemd-sysv- | |
#reboot | |
apt remove -y systemd | |
apt-mark hold systemd systemd-sysv | |
#nice cleanup | |
apt autoremove --purge |
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/sh | |
## you might want to add some user authentication here | |
# from - https://tech.labelleassiette.com/how-to-reduce-the-memory-usage-of-mysql-61ea7d1a9bd | |
# (credits to Eduardo Franceschi) | |
mysql -e "show variables; show status" | awk ' | |
{ | |
VAR[$1]=$2 | |
} | |
END { |
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 fixes booting with new kernels - breaking cgroups on lxc and /dev/net/tun not being available in containers | |
GRUB_CMDLINE_LINUX="console=ttyS0,19200n8 net.ifnames=0 systemd.unified_cgroup_hierarchy=false systemd.legacy_systemd_cgroup_controller=false cgroup_enable=memo | |
ry swapaccount=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
#try and get those sneaky slow brute force ssh attackers to slow down | |
[sshd] | |
enabled = true | |
port = 8022 | |
maxretry=3 | |
bantime = 24h | |
findtime = 1d |
OlderNewer