In doing some Android automation scripts, such as the mobile phone QQ input Chinese chat content, due to the use of Robotium, Appium and other tools to do, because of TX signed verification, so log on QQ. Later only use the most stupid monkeyrunner
Using the shell to combine awk is a good way to tell if a process is running or if a program file is being executed, as an example of PHP.
Define a crontab, execute every minute, the time interval is one minute, possibly next time executes, the
Shell Script
Just do it, simply write a Shell script and it's done!
Script Name: Web site dead chain generation script
Script function: Daily analysis of the site the day before the Nginx log, and then extract the status code of 404 and UA for
The Shell is basically a command interpreter, similar to a DOS command. It receives user commands (such as LS, and so on), and then invokes the appropriate application. The more common shell has the standard Bourne shell (SH) and C shell (CSH).Many
The basic syntax for BASH• The simplest example--hello world www.111cn.net!
• about input, output, and error output
The bash of variables in the Chinese language (and the similarities and differences between C languages)
The basic Process Control
If you are an IT person accustomed to a Windows command prompt, you will feel overwhelmed when you first use the Linux command line. You are familiar with DOS commands that are basically non-existent in Linux. In front of you is a lot of orders to
This example mainly realizes the function that VB calls the external EXE program to run, this is mainly uses the Shell function to execute, the shell function is mainly used to open an external exe executable file, for example, in sub module: Shell "
The Shell function returns the value, generally has 3 kinds of ways: Return,argv,echo
1) Return statementThe return value of the Shell function, as in other languages, can be returned through the return statement.Example:
The process used by git in a team project
1. First from a git remote repository to the clone project to the local
git clone warehouse Address
2. Create a development Branch
Normally we write code that does not write on the master
Head Command Chinese Introduction:
Usage: head [options] ... [File] ...
Displays the first 10 lines of each specified file to standard output.
if more than one file is specified, the filename is given as the file header before each segment
The shell may often see: >/dev/null 2>&1
The result of the command can be defined as the output in the form of%>
/dev/null represents empty device files
> represents where to redirect, for example: echo "123" >/home/123.txt
1 indicates stdout
MyCommand >mylog.txt 2>&1 should be the most classic usage.
The result of the command can be directed output in the form of "%>",% representing the file descriptor: 1 is standard output stdout, 2 is standard error stderr. The system default% value
Sometimes you write scripts with errors that are listed like headings, mostly because your script files are edited under Windows. Windows, the end of each line is \n\r, and in Linux under the end of the file is \ n, then you edit the file in Windows
Since SSH can execute remote command, the FTP software is also gradually less used.
Every time the server code is updated, all want to pack, upload, login to the server to modify file permissions, update Cache, and so on, slow and error prone, so
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 comparison is relatively cumbersome, and the former we can set the host name, IP information,
Shell Script of Linux Basics
1 Shell sciptA program written in the instruction and basic program design structure to complete a complex process
1.1 Program Writing
Copy Code code as follows:
#!/bin/bash
# program:
# This
Description: Everyone at ordinary times to Linux server security is mainly to the system user inspection, landing server IP check, as well as firewall status check!
1. You need to store the correct system username in
In order to prevent the server from being subjected to SSH brute force hack, will attempt ssh brute force hack this machine more than 10 times of IP to seal off, prohibit its landing this machine!#!/bin/bashCat/var/log/secure |awk '/failed/{print $ (
Awk was finally able to get started, so he tidied up the article, mostly from the Internet.First, bash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays. In the shell, the array is
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.