Sunday Blog

人生是一场刻意练习

minio + picgo 自建图床

minio + picgo 自建图床

obsidian安装插件实现贴入图片自动上传到图床 安装 mkdir -p /data/minio/{data,config} docker 运行 docker run \ -p 9000:9000 \ -p 9090:9090 \ --name minio \ -d --restart=always \ -e "MINIO_ROOT_USER=admin" \ -e "MINIO_ROOT_PASSWORD=admin_password" \ -v /data/minio/data:/data \ -v /data/minio/config:/root/.minio \ minio/minio \ server /data --console-address ":9090" docker-compose 运行 version:

Raid Disk Health Check

Raid Disk Health Check

磁盘阵列卡检测与监控硬盘健康状况 常用软件 MegeRAID Hard Disk Sentinel 一般地,支持RAID 5的卡,我们称其为阵列卡,都可以使用LSI官方提供的MegaCli工具来

Dingtalk Shell 脚本

Dingtalk Shell

#!/bin/bash export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH" # 钉钉关键词: 20, ERROR, INFO, WARN title="Dingtalk Test" content="Hello" atMobiles=("156xxx") atUserIds=() isAtAll="False" dingtalk_text(){ webhook_url='https://oapi.dingtalk.com/robot/send?access_token=097cxxxxxxxxxxxxxxxxxxxc924' current_time=$(date +"%Y-%m-%d %H:%M:%S") if [[ $content != "" ]];then title_date="【$(hostname) $title】 $current_time" message="{ \"msgtype\": \"text\",

CentOS 7.4 安装 Cobbler 实现自动化安装 Ubuntu 18.04

Cobbler + Kickstart

https://cobbler.github.io 环境准备 OS: CentOS 7.6 IP: 192.168.1.22 关闭防火墙 sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config setenforce 0 systemctl stop firewalld.service systemctl disable firewalld.service 阿里云源 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 安装Cobbler 安装cobbler yum install cobbler cobbler-web dhcp debmirror pykickstart fence-agents -y 开机启动

Java Redis Exception Connection Reset by Peer

Java Redis Exception Connection Reset by Peer

报错信息 2023-05-18 14:18:01.916 ERROR 109202 --- [pool-6-thread-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task. org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is io.lettuce.core.RedisException: io.netty.channel.unix.Errors$NativeIoException: readAddress(..) failed: Connection reset by peer at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:74) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:268) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceSetCommands.convertLettuceAccessException(LettuceSetCommands.java:520) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceSetCommands.sMembers(LettuceSetCommands.java:245) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.connection.DefaultedRedisConnection.sMembers(DefaultedRedisConnection.java:607) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.core.DefaultSetOperations.lambda$members$6(DefaultSetOperations.java:158) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:95) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.core.DefaultSetOperations.members(DefaultSetOperations.java:158)

iptables NAT转发共享上网

iptables nat forward share network

原文:http://wwdhks.blog.51cto.com/839773/1154032 iptables是一个Linux下优秀的nat+

Golang 基础知识笔记

Golang Basic Knowledge Notes

一、GO变量 1.1 变量的介绍 变量概念 变量相当于内存中的一个数据存储空间,可以将变量看做是一个房间的门牌号,通过门牌号我们可以找到房间,同样的道理

ESXi 6.6 固态硬盘阵列不识别为SSD类型解决

Esxi 6 Ssd Arry Identification

ESXi开启SSH,登陆ESXI主机 # 列出储存清单 esxcli storage nmp device list # WEB界面 - 存储 - 设备 查看 naa.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 设置为SSD类型 esxcli storage nmp satp rule add -s VMW_SATP_LOCAL --device naa.644a84200b26dc0023dda3c80dcac2xx --option="enable_ssd" 重启ESX

Dell R620 R630 R720 R730 通过IPMI手动控制服务器风扇转速

Dell Server Ipmi Fan Offset

测试IPMI的连接性: ipmitool -I lanplus -H 192.168.1.149 -U root -P root raw 将风扇设置为手动调节转速 ipmitool -I lanplus -H 192.168.1.149 -U root -P root-passwd raw 0x30 0x30 0x01 0x00 手动设置风扇转速(最后一字节指示风扇转速的百分

Ubuntu 20.04 Netplan Dns

Ubuntu 20.04 Netplan Dns

如果在netplan设置dns了,但是实际验证中发现无效。 例如通过nslookup去解析域名,显示的是 dns服务器是127.0.0.53 但是

Ubuntu 22.04 设置静态IP

ubuntu 22.04 setting static ip

cat /etc/netplan/00-installer-config.yaml # This is the network config written by 'subiquity' network: ethernets: ens160: dhcp4: false addresses: - 192.168.77.3/24 ens192: dhcp4: false addresses: - 119.38.120.107/27 nameservers: addresses: - 223.5.5.5 routes: - to: default via: 119.38.120.1 version: 2 netplan apply

Ubuntu UFW防火墙启用NAT共享上网

Ufw firewall enable nat shared Internet access

环境信息 内网 网卡接口: ens160 网段: 192.168.77.0/24 IP: 192.168.77.1 外网 网卡接口: ens160 打开内核转发 echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf sysctl -p 启动nat转发测试 非持久化 # 启动 # 适用动态IP 自动转成网卡I

sed引用变量及追加文件内容到文件首部

Sed Head File

只能将昨天的日志文件内容追加到今天的日志文件的首部,从第 1 行后开始,而不是完全从第 1 行开始。 # 表示将 yesterday.log 文件中的内容添加到 today 文件中,且从第一行

Namespace Terminating

Namespace Terminating

问题 删除 namespace 失败,一直处于 terminating 状态。 [root@ha ~]# kubectl get ns NAME STATUS AGE default Active 4d kube-system Active 4d local Active 3d6h monitoring Terminating 19m 排查 检查该 namespace 中是否还存在未被清理的资源 namespace=monitoring kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found

Kubernetes监控kube-prometheus使用

Kube Prometheus

kube-prometheus github 部署 git clone https://github.com/prometheus-operator/kube-prometheus.git cd kube-prometheus git checkout v0.11.0 # 切换kubernetes兼容版本 首先创建需要的命名空间和 CRDs,等待它们可用后再创建其余资源 kubectl apply --server-side -f manifests/setup kubectl wait \ --for condition=Established