posts - 73,  comments - 55,  trackbacks - 0
一,网络时间服务:

1. 与一个已知的时间服务器同步
公司配置:
#synchronize time with fw.exoweb.net
00 0 1 * * root rdate -s fw.exoweb.net

2. 配置网络时间协议(ntp)


1. 让linux自动同步时间

vi /etc/crontab
加上一句:
00 0 1 * * root rdate -s time.nist.gov

time.nist.gov 是一个时间服务器.

2. 时间服务器配置(192.168.10.1)

1). # rpm -ivh ntp-4.1.2-4.EL3.1.i386.rpm
2). # vi /etc/ntp.conf
注释一行
restrict default ignore
加入一行
restrict 192.168.10.0 mask 255.255.255.0 notrust nomodify notrap
3). # vi /etc/ntp/step-tickers
加入一行
pool.ntp.org
这样每次ntpd启动时,会自动连接该国际标准时间服务器;
4). # service ntpd start
5). # netstat -an |grep 123
确保该端口以udp方式开放

时间客户端配置(192.168.10.2)
1). # ntpdate 192.168.10.2
应该显示同步成功
2). # crond -e
加入
0-59/10 * * * * /usr/sbin/ntpdate 192.168.10.1
表示每隔10分钟同步一次时间


二, 出现  must be setuid root 错误
解决办法:

ls -l  /usr/bin/sudo
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo
reboot

三,用nohup命令让Linux下程序永远在后台执行

Unix/Linux下一般想让某个程序在后台运行,很多都是使用 & 在程序结尾来让程序自动运行。比如我们要运行mysql在后台:

         /usr/local/mysql/bin/mysqld_safe --user=mysql &

但是我们很多程序并不象mysqld一样可以做成守护进程,可能我们的程序只是普通程序而已,一般这种程序即使使用 & 结尾,如果终端关闭,那么程序也会被关闭。为了能够后台运行,我们需要使用nohup这个命令,比如我们有个start.sh需要在后台运行,并且希望在 后台能够一直运行,那么就使用nohup:

            nohup /root/start.sh &

四, python反编译工具
decompyle

五,rpm包转deb包工具: fakeroot and alien
fakeroot alien -d *.rpm


六, 保存ftest信息并查看
nohup ./nordicbetsite ftest -v2 >ftest_result 2>&1 &
tail -f ftest_result

七, ip信息
ifconfig

八, dpkg命令
查看python2.5是否安装: dpkg -l python2.5
查看名称含有python的所有软件: dpkg -l | grep python
查看python2.5软件包的位置: dpkg -L python2.5

九, 分区情况
查看所有分区情况: df -h
查看某个软件在哪个分区: df -h ***


posted on 2007-05-08 16:47 保尔任 阅读(592) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 

<2007年5月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

常用链接

留言簿(4)

随笔分类

随笔档案

文章分类

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