ASP.NET CORE 接口统一返回过滤器
新增ApiResultFilterAttribute.cs文件1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950namespace Athena.Infrastructure.Mvc.Attributes;/// <summary>/// API结果统一处理过滤器/// </summary>// ReSharper disable once ClassNeverInstantiated.Globalpublic class ApiResultFilterAttribute : ActionFilterAttribute{ public override void OnActionExecuted(ActionExecutedContext context) { // 如果数据抛异常了,则直接返回 if (context.Exception != null) & ...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment
自定义.net core runtime Docker镜像
Dockerfile1234567891011121314151617181920212223242526272829303132333435363738394041ARG UBUNTU_VERSION=18.04FROM ubuntu:${UBUNTU_VERSION}ARG DOTNET_VERSION=5.0RUN cd /tmp \ # 镜像源 && sed -i 's@/deb.debian.org/@/mirrors.aliyun.com/@g' /etc/apt/sources.list \ && apt-get update \ && apt-get install apt-utils libgdiplus libc6-dev -y \ && apt install -y wget \ # 下载安装AspnetCore运行时 && wget https://packages.microsoft.com/conf ...
使用Python批量上传文件到七牛云
环境准备七牛云申请 AccessKey 和 SecretKeyhttps://www.qiniu.com/products/kodo#docs
安装 Python 的 SDK文档地址
https://developer.qiniu.com/kodo/1242/python#4
1pip3 install qiniu
安装 Python 运行环境https://www.runoob.com/python3/python3-install.html
编写代码新建upload_help.py文件123456789101112131415161718192021222324252627282930313233343536373839# -*- coding: utf-8 -*-# flake8: noqafrom qiniu import Auth, put_file# 需要填写你的 Access Key 和 Secret Keyaccess_key = '申请到的AccessKey'secret_key = '申请到的SecretKey'glob ...
Hello SpringBoot
Spring BootSpring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can “just run”.
We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need minimal Spring configuration.
If you’re looking for information about a specific version, or instructions about how to upgrade from an earlier release, check out the project release notes section on our wiki.
FeaturesC ...
.net core 使用MailKit发送邮件
配置类1234567891011121314151617181920212223242526272829303132333435363738394041424344namespace Configs{ /// <summary> /// 邮箱配置 /// </summary> public class EMailConfig { /// <summary> /// SMTP服务器 /// </summary> /// <value></value> public string SMTPService { get; set; } /// <summary> /// 端口 /// </summary> /// <value></value> public int P ...
MySQL 主从配置
安装、配置mysql安装mysql master、slave安装master12345678910111213141516# 主机1#创建外部存储的路径sudo mkdir /usr/local/docker/volumes#进入挂载文件的路径cd /usr/local/docker/volumes#安装mysql docker run \ -it \ -p 3306:3306 \ --name mysql-master \ -v $PWD/mysql/conf:/etc/mysql/conf.d \ -v $PWD/mysql/logs:/logs \ -v $PWD/mysql/data:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD=@123123qq \ -e TZ=Asia/Shanghai \ -d mysql:5.7
安装slave12345678910111213141516# 主机2#创建外部存储的路径sudo mkdir /usr/local/docker/volumes#进入挂载文件的路径cd /usr/local/docker/ ...
在CentOS 7.x下安装Docker
使用yum更新系统软件1yum update -y
使用curl安装最新版Docker1curl -fsSL https://get.docker.com/ | sh
使用systemctl启动Docker1systemctl start docker
设置Docker开机自启1systemctl enable docker
查看Docker版本信息1docker version
Client: Docker Engine - Community Version: 19.03.8 API version: 1.40 Go version: go1.12.17 Git commit: afacb8b Built: Wed Mar 11 01:21:11 2020 OS/Arch: darwin/amd64 Experimental: false
Server: Docker Engine - Community Engine: Version: ...
Docker下安装TeamCity
快速导航
安装teamcity-server
安装teamcity-agent
安装步骤安装teamcity-server1docker run -it -d --name teamcity-server -p 8111:8111 -v $PWD/teamcity_server/datadir:/data/teamcity_server/datadir jetbrains/teamcity-server
安装teamcity-agent123456789docker run -it -d --name teamcity-agent -e SERVER_URL="172.31.32.9:8111" \ -v $PWD/conf:/data/teamcity_agent/conf \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $PWD/opt/buildagent/work:/opt/buildagent/work \ -v $PWD/opt/buildagent/temp:/op ...
My New Post
Master 配置1234567[mysqld]# mysql二进制日志取名为mysql-binlog-bin=mysql-bin# 二进制日志的格式,有三种:statement/row/mixed,具体分别不多做解释,这里使用mixedbinlog_format=mixed# 为服务器设置一个独一无二的id便于区分,这里使用ip地址的最后一位充当server-id server-id=101
Slave 配置1234567[mysqld]# mysql二进制日志取名为mysql-binlog-bin=mysql-bin# 二进制日志的格式,有三种:statement/row/mixed,具体分别不多做解释,这里使用mixedbinlog_format=mixed# 为服务器设置一个独一无二的id便于区分,这里使用ip地址的最后一位充当server-id server-id=102
1CHANGE MASTER TO MASTER_HOST="172.17.0.2", MASTER_USER="slave", MASTER_PASSWORD= ...