Skip to content

Instantly share code, notes, and snippets.

@bshambaugh
bshambaugh / gist:a27bde0fe7462bcd3a563258222b6e0f
Last active March 13, 2024 15:17
Learn BlockChain / React/ Solidity
Learn React Tutorial:
https://www.youtube.com/watch?v=bMknfKXIFA
FreeCodeCamp Solidity:
https://www.youtube.com/watch?v=gyMwXuJrbJQ
Learn Blockchains by Building One
https://hackernoon.com/learn-blockchains-by-building-one-117428612f46
CryptoRadio Solidity Tutorial:
@bshambaugh
bshambaugh / gist:234b1e335b2772a6eec0d4019f14d34d
Created December 4, 2023 01:27
tests of encrypter and decrypter Auth
brent@brent-P65-67HSHP:~/Downloads/did-jwt$ npm run test
> did-jwt@7.4.1 test
> cross-env NODE_OPTIONS="--experimental-vm-modules" jest
(node:37871) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
PASS src/__tests__/NaclSigner.test.ts (8.837 s)
(node:37868) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
npm run test
> did-jwt@7.4.1 test
> cross-env NODE_OPTIONS="--experimental-vm-modules" jest
(node:56793) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
PASS src/__tests__/SignerAlgorithm.test.ts (13.237 s)
PASS src/__tests__/didkey.test.ts
(node:56746) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
@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 September 18, 2023 14:26
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