; =========================== ; NIXOS ; =========================== % nixos # Rebuild a flake system derivation sudo nixos-rebuild --flake .# $ type: echo -e "switch\nbuild\nboot" $ flake: echo -e "nixinator\nnixtop" % nixos # Find out why a package is included in the closure when building the system derivation nix why-depends /run/current-system nixpkgs# % nixos # Find the storepath of an executable in the users path readlink -f $(which ) $ executable: bash -c "compgen -c" % nixos # Find the wanted dynamic libraries of an executable in the users path ldd $(readlink -f $(which )) $ 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: 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: systemctl --user list-units --type=service --all --full --no-pager --legend=false --plain | awk -F' ' '{print $1}' ; =========================== ; SHELL ; =========================== % shell # Launch a detached process with suppressed output &>/dev/null &; disown % shell # Generate a large text file yes "The quick brown fox jumps over the lazy dog" | head -c > % shell # For-loop in fish shell for o in ; ; end % shell # Find files larger or smaller than a specified size in the current directory fd --type file --size -- "" . $ 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 '{print $}' $ separator: echo -e "' '\t\tWhitespace\n'[ ]'\t\tSingle Space\n'\\\t'\t\tTabs" --- --column 1 % mime # Determine the mime-type of a file file --mime-type $ file: eza -f -1 % mime # Query the default app for a mime type xdg-mime query default % mime # Query the default app for a file xdg-mime query default $(file --mime-type | awk -F' ' '{print $2}') $ file: eza -f -1 ; =========================== ; CODE ; =========================== % code # Disassemble an object file objdump -d -S -M , "" | 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 ; =========================== ; DOCS ; =========================== % docs # Extract svg figure from pdf page pdftocairo -f -l -svg "" "" $ input: eza -f -1 ; =========================== ; YT-DLP ; =========================== % yt-dlp # Download mp4 video in best quality yt-dlp -f 'bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b' --recode-video mp4 "" % yt-dlp # Download mp3 video in best quality yt-dlp -f 'ba' --extract-audio --audio-format mp3 "" ; =========================== ; FFMPEG ; =========================== % ffmpeg # Create a slow motion version of a video with interpolated/blended frames ffmpeg -i "" -filter:v "minterpolate='mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=',setpts=2*PTS" output.mp4 $ input: eza -f -1 % ffmpeg # Detect black bar dimensions automatically by looking at the first 10 frames ffmpeg -i "" -vframes 10 -vf cropdetect -f null - $ input: eza -f -1 % ffmpeg # Preview video with applied crop settings ffplay -vf crop=::: "" $ input: eza -f -1 % ffmpeg # Re-encode the video with applied crop settings ffmpeg -i "" -vf crop=::: -c:a copy output.mp4 $ input: eza -f -1 % ffmpeg # Reencode and compress the video using the h265 codec ffmpeg -i "" -vcodec libx265 -crf "out_" $ input: eza -f -1 $ quality: echo -e "24\n25\n26\n27\n28\n29\n30\n" % ffmpeg # Reencode and compress multiple videos using the h265 codec fish -c "for name in ; ffmpeg -i '$name' -vcodec libx265 -crf 'out_$name'; end" $ quality: echo -e "24\n25\n26\n27\n28\n29\n30\n"