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
/* | |
* To compile and install, execute the following commands. This will create a | |
* build location for MySQL and this plugin. | |
* | |
** Get Percona MySQL source code: | |
* cd ~ | |
* wget https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-8.0.32-24/source/tarball/percona-server-8.0.32-24.tar.gz | |
* tar -xvzf percona-server-8.0.32-24.tar.gz | |
* | |
** Create plugin dir, clone C++ ULID library |
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/sh | |
## | |
## For EdgeRouter Lite | |
## chmod 755 /etc/cron.weekly/dns-blacklist | |
## | |
BLACKLIST_URL=https://raw.githubusercontent.com/oznu/dns-zone-blacklist/master/dnsmasq/dnsmasq-server.blacklist | |
BLACKLIST_PATH=/etc/dnsmasq.d/blacklist.conf | |
WHITELIST_PATH=/config/dnsmasq-server.whitelist |
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
if sysbench.cmdline.command == nil then | |
error("Command is required. Supported commands: run") | |
end | |
sysbench.cmdline.options = { | |
point_selects = {"Number of point SELECT queries to run", 5}, | |
skip_trx = {"Do not use BEGIN/COMMIT; Use global auto_commit value", false} | |
} | |
local page_types = { "actor", "character", "movie" } |
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
# -*- coding: utf-8 -*- | |
# Description: speedtest netdata python.d module | |
# Author: utdrmac | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
# Runs a network speed test using speedtest.net every hour (by default) | |
# Requires: speedtest-cli | |
# apk add speedtest-cli | |
from bases.FrameworkServices.ExecutableService import ExecutableService |
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/python | |
import time | |
import signal, sys, os, re | |
import rrdtool | |
import requests | |
# | |
# Add data points every second (step) | |
# Keep: |
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
currentSize=`mysql $DSN -BNe "SELECT ROUND(@@innodb_log_file_size/1024/1024, 0)"` \ | |
currentNum=`mysql $DSN -BNe "SELECT @@innodb_log_files_in_group"` \ | |
totalCurSize=`mysql $DSN -BNe "SELECT ROUND((@@innodb_log_file_size * @@innodb_log_files_in_group)/1024/1024, 2)"` \ | |
startSeq=`mysql $DSN -BNe "SHOW ENGINE InnoDB STATUS\G" | grep sequence | grep -o "[0-9]\+$"`; sleep 60; \ | |
endSeq=`mysql $DSN -BNe "SHOW ENGINE InnoDB STATUS\G" | grep sequence | grep -o "[0-9]\+$"`; \ | |
logSizeReq=`echo "scale=2; ((($endSeq-$startSeq)/1024/1024)*60)/$currentNum" | bc`; \ | |
echo; echo "innodb_log_file_size is ${currentSize}MB * ${currentNum} log files = ${totalCurSize}MB"; \ | |
echo "innodb_log_file_size setting should be at least ${logSizeReq}MB for ${currentNum} log files."; echo; |
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/env python36 | |
import requests | |
import json | |
from time import sleep | |
from datetime import timedelta, datetime as dt | |
from requests.exceptions import Timeout, HTTPError, ConnectionError | |
from concurrent.futures import TimeoutError, ThreadPoolExecutor | |
nodes = [ |
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
# Encrypt initially using | |
# openssl rand -base64 32 >/etc/ssl/private/mykey.bin && chmod 600 /etc/ssl/private/mykey.bin | |
# openssl aes-256-cbc -a -salt -in /usr/local/mysql/keyring -out /usr/local/mysql/keyring.asc -pass file:/etc/ssl/private/mykey.bin | |
echo $echo_n "Decrypting Keyring..." | |
rm -f /usr/local/mysql/keyring | |
if [ ! -e /usr/local/mysql/keyring.asc -o ! -e /etc/ssl/private/mykey.bin ] | |
then | |
echo "Encrypted keyring and/or keyfile not found. Aborting MySQL startup." | |
exit 1; | |
fi |
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/python | |
import random | |
import time | |
import string | |
from threading import Thread | |
from mysql.utilities.common import (database, options, server, table) |
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 | |
# Redirect STDOUT/STDERR to journalctl | |
# journalctl -f SYSLOG_IDENTIFIER=pushBulletSSH | |
exec > >(logger -t pushBulletSSH) 2> >(logger -t pushBulletSSH -p user.warn) | |
# Config | |
GASGIANT_ID="XXXXXX" | |
PORTFILE=/tmp/.sshport |