update 07-05-2022

This commit is contained in:
2022-05-07 22:22:52 +02:00
parent f84424d30c
commit 467bde3a7f
12 changed files with 527 additions and 0 deletions

53
ffmpeg-convertMP4v3.sh Normal file
View File

@@ -0,0 +1,53 @@
#!/bin/bash
# Variables Section
#==============================================================
# list process to monitor in the variable below.
#PROGRAM1=$1
PROGRAM1=ffmpeg
# APPCHK varible checks to see if $PROGRAM1 is running.
APPCHK=$(ps -ea | grep $PROGRAM1 | grep -v grep | wc -l)
#==================================================================
# The if statement below checks to see if the process is running
# with the ps command. If the value is returned as a 0 then
# a message is prompted
if [ $APPCHK -eq 0 ];
then
#echo “$PROGRAM1 may be down”
cd "$1"
#rename 's/[[:blank:]]/_/g' *
for FILE in *;
do
#on supprime les espaces dans les noms de fichiers
#RENAME=$(echo "$FILE" | tr "[:blank:]" "_")
#mv "$FILE" "$RENAME"
RENAME=$(echo "$FILE" | sed -e 's/[[:blank:]]/_/g');
if [ -e "$RENAME" ];then
echo "">/dev/null;
else
mv "$FILE" "$RENAME";
fi
#on récupère le nom sans extension
NAME=$(echo "$RENAME" | sed 's/\.[^\.]*$//')
#nom des fichiers
INPUT_FILE="$1/$FILE"
OUTPUT_FILE=$(echo "$2/$NAME.mp4")
if [ "$NAME" != "@eaDir" -a ! -f "$OUTPUT_FILE" ];
then
#ffmpeg -i "$INPUT_FILE" -acodec mp3 -vcodec mpeg4 -qscale 5 -r 24 -f mp4 "$OUTPUT_FILE"
/volume1/homes/bruno/scripts/ffmpeg -i "$INPUT_FILE" -map 0:0 -map 0:1 -c:a aac -strict -2 -async 1 -c:v libx264 -crf 20 -r 25 -s 1920x1080 -aspect 16:9 -qmin 3 -qmax 51 -qdiff 4 -y "$OUTPUT_FILE"
mv "$INPUT_FILE" "$2/$RENAME"
fi
done
else
echo$PROGRAM1 is running”
fi
exit

54
ffmpeg-convertMP4v4.sh Normal file
View File

@@ -0,0 +1,54 @@
#!/bin/bash
# run: sh ffmpeg-convertMP4v4.sh /volume1/video/TV_ts /volume1/video/TV
# Variables Section
#==============================================================
# list process to monitor in the variable below.
#PROGRAM1=$1
PROGRAM1=ffmpeg
# APPCHK varible checks to see if $PROGRAM1 is running.
APPCHK=$(ps -ea | grep $PROGRAM1 | grep -v grep | wc -l)
#==================================================================
# The if statement below checks to see if the process is running
# with the ps command. If the value is returned as a 0 then
# a message is prompted
if [ $APPCHK -eq 0 ];
then
echo$PROGRAM1 may be down”
cd "$1"
#rename 's/[[:blank:]]/_/g' *
for FILE in *;
do
RENAME=$(echo "$FILE" | sed -e 's/[[:blank:]]/_/g');
if [ -e "$RENAME" ];then
echo "">/dev/null;
else
mv "$FILE" "$RENAME";
fi
#on récupère le nom sans extension
NAME=$(echo "$RENAME" | sed 's/\.[^\.]*$//')
#nom des fichiers
INPUT_FILE="$1/$RENAME"
OUTPUT_FILE=$(echo "$2/$NAME.mp4")
#if [ "$NAME" != "@eaDir" -a ! -f "$OUTPUT_FILE" ];
if [ "$NAME" != "@eaDir" ];
then
echo "$INPUT_FILE"
echo "$OUTPUT_FILE"
#echo "$2/"
/volume1/homes/bruno/scripts/ffmpeg -i "$INPUT_FILE" -map 0:0 -map 0:1 -c:a aac -strict -2 -async 1 -c:v libx264 -crf 20 -r 25 -s 1920x1080 -aspect 16:9 -qmin 3 -qmax 51 -qdiff 4 -y "$OUTPUT_FILE"
mv "$INPUT_FILE" "$2/"
fi
done
else
echo$PROGRAM1 is running”
fi
exit

69
ffmpeg-convertMP4v5.sh Normal file
View File

