使用arping检查ip冲突. [root@node1 ~]# arping -I enp4s0f0 192.168.11.3 ARPING 192.168.11.3 from 192.168.12.196 enp4s0f0 Unicast reply from 192.168.11.3 [18:C0:4D:1D:AA:7C] 0.683ms Unicast reply from 192.168.11.3 [18:C0:4D:1D:AA:7C] 0.551ms Unicast reply from 192.168.11.3 [18:C0:4D:1D:AA:7C] 0.562ms Unicast reply from 192.168.11.3 [18:C0:4D:1D:AA:7C] 0.548ms 如果返回的mac 地址有多个, 说明这个局域网出现ip冲突.
centos7编译打包keepalived-2.2.8
centos7 compile package keepalived-2.2.8 rpm
统计linux系统进程内存使用百分比
使用 top 或者ps 统计进程使用的内存总和.
rpm快速查询软件包信息
rpm -qi $(rpm -qf $(which ls |grep -v ^alias))
go_1.21泛型示例
package demo import ( “math/rand” “time” ) // 定义泛型接口 type RandomElementer[T any] interface { // 返回一个随机的元素,如果集合为空,返回(zero, false) RandomElement() (T, bool) } func MustRandom[T any](collection RandomElementer[T]) T { val, ok := collection.RandomElement() if !ok { panic(“collection is empty.”) } return val } // MyList 泛型集合. type MyList[T any] []T // MyList 实现接口RandomElement func (l MyList[T]) RandomElement()… Continue reading go_1.21泛型示例