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 | |
WRITER_VIP=192.168.56.83 | |
READER_VIP=192.168.56.84 | |
PXC_CHECK='/usr/bin/clustercheck clustercheck password 0' | |
SCRIPT=$1 | |
WEIGHT=101 | |
case $SCRIPT in | |
'bad_pxc') |
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 | |
dir=$1 | |
duration=$2 | |
outputdir="${dir}/second_samples_output_$(date +%Y-%m-%d_%H-%M-%S)" | |
min_free_bytes=1073741824 # 1GB | |
min_free_pct=10 # 10% | |
function usage { |
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
[root@acme ~]# netstat -plant | |
Active Internet connections (servers and established) | |
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name | |
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1270/sshd | |
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2043/master | |
tcp 0 0 192.254.64.50:50611 103.240.141.54:3505 ESTABLISHED 722/whoami | |
tcp 0 268 192.254.64.50:22 122.2.123.122:54675 ESTABLISHED 15580/sshd: revin [ | |
tcp6 0 0 :::22 :::* LISTEN 1270/sshd | |
tcp6 0 0 ::1:25 :::* LISTEN 2043/master | |
[root@acme ~]# w |
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 | |
dir=$1 | |
duration=$2 | |
if [ "$3" == "" ]; then | |
savedir=$(hostname) | |
else | |
savedir="$3" | |
fi |
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 stap | |
# | |
global latency, latency_histogram | |
probe begin { | |
printf("Begin.\n") | |
} | |
probe process("/usr/sbin/mysqld").function("*") { | |
latency[probefunc()] = gettimeofday_s() |
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
<?php | |
//mysql> insert into t (t) values (repeat('a',1048576)); | |
//Query OK, 1 row affected (0.14 sec) | |
//mysql> show create table t \G | |
//*************************** 1. row *************************** | |
// Table: t | |
//Create Table: CREATE TABLE `t` ( | |
// `t` longtext |
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
bytes_sent STAT_BYTES_SENT | |
bytes_received STAT_BYTES_RECEIVED | |
packets_sent STAT_PACKETS_SENT | |
packets_received STAT_PACKETS_RECEIVED | |
protocol_overhead_in STAT_PROTOCOL_OVERHEAD_IN | |
protocol_overhead_out STAT_PROTOCOL_OVERHEAD_OUT | |
bytes_received_ok_packet STAT_BYTES_RECEIVED_OK | |
bytes_received_eof_packet STAT_BYTES_RECEIVED_EOF | |
bytes_received_rset_header_packet STAT_BYTES_RECEIVED_RSET_HEADER | |
bytes_received_rset_field_meta_packet STAT_BYTES_RECEIVED_RSET_FIELD_META |
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/python | |
import os, time | |
from struct import unpack | |
from datetime import datetime | |
d = '/home/mysql/backup_data/backup_str/binlogs' | |
x = 180 | |
oldest = int(time.time())-(90*24*60*60) |
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 | |
MYCMD="mysql" | |
MAX_OLD=3 | |
MIN_NEW=3 | |
SCHEMA=sphinx | |
TABLE=search_query_log | |
LOGFILE=/tmp/search_query_log_partitions.log | |
DISKPATH=/sphinx/search_query_log_archive | |
ERRTO="[email protected]" |
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
<?php | |
$pareto_power = log(0.7) / log(1.0-0.7); | |
function sb_rand_pareto($a, $b) { | |
global $pareto_power; | |
return $a + ($b - $a + 1) * pow((double)(rand() % 4294967295) / 4294967295, $pareto_power); | |
} | |
for($i=0; $i<=1000; $i++) { |