@@ -0,0 +1,69 @@
#!/bin/bash
# run: sh ffmpeg-convertMP4v5.sh /volume1/video/TV_ts /volume1/video/TV
#v5: notifications, logs
LOG=/volume1/homes/bruno/logs # dossier du fichier .log
JOUR=$(date +"%Y-%m-%d %T") # http://www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display/
touch $LOG/ffmpeg.log # création du fichier log
echo $JOUR "Demarrage du script" >> $LOG/ffmpeg.log
# Variables Section
#==============================================================
# list process to monitor in the variable below.
PROGRAM1=ffmpeg
# APPCHK varible checks to see if $PROGRAM1 is running.
APPCHK=$(ps -ea | grep $PROGRAM1 | grep -v grep | wc -l)
#==================================================================
# The if statement below checks to see if the process is running
# with the ps command. If the value is returned as a 0 then
# a message is prompted
if [ $APPCHK -eq 0 ];
then
cd "$1"
for FILE in *;
do
RENAME=$(echo "$FILE" | sed -e 's/[[:blank:]]/_/g');
if [ -e "$RENAME" ];then
echo "">/dev/null;
else
mv "$FILE" "$RENAME";
fi
#on récupère le nom sans extension
NAME=$(echo "$RENAME" | sed 's/\.[^\.]*$//')
#nom des fichiers
INPUT_FILE="$1/$RENAME"
OUTPUT_FILE=$(echo "$2/$NAME.mp4")
#if [ "$NAME" != "@eaDir" -a ! -f "$OUTPUT_FILE" ];
if [ "$NAME" != "@eaDir" ];
then
echo "Conversion du fichier:"
#echo "$INPUT_FILE"
echo " -$OUTPUT_FILE"
echo "$JOUR Debut conversion du fichier $FILE" >> $LOG/ffmpeg.log
#/volume1/homes/bruno/scripts/ffmpeg -i "$INPUT_FILE" -map 0:0 -map 0:1 -c:a aac -strict -2 -async 1 -c:v libx264 -crf 20 -r 25 -s 1920x1080 -aspect 16:9 -qmin 3 -qmax 51 -qdiff 4 -y "$OUTPUT_FILE"
/volume1/homes/bruno/scripts/ffmpeg -i "$INPUT_FILE" -map 0:0 -map 0:1 -c:a aac -b:a 160k -async 1 -c:v libx264 -crf 20 -r 25 -s 1280x720 -aspect 16:9 -y "$OUTPUT_FILE"
mv "$INPUT_FILE" "$2/"
echo "$JOUR Conversion du fichier $NAME.mp4 terminee" >> $LOG/ffmpeg.log
synodsmnotify @administrators "[ffmpeg-convertMP4.sh]" "Conversion du fichier $FILE terminee"
fi
done
else
#echo “$PROGRAM1 is running”
echo "$JOUR $PROGRAM1 est deja actif" >> $LOG/ffmpeg.log
synodsmnotify @administrators "[ffmpeg-convertMP4.sh]" "$PROGRAM1 est deja actif"
fi
echo $JOUR "Fin du script" >> $LOG/ffmpeg.log
exit

80
ffmpeg-convertMP4v6.sh Normal file
View File

