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
import logging | |
from telegram_handler import TelegramError | |
CHATID = 1234567 | |
APITOKEN = "1111111:EPORIWOIRPWEIRERPIPOIWER" | |
TG_TIMEOUT = 10 | |
TAGLINE = "EG4 Monitor" | |
FORMAT = "%(asctime)s %(funcName)-12s %(levelname)-7s %(message)s" | |
logging.basicConfig(format=FORMAT, level="INFO") |
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 bash | |
# | |
# Reference: | |
# https://dev.mysql.com/blog-archive/binary-log-encryption-at-rest/ | |
# https://dev.mysql.com/blog-archive/how-to-manually-decrypt-an-encrypted-binary-log-file/ | |
# | |
set -e | |
set -o nounset |
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
import sys | |
import argparse | |
import mysql.connector | |
from queue import Queue | |
from concurrent.futures import ThreadPoolExecutor | |
def parseargs(): | |
parser = argparse.ArgumentParser(prog="mysql_queries_prod_consumer.py", add_help=False) |
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
import sys | |
import mysql.connector | |
from mysql.connector.errors import InterfaceError | |
from time import sleep | |
mydb = mysql.connector.connect(host="", user="", password="", database="mysql") | |
cursor = mydb.cursor(dictionary=True) | |
while True: |
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
/* | |
* 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 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
# -*- 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 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/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 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 | |
## | |
## 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 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
# | |
# pip3 install mysql-connector-python | |
""" | |
CREATE TABLE comments ( | |
id int unsigned primary key auto_increment, | |
user_id int unsigned not null, | |
comment varchar(200) not null, | |
type varchar(10) not null, | |
type_id int unsigned not null); |
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
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" } |
NewerOlder