aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Nipper <nipsy@bitgnome.net>2024-11-09 23:49:55 -0800
committerMark Nipper <nipsy@bitgnome.net>2024-11-09 23:49:55 -0800
commitd0d52613b9d039fcbe1f28de7b94eeb5cdc56265 (patch)
tree5ab8aeeddc52f673fafb7a28ed32cc6488bd7b4c
parent30f6af5aede78ad0a0eeed24ffe755863d675b5d (diff)
downloadnix-d0d52613b9d039fcbe1f28de7b94eeb5cdc56265.tar
nix-d0d52613b9d039fcbe1f28de7b94eeb5cdc56265.tar.gz
nix-d0d52613b9d039fcbe1f28de7b94eeb5cdc56265.tar.bz2
nix-d0d52613b9d039fcbe1f28de7b94eeb5cdc56265.tar.lz
nix-d0d52613b9d039fcbe1f28de7b94eeb5cdc56265.tar.xz
nix-d0d52613b9d039fcbe1f28de7b94eeb5cdc56265.tar.zst
nix-d0d52613b9d039fcbe1f28de7b94eeb5cdc56265.zip
Add helpful shell commands
Diffstat (limited to '')
-rw-r--r--home/nipsy/common/core/zsh/zshrc17
-rw-r--r--home/root/common/core/zsh/default.nix1
-rw-r--r--home/root/common/core/zsh/zshrc11
3 files changed, 26 insertions, 3 deletions
diff --git a/home/nipsy/common/core/zsh/zshrc b/home/nipsy/common/core/zsh/zshrc
index 5c72aad..543450d 100644
--- a/home/nipsy/common/core/zsh/zshrc
+++ b/home/nipsy/common/core/zsh/zshrc
@@ -51,14 +51,25 @@ autoload -U edit-command-line
zle -N edit-command-line
bindkey -M vicmd v edit-command-line
-# useful helper functions
-function nix-file-list { find $(nix build ${1} --print-out-paths --no-link) }
-
# always open tmux if interactive
[[ $- != *i* ]] && return
#[[ -z "$TMUX" ]] && (tmux -2 new-session -t default \; new-window || tmux -2 new-session -s default)
[[ -z "$TMUX" ]] && (tmux -2 attach -t default || tmux -2 new-session -s default)
+# useful helper functions
+function nix-file-list { find $(nix build ${1} --print-out-paths --no-link) }
+
+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 {
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 {