@@ -0,0 +1,80 @@
#!/bin/bash
# run: sh ffmpeg-convertMP4v6.sh /volume1/video/TV_ts /volume1/video/TV
#v5: notifications, logs
#v6: modif date dans les logs
LOG=/volume1/homes/bruno/logs # dossier du fichier .log
ENREGISTREMENTS=/volume1/video/TV_2
# http://www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display/
timestamp()
{
date +"%d-%m-%Y %T"
}
# création du fichier log
touch $LOG/ffmpeg.log
echo $(date +"%d-%m-%Y %T") "Demarrage du script" >> $LOG/ffmpeg.log
# Variables Section
#==============================================================
# list process to monitor in the variable below.
PROGRAM1=ffmpeg
# APPCHK varible checks to see if $PROGRAM1 is running.
APPCHK=$(ps -ea | grep $PROGRAM1 | grep -v grep | wc -l)
#==================================================================
# The if statement below checks to see if the process is running
# with the ps command. If the value is returned as a 0 then
# a message is prompted
if [ $APPCHK -eq 0 ];
then
cd "$1"
for FILE in *;
do
#on supprime les espaces dans les noms de fichiers
RENAME=$(echo "$FILE" | sed -e 's/[[:blank:]]/_/g');
if [ -e "$RENAME" ];then
echo "">/dev/null;
else
mv "$FILE" "$RENAME";
fi
#on récupère le nom sans extension
NAME=$(echo "$RENAME" | sed 's/\.[^\.]*$//')
#nom des fichiers
INPUT_FILE="$1/$RENAME"
OUTPUT_FILE=$(echo "$2/$NAME.mp4")
#if [ "$NAME" != "@eaDir" -a ! -f "$OUTPUT_FILE" ];
if [ "$NAME" != "@eaDir" ];
then
echo "Conversion du fichier: $OUTPUT_FILE"
#echo "$JOUR Debut conversion du fichier $FILE" >> $LOG/ffmpeg.log
echo "$(date +"%d-%m-%Y %T") Debut conversion du fichier $FILE" >> $LOG/ffmpeg.log
#/volume1/homes/bruno/scripts/ffmpeg -i "$INPUT_FILE" -map 0:0 -map 0:1 -c:a aac -strict -2 -async 1 -c:v libx264 -crf 20 -r 25 -s 1920x1080 -aspect 16:9 -qmin 3 -qmax 51 -qdiff 4 -y "$OUTPUT_FILE"
/volume1/homes/bruno/scripts/ffmpeg -i "$INPUT_FILE" -map 0:0 -map 0:1 -c:a aac -b:a 160k -async 1 -c:v libx264 -crf 20 -r 25 -s 1280x720 -aspect 16:9 -y "$OUTPUT_FILE"
#les originaux sont déplacés dans $ENREGISTREMENTS
mv "$INPUT_FILE" "$ENREGISTREMENTS/"
#echo "$JOUR Conversion du fichier $NAME.mp4 terminee" >> $LOG/ffmpeg.log
echo "$(date +"%d-%m-%Y %T") Conversion du fichier $NAME.mp4 terminee" >> $LOG/ffmpeg.log
synodsmnotify @administrators "[ffmpeg-convertMP4.sh]" "Conversion du fichier $FILE terminee"
fi
done
else
#echo “$PROGRAM1 is running”
#echo "$JOUR $PROGRAM1 est deja actif" >> $LOG/ffmpeg.log
echo "$(date +"%d-%m-%Y %T") $PROGRAM1 est deja actif" >> $LOG/ffmpeg.log
synodsmnotify @administrators "[ffmpeg-convertMP4.sh]" "$PROGRAM1 est deja actif"
fi
#echo $JOUR "Fin du script" >> $LOG/ffmpeg.log
echo "$(date +"%d-%m-%Y %T") Fin du script" >> $LOG/ffmpeg.log
exit

84
ffmpeg-convertMP4v7.sh Normal file
View File

