to myself 的分类学习日志

做自己想做的事
posts - 232, comments - 6, trackbacks - 0, articles - 0

置顶随笔

以具体应用驱动原理的学习:

TCP/IP详解(tcpdump命令)
黑客技术
分布式算法
网络游戏开发
防火墙和包过滤技术
搜索引擎
大家比较熟悉使用各种搜索引擎,但是,还有一种更主动和专门的搜索技术:网络爬虫。
网络爬虫,也叫网页爬虫,网络蜘蛛,网络蚂蚁等等
蠕虫病毒
larbin是个基于C++的web爬虫工具,拥有易于操作的界面,不过只能跑在LINUX下,在一台普通PC下larbin每天可以爬5百万个页面(当然啦,需要拥有良好的网络) http://larbin.sourceforge.net/index-eng.html

vc/c++正是采用了GB2312内部码作为汉字的编码方式。计算机处理字符时,当连续处理到两个大与160(或-95~-1)的字节时,就认为这两个字节存放了一个汉字字符。

编程思想

五个I/O模型:
阻塞I/O
非阻塞I/O
I/O复用(select和poll)
信号驱动I/O(SIGIO)
异步I/O


3d虚拟现实(VR) VRML 虚拟仿真软件 OpenGL

网络游戏服务器端编程
3D游戏引擎程序设计
游戏服务端程序员
手把手教你写脚本引擎

Big World的设计架构
崩溃的查找:查看crash、core、日志

Lippman的《Inside of the C++ Object Model》(一个空的C++类默认生成哪些成员函数)

C++名库(著名程序库)(三大库:boost、loki、stlport)

Richard Stevens著作《TCP/IP Illustracted Volume 1,2,3》和《UNIX Network Programming Volume 1,2》
《The Linux Networking Architecture--Design and Implementation of Network Protocols in the Linux Kernel》
《Linux网络体系结构:Linux内核中网络协议的设计与实现》

Andrei Alexandrescu著作《Modern C++ Design》,Loki库
James Coplien,1992年著作《Advanced C++ Programing Style and Idioms》

设计模式,模板,范型编程,XXX设计模式的(典型)实现

MakeFile,Shelll,Perl,Emacs


 《0day安全:软件漏洞分析技术》一书中描述了SPIKE的基本使用方法


《LINUX内核源代码情景分析》

高性能I/O设计模式Reactor和Proactor, 《两种高性能I/O设计模式的比较》
前摄器(Proactor), 反应堆(Reactor)
The asynchronous support is based on the Proactor design pattern.
系统I/O方式可分为阻塞,非阻塞同步和非阻塞异步三类,三种方式中,非阻塞异步模式的扩展性和性能最好。主要是讲了两种IO多路复用模式:Reactor和Proactor,并对它们进行了比较。

并发服务器有三种实现方式,
1,多进程
2,多线程
3,i/o多路复用,select函数在多个描述符中选择被激活的描述符进行操作.

Protocol Buffers - Google's data interchange format
http://code.google.com/p/protobuf/, Protocol Buffers - Google's data interchange format.


重建基础库 核心竞争力

通用程序 Pro*C 系统编程(员) 文件系统 刘 何 亚威 电子管 陈易男

软件安全 处理器芯片 控制(器)/适配器芯片 微芯片 地址总线 端口

安全公司和操作系统开发人员 MCSE+ISA:微软系统及安全工程师 电气工程师

嵌入式Linux系统工程师 软件安全工程师 Linux C程序员 逆向工程师

计算机取证分析领域 木马分析 入侵检测 软件攻击 软件破解

嵌入式:机器人 窃听器(listening) 监视器(monitoring)


未来发展规划:清晰,步骤

目标:技术总监


以技术为导向:C++、Qt、网络编程、数据结构与算法、Linux编程等。
以产品为导向:网络游戏、智能设备、网站(门户、搜索)等。


看书要写笔记
技术书要画架构图、组件图、流程图、时序图

分析、设计


posted @ 2009-03-06 13:40 kongkongzi| 编辑 收藏

2013年9月16日

     摘要:     项目管理的知识体系(Project Management Body of Knowledge,PMBOK),是美国项目管理学会PMI(Project Management Institute)在20世纪70年代末提出的,并于1996、2000、2004年三次修订。在这个知识体系指南中,把项目管理划分为9个知识领域。目录:1. 项目整体管理2. 项目范围管理3. 项目时间...  阅读全文

posted @ 2013-09-16 12:34 kongkongzi 阅读(391) | 评论 (0)编辑 收藏

