跳转到内容

SRE笔记

  • 密码
    • 短链
  • 服务器
  • 关于

1月 2022每月档案

git记住用户名密码

git config –global credential.helper store pull一次… 继续阅读 git记住用户名密码

  • 发表于: 2022-01-30 2022-01-30
  • 作者: stnds
  • 分类: SRE
  • 标签: bash, git, https
  • 发表评论: git记住用户名密码

go mod私有仓库环境变量

env: go env -w GOPRIVATE=”hub.my.com” //配置私有仓库域名 g… 继续阅读 go mod私有仓库环境变量

  • 发表于: 2022-01-30 2022-01-30
  • 作者: stnds
  • 分类: SRE
  • 标签: bash, http, https
  • 发表评论: go mod私有仓库环境变量

docker run adult-image-detector图像内容检测

https://github.com/open-dating/adult-image-detecto… 继续阅读 docker run adult-image-detector图像内容检测

  • 发表于: 2022-01-25 2022-01-25
  • 作者: stnds
  • 分类: SRE
  • 标签: bash, curl, Docker, http, https
  • 发表评论: docker run adult-image-detector图像内容检测

golang字符串截取

s := “abcdefg” fmt.Println(s[0:6]) //包含起始位置,不包含结束位… 继续阅读 golang字符串截取

  • 发表于: 2022-01-24 2022-01-24
  • 作者: stnds
  • 分类: SRE
  • 标签: go, golang, https
  • 发表评论: golang字符串截取

map[string]interface{} 转为string

res := make(map[string]interface{}) dataType , _ :… 继续阅读 map[string]interface{} 转为string

  • 发表于: 2022-01-24 2022-01-24
  • 作者: stnds
  • 分类: SRE
  • 标签: https, json, make
  • 发表评论: map[string]interface{} 转为string

golang time.Now()格式化

nowTime := time.Now() year := time.Now().Year() mo… 继续阅读 golang time.Now()格式化

  • 发表于: 2022-01-24 2022-01-24
  • 作者: stnds
  • 分类: SRE
  • 标签: go, golang
  • 发表评论: golang time.Now()格式化

gorm使用连接池

//db, err = gorm.Open(“mysql”, “root:password@tcp(… 继续阅读 gorm使用连接池

  • 发表于: 2022-01-23 2022-01-23
  • 作者: stnds
  • 分类: SRE
  • 标签: gorm, https, MySQL, tcp
  • 发表评论: gorm使用连接池

gorm 使用内存中的SQLite

