[Stick to the top] install some software required for Linux (continuously updated)

Source: Internet
Author: User
Tags ocaml
2011-9-21 Lrzsz

A convenient upload and download tool. In xshell, you can directly pull the file to the terminal when transferring the file to our Linux virtual machine, or enter the command RZ on the terminal, in the dialog box that appears, select a file. Similarly, enter the sz file name on the Virtual Machine terminal to send the file to the local machine.

On centos, you can simply install it through Yum install lrzsz.

The source code installation is also very simple.

 


Unison If we are used to operating on a virtual machine, we know that a folder can be shared between the local machine and the virtual machine as a folder that can be operated simultaneously by both the host and virtual machine, but in many cases, the company will provide a server, we do not need to waste a lot of memory and CPU to open a virtual machine separately, you can directly write on the serverCode, ExecuteProgramBut it does not have the advantage of using a powerful editor locally. If you need to edit the file locally and upload it to the server to compile the file, is there a better way? Just like dealing with our virtual machines, can files be modified and automatically updated on both sides? Unison came into being.

About unison
Unison is a file synchronization tool that can be used in windows, Linux, and other UNIX platforms. It can ensure consistency between the two folders (local or online. Unison has the same features as some other synchronization tools or file systems, but also has its own features:
1. cross-platform use;
2. There are no special requirements on kernel and user permissions;
3. the unison function is bidirectional. It can automatically process the parts without conflict in the two-minute copy. The conflicting parts will be displayed so that the user can choose to update the policy;
4. as long as the two hosts can be connected, you can run unison. You can directly use socket connection or Secure SSH connection, which does not require high bandwidth, use a compression transfer protocol similar to rsync.


Unison installation:
Various unison versions:
Http://www.seas.upenn.edu /~ Bcpierce/unison // download.html
Unison Compiler:
Http://caml.inria.fr/pub/distrib

My installation script is as follows:Wget http://caml.inria.fr/pub/distrib/ocaml-3.12/ocaml-3.12.1.tar.gz
Tar-zxf ocaml-3.11.1.tar.gz
CD ocaml-3.11.1
./Configure
Make World OPT
Make install

Wget http://www.seas.upenn.edu /~ Bcpierce/unison // download/releases/stable/unison-2.40.63.tar.gz
Tar-zxf unison-2.27.157.tar.gz
CD unison-2.27.157
Make uistyle = text
Make install

If an error occurs in make install or make, the prompt etags: Command not found is displayed. You can directly execute the following command:
Chmod 0755 unison
CP unison/usr/bin/
It does not affect usage.

Unison Configuration
Unison can be run directly through the command line or through the configuration file.
The configuration file format is as follows:
<textarea readonly name="code" class="cpp"># Unison preferences file for SV <br/> root = E: \ cartoon_mmo \ trunk \ Server <br/> root = socket: // 192.168.20.7: 4456 // root/work/SV <br/> batch = true <br/> ignore = path *. SVN <br/> ignore = Name *. O <br/> ignore = Name *. so <br/> ignore = Name *. A <br/> ignore = path bin <br/> repeat = 1</textarea>
Notes for configuration files: 1. # Start with a comment line. 2. In option configuration similar to ignore = path bin, spaces on both sides of equal sign "=" cannot be ignored.
The two root accounts here are the two directories to be synchronized. the second root is connected through SSH or socket. However, in this way, the remote machine needs to install unison and start the socket listening port.
Server startup command: unison-socket NNNN
NNNN indicates the port number.

direct command:
unison/Data SSH: // root@10.0.0.1 // data-batch-repeat = 1
indicates local/data directory synchronization and/data directory 10.0.0.1.-Batch indicates automatic confirmation (you do not need to manually press enter to confirm ), repeat = 1 indicates that the task is not executed every second.
Similarly, the socket synchronization method is as follows:
Unison is installed on the server. Run the following command: unison. -Socket 4455
Unison is installed locally. Run: unison/Data socket: // 10.0.0.1 // data-batch-repeat = 1
.

Unison options:
Force indicates that the directory is synchronized to the remote end based on the folder specified locally. Note that if the force parameter is specified, unison becomes a single synchronization item, that is, it will be synchronized Based on the folder specified by force, similar to rsync.
The basic principle of Unison bidirectional synchronization is: if there are two folders A and B, folder a synchronizes its changes to B, and folder B also synchronizes its changes to, the last two folders A and B share the same content, which is a collection of AB folders.
One disadvantage of two-way unison synchronization is that unison Will not synchronize a file when it is modified in both the synchronization folders, because unison cannot determine which one prevails.
Ignore = path indicates that the specified directory is ignored, that is, it is not synchronized during synchronization.
Batch = true, indicating full automatic mode. Accept the default action and execute it.
-Fastcheck true indicates that only the file creation time is used for synchronization. If the option is false, unison compares the content of files in two locations.
Log = true indicates that the running information is output on the terminal.
Logfile specifies the output log file.

In addition, unison has many parameters. Here we only introduce several common parameters. For details, see the unison manual.
-Auto // accept the default action and wait for the user to confirm whether the action is executed.
-Batch // batch mode. It is fully automated. It accepts the default action and executes it.
-Ignore XXX // Add XXX to the ignore list
-Ignorecase [true | false | default] // whether to ignore case sensitivity of file names
-Follow XXX // whether synchronization of the symbolic link pointing content is supported
Owner = true // The file owner that maintains Synchronization
Group = true // keep the synchronized file group information
Perms =-1 // retain the read and write permissions of the synchronized files
Repeat = 1 // start a new synchronization check after 1 second interval
Retry = 3 // retry upon failure
Sshargs =-C // use the SSH compression transmission mode
Xferbycopying = true"
-Immutable XXX // unchanged Directory, which can be ignored during scanning
-Silent // quiet mode
-Times // synchronous modification time
-Path XXX parameter // synchronize only the subdirectories and Files specified by the-path parameter, instead of the entire directory.-path can appear multiple times.

PS: the unison configuration file in Windows is in the C: \ Documents ents and Settings \ currentuser \. unison directory by default. The default configuration file name is default. PRF.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.