2013年8月30日


  • opencv
    • The Open Source Computer Vision Library has >2500 algorithms, extensive documentation and sample code for real-time computer vision.
    • libs after compiled
      • opencv_calib3d241.dll       -> Camera calibration and 3D reconstruction
      • opencv_contrib241.dll
      • opencv_core241.dll       -> The Core Functionality
      • opencv_features2d241.dll  -> 2D Features framework
      • opencv_ffmpeg241.dll
      • opencv_flann241.dll
      • opencv_gpu241.dll           -> GPU-Accelerated Computer Vision
      • opencv_highgui241.dll  -> High Level GUI and Media
      • opencv_imgproc241.dll -> Image Processing
      • opencv_legacy241.dll
      • opencv_ml241.dll             -> Machine Learning
      • opencv_nonfree241.dll
      • opencv_objdetect241.dll   -> Object Detection
      • opencv_photo241.dll
      • opencv_stitching241.dll
      • opencv_ts241.dll
      • opencv_video241.dll        -> Video analysis
      • opencv_videostab241.dll
    • Reference
  • ffmpeg
    • FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.
    • libs after compiled
      • avcodec-54.dll  -> FFmpeg encoders and decoders (codecs)
      • avdevice-54.dll
      • avfilter-2.dll
      • avformat-54.dll -> FFmpeg muxers and demuxers (formats)
      • avutil-51.dll       -> FFmpeg utilities
      • pthreadGC2.dll
      • postproc-52.dll
      • swresample-0.dll
      • swscale-2.dll      -> FFmpeg video scaling and pixel format converter
      • xvidcore.dll
    • Reference

posted @ 2013-08-30 17:25 kongkongzi 阅读(420) | 评论 (0)编辑 收藏

2013年8月26日

1.   Overview

RTSP / RTP protocol is composed by the three sub-protocols -- RTSP, RTP and RTCP.

2.   RTSP

The Real Time Streaming Protocol (RTSP) is a network control protocol designed for use in entertainment and communications systems to control streaming media servers. The protocol is used for establishing and controlling media sessions between end points.

RTSP uses TCP to maintain an end-to-end connection.

Presented here are the basic RTSP requests. The default transport layer port number is 554.

OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER.





3.   RTP

The Real-time Transport Protocol (RTP) defines a standardized packet format for delivering audio and video over IP networks.

RTP is used in conjunction with the RTP Control Protocol (RTCP). While RTP carries the media streams (e.g., audio and video), RTCP is used to monitor transmission statistics and quality of service (QoS) and aids synchronization of multiple streams. RTP is originated and received on even port numbers and the associated RTCP communication uses the next higher odd port number.

RTP packet header

bit offset

0-1

2

3

4-7

8

9-15

16-31

0

Version

P

X

CC

M

PT

Sequence Number

32

Timestamp

64

SSRC identifier

96

CSRC identifiers
...

96+32×CC

Profile-specific extension header ID

Extension header length

128+32×CC

Extension header
...

The RTP header has a minimum size of 12 bytes. After the header, optional header extensions may be present. This is followed by the RTP payload, the format of which is determined by the particular class of application. The fields in the header are as follows:

·         Version: (2 bits) Indicates the version of the protocol. Current version is 2.

·         P (Padding): (1 bit) Used to indicate if there are extra padding bytes at the end of the RTP packet. A padding might be used to fill up a block of certain size, for example as required by an encryption algorithm. The last byte of the padding contains the number of padding bytes that were added (including itself).

·         X (Extension): (1 bit) Indicates presence of an Extension header between standard header and payload data. This is application or profile specific.

·         CC (CSRC Count): (4 bits) Contains the number of CSRC identifiers (defined below) that follow the fixed header.

·         M (Marker): (1 bit) Used at the application level and defined by a profile. If it is set, it means that the current data has some special relevance for the application.

·         PT (Payload Type): (7 bits) Indicates the format of the payload and determines its interpretation by the application. This is specified by an RTP profile. For example, see RTP Profile for audio and video conferences with minimal control (RFC 3551).

·         Sequence Number: (16 bits) The sequence number is incremented by one for each RTP data packet sent and is to be used by the receiver to detect packet loss and to restore packet sequence. The RTP does not specify any action on packet loss; it is left to the application to take appropriate action. For example, video applications may play the last known frame in place of the missing frame. According to RFC 3550, the initial value of the sequence number should be random to make known-plaintext attacks on encryption more difficult. RTP provides no guarantee of delivery, but the presence of sequence numbers makes it possible to detect missing packets.

