linux 下postfix安装
wget http://ftp.unicamp.br/pub/postfix/official/postfix-2.6.3.tar.gztar zxvf postfix-2.6.3.tar.gzcd postfix-2.6.3/make useradd -s /sbin/nologin -d /dev/null postfixgroupadd postdropmake install最后一步选择postdrop =================vi /etc/postfix/main.cfqueue_directory = /var/spool/postfixcommand_directory = /usr/sbindaemon_directory = /usr/libexec/postfixdata_directory = /var/lib/postfixmail_owner = postfixmydomain = domain.commyhostname = mail.$mydomainmyorigin = $mydomainrelay_domains = $mydo
rsync配置认证方式
rsync配置认证方式/etc/rsyncd.conf uid = wst40gid = wst40max connections = 50pid file = /var/run/rsyncd.pidlock file = /var/run/rsyncd.locklog file = /var/log/rsyncd.loghosts allow = xxx.xxx.xxx.0/24ignore errors = yesauth users = wst40secrets file = /etc/rsyncd.secretsread only = no[htdocs]path = /usr/local/apache2/htdocscomment = cms3 - gxydread only = no=====================服务器端/etc/rsyncd.secrets 格式username:password username可以不是操作系统名称password不是操作系统用户名chmod 600 /etc
linux_扫描应用程序端口,发现不能wget页面,就发送邮件通知
#!/bin/shhosts="10.46.64.49 10.46.64.50"ports="6001 6003 6005 6007"#apps="/ /fmccehalladmin/ /fjheart/ /mzonehr/ /pay/ /service/ /fjzp/ /sitestat2/"apps="/ /fjheart/ /mzonehr/ /pay/ /service/ /fjzp/ /sitestat2/"status="status.jsp"send_mail(){mess="$1"cat /app/apache/bin/mail_list |grep -v '^#'|while read emaildomail -s "fj mobile weblogic alert !!! $(date +%Y年%m月%d日 %H时%M分%S秒)"<$mess $email -- -f master@fj.chinamobile
oracle_sql_取当前时间18到7天前的18点之间的数据
select user_mobile, count(*) from t_query_log where application ='wap' andquery_time >= to_date(to_char(trunc(sysdate-7),'yyyy-mm-dd')||' 18:00:00','yyyy-mm-dd hh24:mi:ss') and query_time <= to_date(to_char(trunc(sysdate),'yyyy-mm-dd')||' 18:00:00','yyyy-mm-dd hh24:mi:ss')[@more@]
linux 下的 tcpdump 抓包命令
tcpdump -ni eth0 -s0 -tttt -vvvv host (xxx.xxx.xxx.xxx or yyy.yyy.yyy) and dst port 80[@more@]
Oracle 9i 打开autotrace on 查看执行计划
reference:http://blog.chinaunix.net/u/11765/showart_471903.html===================1.创建表,通过utlxplan脚本 SQL> @?/rdbms/admin/utlxplanTable created. 2. 创建同义词为了多个用户可以共享一个plan_table 并授权给public SQL> create public synonym plan_table for plan_table;Synonym created.SQL> grant all on plan_table to public;Grant succeeded. 3.创建plustrace 角色 SQL> @?/sqlplus/admin/plustrce.sql 执行这个脚本就可以了。SQL> drop role plustrace;drop role plustrace *ERROR at l
linux date 昨天 _取前一个小时
linux date 昨天date -d '-2 day' +%Y%m%d-%H%M%S取前一个小时date -d '-1 hour' +%Y%m%d-%H%M%S[@more@]linux date 昨天date -d '-2 day' +%Y%m%d-%H%M%S取前一个小时date -d '-1 hour' +%Y%m%d-%H%M%S
linux_apache+php+dotproject
注意:php-5.3.0.tar.gz抛弃的很多的函数,所以不适合安装dotproject2.1.2 只能使用php-5.3.0.tar.gz以前的版本[@more@]注意:php-5.3.0.tar.gz抛弃的很多的函数,所以不适合安装dotproject2.1.2 只能使用php-5.3.0.tar.gz以前的版本tar zxvf zlib-1.2.3.tar.gzcd zlib-1.2.3/./configure --prefix=/home/project/usr/localmake make installtar zxvf libpng-1.2.38.tar.gzcd libpng-1.2.38/./configure --prefix=/home/project/usr/localmake make installtar zxvf jpegsrc.v7.tar.gzcd jpeg-7/./configure --prefix=/home/project/usr/local
linux_apache_Subversion安装配置
==============================cd zlib/./configure --prefix=/home/nagios/usr/local/zlib && make && make installcd ../sqlite-amalgamation./configure --prefix=/home/nagios/usr/local/sqlite-amalgamation && make && make installcd ../apr/./configure --prefix=/home/nagios/usr/local/apr && make && make installcd ../apr-util/./configure --prefix=/home/nagios/usr/local/apr-util --with-apr=/home/nagios/usr/local/apr && make && make installcd .
linux_aix安装postfix
wget http://ftp.unicamp.br/pub/postfix/official/postfix-2.6.2.tar.gztar zxvf postfix-2.6.2.tar.gzcd postfix-2.6.2/make useradd -s /sbin/nologin -d /dev/null postfixgroupadd postdropmake install最后一步选择postdrop [@more@]
apache日志统计 按小时,分钟统计url访问次数
####################按小时统计url访问次数# $1 url#!/bin/shif [ "$1" = "" ]then echo "Url is null ... EXIT"exit 1fiLOG='/www/apache_log'HOUR="`seq -w 0 23`"files="`ls -trl ${LOG}/web-?*.log | awk '{print $9}'`"url="$1"export LOG HOUR files urlfor file in $filesdofor a in ${HOUR}do num=`cat ${file} |awk '{print $4"t"$7}' |grep "${url}"|grep "/2009:${a}"|wc -l`echo "${file}:${a} ${num}"echo "---
aix 远程登陆缓慢问题
在AIX操作系统中,如设置了DNS,则会先用DNS解析IP和主机名。要想先用/etc/hosts,而当查询的名字在hosts文件中不存在时再用DNS解析IP和主机名,可在/etc/netsvc.conf 文件中加入下列一行设置:hosts=local,bind 注意:一定要在服务器端,客户端得/etc/hosts中互相增加主机IP,名称记录不然慢如牛,好像很多unix/linux系统都有这个问题,奇怪得问题,但是只要互相在/etc/hosts中增加了IP 主机名得记录就会很快[@more@]
linux 单行命令
懒的写脚本,一行执行多个命令#########zcat web-20090523.log |grep 'Sat2009/05/23:08'| grep '117.25.54.125' | awk '{print $6"t"$10"t"$11"t"$12"t"$13"t"$14"t"$15"t"$16"t"$17"t"$18"t"$19"t"$20"t"$21}' | more###########while : ; do date ;echo "" ;sleep 30 ; date >>/tmp/h/web-1 ; ssh web-1 netstat -anlp |grep tcp | grep -v ESTABLISHED |grep TIME_WAIT |awk -F: '{print
solaris下-silent方式安装oracle client
#.profileORACLE_HOME=/home/ora10/product/10.2.0/client;export ORACLE_HOMEORACLE_SID=ECOM;export ORACLE_SIDLD_LIBRARY_PATH=/usr/lib:$ORACLE_HOME/lib;export LD_LIBRARY_PATHLANG=zh_CN.GBK;export LANGNLS_LANG=american_america.ZHS16GBK;export NLS_LANGPATH=$PATH:$ORACLE_HOME/bin;export PATH#response_client.rspRESPONSEFILE_VERSION=2.2.1.0.0UNIX_GROUP_NAME=dbaFROM_LOCATION="../stage/products.xml"NEXT_SESSION_RESPONSE=<Value Unspecified>ORACLE_HOME="/home/ora10/product/10.2.0/client&
aix下解压缩cpio文件
aix 上解压缩cpio文件 cpio -idcmv < 10gr2_aix5l64_database.cpio[@more@]解
linux_ganglia客户端安装
mkdir -p /tmp/gangliacd /tmp/ganglia/rsync -azv -e ssh root@192.168.2.82:/home/smb/share/linux_soft/ganglia/ganglia_client.tgz ./tar zxvf ganglia_client.tgzcd ganglia/tar zxvf confuse-2.6.tar.gzcd confuse-2.6/./configure && make && make installcd ..rm -rf confuse-2.6tar zxvf apr-1.2.8.tar.gzcd apr-1.2.8/./configure --prefix=/usr/ && make && make installcd ../rm -rf apr-1.2.8tar zxvf ganglia-3.1.1.tar.gzcd ganglia-3.1.1/./configure --prefix=/usr/local/ganglia &
linux_unix_script_生成ping脚本
scan_host.sh[@more@]cat >scan_host.sh<<EOF#!/bin/bashcat $PWD/host.list|while read host;do echo -n "ping ${host} : ";ping -c 3 ${host} >/dev/null ; if [ "$?" -eq "0" ]; then echo "${host} allow ..." ; else echo "${host} deny !!!" ;fi;echo"";echo "" ;doneEOF注意:生成脚本的shell中 $符号前用'反斜线'屏蔽'$'符号直接脚本#!/bin/bash cat $PWD/host.list|while read host port do echo -n "ping ${host} : "ping -c 3 ${
linux_取文件唯一行_取文件重复行
不显示记录行数cat a | sort | uniq -d |sort -r >aacat a | sort | uniq -u |sort -r >ab显示行记录数cat b | soft | uniq -dc | sort -r >bacat b | soft | uniq -uc | sort -r >bb[@more@]
linux_root_scripts
start.shstop.shapp_bin.shappo_log.shmysql_bin.sh[@more@]#################cat start.sh #!/bin/shAPP="$1"if [ "${APP}" == "mysql" ]; then db_pid="`ps -ef | grep mysql-max/bin/mysqld |grep -v grep| awk '{print $2}'`" if [ "${db_pid}" != "" ]; then echo "mysql Started ..." exit 1 fi # startup mysqlsu - mysql<<EOFcd ./mysql-max/./bin/mysqld_safe & EOFelif [ "${APP}" == "tomcat" ] ; thenapp_p
aix_system_monitor
1.# 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /var/log/system/system_monitor&file="/var/log/system/sysinfo`date +%Y%m%d`"time="`date +%H:%M`"cpu=`vmstat 1 2 | sed -n '$p' |awk '{printf "%4s %4s %5s", $14,$15,$16}'`mem_block="`vmstat 1 2 | sed -n '$p'| awk '{print $4}'`"mem_free="`expr ${mem_block} * 4`"load="`uptime | sed s/,/ /g|sed s/:/ /g| awk '{printf "%5s %5s %5s", $12,$13,$14}'`"db2="`netstat -an | grep 1521 | g