diff --git a/config/navi/christoph.cheat b/config/navi/christoph.cheat index 7bb4a1dc..f8adb0b6 100644 --- a/config/navi/christoph.cheat +++ b/config/navi/christoph.cheat @@ -1,6 +1,8 @@ -; TODO: More ffmpeg, yt-dlp +; =========================== +; NIXOS +; =========================== -% nixos, nixos-rebuild +% nixos, nixos-rebuild, flake # Rebuild a flake system derivation sudo nixos-rebuild --flake .# $ type: echo -e "switch\nbuild\nboot" @@ -10,99 +12,97 @@ $ flake: echo -e "nixinator\nnixtop" # Find out why a package is included in the closure when building the system derivation nix why-depends /run/current-system nixpkgs# -; TODO: Autocomplete executable, list everything in path % nixos, nix-store, storepath, link # Find the storepath of an executable in the users path readlink -f $(which ) +$ executable: bash -c "compgen -c" -; TODO: Autocomplete executable, list everything in path % nixos, nix-store, storepath, libraries # Find the wanted dynamic libraries of an executable in the users path ldd $(readlink -f $(which )) +$ executable: bash -c "compgen -c" + +; =========================== +; SHELL +; =========================== % shell, process # Launch a detached process with suppressed output - &>/dev/null & - -; TODO: Filter out directories from input autocomplete (if there are no directories basic grep doesn't work, always needs a pattern) -% ffmpeg, slowmo -# 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 -1 - -% ffmpeg, cropdetect -# Detect black bar dimensions automatically by looking at the first 10 frames -ffmpeg -i "" -vframes 10 -vf cropdetect -f null - -$ input: eza -1 - -% ffmpeg, cropdetect, preview -# Preview video with applied crop settings -ffplay -vf crop=::: "" -$ input: eza -1 - -% ffmpeg, cropdetect, render -# Re-encode the video with applied crop settings -ffmpeg -i "" -vf crop=::: -c:a copy output.mp4 -$ input: eza -1 - -% ffmpeg, video compression, h265, render, reencode -# Reencode and compress the video using the h265 codec -ffmpeg -i "" -vcodec libx265 -crf "out_" -$ input: eza -1 -$ quality: echo -e "24\n25\n26\n27\n28\n29\n30\n" - -; TODO: Setting the default values like this makes them the only possible values -% ffmpeg, video compression, h256, render, reencode -# Reencode and compress multiple videos using the h265 codec -fish -c "for name in ; ffmpeg -i '$name' -vcodec libx265 -crf 'out_$name'; end" -$ files: echo "(eza -1 | grep \".mp4\")" -$ quality: echo "28" - -% qemu, cpu -# Find out what features are supported by different qemu CPUs -qemu-system- -cpu help - -; https://github.com/flathub/com.discordapp.Discord/wiki/Rich-Precense-(discord-rpc) -% discord, flatpak, rich-presence -# Enable rich presence for flatpak Discord -ln -sf $XDG_RUNTIME_DIR/{app/com.discordapp.Discord,}/discord-ipc-0 - -% find -# Find files under a certain size in the current directory -find . -type f -name "" -size - - -% objdump, disassemble -# Disassemble an object file -objdump -d -S -M intel "" | bat -l nasm -$ file: eza -1 - -% pdftocairo, pdf, svg -# Extract svg figure from pdf page -pdftocairo -f -l -svg "" "" -$ input: eza -1 + &>/dev/null &; disown % yes, head, file # Generate a large text file yes "The quick brown fox jumps over the lazy dog" | head -c > -% hotspot, create_ap, wifi, wihotspot -# Open a WiFi Hotspot using "wihotspot" -sudo create_ap wlp5s0 enp0s31f6 Potshot ThisIsMyPotshot --daemon --hidden - -% hotspot, create_ap, wifi, wihotspot -# List running Hotspots -sudo create_ap --list-running - -% hotspot, create_ap, wifi, wihotspot -# List connected devices -watch -d -c -n 0.5 sudo create_ap --list-clients -$ SSID: sudo create_ap --list-running | sd '.+\((.+)\)' '$1' - -% hotspot, create_ap, wifi, wihotspot -# Stop a running hotspot -sudo create_ap --stop -$ SSID: sudo create_ap --list-running | sd '.+\((.+)\)' '$1' - % fish, for, loop # For-loop in fish shell for o in ; ; end + +% find +# Find files under a certain size in the current directory +find . -type f -name "" -size - + +; =========================== +; CODING +; =========================== + +% objdump, disassemble +# Disassemble an object file +objdump -d -S -M intel "" | bat -l nasm +$ file: eza -f -1 + +; =========================== +; DOCUMENTS +; =========================== + +% pdftocairo, pdf, svg +# Extract svg figure from pdf page +pdftocairo -f -l -svg "" "" +$ input: eza -f -1 + +; =========================== +; YT-DLP +; =========================== + +% yt-dlp, mp4 +# 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 +# Download mp3 video in best quality +yt-dlp -f 'ba' --extract-audio --audio-format mp3 "" + +; =========================== +; FFMPEG +; =========================== + +% ffmpeg, slowmo +# 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 +# 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 +# Preview video with applied crop settings +ffplay -vf crop=::: "" +$ input: eza -f -1 + +% ffmpeg, cropdetect, render +# 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 +# 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 +# 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"