Skip to content

Instantly share code, notes, and snippets.

View cekstam's full-sized avatar

Christian Ekstam cekstam

  • Stockholm, Sweden
View GitHub Profile
@cekstam
cekstam / strace-new-process-bash
Last active October 14, 2022 07:52
Bash loop for attaching strace to a not yet created process
while true; do pid=$(pgrep 'httpd' | head -1); if [[ -n "$pid" ]]; then sudo strace -s 2000 -vvtf -p "$pid" ; break; fi; done
@cekstam
cekstam / gist:a7758b8f315835d479f379715eebd0c3
Last active December 27, 2021 14:15
create valid JSON from git log using python and ast.literal_string
git log -n 10\
--pretty=format:'{"commit": "%H", "author": "%aN <%aE>", "date": "%ai", "message": """%B""", "notes": """%N""" },' \
$@ | awk 'BEGIN { print("[") } { print($0) } END { print("]") }' | python -u -c \
'import ast,json,sys; print(json.dumps(ast.literal_eval(sys.stdin.read())))'

Keybase proof

I hereby claim:

  • I am cekstam on github.
  • I am cekstam (https://keybase.io/cekstam) on keybase.
  • I have a public key whose fingerprint is 0FA7 69C1 0C31 0993 BCEE 0695 2A09 CB8D 048A D60A

To claim this, I am signing this object: