To ensure that the PHP page runs in the background, write a monitoring script, assuming that the program exits unexpectedly, you can automatically restart.
Shell Script/usr/local/scripts/receve.sh content:
#!/bin/bash
#funtion: Keep
The content of this section:Keep the specified number of files remaining under the file system
Example:
Copy Code code as follows:
#!/bin/bash
#-------------------------------
#Description: Back Up your files
#site: Www.jb51.net
#--
Copy Code code as follows:
#include
#include
#include
#include
int main (int argc,char **argv)
{
int mode;
int Mode_u;
int mode_g;
int mode_o;
Char *path;
if (argc{
printf ("%s \n", argv[0]);;
Exit (0);
}
Use the shell to quickly generate a sitemap map file in XML format, which is suitable for small and medium sized websites. In this case, a sitemap file with 12,053 URLs is generated and only spents 4.3 seconds! The shell code is as follows:
Copy
Method 1:
Copy Code code as follows:
For file in ' ls '; Do MV $file $file. txt; Done
Method 2:
Copy Code code as follows:
Find. -type f |xargs-i mv {} {}.txt
There are some unsuccessful trials,
On the internet to see this single flow of the script, very good.
Copy Code code as follows:
#!/bin/sh
Usage () {
echo "Usage: $ [i INTERFACE] [-S INTERVAL] [-C COUNT]"
Echo
echo "-I INTERFACE"
echo "The interface to monitor, and
Sometimes when we process and view files, there are often a lot of empty lines, in order to be beautiful or need, it is necessary to remove these lines, the following methods:
1) with the TR command
Copy Code code as follows:
Cat
As a Linux SA, many parts of the day-to-day operation of the script, and the server's IP is generally static IP or Mac binding, of course, the latter is relatively cumbersome to operate, and the former we can set the host name, IP information,
1. Judging variables
Copy Code code as follows:
Read-p "Input a word:" Word
if [!-n "$word"]; then
echo "You have not input a word!"
Else
echo "The word you are $word"
Fi
2. Judging input parameters
Copy
There are a lot of ways, and here are three ways to write:
Writing a:
Copy Code code as follows:
#!/bin/bash
While Read line
Todo
Echo $line
Done
Writing two:
Copy Code code as follows:
#!/bin/bash
Cat
Because of the study of PHP, I also installed a XAMPP integrated environment package under Linux. But every time you start to enter the terminal, and then point Open/opt/lampp/, then sudo to perform manager-linux-x64.run operation, to open the XAMPP
Today on the Internet to see a web connection average time of the shell command, in their own machine tried, found that can not use, incredibly appear awk:fatal:division by zero attempted such a mistake, Mao's own changed the shell command.
Today, my company colleagues to my entire ADSL automatic redial shell, and detect whether connected to, so as to ensure that the internal test server does not drop the net, OK, I sent the script below.
System: CentOS 5.x
Script 1:
Copy Code
This article describes the Gearman::xs in CentOS under the compiler installation method, for everyone to learn about!
At present Gearman can support a variety of languages, its official website description is as follows:
Language
Each process will have a PID, and each PID will have a corresponding directory under the/proc directory, which is the implementation of Linux (current kernel 2.6) system.General backdoor procedures, in the PS and other processes to see the tool can
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