工作,学习,生活,这里将会有一些记录. 备用域名:http://meisw.wdlinux.cn 注册 | 登陆
浏览模式: 标准 | 列表全部文章

js

cygwin

一、cygwin是什么?
 简而言之,cygwin是一个在windows平台上运行的 linux模拟环境,是cygnus solutions公司开发的自由软件

http://www.cygwin.com/

Screen:Shell 孵化器(转)

Screen 这个东东真的够酷、好玩、十二分地有意思,而且也是相当地实用。Screen 就像一个 Shell 孵化器,只需一个 Shell,在 Screen 的神奇作用下,“道生一,一生二,二生三,三生万物”,想要多少个 Shell 都可以。当然,前提是只要你愿意。有了 Screen,再也不需要同时打开多个终端或者多个标签页了。还有更加好玩的在后头,在 Screen 孵化的 Shell 中执行任务,即便是你退出终端,仍然不会对它造成任何影响。稍后,同样可以再次进入 Screen 的世界。

如果你从来没有安装过 Screen,那么就执行 sudo apt-get install screen 吧。然后,在终端中输入 screen 就启动 Screen 了。按照提示按空格键或回车键开始我们的 Screen 快乐之旅吧。现在,你可以随便执行某些命令来测试,如:ls -l。接着,我们就用 Screen 来孵化一个新的 Shell,同时按组合键 ctrl-a c,同样的,你能够在这里执行命令,我们假如是 ps aux。加上最初的,那么现在在 Screen 中就有两个 Shell 了。可是,如何在这两个 Shell 间切换呢?试试 ctrl-a ctrl-a 看?是不是很方便地切换回来了呢。假如你要退出,甚至关掉终端,那么好吧,按 ctrl-a ctrl-d,屏幕会显示 [detached],你就放心的关终端吧。是的,在玩了一圈之后,你又想进入 Screen 了,怎么办?只需输入 screen -d -r 即可。

以下总结一些常用的 Screen 操作快捷键,供大家参考:

ctrl-a c:创建一个新的 Shell
ctrl-a ctrl-a:在 Shell 间切换
ctrl-a n:切换到下一个 Shell
ctrl-a p:切换到上一个 Shell
ctrl-a 0...9:同样是切换各个 Shell
ctrl-a d:退出 Screen 会话

centos5 x86_64

yum install gcc
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package gcc.x86_64 0:4.1.2-42.el5 set to be updated
--> Running transaction check
--> Processing Dependency: libgomp = 4.1.2-42.el5 for package: gcc
--> Processing Dependency: cpp = 4.1.2-42.el5 for package: gcc
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc
--> Processing Dependency: libgomp.so.1()(64bit) for package: gcc
--> Processing Dependency: libgcc >= 4.1.2-42.el5 for package: gcc
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package cpp.x86_64 0:4.1.2-42.el5 set to be updated
---> Package libgomp.x86_64 0:4.1.2-42.el5 set to be updated
---> Package glibc-devel.x86_64 0:2.5-24.el5_2.2 set to be updated
---> Package libgcc.x86_64 0:4.1.2-42.el5 set to be updated
--> Running transaction check
--> Processing Dependency: glibc-headers for package: glibc-devel
--> Processing Dependency: glibc = 2.5-24.el5_2.2 for package: glibc-devel
--> Processing Dependency: glibc-headers = 2.5-24.el5_2.2 for package: glibc-devel
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package glibc.x86_64 0:2.5-24.el5_2.2 set to be updated
---> Package glibc-headers.x86_64 0:2.5-24.el5_2.2 set to be updated
--> Running transaction check
--> Processing Dependency: glibc-common = 2.5-24.el5_2.2 for package: glibc
--> Processing Dependency: kernel-headers for package: glibc-headers
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package glibc-common.x86_64 0:2.5-24.el5_2.2 set to be updated
---> Package kernel-headers.x86_64 0:2.6.18-92.1.22.el5 set to be updated
--> Running transaction check
--> Processing Dependency: glibc-common = 2.5-18 for package: glibc
Error: No Package Matching glibc.i686


出现Error: No Package Matching glibc.i686的问题解决办法
yum install glibc glibc.i386 --enablerepo=c532*

再yum install gcc
就OK了


c++,g++
yum install gcc-c++


web env
mysql
CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/www/servers/mysql --enable-assembler --with-mysqld-ldflags=-all-static --enable-thread-safe-client --with-extra-charsets=gb2312,gbk,utf8,latin1 --with-named-curses-libs=/usr/lib/libncursesw.so.5

