Skip to content

Instantly share code, notes, and snippets.

@sgrodzicki
sgrodzicki / generate-node-flamegraph.sh
Created September 22, 2025 06:36
How to capture a CPU profile in Node.js
# Copy of https://daniellockyer.com/how-to-capture-a-cpu-profile-in-nodejs/
# Find the process ID of the Node program
ps -H aux
# Enter the Node inspector
node inspect -p <pid>
# Start profiling:
profile
@sgrodzicki
sgrodzicki / unifi_device_models.json
Last active September 8, 2025 09:49
UniFi device models
{
"BZ2": {
"name": "UAP",
"names": {
"abbreviation": "UAP",
"fullName": "Access Point",
"sku": "UAP"
},
"type": "uap",
"compliance": {
@sgrodzicki
sgrodzicki / unifi-discovery.dart
Last active July 14, 2025 10:44
UniFi Discovery in Dart
import 'dart:io';
void main() {
var discoveryPort = 10001;
var discoveryBroadcast = InternetAddress('255.255.255.255');
var discoveryMulticast = InternetAddress('233.89.188.1');
RawDatagramSocket.bind(InternetAddress.anyIPv4, discoveryPort).then((RawDatagramSocket udpSocket) {
udpSocket.broadcastEnabled = true;
udpSocket.listen((e) {