脚本源码:#!/bin/bashecho_caidan() {# 清空防火墙规则read -ep "是否清空防火墙规则(y/n):" nameif [ $name == y ];then iptables -F echo " 1) 放行端口 2) 封锁端口 3) 放行ip 4) 封锁ip "else... ...
分类:
系统相关 时间:
2020-07-06 11:04:21
阅读次数:
99
前言 在我之前的文章中有any()和all()的对比:any()和all()对比其中介绍了any()函数的基本特性 可迭代对象中有任意一个不为False的时候,返回True,如果可迭代对象为空的话,返回False 由于这个特性,决定了any()可以用在判断语句中与 or 一较高下。那么俩者有区别吗? ...
分类:
编程语言 时间:
2020-07-06 10:41:50
阅读次数:
92
一、获取当前时间戳 方法1:通过time函数 1 time(); 方法2:通过$_SERVER中的REQUEST_TIME元素 1 $_SERVER['REQUEST_TIME']; 方法3:通过strtotime函数 1 strtotime('now')); 二、获取当前时间 通过date函数格式 ...
分类:
Web程序 时间:
2020-07-06 10:41:34
阅读次数:
76
单例模式(Singleton Pattern)是一种常用的软件设计模式,该模式的主要目的是确保某一个类只有一个实例存在。当你希望在整个系统中,某个类只能出现一个实例时,单例对象就能派上用场。 import time class A(): instance=None def __init__(self ...
分类:
编程语言 时间:
2020-07-06 01:37:14
阅读次数:
75
这是一个获得时间的Python小程序 import ntplib from time import ctime c = ntplib.NTPClient() response = c.request('time.pool.aliyun.com') print(ctime(response.tx_ti ...
分类:
微信 时间:
2020-07-06 01:21:33
阅读次数:
109
1 为什么要使用模块 当应用变得复杂时,store对象就会变得相当臃肿,为了解决这个问题,可以将store分割成模块(module)。而每个模块拥有自己的store mutation action getter等 2 代码 2.1 分割模块与定义模块 src\store\index.js modul ...
分类:
其他好文 时间:
2020-07-06 01:19:48
阅读次数:
64
1、统计出/etc/passwd文件中其默认shell为非/sbin/nologin的用户个数,并将用户都显示出来[root@centos7~]#grep-v"/sbin/nologin"/etc/passwd|cut-d:-f1rootsyncshutdownhaltzjwmageiaslackware2、查出用户UID最大值的用户名、UID及shell类型[root@centos7~]#get
分类:
其他好文 时间:
2020-07-06 01:02:16
阅读次数:
69
简介 这篇文章主要介绍selenium的多层框架定位。案例是使用selenium自动登陆QQ空间。 思路 1 使用selenium自动请求QQ空间网站 https://i.qq.com/ 。打开后出现如下页面。 2 通过xpath定位到账号密码登录的位置,然后使用click点击对象。出现如下页面。 ...
分类:
其他好文 时间:
2020-07-06 01:00:56
阅读次数:
88
mysql> update test set create_time=concat('2013-10-01 ', floor(10+rand()*10),':',floor(10+rand()*49),':',floor(10+rand()*49)) where create_time='0000- ...
分类:
数据库 时间:
2020-07-06 00:42:41
阅读次数:
116
1、统计出/etc/passwd文件中其默认shell为非/sbin/nologin的用户个数,并将用户都显示出来[root@centos7scripts]#grep-v‘/sbin/nologin$‘/etc/passwd|cut-d:-f1rootsyncshutdownhaltkyletest[root@centos7~]#awk-F:‘{if($NF!="/sbin/nologin"){p
分类:
其他好文 时间:
2020-07-06 00:42:07
阅读次数:
89