But shell scripts are readable and writable, and are likely to reveal sensitive information, such as user name, password, path, IP, and so on.
Similarly, sensitive information is leaked when the shell script is run.
SHC is a tool for encrypting
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
#!/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
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
Today, I saw an article with a shell script and a makefile that would automatically download all of the required packages and compile GCC:
The code is as follows
Copy Code
$ # Download the scripts using wget.$
The shell itself cannot be multi-threaded, but it can simulate multithreading by starting the subprocess and putting the child processes into the background, in order to increase the efficiency of the script while not significantly increasing the
When using a virtual host before, look at the Web site run log, found a lot of abnormal malicious access. At that time because they do not have the system permissions can not be able to screen these actions. Now have their own cloud host, front-end
Change the contents of the file in each line in the 20140321_files.txt file to Action_begin,Sed-i "s/action/action_begin/g" ' Cat 20140321_files.txt '
Replace the file contents tags in 20140321_files.txt with tags.phpSed-i "s/tags/tags.php/g" ' ls 2
A few days ago I talked to a few colleagues about a problem: How do you pass an array to the inside of awk for processing in a shell script?
No way was found at that time. Two days ago in the QQ group to discuss awk, the conversation inadvertently
This article briefly describes how to use the Linux command –du, you need friends can refer to.
Du (disk usage)
Feature Description: Displays the size of the directory or file.
syntax:du [-abcdhhklmssx][-l ][-x
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
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] ~]#
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
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 script is as follows:#! /Bin/bash# Nginx access log segmentation shell script# Log DirectoryLog_dir = "/usr/local/nginx/logs /"Cd $ log_dirTime = 'date + % Y % m % d -- date = "-1 day "'# Log Retention daysSave_days = 15# Location where the log
Nginx log access. log is not separated, and access records are always recorded in this file. For a long time, log query and file system are not good, so segmentation is required.Vim/data/scripts/cut_nginx_log.sh #! /Bin/bash# Auto-run this
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