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
aix_ssh scp command not found
vi /etc/environmentPATH=/usr/local/bin:$PATH[@more@]> scp: Command not found. > lost connection Add /usr/local/bin to the end of the line containing 'PATH' in /etc/environment on the AIX box. No further action needed -- it will work on the next scp attempt. /etc/environment (on an AIX machine) always gets executed, even for non-interactive logins, so if /usr/local/bin is listed in PATH there, scp will work correctly. It is best to make sure /usr/local/bin is listed at the *end* of the PAT
linux_监控网卡流量脚本
监控网卡流量脚本 [@more@]监控网卡流量脚本 前言:这个脚本是用来监控网卡的瞬时流量的,跟Cacti的计算结果完全吻合。如果想让系统每多少分钟取一次可以将此脚本改良成任务计划执行的脚本并记录到日志中。 #!/bin/bash################################ Author : Ajian## Time : 2007-9-21## File: netflood.sh## watch the eth0 or eth1 ##################################Set the varible.#ETH=eth0ETH="$1"while : ; do time=`date +%m"-"%d" "%k":"%M` day=`dat
oracle 10g_rac_create tablespace_add_datafile
create tablespace test datafile '+XXXX' size 3M autoextent on next 50M maxsize 8000M extent management local uniform;alter tablespace test add datafile '+XXX' size 3M autoextent on next 50M maxsize 8000M ;drop tablespace test including contents and datafiles;[@more@]
linux_websphere_wsadmin.sh
websphere 6.0.2/app1/ibm/IBM/WebSphere/AppServer/bin/wsadmin.shwsadmin命令行管理[@more@]./wasprofile.sh -create -profileName bladetcb6profile -profilePath /usr/IBM/WebSphere/AppServer/profiles/bladetcb6profile -templatePath /usr/WebSphere/AppServer/profileTemplates/default -nodeName bladetcb6node -cellName bladetcb6Cell -hostName bladetcb6.rtp.raleigh.ibm.comAppSrv01./wasprofile.sh -create -profileName AppSrv01 -profilePath /app1/ibm/IBM/WebSphere/AppServer/profiles/AppSrv01 -templatePa
Linux_java_调用classes
java 调用class[@more@]#!/bin/shLANG=zh_CN.GBKDATE="`date +%m%d%H%M`"#add by llbcps=$CLASSPATH:"/usr/local/tomcat/webapps/sitestat/WEB-INF/classes"for jarPkg in `find /usr/local/tomcat/webapps/sitestat/WEB-INF/lib -name "*.jar"`do cps=$cps:$jarPkgdone#echo $cpsjava -cp $cps com.sinovatech.websitetotal.AnalyseDatasleep 10
solaris_linux_批量删除搜索出的文件
for file in `find ./ -name '*' | grep '.jsp$'` ;do rm -rf $file ; done ===========================#!/bin/shfor file in `find ./ -name '*' | grep '[a-z]*.[0-9]$'` do if [ -d $file ] ; then echo "This is Directory ..." continue else ls -trl ${file} fi done[@more@]
Linux下的Oracle9i data guard配置过程
Linux下的Oracle9i data guard配置过程[@more@]# CONFIGURE STANDBY DATABASEsqlplus /nologset lines 160col PARAMETER for a50col VALUE for a80col name for a40connect / as sysdba;# 启动主库导归档模式startup mount;archive log list;archive log start;alter database Archivelog; alter database force logging; alter database open;# Enable Archiving and Define a Local Archiving Destination ! mkdir -p /export/home/oracle/admin/ECOM/adump/ecom# Create a Control File for the Standby Databasealter database create
linux_php_jpeg6,png,gd
linux 下编译安装gd后php的探针总是不能检测到,以下是编译pnp,jpeg6,freetype ,gd,最后从新编译php后才算能够探测到gd.编译php后要从起apache[@more@]# 编译png./configure --prefix=/usr/local/png# 编译jpeg6./configure --with-jpeg=/usr/local/jpeg6 --with-png --with-zlib --with-freetype=/usr/local/freetype --with-xpm# 编译freetype ./configure --prefix=/usr/local/freetype# 编译 gd./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg6 --with-png=/usr/local/lib --with-zlib=/usr/local/lib --with-freetyp