The command line

CMD seconds into the specified directory

Inefficient operation

Win +r, enter CMD, then jump to the specified directory

 

Insert a picture description here

SAO operation

Enter CMD in the folder address bar. The CMD window is displayed and the specified directory is displayed

 

Insert a picture description here

 

 

Insert a picture description here

SSH and SCP commands

SSH: log in from one machine to another machine SCP: Transfer files from one machine to another machine

You can use the SSH command to log in using a password, but it is still cumbersome. You are advised to configure public key access. Check whether you have generated a public key file before. If not, you need to manually generate one

Windows: In Windows, check whether the id_rsa, id_rsa.pub files exist in drive C > User > User name >.ssh

MAC: in /Users/${own user name}/.ssh folder

Ssh-keygen -t rsa -c "[email protected]" -t Specifies the key type, which is RSA by default. You can omit the -c comment text, such as youremail addressCopy the code

The directory containing id_rsa (private key) and id_rsa.pub (public key) has been generated.

Win10 PowerShell, Linux, Mac is able to directly use these 2 commands, but Win7 does not support

To log in, add the public key to the ~/.ssh/authorized_keys file on the Linux server

The SSH command format is as follows. The port number is 22 by default

SSH -p < port > < username >@<IP address >Copy the code

If the local user name is the same as the remote user name, even the user name can be omitted

# hadoop1 SSH hadoop@hadoop1 # Hadoop2 SSH hadoop2Copy the code

The SCP command format is as follows. The default value is 22

SCP -p < port > <filename> < username >@<IP address >:< destination directory >Copy the code

If you’ve ever been in a cluster, such as a Hadoop cluster, you’ll know that these two commands are a great way to quickly switch between servers and distribute environment variables and configurations.

Of course, it is also useful in real development, if you want to upload your JAR packages to the test environment. You can submit the code to GitLab and have Jenkins publish it automatically or manually.

However, my habit is to test myself before submitting the code, so I usually run the script manually to upload the JAR package to the server

Win the script

deploy.bat

call mvn clean package -DskipTests=true cd ./build/libsscp demo.jar username@ip:/opt/application/ cd .. /.. / @pauseCopy the code

Command line tool

I use Xshell on Win and SecurtCRT on MAC (no Xshell on MAC, really hurt).

 

Insert a picture description here

 

 

Insert a picture description here

SecurtCRT has a super easy to use function, select that copy, right click that paste, and then use Ctrl+C and Ctrl+V. Xshell also supports this functionality, but you need to set up a wave

Tools -> Options

 

Insert a picture description here

Right-click to paste content, and select Automatically copy the selected text to the clipboard

 

Insert a picture description here

At this point, select that copy, right click that paste, super convenient

Xshell executes the same command in multiple Windows

Executing commands in a cluster makes it easy to check view -> Write -> Write

 

Insert a picture description here

In the sidebar below, select all sessions, and commands executed in the sidebar will be executed on all tabs that are currently open

 

Bold style

Alias various commands

It works on both Linux and Mac

You can define an alias for Linux commands that you often use but that are too long (for example, entering a deep project deployment directory)

Alias defined at the system level

All users can use this alias

For example, if you want to use SSH to switch to server 21, configure the alias

echo "alias go21='ssh mosh@21'">>/etc/profile
source /etc/profile
Copy the code

If you’re not comfortable with this, just open the /etc/profile file and add alias go21=’ SSH mosh@21 ‘to the file. In this case, just execute go21 and don’t forget source, and you can jump directly to the server 21. You can also configure an alias like the following

Alias tozo = 'CD/root/zookeeper - 3.4.12 / bin'Copy the code

The tozo command goes directly to the /root/zookeeper-3.4.12/bin directory.

An alias defined at the user level

Only the current user can use this file, but the configuration file is different from /etc/profile to ~/.bash_profile

echo "alias go21='ssh mosh@21'">>~/.bash_profile
source /etc/profile
Copy the code

JSON

Browser formats display JSON

Format and display JSON in Chrome with various plugins such as JSONView. However, the jSON-Handle I have used is the best one. The page is beautiful and you can edit and copy on the right side of the browser, which is really cool.

 


 

Edit JSON Format JSON

Recommend 2 websites I use most, the most obvious feature is powerful, no advertising

Web site:jsoneditoronline.org/

When writing interface documents, I often need to edit JSON, and the one I use most often is json Editor Online

 

JSON is easy to write, and the format is validated in real time, showing crosses to the left when errors occur. Of course, you can also format JSON with this tool, but the appearance level is not too high.

Web site:codebeautify.org/jsonviewer

 

Insert a picture description here

It’s a super powerful site, just take a look and see how powerful it is. You think, you don’t think, it has

All kinds of file format conversion all kinds of picture format conversion all kinds of file verification, comparison…

 

Insert a picture description here

Postman

There is a Chrome plugin, but you are advised to download one, and many people use only a fraction of postman’s functionality

Save the interface export as a file

