摘要: 整理出近几年的随笔笔记分类。 #Java多线程开发系列 Java多线程开发系列-基础 Java多线程开发系列-线程间协作 Java多线程开发系列-线程安全设计 Java多线程开发系列-线程活性故障 Java多线程开发系列-线程管理 CompletableFuture组合异步编程 Swing中的线程并 阅读全文
posted @ 2020-04-08 15:59 昕友软件开发 阅读(488) 评论(0) 推荐(0) 编辑

手动修改fiddle的请求和响应
Rules->Custon Rules,或按Ctrl+R键,编辑 CustomRules.js 代码文件,在OnBeforeRequest函数里修改代码:

添加请求 header(头)

oSession.oRequest["NewHeaderName"] = "New header(头) value";

删除响应 header(头)

oSession.oResponse.headers.Remove("Set-Cookie");

改变请求参数

if (oSession.PathAndQuery=="/version1.css") {
oSession.PathAndQuery="/version2.css";
}

替换请求url指向

if (oSession.HostnameIs("www.baidu.com")) {
oSession.hostname="www.google.com";
}

替换请求url指向和端口

if (oSession.host=="www.baidu.com:8080") {
oSession.host="test.baidu.com:9090";
}

替换请求url指向包含HTTPS tunnels


if (oSession.HTTPMethodIs("CONNECT") && (oSession.PathAndQuery == "www.example.com:443")) {
oSession.PathAndQuery = "beta.example.com:443";
}


if (oSession.HostnameIs("www.example.com")) oSession.hostname = "beta.example.com";

 

替换网页和静态文件

if (oSession.url=="www.example.com/live.js") {
oSession.url = "dev.example.com/workinprogress.js";
}

阻止上载HTTP Cookie

oSession.oRequest.headers.Remove("Cookie");

解压缩并取消解压HTTP响应

// Remove any compression or chunking from the response in order to make it easier to manipulate
oSession.utilDecodeResponse();

在HTML中搜索和替换

if (oSession.HostnameIs("www.baidu.com") && oSession.oResponse.headers.ExistsAndContains("Content-Type","text/html")){
oSession.utilDecodeResponse();
oSession.utilReplaceInResponse('<b>','<u>');
}

响应HTML的不区分大小写搜索.

if (oSession.oResponse.headers.ExistsAndContains("Content-Type", "text/html") && oSession.utilFindInResponse("searchfor", false)>-1){
oSession["ui-color"] = "red";
}

删除所有DIV标记(以及DIV标记内的内容)

// If content-type is HTML, then remove all DIV tags
if (oSession.oResponse.headers.ExistsAndContains("Content-Type", "html")){
// Remove any compression or chunking
oSession.utilDecodeResponse();
var oBody = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);

// Replace all instances of the DIV tag with an empty string
var oRegEx = /<div[^>]*>(.*?)<\/div>/gi;
oBody = oBody.replace(oRegEx, "");

// Set the response body to the div-less string
oSession.utilSetResponseBody(oBody); 
}

模拟HTTP基本身份验证(要求用户在显示web内容之前输入密码。)

if ((oSession.HostnameIs("www.example.com")) && 
!oSession.oRequest.headers.Exists("Authorization")) 
{
// Prevent IE's "Friendly Errors Messages" from hiding the error message by making response body longer than 512 chars.
var oBody = "<html><body>[Fiddler] Authentication Required.<BR>".PadRight(512, ' ') + "</body></html>";
oSession.utilSetResponseBody(oBody); 
// Build up the headers
oSession.oResponse.headers.HTTPResponseCode = 401;
oSession.oResponse.headers.HTTPResponseStatus = "401 Auth Required";
oSession.oResponse["WWW-Authenticate"] = "Basic realm=\"Fiddler (just hit Ok)\"";
oResponse.headers.add("Content-Type", "text/html");
}

 

posted @ 2020-12-09 17:02 昕友软件开发 阅读(1965) 评论(0) 推荐(1) 编辑
摘要: import-to-hdfs 关系数据库导出数据到hdfs&hive sqoop用于关系数据库和hadoop家族(hdfs、hive、hbase)之间的ETL 数据库导出到hadoop家族:sqoop import hadoop家族导出到数据库:sqoop export 下载:http://www. 阅读全文
posted @ 2020-11-25 10:06 昕友软件开发 阅读(442) 评论(0) 推荐(0) 编辑
摘要: 进程信息jpsjps -l 输出应用程序main.class的完整package名或者应用程序jar文件完整路径名jps -v 输出传递给JVM的参数 查看正在运行的java程序的扩展参数jinfo 16439 线程信息 jstack 更多https://www.cnblogs.com/duanxz 阅读全文
posted @ 2020-11-07 14:11 昕友软件开发 阅读(486) 评论(0) 推荐(0) 编辑
摘要: 服务器中创建空仓库 cd /homeuseradd gitpasswd git设置git用户密码为mkdir /home/gitrootcd /home/gitrootchown -R git:git /home/gitroot git init --bare ProjectDemo.git成功:I 阅读全文
posted @ 2020-10-16 18:14 昕友软件开发 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 安装 1、检查系统是否支持clickhouse安装 grep -q sse4_2 /proc/cpuinfo && echo “SSE 4.2 supported” || echo “SSE 4.2 not supported.“SSE 4.2 supported” 代表可以安装,ClickHous 阅读全文
posted @ 2020-10-16 16:02 昕友软件开发 阅读(4113) 评论(0) 推荐(0) 编辑
摘要: 一句话区别 OLTP:基于行存储的关系数据库,写入速度极快,用于数据记录修改场景,MySQL、Oracle OLAP:基于列存储,查询速度极快,用于海量数据分析,Clickhouse、Vertica、 Amazon Redshift、 Sybase IQ、 Exasol、 Infobright、 I 阅读全文
posted @ 2020-10-15 18:10 昕友软件开发 阅读(1135) 评论(0) 推荐(0) 编辑
摘要: Mock服务的使用目的在于前端测试、APP开发、前端测试人员在服务还没完备时模拟接口。 本篇里实现实时动态mock的完整代码: https://gitee.com/475660/databand/tree/master/databand-mock-api 而不是传统使用静态mock,每次都要手动配置 阅读全文
posted @ 2020-09-28 16:46 昕友软件开发 阅读(5008) 评论(0) 推荐(0) 编辑
摘要: pom <dependency> <groupId>com.googlecode.aviator</groupId> <artifactId>aviator</artifactId> <version>4.2.10</version> </dependency> <dependency> <grou 阅读全文
posted @ 2020-09-12 13:36 昕友软件开发 阅读(2342) 评论(0) 推荐(0) 编辑
摘要: 参考:https://docs.openstack.org/nova/latest/user/filter-scheduler.html 阅读全文
posted @ 2020-08-19 17:56 昕友软件开发 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 虚拟机: "server": { "OS-DCF:diskConfig": "AUTO", "OS-EXT-AZ:availability_zone": "nova", "OS-EXT-SRV-ATTR:hypervisor_hostname": "CVK#11", "OS-EXT-SRV-ATTR 阅读全文
posted @ 2020-08-19 17:54 昕友软件开发 阅读(406) 评论(0) 推荐(0) 编辑
欢迎访问我的开源项目:xyIM企业即时通讯
点击右上角即可分享
微信分享提示