Skip to content

Instantly share code, notes, and snippets.

View guoxiaoqiao's full-sized avatar

星云 guoxiaoqiao

View GitHub Profile
@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
@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;
@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