1

Compare commits

..

2 Commits

Author SHA1 Message Date
568bb65515 Config/Navi: Add more cheats 2025-07-01 13:47:49 +02:00
626f7ad1e0 Modules/Fish: Update abbrs 2025-07-01 13:47:41 +02:00
2 changed files with 68 additions and 34 deletions

View File

@ -22,6 +22,36 @@ $ executable: bash -c "compgen -c"
ldd $(readlink -f $(which <executable>))
$ executable: bash -c "compgen -c"
; ===========================
; SYSTEMD
; ===========================
% systemd
# List failed system units
sudo systemctl --failed
% systemd
# List failed user units
systemctl --user --failed
% systemd
# List system errors
sudo journalctl -p 3 -xb
% systemd
# List kernel errors
sudo journalctl -p 3 -xb -k
% systemd
# List system unit errors
sudo journalctl -xb --unit=<unit>
$ unit: sudo systemctl list-units --type=service --all --full --no-pager --legend=false --plain | awk -F' ' '{print $1}'
% systemd
# List user unit errors
journalctl -xb --unit=<unit>
$ unit: systemctl --user list-units --type=service --all --full --no-pager --legend=false --plain | awk -F' ' '{print $1}'
; ===========================
; SHELL
; ===========================
@ -39,12 +69,25 @@ yes "The quick brown fox jumps over the lazy dog" | head -c <size> > <output>
for o in <objects>; <action>; end
% shell
# Find files under a certain size in the current directory
find . -type f -name "<glob>" -size -<size>
# Find files larger or smaller than a specified size in the current directory
fd --type file --size <mode><size> -- "<regex>" .
$ mode: echo -e "+\t\tFind Larger Files\n-\t\tFind Smaller Files" --- --column 1
% gdu
# Visualize storage usage on all mounted disks
sudo gdu -d
% duf
# List all mounted devices
sudo duf
% duf
# Display INode information of all mounted devices
sudo duf -inode
% awk
# Select a column
awk -F<separator> '{print <print>}'
awk -F<separator> '{print $<print>}'
$ separator: echo -e "' '\t\tWhitespace\n'[ ]'\t\tSingle Space\n'\\\t'\t\tTabs" --- --column 1
% mime
@ -67,7 +110,9 @@ $ file: eza -f -1
% code
# Disassemble an object file
objdump -d -S -M intel "<file>" | bat -l nasm
objdump -d -S -M <arch>,<syntax> "<file>" | bat -l nasm
$ arch: echo -e "x86-64\t\t64 Bit\ni386\t\t32 Bit\ni8086\t\t16 Bit" --- --column 1
$ syntax: echo -e "intel\t\tIntel Syntax\natt\t\tAT&T Syntax" --- --column 1
$ file: eza -f -1
; ===========================

View File

@ -130,41 +130,32 @@ in {
# Fish
h = batifyWithArgs "history" "-l fish"; # -l fish sets syntax highlighting to fish
listabbrs = batifyWithArgs "abbr" "-l fish";
abbrs = batifyWithArgs "abbr" "-l fish";
# Tools
cd = "z"; # zoxide for quickjump to previously visited locations
cdd = "zi";
b = "z -"; # jump to previous dir
mkdir = "mkdir -p"; # also create parents (-p)
blk = batify "lsblk -o NAME,LABEL,UUID,FSTYPE,SIZE,FSUSE%,MOUNTPOINT,MODEL";
grep = "grep --color=auto -E"; # grep with extended regex
watch = "watch -d -c -n 0.5";
ssh = "kitty +kitten ssh";
# Systemd
failed = "systemctl --failed";
errors = "journalctl -p 3 -xb";
kernelerrors = "journalctl -p 3 -xb -k";
uniterrors = "journalctl -xb --unit=";
useruniterrors = "journalctl -xb --user-unit=";
# Disassemble
disassemble = "objdump -d -S -M intel";
nd = "nix develop";
nb = "nix build -L";
}
# Abbrs only available if package is installed
(abbrify pkgs.btop {top = "btop";})
(abbrify pkgs.duf {
df = "duf";
disksummary = "duf";
# df = "duf";
disks = "duf";
})
(abbrify pkgs.eza {
ls = "eza --color=always --group-directories-first -F --git --icons=always"; # color-ls
lsl = "eza --color=always --group-directories-first -F -l --git --icons=always --octal-permissions";
lsa = "eza --color=always --group-directories-first -F -l -a --git --icons=always --octal-permissions";
tre = "eza --color=always --group-directories-first -F -T -L 2 ---icons=always";
ls = "eza --color=always --group-directories-first -F --git --icons=always --octal-permissions";
lsl = "eza --color=always --group-directories-first -F --git --icons=always --octal-permissions -l";
lsa = "eza --color=always --group-directories-first -F --git --icons=always --octal-permissions -l -a";
tre = "eza --color=always --group-directories-first -F --git --icons=always --octal-permissions -T -L 2";
})
(abbrify pkgs.fd {find = "fd";})
@ -172,8 +163,8 @@ in {
(abbrify pkgs.fzf {fuzzy = "fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'";})
(abbrify pkgs.gdu {
du = "gdu";
storageanalysis = "gdu";
# du = "gdu";
storage = "gdu";
})
(abbrify pkgs.git {
@ -184,8 +175,6 @@ in {
gcl = "git clone";
})
# (abbrify pkgs.gping {ping = "gping";})
(abbrify pkgs.lazygit {lg = "lazygit";})
# Doesn't work with abbrify because I have nnn.override...
@ -194,17 +183,17 @@ in {
(abbrify pkgs.ranger {r = "ranger --choosedir=$HOME/.rangerdir; set LASTDIR (cat $HOME/.rangerdir); cd $LASTDIR";})
(abbrify pkgs.rsync {
copy = "rsync -ahv --inplace --partial --info=progress2";
(abbrify pkgs.ripgrep rec {
rg = "rg --trim --pretty";
grep = rg;
})
(abbrify pkgs.rsync rec {
rsync = "rsync -ahv --inplace --partial --info=progress2";
copy = rsync;
})
(abbrify pkgs.sd {sed = "sd";})
(abbrify pkgs.yt-dlp {
mp4 = "yt-dlp -f 'bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b' --recode-video mp4"; # the -f options are yt-dlp defaults
mp3 = "yt-dlp -f 'ba' --extract-audio --audio-format mp3";
})
];
};