This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const _get = function(object, path, defaultVal) { | |
| const _path = Array.isArray(path) | |
| ? path | |
| : path.split('.').filter(i => i.length) | |
| if (!_path.length || object === undefined) { | |
| return object === undefined ? defaultVal : object | |
| } | |
| return _get(object[_path.shift()], _path, defaultVal) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| if [[ "${1}" == "" ]]; then | |
| echo "must provide a process" | |
| exit 1 | |
| fi | |
| while : | |
| do | |
| ps -o rss "${1}" | tail -1 | numfmt --to=si |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This script will loop through all files in the current directory and its subdirectories, | |
| # and then will use ffmpeg to compress them using the H.265 codec. | |
| # It will output the compressed files to a new directory called "optimized". | |
| # This will retain the original directory structure, which is ideal for modifying video libraries like Plex. | |
| for f in **/*; | |
| if test -d $f; | |
| mkdir -p optimized/$f; | |
| else if test -f $f; | |
| ffmpeg -i $f -vcodec libx265 -c:a copy -crf 28 -tag:v hvc1 optimized/$f; |
OlderNewer