@@ -0,0 +1,84 @@
#!/bin/bash
# run: sh ffmpeg-convertMP4v6.sh /volume1/video/TV_ts /volume1/video/TV
#v5: notifications, logs
#v6: modif date dans les logs
#v7 supprime ( GR1_B SMR6 Nat CNH Multi4 NTN MHD7 )
LOG=/volume1/homes/bruno/logs # dossier du fichier .log
ENREGISTREMENTS=/volume1/video/TV_2
TABLEAU=( GR1_B SMR6 Nat CNH Multi4 NTN MHD7 )
# http://www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display/
timestamp()
{
date +"%d-%m-%Y %T"
}
# création du fichier log
touch $LOG/ffmpeg.log
echo $(timestamp) "Demarrage du script" >> $LOG/ffmpeg.log
# Variables Section
#==============================================================
# list process to monitor in the variable below.
PROGRAM1=ffmpeg
# APPCHK varible checks to see if $PROGRAM1 is running.
APPCHK=$(ps -ea | grep $PROGRAM1 | grep -v grep | wc -l)
#==================================================================
# The if statement below checks to see if the process is running
# with the ps command. If the value is returned as a 0 then
# a message is prompted
if [ $APPCHK -eq 0 ];
then
cd "$1"
for FILE in *;
do
#on supprime les espaces dans les noms de fichiers
# on supprime ( GR1_B SMR6 Nat CNH Multi4 NTN MHD7 )
#RENAME=$(echo "$FILE" | sed -e 's/[[:blank:]]/_/g');
RENAME=$(echo "$FILE" | sed -e '{s/[[:blank:]]/_/g;s/(\(GR1_B\|SMR6\|Nat\|CNH\|Multi4\|NTN\|MHD7\))//g}')
if [ -e "$RENAME" ];then
echo "">/dev/null;
else
mv "$FILE" "$RENAME";
fi
#on récupère le nom sans extension
NAME=$(echo "$RENAME" | sed 's/\.[^\.]*$//')
#nom des fichiers
INPUT_FILE="$1/$RENAME"
OUTPUT_FILE=$(echo "$2/$NAME.mp4")
#if [ "$NAME" != "@eaDir" -a ! -f "$OUTPUT_FILE" ];
if [ "$NAME" != "@eaDir" ];
then
echo "Conversion du fichier: $OUTPUT_FILE"
#echo "$JOUR Debut conversion du fichier $FILE" >> $LOG/ffmpeg.log
echo "$(timestamp) Debut conversion du fichier $FILE" >> $LOG/ffmpeg.log
#/volume1/homes/bruno/scripts/ffmpeg -i "$INPUT_FILE" -map 0:0 -map 0:1 -c:a aac -strict -2 -async 1 -c:v libx264 -crf 20 -r 25 -s 1920x1080 -aspect 16:9 -qmin 3 -qmax 51 -qdiff 4 -y "$OUTPUT_FILE"
/volume1/homes/bruno/scripts/ffmpeg -i "$INPUT_FILE" -map 0:0 -map 0:1 -c:a aac -b:a 160k -async 1 -c:v libx264 -crf 20 -r 25 -s 1280x720 -aspect 16:9 -y "$OUTPUT_FILE"
#les originaux sont déplacés dans $ENREGISTREMENTS
mv "$INPUT_FILE" "$ENREGISTREMENTS/"
#echo "$JOUR Conversion du fichier $NAME.mp4 terminee" >> $LOG/ffmpeg.log
echo "$(timestamp) Conversion du fichier $NAME.mp4 terminee" >> $LOG/ffmpeg.log
synodsmnotify @administrators "[ffmpeg-convertMP4.sh]" "Conversion du fichier $FILE terminee"
fi
done
else
#echo “$PROGRAM1 is running”
#echo "$JOUR $PROGRAM1 est deja actif" >> $LOG/ffmpeg.log
echo "$(timestamp) $PROGRAM1 est deja actif" >> $LOG/ffmpeg.log
synodsmnotify @administrators "[ffmpeg-convertMP4.sh]" "$PROGRAM1 est deja actif"
fi
#echo $JOUR "Fin du script" >> $LOG/ffmpeg.log
echo "$(timestamp) Fin du script" >> $LOG/ffmpeg.log
exit

13
install_wp-cli.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Télécharger
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
# Test
php wp-cli.phar --info
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
# Test
wp --info

57
install_wp.sh Normal file
View File

@@ -0,0 +1,57 @@
#!/usr/bin/env bash
#bdd
dbhost=localhost
dbuser=root
dbpass=qUtjnFdebz24N5Xy
dbname=wordpress4
dbprefix=wp4_
#wp
url=localhost
title="My WordPress blog"
admin_user=bruno
admin_password=kpm97321
admin_email="bruno@clicclac.info"
default_theme=twentyseven
defaults_plugins="admin-post-navigation meow-lightbox"
locale=fr_FR
version=4.8
# Télécharger WordPress:
$ wp core download --locale=$locale --version=$version
# Créer le fichier de config (wp-config.php):
#$ wp config create --dbname=testdb --dbuser=wp --dbpass=yourpassword
#$ wp core config --dbname=databasename --dbuser=databaseuser --dbpass=databasepassword --dbhost=localhost --dbprefix=prfx_
# Avec Des options supplémentaires:
$ wp core config --dbname=$dbname --dbuser=$dbuser --dbpass=$dbpass --dbhost=$dbhost --dbprefix=$dbprefix --extra-php <<PHP
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
PHP
# Créer la bdd 'wordpress4':
$ wp db create
# Pour connaitre les encodages utilisés:
#$ wp db cli
#MariaDB [wordpress5]> SELECT @@character_set_database, @@collation_database;
# Installer WordPress:
$ wp core install --url=$url --title=$title --admin_user=$admin_user --admin_password=$admin_password --admin_email=$admin_email
# Changement de la structure des liens pour ne conserver que le nom de l'article
$ wp rewrite structure '/%postname%'
# Liste les thèmes trouvable dans l'installation
$ wp theme list
# Installer un thème:
$ wp theme install $default_theme
# Activer le thème:
$ wp theme activate $default_theme
# Installer et activer les plugins:
#$ wp plugin install admin-post-navigation jetpack meow-lightbox simple-tags sola-newsletters wp-retina-2x-pro wp-super-cache --activate
$ wp plugin install $defaults_plugins --activate

6
klaus.sh Normal file
View File

