#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin export PATH=$PATH # Define SRC="/usr/local/src" TimeZone="/usr/share/zoneinfo/Asia/Shanghai" # Timezone && Datetime netstat -antp|grep LISTEN|grep ntpd && /etc/init.d/ntpd stop chkconfig ntpd off [ -f /etc/localtime -a ! -f /etc/localtime.default ] && cp /etc/localtime /etc/localtime.default [ -f /etc/localtime -a -f $TimeZone ] && mv /etc/localtime /etc/localtime.$(date +%F_%T) [ -f $TimeZone ] && \cp $TimeZone /etc/localtime /usr/sbin/ntpdate us.pool.ntp.org hwclock --systohc # DNS grep 202.106.0.20 /etc/resolv.conf >/dev/null 2>&1||echo 'nameserver 202.106.0.20' >> /etc/resolv.conf grep 219.141.136.10 /etc/resolv.conf >/dev/null 2>&1||echo 'nameserver 114.114.114.114' >> /etc/resolv.conf grep 114.114.114.114 /etc/resolv.conf >/dev/null 2>&1||echo 'nameserver 219.141.136.10' >> /etc/resolv.conf grep 8.8.8.8 /etc/resolv.conf >/dev/null 2>&1||echo 'nameserver 8.8.8.8' >> /etc/resolv.conf grep 4.4.4.4 /etc/resolv.conf >/dev/null 2>&1||echo 'nameserver 4.4.4.4' >> /etc/resolv.conf # Limits grep '# CmsTop Limits' /etc/security/limits.conf> /dev/null 2>&1 ||cat >> /etc/security/limits.conf < CentOS${release}-Base-163.repo yum -y update bash yum -y install parted dmidecode yum -y install man ntp ntpdate screen chkconfig yum -y install vixie-cron crontabs ftp vsftpd httpd memcached subversoin createrepo yum -y install wget lrzsz zip unzip tree vim mlocate dos2unix patch rsync sed yum -y install gcc gcc-c++ autoconf automake make cmake yum -y install tcpdump telnet sysstat lsof strace iptraf iotop ifstat sar yum -y install rkhunter chkrootkit tripwire aide # Tools ## iftop wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz -P $SRC/ tar --overwrite -zxvf $SRC/iftop-0.17.tar.gz -C $SRC/ cd $SRC/iftop-0.17 ./configure make && make install # Env & Charset [ -f /etc/sysconfig/i18n -a ! -f /etc/sysconfig/i18n.default ] && mv /etc/sysconfig/i18n /etc/sysconfig/i18n.default [ -f '/etc/sysconfig/i18n' ] && mv /etc/sysconfig/i18n /etc/sysconfig/i18n.$(date +%F_%T) cat > /etc/sysconfig/i18n <> ~/.bashrc <> ~/.wgetrc <> ~/.curlrc <