Describe linux/rhel 5.7 安装 rabbitmq here.

=== 先安装erlang ===

{{{ yum list|grep curses rpm -ivh ncurses-devel-5.5-24.20060715.x86_64.rpm

wget http://www.erlang.org/download/otp_src_R16B01.tar.gz tar zxf otp_src_R16B01.tar.gz cd otp_src_R16B01 ./configure make && make install

}}} === 安装rabbitmq之前,设置环境变量 === {{{ export TARGET_DIR=/opt/rabbitmq export SBIN_DIR=/opt/rabbitmq/sbin export MAN_DIR=/opt/rabbitmq/man }}}

=== 安装rabbitmq === {{{ rpm ...

more ...

Describe linux/zeromq安装 here.

{{{ apt-get install libtool autoconf automake uuid-dev g++ wget http://download.zeromq.org/zeromq-3.2.3.tar.gz tar zxf zeromq-3.2.3.tar.gz cd zeromq-3.2.3 ./configure --build=sparc-linux make make install

}}}

pyzmq {{{ pip install pyzmq }}} client.py {{{#!highlight python import sys import zmq

Socket to talk to ...

more ...

linux/bash/awk中RS,ORS,FS,OFS区别与联系

学习awk时,一定要记得动手去实践,只有在实践中才能发现问题,以下就我在学习中和实践中的经验,总结一下RS,ORS,FS,OFS的区别和联系。

'''一,RS与ORS'''

1,RS是记录分隔符,默认的分隔符是\n,具体用法看下

  1. [root@krlcgcms01 mytest]# cat test1 / //测试文件 /

  2. 111 222

  3. 333 444
  4. 555 666

2,RS默认分割符\n

  1. [root@krlcgcms01 mytest]# awk '{print $0}' test1 / //awk 'BEGIN{RS="\n"}{print $0}' test1 这二个是一样的 /

  2. 111 222

  3. 333 444
  4. 555 ...
more ...

章节3 课时 42 讲解proc-sysctl

proc 目录,是内存中的数值,没有来源,只是入口,到内存结构中, proc目录下只是一个接口,不可更改,以文件形式存在,

mount -t proc none /aaa

/proc/sys 下文件多数可更改,少数不能改 更改之后马上第一次,但下次启动无效(因为更改的是内存的值),这里只提供入口方法

echo 1 > icmp_echo_ignore_all //使机器不可ping

sysctl -w net.ipv4.icmp_echo_ignore_all=1 //功能同上

cat /proc/sys/net/ipv4/net.ipv4.icmp_echo_ignore_all

1

vi /etc/sysctl.conf

net.ipv4.icmp_echo_ignore_all=1 ...

more ...

章节3 课时 43 讲解modprobe.conf

内核模块加载方法多种 1. kernel kernel.org 下载内核源码make menuconfig demsg | more 1. initrd mkinitrd 制作驱动映象,(启动相关驱动放在initrd或者kernel中) 1. /etc/rc.d/rc.sysinit 驱动的80-90%在这里配置 1. /etc/modprobe.conf 放和启动无关的驱动,生产驱动,网卡驱动 grep modprobe /etc/rc.d/rc.sysinit

 depmod -v |grep bond 查找内核模块 depmond 加载所有内核模块)

 网卡多链路,2块网卡当一块用 /etc/modprobe.conf
 alias ...
more ...

章节3 课时 44 讲解mod-tools

{{{

rpm -qf /sbin/lsmod

module-init-tools-3.3-0.pre3.1.60.el5

rpm -qfl /sbin/lsmod //l 显示该包中的所有文件

lsmod 显示所有模块 加载内核模块 modprobe usb-storage insmod 加载不上就报错 lsmod |grep fat

modprobe vfat 加载vfat,同时加载fat ,vfat 依赖fat modprobe -r vfat 卸载vfat,fat

insmod /lib/modules/2.6.18-194.el5/kernel/fs/vfat/vfat.ko 出错 ...

more ...

章节3 课时 45 讲解devices-file-dd

{{{ 一切皆文件

/proc/xxx /

ls -l 时第一字节 b block型设备文件 c 字符型设备文件 s 网络类型文件 p 管道类型文件 d 目录 - 普通文件

root@x201i:/dev# ls -l /dev/sda /dev/tty1 brw-rw---T 1 root disk 8, 0 Aug 27 08:48 /dev/sda 主设备号8,辅助设备号0 crw-rw 1 root tty 4, 1 Aug 27 08:48 ...

more ...

章节3 课时 46 讲解network-fconfig-ip-route-config

{{{ ifconfig 看不到没有设置IP的网卡 ifconfig eth1 192.168.0.11 ifconfig eth1 down ifconfig eth1 up

ip ad sh = ip address show 命令显示IP地址,功能比ifconfig 强大

ip ad help 帮助 ip ad add 192.168.1.254 dev eth1 添加一个IP ,ifconfig看不到 {{{ root@x201i:/tmp# ip help Usage: ip [ OPTIONS ] OBJECT { COMMAND | help } ip ...

more ...

章节3 课时 47 讲解network-command-troubleshooting

{{{ ping -b 10.20.57.0 //ping广播包 traceroute www.sina.com.cn //看哪里不通 mtr www.sina.com //可以看到经过哪些路由,哪个路由的掉包率

ping www.sina.com.cn dig www.sina.com.cn host www.sina.com.cn nslookup www.sina.com.cn

nslookup

www.sina.com.cn set q=ns //q=a记录 set ...

more ...

章节3 课时 48 讲解dhclient-nmap

{{{ 抓包图形界面 ethercal

文本 tcpdump

nmap -sS -P0 -o 192.168.0.1 nmap -sS -O -P0 192.168.0.254 -p 1-65535 cat /etc/services 应用程序的默认端口说明 cat /etc/protocols internet协议内容

dhclient //dhcp 服务器指定

dhclient -s 192.168.0.1 获取指定服务器指定的IP地址

}}}

more ...