@@ -0,0 +1,6 @@
#/bin/bash
repo=/volume1/Repositories
klaus $repo/shell_scripts.git/ $repo/syno_scripts.git --host 192.168.1.7

30
klaus.wsgi Normal file
View File

@@ -0,0 +1,30 @@
# -*- coding: UTF-8 -*-
# wsgi.py
# Optional: if you install klaus in a virtualenv, you need to tell Python
# about your environment's site-packages directory
import site
site.addsitedir('/volume1/homes/bruno/.local/lib/python3.5/site-packages')
# Your klaus site title. Make sure it's a unicode object if it
# contains non-ascii characters
TITLE = u"My site title"
# A list of paths pointing to your git repositories
REPOSITORIES = [
"/volume1/Repositories/kymsu_dsm.git",
"/volume1/Repositories/shell_scripts.git",
"/volume1/Repositories/syno_scripts.git",
"/volume1/Repositories/wiki.js.git",
"/volume1/Repositories/wp2010.git",
"/volume1/Repositories/wp2012.git",
"/volume1/Repositories/wp_creator.git",
"/volume1/Repositories/zp_photoblog2.git",
]
# klaus provides a make_app function that creates a WSGI application
from klaus import make_app
# Create the application
application = make_app(REPOSITORIES, TITLE)

47
running3.sh Normal file
View File

@@ -0,0 +1,47 @@
#!/bin/bash
# Variables Section
#==============================================================
# list process to monitor in the variable below.
#PROGRAM1=$1
PROGRAM1=ffmpeg
# APPCHK varible checks to see if $PROGRAM1 is running.
APPCHK=$(ps -ea | grep $PROGRAM1 | grep -v grep | wc -l)
#==================================================================
# The if statement below checks to see if the process is running
# with the ps command. If the value is returned as a 0 then
# a message is prompted
if [ $APPCHK -eq 0 ];
then
echo$PROGRAM1 may be down”
cd "$1"
#rename 's/[[:blank:]]/_/g' *
for FILE in *;
do
#echo "$FILE"
#on récupère le nom sans extension
NAME=$(echo "$FILE" | sed 's/\.[^\.]*$//')
#nom des fichiers
INPUT_FILE="$1/$FILE"
#OUTPUT_FILE=$(echo "$2/$FILE")
OUTPUT_FILE=$(echo "$2/$NAME.mp4")
#if [ "$NAME" != "@eaDir" -a ! -f "$OUTPUT_FILE" ];
if [ "$NAME" != "@eaDir" ];
then
echo "$INPUT_FILE"
echo "$OUTPUT_FILE"
/volume1/homes/bruno/scripts/ffmpeg -i "$INPUT_FILE" -map 0:0 -map 0:1 -c:a aac -strict -2 -async 1 -c:v libx264 -crf 20 -r 25 -s 1920x1080 -aspect 16:9 -qmin 3 -qmax 51 -qdiff 4 -y "$OUTPUT_FILE"
mv "$INPUT_FILE" "$2/"
fi
done
else
echo$PROGRAM1 is running”
fi
exit

29
test.sh Normal file
View File

@@ -0,0 +1,29 @@
ENREGISTREMENTS=/volume1/video/TV_2
TABLEAU=( GR1_B SMR6 Nat CNH Multi4 NTN MHD7 )
cd "$ENREGISTREMENTS"
for FILE in *;
do
echo "$FILE";
#on supprime les espaces dans les noms de fichiers
#RENAME=$(echo "$FILE" | sed -e 's/[[:blank:]]/_/g');
#REN2=$(echo "$FILE" | sed -e 's/Nat/aa/g')
REN2=$(echo "$FILE" | sed -e '{s/[[:blank:]]/_/g;s/(\(GR1_B\|SMR6\|Nat\|CNH\|Multi4\|NTN\|MHD7\))//g}')
#for i in ${TABLEAU[*]}
#do
# echo "$i"
# REN2=$(echo "$FILE" | sed -e 's/\"$i\"//g')
# #REN2=$(echo "$FILE" | sed -e 's/a/aa/g')
#done
if [ -e "$RENAME" ];then
echo "">/dev/null;
else
#mv "$FILE" "$RENAME";
echo "$FILE" "$RENAME" "$REN2";
fi
done
exit

5
vnstatdump.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
/opt/bin/vnstat -u
sleep 10
/opt/bin/vnstat --dumpdb -i eth0 >> /volume1/web/vnstat_php_frontend-1.4.1/dumps/vnstat_dump_eth0