Skip to content

Instantly share code, notes, and snippets.

View guoxiaoqiao's full-sized avatar

星云 guoxiaoqiao

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