From f644d42b616e86849c5e2f68ad2e20d52e06629e Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Thu, 19 Jun 2025 03:26:57 +0200 Subject: [PATCH] Config/Navi: Update cheats --- config/navi/christoph.cheat | 59 ++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/config/navi/christoph.cheat b/config/navi/christoph.cheat index f8adb0b6..70f02385 100644 --- a/config/navi/christoph.cheat +++ b/config/navi/christoph.cheat @@ -2,22 +2,22 @@ ; NIXOS ; =========================== -% nixos, nixos-rebuild, flake +% nixos # Rebuild a flake system derivation sudo nixos-rebuild --flake .# $ type: echo -e "switch\nbuild\nboot" $ flake: echo -e "nixinator\nnixtop" -% nixos, nix-store, closure, dependency +% nixos # Find out why a package is included in the closure when building the system derivation nix why-depends /run/current-system nixpkgs# -% nixos, nix-store, storepath, link +% nixos # Find the storepath of an executable in the users path readlink -f $(which ) $ executable: bash -c "compgen -c" -% nixos, nix-store, storepath, libraries +% nixos # Find the wanted dynamic libraries of an executable in the users path ldd $(readlink -f $(which )) $ executable: bash -c "compgen -c" @@ -26,36 +26,55 @@ $ executable: bash -c "compgen -c" ; SHELL ; =========================== -% shell, process +% shell # Launch a detached process with suppressed output &>/dev/null &; disown -% yes, head, file +% shell # Generate a large text file yes "The quick brown fox jumps over the lazy dog" | head -c > -% fish, for, loop +% shell # For-loop in fish shell for o in ; ; end -% find +% shell # Find files under a certain size in the current directory find . -type f -name "" -size - +% 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 + ; =========================== -; CODING +; CODE ; =========================== -% objdump, disassemble +% code # Disassemble an object file objdump -d -S -M intel "" | bat -l nasm $ file: eza -f -1 ; =========================== -; DOCUMENTS +; DOCS ; =========================== -% pdftocairo, pdf, svg +% docs # Extract svg figure from pdf page pdftocairo -f -l -svg "" "" $ input: eza -f -1 @@ -64,11 +83,11 @@ $ input: eza -f -1 ; YT-DLP ; =========================== -% yt-dlp, mp4 +% 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, mp3 +% yt-dlp # Download mp3 video in best quality yt-dlp -f 'ba' --extract-audio --audio-format mp3 "" @@ -76,33 +95,33 @@ yt-dlp -f 'ba' --extract-audio --audio-format mp3 "" ; FFMPEG ; =========================== -% ffmpeg, slowmo +% 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, cropdetect +% 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, cropdetect, preview +% ffmpeg # Preview video with applied crop settings ffplay -vf crop=::: "" $ input: eza -f -1 -% ffmpeg, cropdetect, render +% ffmpeg # Re-encode the video with applied crop settings ffmpeg -i "" -vf crop=::: -c:a copy output.mp4 $ input: eza -f -1 -% ffmpeg, video compression, h265, render, reencode +% 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, video compression, h256, render, reencode +% 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"