CLI One-liners

File Operations Find and Replace Text sed -i 's/old-text/new-text/g' filename Replace all occurrences of ‘old-text’ with ’new-text’ in a file Quick File Search find . -name "*.txt" -type f -mtime -7 Find all .txt files modified in the last 7 days Move files with rsync and ssh rsync -avz -e "ssh -p 22" <source_file_or_dir> user@<remote_host>:/<remote_dir>/ Rsync via ssh. Port 22 is default but is added as a reminder that you might need to change to something else. ...

December 8, 2024 · 4 min · 682 words

Video to Text Rendering: A Simple AI Pipeline

Here’s a powerful one-liner that converts any video into a concise text summary using modern AI tools: #!/bin/sh yt-dlp -x --audio-format mp3 "$1" -o "audio.mp3" && \ whisper "audio.mp3" --model medium --output_format txt --output_dir . && \ cat audio.txt | ollama run mistral "Summarize the following text, removing any fluff and focusing on key points: ${cat}" > summary.txt && \ rm audio.mp3 audio.txt && cat summary.txt How It Works The pipeline combines three powerful tools: yt-dlp: A robust video downloader that handles YouTube, Vimeo, and many other platforms. It extracts just the audio track to minimize processing time. ...

October 12, 2024 · 2 min · 268 words