diff --git a/how_to b/how_to index 1c66364..1f32580 100644 --- a/how_to +++ b/how_to @@ -1230,6 +1230,11 @@ gdb tricks: (gdb) while ($i < ) > print foo[$i++].attribute > end + Dynamic printf: + # Breakpoint that prints instead of stopping + # https://sourceware.org/gdb/current/onlinedocs/gdb.html/Dynamic-Printf.html + # https://developers.redhat.com/articles/2021/10/13/printf-style-debugging-using-gdb-part-2 + (gdb) dprintf meow.c:42,"foo:%d bar:%s\n", number, string Non-standard zsh cd trick: # https://dataswamp.org/~solene/2020-09-04-cd-command.html @@ -1248,6 +1253,12 @@ Git: git config url."git@example.org:user/".pushInsteadOf "https://example.org/user/" Prevent git from trying to auto-detect user name and email: user.useConfigOnly = true + Revert a rebase after continue/commit: + # https://stackoverflow.com/a/135614 + # Find last sane state (prefixed with "commit:" instead of "rebase:" + git reflog + # /!\ Be careful to either your modifications or remember what you did + git reset --hard 'HEAD@{}' Setup a midi synth: # http://www.tedfelix.com/linux/linux-midi.html @@ -1419,3 +1430,7 @@ Change default java environment (archlinux): archlinux-java status # Example archlinux set java-18-openjdk + +strace: + print all file access: + strace -yy -f -e trace=file --