parse @message /Query_time: (?<queryTime>.*?) Lock_time: (<?lockTime>.*?) Rows_sent: (?<rowsSent>.*?) Rows_examined: (?<rowsExamined>.*?)\s(?<query>.*?)$/
| filter @message like /(?i)insert/
| sort queryTime desc
| limit 10
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
SET @tables = NULL; | |
SET GROUP_CONCAT_MAX_LEN=1048576; | |
SELECT GROUP_CONCAT('`', table_schema, '`.`', table_name, '`' SEPARATOR ',') INTO @tables | |
FROM information_schema.tables | |
WHERE table_schema = (SELECT DATABASE()); | |
SELECT IF(@tables IS NULL, | |
'SELECT NULL FROM (SELECT NULL) AS `empty` WHERE 0=1', | |
CONCAT('DROP TABLE IF EXISTS ', @tables)) INTO @tables; |
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
entryPoints: | |
web: | |
address: ":80" | |
websecure: | |
address: ":443" | |
http: | |
routers: | |
myrouter: | |
rule: "Host(`bchain.example.in`)" |
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
# https://github.com/dannysteenman/aws-toolbox | |
# | |
# License: MIT | |
# | |
# This script deletes all inactive task definitions in the ECS service in all AWS Regions. | |
import boto3 | |
def get_inactive_task_definition_arns(region): |
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
version: '3' | |
services: | |
spark-master: | |
image: bde2020/spark-master:3.3.0-hadoop3.3 | |
container_name: spark-master | |
ports: | |
- "8080:8080" | |
- "7077:7077" | |
environment: | |
- INIT_DAEMON_STEP=setup_spark |
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
""" | |
Queries the slowlog database table maintained by Amazon RDS and outputs it in | |
the normal MySQL slow log text format. Modified version of the script by | |
memonic (Thanks!) at https://gist.github.com/1481025 | |
Things to change in this script for your own setup: | |
<root_user> to your mysql root user (e.g. "root") | |
<root_pass> to your mysql root password (e.g. "hunter2") | |
<host_domain> to your mysql root password (e.g. "prod-01.w3rfs2.us-east-1.rds.amazonaws.com") |
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
MY_DOMAIN1=<domain for Traefik1's dashboard> | |
TRAEFIK1_NET=traefik1_net | |
CF_API_EMAIL=<your CF API email> | |
CF_ZONE_API_TOKEN=<your Zone API Token> | |
CF_DNS_API_TOKEN=-<your DNS token> | |
TRAEFIK2_DNS_MAPPER=traefik2:<static ip of traefik2 in NET1> | |
TAEAFIK2_HOST_SNI=`traefik.<Traefik2's dashboard domain>` | |
TRAEFIK2_NET1_ADDRESS=traefik2:443 |
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
ufw allow from 192.168.3.0/24 proto tcp to any port 2376 | |
ufw allow from 192.168.3.0/24 proto tcp to any port 2377 | |
ufw allow from 192.168.3.0/24 proto tcp to any port 7946 | |
ufw allow from 192.168.3.0/24 proto udp to any port 7946 | |
ufw allow from 192.168.3.0/24 proto udp to any port 4789 |
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 | |
curl -O https://bootstrap.pypa.io/get-pip.py | |
python3 get-pip.py --user | |
echo "export PATH=~/.local/bin:$PATH" > ~/.bash_profile | |
source ~/.bash_profile | |
pip3 install awscli --upgrade --user |
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 | |
for user in $(aws iam list-users --query 'Users[*].UserName' --output text); do | |
echo $user; | |
echo "======================"; | |
aws iam list-access-keys --user $user --query "AccessKeyMetadata[].AccessKeyId" --output text | |
done |
NewerOlder