Improved awkuniq alias and fixed some other bugs

This commit is contained in:
Random936 2025-02-27 18:28:10 -08:00
parent c059e55a57
commit 12f2d9e986
4 changed files with 12 additions and 3 deletions

View File

@ -2,6 +2,7 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
feh feh
vlc vlc
dconf
firefox firefox
zoom-us zoom-us
discord discord
@ -40,4 +41,5 @@
}; };
}; };
} }

View File

@ -23,7 +23,6 @@
openldap openldap
rustscan rustscan
inetutils inetutils
wireshark
thc-hydra thc-hydra
exploitdb exploitdb
responder responder

View File

@ -5,9 +5,9 @@
dig dig
iftop iftop
iperf iperf
tshark
tcpdump tcpdump
ethtool ethtool
wireshark
traceroute traceroute
]; ];
} }

View File

@ -18,7 +18,6 @@
shellAliases = { shellAliases = {
cd = "z"; cd = "z";
ls = "eza"; ls = "eza";
awkuniq = "sort | uniq";
histogram = "awkuniq -c | sort -nr"; histogram = "awkuniq -c | sort -nr";
json-less = "jq -C . | less -R"; json-less = "jq -C . | less -R";
csv2json = "python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))'"; csv2json = "python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))'";
@ -61,6 +60,15 @@
if [[ -n "$SSH_CONNECTION" && "$TERM" == "ghostty" ]]; then if [[ -n "$SSH_CONNECTION" && "$TERM" == "ghostty" ]]; then
export TERM="xterm-256color" export TERM="xterm-256color"
fi fi
awkuniq() {
if [[ "$1" == "-c" ]]; then
awk '{ !x[$0]++ } END { for (i in x) print x[i] "\t" i }'
else
awk '!x[$0]++'
fi
}
''; '';
plugins = [ plugins = [