🌈 ☯️Teresita🐧👭 on Nostr: Hex dump with #python #!/usr/bin/python3 import sys with open(sys.argv[1], "rb") as ...
Hex dump with #python
#!/usr/bin/python3
import sys
with open(sys.argv[1], "rb") as f:
data = f.read()
for offset in range(0, len(data), 16):
b = data[offset:offset + 16]
left = " ".join(f"{x:02x}" for x in b[:8])
right = " ".join(f"{x:02x}" for x in b[8:])
hexpart = f"{left:<23} {right:<23}"
text = "".join(chr(x) if 32 <= x <= 126 else "." for x in b)
print(f"{offset:08x} {hexpart} |{text}|")
Published at
2026-08-10 01:52:10 UTCEvent JSON
{
"id": "acdc8708e3e6d6e69f7c1e572aa55e994d840336f7400d932cd63ac8c02eac0b",
"pubkey": "59cce5af2293758f4a9985b2b0c566424561f7c8362795bee71fcb338cb3b4eb",
"created_at": 1786326730,
"kind": 1,
"tags": [
[
"t",
"python"
],
[
"imeta",
"url https://files.techhub.social/media_attachments/files/117/068/707/656/162/430/original/dc05382614949b82.png",
"m image/png",
"dim 827x465",
"blurhash U12Y-ryGo7sGI;XUWGV[MejKkCbb?1r_k9oz"
],
[
"proxy",
"https://techhub.social/users/linuxgal/statuses/117068708621706154",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.ditto.pub"
]
],
"content": "Hex dump with #python \n\n#!/usr/bin/python3\nimport sys\nwith open(sys.argv[1], \"rb\") as f:\n data = f.read()\nfor offset in range(0, len(data), 16):\n b = data[offset:offset + 16]\n left = \" \".join(f\"{x:02x}\" for x in b[:8])\n right = \" \".join(f\"{x:02x}\" for x in b[8:])\n hexpart = f\"{left:\u003c23} {right:\u003c23}\"\n text = \"\".join(chr(x) if 32 \u003c= x \u003c= 126 else \".\" for x in b)\n print(f\"{offset:08x} {hexpart} |{text}|\")\n\nhttps://files.techhub.social/media_attachments/files/117/068/707/656/162/430/original/dc05382614949b82.png",
"sig": "6319dd6b6a9ed3c618fe08176cd748ed7894791ac30370490fa729eddaf3887ca2488cec4b5fc0c4b2e3c66ff547621c33ee256ef66d5aefded09798e6f98647"
}