Latest stories

为Ping记录加一个时间戳

最近公司网络不稳定,间歇性断流。为了检查网络状况。我们需要用ping来了解网络状况(丢包等等一些问题)。 ping的输出默认是不带时间戳的,所以很难定位故障时间。 下面一个脚本很好的解决了此问题。 代码另存为ping.vbs 用法为:cscript ping.vbs 192.168.1.2 -t > ping.txt 如果ping的输出是英文 那么脚本里的 re.Pattern=”^请求|^来自” 替换为: re.Pattern=”^Reply|^Request” Dim args, flag, unsuccOut args="" otherout="" flag=0 If WScript.Arguments.count = 0 Then WScript.Echo "Usage: cscript tping.vbs [-t] [-a] [...

解决linux系统文件变只读

一台IBM3650,因为其中一块硬盘损坏,导致系统出故障。开启需要fsck修复。 fsck -y -f /var 用了-f强行修复之后,可以顺利进入系统。但发现/var变为只读文件系统了。导致系统大部分应用都启动失败。 [root@ox1 /]# rm /var/run/httpd.pid rm:是否删除 一般文件 “/var/run/httpd.pid”? y rm: 无法删除 “/var/run/httpd.pid”: 只读文件系统 [root@ox1 ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 /dev/mapper/vg-slash 4.8G 1.1G 3.5G 24% / /dev/sda1 99M 26M 69M 28% /boot tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/mapper/vg-home 757G 238G...

RHEL5.5 6.0 Xmanager连接

R

RHEL5.5 Xmanager连接 1,修改/usr/share/gdm/defaults.conf 将五个参数按如下修改: Enable=true DisplaysPerHost=10 Ports=177 AllowRoot=true AllowRemoteRoot=true 2,修改/etc/inittab文件 将 #x:5:respawn:/etc/X11/prefdm -nodaemon #注销这句 下面新增加一句 x:5:respawn:/usr/sbin/gdm -nodaemon 3,启起系统 RHEL6.0 Xmanager连接 1、修改/etc/gdm/custom.conf # GDM configuration storage [daemon] [security] [xdmcp] Enable=1 ———增加此行...

Ubuntu12.10 配置自动启动vnc

U

1、安装x11vnc
sudo apt-get install vino vinagre x11vnc
2、设置远程桌面登录时使用的密码,设置完后直接回车确认保存密码到 ~/.vnc/passwd文件里,“~/ ”是你当前用户的根目录如:/home/xyz/
sudo x11vnc -storepasswd
3、设置x11vnc通用的密码存储位置
sudo x11vnc -storepasswd in /etc/x11vnc.pass

RHEL改用Centos源

R

实验室购买的rhel订阅到期了。无法使用yum来解决依赖包问题,是个很头痛的事。
逼不得已将rhel的源改为centos。

系统环境:RHEL 5
备份源文件#cp -a /etc/yum.repos.d/rhel-debuginfo.repo{,.bak}
创建CentOS-Base.repo 为如下内容:

Cleanup Maildir Folders (Archive/delete Old Mails)

C

Maildir is a huge improvement over mbox for storing local mails of users. Why? I will not go into a long explanation about this, because it is not the scope of this post, but just consider that saving each mail in its own file on the disk (Maildir) opposed to saving all mails in a single file (mbox) is much faster. Not only faster, but it is also much easier to manipulate the files (that are...

AIX平台NFS配置

A

AIX平台NFS配置
1、 Nfs依赖的2种协议,包括表示层的XDR(external data representation 外部数据表示)和会话层的RPC(remote procedure call远程过程调用)。
2、 nfs守候进程和它们的子系统

 
 
 
 
3、2和3成对完成预读后写功能。保证系统响应速度。
4、4和5配对,完成文件锁定功能。

Samba配置文件常用参数详解

S

Samba配置文件常用参数详解

Samba的主配置文件叫smb.conf,默认在/etc/samba/目录下。
smb.conf含有多个段,每个段由段名开始,直到下个段名。每个段名放在方括号中间。每段的参数的格式是:名称=指。配置文件中一行一个段名和参数,段名和参数名不分大小写。
除了[global]段外,所有的段都可以看作是一个共享资源。段名是该共享资源的名字,段里的参数是该共享资源的属性。
Samba安装好后,使用testparm命令可以测试smb.conf配置是否正确。使用testparm –v命令可以详细的列出smb.conf支持的配置参数。

全局参数:
==================Global Settings ===================
[global]

config file = /usr/local/samba/lib/smb.conf.%m

sendmail 文件 virtusertable 管理虚拟域

s

如同Apache一样,sendmail也允许使用虚拟主机功能,这是通过FEATURE(virtusertable)功能实现的,而虚拟主机的文件缺省是/etc/mail/virtusertable。这个文件的形式类似于aliases文件,即:左地址 右地址 ,中间用Tab键分开。还需要注意的是,虚拟域(左地址的域名),应该属于本机接收之列。
joe@yourdomain.com    jschmoe                         1
bogus@yourdomain.com  error:nouser No such user here  2
@testdomain.com       test@mydomain.com               3
@yourdomain.com       %1@othercompany.com             4

Your sidebar area is currently empty. Hurry up and add some widgets.