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 | |
if [ $# -lt 2 ]; then | |
echo "usage:$0 dev output_dir [iodepth]" | |
echo "example 1: Testing the whole block device. Attention: That will destory the filesystem on the target block device" | |
echo "./run_fio.sh /dev/sdb fio_test" | |
echo "" | |
echo "example 2: Testing a file, but not destory filesystem. Suppose the target device mount on /data" | |
echo "fallocate -l 1G /data/test.dat" | |
echo "./run_fio.sh /data/test.dat fio_test" |
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 | |
log="./zookeeper.out" | |
if [ -f "$log" ]; then | |
# unit(MB) | |
size=`du -sm "$log" | grep "$log" | awk '{print $1}'` | |
limit=300 | |
# split log | |
if [ $size -gt $limit ]; then | |
newlog="zookeeper-`date +%Y%m%d%H%M%S`.log" |
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 | |
if [ $# -lt 2 ]; then | |
echo "usage:$0 dev prefix" | |
exit 1 | |
fi | |
dev="$1" | |
if [ "$dev" = "" ];then |
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 | |
if [ $# -lt 1 ]; then | |
echo "usage:$0 dev" | |
exit | |
fi | |
dev="$1" | |
echo "it will rw the dev:$dev, are you sure?[Y/n]" | |
read cmd |
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 | |
if [ $# -lt 2 ]; then | |
echo "usage:$0 test_name {prepare|run|cleanup|gen}" | |
exit 1 | |
fi | |
test_name="$1" | |
cmd="$2" |
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/env python2 | |
import sys, os | |
import random | |
import time | |
import MySQLdb | |
if __name__ == "__main__": |
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/env python | |
import sys, os | |
import string | |
import random | |
def id_generator(size=6, chars=string.ascii_uppercase): | |
return ''.join(random.choice(chars) for x in range(size)) | |
if __name__ == "__main__": |
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 | |
# sector_list sample as below: | |
# 0 | |
# 512 | |
# 4087578 | |
# 4087579 | |
# 6324224 | |
# | |
# You should build a sector_list firstly, and then execute this script to catch the files |
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 | |
if [ $# -lt 1 ];then | |
echo "usage:$0 pid [nproc=1024000]" | |
exit 1 | |
fi | |
pid=$1 | |
if [ $# -ge 2 ];then | |
nproc="$2ll" |
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 | |
if [ $# -lt 2 ];then | |
echo "usage:$0 deleted_list existed_list" | |
exit 1 | |
fi | |
deleted_list=$1 | |
existed_list=$2 |
OlderNewer