Shell Foundation (6): position parameter and case branch

Position parameter sign $0: script file absolute Lujin $1-9: position parameter mark less than 10 ${10..}: position parameter marker greater than 10 $×: total number of parameters $*: expand to a list of location parameters starting at 1. When it's enclosed in double quotes When it gets up, it expands into a stri ...

Posted by eatadi on Mon, 06 Jan 2020 01:51:07 -0800

String to get started with Python

The string to get started with Python 1. The concept and creation of strings 1. The concept of string *In programs, text content is represented as a string *Strings are composed of a series of ordered characters, such as:'helloworld' *Strings and lists, tuples, are of sequence type' *You can think of strings as lists of characters, and many op ...

Posted by jamey on Sun, 05 Jan 2020 22:54:33 -0800

saltstack automatic deployment nginx (source compilation)

Automatic deployment of nginx source code through saltstack Experimental topology Node name IP function server1 172.25.21.1 salt-server server3 172.25.21.3 Salt minion, nginx server The basic configuration of each node will not be described in detail. See my blog for details Saltstack automation manageme ...

Posted by rahulroy on Sun, 05 Jan 2020 21:19:22 -0800

NOIP 1999 Missile Interception

Title Description: A country has developed a missile interception system in order to defend itself against enemy missile attacks.However, this missile interception system has one drawback: although its first shell can reach any height, each subsequent shell cannot be higher than the previous one.One day, the radar caught the e ...

Posted by MsShelle on Sun, 05 Jan 2020 14:54:16 -0800

Using python code to intercept ddos Attacks

Recently, the company's servers have been attacked by a large number of requests, and the other side constantly requests to visit the web site. It takes up the broadband of the server, which makes it inaccessible to ordinary users. Headache, so I studied for a day, wrote a script with python, extracted a large number of reques ...

Posted by MikeNye on Fri, 03 Jan 2020 22:37:00 -0800

18 19 20 py if statement comparison operator assertions

The fourth lesson Conditional statement( if,else and elif) # coding:utf-8 python The language is defined by indented code blocks # Conditional statements (if, else, and elif) ''' if logic_expression: statement1 statement2 statement3 ... ... statementn elif logic_expression: statement1 statement2 ... ... ...

Posted by berbbrown on Fri, 03 Jan 2020 16:59:05 -0800

Alibaba 2018 front end evaluation questions (Promise asynchronous process control)

Use Promise to control the asynchronous process. The three asynchronous tasks may be in the order of time, but they should be output in the desired order. I use four methods to solve this problem. In fact, I want to examine your understanding of Promise, the basic problem. //Realization mergePromise Function to execute the ar ...

Posted by eosinophil on Fri, 03 Jan 2020 12:15:57 -0800

shell script exercises

Exercise questions: Write shell script to calculate the sum of 1-100; Write a shell script, ask to input a number, and then calculate the sum from 1 to the input number. If the input number is less than 1, input again until the correct number is input; Write shell script, copy all directories (only one level) under / root / ...

Posted by tilde on Thu, 02 Jan 2020 21:34:21 -0800

Create or delete users in batch under Linux.

Batch create users: 1. Create the list file users.txt of user name, one line for each user. [root@linuxprobe ~]# vim users.txt andy barry carl duke eric ergou Next, write the shell script useradd.sh. [root@linuxprobe ~]# vim useradd.sh #!/bin/bush read -p "Enter The Users Password : " PASSWD for UNAME in `cat users.txt` d ...

Posted by zuhalter223 on Mon, 30 Dec 2019 22:42:52 -0800

Introduction to python Library - python daemon: a tool to implement python background program

brief introduction Python daemon implements Unix daemons. Reference resources: PEP 3143 This library implements the good behavior daemons specification of PEP 3143 "standard daemons library". The DaemonContext instance stores the behavior of the program and the configured process environment. quick get start import time ...

Posted by TCovert on Mon, 30 Dec 2019 08:27:19 -0800