- 博客(120)
- 资源 (4)
- 收藏
- 关注
原创 ModuleNotFoundError: No module named ‘audioop‘
ModuleNotFoundError: No module named 'audioop'
2025-01-08 20:37:05
1423
原创 Failure to install and run Docker in WSL Ubuntu 22.04
【代码】Failure to install and run Docker in WSL Ubuntu 22.04。
2023-06-14 20:53:00
254
原创 CentOS7和Windows7通过samba共享文件
1. 安装sambasudo yum install samba samba-client -y2. 创建用户和权限sudo adduser samba#如果需要组授权,可以创建组,并把用户加入组中,如果不需要,可以不用创建# groupadd sharewindow# usermod -a -G sharewindow samba# 创建目录mkdir /var/mirror #如果只是临时文件传输,可以使用/tmp目录,系统重启就自动删除sudo chmod 777 /var/mi
2021-12-09 22:40:25
1094
原创 ffmpeg启用lib264编译错误relocation R_X86_64_32 against .rodata‘ can not be used when making a shared obj
错误信息/usr/bin/ld: libavcodec/mqc.o: relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: libavcodec/mqcdec.o: relocation R_X86_64_32S against undefined symbolff_mqc_qe’ can not be used when
2021-12-03 00:05:47
2595
3
原创 protobuff序列化二进制包格式解析
protomessage Req{ string spid = 1; // 商户号 // [required=true] string sign = 2; // 签名 // [required=true,minLen=1 , maxLen=64,cnName="requestId"] string request_id = 3; // 请求ID // [required=true] string client_ip = 4; // 请求方 ip // [requir
2021-12-02 17:33:24
2864
原创 github Support for password authentication was removed
问题2021年8月13号,github做了重大权限变更,不需要密码来进行身份验证,而是需要个人访问令牌。输入个人密码会提示如下错误:remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.remote: Please see https://github.blog/2020-12-15-token-authenticati
2021-09-30 23:55:23
340
原创 golang iso8601转换成东八时区
RTfunc ConverTime(iso8601 string) string { //这个必须加UTC参数,不加本地测试和服务器上不一致 t, err := time.ParseInLocation(time.RFC3339, iso8601, time.UTC) if err != nil { return iso8601 } //设置东八区 cz := time.FixedZone("CST", 8*3600) return t.In(cz).Format("2006-01-02
2020-11-19 20:45:42
1742
原创 Istio实战——什么是Istio
文章目录1. 什么是 Istio?2. 什么是服务网格?3. 为什么使用 Istio?5. Istio的框架图1. 什么是 Istio?Istio 有助于减少部署的复杂性,并减轻开发团队的压力。部署的复杂性,主要是微服务的增加所带来的。开发团队的什么压力呢?主要是传统的业务开发有时候不得不关注基础的监控,日志,跟踪等遥测能力,而让业务开发变得复杂。服务网格可以把这些东西剥离出来并下沉成框架能力。它是一个平台,具有很强的扩展性,集成不同的日志、遥测或策略系统。具有多样特性,对外提供统一的方式来保护(安
2020-08-06 11:13:18
415
原创 Istio实战——流量管理
文章目录流量管理1.1 virtual service1.2 Destination rules1.3 Gateway1.4 Service entries1.5 Sidecars总结流量管理通过配置路由调整服务之间的流量,支持AB测试,金丝雀测试和流量百分比分发,支持断路器,超时和重试。流量管理 的API 资源包括:virtual service 虚拟服务Destination rulesgatewayservice entriessidecars1.1 virtual servic
2020-08-06 11:11:30
994
原创 working directory is not part of a module
client.go:9:2: cannot find module providing package google.golang.org/grpc: working directory is not part of a module因为开启mod模式了export GO111MODULE=auto另外一种方法就是使用mod模式export GO111MODULE=ongo mod initgo mod vendor#缺少什么包,go get什么包...
2020-07-14 20:52:48
8706
原创 升级golang
升级go版本git clone https://github.com/udhos/update-golangcd update-golangsudo ./update-golang.sh参考:https://gist.github.com/nikhita/432436d570b89cab172dcf2894465753
2020-06-16 11:26:51
321
原创 CentOS7下libstdc++.so.6: version `GLIBCXX_3.4.21' not found 的解决办法
问题背景最新搞 webassembly 安装emcc 遇到这个问题emcc hello.c -o hello.html -static-libgcc -static-libstdc++/root/emsdk/upstream/bin/llc: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /roo...
2020-03-17 23:37:20
5701
2
原创 ServiceMesh实战-服务网格是什么?
文章目录1. Service Mesh2. 服务拓扑3. 微服务4. 容器5. 服务治理6. 微服务,容器,服务治理和服务网格的关系7. 服务网格要做什么总结后话参考文献 牛顿有曰:如果说我看得比别人更远些,那是因为我站在巨人的肩膀上。 学习前人的成果,就是先努力站到巨人的肩膀上;掌握前人的成果是前进的必要过程。有...
2020-03-14 14:46:53
1635
原创 Element el-upload 自定义上传单个指定格式文件
后台玩前端,第一次使用VUE+Element。对于文件上传这一块折腾了好久才搞定,记个笔记。同时帮助需要的人。VUE代码如下:<el-upload class="upload-demo" ref="upload-demo" action="http://localhost" accept=".xlsx,.xls" :limit="2" :on-pre...
2020-02-14 19:38:55
2907
原创 mysql使用FROM_UNIXTIME将时间戳按日期group by
1.功能将Unix时间戳转换成指定或默认的日期字符串官宣。它具有的特点使用整型的高效存储和查询时间(时间戳)使用此函数兼容日期的时间处理(可读性)2. 语法FROM_UNIXTIME(unix_timestamp[,format])即:省略格式化字符串和指定格式化字符串,两种方式FROM_UNIXTIME(unix_timestamp)FROM_UNIXTIME(unix_t...
2019-11-29 13:41:30
2356
原创 农历过生日准确吗?不准确
农历和阳历农历以月亮绕地球的时间为准;阳历以地球绕太阳的时间为准。月亮绕地球一周,以不同的参考系时间不同,这里选择太阳为参考系来算,不选择地球为参考系的原因是地球的自转会增加计算的复杂度。这个时间是29.530 589天。地球绕太阳一圈定义为一回归年,这个时间多于365天,约等于365.24219天。天又是个什么单位,地球自转一周为一天,这是常用的定义,天文上称为恒星日;它的时间是23时56...
2019-08-10 11:21:19
2861
原创 Golang json反序列化使用interface泛型接收整型值会得到float64
RTtype Test struct { Value inteface{} `json:"value"`}请求json{ "value":123,}得到类型是float64var test Testtest.Value.(float64)//如果想使用整型,需要强转一下参考:https://blog.youkuaiyun.com/chuanglan/article/details/...
2019-08-02 20:41:20
2650
原创 httpd 400 Bad Request
0. web请求服务返回400服务器日志/var/log/httpd/error_log[Thu Aug 01 15:22:48.690943 2019] [suexec:notice] [pid 7181] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)AH00558: httpd: Could not reli...
2019-08-01 15:51:01
1382
原创 ssl PEM_read_bio:bad end line
KEY/CSR/SSL证书匹配工具openssl x509 -noout -modulus -in certificate.crt | openssl md5openssl rsa -noout -modulus -in privateKey.key | openssl md5openssl req -noout -modulus -in CSR.csr | openssl md5执行第...
2019-07-22 15:08:20
1648
原创 Go-Gin上使用SSL
自签openssl req -newkey rsa:4096 -nodes -keyout server.key -out server.csropenssl x509 -signkey server.key -in server.csr -req -days 365 -out server.crt示例package mainimport ( "github.com/gin-gon...
2019-07-17 12:44:41
2418
原创 mac终端设置不同文件类型显示不同的颜色
打开~/.bash_profile文件,添加如下两行命令export CLICOLOR=1export LSCOLORS=ExFxCxDxBxegedabagacad然后生效配置即可。source ~/.bash_profile效果如下图所示:
2019-06-15 19:03:02
1938
原创 windows git Authentication failed for 权限失败
导致原因就是远程git密码变更导致本地密码失效了,window与linux或者mac不同,解决办法是删除window下的git凭据,操作流程参考这里:https://blog.youkuaiyun.com/qq_40028324/article/details/80883010...
2019-06-05 10:17:28
1301
原创 minikube OSX安装
四步安装命令#1.安装vsboxbrew cask install virtualbox#2.安装dockerbrew install docker#3.安装kubectlbrew install kubectl#4.下载minikuber安装curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1....
2019-05-23 17:35:54
348
原创 assertion: 18 { ok: 0.0, errmsg: "auth failed", code: 18 }
0、mongorestore报错mongorestore -h 172.0.0.10:xxx -u xxx -p xxx -d aeras 执行恢复数据库出现RT鉴权失败错误assertion: 18 { ok: 0.0, errmsg: "auth failed", code: 18 }1、解决办法方案1. 加上参数--authenticationDatabase admin方...
2019-05-10 11:37:11
2412
原创 Fix rpmdb: Thread died in Berkeley DB library
mkdir /var/lib/rpm/backupcp -a /var/lib/rpm/__db* /var/lib/rpm/backup/rm -f /var/lib/rpm/__db.[0-9][0-9]*rpm --quiet -qarpm --rebuilddbyum clean all参考链接:https://cloudlinux.zendesk.com/hc/en-us/...
2019-05-07 20:05:53
298
原创 linux下安装vue
yum install nodejsnpm install -g cnpmcnpm install -g vue-clivue --vesion搞定,安装cnpm的目的是因为npm太慢
2019-05-07 19:57:59
2404
原创 golang templge range struct list
0.目标使用golang "text/template"库实现插入sql模板1.实现示例//结构体type Person struct { Name string Age int32}//模板语句var InsertPersonInfoSql = `insert into {{.Table}} (name, age, create_time)values{{ rang...
2019-04-23 17:26:15
517
原创 ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
docker-compose -f xxx.yml up 时报错RT解决办法:service docker status 确认是否运行然后使用root权限执行命令
2019-04-17 10:18:51
15840
3
原创 MongoDB删除指定字段
db.collection.update({},{"$unset":{"key":""}},{multi:true})设置用$set
2019-04-16 11:43:13
3752
原创 redis的list为空时为什么键被删除
一个协程brpop在一个redis list队列上,当list为空时,使用key查询redis db,发现此队列的key不存在;只有当list不空时才能keys到。从源码中剖析下原因
2019-04-15 19:26:45
5579
3
原创 leetcode-572. 另一个树的子树
0.问题给定两个非空二叉树 s 和 t,检验 s 中是否包含和 t 具有相同结构和节点值的子树。s 的一个子树包括 s 的一个节点和这个节点的所有子孙。s 也可以看做它自身的一棵子树。链接1.实现/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *le...
2019-04-13 13:56:47
366
1
原创 go mod vendor:modules disabled inside GOPATH/src by GO111MODULE=auto
问题使用go mod vendor 时,返回RT错误解决办法$ GOPATH=""即取消GOPATH的设置
2019-04-03 10:52:41
7062
原创 expect传入参数和程序执行命令不成功问题
1.expect 关键字send: 向进程发送字符串,用于模拟用户的输入。注意一定要加\r回车expect: 从进程接收字符串spawn: 启动进程(由spawn启动的进程的输出可以被expect所捕获)interact: 用户交互2.如何向expect脚本传入参数set <变量名称> [lindex $argv <param index>]注意下标从0...
2019-04-02 19:13:36
3554
原创 golang 结构体匿名成员不能用于mgo的tag读取
Go允许我们定义不带名称的结构体成员,只需要指定类型即可,这种结构体成员称为匿名成员,比如type Point struct { X int `bson:"x"` Y int `bson:"y"`}type Circle struct { Point Radius int `bson:"redius"`}这个匿名成员,在json的tag中是可以正常的反序列化的,但是mgo的b...
2019-04-02 13:16:59
1021
1
原创 golang mongodb insert时候获取插入的ID
RT不像mysql,有直接的接口可用,不过可以绕道而行先生成ID,再插入import "gopkg.in/mgo.v2/bson"id := bson.NewObjectId()bson.M{"_id": id, ...}
2019-03-29 21:21:44
4517
C语言中常见问题的算法与程序总结
2010-12-04
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人