1. Use of time-related random numbers
Generate output Unixtimestamp (%s) and current time nanosecond data (%N, accurate to one-seconds) using the data command. )
The former ensures that the output does not repeat in different seconds, and that the
Uninstall and remove the WScript component
Wscript.Shell can invoke the system kernel to run DOS basic commands, which is harmful to system security. We're going to uninstall and remove the component to prevent this kind of trojan from
Learn to use shell analysis log only one morning!!!
Many places to share the log analysis of the shell script, but basically did not say the specific meaning of each command, learning cost is very high, summed up here, to facilitate the quick start.
A note earlier, just recorded two lines of code, put out the words is also a low quality page, so set up in order to only be visible, tonight to add.
Remember when the scene should be submitted sitemap when Baidu old hint of the wrong URL, cause
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,
Copy Code code as follows:
#!/bin/bash
function Pinghost {
Ping $1-c 1-w |grep rtt|cut-d "/"-f6
}
Tmp_fifofile= "/tmp/$.fifo" # script runs the current process ID number as filename
Mkfifo $tmp _fifofile # Create a new random FIFO pipeline
#!/bin/sh #测试各种字符串比较操作. #shell中对变量的值添加单引号, the difference between the hot quotes and the not added: it is irrelevant to the type, that is, not adding quotes into the string type, #单引号不对相关量进行替换, if the $ symbol is not interpreted as a variable
One of my colleagues once asked me this question: how do I delete all files in the directory except some files under Linux? At the time, I told him that he could solve it by pattern matching. But in fact, besides, there are other methods, which are
In the scripting process, the input of parameters is usually involved. For example, SH 1.sh 10 20, in the execution 1.sh this script, 10 is the first parameter, 20 is the second parameter. Sometimes, there is this confusion, that is, how many
UsageParameter 1, write the text that needs to replace the path record, format: Old path old name new path new nameParameter 2, directory of files that need to be replacedParameter 3, type of file that needs to be replaced
Copy Code code as
The Linux terminal executes to delete the invalid link file.
Copy Code code as follows:
#!/bin/sh
Usage (){echo "Removebroken 0.1, a shell script to remove broken link files."echo "License:mit, (c) Chenzhiqiang"echo "Usage:"echo "$--
A shell script, what is its command parameter?First, shell scripting and scripting like Python can use parameters as well;Secondly, the shell parameters are divided into positional parameters and internal parameters;Where, positional parameter: is
Note: Do not plan to use root user directly to run Node.js service! This will lead to an unpredictable security issue!However, using port 80 as the HTTP default port is a habit that has lasted since the age of Ms. People on the Internet talk about
Check to see if the remote port is open to bash:
Copy Code code as follows:
echo >/dev/tcp/8.8.8.8/53 && echo "Open"
To get a process into the background:
Copy Code code as follows:
Ctrl + Z
To move a
Now in order to save money, I used a shell script, simply write a monitoring. By Curl a fixed page of 200 status code, if it is 200, said the site is normal, if not 200 automatically restart the site, and then send mail to QQ mailbox. QQ on their
Recently, in order to do a weather forecast project, need to download some weather icons from Yahoo, but because of more than 80 icons. The icons are stored on the Yahoo image site.
Thunder does not support HTTPS downloads, although it can be
Recently, just need to test the stability of the new station, so write a shell script to the local (recently changed MAC), to real-time view you need to monitor the status of the Web page, and sent to the designated mailbox.
Here's a compliment. OS
All executed scripts need root identity to execute: Execute the command as root: Bash xxx.sh
Function: Automatic detection system and update sourceApplicable system version: compatible with all Linux versions on lineHow to: Execute a command as
Nagios is an open source free network monitoring tool, can effectively monitor Windows, Linux and UNIX host State, switch routers and other network settings, printers and so on. When the system or service status is abnormal, send an email or SMS
Once run, the warehouse on the Gitolite server can be backed up to the local. The first run creates a local mirror of the remote warehouse, which updates the local mirror each time it runs.
This program only supports SSH mode
Other GIT servers do
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