- Anleitungen Bash Debian Do_it_Yourself Eigene Werke Encryption Energieversorgung Ernährung Finanzen Gesammelte Werke Gesellschaft Gesundheit Grafiken Grundlagen GUI Heilpflanzen Humor Innovationen IT Syntax Juristisches Lebensmittel Linux Literatur Mobilität 2.0 Multimedia Nachhaltigkeit Netzwerke obsolet PHP Politricks Sailfish OS Scripte Server Shell Sicherheit Technologie Virtualisierung Wordpress Zitate
Kategorien
Archive
Neueste Beiträge
- Nextcloud 17 Installation auf Debian 10 Server
- MySQL Befehle
- IP Fire – Die Next Generation Firewall
- Grafikprojekt : Gib Autos keine Chance
- LVM Installation auf LUKS Basis – Grub reparieren / neu installieren
- MySQL Server Umzug
- FFMpeg video merge Script ( SFOS / Debian / u.a.)
- Brennnessel – Wildgemüse und Heilpflanze
- Gewöhnlicher Tüpfelfarn – natürlicher Sonnenschutz
- Der Virus
Archiv der Kategorie: Debian
Nextcloud 17 Installation auf Debian 10 Server
Installation Installation des Apache und MySQL Servers Mit dem folgenden Befehl wird der Apache und MySQL Server sowie einige von Nextcloud benötigte Pakete installiert:
1 | sudo apt install -y mariadb-server mariadb-client apache2 apache2-utils php7.3-cli php7.3-common php7.3-mbstring php7.3-gd php-imagick php7.3-intl php7.3-bz2 php7.3-xml php7.3-mysql php7.3-zip php7.3-dev php7.3-curl php7.3-fpm php-dompdf redis-server php-redis php-smbclient php7.3-ldap wget curl sudo unzip |
MySQL Datenbank Setupscript für Mariadatenbanken ausführen:
1 | sudo mysql_secure_installation |
Ausgabe des Setupscripts: NOTE: RUNNING ALL PARTS OF … Weiterlesen
Kategorie(n): Anleitungen, Debian, Multimedia, Server
LVM Installation auf LUKS Basis – Grub reparieren / neu installieren
Die Installation eines Linux auf eine mit LUKS verschlüsselte und per LVM partitionierte Festplatte erfordert im Falle eines defekten Grub Bootloaders einige umfangreichere Vorbereitungen um Grub zu reparieren bzw. neu zu installieren. Die meisten Werkzeuge wie Rescatux oder Supergrubdisk setzen … Weiterlesen
Kategorie(n): Anleitungen, Debian, Encryption, IT Syntax, Linux, Server
MySQL Server Umzug
MySQL-Datenbanken komplett sichern Das folgende Bash-Script ermittelt alle aktuell vorhandenen MySQL-Datenbanken, und schreibt im laufenden Datenbankserver-Betrieb komprimierte MySQL-Dumps in einen lokalen Ordner (BACKUP_DIR). Es kann eingestellt werden, wie viele solcher Kopien vorgehalten werden (HOLD_DAYS). Ältere Ordner werden automatisch gelöscht. Gleich … Weiterlesen
Kategorie(n): Anleitungen, Debian, Server
FFMpeg video merge Script ( SFOS / Debian / u.a.)
Action Cams sowie einige Apps teilen Videoaufzeichnungen oftmals in kleine Teile. Diese wieder ohne Neurendern zu einer Videodatei zusamenzufügen ist mit dem Programm ffmpeg möglich. Das unten aufgeführte Script verinefacht die syntax Eingabe
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | #!/bin/bash # name : ffmpeg_vm.sh # desciption : ffmpeg video merge script for Sailfish OS // merge video files parts to one file # autor : speefak (itoss@gmx.de) # licence : (CC) BY-NC-SA VERSION=1.6 # #------------------------------------------------------------------------------------------------------------ ############################################################################################################ ####################################### define global variables ######################################## ############################################################################################################ #------------------------------------------------------------------------------------------------------------ VideoFileTypes="mkv\|mp4\|mpg\|mpeg\|mov\|m4a\|3gp" Options=$(echo $@ | tr " " "\n" | grep -w "\-[a-z]") #------------------------------------------------------------------------------------------------------------ ############################################################################################################ ######################################## define input options ########################################## ############################################################################################################ #------------------------------------------------------------------------------------------------------------ config () { InputDir=$(echo $@ | tr " " "\n" | grep -wv "\-[a-z]" | sed 's|/$||' | head -n1) OutputTarget=$(echo $@ | tr " " "\n" | grep -wv "\-[a-z]" | sed -n '2p') if [[ $(grep "/" <<< $OutputTarget) ]]; then OutputTargetDIR=$(echo $OutputTarget | sed 's|/'$(echo $OutputTarget | awk -F "/" '{printf $NF}' )'||') fi OutputDefaultName=$(date "+%F_%H:%M")_merged OutputDefaultDir=$InputDir VideoOutputFile=${OutputTarget:-$OutputDefaultDir/$OutputDefaultName}.mkv # ProccessingFileList=$(find $InputDir -maxdepth 1 -type f -name '*' -printf "$PWD/%p\n" 2> /dev/null | grep -vw ".*_merged" | sort | grep -i $VideoFileTypes) # SFOS incomp. for i in $(find $InputDir -maxdepth 1 -type f -name '*' 2> /dev/null | grep -vw ".*_merged" | sort | grep -i $VideoFileTypes); do # check for realtive or absolute path if [[ ! $(grep "^\/" <<< $i) ]]; then ProccessingFileList=$(echo -e -n "$(pwd)/$i\n""$ProccessingFileList") else ProccessingFileList=$(echo -e -n "$i\n""$ProccessingFileList") fi done ProccessingFileListSize=$(du -ch $ProccessingFileList 2> /dev/null | tail -1 | cut -f 1) ProccessingFileListFFMPEG=$( echo "$ProccessingFileList" | tac | sed "s/^/file '/" | sed "s/$/'/" ) if [[ $(grep "\-v" <<< $Options ) ]] ; then VerboseMode=1 ; fi # detect OS if [[ $(cat /etc/*release* | grep "NAME=\"Sailfish OS\"") ]]; then DetectedOS=SFOS ffmpeg=ffmpeg_static elif [[ $(cat /etc/*release* | grep "PRETTY_NAME=\"Debian GNU/Linux 9 (stretch)\"") ]]; then DetectedOS=D9 ffmpeg=ffmpeg else DetectedOS=unknown fi } #------------------------------------------------------------------------------------------------------------ ############################################################################################################ ########################################### define functions ########################################### ############################################################################################################ #------------------------------------------------------------------------------------------------------------ usage() { printf "\n sailfish os video merge - version $VERSION " printf "\n merging video files located in a given directory," printf "\n subdirectories excluded, ordered by filenames." printf "\n default video export to input directory" printf "\n" printf "\n usage:$basename $0 <option> </path/to/inputdir> <path/to/outputfile> " printf "\n" printf "\n options: \n" printf "\n -h, display help" printf "\n -v, verbose mode" printf "\n -c, config (software check)" printf "\n -f, fast mode - no requests ( auto overide outputfile )" printf "\n " printf "\e[0;31m\n $1\e[0m\n"$(tput sgr0) printf "\n" exit } #------------------------------------------------------------------------------------------------------------ check_for_required_packages () { # set package name and packagemanagement parameter for various OS types if [[ $DetectedOS == SFOS ]]; then PackagesListInstalled=$(zypper packages --installed-only) PackagesListRequired="ffmpeg_static" elif [[ $DetectedOS == D9 ]]; then PackagesListInstalled=$(dpkg -l) PackagesListRequired="ffmpeg" else usage "package install error: unknown OS" fi # check for required packages for PackageRequired in $PackagesListRequired ; do if [[ ! $(grep -w "$PackageRequired" <<< "$PackagesListInstalled") ]]; then MissingPackages="$MissingPackages $PackageRequired" fi done MissingPackages=$(sed 's/^[ \t]*//' <<< $MissingPackages) # install package request if [[ -n $MissingPackages ]]; then printf "missing packets:\e[0;31m $MissingPackages\e[0m\n"$(tput sgr0) read -e -p "install required packets ? (Y/N) " InstallMissingPackages if [[ $InstallMissingPackages == [Yy] ]]; then # install software packets if [[ $DetectedOS == SFOS ]]; then sudo zypper ref sudo zypper install $MissingPackages if [[ ! $? == 0 ]]; then exit 1 fi elif [[ $DetectedOS == D9 ]]; then sudo apt update sudo apt install $MissingPackages if [[ ! $? == 0 ]]; then exit 1 fi fi else printf "programm error:\e[0;31m missing packets : $MissingPackages\e[0m\n\n"$(tput sgr0) exit 1 fi else printf "\e[0;32m all required packets installed\n"$(tput sgr0) fi } #------------------------------------------------------------------------------------------------------------ check_for_valid_path () { #usage: check_for_valid_path "/checked/path" ProcessingPath=$1 # check write persmission check_write_permission () { touch $ProcessingPath/permissiontest 2>/dev/null if [[ $? == 0 ]]; then if [[ $VerboseMode ]]; then printf "\e[0;32m user has write permission for: $ProcessingPath\n"$(tput sgr0) fi rm $ProcessingPath/permissiontest else usage "user has no write permission for: $ProcessingPath\n" fi } # check path if [[ -d $1 ]]; then if [[ $VerboseMode ]]; then printf "\e[0;32m path exists: $ProcessingPath\n"$(tput sgr0) fi check_write_permission else if [[ $VerboseMode ]]; then printf "\e[0;33m create path: $ProcessingPath\n"$(tput sgr0) fi MkdirOutput=$(mkdir $ProcessingPath 2>&1) if [[ $MkdirOutput ]]; then usage "$(echo $MkdirOutput | cut -d ":" -f2)" fi check_write_permission fi } #------------------------------------------------------------------------------------------------------------ check_for_valid_input_video_files () { if [[ ! $(ls $InputDir 2>/dev/null | grep -i "mkv\|mp4\|mpg\|mpeg\|mov\|m4a\|3gp") ]]; then printf "\n directory contains no video files :\e[0;31m $InputDir \n\n"$(tput sgr0) exit 1 fi } #------------------------------------------------------------------------------------------------------------ progressbar () { # usage : progressbar "MESSAGE" 3 "." echo -ne "$1 " for i in `seq 1 $2`; do echo -en "\033[K$3" sleep 1 done echo -en "\015" } #------------------------------------------------------------------------------------------------------------ ############################################################################################################ ############################################# start script ############################################# ############################################################################################################ #------------------------------------------------------------------------------------------------------------ # help dialog if [[ $(grep "\-h" <<< $Options ) ]]; then usage fi #------------------------------------------------------------------------------------------------------------ config $@ #------------------------------------------------------------------------------------------------------------ # check input options # non interactive mode / fast mode if [[ $(grep "\-f" <<< $Options ) ]]; then yes | $basename $0 $(echo $@ | sed 's/ -f//g') exit 0 fi # check for required software if [[ $(grep "\-c" <<< $Options ) ]]; then check_for_required_packages fi # check for valid input directory if [[ ! -d $InputDir ]]; then usage "enter video input directory" fi # check if output file is a diretory if [[ $(grep "/$" <<< $OutputTarget) ]]; then usage " outputfile is a directory: $OutputTarget" fi # check for existing output dir if [[ -n $OutputTargetDIR ]]; then check_for_valid_path $OutputTargetDIR fi # check for existing outputfile if [[ -f $VideoOutputFile ]]; then read -n1 -e -p " $VideoOutputFile exists, overide (y/N)? " Request if [[ "$Request" == [yY] ]]; then rm $VideoOutputFile else usage " file $VideoOutputFile exists" fi fi #------------------------------------------------------------------------------------------------------------ # print processing parameter printf "\n merge videoparts from directory: $InputDir" printf "\n merged video file destination: $VideoOutputFile" if [[ $VerboseMode == 1 ]]; then printf "\n\e[0;33m %s" $ProccessingFileList $(tput sgr0) else printf "\n " fi printf "estimated video filesize: $ProccessingFileListSize ($(ls $InputDir | grep -c . ) parts)\n" request_loop () { Request= read -n1 -e -p " start merging proccess (y/N)? " Request if [[ "$Request" == [yY] ]]; then printf "" elif [[ "$Request" == [nN] ]]; then printf " merging proccess canceled \n" exit 1 else request_loop fi #printf "\n" } request_loop #------------------------------------------------------------------------------------------------------------ # start merging proccess ErrorLog=/tmp/ffmpeg_vm.err if [[ $VerboseMode ]]; then $ffmpeg -safe 0 -f concat -i <(echo "$ProccessingFileListFFMPEG") -c copy $VideoOutputFile else $ffmpeg -loglevel error -safe 0 -f concat -i <(echo "$ProccessingFileListFFMPEG") -c copy $VideoOutputFile > $ErrorLog 2>&1 & sleep 0.3 while [[ $(ps -ax 2>/dev/null | grep ffmpeg | grep $VideoOutputFile) ]]; do if [[ -s $ErrorLog ]]; then break fi progressbar " processing: $InputDir > $VideoOutputFile " 3 "." done fi if [[ -s $ErrorLog ]]; then printf "\n\n\e[0;31m ffmpeg processing error:\n"$(tput sgr0) cat $ErrorLog rm $ErrorLog 2>&1 > /dev/null exit 1 else printf "\n Videofile created: $VideoOutputFile ($(du -h "$VideoOutputFile" | cut -f1)) " printf "\n" fi #------------------------------------------------------------------------------------------------------------ exit 0 |
Kategorie(n): Bash, Debian, Sailfish OS, Scripte