CentOS系统下CPU温度监控

CentOS下监控CPU的温度。本文基于CentOS 6.5 64bit。

lm_sensors通过调用/lib/modules/2.6.32-358.xxx.x86_64/kernel/drivers/hwmon/coretemp.ko模块来读取温度值。

yum install lm_sensors
sensors-detect           #一路YES即可

modprobe i2c-dev
mobprobe coretemp        #必要

cat /etc/sysconfig/lm_sensors    #查看温度监控模块
sensors                  #查看CPU温度
watch sensors            #每隔一秒显示CPU温度
watch -n 1 -d sensors    #每隔一秒显示CPU温度

以下是一些无用内容,请自动忽略。
谷歌查到的一些其它监控CPU温度的内容:

/sys/bus/acpi/devices/LNXTHERM\:00/thermal_zone/temp
cat /proc/acpi/thermal_zone/THM0/temperature

On my 2010 Debian Lenny system, the path is:
proc/acpi/thermal_zone/THRM/temperature

Read More

CentOS 6配置vsftpd

最近被pureftpd的乱码搞到头疼了。查了很多资料包括官方文档,要让pureftpd支持utf-8编码,需要在编译的时候加上–with-rfc2640选项,于是我又重新编译了一遍,发现该功能依然是失效的!很无奈只好放弃pureftpd了转向vsftpd的怀抱了。经过简单的测试,发现vsftpd默认编码就是utf-8,且能够自动处理文件的编码(例如当收到无效字节时会自动禁用utf-8,即使有用户以gbk上传的文件,也能正常显示,这个功能很赞)。本文CentOS 6 64bit上面配置vsftpd的过程,记录一下。

假设ftp的根目录是/home/wwwroot/ftp:

$ yum install vsftpd

$ useradd -d /home/wwwroot/ftp -g www -s /sbin/nologin 用户名
$ passwd 用户名

$ touch /etc/vsftpd/chroot_list

$ vim /etc/vsftpd/vsftpd.conf

#对以下选项作更改,如果没有就添加
anonymous_enable=NO
idle_session_timeout=600
ftpd_banner=Welcome to zhukun.net FTP service.
chroot_list_enable=YES     #是否启用列表文件,默认为NO
chroot_local_user=YES      #列表文件中的用户能否切换到上级目录,默认为NO
chroot_list_file=/etc/vsftpd/chroot_list
use_localtime=YES

$ chkconfig --level 2345 vsftpd on
$ service vsftpd start
$ chown -R 用户名 /home/wwwroot/ftp

(more…)

Read More

CentOS下给pptp限速

其实PPP的配置文件里有一个限速的配置项,但该配置项在Linux系统下不起作用。因此只好从其它方向研究一下限速的办法了。本文在CentOS 6 64bit系统上测试成功。

假设已经安装好了pptpd,且pptpd的子网段是172.16.36.0/24。

1,准备工作

yum install /sbin/tc

vim /etc/sysctl.conf
修改net.ipv4.ip_forward = 1
sysctl -p

#加载sch_htb模块
modprobe sch_htb
echo "modprobe sch_htb" >> /etc/rc.local

2,限速设置

vim /etc/ppp/ip-up

在最后一行的exit 0上面,添加如下内容 (more…)

Read More

CentOS 6使用mutt+msmtp发送邮件

CentOS系统下如果希望向外域发送邮件,需要配置sendmail+dovecot等一系列工具。其实不用这么麻烦,只要mutt+msmtp就可以实现向外域发送邮件的功能了。本文基于CentOS6 64bit。

1,安装配置msmtp

$ yum install gcc gcc-c++ gnutls gnutls-devel gnutls-utils openssl openssl-devel libidn libidn-devel -y
$ wget http://sourceforge.net/projects/msmtp/files/msmtp/1.4.32/msmtp-1.4.32.tar.bz2
$ tar -jxvf msmtp-1.4.32.tar.bz2
$ cd msmtp-1.4.32
$ ./configure --prefix=/usr/local/msmtp
$ cd msmtp-1.4.32
$ make && make install

$ mkdir /usr/local/msmtp/etc

生成配置文件

$ cat >>/usr/local/msmtp/etc/msmtprc<<EOF

直接复制以下内容粘贴在>号的位置即可 (more…)

Read More

CentOS6配置rsync服务

rsync是linux下的文件同步服务,本文演示了在CentOS 6系统上配置rsync的过程。

1,服务端配置

网上有很多教程在配置rsync服务端的时候,都先配置了xinetd服务,事实上这是不必要的,rsync也能脱离xinetd以独立进程的方式运行,所以本文未配置xinetd。

$ yum install rsync -y

$ mkdir /etc/rsyncd
$ touch /etc/rsyncd/rsyncd.conf    #主配置文件
$ touch /etc/rsyncd/rsyncd.secrets #客户端连接时使用的用户和密码
$ touch /etc/rsyncd/rsyncd.motd    #服务端提示信息文件
$ chmod 600 /etc/rsyncd/rsyncd.secrets
$ chown root:root /etc/rsyncd/rsyncd.secrets

(more…)

Read More

CentOS 6.4安装配置NFS服务器

CentOS 6.4 64bit系统上设置NFS的过程,简单记录一下。

1,配置NFS服务端

$ yum install nfs-utils portmap  (适用centos 5)
$ yum install nfs-utils rpcbind  (适用centos 6)

假设服务端要挂载的目录是/mnt/koji,设置如下

$ vim /etc/exports
/mnt/koji       *(rw,async,no_root_squash,no_subtree_check)

(more…)

Read More

CentOS 安装gnome/xfce+vncserver

CentOS 安装图形界面的过程,简单记录一下。这里提供了两种图形界面的安装,分别是CentOS自带的gnome桌面及轻巧的xfce。据测试,我的精简版CentOS 6 64位系统安装gnome需要下载522M的文件,而安装xfce仅需下载89M的文件。下面分别介绍安装方法:

1,安装gnome桌面

[root@localhost ~]# yum groupinstall "GNOME Desktop Environment"  (适合Centos 5)
[root@localhost ~]# yum groupinstall "Desktop"                    (适合Centos 6)
安装完gnome桌面以后,最好也同时安装以下两个软件包:
[root@localhost ~]# yum install fonts-chinese         (CentOS 5 安装中文字体)
[root@localhost ~]# yum groupinstall chinese-support  (CentOS 6 安装中文字体)

[root@localhost ~]# yum install nautilus-open-terminal (桌面右键菜单在终端中打开,需重启)

2,安装xfce桌面 (more…)

Read More