自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(67)
  • 收藏
  • 关注

原创 【Python】IP地址解析并生成

【代码】【Python】IP地址解析并生成。

2023-09-14 14:50:41 187

原创 把字段串分割成指定长度的字符串组 [ golang ]

【代码】把字段串分割成指定长度的字符串组 [ golang ]

2023-05-18 14:31:52 299

原创 在centos8 stream 上安装 php8.x

【代码】在centos8 stream 上安装 php8.x。

2023-01-06 02:24:54 498

原创 关于Win10下,取消回环代理限制的问题

使用IP无法访问本地服务

2022-06-03 14:41:50 1205

原创 VMware Workstation 16更改网卡型号

今天安装了几台虚拟机,系统是centos8和ubuntu-22.04, 在centos8下,找不到网卡了,查看设备网卡的型号变成了pcnet32了,centos7 和 centos8没有自带驱动,需要把网卡型号改成e1000,找到虚拟机的配置文件:xxx.vmx,在里面针对每个网卡,添加配置:ethernet0.virtualDev = "e1000"如:ethernet1.connectionType = "pvn"ethernet1.addressType = "generated"eth

2022-05-10 14:49:57 3214 1

原创 BGP配置记录

在CentOS下,frr运行BGP协议,以下是单台机器的配置记录,特别要注意的是:no bgp ebgp-requires-policy,不然邻居之间由于没有策略不允许连接。frr version 8.2.2frr defaults traditionalhostname localhost.localdomainlog syslog informational!router bgp 200 no bgp ebgp-requires-policy neighbor 172.16.251.1

2022-04-29 17:28:48 618 3

原创 LVS FULLNAT

使用iptables来实现LVS下的FULLNAT:安装lvs(CentOS Stream 8):yum install ipvsadm -y 配置如下(DNAT):#!/bin/bash/usr/sbin/ipvsadm -A -t 5.5.1.60:8300 -s wlc/usr/sbin/ipvsadm -a -t 5.5.1.60:8300 -r 5.5.7.146:8300 -m开启内核参数sysctl net.ipv4.vs.conntrack=1 [重点,必须]

2022-04-21 13:27:48 519

原创 Cacti(1.2.20)有图,但图中没有绘制曲线

Cact(1.2.20)有图,但图中没有绘制曲线安装了cacti之后,可以正常工作,有图,图中也会绘制曲线,但是工作了一天之后,就不绘制曲线了。重新安装Cacti,又可以正常工作了,但一段时间后,又不绘制图了检查定时任务里面的脚本*/5 * * * * nginx php /usr/share/nginx/html/cacti/poller.php &>/dev/null手动运行此脚本,发现有报错:ERROR: unknown option '--skip-past-updates

2022-04-12 10:36:50 463

原创 gre搭建记录

gre搭建记录主机A,外网地址:a.a.a.a主机B,外网地址:b.b.b.b主机A:#!/bin/bashmodprobe ip_greip link set neta downip link delete netaip tunnel add neta mode gre remote b.b.b.b local a.a.a.a ttl 255ip link set neta upip addr add 10.0.2.1/24 dev netaip route add 10.0.2.0

2022-04-11 22:38:20 377

转载 parted格式化磁盘脚本

parted格式化磁盘脚本#!/bin/bash #Used to fomat 6 disksPATH=/bin:/sbin:/usr/bin:/usr/sbinexport PATH disk_to_parted="$1"if [ $# == 0 ];then echo "no disk to parted,example /dev/sdb" exitelse echo -e "\n\n****** ${disk_to_parted} __was Fdisked!

2022-04-09 01:07:05 335

原创 Linux接口之虚拟网络接口介绍

https://lyyao09.github.io/2020/06/13/linux/An-introduction-to-linux-interfaces-for-virtual-networking/

2022-01-05 16:38:24 752

原创 configure: WARNING: sphinx is missing but required to build documentation

configure: WARNING: sphinx is missing but required to build documentation解决方式(CentOS8):pip3 install Sphinx[root@R3 ~]# pip3 install SphinxWARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instea

2021-12-15 10:19:17 1108

原创 Uncaught ReferenceError: slowAES is not defined

