1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76



kill -9 `ps -ef | grep gzip | awk '{print$2}'`

echo "use jfpt_qd ; source sql ;"| mysql -uroot -pqaz000123 -h192.168.68.23 > 123

tar解压解包指定文件到指定目录:tar -zxvf test.tar.gz -C /root test/f1.txt

netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' #查看tcp状态

find /etc/ -name "*" | xargs du -h

sed -ri "/\<$svnname\>/d" /data/svn/conf/authz.conf

rm -fr /tmp/crontablist_20180510 ;cat /etc/passwd | awk -F ':' '{print $1}' | while read USER; do echo "***" >> /tmp/crontablist_20180510 ;echo ${USER} >> /tmp/crontablist_20180510; crontab -l -u ${USER} >> /tmp/crontablist_20180510; done ; sz /tmp/crontablist_20180510

rm -fr /tmp/crontablist && IP=`cat /etc/sysconfig/network-scripts/ifcfg-eth0 |grep IP |awk -F '.' '{print $NF}'` && cat /etc/passwd | awk -F ':' '{print $1}' | while read USER; do crontab -l -u $USER |sed "s/^/$IP $USER &/g">> /tmp/crontablist ; done && sz /tmp/crontablist

#centos 6
yum groupinstall "Development Tools" -y

#centos7
yum clean all
yum -y groupinstall Development tools

yum install gcc c++ zip unzip man vim bind-utils telnet wget nethogs htop glances dstat traceroute lrzsz goaccess ntpdate dos2unix openssl-devel xinetd lvm2 lftp nfs-utils net-tools

/usr/sbin/ntpdate ntp1.aliyun.com

egrep "as|x" test

rsync --bwlimit=200 -a /home/www/applelog/136/fidp_chn/debug/2017 /mnt/log/136_old_2017/fidp_chn/debug &

curl members.3322.org/dyndns/getip #获取公网ip

rsync -av /home/xbjc/xbjc-settle/logs/ rsync@192.168.1.171::xbjc-settle --password-file=/etc/rsyncd.secret

RSYNC () { rsync -av $1 rsync@192.168.1.171::$2; } ; RSYNC jfpt_jjcz.log.2018-05-28.gz 80-jfpt_jjcz

mount -o codepage=utf8,username=dbbackup,password=RongLian_200,-l //192.168.3.138/dbbackup /tmp/jfpt_qd/

rename table monitor_info to monitor_info_20180611;
create table monitor_info like monitor_info_20180611;

/usr/local/bin/memcached -d -m 2048 -u root -l 192.168.2.4 -p 12111 -c 1024 -P /tmp/memcached.pid

/usr/local/zabbix/bin/zabbix_get -s192.168.1.162 -p10050 -k"3506_status"

ps -p 22638 -o lstart

sed -i "s/#PermitRootLogin yes/PermitRootLogin no/g" /etc/ssh/sshd_config && service sshd restart

sed -i ':a;N;$!ba;s/\n/ /g' testfile.csv

mysql -P3307 -S /tmp/mysql_3307.sock #mysql 非3306端口连接

iptables -I INPUT -s 118.109.231.217 -j DROP

sysbench oltp_read_write.lua --time=60 --mysql-host=192.168.122.141 --mysql-port=3306 --mysql-user=root --mysql-password=qaz000123 --mysql-db=test_ha --table-size=10000 --tables=2 --threads=2 prepare


sysbench oltp_read_write.lua --time=60 --mysql-host=192.168.122.141 --mysql-port=3306 --mysql-user=root --mysql-password=qaz000123 --mysql-db=test_ha --table-size=10000 --tables=2 --threads=2 run

#binlog查看
mysqlbinlog -v --base64-output=decode-rows --start-datetime='2019-03-27 17:30:00' --stop-datetime='2019-03-27 17:40:00' mysql-bin.000089 > /tmp/DB111.sql

ssh-copy-id '-p PORT www@IP'

figlet 字符画生成

# 解压,到当前目录
jar -xvf source.jar

# 打包,不进行压缩
jar -cvfM0 source.jar ./
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

delete from table_name;
alter table table_name auto_increment= 1; #重置自增ID

select
partition_name part,
partition_expression expr,
partition_description descr,
table_rows
from information_schema.partitions where
table_schema = schema()
and table_name='ccbpaybill';

SELECT
partition_name part
FROM
information_schema. PARTITIONS
WHERE
table_schema = SCHEMA ()
AND partition_name < 'p20180801'
AND partition_name > 'p20180401'
AND table_name = 'alipaybill';

alter table trends add partition (PARTITION p20190115 VALUES LESS THAN (1547481600) ENGINE = InnoDB);

ALTER TABLE alipaybill DROP PARTITION
p20180411,
p20180421,
p20180501,
p20180511,
p20180521,
p20180601,
p20180611,
p20180621,
p20180701,
P20180711,
P20180721

alter table bill2019 auto_increment=0 --自增ID重新计算