Skip to content

Instantly share code, notes, and snippets.

View guoxiaoqiao's full-sized avatar

星云 guoxiaoqiao

View GitHub Profile
@guoxiaoqiao
guoxiaoqiao / openvpn-2.3.4-obfs.patch
Last active October 17, 2019 16:20
OpenVPN 2.3.4 混淆补丁
diff -Nur openvpn-2.3.4/src/openvpn/options.c openvpn-2.3.4.obfs/src/openvpn/options.c
--- openvpn-2.3.4/src/openvpn/options.c 2014-05-01 19:12:22.000000000 +0800
+++ openvpn-2.3.4.obfs/src/openvpn/options.c 2014-10-08 21:29:19.330754723 +0800
@@ -60,6 +60,10 @@
#include "memdbg.h"
+extern char* _socket_obfs_salt;
+extern int _socket_obfs_salt_len;
+extern int _socket_obfs_padlen;
#!/bin/bash
# 用于创建macOS安装ISO的脚本文件
# 初始脚本来源:http://www.insanelymac.com/forum/topic/308533-how-to-create-a-bootable-el-capitan-iso-fo-vmware/
set -x
SCRIPT_PATH=`pwd`/$0
# 先卸载要用到的卷名,避免冲突
@guoxiaoqiao
guoxiaoqiao / gcc47-chs.patch
Created October 26, 2016 15:15
gcc支持中文变量名的补丁
--- gcc-4.7.0-20120604/libcpp/lex.c 2011-12-20 20:56:54.000000000 +0800
+++ gcc-4.7.0-20120604/libcpp/lex.umod.c 2012-07-05 21:53:30.184527392 +0800
@@ -1322,7 +1322,10 @@
raw_prefix_len++;
continue;
}
- break;
+ if (raw_prefix[raw_prefix_len] > 0x80)
+ raw_prefix_len++;
+ else
@guoxiaoqiao
guoxiaoqiao / nginx-url-unescape.patch
Created July 28, 2017 13:54
nginx日志支持中文URL显示的补丁
diff -Nur nginx-1.12.1/src/http/ngx_http_request.c nginx-1.12.1-unescape/src/http/ngx_http_request.c
--- nginx-1.12.1/src/http/ngx_http_request.c 2017-07-11 21:24:09.000000000 +0800
+++ nginx-1.12.1-unescape/src/http/ngx_http_request.c 2017-07-19 12:35:57.345284961 +0800
@@ -924,6 +924,13 @@
ngx_str_t host;
ngx_connection_t *c;
ngx_http_request_t *r;
+ /* 允许取消转义的最大URL长度 */
+ #define ALLOW_LEN 512
+ char tmp[ALLOW_LEN] = {0};
#!/bin/bash
# 用于创建macOS安装ISO的脚本文件
# 初始脚本来源:http://www.insanelymac.com/forum/topic/308533-how-to-create-a-bootable-el-capitan-iso-fo-vmware/
set -x
SCRIPT_PATH=`pwd`/$0
DMG_PATH="/Applications/Install macOS High Sierra.app/Contents/SharedSupport"
#!/bin/bash
# 用于创建macOS安装ISO的脚本文件
# 初始脚本来源:http://www.insanelymac.com/forum/topic/308533-how-to-create-a-bootable-el-capitan-iso-fo-vmware/
# High Sierra的ISO制作方法也参考了:http://www.kaufmann.no/roland/articles/20171007-high-sierra-iso.html
set -x
SCRIPT_PATH=`pwd`/$0
APP_PATH="/Applications/Install macOS High Sierra.app"
@guoxiaoqiao
guoxiaoqiao / sign.sh
Created January 23, 2018 08:24 — forked from ezimuel/sign.sh
Sign and verify a file using OpenSSL command line tool. It exports the digital signature in Base64 format.
#!/bin/bash
# Sign a file with a private key using OpenSSL
# Encode the signature in Base64 format
#
# Usage: sign <file> <private_key>
#
# NOTE: to generate a public/private key use the following commands:
#
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem
if([System.IO.File]::Exists("C:\win10\install.wim")){
dism /unmount-wim /mountdir:C:\win10\wim /discard
dism /Cleanup-Wim
rm C:\win10\install.wim
}
copy H:\sources\install.wim c:\win10\
#!/bin/bash
# 用于创建macOS安装ISO的脚本文件
# 初始脚本来源:http://www.insanelymac.com/forum/topic/308533-how-to-create-a-bootable-el-capitan-iso-fo-vmware/
# Mojave的ISO制作方法也参考了:http://www.kaufmann.no/roland/articles/20171007-high-sierra-iso.html
set -x
SCRIPT_PATH=`pwd`/$0
APP_PATH="/Applications/Install macOS Mojave.app"
@guoxiaoqiao
guoxiaoqiao / BQ27441-battery-fuel-gauge.js
Created July 19, 2022 13:37 — forked from stokebrain/BQ27441-battery-fuel-gauge.js
BQ27441 battery fuel gauge for Espruino
/*
* This file implements code to read data from and set data for
* TI-make BQ27441 battery fuel gauge. Data to be set include
* "Design Capacity", "Termination Voltage" etc. Data to be read
* include "Voltage", "Current", "Temperature", "SOC", etc.
*/
var i2c = I2C1;