Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ppabc committed Feb 16, 2017
1 parent eeef322 commit 166d6fb
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
2 changes: 2 additions & 0 deletions iptables/ipt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/sbin/iptables -A INPUT -s 192.168.1.112 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 443 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 80 -j ACCEPT
##允许ping规则
##/sbin/iptables -A INPUT -p icmp -j ACCEPT
/sbin/iptables -A INPUT -j REJECT
/sbin/iptables -A FORWARD -j REJECT

Expand Down
3 changes: 3 additions & 0 deletions nginx/cut_del_logs.sh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ mv ${LOGS_PATH}/aqzt.com.log ${LOGS_PATH}/aqzt.com_${YESTERDAY}.log

kill -USR1 `ps axu | grep "nginx: master process" | grep -v grep | awk '{print $2}'`

#或者调用nginx -s reopen用来打开日志文件,nginx会把新日志写入这个新的文件中


#删除7天前的日志

cd ${LOGS_PATH}
Expand Down
12 changes: 11 additions & 1 deletion shell/dd/dd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,17 @@ dd if=/dev/zero bs=8192 count=125000 of=/root/1Gb.file
2.4.2测试硬盘读写速度
dd if=/root/1Gb.file bs=64k | dd of=/dev/null
dd if=/dev/zero of=/root/1Gb.file bs=1024 count=1000000
通过上两个命令输出的执行时间,可以计算出测试硬盘的读/写速度
#通过上两个命令输出的执行时间,可以计算出测试硬盘的读/写速度
#数据传输时间 Ttransfer是指完成传输所请求的数据所需要的时间,它取决于数据传输率,其值等于数据大小除以数据传输率。目前IDE/ATA能达到133MB/s,SATA II可达到300MB/s的接口数据传输率,数据传输时间通常远小于前两部分消耗时间。简单计算时可忽略。
#测/data目录所在磁盘的纯写速度:
time dd if=/dev/zero of=/data/1Gb.file bs=8k count=1000000

#测/data目录所在磁盘的纯读速度:
time dd if=/data/1Gb.file of=/dev/null bs=8k count=1000000

#测读写速度:
time dd if=/data/1Gb.file of=/tmp/test bs=8k count=1000000


2.4.3.修复硬盘
dd if=/dev/sda of=/dev/sda
Expand Down
13 changes: 13 additions & 0 deletions shell/rpm/rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
##robert yu
##centos 6和centos 7

##查询一个包是否被安装
##rpm -q < rpm package name>
rpm -q wget
##列出所有被安装的rpm package
rpm -qa
rpm -qa |grep nginx

##删除特定rpm包
##rpm -e <包的名字>
rpm -e wget
rpm -e wget-1.12-8.el6.x86_64

## 删除原有软件包
rpm -qa | grep mysql | xargs sudo rpm -e --nodeps

Expand All @@ -14,3 +26,4 @@ rpm -ivh Percona-XtraDB-Cluster*.rpm
## 升级安装
rpm -Uvh *.rpm
rpm -Uvh --force --nodeps *.rpm

3 changes: 3 additions & 0 deletions shell/shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
## robert yu
## centos 6和centos 7

##内存强制释放命令,最好不要在生产环境使用,生产环境需先下线服务,再使用
echo 3 > /proc/sys/vm/drop_caches

##Mutt 发送测试邮件
echo "邮件内容123456" | mutt -s “邮件标题测试邮件” -a /home/test.txt [email protected]
echo "mail test 123" | mail -s "mail_test" [email protected]
Expand Down

0 comments on commit 166d6fb

Please sign in to comment.