Conditional judgment of Shell script
1. Basic grammar
[condition] (note that there should be spaces before and after the condition) Note: if the condition is not empty, it is true, [666] returns true and [] returns false.
2. Common judgment conditions
(1) Comparison between two integers = string comparison -lt less than -le less than or equal -eq equals (equal) -gt greater than ...
Posted by phpIsKillingMe on Sun, 05 Dec 2021 18:34:49 -0800
02 architecture 12 firewall
iptables firewall
Application scenario
1.Host firewall
2.Internal sharing and Internet access
3.Port and ip mapping
iptables workflow
1.Rule matching is performed from top to bottom
2.As long as it matches up, it doesn't match down
3.If no explicit rules are matched, the default rules will be matched (all are allowed by default and can be ...
Posted by mikeblaszczec on Fri, 03 Dec 2021 19:23:35 -0800
Implementation of mysql architecture cache in redis server environment
Build an instance based on memcache:
web(php) host: 192.168.181.6
redis host: 192.168.181.5
mysql host: 192.168.181.4
First, close the firewall of the three hosts
systemctl stop firewalld
systemctl disable firewalld
sed -i 's/enforcing/disabled/'/etc/selinux/config
setenforce 0
Synchronization time
yum -y install ntp ntpdate
ntpdat ...
Posted by True`Logic on Sun, 28 Nov 2021 17:09:09 -0800
Perfectionist Win10 installation guide
The original text is published in github and updated from time to timeAfter computer is too laggy, it will become very stuck. All kinds of files will be out of order. Therefore, it is an important link to improve work efficiency and fun to develop good use habits and reinstall the system regularly. However, the personal files on the computer an ...
Posted by doobster on Tue, 23 Nov 2021 17:08:52 -0800
Build gray publishing environment
Teach you to build a gray publishing environment
Tip: gray release, also known as Canary release, Canary release
The term comes from the tradition of coal miners bringing caged canaries into the mine. Miners know the concentration of carbon monoxide in the mine through canary. If the concentration of carbon monoxide is too high, Canary wil ...
Posted by hamboy on Fri, 19 Nov 2021 08:29:27 -0800
minimatch source code analysis
minimatch source code analysis
text
0. Basic information
version: v3.0.4Functions: brace expansion, glob expression matching, globstar extension (* *)Npm Repository: https://www.npmjs.com/package/minimatch
1. Source code analysis
minimatch still has a lot of content, mainly the reproduction of Bash's glob parsing based on js, and learn ...
Posted by NeverPool on Wed, 17 Nov 2021 06:25:29 -0800
Linux User & User Group Management
1. Users & User Groups
Linux is a multi-user and multi-task operating system. The Linux system supports multiple users to log on at the same time. Different users can perform different tasks within their permissions without affecting each other.
Corresponding relationships between users and user groups:
One-to-one: A user can exist in a ...
Posted by Takuma on Fri, 12 Nov 2021 13:18:45 -0800
cat ~/.bash_history | grep java view linux history command
Query the recently executed Java command cat ~/.bash_history | grep java
7. history command
The history command is used to display the commands executed in history. The format is "history [-c]".
The history command should be the author's favorite command. Executing the history command can display the last 1000 command records execu ...
Posted by Darrel on Wed, 10 Nov 2021 03:17:03 -0800
Linux basic command learning notes
dpkg -- deb series software package management system
#List the software packages in the current system
dpkg -l
#Install package
dpkg -i packageName.deb
#Uninstall package (keep profile)
dpkg -r packageName
#Uninstall package (delete profile)
dpkg -P packageName
#Lists the contents of the specified installed packages
dpkg -L packageName
#Repor ...
Posted by slobodnium on Mon, 08 Nov 2021 11:32:55 -0800
Function and script debugging method in shell
1. Function format
Objective: to turn some opposed codes into functions, provide readability and reusability, and avoid writing the same code repeatedly.Function format:
Function keyword: function can be omitted without any parameters;The symbol {indicates the beginning of the function body (a separate line after the function name can be us ...
Posted by Boom.dk on Sat, 06 Nov 2021 09:41:52 -0700