err
/usr/lib/libncursesw.so.5: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[2]: *** [mysql] Error 1
make[2]: Leaving directory `/home/r00t/mysql-5.0.77/client'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/r00t/mysql-5.0.77'
make: *** [all] Error 2

change
--with-named-curses-libs=/usr/lib64/libncursesw.so.5


php
./configure --prefix=/www/servers/php --with-apxs2=/www/servers/httpd20/bin/apxs --with-mysql=/www/servers/mysql --with-iconv --enable-mbstring --enable-ftp --with-libxml2-dir=/usr

err
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.

yum install libxml2-devel

err
Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... no
configure: error: build test failed.  Please check the config.log for details.


ftp://xmlsoft.org/libxml2/
ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz
tar zxvf
./configure --prefix=/usr/local/libxml2
make

collect2: ld returned 1 exit status
make[2]: *** [xmllint] Error 1
make[2]: Leaving directory `/home/r00t/php-5.2.9/libxml2-2.7.3'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/r00t/php-5.2.9/libxml2-2.7.3'
make: *** [all] Error 2


在configure 加上 --without-zlib 可以编译通过

++
--with-libxml2-dir=/usr/local/libxml2

 

 

----------------------------------------------------------------

usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC/usr/local/lib/libz.a: could not read symbols: Bad value解决方法如下:

cd zlib-1.2.3 //进入zlib目录
CFLAGS="-O3 -fPIC" ./configure   //使用64位元的方法进行编译
make
make installmake clean


错误提示:
/usr/bin/ld: /usr/local/lib/libjpeg.a(jcapimin.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

进入Jpeg目录
CFLAGS="-O3 -fPIC" ./configure
make
make install-lib


在Linux-x86_64环境下编译php5
LDFLAGS="-L/usr/lib64 -L/lib64" ./configure --prefix=/

rhel 5.3

 ./configure --prefix=/www/servers/mysql --enable-assembler --enable-thread-safe-client --with-extra-charsets=gb2312,gbk,utf8,latin1

err
checking for termcap functions library... configure: error: No curses/termcap library found

++
--with-named-curses-libs=/usr/lib/libncursesw.so.5

libxml2

nload

http://www.roland-riegel.de/nload/index.html

 

安装 tar zxvf ...,configure

checking for netinet/in.h... yes
configure: error: ncurses library or development files not found. ncurses is required for nload.

安装 ncurses-devel

继续 make;make install,完成

install nload
checking for xlC... no
checking for C++ compiler default output file name...
configure: error: C++ compiler cannot create executables
See `config.log' for more details.

yum install gcc-c++ libstdc++ libstdc++-devel

dns zone 文件说明

第一行是TTL设定,生存时间记录字段。它以秒为单位定义该资源记录中的信息存放在高速缓存中的时间长度。这里定义为604800秒,也就是1周。

  第二行是$ORIGIN设定,说明下面的记录出自何处.请您加倍留意最后的一个小小数点"."

  然后,第三行,是一个 SOA 记录的设定,在这里我们看到一个特殊字符 @ ,它就是 ORIGIN 的意思,也就是刚刚所定义的$ ORIGIN 51099.com. 的内容,您可以写成 51099.com. 也可以用 @ 来代替。

  假如这个文件前面没有定义 $ ORIGIN 的话, 那這个 @ 的值就以 named.conf 里的 zone。

  接着 SOA 后面,指定了这个区域的授权主机和管理者的信箱,这里分别是"51099.com." 和"root.51099.com."。我们平时使用的信箱通常是“user@host”这样的格式,但因为@在 DNS 记录中是个保留字符,所以在 SOA 中就用“.”来代替了@。目前这个信箱是 "root@51099.com."。

  接下来的 SOA 设置,是被括在“( )”之间的 5 组数字,主要作为和 slave 服务器同步 DNS 资料所使用的资料:

  Serial:其格式通常会是“年月日+修改次序”(但也不一定如此,您自己能够记得就行)。当 slave 要进行资料同步的时候,会比较这个号码。如果发现在这里的号码比它那边的数值“大”,就进行更新,否则忽略。不过设 serial 有一个地方您要留意:不能超过 10 位数字!

  Refresh:这里是是告诉 slave 要隔多久要进行资料同步(是否同步要看 Serial 的比较结果)。

  Retry:如果 slave 在进行更新失败后,要隔多久再进行重试。

  Expire:这是记录逾期时间:当 slave 一直未能成功与 master 取得联系,那到这里就放弃 retry,同时这里的资料也将标识为过期(expired )。

  Minimum:这是最小默认 TTL 值,如果您在前面没有用“$TTL”来定义,就会以此值为准。

  请注意:SOA 记录中这对 “( ) ”符号之第一个 “(”括号一定要和 SOA 写在同一行,而不能用 Enter 断行到下一行去,而且其左边最好有一个空格键或 tab 建。而最后一个 “)”括号也不能写在注解符号 “;”的右边。 置 DNS 的 RR 记录档,其格式要求非常严格,我们丝毫不能掉以轻心。比方说:如果句子不是以空格键、Tab 键、 或注解符号 ( ;)开头,也不在 SOA 的 “( ) ”之内, 则表示要定义一个“新记录项 (Entry) ”;如果句子是以空格键或 tab 键开始的话,其设置被视为上一个“记录项”的内容。所以,如果您要为“同一个记录项”定义多个记录设置,而不想重复打字,您倒可以偷懒:在接着它的后面几行用空白或 Tab 来缩排就可以了。