摘要:
使用除法来缩减数字,使用余数法来计算个数。 class Solution: def hammingWeight(self, n: int) -> int: count = 0 while True : s = n // 2 y = n % 2 if y == 1: count += 1 if s =
阅读全文
posted @ 2020-03-25 09:54
topass123
阅读(141)
推荐(0)
摘要:
class Solution: def reversePrint(self, head: ListNode) -> List[int]: newList=[] while head: newList.append(head.val) head=head.next return newList[::-
阅读全文
posted @ 2020-03-24 10:16
topass123
阅读(164)
推荐(0)
摘要:
一个playbook文件中,执行时如果想执行某一个任务,那么可以给每个任务集进行打标签,这样在执行的时候可以通过-t选择指定标签执行, 还可以通过--skip-tags选择除了某个标签外全部执行等 [root@ansible PlayBook]# cat httpd.yml - hosts: 192
阅读全文
posted @ 2020-03-23 22:49
topass123
阅读(166)
推荐(0)
摘要:
在单一一个playbook文件中,可以连续三个连子号( )区分多个play。还有选择性的连续三个点好(...)用来表示play的结尾,也可省略 Playbook核心元素 Hosts 执行的远程主机列表 Tasks 任务集 Varniables 内置变量或自定义变量在playbook中调用 Templ
阅读全文
posted @ 2020-03-23 21:11
topass123
阅读(266)
推荐(0)
摘要:
ansible的模块的应用。 mount的使用:
阅读全文
posted @ 2020-03-23 20:54
topass123
阅读(123)
推荐(0)
摘要:
在下面的hosts文件都添加一下的ip地址: [topass] 172.16.1.7 172.16.1.31 172.16.1.41 很显然这里涉及到了ansible的模块的问题 1.获取模块的个数 [root@localhost ~]# ansible-doc -l |wc -l #查看支持的模块
阅读全文
posted @ 2020-03-23 20:39
topass123
阅读(94)
推荐(0)
摘要:
yum list ansible 检测是否有epel源。如果没有可以到阿里云下载。再安装 yum -y install ansible. ansible -v 查看版本的信息 ansible的使用格式: ansible topass123 -m command -a hostname
阅读全文
posted @ 2020-03-23 20:23
topass123
阅读(148)
推荐(0)
摘要:
1。sensor:可以显示包括cpu在内的所有传感器的当前读数 使用sensors可以检测到cpu的温度,风扇的风速度,电压等。 2.Glances使用Python写的跨平台的curses的检测工具。可以看到cpu的使用率, 系统负载均衡,网络的接口,io,文件系统的使用率。 3.i7z可以实时的报
阅读全文
posted @ 2020-03-23 14:07
topass123
阅读(2123)
推荐(0)
posted @ 2020-03-23 11:59
topass123
阅读(134)
推荐(0)
摘要:
使用排序比较的方式 class Solution: def findRepeatNumber(self, nums: List[int]) -> int: nums.sort() pre = nums[0] for i in range(1,len(nums)): if pre == nums[i]
阅读全文
posted @ 2020-03-23 11:54
topass123
阅读(135)
推荐(0)