CentOS Linux查看主板型号及硬件信息已关闭评论
操作系统:CentOS release 6
安装包命令查找:
yum whatprovides */lspci
查看主板型号:
dmidecode |grep -A16 "System Information$"
内存槽及内存条:
dmidecode |grep -A16 "Memory Device$"
硬盘:
fdisk -l
smartctl -a /dev/sda
HP SmartArray (cciss) hardware RAID controllers:
smartctl -d cciss,0 -a /dev/cciss/c0d0
网卡:
mii-tool
scsi/raid卡:
lspci
centos相关命令安装:
yum -y install smartmontools
yum install pciutils -y
阅读全文
1℃
问题 linux平台用pptp搭建了vpn服务器,拨入后访问内网ftp,下载文件极慢;用其作网关上网,除了baidu外,大部分网站访问速度极慢,几乎无法访问。
解决 在pptp所在的linux服务的iptables的*filter表中加入
-I FORWARD -p tcp --syn -i ppp+ -j TCPMSS --set-mss 1356
或者在命令提示符运行
/sbin/iptables -I FORWARD -p tcp --syn -i ppp+ -j TCPMSS --set-mss 1356
原因分析
=====在断开vpn链接的情况下:
在windowsXP下用ping -f -l XXXXXX 192.168.0.1一步一步测试(XXXXXXX为MTU大小,可以从1500开始,逐渐...
cnetos, linux, mtu, pptp, syn, vpn阅读全文
cp/rm/mv等命令强制覆盖操作方式实现已关闭评论
centos下查找目录下的所有文件中是否包含指定字符串已关闭评论
linux下查找目录下的所有文件中是否包含指定字符串
find . | xargs grep -ri "IBM"
查找目录下的所有文件中是否含有某个字符串,并且只打印出文件名
find . | xargs grep -ril "IBM" 1.正则表达式
(1)正则表达式一般用来描述文本模式的特殊用法,由普通字符(例如字符a-z)以及特殊字符(称为元字符,如/、*、?等)组成。
(2)基本元字符集及其含义
^ :只匹配行首。 如^a 匹配以a开头的行abc,a2e,a12,aaa,......
$ :只匹配行尾。 如^a 匹配以a结尾的行bca,12a,aaa,.......
* :匹配0个或多个此单字符。 如(a)*...
centos, find, grep, linux, xargs阅读全文
1℃
之前在FreeBSD7.4上安装很顺利就安装了,但这次在CentOS 5.5上安装时遇到了如下问题
zmalloc.o: In function zmalloc_used_memory':
/home/xx/redis-2.6.2/src/zmalloc.c:223: undefined reference to__sync_add_and_fetch_4′
collect2: ld 返回 1
make[1]: *** [redis-server] 错误 1
make[1]: Leaving directory `/home/xx/redis-2.6.2/src’
make: *** [all] 错误 2
github上面一兄弟在src/Makefile开头加 CFLAGS= -march=i686解决了,但是我试了。继续google,发现google group里有个兄弟编辑了下src/.make_set...
centos, redis, tcl阅读全文
关闭rpc.statd服务已关闭评论
为了让linux主机少一些隐患,我们要尽可能把一些不需要的服务取消或者删掉。
我们可以先来看看目前有哪些端口是开着的
[root@localhost linsc]# nmap 127.0.0.1
Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2007-12-05 21:28 CST
Interesting ports on localhost.localdomain (127.0.0.1):
(The 1652 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
766/tcp open unknown
3306...
netstat, nfs阅读全文
linux下使用md5sum递归生成整个目录的md5 [原创]已关闭评论
linux下使用md5sum递归生成整个目录的md5
今天要用md5sum操作目录,递归生成目录下所有文件的md5值,结果发现它不支持递归操作于是写了个php脚本处理下
代码:
<?php
$path ='/data/www/bbs/source';
$outfile = 'file.md5';
get_file_md5($path, $outfile);
function get_file_md5($path, $outfile)
{
$path = rtrim($path, '/');
if(function_exists('scandir'))
{
$files = scandir($path);
foreach($files as $v)
{
...
linux, md5, md5sum, php阅读全文
CentOS 5.7 Missing Dependency :kernel-header已关闭评论
CentOS 5.7 yum时出现Missing Dependency :kernel-header 的解决方法,在此记下
错误信息如下:
glibc-headers-2.5-81.el5_8.2.x86_64 from updates has depsolving problems
--> Missing Dependency: kernel-headers >= 2.2.1 is needed by package glibc-headers-2.5-81.el5_8.2.x86_64 (updates)
glibc-headers-2.5-81.el5_8.2.x86_64 from updates has depsolving problems
--> Missing Dependency: kernel-headers is needed by package glibc-headers-2.5-81.el5_8.2.x86_64 (updates)...
centos, header, kernel, yum阅读全文