Creating clips from tv recordings: ffmpeg -ss 01:59:00.000 -i "interlaced.ts" -ss 00:00:12.000 -t 26 -max_muxing_queue_size 1024 -c:a libopus -b:a 96k -c:v libx264 -crf 20 -vf "yadif=1" -profile:v baseline -level 3.0 -pix_fmt yuv420p -movflags +faststart -y clip.mp4 Make clip compatible with WhatsApp: ffmpeg -i in.mp4 -map 0:v:0 -map 0:a:0 -map_metadata -1 -map_chapters -1 -c:v libx264 -preset slow -tune film -crf 32…
Most streaming sites break a video into many small fragments, which are listed in a m4mu file. I have a script to download the fragments one by one using curl. To merge the video fragments back into one file, I do the following. Merge video files with ffmpeg - Make a file listing all the videos in sequence. E.g. file 'video01.ts' file 'video02.ts' file 'video03.ts' ... - Generate the file list for files in the curren…
Ask HN: Can I see your cheatsheet?
71–80 of 173 posts
Re: Ask HN: Can I see your cheatsheet?
#72Earlier quoted context omitted.
I'm curious why history | grep and not ctrl-R?
Probably because ctrl-R doesn't present you a list in most shells. Maybe you want to scan the list visually and look at neighboring commands. ctrl-R doesn't really take advantage of human vision by showing all results next to each other.
H() { history | egrep -v '^ *[[:digit:]]+ +H +' | grep "$@" | sort -rk 2 | uniq -f 1 | sort; }
Re: Ask HN: Can I see your cheatsheet?
#73On a related note: has anyone used a good tool for using/inserting these kinds of custom snippets? It would be neat to have a snippet manager with quick search bound to a keypress.
Bonus: it's all stored in a git repo
I do kinda live on the command line, ymmv
Re: Ask HN: Can I see your cheatsheet?
#74Re: Ask HN: Can I see your cheatsheet?
#75Set a huuuuuuuge shell history https://github.com/craigjperry2/dotfiles/blob/aa77ddcbde63bf... then fzf ctrl+r bindings mean you can recall anything right where you need it. If you’re going to do this then have an escape hatch for commands you don’t want memorised https://github.com/craigjperry2/dotfiles/blob/aa77ddcbde63bf...
# Edit
I sometimes add comments to commands via `# This‘ll do this and that` so that I can find the command by those keywords in the bash history.
Re: Ask HN: Can I see your cheatsheet?
#76Earlier quoted context omitted.
I'm curious why history | grep and not ctrl-R?
Probably because ctrl-R doesn't present you a list in most shells. Maybe you want to scan the list visually and look at neighboring commands. ctrl-R doesn't really take advantage of human vision by showing all results next to each other.
Re: Ask HN: Can I see your cheatsheet?
#77- Find all files modified in the last 90 minutes find . -type f -mmin -90 - Find all files and do something to each one find . -type f -mmin -90 | xargs ls -l - Find all files modified before 2 days ago find . -type f -mtime +2 - Removing files older than 7 days find . -type f -mtime +7 -name '*.gz' -exec rm {} \; - Find all files modified after last 2 days find . -type f -mtime -2 - Find all files modified at the la…
zsh's built-in globbing features can be used instead.
- Find all files modified in the last 90 minutes
print -l **/*(mm-90)
- Find all files and do something to each one
print -l **/*(mm-90) | xargs ls -l
- Find all files modified before 2 days ago
print -l **/*(m+2)
- Removing files older than 7 days
zargs -- **/*(m+7) -- rm
- Find all files modified after last 2 days
print -l **/*(m-2)
- Find all files modified at the last 2 day mark
print -l **/*(m2)
In most of the above examples "print -l" is used to print the results to the terminal, but you can instead use whatever command you want (as in the "rm" example above).Many more examples and tips can be seen here: [1]
Re: Ask HN: Can I see your cheatsheet?
#78Set a huuuuuuuge shell history https://github.com/craigjperry2/dotfiles/blob/aa77ddcbde63bf... then fzf ctrl+r bindings mean you can recall anything right where you need it. If you’re going to do this then have an escape hatch for commands you don’t want memorised https://github.com/craigjperry2/dotfiles/blob/aa77ddcbde63bf...
I‘ve been doing this ever since I migrated from Windows to Mac in 2015. My bash history has over 40k lines, datestamped. I can recall any command I have typed in my terminal in the past seven years. Extremely helpful whenever I need to repeat anything in the terminal. # Edit I sometimes add comments to commands via `# This‘ll do this and that` so that I can find the command by those keywords in the bash history.
Hope there's a project out there that helps parse, rank, or do something with a file like this. There must be interesting information.
Re: Ask HN: Can I see your cheatsheet?
#79- Find all files modified in the last 90 minutes find . -type f -mmin -90 - Find all files and do something to each one find . -type f -mmin -90 | xargs ls -l - Find all files modified before 2 days ago find . -type f -mtime +2 - Removing files older than 7 days find . -type f -mtime +7 -name '*.gz' -exec rm {} \; - Find all files modified after last 2 days find . -type f -mtime -2 - Find all files modified at the la…
Find all .txt files containing the word 'foo': find ./ -mount -type f -name "*.txt" -exec grep -iHn 'foo' {} \; (the -mount stops it traversing into mounted shares)
grep -iHn 'foo' **/*.txt(.)
Though I'm not sure how to prevent zsh from descending in to other filesystems, as you can with find.