
前端 在浏览器上面唤起微信小程序的代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>标题</title> </head> <body> <script> var openlink = "weixin://dl/business/?t=xxxxx"; // 小程序代码 if(openlink!=''){ window.location = openlink }else{ console.log([])…
前端 vue 部署到Nginx时刷新404
location / { try_files $uri $uri/ /index.html; }
PHP WordPress插件 wp-rocket 高级用法Nginx配置文件
rocket.conf 文件内容 ################################################################################################### # Rocket-Nginx # # Rocket-Nginx is a NGINX configuration to speedup your WordPress # website with the cache plugin WP-Rocket (http://wp-rocket.me) # # Author: Maxime Jobin # URL: https://github.com/maximejobin/rocket-nginx # # Tested with WP-Rocket version: 2.6.15 # Tested with NGINX: 1.8.0 (stable) # # Version 1.1 # ################################################################…
前端 drone 编译 vue或者node之类的项目时使用缓存
下面配置大概的思路是这样的 从本机 /tmp/cache 目录还原缓存 执行更新依赖和编译命令 把最新的依赖复制到b本机 /tmp/cache 目录供下次使用 .drone.yml 文件 kind: pipeline name: default type: docker steps: – name: restore-cache #把缓存目录复制到根目录下的node_modules image: drillster/drone-volume-cache volumes: – name: cache path: /cache settings: restore: true # 这个配置还原缓存的意思 mount: # 此处配置需要复制的路径 – ./node_modules – name: 编译 image: node:12-alpine commands: – yarn – yarn build – name: rebuild-cache # 保存最新缓存到本地 image: drillster/drone-volume-cache volumes: – name: cache path…
服务器 Drone SETTINGS 页面没有 Trusted
近期使用drone,需要用到 volumes 挂载 host 磁盘的时候报错,经过搜索学习,是因为缺少启动配置所致 原安装文章 docker-compose.yml文件缺少一个 environment 新的 docker-compose.yml文件 如下 version: '3' services: drone-server: restart: always image: drone/drone:2 #这里是版本,可选1和2 ports: – "10003:80" volumes: – ./data/drone/:/var/lib/drone/ – ./data/data/:/data/ environment: – DRONE_GITEA_SERVER=https://gitea服务器地址 – DRONE_GITEA_CLIENT_ID=gitea生成的OAuth2客户端ID – DRONE_GITEA_CLIENT_SECRET=gitea生成的OAuth2客户端密钥 – DRONE_SERVER_HOST=drone服务器地址 – DRON…
服务器 centos7下NFS使用与配置学习记录
缘由 最近学习docker 需要部署多个节点,要求挂载配置和日志写入同一个地方,所以就学习了NFS的搭建,在此记录一下 开始 系统 角色 IP centos 7 NFS服务器端 192.168.10.150 centos 7 NFS客户端 192.168.10.151 先决条件 系统centos 7 服务器之间防火墙开放且相互信任 IP 关闭selinux 服务端部署 当前统一使用 centos 7.6 安装NFS服务nfs-untils和rpcbind yum install nfs-utils rpcbind -y 启动rpcbind服务(一定要先启动rpcbind服务再启动nfs服务) 查看rpcbind服务状态 systemctl status rpcbind.service 启动rpcbind服务 systemctl start rpcbind.service 查看rpc [root@service ~]# lsof -i :111 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME systemd 1 root 33u IP…
服务器 docker swarm 通过 docker-compose.yml发布service
docker-compose.yml文件 version: '3.2' services: main: image: registry.cn-shenzhen.aliyuncs.com/xxx/xxx:v0.0.2 ports: – "8080:8080" volumes: – /www/wwwroot/xxx/config:/go/src/config – /www/wwwroot/xxx/res:/go/src/res – /www/wwwroot/xxx/wwwroot:/go/src/wwwroot – /www/wwwroot/xxx/tmp:/go/src/tmp deploy: mode: replicated replicas: 1 执行发布命令 serviceName为服务名,可以自定义 docker stack deploy -c docker-compose.yml serviceName
服务器 docker service create 命令学习记录主要是映射、挂载目录的用法
docker service create –replicas 1 –name hndf-admin-go-api -p 8080:8080 –mount type=bind,src=/www/wwwroot/hndf_admin.devtest/config,dst=/go/src/config –mount type=bind,src=/www/wwwroot/hndf_admin.devtest/res,dst=/go/src/res –mount type=bind,src=/www/wwwroot/hndf_admin.devtest/wwwroot,dst=/go/src/wwwroot –mount type=bind,src=/www/wwwroot/hndf_admin.devtest/tmp,dst=/go/src/tmp registry.cn-shenzhen.aliyuncs.com/xxx/xxx:v0.0.2 –mount type=bind,src=/www/wwwroot/hndf_admin.devtest/tmp,dst=/go/sr…
golang golang 编译时,报错 missing go.sum entry解决方法
增加参数即可 go build -mod=mod
前端 原生js实现类似小程序、uniapp的onShow onHide
直接上代码 // 这里有三个状态 prerender,visible 和 hidden let pageVisibleStatus = document.visibilityState; // 监听页面状态 document.addEventListener('visibilitychange', function() { // 页面状态变化为不可见时触发 if (document.visibilityState == 'hidden') { … } // 页面状态变化为可见时触发 if (document.visibilityState == 'visible') { … } } );
golang 另外一个版本的Dockerfile,记录一下,用于编译golang 的
# builder FROM golang:alpine AS builder ENV GO111MODULE=on ENV GOPROXY="https://goproxy.cn" WORKDIR /go/src/app COPY . . RUN go build . # runner FROM alpine:latest WORKDIR /root/ COPY –from=builder /go/src/app . ENV TZ=Asia/Shanghai EXPOSE 8001 ENTRYPOINT ["./main"]
golang centos 7 下yum方式安装最新的golang环境
首先导入go的yum源 rpm –import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO curl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo 执行安装操作 yum install golang -y 验证版本 go version
服务器 MySQL搭建主从同步
准备 主从数据库版本最好一致 主从数据库内数据保持一致 主数据库:192.168.1.31 /linux 从数据库:192.168.1.32 /linux 在主数据库上的操作 找到配置文件,并修改它,找到[mysqld] log-bin=mysql-bin #开启二进制日志 server-id=31 #设置server-id 重启MySQL,创建同步账号 先登录到主MySQL mysql -uroot -p123 创建同步账号,192.168.% 的意思是授权全部内网访问 mysql> CREATE USER 'repl'@'192.168.%' IDENTIFIED BY 'slavepass';#创建用户 mysql> GRANT REPLICATION SLAVE ON *.* TO 'repl'@'192.168.%';#分配权限 mysql>flush privileges; #刷新权限 查看master状态,记录二进制文件名(mysql-bin.000003…
golang drone部署go项目的一些示例记录
.drone.yml 文件 kind: pipeline type: docker name: default steps: – name: 编译 image: golang:1.16.5-alpine pull: if-not-exists environment: GOPROXY: https://mirrors.aliyun.com/goproxy/ commands: – CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main . – name: 构建镜像 image: plugins/docker pull: if-not-exists settings: mirror: https://xxxx.mirror.aliyuncs.com # 我自己的加速地址 purge: false username: from_secret: docker_user # 在 drone 的 secret 里面设置的变量 password: from_secret: docker_pass # 在 drone 的 sec…


VMware15 安装 mac OS 10.15 调整分辨率

Quartz MySQL Specified key was too long; max key length is 767 bytes

阿里小号突然不能开机了阿里小号客服电话

VMware 安装 Mac os时必要操作

WordPress出现Briefly unavailable for scheduled maintenance. Check back in a minute. 的解决方法

WordPress一次表单设置导致的报错,此表单不安全,因此,系统已关闭自动填充功能

golang 适配器 单例模式

docker-compose.yml 一个细小的配置引起的网络bug

SaiAdmin 基于webman(高性能HTTP服务框架)开箱即用的高质量中后台管理系统
