avatar
童琦杰
  1. ARR 一、下载并安装IIS插件ARR: https://www.iis.net/downloads/microsoft/application-request-routing 二、下载并安装IIS插件URL Rewrite: https://www.iis.net/downloads/microsoft/url-rewrite 三、打开IIS,选中服务器名称,在功能视图下找到Application Request Routing Cache(如没有找到这个,尝试使用Win+R,输入inetmgr打开)。 四、打开Application Request Routing Cache,在右侧栏找到Server Proxy Settings并打开,勾选Enable Proxy。 URL重写-入站规则 一、选中虚拟目录节点,在功能视图中找到URL Rewrite并打开。 二、在右侧栏点击Add Rules,在Inbound rules下选择Blank rule。 三、输入Name,随意。 四、Match URL输入如下图: 五、Action输入如下图,http://localhost:5000为重定向的域名,{R:1
  2. 属性 interface LabelledValue { label: string; } 通过在属性名称后添加问号?来定义可选属性。 interface SquareConfig { color?: string; width?: number; } 使用关键字readonly定义只读属性。 interface Point { readonly x: number; readonly y: number; } 方法类型 使用接口描述方法类型时,我们只需要提供方法参数及返回类型,参数列表中每个参数必须包含名称和类型。 interface SearchFunc { (source: string, subString: string): boolean; } let mySearch: SearchFunc; mySearch = function(src: string, sub: string): boolean { let result = src.search(sub); return result > -1; } 使用接口描述方法类型更像是C#语言中的委托定义。 索引类型 接口也支持描述索引类型。 i
  3. 与Javascript语言一样,TypeScript也支持几种基本的数据类型,如布尔类型、数值类型、字符串类型。除了以上几种基本类型,TypeScript同时也提供几种独特的数据类型。 布尔类型 布尔类型只支持两种值:true/false。 let done: boolean = false; 数值类型 数值类型变量允许使用十六进制、十进制、八进制、二进制字面量赋值。 let decimal: number = 6; let hex: number = 0xf00d; let binary: number = 0b1010; let octal: number = 0o744; 字符串类型 TypeScript中字符串值允许使用双引号"或单引号'标记。 let color: string = "blue"; color = 'red'; 同时,TypeScript支持模板字符串(template strings),允许跨越多行定义字符串值,并且允许在字符串内嵌入表达式,模板字符串使用反引号```标记。 let fullName: string = `Bob Bobbington`; let age: numb
  4. 修改配置文件 //codefile:/etc/nginx/sites-enabled/example.conf http { ... allow xx.xx.xx.xx; allow xx.xx.xx.xx; deny all; ... } server { ... allow xx.xx.xx.xx; allow xx.xx.xx.xx; deny all; ... } location / { allow xx.xx.xx.xx; allow xx.xx.xx.xx; deny all; } 加载Nginx配置 nginx -s reload
  5. adb文件位置: AndroidSdk\platform-tools\adb.exe 模拟进程被杀死命令: adb shell am kill package-name 截图并保存到PC: adb shell /system/bin/screencap -p /sdcard/screenshot.png & adb pull /sdcard/screenshot.png "this/is/target/folder" 模拟屏幕按压: adb shell input swipe 100 100 120 120 1000 打开Android Device Monitor: AndroidSdk\tools\monitor Java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed //codefile:build.grade android { ... aaptOptions { noCompress "tflite" //表示不让aapt压缩的文件后缀 } .
  6. 目前该方案只支持 Chrome 和 Firefox 浏览器,通过设置 SSLKEYLOGFILE 环境变量,可以指定浏览器在访问 SSL/TLS 网站时将对应的密钥保存到本地文件中,有了这个日志文件之后 wireshake 就可以将报文进行解密了。 首先设置SSLKEYLOGFILE环境变量,指定文件路径。 配置Wireshake,Edit->Preferences->Protocols->TLS->(pre)-Master-Secret log filename,输入上面配置环境变量的路径。 重启浏览器,进行抓包
  7. //codefile:DateTime.java import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; public class DateTime implements Comparable<DateTime> { public static DateTime now() { return new DateTime(new Date()); } public static DateTime today() { return DateTime.now().getDate(); } public static DateTime minValue() { return new DateTime(); } public static DateTime maxValue() { return new DateTime(9999, 12,
  8. linking against a dylib which is not safe for use in application extensions 因为app extension限制了某些API的使用, ( App Extensions不能使用的一些API ) ,因此在自定义自己的framework后,这个framework可能包含了某些在App Extensions里不能使用的API,因此为了安全起见才会给出这个警告。 选中自定义framework的target,然后选中Build Settings,(记住选择All,而不是Basic),在过滤框中输入"require only",将Require Only App-Extension-Safe API的值改成YES,(默认为NO),然后Command + K clean一下工程,警告久消除了。 warning: Auto Layout Localization: Leading constraint is missing, which may cause overlapping with other views. 需要多加一条约束左或右间距约束。 'C
  9. Ubuntu下安装 sudo apt-get install mysql-server 登录MYSQL 根用户登录 mysql -u root -p 指定用户名密码登录 mysql --user=user_name --password=your_password 创建用户 CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'password'; CREATE USER 'user_name'@'%' IDENTIFIED BY 'password'; 创建数据库、表 CREATE SCHEMA `database_name`; USE `database_name`; CREATE TABLE `table_name` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `username` varchar(100) NOT NULL, `password` varchar(100) NOT NULL, `createTime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRI
  10. 子命令扩展 $(...)可以扩展成另一个命令的运行结果,该命令的所有输出都会作为返回值。 echo $(date) Tue 30 Nov 2021 05:26:45 CST 上面例子中,$(date)返回date命令的运行结果。 单引号 单引号用于保留字符的字面含义,各种特殊字符在单引号里面,都会变为普通字符,比如星号(*)、美元符号($)、反斜杠(\)等。 由于反斜杠在单引号里面变成了普通字符,所以如果单引号之中,还要使用单引号,不能使用转义,需要在外层的单引号前面加上一个美元符号($),然后再对里层的单引号转义。 echo $'it\'s' 双引号 双引号比单引号宽松,大部分特殊字符在双引号里面,都会失去特殊含义,变成普通字符。 但是,三个特殊字符除外:美元符号($)、反引号(`)和反斜杠(\)。这三个字符在双引号之中,依然有特殊含义,会被 Bash 自动扩展。 反斜杠在双引号之中保持特殊含义,用来转义。所以,可以使用反斜杠,在双引号之中插入双引号,或者插入反斜杠本身。 创建变量 如果变量的值包含空格,则必须将值放在引号中。 var="hello world" Bash 没有数据类型的概念,所有的变量值都
© 2015-2022 tongqijie.com 版权所有沪ICP备17000682号