From 8d96b31b2650855348a4ca77a2155b22649493c4 Mon Sep 17 00:00:00 2001 From: bmixed <2+bmixed@noreply.localhost> Date: Wed, 22 Jul 2026 05:00:38 +0000 Subject: [PATCH] Upload files to "/" --- apgen | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 apgen diff --git a/apgen b/apgen new file mode 100644 index 0000000..736dcff --- /dev/null +++ b/apgen @@ -0,0 +1,51 @@ +#!/bin/bash + +## ARDUINO PASSKEY GENERATOR +## 20260722-043053 + +##SETUP +#sudo apt install coreutils curl git openssl +#curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh +#arduino-cli core install arduino:avr; arduino-cli lib install keyboard + +echo "CREATE PASSKEY:" +read -r pw +##sha512sum +#key=$(echo -n $key | sha512sum | awk '{print $1}') +##openssl sha512 +#key=$(printf '%s' $key | openssl dgst -sha512 | awk '{print $2}') +##openssl passwd sha512 +key=$(openssl passwd -6 -salt $pw $pw | awk -F'$' '{print $4}') + +#arduino-cli board list +#echo "SET SERIAL PORT [PORT]:" +#read -r port +#echo "SET BOARD [FQBN]:" +#read -r fqbn +port=ACM0 +fqbn=arduino:avr:micro +#export port +#export fqbn + +rm -df ./.tmp +mkdir ./.tmp +mkdir ./.tmp/apg + +echo " +#include + +void setup() { + // put your setup code here, to run once: + Keyboard.begin(); + delay(1000); + Keyboard.println(\"$key\"); +} + +void loop() { + // put your main code here, to run repeatedly: + +}" | tee ./.tmp/apg/apg.ino + + +arduino-cli compile --fqbn $fqbn --port /dev/tty$port ./.tmp/apg/apg.ino +arduino-cli upload --fqbn $fqbn --port /dev/tty$port ./.tmp/apg/apg.ino