__director

2020年5月31日

configMap

摘要: apiVersion: v1 kind: ConfigMap metadata: name: nginx-configmap2 data: default.conf: | server { listen 81; server_name localhost; location / { root /us 阅读全文

posted @ 2020-05-31 14:54 __director 阅读(94) 评论(0) 推荐(0) 编辑

入门deployment

摘要: apiVersion: apps/v1 kind: Deployment metadata: name: nginx spec: replicas: 1 selector: matchLabels: app: nginx template: metadata: labels: app: nginx 阅读全文

posted @ 2020-05-31 14:52 __director 阅读(142) 评论(0) 推荐(0) 编辑

2020年5月3日

prometheus小坑--no datapoints found

摘要: web 界面出现:Warning! Detected 437.83 seconds time difference between your browser and the server. Prometheus relies on accurate time and time drift might 阅读全文

posted @ 2020-05-03 10:35 __director 阅读(2844) 评论(0) 推荐(0) 编辑

2020年4月26日

AWK 小用--打印奇偶行

摘要: [root@xiaoyuan mnt]# cat file001 1 2 3 4 5 6 7 8 9 10 [root@xiaoyuan mnt]# awk 'i=!i' file001 1 3 5 7 9 [root@xiaoyuan mnt]# awk '!(i=!i)' file001 2 4 阅读全文

posted @ 2020-04-26 21:40 __director 阅读(141) 评论(0) 推荐(0) 编辑

2020年4月25日

行列互换

摘要: [root@xiaoyuan ~]# cat file0081 2 34 5 67 8 9[root@xiaoyuan ~]# awk '{for(i=1;i<=NF;i++)a[i]=a[i]$i" "}END{for(x in a)print a[x]}' file0081 4 7 2 5 8 阅读全文

posted @ 2020-04-25 21:05 __director 阅读(92) 评论(0) 推荐(0) 编辑

毕业毕业

摘要: 只求一offer 阅读全文

posted @ 2020-04-25 17:28 __director 阅读(93) 评论(0) 推荐(0) 编辑

列表去重

摘要: listA = [2,2,5,5,45,3,1,3] listB = [2,2,5,5,45,3,1,3] listC = [2,2,5,5,45,3,1,3] #法一:set print(list(set(listA))) #法二 tmp = [] for i in listB: if i not 阅读全文

posted @ 2020-04-25 17:10 __director 阅读(59) 评论(0) 推荐(0) 编辑

两个列表引索相同元素相加

摘要: listA = [1,2,3,4] listB = [8,7,6,5] listC = list(zip(listA,listB)) print(listC) listD = [x+y for x ,y in listC] print(listD) 阅读全文

posted @ 2020-04-25 17:00 __director 阅读(217) 评论(0) 推荐(0) 编辑

合拼两个有序列表

摘要: listA = [1,2,5,9,34,99] listB = [3,6,15,59,88] def fun(arg1,arg2): tmp = [] while len(arg1) > 0 and len(arg2) > 0: if arg1[0] > arg2[0]: tmp.append(ar 阅读全文

posted @ 2020-04-25 16:49 __director 阅读(72) 评论(0) 推荐(0) 编辑

遍历目录

摘要: import os n = m = count =0 list_05 = [] def fun(argument): for i in os.listdir(argument): doucument = os.path.join(argument,i) if os.path.isdir(doucum 阅读全文

posted @ 2020-04-25 16:02 __director 阅读(122) 评论(0) 推荐(0) 编辑

导航