·         Timestamp: (32 bits) Used to enable the receiver to play back the received samples at appropriate intervals. When several media streams are present, the timestamps are independent in each stream, and may not be relied upon for media synchronization. The granularity of the timing is application specific. For example, an audio application that samples data once every 125 µs (8 kHz, a common sample rate in digital telephony) could use that value as its clock resolution. The clock granularity is one of the details that is specified in the RTP profile for an application.

·         SSRC: (32 bits) Synchronization source identifier uniquely identifies the source of a stream. The synchronization sources within the same RTP session will be unique.

·         CSRC: Contributing source IDs enumerate contributing sources to a stream which has been generated from multiple sources.

·         Extension header: (optional) The first 32-bit word contains a profile-specific identifier (16 bits) and a length specifier (16 bits) that indicates the length of the extension (EHL=extension header length) in 32-bit units, excluding the 32 bits of the extension header.

Examples of RTP header:
           0   1    2   3    4    5   6    7   8   9    a   b     c   d   e   f
00h: 80 60 C6 C6 01 49 A5 10 00 00 00 00  00 00 01 BA
10h: 44 14  9C C8 E4 01 00 5F 6B F8 00 00 01 E0 5F 8C

=> 0x80=1000 0000  => Version=10bit, P=0bit, X=0bit, CC=0000bit
=> 0x60=0110 0000  => M=0bit, PT=1100000bit=0x60
=> 0xC6C6=50886dec  => SequenceNumber=50886dec
=> 0x0149A510=21603600dec  => Timestamp=21603600dec
=> 0x00000000  =>  SSRC=0x00
=> 0x000001BA  =>  CSRC=0x01BA


Reference

Ø   RTP Payload Format for H.264 Video

Ø   RTP Payload Format for MPEG-4 Audio/Visual Streams



4.   RTCP

The RTP Control Protocol (RTCP) is a sister protocol of the Real-time Transport Protocol (RTP).

RTCP provides out-of-band statistics and control information for an RTP flow. It partners RTP in the delivery and packaging of multimedia data, but does not transport any media streams itself. Typically RTP will be sent on an even-numbered UDP port, with RTCP messages being sent over the next higher odd-numbered port. The primary function of RTCP is to provide feedback on the quality of service (QoS) in media distribution by periodically sending statistics information to participants in a streaming multimedia session.

RTCP gathers statistics for a media connection and information such as transmitted octet and packet counts, lost packet counts, jitter, and round-trip delay time. An application may use this information to control quality of service parameters, perhaps by limiting flow, or using a different codec.

RTCP distinguishes several types of packets: sender report, receiver report, source description, and bye. In addition, the protocol is extensible and allows application-specific RTCP packets. A standards-based extension of RTCP is the Extended Report packet type introduced by RFC 3611.

附1.   RTSP Interleaved Frame

参考:Real Time Streaming Protocol (RTSP)

rfc2326 10.12 Embedded (Interleaved) Binary Data

Interleaved binary data SHOULD only be used if RTSP is carried over TCP.

Stream data such as RTP packets is encapsulated by an ASCII dollar sign (24 hexadecimal), followed by a one-byte channel identifier, followed by the length of the encapsulated binary data as a binary, two-byte integer in network byte order. The stream data follows immediately afterwards, without a CRLF, but including the upper-layer protocol headers. Each $ block contains exactly one upper-layer protocol data unit, e.g., one RTP packet.

The channel identifier is defined in the Transport header with the interleaved parameter(Section 12.39).

When the transport choice is RTP, RTCP messages are also interleaved by the server over the TCP connection. As a default, RTCP packets are sent on the first available channel higher than the RTP channel. The client MAY explicitly request RTCP packets on another channel. This is done by specifying two channels in the interleaved parameter of the Transport header(Section 12.39).

Example:

SETUP Transport: RTP/AVP/TCP;interleaved=0-1
Then the channel identifier of RTP is 0, 1 for RTCP.



posted @ 2013-08-26 12:09 kongkongzi 阅读(1579) | 评论 (0)编辑 收藏

