作者:threeperson

H5 阿里云oss 跨域访问

阿里云oss跨域访问设置 bucket>跨域设置> 源:一定要加http://

threeperson threeperson 发布于 2019-07-12

springcloud微服务上下线管理

我们的微服务是托管在阿里云平台,通过Swarm控制台管理。平台本身是不提供服务的平滑上下线功能的,只有对应的部署功能。 于是我们在我们的内容搭建了一个服务上下线的管理功能,先看一下管理页面。 ![springcloud服务上下线管理](http://dl2.iteye.com/upload/atta

threeperson threeperson 发布于 2019-07-02

nginx 转发其他域名502 403 等问题

由于需要在微信小程序中加载第三方的H5页面,且三方地址不支持https,导致微信小程序无法正常加载页面。 于是乎想到通过nginx转发,但是发现遇到502问题。看来一下nginx转发日志,发现host携带的是代理地址。于是 调整了一下host,问题解决。 ###proxy_set_header Ho

threeperson threeperson 发布于 2019-06-10

mysql 分组取前N名

##表结构 ``` CREATE TABLE tbl_agent_three_copy ( id bigint(20) DEFAULT NULL, uid bigint(20) DEFAULT NULL, article_id bigint(20) DEFAULT NULL, count int(1

threeperson threeperson 发布于 2019-06-10
vue

vue跨域访问服务端

最近一个vue 构建的web项目要添加打点,但是打点服务和web不在同一个域名下,导致web报跨域错误。 打点服务是一个老项目,一直没有碰过,且线上运行正常。为了不引入bug,最好是在不动用服务端代码的情况下,处理 这个跨域访问的问题。 解决方案,nginx里设置打点服务header。 ``` lo

threeperson threeperson 发布于 2019-05-30

shell json解析

最近在做一个基于千万级日志数据的汇总统计。由于数据是json结构,用shell脚本处理时,需要从单条数据上同时读取多字段,没找到合适的办法。于是google了一下,找到了[jq](https://stedolan.github.io/jq/manual/)。安装步骤很简单,不再赘述。 ###日志格式

threeperson threeperson 发布于 2019-05-10

gmail子账号

已 xxoo@gmail.com 为例,如下邮箱名可用于注册三方账号,接收邮件。 xxoo@gmail.com xx.oo@gmail.com x.xoo@gmail.com x.x.o.o@gmail.com xxoo+xxx@gmail.com xx.oo+xxx@gmail.com gamil

threeperson threeperson 发布于 2019-04-26

springboot json和html 通用异常处理

目前我们的服务大多数通过springboot开发的服务端。针对接口返回类型,可以分为json和html两种返回结果。 针对两种返回结果,实现了500 400 通用错误处理逻辑。 ``` package com.xxxx.health.insurance.web; import com.xxxx.he

threeperson threeperson 发布于 2019-04-23

微信右上角分享屏蔽

function onBridgeReady() { WeixinJSBridge.call('hideOptionMenu'); } if (typeof WeixinJSBridge == "undefined") { if (document.addEventListener) { docum

threeperson threeperson 发布于 2019-04-04

日志压缩

``` #!/bin/bash #日志根目录 log_home=/home/data/logs #应用文件夹目录列表 dir=$(ls -l $log_home |awk '/^d/ {print $NF}') #遍历应用目录列表 for i in $dir do #进入应用目录 cd $log_h

threeperson threeperson 发布于 2019-04-03

shell 按日期分组统计

### 日志解析出日期:UID ``` cat 27.log | awk -F "&" '{ print strftime("%Y-%m-%d",substr($6,11,10))":"substr($3,5,7)}' |sort | uniq | awk -F ":" '{s[$1] += 1}E

threeperson threeperson 发布于 2019-03-30

网络流入异常排查

问题描述: 下午四点阿里云发送服务610告警。查看监控发现cpu 内存 网络连接无明显异常。 但是公网流入流出和磁盘IO明显增高。 初步结论: 由于公网流入明显比流出高,断定是有人通过公网上传文件。 定位步骤: 查看指定服务器的最后登录用户 ``` [root@xxxx conf]# last xx

threeperson threeperson 发布于 2019-02-16

springcloud 服务上下线

通过eureka设置微服务上线,下线。 ``` //method=PUT //url = http://name:password@eureka-server-ip:eureka-server-port/eureka/apps/SERVER-NAME/SERVER-IP:SERVER-PORT/st

threeperson threeperson 发布于 2019-01-29

spring-cloud 配置更新触发

#spring-cloud 配置更新触发 ##通过访问端点bus-refresh实现 地址:http://xxxx/actuator/bus-refresh/{服务名称(区分大小写)} 方式:POST 说明:不添加服务名,则更新所有注册到注册中心服务的配置。 举例:http://xxxx/actua

threeperson threeperson 发布于 2018-12-05