#!/bin/bash#dhcp="/mnt/Server/dhcp-3.0.5-23.el5.i386.rpm"file=/etc/sysconfig/network-scripts/ifcfg-eth0grepdhcp$fileif[$?-eq0]then #设置IP read-p"请输入IP地址":ip read-p"请输入子网掩码":net read-p"请输入网关地址":ga sed-i‘s/BOOTPROTO=.*/BOOTPROTO=static/‘$f..
分类:
其他好文 时间:
2014-09-29 18:13:12
阅读次数:
224
#!/bin/bash
echo "IP:"
ifconfig |grep "inet addr"|grep -v 127.0.0.1|awk '{print $2}'|awk -F ':' '{print $2}'
echo "Product Name:"
dmidecode |grep Name
echo "CPU Info:"
dmidecode |grep -i cpu|grep -i v...
分类:
其他好文 时间:
2014-09-29 14:51:31
阅读次数:
199
#!/bin/bash
IP=`awk‘{print$1}‘/home/bash/mima.txt`
foriin$IP
do
{port=`grep$i/home/bash/mima.txt|awk‘{print$2}‘`
pawd=`grep$i/home/bash/mima.txt|awk‘{print$3}‘`
expect<<EOF
spawnssh-p$portroot@$i;
expect{
"(yes/no)?"{send"yes\r"}
"password:"{send"$pa..
分类:
其他好文 时间:
2014-09-28 18:43:36
阅读次数:
133
1 内存分析1.1 jmap -histo 命令pid=`jps | awk '{if ($2 == "Jps") print $1}'`jmap -histo $pid >>1.txt 查看pid中类的内存占用num #instances(实例数) #bytes(占用字节) class name ...
分类:
其他好文 时间:
2014-09-28 18:01:53
阅读次数:
176
1.硬件和系统配置 CPU 双核 内存 1480M swap 4G /u01 16G 核心版本 3.10.0-123.el7.x86_642.配置系统和安装所需软件包 2.1 关闭selinux sed -i 's/SELINUX=enforcing/SELINUX...
分类:
数据库 时间:
2014-09-28 02:21:10
阅读次数:
6602
Last night , I attended writting examination for Bai Du,There is a problem, ask us implement a state machine to deleting the comments in c,I don't k.....
分类:
编程语言 时间:
2014-09-27 10:43:39
阅读次数:
178
[plain]
view plaincopyprint?
#! /bin/sh while true; do i=`df -h | egrep '/mnt/yourpath'| awk '{print $5}' | cut -d "%" -f1 -`
if [ "$i" -ge 90 ] then echo "disk nearly full" cd /mnt/your...
分类:
系统相关 时间:
2014-09-27 09:35:19
阅读次数:
240
数组states[$NF],格式输出printf,注意循环结构范围{}nginx日志格式分状态码查看流量awk‘{StatesCode[$9]+=$10}END{printf("StateCode------SIZE(bytes)\n");for(iinStatesCode)printf("%8s%18s\n",i,StatesCode[i])}‘access.log
分类:
其他好文 时间:
2014-09-26 20:37:59
阅读次数:
127
#!/bin/awk-f
#Function:指定使用文件中随机数量的行(手动传参ipl和idl)随机替换指定列(脚本中指定);使用指定位数的随机浮点替换指定列(脚本中指定)。
#Usage:./t.awk-vip=<ipfile>-vid=<idfile>-vipl=<n>-vidl=<n>log.txt
#Date:2014092220:16
BEGIN..
分类:
其他好文 时间:
2014-09-26 20:26:39
阅读次数:
176