2013年8月23日



  • 安全防范视频监控联网系统信息传输、交换、控制技术要求  GB/T 28181-2011
    Security and protection video monitoring network system technical specification for information transport, switch and control
    通过GB/T28181-2011标准检测的平台软件: http://www.tcspbj.com/other/Zxtg1.aspx
    安防标准GB/T28181-2011的推广与反思: http://news.cecb2b.com/info/20130325/518666.shtml
    • 下载: http://www.bzko.com/std/192172.html
    • 协议规范A:平台之间
      1. 注册和注销     => 同规范B  => 下级平台向上级平台注册:Register 类型编码,200,中心信令控制服务器编码。
      2. 状态信息报送(保活) => 同规范B
      3. 校时      => 同规范B
      4. 实时视音频点播    => 同规范B
      5. 设备视音频文件检索(录像文件查询)   => 同规范B
      6. 历史视音频的回放(录像回放)   => 同规范B
      7. 视音频文件的下载(录像下载)   => 同规范B
      8. 设备控制         => 同规范B
      9. 设备重启         => 同规范B
      10. 手工录像         => 同规范B
      11. 布撤防            => 同规范B
      12. 设备信息查询  => 同规范B
      13. 设备状态查询  => 同规范B
      14. 报警               => 同规范B
      15. 报警复位        => 同规范B
      16. 语音对讲        => 同规范B
      17. 事件订阅        SUBSCRIBE,  Query -> CmdType: Catalog (Alarm)
      18. 事件通知        NOTIFY,  Notify -> CmdType: Catalog (Alarm)
    • 协议规范B:平台与前端之间
      1. 注册和注销  REGISTER,   Note:   
         Authorization + Capability, algorithm(非对称算法RSA,摘要算法MD5/SHA-1/SHA-256,对称算法DES/3DES/SM1)
         WWW_Authenticate + Asymmetric, nonce + algorithm
         Expires: 0, SIP代理要注销
        => 前端向平台注册:111, DVR; 112,视频服务器; 131,摄像机; 132,网络摄像机(IPC) 
      2. 状态信息报送(保活)                MESSAGE,   Notify -> CmdType: Keepalive
      3. 校时      联网内设备支持基于SIP方式或NTP方式(见RFC 2030)的网络校时功能,标准时间为北京时间。  
        SIP方式: 在注册成功情况下,注册流程的最后一个SIP应答消息200 OK中的Date头域中携带时间信息。
      4. 实时视音频点播(实时视频)  a) INVITE + Subject,   s=Play     c=IN IP4 172.20.16.3    m=video 6000 RTP/AVP 96 98 97  =>  视频流接收者的IP和Port
        b) 200 OK (with SDP),    s=Embedded Net DVR    c=IN IP4 172.24.18.44   m=video 8412 RTP/AVP 96 98  a=sendonly   
            a=username:64010000041110000044  a=password:12345678
        c) ACK
        d) 开始接收视频流
      5. 设备视音频文件检索(录像文件查询)   MESSAGE,   Query -> CmdType: RecordInfo
      6. 历史视音频的回放(录像回放)   INVITE,   s=Playback    c=IN IP4 192.168.14.7   m=video 6000 RTP/AVP 96 98 97  => 视频流接收者的IP和Port
      7. 视音频文件的下载(录像下载)   INVITE,   s=Download  c=IN IP4 172.20.16.3     m=video 6000 RTP/AVP 96 98 97  => 视频流接收者的IP和Port
      8. 设备控制         MESSAGE,  Control -> CmdType: DeviceControl,  PTZCmd
      9. 设备重启         MESSAGE,  Control -> CmdType: DeviceControl, TeleBoot: Boot
      10. 手工录像         MESSAGE,  Control -> CmdType: DeviceControl,  RecordCmd: Record  (StopRecord, 停止手动录像)
      11. 布撤防            MESSAGE,  Control -> CmdType: DeviceControl,  GuardCmd: SetGuard (ResetGuard)
      12. 设备信息查询  MESSAGE,  Query -> CmdType: DeviceInfo
      13. 设备状态查询  MESSAGE,  Query -> CmdType:DeviceStatus
      14. 报警               MESSAGE,  Notify -> CmdType: Alarm (ResetAlarm),  AlarmMethod
      15. 报警复位        MESSAGE,  Control -> CmdType: ResetAlarm, AlarmMethod
      16. 语音对讲        INVITE,   s=Play    c=IN IP4 192.168.14.7     t=0 0    =>  视频流接收者的IP
                                           m=audio 20518 RTP/AVP 8    a=recvonly    a=rtpmap:8 G711/8000/1/8
                                           m=audio 24882 RTP/AVP 8    a=sendonly   a=rtpmap:8 G711/8000/1/8
                             INVITE 200 OK,   s=BroadCast  (BroadCast, 广播; Dialog, 对讲)  c=IN IP4 10.1.1.9   t=0 0
                                           m=audio 20518 RTP/AVP 8    a=recvonly    a=rtpmap:8 G711/8000/1/8
                                           m=audio 24882 RTP/AVP 8    a=sendonly   a=rtpmap:8 G711/8000/1/8
    • 统一编码:
      • 20位:64010000 00 200 0 000001
        • 640100,银川市。 00,基层接入单位编号。
          00,行业编码,社会治安路面接入。
          200,类型编码,中心信令控制服务器编码。
          0,网络标识,为监控报警专网。
          000001,6位,设备、用户序号。 
    • 基于RTP的视音频数据封装
      • 基于RTP的视音频数据PS封装:基于RTP的PS封装首先按照ISO/IEC 13818-1:2000将视音频流封装成PS包,再将PS包以负载
        的方式封装成RTP 包。
      • 基于RTP的视音频基本流封装:该方式直接将视音频数据以负载的方式封装成RTP包。

