background picture of the home page

Hi,Friend

Go 1.16新特性-embed包及其使用

Go 1.16新特性-embed包及其使用embed是什么embed是在Go 1.16中新加包。它通过//go:embed指令,可以在编译阶段将静态资源文件打包进编译好的程序中,并提供访问这些文件的能力。为什么需要embed包部署过程更简单。传统部署要么需要将静态资源与已编译程序打包在一起上传,或者

thumbnail of the cover of the post

Go多协程并发环境下的错误处理

Go协程这样用才安全Go协程有一个不小的问题——你无法在父协程中捕获子协程的panic。比如下面的例子:func main() { // 希望捕获所有所有 panic defer func() { r := recover() fmt.Println(r) }() // 启动新协

thumbnail of the cover of the post

Xinetd服务的安装与配置

Xinetd服务的安装与配置Linux守护进程与初始化进程Linux服务器的主要任务就是为本地或远程用户提供各种服务。通常Linux系统上提供服务的程序是由运行在后台的守护进程(Daemon)来执行。一个实际运行中的Linux系统一般会有多个这样的程序在运行。这些后台守护进程在系统开机后就运行了,并

thumbnail of the cover of the post

CentOS8.2 救援模式修复系统

CentOS8.2 救援模式修复系统问题示例:系统中的libc.so.6动态库文件误删除挂载镜像启动(1)选择完成后进入安装界面,选择troubleshooting。(2)进入后选择rescue a CentOS system(使用光盘制作一个小型的系统)。(3)跳出4个选项,选择1继续。退出救援模

thumbnail of the cover of the post

CentOS8.2基础配置

CentOS8.2基础配置系统服务配置现在活动的服务列表systemctl -t service所有服务清单systemctl list-unit-files -t service[root@lianglab ~]# systemctl list-unit-files -t serviceUNIT

thumbnail of the cover of the post

运维管理利器系列--ipmitool

运维管理利器系列--ipmitool安装yum -y install epel-releaseyum -y install ipmitoolyum install OpenIPMI ipmitool加载模块modprobe ipmi_watchdogmodprobe ipmi_poweroffmo

thumbnail of the cover of the post

CentOS8.2安装配置Prometheus和node_exporter详解

CentOS8.2安装配置Prometheus和node_exporter详解步骤1:创建一个Prometheus用户和组首先,我们将为Prometheus创建一个系统用户。执行以下命令以实现此目的。# useradd -m -s /bin/false prometheus# id promethe

thumbnail of the cover of the post

Node Exporter 开启 TLS认证

Node Exporter 开启 TLS认证生成证书从 GO 1.15 开始,X509 不能用了 ,需要用到 SAN 证书生成 CA 根证书openssl genrsa -out ca.key 2048openssl req -new -x509 -days 3650 -key ca.key -ou

thumbnail of the cover of the post

收集容器中日志 Log-polit Kafka Logstash Elasticsearch Kibana

收集容器中日志 Log-polit Kafka Logstash Elasticsearch KibanaLog-polit简介Log-pilot通过声明式配置实现强大的容器事件管理,可同时获取容器标准输出和内部文件日志,解决了动态伸缩问题,此外,Log-pilot具有自动发现机制、CheckPoi

thumbnail of the cover of the post

SSH+rsync实现服务器的自动备份

SSH+rsync实现服务器的自动备份免密登录ssh-keygenssh-copy-id root@hostname使用 rsync 实现自动备份#!/bin/bashlocalDir=/root/halo/remoteDir=/root/halo_backupremoteIP=10.0.8.12i

thumbnail of the cover of the post