Skip to content

Instantly share code, notes, and snippets.

@brunoaduarte
brunoaduarte / aws_latency.ps1
Created May 3, 2025 15:24
PowerShell script to measure latency (by opening a TCP connection since ICMP is blocked) to all america nearest AWS regions.
# List of AWS regions
$regions = @(
"us-east-1","us-east-2","us-west-1","us-west-2",
"ca-central-1",
"eu-west-1","eu-west-2","eu-west-3","eu-central-1","eu-north-1","eu-south-1",
"ap-east-1","ap-south-1","ap-northeast-1","ap-northeast-2","ap-northeast-3",
"ap-southeast-1","ap-southeast-2",
"sa-east-1",
"me-south-1","af-south-1"
)
@brunoaduarte
brunoaduarte / monitor.js
Last active July 15, 2024 17:37 — forked from purpshell/monitor.js
Monitor Socket messages on 2.3000x and above
if (!window.decodeBackStanza) {
window.decodeBackStanza = require("WAWap").decodeStanza;
window.encodeBackStanza = require("WAWap").encodeStanza;
}
function byteArrayToHex(byteArray) {
return Array.from(byteArray).map(byte => byte.toString(16).padStart(2, '0')).join('');
}
function isAscii(byteArray) {