& Lt; practical training | day 5 & gt; share files via NFS and FTP with Vim script game and nfsvim

Source: Internet
Author: User
Tags ftp connection

<Practical training | day 5> shared files through NFS and FTP are attached with Vim script games and nfsvim

Let me talk about this first thing: I did not update this series of tutorials on weekends, but other content will be updated. On weekends, I will sort out all the content of this week to my public account, provided to you!

The long-awaited linux O & M and oracle training courses have finally started,Starting from four and a half months of linux O & M and oracle training, I will study hard during the day. I will try to update the Tutorial at night, including what I learned today and how I used it, what tools are used, where tools are shared, and so on, so that every old driver who is interested can learn a little extra knowledge in his spare time, maybe you used it a little on that day!

 

Thank you for your support. I would like to say a few words here. During the first four or five days of practical training, you may have learned the basics of knowledge. I also hope that people will take a look and give me some advice; no one will follow me to learn from the basics, but everyone should not take it for granted as simple. In actual operations, the problems you encounter far exceed your imagination, you can solve some problems easily, but I believe that not everyone can solve them quickly. Therefore, knowledge and other things are accumulated step by step. Thank you for your support!

 

I promise that you will be able to learn a lot about linux, oracle, and cloud computing in the next few days!

 

 

 

Day 5:

  Main Content outline:

Detailed explanation:

  • Discard NetworkManager

  I wonder if you have heard of one of linux's major pitfalls: NetworkManager. As NetworkManger and network are incompatible, you certainly do not want to give the network adapter to NetworkManager as an O & M engineer, so we need to close it.

① Disable the NetworkManagere Service

root@localhost~#service NetworkManager stop

 

② Set NetworkManager not to start upon startup,

root@localhost~#chkconfig NetworkManger off

 

③ Since the network is handed over, edit the NIC information,

 

root@localhost~#vim /etc/sysconfig/network-scripts/ifcfg-eth0

 

④ Change NM_CONTROLLED = yes to no.

  

⑤ Also want to say is, as an O & M engineer, even if the ifcfg-eth0 is deleted, you also have the ability to re-connect the machine to the Internet, so you have to remember is the configuration file information, the main: DEVICE, TYPE, ONBOOT, IPADDR, NETMASK, GATEWAY, and BOOTPROR.

  • Install lftp and use terminal commands to download shared files

  Lftp is a remote ftp connection tool in the terminal, which is quite convenient. Here I will teach you how to use lftp to upload and download files. I will explain the ftp installation configuration in a later tutorial.

① First install and use:

root@localhsot~#yum install lftp -y

 

② After installation, directly use:Lftp IP Address. If the other party has a password, you can useLftp root: Password IP Address.

③ You can run ls and other commands to check whether put is used for uploading and get is used for downloading. Note: The lftp command you run in the folder where the downloaded file is located.

  

  • Establish NFS to share resources between the client and the server

  NFS server is a very common file sharing service, which can be divided into clients and servers. Here I will use a local instance for demonstration.

  1. Server

① Create a directory that you want to share. Suppose: mkdir share. Assume that the server ip address is 192.168.30.1 and the client ip address is 192.168.30.2.

② Open the configuration file, vim/etc/exports, and add a line in it:/share * (ro ).

③/Share indicates the shared directory. * (ro) indicates that all ip addresses are shared in read-only mode. At the same time, you can replace * with the client ip address.

④ Now, you need to disable your firewall, iptables, and selinux. Iptables can be set to disable or disable startup. The setting method is service iptables stop and chkconfig iptables off. Disable selinux and run the following command: setenforce 0. Change the configuration file vim/etc/selinux/config and enforcing to permissive.

  

  2. Client

  ① First, check the folder shared by the server, and use: showmount-e 192.168.30.1. You can see that it shares the/share folder.

② Now we need to mount the/share folder to the local directory and use: mount 192.168.30.1:/share/mnt. /Mnt indicates the directory where files are mounted temporarily.

③ Now you can use the cp command to download the file, which is actually a copy.

④ Here we can use the df command to view the Mounted Directories. After the file is copied, You Need To unmount it because it is a temporary mount. Run the command umount/mnt to share the file.

  • Set the default startup Item of vim

  When we open vim, it is very simple and may not be very nice. So how can we make our vim more fresh and nice through settings? In shell, enter:Vim ~ /. VimrcAnd then add some content to it.

  

The content in the first two rows is mandatory. The first line means that the content is not compatible with vi, the second line is supported encoding, and the rest is written by yourself. I have posted my own configurations. I don't need a lot of them. I just need to use them. This is my setting, and it is also the effect after setting.

  

  • Split-screen display in vim

  If we want to modify another vim when opening a vim, but do not want to disable it, what should we do? Split the screen to solve the problem.

Open a vim file and enter the following file directory: vsp and vertical. vsp indicates vertical, and sp indicates vertical.

  

The effect is as follows:

  

  

  • Script running in vim -- Kingsoft typing 

Vim is a simple tool. It is complicated and requires long-term practice. How can we make any file in your linux system the object of your practice, here I will introduce a python script. You can use vim to open a file and take it as an object for practicing vim operations. How can this problem be achieved? Obtain the script first. Reply to typegame for obtaining.

Then we will create a new directory in shell: mkdir-p ~ /. Vim/plugin to move the obtained file cp to the newly created folder. Then you can practice. Use vim to open a file. Enter ToggleType below to enter the exercise mode. I will enter the insert mode and start, with information such as your speed displayed. It is very convenient. You can practice vim operations and typing normally.

  

Summary:  

The update is not very fast. Many people have learned the course in the past few days, but I promise that after the preparatory course, it is what you want to learn.

 

I hope you will keep an eye on my blog. I will update it every day for about four and a half months. What you have learned will not disappoint you!

 

Blog: IT male who loves his family and his wife

 

QQ Group: 145252709. I will upload resources, and many great gods will discuss and share with you.

 

Public Account: Wild bananas of programmers [get the tools that appear in the 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.