< training | fifth day > by building nfs,ftp to realize shared files with Vim scripting game

Source: Internet
Author: User
Tags python script

First thing to say: I do not update this series of tutorials this weekend, but other content will be updated, I will organize this week's various contents of the weekend to my public number, to provide to you!

long-awaited Linux operations, Oracle "training course" finally started, Small series from the long-term 4.5 months of Linux operation and maintenance, Oracle training, every day I will study hard, evening back I will try to update the tutorial, including today learned what knowledge points, Using what method, what tools are used, where tools are shared and so on, and strive to make every interested in the old driver can learn a little extra knowledge in their leisure time, that day you will use a little!

Thank you for your support, I would like to say two sentences, the first four or five days of training, you may learn the basis of knowledge, but also hope that people look at the two eyes, pointing out; no one follows me from the basics, but don't take it for granted that it's simple, and you're going to have more problems than you think when you actually do it. Some of you can easily solve, but there are some problems I believe not everyone can quickly solve, so the knowledge of this thing is a step by step accumulation, thank you for your support!

I'm here to make sure that over the next few days, you'll be able to learn a lot and very useful knowledge about Linux, Oracle, cloud computing!

The fifth day of the classes:

  Main content outline:

    1. abandon NetworkManager
    2. Install LFTP, use terminal commands to download the shared file
    3. < Span style= "FONT-SIZE:16PX;" > build NFS to share resource sharing between client and server
    4. < Span style= "FONT-SIZE:16PX;" > Set the default startup entry for Vim
    5. vim display
    6. The script running in vim--Jinshan typing pass

Detailed Explanation:

    • Abandon NetworkManager

  Do not know if you have ever heard of Linux one of the big pits is networkmanager, because Networkmanger and network is incompatible, as a maintenance engineer you certainly do not want to give the network card to NetworkManager, So we're going to close it.

① Close Networkmanagere Service  

[Email protected]~ #service NetworkManager Stop

② set NetworkManager boot does not start,

[Email protected]~ #chkconfig Networkmanger off

③ to network, edit the network card information,

[Email protected]~ #vim/etc/sysconfig/network-scripts/ifcfg-eth0

④ the Nm_controlled=yes and changed it to No.

  

⑤ also want to say is, as a maintenance engineer, even if the Ifcfg-eth0 deleted, you also have the ability to allow the machine to reconnect the Internet, so you have to remember the information in the configuration file, the main: DEVICE, TYPE, Onboot, IPAddr, NETMASK, GATEWAY , Bootpror.

    • Install LFTP, use terminal commands to download shared files

  LFTP is a remote connection FTP tool in the terminal, very convenient. Here I will teach you how to upload and download files using LFTP. The installation configuration of FTP will be explained in detail in future tutorials.

① first installed, using:

[Email protected]~#yuminstall lftp-y

② after installation, directly use:lftp IP address , access. If the other party has a password, you can use the lftp root: Password IP address .

③ then you can use the LS and other commands, view, upload using put, download using get. Note: in which folder you run the lftp command, the file you downloaded is in which directory.

  

    • Build NFS for resource sharing between client and server

  NFS server is a very common file sharing service, divided into the client and the service side, here I use the local as an example to demonstrate.

  1. Service Side

① Create a directory that you want to share. Hypothesis: mkdir share. Also assume that the server IP is: 192.168.30.1, the client IP is 192.168.30.2

② Open the configuration file, Vim/etc/exports, add a line inside:/share * (RO).

③/share represents shared directory, * (RO) represents shared to all IPs in read-only mode. You can also change the * to client IP.

④ need to do now is to shut down their firewalls, iptables and SELinux. The iptables can be set to power on without booting and off, and is set to: Service Iptables stop,chkconfig iptables off. To turn off SELinux, use the command: Setenforce 0. At the same time change the configuration file Vim/etc/selinux/config, enforcing changed to permissive.

  

  2, the Client

  ① first look at which folder the server shared, using: Showmount-e 192.168.30.1. You can see that it shares the/share folder.

② now we need to mount the/share folder to a local directory using: Mount 192.168.30.1:/share/mnt. /MNT represents the directory where files are temporarily mounted.

③ can now download the file using the CP command, which is actually a copy.

④ Here you can view the directories we have mounted by using the DF command. After the copy is good, because it is temporary mount, so to uninstall, use the command: UMOUNT/MNT, so that the successful implementation of the file sharing.

    • Set the default startup entry for VIM

  We usually open vim when, very humble, may not be particularly good-looking, then how we set up to let our vim more refreshing, good-looking? Enter in the shell:vim ~/.VIMRC, we add some content to it after opening.

  

The first two rows of content is necessary to have, the line means not to be compatible with VI, the second line is supported by the encoding, the rest is to write on their own. I posted my own configuration, not a lot, enough on the line. This is my setting and it is also the effect after setting.

  

    • Sub-screen display in Vim

  If we open a vim, want to modify another vim, but do not want to close this, what to do, split screen can be resolved.

Open a vim, and then enter directly: VSP Another file directory, VSP represents portrait, SP represents portrait.

  

The effect is as follows:

  

  

    • Run in Vim script--Jinshan typing Pass 

Vim this tool, simple to listen to simple, say complex, need your long-term practice, how to make your Linux system of any files to become the object of your practice, here I introduce a Python script, you open a file with Vim, you can take it as the practice of the vim operation of the object. How to achieve it? First get to this script. Reply Typegame get.

Then we create a new directory in the shell: Mkdir-p ~/.vim/plugin, move the CP file you acquired to the newly created folder. Then you can practice it. Use VIM to open a file. Enter in the following: Toggletype, you can enter into the practice mode, I enter the insertion mode, start, there is a display of your speed and other information. Very convenient, usually nothing can be practiced vim operation, typing and so on.

  

Summarize:  

Update is not particularly fast, these days to learn the things are preparatory, so a lot of people have learned, but I promise that after the foundation, is what you want to learn.

I hope you can focus on my blog park, I will be updated every day for about 4.5 months, you learned from the simple to the depth, will not let you down!

Blog Park : Love family love wife of it male

QQ Group : 145252709, I will upload resources, and there will be many great gods to discuss with you to learn to share

Public number : Program Ape's Wild Banana "get the tools that appear in the article"

< training | fifth day > by building nfs,ftp to realize shared files with Vim scripting game

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.