To have a holiday, today is really idle egg pain, originally just want to write a configuration iptables script, did not expect to be so complicated by their own, or to share out to everyone, interested can change their own.PS: This script only
in a production environment, it is possible that other administrators or users may modify Hosts.allow to allow more IP landing machines; In order to facilitate unified management, we can modify the Allow and deny files to the default settings when
in industrial applications, some files from industrial equipment will be placed in the specified directory, as these files need to be reformatted before being processed by higher-level software. At this point the processing of the script is
The specific script content is as follows:
The code is as follows
Copy Code
$ vim/home/rainbow/sbin/block_attack_ips.sh #!/bin/bash Logfile=/webserver/blog/logs/rainbow_access.log function Check_root () {If [$EUID-ne 0];
Day Fifth: Functions and task scheduling
Advantages of the function
Divide and conquer F
Work together
Easy Management
Easy Maintenance
Structure of the function
function functions name ()
{
Command 1
Command 2
Command 3
}
Parameter
One, single branch if statement
Format: if judge condition; then
Statement1
statement2 ...
Fi
Two, two-branched if statement
Format: if judgment condition; Then
Statement1
statement2 ...
else
statementn
...
Fi
Use a
I have a limited memory, the usual Linux encountered in the project to share the common commands to everyone.
Linux Common commands complete http://www.jb51.net/linux/
^m exists in Linux filesThe use of shell command TR can be achieved by removing
1 Ensure that you are in the home directory (if not, run: cd/home)2 New Backup folder (command: mkdir backup)3) New Script backup.shVI backup.sh
Copy the following code (after replication: wq! to save):
Copy Code code as follows:
#!/bin/
Each line that the Shell reads from standard input or script is called a pipe (pipeline); it contains one or more commands (commands) that are separated by one or more pipe characters (|).
In fact, there are many special symbols that can be used to
1, backup_run.sh
Copy Code code as follows:
#!/bin/sh
# Backup_run
# script to run the backups
# loads in a setting file for the ' user to ' change
Source=/home/bob/backup.defaults
Check_source ()
{
# Check_source
# Can we load
Nothing recently, I wrote a code statistics gadget based on SVN in bash. You can specify a catalog of statistics, and the default recursive statistics subdirectory.
Currently, there is no capability to mask the specified directory. The code is
First, debug scripts
Debugging is one of the important features that every programming language should implement, and when something unexpected happens, use it to generate the running information of the script, and the debugging information can
ZshThe Mac system comes with zsh, which is generally not the latest version, and can be installed by Homebrew if requiredBrew Install Zshzsh --versionversion of Zsh can be viewed by commandUse echo $ZSH_VERSION the command to view the ZSH version
Previous JMeter Bean shell Use (a) a brief introduction of the bean shell in the next jmeter, this article is a supplement to the above, mainly summarizes the common scenarios and methods, I believe these basic can cover most of the needs. This
Bash's built-in string processing tool:String slices:${var:offset:number}Takes a substring of a string;Take the rightmost few characters of the string: ${var:-length}Note: There must be a white space character after the colon;To take a substring
4. Bash 's variables4.1 user-defined variables4.1.1 What is a variableA variable is a memory unit of a computer where the stored value can be changed. When a shell script needs to save some information, such as a file name or a number, it is stored
1. Shell Overview1.1 Shell Introduction(1) The shell is a command-line interpreter that provides users with an interface system-level program that sends a request to the Linux kernel to run the program, allowing the user to start, suspend, stop, or
16. File Lookup Command find:Here's a sample of the main applications for the Find command:/> Ls-l#列出当前目录下所包含的测试文件-rw-r--r--. 1 root root 48217 Nov 00:57 Install.log-rw-r--r--. 1 root root Panax notoginseng 00:56 testfile.dat-rw-r--r--. 1 root root 1
There are two ways to represent logic in bash:(1) [$state = = "Running"-a $name = = "Zone1"](2) [[$state = = "Running" && $name = = "Zone1"]]The second type is supported in Ksh.Instance:#! /bin/-P "pelease input your name:"-P "pleaase Input your
Let's give you a detailed analysis of the Illustrator software.Tutorial sharing:In the Ai software, create a 800*800 document, select the elliptical tool, and draw an elliptical image, as shown in the figure. Then, select the pen tool, check the
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