Skip to content

Instantly share code, notes, and snippets.

View TheTechromancer's full-sized avatar

TheTechromancer

View GitHub Profile
@TheTechromancer
TheTechromancer / python_attach_howto.md
Last active February 11, 2025 16:03
Attach to a running python process and explore its state - useful for troubleshooting deadlocks, memory leaks, etc.

Attach to PID with GDB

Prerequisites

  • If running inside docker, make sure to execute docker exec with --privileged
  • Install remote_pdb
pip install remote_pdb
@kerrymilan
kerrymilan / confd-decrypt.cpp
Last active March 10, 2023 13:19
Utility to decrypt AESCFB128-encrypted (e.g. $8$...) ConfD config values. This is intended to be used in cases where the encryption keys are stored in the device's database (*.cdb) files rather than in confd.conf.
/**
* ConfD Decrypt Utility
*
* Prerequisites:
* * AESCFB128-encrypted (e.g. $8$) config values
* * May work on DES3CBC as well; untested
* * CDB files from target device
* * confd.conf file from target device
* * At minimum, AESCFB128 key and initVector values
* * gcc/make
@aconz2
aconz2 / noworks.py
Last active May 18, 2023 12:31
asyncio ssl get peercert
# WARNING: this doesn't work properly
import asyncio
import ssl
import socket
# included logging to try to figure out why this wasn't working...
import logging
logging.basicConfig()
logging.getLogger('asyncio').setLevel(logging.DEBUG)
//1D grid of 1D blocks
__device__ int getGlobalIdx_1D_1D()
{
return blockIdx.x *blockDim.x + threadIdx.x;
}
//1D grid of 2D blocks
__device__ int getGlobalIdx_1D_2D()
{
return blockIdx.x * blockDim.x * blockDim.y + threadIdx.y * blockDim.x + threadIdx.x;