10 2023 档案
摘要:临时配置,在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple pip install -i https://pypi.tuna.tsinghua.edu.cn/simple django pip install -r .\requireme
阅读全文
摘要:promethus监控k8s有两种方式,一直是k8s搭建自己监控自己 第二种是外部搭建好了promethus,k8s搭建pod收集信息 yaml地址为 https://github.com/starsliao/Prometheus/tree/master/kubernetes 或者 https://
阅读全文
摘要:<?php // 定义坐标结构 class Coordinate { public $x; public $y; public function __construct($x, $y) { $this->x = $x; $this->y = $y; } } // 定义地图大小 define("ROW
阅读全文
摘要:package main import ( "fmt" ) // 定义坐标结构 type Coordinate struct { x, y int } // 定义地图大小 const ( rows = 4 cols = 4 ) // 定义地图数组 var grid = [][]int{ {0, 1,
阅读全文
摘要:logrus目前以及不维护了,care的话可以用zap package xlog import ( "bufio" "fmt" "github.com/sirupsen/logrus" rotatelogs "github.com/lestrrat-go/file-rotatelogs" "gith
阅读全文
摘要:go get github.com/spf13/viper config.toml title = "toml exaples" redis = "127.0.0.1:3300" [mysql] host = "192.168.1.1" ports = 3306 username = "root"
阅读全文
摘要:WaitGroup 主要用于控制任务组下的并发子任务。它的具体做法就是,子任务 goroutine 执行前通过 Add 方法添加任务数目,子任务 goroutine 结束时调用 Done 标记已完成任务数,主任务 goroutine 通过 Wait 方法等待所有的任务完成后才能执行后续逻辑 pack
阅读全文
摘要:package main import ( "fmt" _ "github.com/go-sql-driver/mysql" "xorm.io/xorm" ) type PointInfo struct { Id int64 `xorm:"pk autoincr"` ProductKey strin
阅读全文
摘要:有时候拼接es语法太麻烦了,熟悉mysql的同学可以用mysql语法,6.X以上的es版本都支持 package main import ( "bytes" "encoding/json" "fmt" "github.com/elastic/go-elasticsearch/v8" "log" )
阅读全文
摘要:package main import "fmt" // MyInt ~表示不仅支持int8, 还支持int8的衍生类型int8A和int8B type MyInt interface { int | ~int8 | int16 | int32 | int64 } func getMaxNum[T
阅读全文
摘要:首先新建Service,名称叫做server-api vim /lib/systemd/system/server-api.service 或者 vim /etc/systemd/system/server-api.service [Unit] Description=grave server [S
阅读全文
摘要:项目目录 ├── asset // 静态资源文件 │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ └── jquery.js ├── go.mod ├── go.sum ├── html // html模版文件 │ └── index.html └─
阅读全文
摘要:安装cerbot apt install certbot 执行 you.cn 换成对应的域名 certbot certonly -d *.you.cn --manual --preferred-challenges dns --server https://acme-v02.api.letsencr
阅读全文
摘要:安装htpassed工具 yum -y install httpd-tools 或者 apt install apache2-utils 创建用户名和密码 htpasswd -c /etc/nginx/.htpasswd username 修改nginx配置文件 server { listen ;
阅读全文
摘要:创建服务器证书秘钥文件 [root@Nginx ~]# openssl genrsa -des3 -out server.key 1024 ... Enter pass phrase for server.key: # 输入密码 Verifying - Enter pass phrase for s
阅读全文
摘要:1,借助linux系统命令 /usr/bin/uuidgen 1.1 代码 package main import ( "fmt" "log" "os/exec" ) func main(){ out,err := exec.Command("uuidgen").Output() if err!=n
阅读全文
摘要:创建账号 CREATE USER '账号'@'%' IDENTIFIED BY '密码'; mysql8的话需要改一下加密方式 ALTER USER '账号'@'%' IDENTIFIED WITH mysql_native_password BY '密码'; 创建数据库,必须要有库,不然无法绑定
阅读全文
摘要:UPDATE user SET age = CASE id WHEN 1 THEN 3 WHEN 2 THEN 4 WHEN 3 THEN 5 END WHERE id IN (1,2,3) php示例 $display_order = array( 1 => 4, 2 => 1, 3 => 2,
阅读全文
摘要:pecl安装 apt-get install libevent-dev -y # 如果无法安装,请尝试以下命令 # apt-get install libevent2-dev -y pecl install event 注意提示:Include libevent OpenSSL support [y
阅读全文
摘要:更新,加入源 apt-get update apt -y install software-properties-common 安装存储库 ppa:ondrej/php,它提供所有 PHP 版本 add-apt-repository ppa:ondrej/php apt-get update 开始安
阅读全文
摘要:生产者 package main import ( "fmt" "github.com/streadway/amqp" "strconv" "time" ) // 启动生产者,n秒之内,如果consume没有消费,那么就会被die-死信队列消费 func main() { // # 1.创建连接 m
阅读全文
摘要:如果您已将公钥添加到GitLab,并且仍然每次都要求输入用户名和密码,这可能是由于使用了HTTPS URL而非SSH URL来访问GitLab仓库。 当使用HTTPS URL时,GitLab将要求输入用户名和密码来进行身份验证,即使您已将SSH公钥添加到GitLab中。要解决这个问题,您需要将仓库的
阅读全文

浙公网安备 33010602011771号