Browse Source

update setup-nodejs

* fix rdfind 
* refactor ffmpeg-start-time
master
VirtuBox 5 months ago
parent
commit
45359f3403
Signed by: virtubox GPG Key ID: 22EB296C97BAD476
1 changed files with 22 additions and 21 deletions
  1. +22
    -21
      mybashrc

+ 22
- 21
mybashrc View File

@ -112,21 +112,6 @@ DD_BENCHMARK_DISK() {
}
ffmpeg_start_time() {
if [ "$#" = "0" ]; then
echo "ffmpeg-cut-start <start-time> <input> <duration(optional)>"
echo ""
echo "example : ffmpeg-cut-start 00:34:24.85 file.mp4 300"
else
if [ -n "$3" ]; then
bash -c "ffmpeg -ss '$1' -y -i '$2' -t '$3' -c copy -movflags +faststart '${2%.mp4}-output.mp4';"
else
bash -c "ffmpeg -ss '$1' -y -i '$2' -c copy -movflags +faststart '${2%.mp4}-output.mp4';"
fi
fi
}
RANDOM_GIT_COMMIT() {
[ -z "$(command -v w3m)" ] && {
@ -152,7 +137,7 @@ _find_duplicates() {
apt-get install rdfind -y
fi
if [ "$2" = "--force" ]; then
rdfind -ignoreempty false "$1"
rdfind -ignoreempty false -deleteduplicates true "$1"
else
rdfind -dryrun true -ignoreempty false "$1"
fi
@ -325,14 +310,15 @@ _NGINX_EE() {
}
_INSTALL_NODEJS() {
if [ -n "$1" ]; then
wget -O nodejs.sh https://deb.nodesource.com/setup_"$1".x
if [ "$#" -eq 0 ]; then
echo "Usage : setup-nodejs <version>"
echo "Example : setup-nodejs 12"
else
wget -O nodejs.sh https://deb.nodesource.com/setup_10.x
wget -O nodejs.sh https://deb.nodesource.com/setup_"$1".x
fi
chmod +x nodejs.sh
./nodejs.sh
rm nodejs.sh
rm -f nodejs.sh
$NEED_SUDO apt-get install -y nodejs
}
@ -699,6 +685,21 @@ _DELETE_WO_SITES() {
done
}
ffmpeg_start_time() {
if [ "$#" = "0" ]; then
echo "ffmpeg-cut-start <start-time> <input> <duration(optional)>"
echo ""
echo "example : ffmpeg-cut-start 00:34 file.mp4 300"
else
if [ -n "$3" ]; then
bash -c "ffmpeg -ss '$1' -t '$3' -y -i '$2' -c copy -movflags +faststart '${2%.mp4}-output.mp4';"
else
bash -c "ffmpeg -ss '$1' -y -i '$2' -c copy -movflags +faststart '${2%.mp4}-output.mp4';"
fi
fi
}
_STABILISE_VIDEO() {
for i in "$PWD"/*; do
@ -855,4 +856,4 @@ alias yt-encode=_YOUTUBE_ENCODE
alias mp4convert=_MP4_CONVERT
alias suroot='sudo su - root'
alias apt-playbook='ansible-playbook /etc/ansible/playbooks/include/update-apt-servers.yml'
alias full-upgrade-playbook='ansible-playbook /etc/ansible/playbooks/update-all-servers.yml'
alias full-upgrade-playbook='ansible-playbook /etc/ansible/playbooks/update-all-servers.yml'

Loading…
Cancel
Save