Skip to content

Instantly share code, notes, and snippets.

@sbolel
Last active June 10, 2021 16:45
Show Gist options
  • Save sbolel/b22c6ee1a6b033c71939b22ba4505786 to your computer and use it in GitHub Desktop.
Save sbolel/b22c6ee1a6b033c71939b22ba4505786 to your computer and use it in GitHub Desktop.
Shell Snippets: assorted helpful snippets (sh/zsh/bash)
#!/usr/bin/env sh
# @description convert .m3u8 file to .mp4
ffmpeg -i "https://website.com/path/to/file.m3u8" \
-bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 file.mp4
#!/usr/bin/env sh
# @desc replaces all occurances of " " in a filename with "_"
# @author enzotib (https://unix.stackexchange.com/users/6539/enzotib)
# @see https://unix.stackexchange.com/a/19059/215916
find /search/path -depth -name '* *' \
-execdir bash -c 'mv -- "$1" "${1// /_}"' bash {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment