ITeye博客

Focus on the Oracle MAA -- Yumeng

mixmaomao · 共 62 篇文章

CentOS Too many open files

打开Terminal提示下列报错 There was an error creating the child process for this terminal Failed to create pipe for communicating with child process (Too many open files) 解决方法 vim /etc/security/limits.conf 增加 *** soft nofile 8096** *** hard nofile 20480** 作用在于更改ulimit open files

2013-12-13T16:50:27Z · Unix/Linux OS · 评论(0)

Python expect模块

Expect python也是有支持的,只不过换个名字pexpext而已. status = pexpect.spawn('ssh %s "%s"' % (host,command)) #此处需要执行的命令 try: i = status.expect(['password:', 'continue connecting (yes/no)?'], timeout=1) if i == 0:#不成立输入密码 status.sendline(passwd) elif i == 1:#成立输入yes和密码 status.sendline('yes') status.expect('password…

2013-12-07T12:40:43Z · Python Module · 评论(0)

Perl实现批量安装NRPE客户端

近期要安装N多台Linux主机的NRPE客户端,话说我这么“懒”的人怎么可能会一个个自己安.批量处理的简单小程序就用perl来做吧! # tar -tf BatchNrpe.tar.gz BatchNrpe/ BatchNrpe/install.sh BatchNrpe/Check_Nrpe.pl BatchNrpe/nrpe-2.15.tar.gz BatchNrpe/Batch_Installation_Nrpe.pl BatchNrpe/hostlist BatchNrpe/nagios-plugins-1.5.tar.gz BatchNrpe.tar.gz为主主程序包. instal…

2013-12-04T19:49:31Z · Perl Module · Shell · Nagios Core · 评论(0)

Perl Expect模块

Expect是Unix系统中用来进行自动化控制和测试的软件工具,由Don Libes制作,作为Tcl脚本语言的一个扩展,应用在交互式软件中如telnet、ftp、Passwd、fsck、rlogin、tip、ssh等等.该工具利用Unix伪终端包装其子进程,允许任意程序通过终端接入进行自动化控制;也可利用Tk工具,将交互程序包装在X11的图形用户界面中. 当然Perl也集成了Expect模块 my $exp = Expect->new; $exp = Expect->spawn("command"); $exp->expect(2, [ 'password', sub { my $self_…

2013-12-04T19:29:23Z · Perl Module · 评论(0)

vi/vim 快捷操作

删除空行 :g/^$/d 替换空格为回车 :s/ /\r/g 清空文件 gg + dG 删除当前行到最后 dG

2013-12-02T11:45:24Z · Unix/Linux OS · 评论(0)

CentOS 部署Subversion + Apache版本控制服务器

安装前提 安装步骤 配置subversion 一、安装前提 1.关闭防火墙 # service iptables stop # chkconfig iptables off # service ip6tables stop # chkconfig ip6tables off 2.关闭SElinux # perl -i -p -e 's/=enforcinig/=disabled/g' /etc/selinux/config 重启系统 二、安装步骤 /*** apache 2.2 -> openssl 0.9.8 -> subversion 1.6 apache 2.4 -> openssl …

2013-11-30T12:08:55Z · Unix/Linux APP · 评论(0)

Perl 操作符优先级

操作符优先级 结合性 元数 优先级 无 左 无 右 右 左 左 左 左 右 无 无 左 左 左 左 无 右 右 左 右 右 左 左 0 2 1 2 1 2 2 2 2 0,1 2 2 2 2 2 2 2 3 2 2 0+ 1 2 2 项和列表操作符(左侧) -> ++ -- ** !~\和一元+及- =~ !~ *** / % x** + - . << >> 命名一元操作符 < > <= => lt gt le ge == != <=> eq ne cmp & | ^ && || .. ... ?: + += -+ *= 等等 , => 列表操作符(右侧) not and or xor

2013-11-26T22:52:36Z · Perl Basic · 评论(0)

firefox is already running

出现firefox is already running的原因是没有正常关闭firefox. 按照Google的方法将~/.mozilla/firefox/*.default目录下的lock删除掉 问题依旧. 自己动手丰衣足食: 索性 将.mozilla移走或删除即可.

2013-11-25T12:43:38Z · Unix/Linux OS · 评论(0)

Kernel Panic - not syncing: Attempted to kill init!

Ghost CentOS新系统后提示报错: Kernel Panic - not syncing: Attempted to kill init! 解决方法 将Bios中硬盘模式更改为AHCI即可

2013-11-19T16:58:41Z · Unix/Linux OS · 评论(0)

Yum 参数

1.使yum安装i686以及X86_64全部软件包 vim /etc/yum.conf 新增一行 multilib_policy=all 2.使yum安装非i686以及i386全部软件包 vim /etc/yum.conf 新增一行 exclude=*.i?86

2013-11-19T14:43:11Z · Unix/Linux OS · 评论(0)

CentOS 释放内存

内存占用原因 当读写文件的时候,Linux内核为了提高读写性能与速度,会将文件在内存中进行缓存,这部分内存就是Cache Memory. 即使你的程序运行结束后,Cache Memory也不会自动释放.这就会导致你在Linux系统中程序频繁读写文件后,你会发现可用物理内存会很少. 处理方法一 Cache Memory在你需要使用内存的时候会自动释放,所以你不必担心没有内存可用. 处理方法二 如果你希望手动去释放Cache Memory也是有办法的: 使用 sync;sync;echo 1 > /proc/sys/vm/drop_caches 命令. 效果很显著. 命令解释 sync命令的作用…

2013-11-18T15:59:22Z · Unix/Linux OS · 评论(0)

no device found for connection 'System eth0'

使用cloneZlia Ghost CentOS系统后,启动会莫名其妙的出现网卡错误 # ifconfig eth0 eth0: unknown interface :No such device 使用ifconfig命令查看发现网卡认到eth1,那我们就将错就错将eth0变更为eth1 # cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0_BAK # mv /etc/sysconfig/network-scripts/ifconfig-eth0 /etc/syscon…

2013-11-15T14:55:17Z · Unix/Linux OS · 评论(0)

freeswitch configure: error: libtermcap, libcurses or libncurses are required!

编译安装freeswitch 1.2.14报错error: libtermcap, libcurses or libncurses are required! # yum install libtermcap # yum install ncurses-devel

2013-11-13T16:33:53Z · Unix/Linux APP · 评论(0)

CentOS 内核裁剪

1.下载系统对应内核版本 https://www.kernel.org/pub/linux/kernel/ 2.将本机内核配置文件拷贝至新下载的内核包中 # tar -zxvf linux-2.6.32.tar.gz # cd linux-2.6.32 # cp /boot/config-2.6.32-279.el6.x86_64 .config 3.使用make menuconfig进行内核裁剪(此处实例为去掉USB模组) # make menuconfig 选择Device Drivers “回车” 选择USB support 按"空格"取消支持 按两下"Esc"退出一层配置(退出两次)…

2013-11-11T19:18:47Z · Unix/Linux OS · 评论(0)

CentOS 安装网卡驱动

1.查看网卡型号 # lspci 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation 3rd Gen Core processor PCI Express Root Port (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series Chipset Family USB xHCI Host Controller (rev 04) 00:…

2013-11-11T17:15:58Z · Unix/Linux OS · 评论(0)