说明:
1. 该文档规范同时定义了平台内的一些元素,而没有将平台看做一个黑盒整体,有点多余。 但如果有公司想现在实现一个监控平台,可以参考这些元素来实现。

posted @ 2013-08-23 17:31 kongkongzi 阅读(967) | 评论 (0)编辑 收藏

2013年8月1日




     
  • 接口A协议规范:平台之间
    • 定义:
      A.1.1 系统上下线通知  POST /Request_Update_Status   <HTTP_XML EventType=”Request_Update_Status”>
      A.1.2 系统连接保活    POST /KeepAlive    <HTTP_XML EventType=”KeepAlive”>
      A.2 系统资源获取       POST /Request_Resource    <HTTP_XML EventType=”Request_Resource”>
      A.3 历史告警查询       POST /Request_History_Alarm  <HTTP_XML EventType=”Request_History_Alarm”>
      A.4 录像检索             POST /Request_History_Video   <HTTP_XML EventType=”Response_History_Video”>
      A.5 调阅实时视频      INVITE   Content-type: application/SDP   s=-   m=video 13578 RTP/AVP 110    a=rtpmap:110 HIK264/90000
      A.6 语音对讲和广播   INVITE   Content-type: application/SDP   s=-   m=audio 38564 RTP/AVP 8       a=rtpmap:8 PCMA/8000
      A.7 客户端/用户间音视频会话  INVITE  Content-type: application/SDP   s=Sip Call     m=audio 38564 RTP/AVP 8   a=rtpmap:100 H.264/90000
      A.8 云镜控制             MESSAGE   <SIP_XML EventType=”Control_Camera”>
      A.9.1 告警事件订阅    SUBSCRIBE   <SIP_XML EventType=”Subscribe_Alarm”>
      A.9.2 状态事件订阅    SUBSCRIBE   <SIP_XML EventType=”Subscribe_Status”>
      A.9.3 事件通知           NOTIFY   Call-ID: 40107    Content-Length: 0
      A.10 流量查询            MESSAGE   <SIP_XML EventType=”Request_Flow”>
      A.11 录像回放            RTSP:  OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, GET_PARAMETER, OPTIONS, PAUSE, ANNOUNCE
  • 接口B协议规范:平台与前端之间
    • SIP MESSAGE 通过消息体中的某个字段的值来区分 <=> HTTP POST 通过消息头中的URI的值来区分,例如:
      B.1 注册                  REGISTER
      B.2 资源上报            NOTIFY      <SIP_XML EventType=Push_Resourse>
      B.3 资源信息获取      MESSAGE  <SIP_XML EventType=Request_Resource>
      B.4 历史告警查询      MESSAGE  <SIP_XML EventType="Request_History_Alarm">
      B.5 录像检索            MESSAGE  <SIP_XML EventType="Request_History_Video">
      B.6 调阅实时视频     INVITE       m=video 13578 RTP/AVP 100   a=rtpmap:100 HIK-H.264/90000
      B.7 语音对讲和广播  INVITE       m=audio 38564 RTP/AVP 8      a=rtpmap:8 PCMA/8000
      B.8 云镜控制            MESSAGE  <SIP_XML EventType="Control_Camera">
      B.9.1 告警事件订阅   SUBSCRIBE <SIP_XML EventType="Subscribe_Status">
      B.9.2 状态事件订阅   SUBSCRIBE <SIP_XML EventType="Subscribe_Status">
      B.9.3 告警事件通知   NOTIFY       <SIP_XML EventType="Notify_Alarm">
      B.9.4 状态事件通知   NOTIFY       <SIP_XML EventType="Notify_Status">
      B.10 录像回放          RTSP:  OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, GET_PARAMETER, OPTIONS, PAUSE, ANNOUNCE


