import time import datetime t=datetime.datetime.now() #当前日期 t1 =t.strftime('%Y-%m-%d %H:%M:%S') #转为秒级时间戳 ts1=time.mktime(time.strptime(t1, '%Y-%m-%d % ...
分类:
编程语言 时间:
2020-01-12 16:40:32
阅读次数:
680
#time库 import time #线程推迟时间 time.sleep(3) #时间戳 print(time.time()) #返回日期、时间、星期 print(time.strftime('%Y/%m/%d %H:%M:%S %A')) #返回时间信息元祖 print(time.localti ...
分类:
编程语言 时间:
2020-01-11 20:45:52
阅读次数:
161
k8s StatefulSet部署有状态服务,本文拿zookeeper 作为示例,其他服务中间件部署都可以采用类似的方式
分类:
其他好文 时间:
2020-01-10 18:52:27
阅读次数:
248
Linux下shell通用脚本启动jar(微服务) vim app_jar.sh #!/bin/bash #source /etc/profile # Auth:Liucx # Please change these parameters according to your real env. # ...
分类:
编程语言 时间:
2020-01-10 12:18:11
阅读次数:
79
awk:格式化文本输出 gawk - pattern scanning and processing language awk:gawk的符号链接 基本用法:gawk [options] 'program' FILE program:PATTERN {ACTION STATEMENTS} 语句之间用 ...
分类:
其他好文 时间:
2020-01-09 20:44:26
阅读次数:
76
1. awk 默认使用空格分隔, 可使用-F参数来指定分隔符 awk -F"xx" '{print $1}' file.txt # 指定xx来分隔, xx会被切掉, 不包含在任何一段中 2. awk语法简介 awk [options] 'commands' file.txt options: 参数选 ...
分类:
其他好文 时间:
2020-01-09 20:25:31
阅读次数:
89
笔者最近在使用shell脚本中处理字符串,因此使用了大量shell脚本中的四剑客(awk,grep,sed,cut)而其中使用最多的两种方法就是grep和awk,因此想总结整理一下。 一、grep的意义 二、grep的基本用法 三、awk的意义 四、awk的基本用法 五、实例说明两者怎么用 一、gr ...
分类:
系统相关 时间:
2020-01-08 22:48:32
阅读次数:
153
我在要完成这个需求的时候大概有两个思路。 第一种方法: 我们直接使用 Kafka 提供的 bin 工具,去把我们关心的 lag 值 show 出来然后通过代码处理一下报出来。例如: 我们可以起个远程的 cmd 脚本,定期去执行 kafka-consumer-groups.sh 工具然后通过 awk ...
分类:
编程语言 时间:
2020-01-08 19:08:27
阅读次数:
102
lotus环境搭建: (1.)官方网站: https://docs.lotu.sh/en+install lotus arch https://docs.filecoin.io/ (2.)其他网站 https://www.aicoin.cn/article/99301.html https://ww ...
分类:
其他好文 时间:
2020-01-08 00:59:53
阅读次数:
295
shell-流程控制 for语句 数字循环1 #!/bin/bash for((i=1;i<=3;i++)); do echo ${i} done 数字循环2 #!/bin/bash for i in $(seq 1 3); do echo ${i} done 数字循环3 #!/bin/bash f ...
分类:
系统相关 时间:
2020-01-08 00:37:51
阅读次数:
93