Skip to content

Instantly share code, notes, and snippets.

View guoxiaoqiao's full-sized avatar

星云 guoxiaoqiao

View GitHub Profile
@guoxiaoqiao
guoxiaoqiao / .\connect.sh
Created July 10, 2024 14:59 — forked from arvati/.\connect.sh
Connect Bluetooth Alsa Device Openwrt
#!/bin/ash
echo "Choose Device to connect"
echo "Device 1: B28S"
echo "Device 2: PT-Music"
echo "Device 3: Memorex MW212"
echo "Device 4: ilink"
echo "Device 5: BT-163"
read -n 1 -s resp
@guoxiaoqiao
guoxiaoqiao / gitlab_wechat.py
Last active October 25, 2023 13:45
GitLab的企业微信机器人通知转发代码。(本人只是搬运工,原创作者:建帅小伙儿,URL:https://developer.aliyun.com/article/1025391
# coding=utf-8
"""
@Project :pachong-master
@File :gitlab_wechat.py
@Author :gaojs
@Date :2022/8/10 21:56
@Blogs : https://www.gaojs.com.cn
"""
from flask import Flask, request, json
import argparse
@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;
#!/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"
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\
@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
#!/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"
#!/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"
@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};
@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