Skip to content

Instantly share code, notes, and snippets.

View nervous-inhuman's full-sized avatar

nervous-inhuman

View GitHub Profile
@BlackPropaganda
BlackPropaganda / U2F_ssh_ecdsa.txt
Created September 22, 2022 21:58
U2F ECDSA SSH Key Generation using Flipper Zero
#
# U2F SSH key generation and installation guide
#
# install U2F libraries on client machine
sudo apt-get install pamu2fcfg libpam-u2f
#
# Currently, there are only two ciphers that support
# 'special keys' or (sk) this is the notation in the
@zengxinhui
zengxinhui / convert2arch_arm.sh
Last active June 21, 2024 17:44
Replace Oracle Cloud Linux with Arch Linux ARM remotely
[09/23/2023]
Refs:
1. http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz
2. https://dl-cdn.alpinelinux.org/alpine/v3.18/releases/aarch64/alpine-virt-3.18.0-aarch64.iso
3. https://wiki.alpinelinux.org/wiki/Replacing_non-Alpine_Linux_with_Alpine_remotely
4. https://wiki.archlinux.org/index.php/installation_guide#Configure_the_system
5. https://archlinuxarm.org/platforms/armv8/generic
See also:
@SharkyRawr
SharkyRawr / heic_to_jpg.sh
Created December 31, 2020 16:14
Script to convert all HEIC files to JPG
#! /bin/bash -ex
## REQUIRES imagemagick with HEIC support !!!
mkdir -p /tmp/new
find . -type f -iname '*.heic' |
while read file; do
echo $file
basefile=$(basename "$file")
@alexhude
alexhude / ImHex.diff
Last active February 4, 2021 19:21
Build ImHex for macOS
diff --git a/source/helpers/crypto.cpp b/source/helpers/crypto.cpp
index fa23428..e0ef3ad 100644
--- a/source/helpers/crypto.cpp
+++ b/source/helpers/crypto.cpp
@@ -41,7 +41,7 @@ namespace hex {
std::array<u8, 512> buffer = { 0 };
for (u64 bufferOffset = 0; offset < size; offset += buffer.size()) {
- const u64 readSize = std::min(buffer.size(), size - bufferOffset);
+ const u64 readSize = std::min((u64)buffer.size(), size - bufferOffset);
@apfelchips
apfelchips / defaults.duti
Last active December 23, 2023 03:53
set file-associations on macOS: ~ 🥖.config 🥖duti 🥖defaults.duti
# duti settings file
# src: https://gist.github.com/apfelchips/0073cb3e8d186115f590d318998c1025
# mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/duti/" && curl -L "https://git.io/JRtzH" -o "${XDG_CONFIG_HOME:-$HOME/.config}/duti/default.duti"
# duti-apply wrapper: alias duti-apply='duti -v "${XDG_CONFIG_HOME:-$HOME/.config}/duti"'
## duti documentation http://duti.org/documentation.html
## see also: https://github.com/Lord-Kamina/SwiftDefaultApps#readme
# List of MIME Types:
@hwhw
hwhw / cc2538-and-openocd.md
Last active November 16, 2023 20:20
Flashing CC2538 using OpenOCD (&UART)

Flashing CC2538 using OpenOCD (&UART)

Problem description

CC2538 SoCs are Cortex-M4 based SoCs by Texas Instruments for 802.15.4 PAN networking, especially for Zigbee communication using their Zigbee Stack solution. It also is a solid foundation for hobbyist-grade solutions involving Zigbee communication, especially for running a self-implemented Zigbee coordinator (often called "Zigbee gateway" in commercial distribution of similar tech). Software-wise, this is usually done by running "ZNP" (Zigbee Network Processor) firmware on the SoC and using a separate controller/computer to act as the "ZAP" (Zigbee Application Processor). In a hobbyist setting, the former is usually a cheap module from china containing the chip, capacitors and an antenna or antenna connector, while the latter is e.g. a Raspberry Pi or an Intel NUC or whatever floats your boat. The API between both components is specified and so the software side on the ZAP does not need to bother with Zigbee communication states but can act on a

http://miot-spec.org/miot-spec-v2/instances?status=all
http://miot-spec.org/miot-spec-v2/instances?status=debug
http://miot-spec.org/miot-spec-v2/instances?status=released
and for example air purifier 3 cn (zhimi.airpurifier.ma4)
https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:air-purifier:0000A007:zhimi-ma4:1
http://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:light:0000A001:philips-bulb:1
http://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:fan:0000A005:zhimi-sa1:1
@seidler2547
seidler2547 / convert_ha_sqlite2mysql.sh
Last active April 16, 2024 02:30
One-liner to convert an existing Home-Assistant SQLite database to MySQL
# prerequisites:
## install software
apt install mariadb-server libmariadbclient-dev sqlite3
## install mysqlclient in virtualenv
su -c 'homeassistant/bin/pip3 install mysqlclient --upgrade' -l homeassistant
## create database
mysql -e 'CREATE SCHEMA IF NOT EXISTS `hass_db` DEFAULT CHARACTER SET utf8'
## create user (use a safe password please)
mysql -e "CREATE USER 'hass_user'@'localhost' IDENTIFIED BY 'hass_pw'"
mysql -e "GRANT ALL PRIVILEGES ON hass_db.* TO 'hass_user'@'localhost'"