Uncaught ReferenceError: slowAES is not defined以下是aes.min.js的内容,保存成文件,再引入script:/* * aes.js: implements AES - Advanced Encryption Standard * from the SlowAES project, http://code.google.com/p/slowaes/ * * Copyright (c) 2008 Josh Davis ( http://www.

2021-12-09 15:42:00 420

原创 Prometheus Config Manager

Prometheus Config Managergithub:https://github.com/leslieDD/prometheus_cfg_managergitee:https://gitee.com/aidiandian/prometheus_cfg_manager介绍prometheus_cfg_manager是用来管理prometheus的相关配置,包括prometheus.yml,告警规则,及服务发现等安装在本项目库中有一SQL文件:prometheus_cfg_manage

2021-08-11 09:27:00 166

原创 estimating gas used: message execution failed: exit 16, reason: failed to init new actor (RetCode=16

2021-08-04T15:44:45.058+0800 INFO main lotus-storage-miner/init.go:173 Checking if repo exists2021-08-04T15:44:45.058+0800 INFO main lotus-storage-miner/init.go:189 Checking full node version2021-08-04T15:44:45.059+0800 INFO main lotus-storage-miner/init

2021-08-04 16:07:14 437 1

原创 vue3+element plus下面,自定义el-table表格标题

参考了网络上很多资料,照着写,都不行,后来自己琢磨了一会儿出来了,代码如下: <el-table-column label="权限列表" scoped-slot> <template #header> <span>{{ "权限列表" }}</span> <el-divider direction="vertical"></el-divider>

2021-08-03 18:26:30 2803

原创 Mysql中Json类型上使用Join操作实例

SELECT m.id, m.ipaddr, j.name, j.port, j.cfg_name, m.job_id, m.update_at FROM machines AS mLEFT JOIN jobs AS jON JSON_CONTAINS(m.job_id, JSON_array(j.id))WHERE j.is_common=0 AND (m.ipaddr LIKE '%1%' OR j.name LIKE '%1%' ) ORDER BY m.update_at desc

2021-06-19 13:23:13 1836

转载 CSS 实现高度自适应铺满整屏的实现

<style> #login{ width:100%; min-height: 100vh; display: flex; justify-content: center; align-items: center; }</style>此时#login的高度自适应整个屏的高度视口单位(Viewport units)什么是视口?在桌面端,视口指的是在桌面端,指的是浏览器的可视

2021-06-13 12:47:58 1245

原创 设置背景颜色为透明色

css代码如下:{ background: transparent;}

2021-06-12 11:55:55 102

原创 vue中表格中每行都嵌入下拉选择(多选)的处理

<el-table-column label="分组选项" prop="job_id"> <template slot-scope="scope"> <el-select v-model="selectTypeValue[scope.row.ipaddr]" @change="handleSelect(scope.$index,scope.row)" size="small" multiple placeholder="请选择"> &l

2021-06-10 10:54:12 1533 1

原创 bootstrap,创建Input搜索框,回车后会刷新页面的问题

需求是,用Input创建一个搜索框,回车后直接执行搜索操作,但在实现过程中,会出现刷新页面的问题,代码如下: <div class="col-sm-3" style="float: right;"> <div class="input-group" style="width: 250px;"> <input type="text" id="searchContext" class="form-control" placeholder="模糊搜索IP..."

2021-06-10 09:49:49 606 2

原创 Please select the mail server configuration type that best meets your needs

Please select the mail server configuration type that best meets your needs. No configuration: Should be chosen to leave the current configuration unchanged. Internet site: Mail is sent and received directly using SMTP. Internet with smarthos

2021-06-03 14:29:04 1500

原创 prometheus查询合并标签

有查询语句1(得到温度传感器的名称): node_hwmon_sensor_label{instance="192.168.1.100", label=~"core_.*"}得到结果:node_hwmon_sensor_label{chip="platform_coretemp_0", instance="192.168.1.100", job="node-development", label="core_0", sensor="temp2"} 1node_hwmon_sensor_lab

2021-05-31 20:05:17 2507

原创 Prometheus中文文档

Prometheus中文文档:http://www.coderdocument.com/docs/prometheus/v2.14/introduction/overview.html

2021-05-28 23:35:46 1903

原创 博客记录

rust之Cell、RefCell: https://www.dazhuanlan.com/2019/12/08/5deca828ede3b/rust之Rc、Weak:https://www.dazhuanlan.com/2019/12/07/5deb0e7f238a5/

2021-05-21 16:30:46 43

原创 Mysql设置密码后,用相同的密码为什么登录不了

如题!在以下数据版本中有遇到:mysql> select version();+-----------+| version() |+-----------+| 5.7.34 |+-----------+1 row in set (0.00 sec)在给账号设置密码的时候,在密码文本中带有反斜杆(\)时,mysql会转义反斜杆后面的字符,如:设置密码文本Sedfa123cRJ\V,tR$"ZA时,登录的时候要使用Sedfa123cRJV,tR$"ZA,如果确定要在密码是使用反

2021-05-20 17:42:27 168

原创 rust unresolved import

有时候,明明在Cargo.toml中的dependencies已经引入了crate,如:cargo add xxxx,但是在代码中引入crate,就是会提示如下错误:unresolved import此时可以试着,在项目根目录下面,运行如下命令:# cargo clean# cargo build...

2021-05-20 14:34:31 3359

原创 go中读写锁和互斥锁的效率比较

机器及环境:代码编辑器:Visual Studio Code读写锁:sync.RWMutex互斥锁:sync.Mutex{}测试:一共7个协程,6个协程用于读map中的数据,1个协程用于写入map数据,计算所有协程完成工作后的总时间,列出以下表格,以下所有单位为:秒循环次数(每个协程)读写map全加Lock锁[RWMutex]读map加RLock 锁,写map加Lock锁[RWMutex]读写map加Lock锁[Mutex]1千0.00292110.001998

2021-03-22 10:54:14 457

转载 linux中nmcli命令的使用及网络配置

【转载】文章原地址:https://blog.51cto.com/groot/1847482Red Hat Enterprise Linux 7 与 CentOS 7 中默认的网络服务由 NetworkManager 提供,这是动态控制及配置网络的守护进程,它用于保持当前网络设备及连接处于工作状态,同时也支持传统的 ifcfg 类型的配置文件。NetworkManager 可以用于以下类型的连接:Ethernet,VLANS,Bridges,Bonds,Teams,Wi-Fi,mobile boradb

2021-03-14 23:30:53 7567

原创 pwgen命令生成密码

生成脚本if [ "$1" == "" ];then pwgen -s -c -n -y 12 -B -r \'\\\" else pwgen -s -c -n -y 12 -B -r \'\\\" $1 fi生成的密码中排除了指定的字符,如单引号,双引号等使用方式:./pwgen.sh 密码个数如:[root@harbor ~]# ./pwgen.sh 20g_R]9~w9j}bC 3+//.YP7#%]b [nUF3R-y$&u` |s[Pyr4)=roJ *W

2021-03-09 16:30:47 397

原创 flannel0和docker0的网段不一致

检查了一会儿,发现docker的版本太新,与现在安装的flanneld版本不匹配,造成flanneld的配置对docker不生效,卸载现有的docker版本,使用合适版本的docker:[root@master ~]# flanneld -version0.7.1[root@master ~]# docker -vDocker version 1.13.1, build 0be3e21/1.13.1[root@master ~]# ...

2020-12-21 17:35:47 1668 1

原创 字符串转byte数组【golang】

转换代码如下:package cmdimport ( "fmt" "unsafe" "github.com/spf13/cobra")func init() { rootCmd.AddCommand(bufferCmd)}var bufferCmd = &cobra.Command{ Use: "buffert", Run: func(cmd *cobra.Command, args []string) { s := "1111111111111111111111

2020-11-26 15:43:47 589

原创 curl配合sh执行脚本,让sh传递参数给curl下载的脚本

curl -s http://192.168.1.1/zabbix_agent.sh | bash /dev/stdin 192.168.1.1其中:zabbix_agent.sh在其它服务器上已经写好的脚本,使用curl下载/dev/stdin是标准输入,192.168.1.1是要传递给脚本的参数

2020-11-19 17:54:38 2379

原创 psql: FATAL: role is not permitted to log in

postgres=# alter role "zabbix" with login;ALTER ROLEpostgres=#

2020-11-19 14:25:52 2048

原创 sync.NewCond的用法,实例

直接上代码package cmdimport ( "fmt" "sync" "time" "github.com/spf13/cobra")func init() { rootCmd.AddCommand(syncCmd)}type Lock struct{}func (l *Lock) Lock() {}func (l *Lock) Unlock() {}var syncCmd = &cobra.Command{ Use: "sync", Run: f

2020-11-13 22:04:23 843

原创 [zap logger] no sink found for scheme [golang]

在win10系统上,golang使用zap日志库测试过程中,遇到这么一个错误:代码如下:package cmdimport ( "fmt" "log" "os" "path/filepath" "time" "github.com/spf13/cobra" "go.uber.org/zap")func init() { rootCmd.AddCommand(zapCmd)}var zapCmd = &cobra.Command{ Use: "zap", Ru

2020-11-12 20:49:40 705

原创 Ubuntu 20.04.1 LTS, 开机进入不了登录界面,画面一直停留在转圈圈的地方

系统: Ubuntu 20.04.1 LTS问题: 开机后,一直停留在转圈圈的画面,进入不了登录界面解决 :通过电源键,反复重启系统,直到进入系统进入系统之后,运行以下命令: sudo apt-get install lightdm, 在选择显示方式的时候,选择lightdm重启系统后,可以正常进入登录界面,并进入系统. 再不会停留在转圈圈的地方....

2020-11-04 19:11:17 10865 2

原创 OpenStack VS Kubernetes

https://www.cnblogs.com/goldsunshine/p/9872142.html

2020-11-03 16:52:32 131

原创 最后一个支持windows 2003的golang版本

最后一个支持windows 2003的golang版本是1.10.8,再之后的版本就要求系统至少是windows 7go1.10.8.windows-386.msi下载页面:https://studygolang.com/dl官方下载地址:https://studygolang.com/dl/golang/go1.10.8.windows-386.msi...

2020-10-21 10:44:13 1163

原创 logrus的使用及格式定制

在查询许多资料后,整理了以下代码:package configimport ( "fmt" nested "github.com/antonfisher/nested-logrus-formatter" "github.com/lestrrat-go/file-rotatelogs" "github.com/rifflock/lfshook" "github.com/sirupsen/logrus" "path/filepath" "runtime" "strings" "time"

2020-10-21 10:24:13 1415 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除