Scripting Page 3

Regular expression validation URL domain name URL specification record

Published by Lao Jiang on March 30, 2019 at 10:28:52

Today, Lao Jiang is modifying a set of source code for directory websites. Because there was no specification that HTTPS must be used in the past, and now more and more websites need to use HTTPS, so users need to be forced to enter http or https when submitting web addresses, but they can not necessarily enter the www prefix. Here we need to modify the regular expression of the URL specification in this set of source code. Here we directly introduce several kinds of verification

Two website platforms for online access to website thumbnails

two

Published by Lao Jiang on 2019-03-26 08:02:15

Lao Jiang met a netizen who was modifying the source code of the directory website found on the Internet, but there seems to be a problem with the thumbnail. The thumbnail call in the original program has failed, and a new interface for providing website thumbnails needs to be replaced. In fact, if you can directly cache the website thumbnail to the server, it will be more accurate, and you won't have to worry about the problem of not finding the interface in the future. However, caching images locally will also increase the size of the server. Old here

Nginx website environment implements subdomain universal resolution settings

Published by Lao Jiang on 2019-02-12 09:44:33

Some webmasters who are site groups may need to use the pan resolution domain name function, such as resolving the pan domain name of the main domain name in the same content or sometimes on random pages. In the past, Mr. Jiang has also been exposed to such website projects, but he has never operated them. The NGINX website environment is relatively simple to configure, especially the server we use is simpler than the virtual host. server { server_na...

CentOS "ImportError: No module named requests" problem solving

one

Published by Lao Jiang on December 28, 2018 08:18:26

Today, when Lao Jiang was debugging a Python script, he had an "ImportError: No module named requests" error prompt. In fact, there is a relatively complete self configuration system for testing python scripts at ordinary times. Today, it is only temporarily executed in a CentOS Web system, which should be caused by the lack of a module. Page

Collection - use Python to send group/single mails via SMTP protocol

Published by Lao Jiang on November 13, 2018 08:41:06

Because of the functions that may be needed, I have searched for ways to send mails in groups. I have searched several free and paid platforms, but I am not particularly satisfied with them. So Mr. Tang said that you can use Python in combination with Alibaba Cloud email push service. Here is a list of Python SMTP scripts that can be implemented. The scripts are also provided by AliCloud. Chiang recorded it here so that it can be used directly when necessary in the future and not forgotten

Solve the problem of "smtplib. py" when smtplib pushes email

Published by Lao Jiang on November 12, 2018 at 21:01:43

Lao Jiang was studying an email group sending python script suggested by Lao Tang, but there was an error when configuring the file push. At first, I thought that the smtplib and email modules were not installed, but after checking, I found that they were installed, and no error was prompted. The error here is like this. root@li924-42 :~# python mymail.p...

Python monitors WHMCS panel VPS host vendor inventory and E-Mail email notification

Published by Lao Jiang at 09:16:31, April 12, 2018

Lao Jiang sorted out the "Python monitoring WHMCS panel VPS host vendor inventory and WeChat notification" a few days ago. He can use WeChat notification to inform VPS and server vendors of inventory, but only the WHMCS panel vendors can support it. When browsing the document, see here“ https://eqblog.com/whmcs-python-hon.h...

Python monitors WHMCS panel VPS host vendor inventory and WeChat notifications

Published by Lao Jiang on 2018-04-09 16:49:54

Although it is not so difficult to choose VPS and servers nowadays, there are still some special prices or scarce VPS and servers provided by service providers that are snapped up by users. And most overseas service providers often miss some time due to jet lag or uncertain updating factors. Because most host vendors will use the WHMCS panel, in this article, Jiang sorted out that this can be used for Python monitoring

Common sys.argv usage records in Python

Published by Lao Jiang on April 9, 2018 at 14:46:06

Today, when Laojiang was exposed to Python and needed to pass the parameters in the command line, he found sys.argv here to directly obtain the parameters at the specified position in the command. Here we record the methods we need to use, and we can refer to them when we need to use them later. First, the common usage is python wx. py 123. Here, when I need to enter a command, I want to set the parameters of 123

Hide Flask's default 5000 port and reverse domain name resolution method record

Published by Lao Jiang on March 16, 2018 12:32:06

This year, Lao Jiang decided to get a thorough introduction to Python, so after picking up the basic Python documents again (read them repeatedly in the previous two years, and forgot after not practicing), he simply practiced Flask "a minimal application". In every process, we always keep the skills in learning recorded. Some simple ones that cannot be recorded in the form of articles are directly recorded in local documents, and they will be sorted into documents later