Postman has login function. It is suggested to put a Collection for each project, indicating the function of each interface, so that the account can be sent to the test after self-testing, and the test does not need to reconstruct request parameters by itself. Or export your Collection to a file for someone else to import

 

In addition, the requested URL should be written to support multi-environment switching. Because the domain name of the development environment and the test environment are different, but the subsequent request path is the same.

Multi-environment Configuration

 

It can be seen that I have configured three environments now. Switch the environment and click the drop-down box to select it. Click the configuration button at the back to configure the environment

 

 

 

 

Insert a picture description here

Base_url was used in the previous request path and is equivalent to a key, and this configuration is equivalent to a map

Test login interface

Nowadays, many enterprises login users based on cookies and sessions, testing some need to login interface. I saw one of my colleagues do it earlier, and, seriously, it really showed me

  1. First log in to the system and get the cookie value from the request head of the interface
  2. Paste the value of this cookie into the header of the Postman request
  3. Send request test interface

I’ll send you a picture, you can probably think of the position

 

Insert a picture description here

SAO operation

In Postman, all you have to do is ask for the login interface first, and the cookie will be automatically added to the interface after the request, so you don’t have to paste the header every time. You don’t have to click on the login interface again until the cookie expires, just keep testing

 

Insert a picture description here

As long as a website has set a cookie, subsequent requests will automatically carry the set cookie, the browser is the same, postman, do not need to manually paste

drawing

ProcessOn

Website: www.processon.com/

Chinese development of online drawing procedures, the renderings are as follows

 

Insert a picture description here

drawio

Website: www.draw.io/

This is an online drawing program developed by foreigners

 

Insert a picture description here


Xmind

Website: www.xmind.cn

A commonly used mind mapping tool

 

markdown

Typora

One of the most visually advanced Markdown editors, this may be a bit of a shock for beginners, as it shows the effects in real time while editing the page. It’s good to get used to it, but it can’t be saved to the cloud server

 

Impression of notes

A very well-known software, left to write, right preview. Can be saved to the cloud server, support multi-terminal. Markdown, mind mapping are supported, but they have to be expensive to use

 

 

 

Insert a picture description here

code

Share code with pictures

Address: carbon. Now. Sh /

 

Insert a picture description here

The main purpose of this is to export the code as an image, which is easy to distribute to multiple platforms, so that the format of the image is not messy border, font and style can be adjusted (I usually remove both border and style, so that the code looks bigger).

 

Insert a picture description here

Use web pages to share code

Address: paste.ubuntu.com/

Sometimes when I want others to see the code, I send it to them through chat tools, and the format will be messy, so I usually post the code on the web page for others to see

 

Insert a picture description here

Data structures and algorithms

Cattle from

Website: www.nowcoder.com/

There is nothing wrong with visiting this website

 

Insert a picture description here

LeetCode

Address: leetcode-cn.com/

On this website you can find all kinds of algorithmic questions that you have encountered during the interview process, and they are the original ones

 

Insert a picture description here

Other useful websites

Love course

Address: www.icourse163.org/

I used to watch it when I was in school, and many universities have it in open courses

 

Insert a picture description here

Stack Overflow

Address: stackoverflow.com/

Many of the problems encountered are well explained

 

Insert a picture description here

Redis command reference

Address: redisdoc.com/

Redis’s various commands are explained in super detail, with lots of demos

 

Insert a picture description here

The lab building

Website: www.shiyanlou.com/

Learn Linux and Git, etc., with the experimental floor can not be too cool, online to provide you with the environment and test questions, is to let you practice

 

Insert a picture description here

Java knowledge sharing network

Website: www.java1234.com/

 

Insert a picture description here

Many books are available as PDF downloads

Linux command

Address: man.linuxde.net/

 

Insert a picture description here

Other utility tools

Leak check

This is used in many enterprises to manage the code quality. Many inelegant writing methods in the code can be checked out. It can be integrated with gitLab and strongly recommended to use it

Website: www.sonarqube.org/

 

Insert a picture description here

API Management Tools

API management tools I have used include Wiki, Wordfinch, Yapi, Swagger

 

Insert a picture description here

Wiki is a text tool. Yapi is an open source project to manage apis. Swagger writes comments directly in code and then exports documentation.

 

 

Insert a picture description here

I think whisperer and Swagger are better. The Language Sparrow supports Markdown syntax, and the page is nice.

Swagger is friendly to the front end and easy to debug, and the back end does not need to write interface documentation, but it is somewhat intrusive to the back end code, in fact, I think it is also ok.

If swagger open source version request entry is in form form, I can write swagger annotation (for writing annotation) and Spring MVC annotation (for requesting mapping), but our infrastructure group rewrote Spring MVC parameter parser, only need to use one annotation, support annotation, request mapping, Invalid parameters return JSON message, do not need to manually verify, super convenient. At the same time, Swagger is integrated into the company’s single sign-on, test sign-on interface is also very convenient.