package util import ( “gorm.io/driver/sqlite” “gor… 继续阅读 gorm 使用内存中的SQLite

  • 发表于: 2022-01-23 2022-01-23
  • 作者: stnds
  • 分类: SRE
  • 标签: cache, gorm, https, I/O, SQLite
  • 发表评论: gorm 使用内存中的SQLite

gorm自定义CreatedAt值

db.Create(&user) // 将 `CreatedAt` 设为当前时间 // 想要… 继续阅读 gorm自定义CreatedAt值

  • 发表于: 2022-01-23 2022-01-23
  • 作者: stnds
  • 分类: SRE
  • 标签: gorm, https
  • 发表评论: gorm自定义CreatedAt值

gorm自定字段名

type Student struct { Age int64 `gorm:”column:his_… 继续阅读 gorm自定字段名

  • 发表于: 2022-01-22 2022-01-22
  • 作者: stnds
  • 分类: SRE
  • 标签: gorm, https
  • 发表评论: gorm自定字段名

gorm字段使用自定义前缀

type Blog struct { ID int Author Author `gorm:”emb… 继续阅读 gorm字段使用自定义前缀

  • 发表于: 2022-01-22 2022-01-22
  • 作者: stnds
  • 分类: SRE
  • 标签: gorm, https
  • 发表评论: gorm字段使用自定义前缀

Scan error on column index 1, name “created_at”: unsupported Scan, storing driver.Value type []uint8

解决办法: root:123456@tcp(127.0.0.1:3306)/testdb?chars… 继续阅读 Scan error on column index 1, name “created_at”: unsupported Scan, storing driver.Value type []uint8

  • 发表于: 2022-01-22 2022-01-22
  • 作者: stnds
  • 分类: SRE
  • 标签: bash, https, tcp
  • 发表评论: Scan error on column index 1, name “created_at”: unsupported Scan, storing driver.Value type []uint8

gorm insert捕获失败情况

newUser := model.User{ Phone: phone, Password: str… 继续阅读 gorm insert捕获失败情况

  • 发表于: 2022-01-22 2022-08-05
  • 作者: stnds
  • 分类: SRE
  • 标签: gorm, http, https
  • 发表评论: gorm insert捕获失败情况

mysql data_time增加天数

update t1 set ArrivalDate=date_add(ArrivalDate, in… 继续阅读 mysql data_time增加天数

  • 发表于: 2022-01-22 2022-01-22
  • 作者: stnds
  • 分类: SRE
  • 标签: https, MySQL, sql
  • 发表评论: mysql data_time增加天数

kill信号列表

$ kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL… 继续阅读 kill信号列表

  • 发表于: 2022-01-20 2022-01-20
  • 作者: stnds
  • 分类: SRE
  • 标签: bash
  • 发表评论: kill信号列表

gin router 限制multipart forms内存

func main() { router := gin.Default() // 为 multipa… 继续阅读 gin router 限制multipart forms内存

  • 发表于: 2022-01-19 2022-01-19
  • 作者: stnds
  • 分类: SRE
  • 标签: gin, golang, http, https
  • 发表评论: gin router 限制multipart forms内存

gorm设置最大连接数和最大闲置数

//默认0表示不限制 db.DB().SetMaxIdleConns(2000) db.DB().S… 继续阅读 gorm设置最大连接数和最大闲置数

  • 发表于: 2022-01-19 2022-01-19
  • 作者: stnds
  • 分类: SRE
  • 标签: gorm, https
  • 发表评论: gorm设置最大连接数和最大闲置数

gorm创建表语句添加后缀

db.Set(“grom:table_options”, “ENGINE=InnoDB”)

  • 发表于: 2022-01-19 2022-01-19
  • 作者: stnds
  • 分类: SRE
  • 标签: gorm, https
  • 发表评论: gorm创建表语句添加后缀

gorm全局禁用表名复数

// 如果设置为true,`User`的默认表名为`user`,使用`TableName`设置的表名… 继续阅读 gorm全局禁用表名复数

  • 发表于: 2022-01-19 2022-01-19
  • 作者: stnds
  • 分类: SRE
  • 标签: gorm, https
  • 发表评论: gorm全局禁用表名复数

gorm打开sql日志

db.LogMode(true)

  • 发表于: 2022-01-19 2022-01-19
  • 作者: stnds
  • 分类: SRE
  • 标签: gorm, https, sql
  • 发表评论: gorm打开sql日志

分页

页码: 1 页码: 2 页码: 3 下一页

搜索

搜索:

近期评论

  • test发表在《gin不转义html标签》
  • 路过发表在《msg=”getting status of runtime: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService”》
  • 禁止chrome浏览器http自动转成https – SRE笔记发表在《nginx安全配置 XSS攻击 Header头设置》
  • springboot lifecycle timeout-per-shutdown-phase优雅退出 – SRE笔记发表在《terminationGracePeriodSeconds优雅终止pod时间》
  • kubernetes Deployment快速部署rocketmq 4.9.2 dledger集群 3-broker – SRE笔记发表在《kubernetes Deployment快速部署rocketmq 4.9.2 dledger集群 1-镜像》

标签

aws (15) azure (12) Blockchain (28) centos (28) Docker (105) elasticsearch (26) eth (34) fil (39) go (129) golang (120) Grafana (13) hpc (15) http (299) ingress (14) java (75) jenkins (13) JVM (20) kubernetes (309) Linux (439) lotus (30) mongoDB (41) MySQL (184) nginx (112) Oracle (13) php (25) python (148) redis (34) s3 (75) shell (20) springboot (32) tomcat (15) ubuntu (31) vue (18) windows (42) wordpress (14) zabbix (37) zookeeper (13) 夏小胖 (31) 安全 (55) 工具 (451) 折腾 (24) 推荐 (15) 硬件 (61) 网络 (246) 资源 (49)

归档

  • 2022年12月
  • 2022年11月
  • 2022年10月
  • 2022年9月
  • 2022年8月
  • 2022年7月
  • 2022年6月
  • 2022年5月
  • 2022年4月
  • 2022年3月
  • 2022年2月
  • 2022年1月
  • 2021年12月
  • 2021年11月
  • 2021年10月
  • 2021年9月
  • 2021年8月
  • 2021年7月
  • 2021年6月
  • 2021年5月
  • 2021年4月
  • 2021年3月
  • 2021年2月
  • 2021年1月
  • 2020年12月
  • 2020年11月
  • 2020年10月
  • 2020年9月
  • 2020年8月
  • 2020年7月
  • 2020年6月
  • 2020年5月
  • 2020年4月
  • 2020年3月
  • 2020年2月
  • 2020年1月
  • 2019年12月
  • 2019年11月
  • 2019年10月
  • 2019年9月
  • 2019年8月
  • 2019年7月
  • 2019年6月
  • 2019年5月
  • 2019年4月
  • 2019年3月
  • 2019年2月
  • 2019年1月
  • 2018年12月
  • 2018年11月
  • 2018年10月
  • 2018年9月
  • 2018年8月
  • 2018年7月
  • 2018年6月
  • 2018年5月
  • 2018年4月
  • 2018年3月
  • 2018年2月
  • 2018年1月
  • 2017年12月
  • 2017年11月
  • 2017年10月
  • 2017年8月
  • 2017年7月
  • 2017年6月
  • 2017年5月
  • 2017年4月
  • 2017年3月
  • 2017年2月
  • 2017年1月
  • 2016年12月
  • 2016年11月
  • 2016年10月
  • 2016年9月
  • 2016年8月
  • 2016年7月
  • 2016年6月
  • 2016年5月
  • 2016年4月
  • 2016年3月
  • 2016年2月
  • 2016年1月
  • 2015年12月
  • 2015年10月
  • 2015年9月
  • 2015年8月
  • 2015年7月
  • 2015年6月
  • 2015年5月
  • 2015年4月
  • 2015年3月
  • 2015年2月
  • 2015年1月
  • 2014年12月
  • 2014年11月
  • 2014年10月
  • 2014年9月
  • 2014年8月
  • 2014年7月
  • 2014年6月
  • 2014年5月
  • 2014年2月