posted @ 2013-08-01 16:17 kongkongzi 阅读(613) | 评论 (0)编辑 收藏

2011年11月8日

抓包
tcpdump -i eth1 -w platgate.pcap tcp port 6001 and dst 192.168.5.232
Wireshark
smsniff
Ethereal

posted @ 2011-11-08 15:23 kongkongzi 阅读(289) | 评论 (0)编辑 收藏

2010年5月20日

  如果你有一定的英语基础,并希望突破计算机英语的障碍并成为高手,从现在起就养成一个学用计算机英语的良好习惯吧。 

1、 给自己起一个英文名字。并用作网名和登录名。
2、 选一本适合自己的计算机英语教材。
3、 保证一年至少读1-2本原版影印的计算机书,并坚持读完。
4、 上网尽量多访问英文的技术论坛和网站,不使用汉化的帮助。
5、 在程序中使用英文注释,坚决不用中文或汉语拼音作变量名、字段名、文件和文件夹名。
6、 每月至少看1-2部原版电影(VCD/DVD),尽量不看字幕,提高语感和听力。
7、 不看中英文对照读物,但可以看注释读物;多使用英英字典,少使用英汉字典。
8、 每天坚持记录和复习遇到的生词,对于缩略语,一定搞清每个字母的英文含义。

posted @ 2010-05-20 17:29 kongkongzi| 编辑 收藏

2010年5月6日

lsof -i:<port>
ps 
-Lf <pid> 可以查看进程的线程数

查看自己的外网ip(公网ip)
方法一: wget http://whatismyip.org
         cat index.html 
方法二: curl http://whatismyip.org

netstat -anp|grep 7898 |sort -rnk2 |head -n 5 
Netstat –ano|findstr “
<端口号>”,
tasklist|findstr “
<PID>

同时修改日期时间,注意要加双引号,日期与时间之间有一空格,输入:date -s "2010-07-20 16:30:00"
修改完后,记得输入:clock -w 
把系统时间写入CMOS 

减少shell窗口开启的个数:
& 将指令丢到后台中去执行
[ctrl]+z 將前台任务丟到后台中暂停
jobs 查看后台的工作状态
fg %jobnumber 将后台的任务拿到前台来处理
bg %jobnumber 将任务放到后台中去处理
kill 管理后台的任务.

硬链接(Hard Link)
硬链接说白了是一个指针,指向文件索引节点,系统并不为它重新分配inode。
可以用:ln命令来建立硬链接。
引用
ln [options] existingfile newfile
ln [options] existingfile
-list directory

用法:
第一种为”existingfile”创建硬链接,文件名为”newfile”。
第二种在”directory”目录中,为” existingfile
-list”中包含的所有文件创建一个同名的硬链接。
常用可选[options]:
-f 无论”newfile”存在与否,都创建链接。-n 如果”newfile”已存在,就不创建链接。

软链接(Soft 
Link)
软链接又叫符号链接,这个文件包含了另一个文件的路径名。可以是任意文件或目录,可以链接不同文件系统的文件。和win下的快捷方式差不多。
可以用:ln 
-s 命令来建立软链接。
引用
ln 
-s existingfile newfile
ln 
-s existingfile-list directory

ls -> out.file 2>&1 &
解释
:
ls 
-> out.file //将ls的输出重定向到文件out.file
2>&1 //在shell中,文件描述符通常是:STDIN,STDOUT,STDERR,:0,1,2,由此可以看出,它将ls -> out.file在输出过程中产生的错误信息也放在了STDOUT,:1中.
最后的
& ,不用说,是放在后台运行.

nohup ssh root@192.168.0.175 'cmd' > /dev/null 2>&1 &

posted @ 2010-05-06 16:46 kongkongzi| 编辑 收藏

2009年9月15日

在Linux下删除文件行末尾的^M符号方法:
在Vim中解决这个问题,很简单,在Vim中利用替换功能就可以将“
^M”都干掉,键入如下替换命令行:
:
%s/^M//g
注意:上述命令行中的“^M”符,不是“^”再加上“M”,而是由“Ctrl+v”、“Ctrl+M”键生成的

posted @ 2009-09-15 17:19 kongkongzi| 编辑 收藏

scp -P port ip:/data/filename  . 

posted @ 2009-09-15 17:11 kongkongzi| 编辑 收藏