`
文章列表

dnsmasq 安装

在192.168.0.133机器上操作 rpm -qa dnsmasq dnsmasq-2.45-1.1.el5_3 如果不存在 yum install dnsmasq 安装完成后 cp /etc/resolv.conf /etc/resolv.dnsmasq.conf vi /etc/dnsmasq.conf resolv-file=/etc/resolv.dnsmasq.conf vi /etc/dnsmasq.d/xxx.conf(名字随便取) address=/test.test.feng.com/192.168.0.133 ptr-record= ...
zabbix 23698 23693 0 Mar05 ? 00:03:48 /opt/App/zabbix/sbin/zabbix_agentd [root@DB01 ~]# [root@DB01 ~]# [root@DB01 ~]# cat /etc/init.d/dnsmasq #!/bin/sh # # Startup script for the DNS caching server # # chkconfig: - 49 50 # description: This script starts your DNS caching serve ...

Webbench 测试

Webbench最多可以模拟3万个并发连接去测试网站的负载能力 tar -zxvf webbench-1.5.tar.gz cd webbench-1.5 make 出现错误 ctags *.c /bin/sh: ctags: command not found make: [tags] Error 127 (ignored) yum install ctags mkdir -p /usr/local/man ←建立相应目录(否则导致无法正常安装) make install webbench -c 10 -t 60 http://172.1 ...

php nginx

    博客分类:
  • php
http://www.nginx.cn/231.html
今天写了个发邮件的脚本,名字叫email.py 运行的时候报 Traceback (most recent call last): File "<frozen importlib._bootstrap>", line 1521, in _find_and_load_unlocked AttributeError: 'module' object has no attribute '__path__' During handling of the above exception, another exception occurred: Tra ...

shell mysql

mysql -e 可以操作各种sql #!/bin/sh host="localhost" username="root" password="123456" port="3306" dbname="news" isql="select * from userinfo" mysql -h${host} -P${port} -u${username} -p${password} ${dbname} -e"${isql}"

oracle rac 原理

看附件
原来写过一篇,为了加深理解,再写一篇 session分为 session replication 策略是复制会话,即一个用户访问了一次就把session复制到所有的服务器或这一部分服务器。 这样的好处是如果正访问的服务器down了用户可以自动被转到别的服 ...

数组遍历

#!/bin/sh function check(){ var=(gcc gcc-c++ libxml2 libxml2-devel autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel) echo "array's length is ${#var[@]}" #${array[@]}==${var[*]} for name in ${var[*]} ...
StringBuffer sb=new StringBuffer(); Map<String,String> map=new HashMap<String,String>(); map.put("key1","1" ); map.put("key2","2" ); map.put("key3","3" ); map.put("key4","4" ); Set<Strin ...

ant例子

    博客分类:
  • ant
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- WARNING: Eclipse auto-generated file. Any modifications will be overwritten. To include a user specific buildfile here, simply create one in the same dire ...
在编译时会出现这样的错IndentationError:expected an indented block说明此处需要缩进, 你只要在出现错误的那一行,按空格或Tab(但不能混用)键缩进就行。 例如: if xxxxxx: (空格)xxxxx 或者 def xxxxxx: (空格)xxxxx 还有 for xxxxxx: (空格)xxxxx 一句话 有冒号的下一行往往要缩进,该缩进就缩进
while true do nginxpid=`ps -C nginx --no-header | wc -l` if [ $nginxpid -eq 0 ];then /usr/local/nginx/sbin/nginx sleep 5 nginxpid=`ps -C nginx --no-header | wc -l` if [ $nginxpid -eq 0 ];then /etc/init.d/keepalived stop fi fi sleep 5 done sleep时间可以重新设置,用nohup启动

mysql备份脚本

#!/bin/sh #PATH=/usr/local/sbin:/usr/bin:/bin # The Directory of Backup BACKDIR=/usr/mysql_backup # The Password of MySQL ROOTPASS=123456 # Remake the Directory of Backup rm -rf $BACKDIR mkdir -p $BACKDIR DBLIST=`ls -p /var/lib/mysql | grep / | tr -d /` for dbname in $DBLIST ...

逻辑判断

逻辑非 ! 条件表达式的相反 if [ ! 表达式 ] if [ ! -d $num ] 如果不存在目录$num 逻辑与 –a 条件表达式的并列 if [ 表达式1 –a 表达式2 ] 逻辑或 -o 条件表达式的或 if [ 表达式1 –o 表达式2 ]
Global site tag (gtag.js) - Google Analytics