Android/Ios 使用Fiddler抓http/https包

Fiddler基础配置

1、安装fiddler 下载地址 https://www.telerik.com/download/fiddler

2、Tools->Options 进行配置

a. Connections 配置
设置 Fiddler listens on port 8888
勾选 Allow remote computers to connect
勾选 Reuse client connection
勾选 Reuse server connections
勾选 Act as system proxy on startup

b. Https 配置
勾选 Capture HTTPS CONNECTs
勾选 Decrypt HTTPS traffic
勾选 Ignore server certificate erros(unsafe)

客户端配置

  1. 连接WiFi
    设置-Wlan-右键WiFi名称->高级选项 填入本机IP 加端口号8888

  2. 信任证书
    客户端浏览器访问 http://本机IP:8888/
    点击“FiddlerRoot certificate”,安装即可

以Curl请求方式导出Fiddler会话

点击选中会话->File->Export Session ->选择curl->保存到文件

Windows安装Curl工具

Windows下排查问题常需要curl进行请求访问,下面记录一下windows安装curl过程:

1、https://curl.haxx.se/download.html#Win64 进行下载

2、新建目录,如C:\curl,将所下载内容解压

3、配置环境变量path,计算机右键->属性->高级系统设置->高级->环境变量->path,进行修改新增;C:\curl

解决WordPress后台登录后报File_not_found问题

wordpress 的后台,一些菜单标题都是相对路径,这样通过访问 www.xxx.us/wp-admin 再点击菜单比如写文章功能,会跳转到 www.xxx.us/post-new.php ,而我们想要的是跳转到 www.xxx.us/wp-admin/post-new.php 这个地址,否则将是会报File not Found

解决方案:

如果用户输入了 www.xxx.us/wp-admin 我们强制加上/ 变成 www.xxx.us/wp-admin/

需要再nginx配置文件中增加配置:

rewrite /wp-adminscheme://hosturi/ permanent;

以上即可~

Windows安装Composer选择php.exe报错问题

环境重装,重新安装一把composer,但是选择php7之后版本报错,本地环境不用php7是绝对不行的…

The PHP exe file you specified did not run correctly:
C:\phpStudy\PHPTutorial\php\php-7.2.1-nts\php.exe

The program failed to run correctly. Try reinstalling the program to fix this problem. Make sure you have installed the appropriate Visual C++ Redistributable.

确定问题,缺少VC14,下载安装之后再安装composer即解决

下载地址:http://www.xdowns.com/soft/184/dll/2016/Soft_164980.html

记得安装完之后重启一下cmd,否则composer命令无法再当前cmd中执行

詹姆斯不会有决定三

总决赛过去了,勇士实力强劲,实至名归。

詹姆斯这个赛季有点悲情色彩,绝对力量是值得尊敬的,每个人都羡慕这种绝对力量,也都希望拥有,得分场均34分,近三双的数据,非常强劲的控制力,最近复联大热,大家给了他一个灭霸的称号。

灭霸詹最终是落败了,篮球就是这个规则,靠的是团队,骑士败了,但是詹姆斯并不是失败者,他的表现早已是个winner。

不过大家开始讨论是否会上演决定三?

我觉得不会,首先

1、克利夫兰是詹姆斯的家,NBA球员大部分都会想在最初的地方

2、决定一成本很大的,球迷都是不理性的,回到骑士拿到冠军好歹追回来一点

3、把家乡球队骑士变得强大吧,换个教练,锻炼好新人

不过写到这里,好担心骑士管理层,毕竟外面诱惑还是很多的,比如我们大马刺…

音乐剧-千万留神

千万留神

讲述的是一个因言语冲突致人轻伤坐牢15年的人,出狱后成为一个演员的一些事情

其中桑医生劝他的一段特别有意思,你要强大,要适应,要改变,不要冲动,不要盲目

可惜没有版权的在线音乐…

《人是鱼变的》歌词:
我们总要
随着社会改变
去强大自己
然后再去
改变世界
哪能万事顺着你
我们必须
适应世界
最终百毒都不侵
然后才能
活在世上
笑看污染满天飞

Fabric 错误异常处理

Fabric是Python编写的自动化运维工具,使用fabric批量去机器上面执行shell脚本的时候,可能会遇到机器故障等情况,造成执行中断,那么能否忽略或者说爆出异常之后继续执行呢?那就需要fabric的异常处理,具体实现参见下面

import logging

try:
    1/0
except Exception as e:
    logging.exception(e)

错误异常打印如下:

ERROR:root:division by zero
Traceback (most recent call last):
  File "/home/padraic/Dropbox/python/py3/size.py", line 105, in <module>
    1/0
ZeroDivisionError: division by zero

Process finished with exit code 0

《一分钟经理人》读书笔记

一分钟经理人这本书比较薄,上下班通勤路上就看完了,包含内容归纳的也比较简洁,印象比较深的是其中一页插图,分别对应着开始时要考虑一分钟目标、成功时要考虑一分钟表扬和失败时应考虑一分钟更正,简洁但不简单,又看了一下Kindle上阅读时的标注,回顾一下书上的内容。
Read more

dependencies.dependency.version missing问题解决

Spring Boot打算引入Redis但是导入依赖包之后却报如下错误

        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-redis</artifactId>
        </dependency>
Project build error: 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-redis:jar is missing.

