本人博客迁移到http://www.itmin.cn,希望大家稳步过去交流
if ($request_uri ~* "^/loupan/pho\.php\?houseid=52&type=huxing$") { rewrite .* http://house.xxx.com/hengjidongshang/? permanent;}这样的话就是从http://house1.xxxx.com/loupan/pho\.php\?houseid=52&
首先,在这里我写的脚本的功能没有一一写出来,有兴趣的朋友可以自已完成,好久没有写shell脚本了,今天写这个就当是复习下,最近一直使用python,不过对比之下,本人不才,总结以下: 1 shell只能对系统层面使用,而ptyhon任何情况下都可以使用 2 &nb
apache根据日志时间段统计语句1 使用sed统计出 12点到2点的日志sed -n '/12\/Apr\/2013:12:00:00/,/12\/Apr\/2013:14:30:00/p' access_log >1.txt2 使用awk统计下访问cat 1.txt|awk '{print $11}'|sort|uniq -c|sort -nr|head
由于最近为了上线的项目做好安全,害怕被对手有心搞,有必要简单防下DDOS和CC,公司资金的问题,现在由运维写个脚本来顶着用,只能简单防 一、查看IP连接数 [root@localhost shell]# cat iptables-cc-ip #!/bin/bash num=100&nbs
前阵子去面试,最后一道简单的shell脚本,shell监控磁盘超过80%的打印并显示出磁盘名字,我当时写的脚本如下: #!/bin/bash array=(`df |sed 1d | awk '{print $1,$5}'|tr -d % `) len=${#array[@]} for((i=1;i<=$len;i=i+2));do  
&n
一、首先将apache日志按天切割 vi /etc/httpd/conf/httpd.conf ErrorLog "|rotatelogs /var/log/httpd/%Y%m%derror
########本脚本应用在生产环境中,是运用mysql主从的基础上######## vi mysqlm-s.sh #!/bin/bash ip=`ifconfig eth0|sed -n 2p|awk '{ print $2 }'|awk -F : '{ print $2 }'` port=`netstat -anl|grep 3306 |sed -n '1p'
1 安装sendEmail tar xvf sendEmail-v1.56.tar.gz mv sendEmail-v1.56 sendEmail 2 添加apache虚拟主机shell脚本: vi addVirtual.sh #!/bin/bash cat <<EOF>> /etc/httpd/conf/httpd.conf <
wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz tar xvf sendEmail-v1.56.tar.gz mv sendEmail-v1.56 sendEmail vi /etc/ssh/sshrc #!/b
wget http://cloud.github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz wget http://inotify.aiken.cz/d
cat disk.sh #!/bin/bash for i in `df |sed 1d | awk '{print $5}' | sed 's/%//g'` ####获取后循环比较大小#### do if [ $i -gt 10 ] ###这里阀值设置为10,为了方便测试效果### then df -lh
vi ip.sh #!/bin/bash ifconfig $1|sed -n 2p|awk '{ print $2 }'|awk -F : '{ print $2 }' ##ifconfig $1|sed -n 2p|awk '{ print $2 }'|tr -d 'addr:'#这个也可以实现#### 执行: ./ip.sh eth0 192.168.2.
vi useradd.sh #!/bin/bash i=1 while [ $i -le 5 ] do useradd red$i a=`sh ./passwd.sh` echo " red$i:$a " >> u
vi /home/shell/useradd.sh #!/bin/bash i=1 while [ $i -le 5 ] do useradd test$i let i++ done 执行:sh useradd.sh cat /etc/passwd|grep test test1:x:502:502::
vi /home/shell/passwd.sh #!/bin/bash a=(a b c d e A B C D E F @ $ % ^ 0 1 2 3 4 5 6 7 8 9) for ((i=0;i<10;i++));do echo -n ${a[$RANDOM % ${#a[@]
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号