Skip to content

Instantly share code, notes, and snippets.

@bshambaugh
bshambaugh / gist:e4d2e4926e3d6d1f800864bee58d7127
Created December 1, 2023 20:53
why does auth encrypter with dir have a key wrapper?
https://github.com/decentralized-identity/veramo/blob/next/packages/did-comm/src/encryption/a256kw-encrypters.ts#L144-L157
export function a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(
recipientPublicKey: Uint8Array,
senderSecret: Uint8Array | ECDH,
options: Partial<AuthEncryptParams> = {},
): Encrypter {
return createFullEncrypter(
recipientPublicKey,
senderSecret,
@bshambaugh
bshambaugh / gist:9953749a2d1d985b8eea5d6bb2405b43
Created November 27, 2023 17:53
error.log.did-jwt-295-ephemeralKeyError?
src/__tests__/xc20pEncryption.test.ts (11.306 s)
● xc20pEncryption › resolveP256Encrypters › correctly resolves encrypters for DIDs
second arg must be public key
37 | const ephemeral = ephemeralKeyPair ? generateKeyPairFromSeed(ephemeralKeyPair.secretKey) : generateKeyPair()
38 | const epk = { kty: 'EC', crv, x: bytesToBase64url(ephemeral.publicKey) }
> 39 | const sharedSecret = p256.getSharedSecret(ephemeral.secretKey, recipientPublicKey)
| ^
40 | // Key Encryption Key
@bshambaugh
bshambaugh / gist:cb113144bc9a75e4117f5ef5c684d5bf
Last active October 30, 2025 18:11
VS1053 MIDI snyth/sound module links
https://diyelectromusic.wordpress.com/2020/07/08/arduino-midi-vs1053-synth/ (Arduino MIDI VS1053 Synth)
https://diyelectromusic.wordpress.com/2020/06/04/arduino-simple-midi-controller/ (Arduino Simple MIDI Controller)
https://forum.arduino.cc/t/what-are-the-different-usb-sheild-options-for-an-uno/299676 (usb adapter, usb to serial)
https://www.youtube.com/watch?v=7xIEA66e7eI (DIY VS1053 MIDI Sound Module)
https://datasheetspdf.com/pdf/640613/VLSI/VS1053B/1 (datasheet)
https://www.pschatzmann.ch/home/2022/08/25/arduino-audio-tools-vs1053-real-time-midi/
https://diyelectromusic.wordpress.com/2021/01/09/arduino-midi-vs1003-synth/ (vs1003 synth)
@bshambaugh
bshambaugh / gist:9a78b47571bdb0220db62f505a1a7020
Created September 13, 2023 21:28
npm install mdns error --- maybe a python version problem??
0 verbose cli /usr/local/bin/node /usr/local/bin/npm
1 info using npm@9.8.1
2 info using node@v18.16.0
3 timing npm:load:whichnode Completed in 6ms
4 timing config:load:defaults Completed in 9ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 4ms
6 timing config:load:builtin Completed in 6ms
7 timing config:load:cli Completed in 26ms
8 timing config:load:env Completed in 2ms
9 timing config:load:file:/home/brent/Downloads/queryMDNS/.npmrc Completed in 0ms
@bshambaugh
bshambaugh / gist:3da3079286ea05fba616fa47852f8274
Created September 12, 2023 21:32
WifFi Manager by Drone Bot Workshop
https://www.youtube.com/watch?v=VnfX9YJbaU8
WiFiManager with ESP32 - Stop Hard-coding WiFi Credentials! -
DroneBot Workshop
1) Deal with the use of only port 80 and 43 on most public networks with a reverse proxy
https://www.tutorialspoint.com/how-to-configure-nginx-as-reverse-proxy-for-websocket
2) Deal with a changing IP address of the websockets server with
bshambaughOP
08/30/2023 4:44 PM
That reminds me, in https://github.com/bshambaugh/BlinkyProject/blob/remoteSigner/edgeDevices/ESP32-testing/include/websocketserver_config.h I have the IP address of the laptop assigned by the router hardcoded which I can discover by hostname -I on the laptop. Recompiling the ESP32 with the new IP address when I move to a new network like 192.168.1.29 (or even if the router reassigns it .... occasionally locally I go from 10.0.0.4 to 10.0.0.5 and back again) is a pain. I think this is a different issue though....I just need to somehow give my devices unique identifiers, call out to them through some sort of broadcast scheme and pull down their assigned IP addresses.
lots to think about, thanks for your help so far. (Find the IP address
@bshambaugh
bshambaugh / gist:b72a95cf70268b68a6377261d87bf6f5
Created August 4, 2023 19:06
sketch_used_for_sensorica_sign_08042023
// video: https://www.youtube.com/watch?v=vH2QmrpCJuw
// code: https://www.tweaking4all.com/hardware/arduino/arduino-all-ledstrip-effects-in-one/
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pin on the Arduino is connected to the NeoPixels?
#define PIN 6 // On Trinket or Gemma, suggest changing this to 1 // white --> green wire
@bshambaugh
bshambaugh / gist:a1c7d66551f22c8c68cf46ad1aa31477
Created April 25, 2023 14:27
go through pospigos REA for HoloChain tutorial and try to replicate it.
https://www.youtube.com/watch?v=CHbl_tHtr3o
@bshambaugh
bshambaugh / gist:2097200d293cef6b9877c205d8da77a1
Created March 22, 2023 10:34
simple button clicker ... needs server
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<title> Script in head section </title>
<script type = "text/javascript">
function ClickMe() {
console.log("click")
}
</script>
</head>
I worked with this model during the EthDenver https://github.com/spro/char-rnn.pytorch . I did not manage to get the right shape for https://github.com/zkonduit/pyezkl/tree/main/examples/tutorial . (loading the model to convert to *.onnx)
I learned a bit about ML though. :P
You
11:48 AM
https://gist.github.com/bshambaugh/af01e7366ac7f43abd8295533703d990 (other scratch work)
....
You
11:51 AM
Here is my colab python sketches: https://colab.research.google.com/drive/1mi2Rcehz-YWOeXGBNjCe-COR5XhnfPTB