在Flask中,添加路由有两种方式:(一般情况下都是用第一种方式) 第一种:常见的装饰器模式 @app.route("/") def index(): return "Hello World" 通过这种方式,将rule与视图函数对应起来 第二种:通过阅读装饰器模式添加路由的源码发现 def rout ...
分类:
其他好文 时间:
2020-07-23 23:29:38
阅读次数:
138
package com.zsins.risk.util; import java.io.Serializable; public class LongMap implements BitMap, Serializable { private static final long serialVersi ...
分类:
其他好文 时间:
2020-07-23 18:59:01
阅读次数:
90
1. 如何在一个多级目录下,找出文件内容中所有包含“ibmq”字符的文件? 例如,找到在/home/www下所有文件内容中包含“ibmq”字符的文件: find /home/www -name "*" | xargs grep -ri "ibmq" #r是搜索子目录,i是忽略大小写 其中xargs命 ...
分类:
其他好文 时间:
2020-07-23 15:43:55
阅读次数:
65
Redis 服务监控, ps=`ps -efl|grep redis|grep -v $0|grep -v grep|wc -l` if [ $ps -eq 0 ]; then echo -e "\n$(date '+%Y-%m-%d %H:%M:%S') start " /etc/init.d/r ...
分类:
系统相关 时间:
2020-07-23 15:41:30
阅读次数:
183
#!/bin/bash#作者:洪永坚echo-e"\033[31m211服务器时间:\033[0m"date+%F""%H:%M#获取脚本执行的时间echo-e"\033[31m服务器ip地址:\033[0m"ifconfigeno1|awk‘/inet/‘|awk‘{print$2}‘#获取IP#检查CP
分类:
编程语言 时间:
2020-07-22 21:05:02
阅读次数:
98
1. 从第1000行开始,显示2000行。即显示1000~2999行 cat input_file | tail -n +1000 | head -n 2000 2. 显示 1000行到3000行 cat input_file | head -n 3000 | tail -n +1001 *注意两种 ...
分类:
系统相关 时间:
2020-07-22 21:01:38
阅读次数:
116
1.启动Nginx $ sudo service nginx start 查看状态: $ sudo service nginx status 2.查看版本信息 $ nginx -V $ nginx -V 2>&1 | sed 's/ /\n/g'(与上一命令一样,查看版本信息,但更加整洁规范。 2> ...
分类:
Web程序 时间:
2020-07-22 20:56:48
阅读次数:
98
1.找到mysql启动时是加载了哪个my.cnf文件 看看是否有设置使用指定目录的my.cnf文件,如果有则表示mysql启动时是加载了默认的配置文件(/etc/my.cnf) ps aux|grep mysql|grep 'my.cnf' 2.查看mysql默认使用的my.cnf文件目录 mysq ...
分类:
数据库 时间:
2020-07-22 20:52:23
阅读次数:
108
neutron agent-list | grep dhcp-agent | 60c33247-ffcd-4a0a-bb2f-75535ff56f75 | DHCP agent | controller3 | nova | :-) | True | neutron-dhcp-agent | | 84 ...
分类:
其他好文 时间:
2020-07-22 20:51:02
阅读次数:
75