Command Line
CMD enters the specified directory in seconds
Inefficient operation
win+r, enter cmd, and then jump to the specified directory
Insert picture description here
Sao operation
Enter cmd in the folder address bar, the cmd window will pop up and enter the specified directory at the same time
Insert picture description here
Insert picture description here
SSH and SCP commands
ssh: log in from one machine to another
scp: transfer files from one machine to another
Although the ssh command can log in with a password, it is still more troublesome. It is recommended to configure public key access.
First, see if you have generated the public key file before, if not, you need to generate it manually
windows: check [c drive -> user -> own user name ->.ssh] under windows to see if there are id_rsa, id_rsa.pub files
mac: under the /Users/${own user name}/.ssh folder
ssh-keygen -t rsa -C "[email protected]"
-t 指定密钥类型,默认即 rsa ,可以省略-C 设置注释文字,比如你的邮箱,可以省略
Then press Enter all the way. If you want to set a password, you can set it yourself. If successful, the above directory has been generated, including id_rsa (private key), id_rsa.pub (public key)
These two commands can be used directly in PowerShell, Linux and Mac of win10, but win7 does not support
Append the public key to the file ~/.ssh/authorized_keys on the Linux server to log in with the public key
The format of the ssh command is as follows, the port may not be specified, the default is 22
ssh -p <端口> <用户名>@<IP地址>
If the local user name is the same as the remote user name, even the user name can be omitted
# 登陆到hadoop1服务器
ssh hadoop@hadoop1
# hadoop用户,从hadoop1服务器登陆到hadoop2服务器
ssh hadoop2
The scp command format is as follows, the port may not be specified, the default is 22
scp -P <端口> <filename> <用户名>@<IP地址>:<目标目录>
If you have set up a cluster, such as a hadoop cluster, you will find that these two commands are simply artifacts. Not only can you quickly switch between servers, but also distribute environment variables and distribute various configurations super convenient.
Of course, it is also very useful in actual development, if you want to transfer your jar package to the test environment. You can submit the code to gitlab first, and then let jenkins publish it automatically, or publish it manually.
But my habit is to submit the code after the self-test is completed, so I usually run the script manually to upload the jar package to the server
win script
deploy.bat
call mvn clean package -DskipTests=true
cd ./build/libsscp demo.jar username@ip:/opt/application/
cd ../../
@pause
Command line tool
I use Xshell on win and SecurtCRT on mac (no Xshell on mac, it hurts)
Insert picture description here
Insert picture description here
SecurtCRT has a super easy-to-use function, select it to copy, right-click to paste, no longer need Ctrl+C and Ctrl+V. Although Xshell also supports this feature, it still needs to be set up
Tools -> Options
Insert picture description here
Set right-click to paste content, check the option to automatically copy the selected text to the clipboard
Insert picture description here
At this time, select to copy, right-click to paste, super convenient
Xshell executes the same command in multiple windows
It is very convenient to execute commands in the cluster.
Check View->Compose->Compose column
Insert picture description here
In the compose bar below, select all sessions, the commands executed in the compose bar will be executed on all tab pages currently open
Bold style
Aliasing various commands
Can be used under Linux and Mac
There are some Linux commands that we often use, but some of these commands are particularly long (such as entering a particularly deep-level project deployment directory), then you can define an alias for these commands
Alias defined at the system level
All users can use this alias
For example, if you want to jump to the 21 server directly through ssh, first configure the alias
echo "alias go21='ssh mosh@21'">>/etc/profile
source /etc/profile
If you are not used to this usage, just open the /etc/profile file and append the line alias go21='ssh mosh@21' to the file. At this time, just execute go21, don’t forget the source, and you can jump directly On the 21st server, you can also configure an alias as follows
alias tozo='cd /root/zookeeper-3.4.12/bin'
Such a tozo command directly enters the /root/zookeeper-3.4.12/bin directory, is it super fast?
User level defined alias
Only the current user can use it, but the configuration file is different, changed from /etc/profile to ~/.bash_profile
echo "alias go21='ssh mosh@21'">>~/.bash_profile
source /etc/profile
JSON
Browser format display JSON
There are various plug-ins for formatting and displaying json in the chrome browser, such as JSONView. But the best thing I have used is JSON-Handle. The page is beautiful, and the right side of the browser can be edited and copied, which is very cool.
Edit JSON format JSON
Recommend 2 websites that I use the most, the most obvious feature is powerful, no ads
Website: https://jsoneditoronline.org/
When writing interface documents, I often edit json, and the most commonly used one is JSON Editor Online
It is very convenient to write JSON, and the format is verified in real time. When there is an error, a cross is displayed on the left. Of course, you can also use this tool to format JSON, and the value should not be too high.
Website: https://codebeautify.org/jsonviewer
Insert picture description here
This is a super powerful website. As for how powerful it is, you can just open it and see. What you think of, what you didn’t think of, it has
Various file format conversion
Various picture format conversion
Various file verification, comparison
...
Insert picture description here
Postman
There is a chrome plug-in, but it is recommended that you download a software, and many people only use a few functions of postman
Save interface export to file
Postman has a login function. It is recommended to put a collection in a project, and indicate the function of each interface, so that the account can be tested after the self-test, and the test does not need to reconstruct the request parameters. Or export your collection to a file and let others import it
In addition, the requested URL should be written to support multi-environment switching. Because the domain names of the development environment and the test environment are different, but the subsequent request path remains unchanged.
Multi-environment configuration
You can see that I have configured 3 environments now, switch the environment and click the drop-down box to select it, and click the configuration button behind to configure the environment
Insert picture description here
base_url is used in the previous request path, which is equivalent to a key, and this configuration is equivalent to a map
Test login interface
Nowadays, user logins of many companies are based on cookies and sessions. When testing certain interfaces that require login. I saw how my colleague did it before. Seriously, it really showed me
- Log in to the system first and get the cookie value from the request head of the interface
- Paste the value of this cookie into the header of the postman request
- Send request test interface
I send a picture, you can probably think of the posture
Insert picture description here
Sao operation
In postman, you only need to request the login interface first, and the cookie will be automatically added to the subsequent request interface, so you don't need to stick the header every time. You don’t need to log in to the interface again before the cookie expires, just keep testing.
Insert picture description here
As long as a website has set a cookie, subsequent requests will automatically bring the set cookie. This is the case for the browser, and so does the postman. You don’t need to manually stick it yourself.
Drawing
ProcessOn
Website: https://www.processon.com/
The online drawing program developed by the Chinese, the renderings are as follows
Insert picture description here
drawio
Website: https://www.draw.io/
The online drawing program developed by foreigners, the renderings are as follows
Insert picture description here
Xmind
Website: https://www.xmind.cn
A commonly used mind mapping tool
markdown
Typora
One of the most beautiful markdown editors may not be used by people who just started using it, because the effect is displayed in real time on the editing page. It’s good to get used to it, but the hurt is that it can’t be saved to the cloud server
Evernote
A well-known software, write text on the left and preview on the right. It can be saved to a cloud server and supports multiple terminals. Both markdown and mind maps are supported, but it is inevitable to charge money if you want to use it
Insert picture description here
Code
Share code with pictures
Website: https://carbon.now.sh/
Insert picture description here
This is mainly to export the code as a picture, which is convenient for distributing to multiple platforms, saving the formatting
. The border, font and style of the picture can be adjusted (I usually remove the border and style so that the code looks bigger)
Insert picture description here
Share code with webpage
Website: https://paste.ubuntu.com/
Sometimes when I want others to read the code, use a chat tool to post it, the format will be messy, so I usually post the code on the web page for others to view
Insert picture description here
Data structure and algorithm
Niuke
Website: https://www.nowcoder.com/
There is nothing wrong with seeing the face on this website
Insert picture description here
LeetCode
Website: https://leetcode-cn.com/
On this website you can find all kinds of algorithm questions you encountered during the interview, and they are the original questions
Insert picture description here
Other useful websites
Love course
Address: https://www.icourse163.org/
I often watch it when I am in school. Many universities have open classes
Insert picture description here
Stack Overflow
Website: https://stackoverflow.com/
Many problems encountered are explained clearly
Insert picture description here
Redis command reference
Website: http://redisdoc.com/
The various commands of Redis are explained in super detail, with a large number of demos
Insert picture description here
Laboratory building
Website: https://www.shiyanlou.com/
To learn Linux and Git, etc., it is not too cool to use the laboratory building. The online environment and test questions are provided for you to practice
Insert picture description here
Java Knowledge Sharing Network
Website: http://www.java1234.com/
Insert picture description here
Many pdfs of books can be downloaded
Linux commands
Website: https://man.linuxde.net/
Insert picture description here
Other useful tools
Vulnerability check
This is used in many companies to manage code quality. Many inelegant writing in the code can be checked out. It
can be integrated with gitlab. It is strongly recommended to use
Website: https://www.sonarqube.org/
Insert picture description here
API management tools
API management tools I have used are wiki, Yuque, Yapi, Swagger
Insert picture description here
Wiki, Yuque is a text tool. Yapi is an open source project for API management. Swagger writes comments directly in the code and then exports the document.
Insert picture description here
I think Yuque and swagger are better. Yuque supports markdown syntax, and the page is very beautiful.
Swagger is very friendly to the front-end, easy to debug, and there is no need to write interface documentation for the back-end, but it is intrusive to the back-end code. In fact, I think it's okay.
If the swagger open source version request input is in the form of a form, I can write swagger annotations (used to write annotations) and Spring MVC annotations (used to request mapping), but our infrastructure team has rewritten the Spring MVC parameter parser , Only need to use one annotation, support annotation, request mapping, return json prompt if parameter is invalid, no need to manually verify, super convenient. At the same time, swagger is integrated with the company's single sign-on, and it is very convenient to test the login interface.