#!/bin/sh #本脚本为守护进程, , automatic restart process Function check_and_kill_and_start () {log_file=$1 If a process zombie is found
Name=$2 dead_duration=$3 # echo "check the progress " $ps _name ymd=$ (date +%Y-%m-%d) Log_file=${log_file}${ymd}.log
Infiltration using OPENROWSET to engage the shell
Get the SQL injection point, the first thought is backup Webshell, throw in NB run a lap, found that blocked the SQL error messages, not the physical path, that also wrote a PP horse.
Associated with
Requirements Analysis:
1, SSH Public key copy, provide no password management.
2, batch synchronization hosts files to more than one host.
3. Batch modification of host name.
Realize:
First edit a Hosts file for synchronization to multiple
Objective
Now every time you analyze the site log, you need to judge Baidu Spider is not the real spider, nslookup after the need to determine whether the results include "Baidu" string
Here are some of the methods that are included in the
It hasn't been updated in a long time.Think you should continue reading the script.
#14 Formatting Long Lines
#!/bin/sh
# A version of FMT, using Nroff. Adds Two useful flags:-W X for line width
# and-h to enable hyphenation for
It is common to repeat a series of commands while running a script, when we need to use a loop statement to do this.
One, for command
Format: for variable in list;
Circulation body
Done
The for command traverses each value in the list and exits
Function Description: Tell the shell to remove the eval parameters, recalculate the contents of the parameters.Syntax: eval [parameters]Supplemental Note: Eval can read a series of parameters and then perform them according to the characteristics of
Use here documentation
Copy Code code as follows:
#!/bin/sh
FTP-IVN 210.29.28.124 User Yun yun2011
Lcd/home/veyun
Cd/home/veyun/yhb
Get V
Bye
Eof
Explain:
-I: Turns off interactive prompts during multiple file transfers, so
Binary comparison operator, comparing variables or comparing numbers. Note the difference between numbers and strings.
Integer Comparisons
-eq equals, such as: if ["$a"-eq "$b"]
-ne is not equal to, such as: if ["$a"-ne "$b"]
-GT is greater than,
Ctrl + a switches to command line start
Ctrl + e Switch to the end of the command line
Ctrl + L Clear Screen contents
Ctrl + U Clear the contents before the clipping cursor
Ctrl + K-cut to clear the contents after the cursor
Ctrl + y Copy the
1 matching names with Pgrep
Copy Code code as follows:
if test $ (pgrep-f $ | wc-l)-EQ 0
Then
echo "process does not exist"
Else
echo "Existence process"
Fi
The following are supplementary content:Processes in the
Copy Code code as follows:
#!/bin/bash
#This the script is Usage for describle CPU Hard memery Utilization
Total=0
Idle=0
System=0
User=0
Nice=0
Mem=0
Vmexec=/usr/bin/vmstat
Which SAR >/dev/null 2>&1
If [$?-ne 0]
Then
Ver= '
In Java,python, you can use the import method to make calls between scripts or modules, for example:
Copy Code code as follows:
>>> Import Math
>>> Math.sqrt (4)
2.0
How do you invoke other shell scripts in the shell, or
This article mainly introduces the "shell judge string is a number", mainly related to the shell to determine whether the string is a digital content, for the shell to determine whether the number of figures interested students can refer to.
#!
A question about how to automatically delete a specified file after it is larger than 1GB.The batch code is as follows:
Copy Code code as follows:
#!/bin/bash
# when the/var/log/syslog is greater than 1GB
# automatically back it up and
Port forwarding under Windows is typically a self-contained NAT and Porttunnel, Portmap
Linux Lower port forwarding mapping program called RINETD, boot method rinetd-c/etc/rinetd.conf, Pkill rinetd shutdown process
Tools Home:
The LS command is used to display which files and folders are in the directoryLsBlue indicates folder White is fileLs-r List the contents of all folders (R = recursive)Ls-l View details including file permissions last modified time size (L for
1 First Test "/etc/vsftpd", "/etc/hosts" is the directory, and through the "$?" Variable view returns a status value to determine the test result.[Email protected] ~]# [-d/etc/vsftpd][[email protected] ~]# echo $?1[[email protected] ~]#
Two methods
Start a new shell and execute the shell scripts.
Shell scripts at the moment.
The scripts that brings up another shell will be added to the front of the scripts file. #! /bin/shThe first approach is to point out
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