awk 'NR==行号' uRfile
date +%Y%m%d-%H:%M date --date='5 minute ago'
+%Y%m%d-%H:%M
j=1
i=9
let 'j=j+i'
echo $j
等价于:
j=1
i=9
((j=j+i))
echo $j
(2012-04-29 18:49)

DNAT
target
这个target是用来做目的网络地址转换的,就是重写包的目的IP地址。如果一个包被匹配了,那么和它属于同一个流的所有的包都会被自动转换,然后就可以被路由到正确的主机或网络。DNAT
target是非常有用的。比如,你的web服务器在LAN内部,而且没有可以在Internet上使用的真实IP地址,那就可以使用这个target让防火墙把所有到它自己HTTP端口的包转发给LAN内部真正的web服务器。目的地址也可以是一个范围,这样的话,DNA
PHP环境PHP5.3 需要扩展 apc imagick memecache redis amqp mongo
mysqlnd mcrypt gearman :
mkdir /opt/software
cd /opt/software
wget
http://mirrors.ustc.edu.cn/fedora/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uvh /opt/software/epel-release-5-4.noarch.rpm
wget -S
http://mirror.checkdomain.de/imagemagick/ImageMagick-6.7.6-5.tar.bz2
wget https://github.com/nicolasff/phpredis/tarball/master
--no-check-certificate
wget -S http://pecl.php.net/get/gearman-0.8.1.tgz
wget
http://cn2.php.net/get/php-5.3.10.tar.bz2/from/this/mirror
cd /opt/software/
tar vxjf ImageMagick-6.7.6-5.tar.bz2
cd ImageMagick-6.7.6-5
./configure LDFLAGS=-L/usr/lib64 CPPFLAGS=-I/usr/include
--prefix=/usr/local/ImageMagick --enable-shared --enable-lzw
make
make install
1:
rpm -e libgearman
error: 'libgearman' specifies multiple packages
通过man rpm,发现–allmatches应该可以解决这个问题:
–allmatches
Remove all versions of the package which match PACKAGE_NAME.
Normally an error is issued if PACKAGE_NAME matches multiple
packages.
rpm -e --allmatches libgearman
2: 强制安装
rpm -ivh --force --nodeps xxxx.rpm
as5.x要升级python2.4到2.6 #看
http://blog.sina.com.cn/s/blog_57c70e19010145ok.html
安装 yum install python26-devel.x86_64
升级 Python setuptools #看
http://blog.sina.com.cn/s/blog_57c70e19010145ow.html
easy_install simplejson
yum install mercurial
hg clone http://hg.rabbitmq.com/rabbitmq-codegen/
hg clone http://hg.rabbitmq.com/rabbitmq-c/
cd rabbitmq-c
autoreconf -i
./configure
make
make install
vi /etc/ld.so.conf
增加/usr/local/lib 保存退出
ldconfig
查看:
# ldconfig -p |grep rabbitmq
librabbitmq.so.0 (libc6,x86-64) =>
/usr/local/lib/librabbitmq.so.0
librabbitmq.so (libc6,x86-64) => /
For EL5:
su -c 'rpm -Uvh
http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm'
...
su -c 'yum install foo'
For EL6:
su -c 'rpm -Uvh
http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm'
...
su -c 'yum install foo'
是64位操作系统得, URL里的i386换成x86_64
今天本来想要升级python来得,不小心把python-setuptools包给删除了,导致easy_install这个命令没有了,要装一些python的包变得很麻烦。
在http://pypi.python.org/pypi/setuptools/#rpm-based-systems上下载新的安装
wget -S
http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
tar vxzf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python setup.py install
redhat as5.6中,其python的版本依然比较落后,还是古老的2.4。安装
PythonJSON包simplejson有问题。
所以需要升级到2.6。
下面就给出使用yum升级python2.6方案。
1: rpm -Uvh
http://download.fedora.redhat.com/pub/epel/5Server/i386/epel-release-5-4.noarch.rpm
2: yum install libffi -y
3: yum install python26 -y
4: yum
install python26-devel.x86_64
5: rm -f /usr/bin/python
6: ln -s /usr/bin/python26 /usr/bin/python
运行完毕后,此时系统默认的 python 已经是 2.6 版了。
然而,yum 是基于 python2.4 的,因此会出现故障。解决方法也很简单:
vi /usr/bin/yum
将第一行末的 py
许久没装apache了,今天要搞OCS,按文档需求装了一下apache2。刚好在这儿记录一下安装过程。。。
系统是as5.6,下了httpd-2.4.1,./configure的时候提示apr太低,“configure:
error: APR version 1.3.0 or later is required”。到官网下了apr-1.4.6,安装完。
又提示apr-util太低,又下了,安装完成后。
apache2提示:
modules/http/.libs/libmod_http.a(byterange_filter.o): In
function `ap_set_byterange':
byterange_filter.c:(.text+0x12c1): undefined reference to
`apr_array_clear'
collect2: ld returned 1 exit status
make[1]: *** [httpd] Error 1
make[1]: Leaving directory `/opt/software/httpd-2.4.1'
make: *** [all-recursive] Error 1
[root@ocs01 httpd-2.4.1]#
在./configure --help 查了一下和apr,apr-util相关得,我全加上终于OK了
./configure --prefix=/usr/local/apache2 --with-mpm=worker
--enable-so --disable-negotiat
在Linux下要查看一个文件的编码格式,可以用VIM来看
:set fileencoding
(有点奇怪,在windowns下生成的中文文本,用这个办法来看是显示是latin1)
iconv (文档内容)
convmv (文件名)
iconv -f GB2312 -t UTF-8 -o history111.shtml
/home/httpd/html/about.xxxxx.com/history.shtml
iconv -f gbk -t utf-8 -o 123.txt *.txt
convmv -f gbk --t utf-8 --notest *.txt