From d0d52613b9d039fcbe1f28de7b94eeb5cdc56265 Mon Sep 17 00:00:00 2001 From: Mark Nipper Date: Sat, 9 Nov 2024 23:49:55 -0800 Subject: Add helpful shell commands --- home/root/common/core/zsh/default.nix | 1 + home/root/common/core/zsh/zshrc | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'home/root') diff --git a/home/root/common/core/zsh/default.nix b/home/root/common/core/zsh/default.nix index 5fe88b2..eaec714 100644 --- a/home/root/common/core/zsh/default.nix +++ b/home/root/common/core/zsh/default.nix @@ -27,6 +27,7 @@ export COLORFGBG=";0" ll = "ls -alFhs --color=auto"; nix-list-derivations = "nix-store --query --requisites /run/current-system | cut -d- -f2- | sort | uniq"; nix-list-generations = "nixos-rebuild list-generations | cat; echo; nix-env --list-generations --profile /nix/var/nix/profiles/system"; + pstrace = "bpftrace -e 'tracepoint:syscalls:sys_enter_exec*{ printf(\"pid: %d, comm: %s, args: \", pid, comm); join(args->argv); }'"; zgrep = "zgrep --color=auto"; }; }; diff --git a/home/root/common/core/zsh/zshrc b/home/root/common/core/zsh/zshrc index a0f7fee..28284f8 100644 --- a/home/root/common/core/zsh/zshrc +++ b/home/root/common/core/zsh/zshrc @@ -61,6 +61,17 @@ function nix-depends { } +function ntrace { + + if [[ -z ${argv} ]]; then + echo 'you must specify a command to strace!' >&2 + return 1 + fi + + eval strace -f -e trace=network -s 10000 ${=argv[@]} + +} + # prompt/theme shit function precmd { -- cgit v1.2.3