同时pom配置文件中位置,报如下位置:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.9.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
Multiple annotations found at this line:
    - For artifact {org.springframework.boot:spring-boot-starter-redis:null:jar}: The version cannot be empty. (org.apache.maven.plugins:maven-resources-plugin:2.6:testResources:default-
     testResources:process-test-resources) org.apache.maven.artifact.InvalidArtifactRTException: For artifact {org.springframework.boot:spring-boot-starter-redis:null:jar}: The version cannot be empty. at 
     org.apache.maven.artifact.DefaultArtifact.validateIdentity(DefaultArtifact.java:148) at org.apache.maven.artifact.DefaultArtifact.<init>(DefaultArtifact.java:123) at 
     org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:157) at 
     org.apache.maven.artifact.factory.DefaultArtifactFactory.createDependencyArtifact(DefaultArtifactFactory.java:57) at 
     org.apache.maven.project.artifact.MavenMetadataSource.createDependencyArtifact(MavenMetadataSource.java:328) at 
     org.apache.maven.project.artifact.MavenMetadataSource.createArtifacts(MavenMetadataSource.java:503) at 
     org.apache.maven.lifecycle.internal.DefaultProjectArtifactFactory.createArtifacts(DefaultProjectArtifactFactory.java:50) at 
     org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:119) at 
     org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:257) at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:330) at 
     org.eclipse.m2e.core.internal.embedder.MavenImpl11.call(MavenImpl.java:1362) at org.eclipse.m2e.core.internal.embedder.MavenImpl11.call(MavenImpl.java:1) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112) at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360) at 
     org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137) at org.eclipse.m2e.core.internal.builder.MavenBuilder1.method(MavenBuilder.java:172) at     org.eclipse.m2e.core.internal.builder.MavenBuilder1.method(MavenBuilder.java:1) at org.eclipse.m2e.core.internal.builder.MavenBuilderBuildMethod11.call(MavenBuilder.java:115) at     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112) at org.eclipse.m2e.core.internal.builder.MavenBuilderBuildMethod1.call(MavenBuilder.java:
     105) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151) at     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99) at org.eclipse.m2e.core.internal.builder.MavenBuilderBuildMethod.execute(MavenBuilder.java:
     86) at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200) at org.eclipse.core.internal.events.BuildManager2.run(BuildManager.java:734) at     org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:205) at     org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:245) at org.eclipse.core.internal.events.BuildManager1.run(BuildManager.java:300) at 
     org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303) at 
     org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:359) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:382) at 
     org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235) at 
     org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
    - For artifact {org.springframework.boot:spring-boot-starter-redis:null:jar}: The version cannot be empty. (org.apache.maven.plugins:maven-resources-plugin:2.6:resources:default-
     resources:process-resources) org.apache.maven.artifact.InvalidArtifactRTException: For artifact {org.springframework.boot:spring-boot-starter-redis:null:jar}: The version cannot be empty. at 
     org.apache.maven.artifact.DefaultArtifact.validateIdentity(DefaultArtifact.java:148) at org.apache.maven.artifact.DefaultArtifact.<init>(DefaultArtifact.java:123) at 
     org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:157) at 
     org.apache.maven.artifact.factory.DefaultArtifactFactory.createDependencyArtifact(DefaultArtifactFactory.java:57) at 
     org.apache.maven.project.artifact.MavenMetadataSource.createDependencyArtifact(MavenMetadataSource.java:328) at 
     org.apache.maven.project.artifact.MavenMetadataSource.createArtifacts(MavenMetadataSource.java:503) at 
     org.apache.maven.lifecycle.internal.DefaultProjectArtifactFactory.createArtifacts(DefaultProjectArtifactFactory.java:50) at 
     org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:119) at 
     org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:257) at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:330) at 
     org.eclipse.m2e.core.internal.embedder.MavenImpl11.call(MavenImpl.java:1362) at org.eclipse.m2e.core.internal.embedder.MavenImpl11.call(MavenImpl.java:1) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112) at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360) at 
     org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137) at org.eclipse.m2e.core.internal.builder.MavenBuilder1.method(MavenBuilder.java:172) at     org.eclipse.m2e.core.internal.builder.MavenBuilder1.method(MavenBuilder.java:1) at org.eclipse.m2e.core.internal.builder.MavenBuilderBuildMethod11.call(MavenBuilder.java:115) at     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112) at org.eclipse.m2e.core.internal.builder.MavenBuilderBuildMethod1.call(MavenBuilder.java:
     105) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151) at     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99) at org.eclipse.m2e.core.internal.builder.MavenBuilderBuildMethod.execute(MavenBuilder.java:
     86) at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200) at org.eclipse.core.internal.events.BuildManager2.run(BuildManager.java:734) at     org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:205) at     org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:245) at org.eclipse.core.internal.events.BuildManager1.run(BuildManager.java:300) at 
     org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303) at 
     org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:359) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:382) at 
     org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235) at 
     org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

解决方案

排查一:

是否引入了<parent>标签,如果未引入请引入,或者主动加上version

排查二:

是否dependences包含在了dependencyManagement标签内

排查三:

其中网上搜索了一下很多答案集中在是否引入了parent,但是parent是完整引入的,最终发现原来是因为使用的Spring Boot 1.5,而Spring Boot 1.2之后不再支持spring-boot-starter-redis,更换之后就OK了,至于这两个有何不一致,没什么不一致,为何名称变了,大概可能是为了统一,记录一下,如果遇到的小伙伴麻烦检查一下,是否将 spring-boot-starter-data-redis 写成了spring-boot-starter-redis 。

解决Error: pg_config executable not found问题

最近安装sentry时,需要安装postgresql,但是安装过程中报如下问题

Error: pg_config executable not found.

最终查看pg_config是存在的

sudo find / -name "pg_config" -print

但是path里面没有,直接导入pa_home中bin目录的所有命令解决

export PG_HOME=/usr/pgsql-9.6
export PATH=PATH:PG_HOME/bin