commit 43c7e0cc64bff2253387f439825b16ed38a8c958 Author: Bruno21 Date: Mon Jan 29 09:25:34 2018 +0100 Created my repo Shell Scripts diff --git a/EPG.sh b/EPG.sh new file mode 120000 index 0000000..239cdf1 --- /dev/null +++ b/EPG.sh @@ -0,0 +1 @@ +/Users/bruno/.wg++/EPG.sh \ No newline at end of file diff --git a/_test.sh b/_test.sh new file mode 100755 index 0000000..30d582c --- /dev/null +++ b/_test.sh @@ -0,0 +1,17 @@ +#!/bin/bash +APACHE=$(httpd -v | grep "version" | awk '{print $3}' | awk -F/ '{print $2}') +PHP=$(php -v | grep "cli" | awk '{print $2}') + +#echo $APACHE +#echo $PHP + +cd /Users/bruno/Documents/config\ web\ \(homebrew\)/ + +if [ ! -d "apache $APACHE" ]; then mkdir "apache $APACHE"; fi + +cp /usr/local/etc/httpd/httpd.conf /Users/bruno/Documents/config\ web\ \(homebrew\)/apache\ $APACHE/ +cp /usr/local/etc/httpd/extra/httpd-vhosts.conf /Users/bruno/Documents/config\ web\ \(homebrew\)/apache\ $APACHE/ + +if [ ! -d "php $PHP" ]; then mkdir "php $PHP"; fi + +cp /usr/local/etc/php/7.2/php.ini /Users/bruno/Documents/config\ web\ \(homebrew\)/php\ $PHP/ diff --git a/backup-conf.sh b/backup-conf.sh new file mode 100755 index 0000000..7b52f66 --- /dev/null +++ b/backup-conf.sh @@ -0,0 +1,22 @@ +#!/bin/bash +APACHE=$(httpd -v | grep "version" | awk '{print $3}' | awk -F/ '{print $2}') +PHP=$(php -v | grep "cli" | awk '{print $2}') + +cd /Users/bruno/Documents/config\ web\ \(homebrew\)/ + +if [ ! -d "apache $APACHE" ]; then mkdir "apache $APACHE"; fi +cp /usr/local/etc/httpd/httpd.conf /Users/bruno/Documents/config\ web\ \(homebrew\)/apache\ $APACHE/ +cp /usr/local/etc/httpd/extra/httpd-vhosts.conf /Users/bruno/Documents/config\ web\ \(homebrew\)/apache\ $APACHE/ + +if [ ! -d "php $PHP" ]; then mkdir "php $PHP"; fi +cp /usr/local/etc/php/7.2/php.ini /Users/bruno/Documents/config\ web\ \(homebrew\)/php\ $PHP/ + +cp /Users/bruno/.bash_profile /Users/bruno/Documents/Backups/Bruno/ +cp /Users/bruno/.gitconfig /Users/bruno/Documents/Backups/Bruno/ +cp /Users/bruno/.wg++/WebGrab++.config.xml /Users/bruno/Documents/Backups/Bruno/ +cp /Users/bruno/.nanorc /Users/bruno/Documents/Backups/Bruno/ +cp -R /Users/bruno/.nanosyntax /Users/bruno/Documents/Backups/Bruno/ +cp -R /Users/bruno/.ssh /Users/bruno/Documents/Backups/Bruno/ +cp -R /Users/bruno/.vnc /Users/bruno/Documents/Backups/Bruno/ +cp -R /Users/bruno/.kymsu /Users/bruno/Documents/Backups/Bruno/ +terminal-notifier -title 'Backups' -message 'Sauvegarde terminée !' -sound 'Glass' diff --git a/handbrake-batchconvert.sh b/handbrake-batchconvert.sh new file mode 100755 index 0000000..e4a6e1d --- /dev/null +++ b/handbrake-batchconvert.sh @@ -0,0 +1,69 @@ +#!/bin/sh + +############################################################################### +# +# Script to recursively search a directory and batch convert all files of a given +# file type into another file type via HandBrake conversion. +# +# To run in your environment set the variables: +# hbcli - Path to your HandBrakeCLI +# +# dirs - Array of starting directories for recursive search +# +# input_file_type - Input file type to search for +# +# output_file_type - Output file type to convert into +# +############################################################################### + +hbcli=/usr/local/bin/HandBrakeCLI +input_file_type="mkv" +output_file_type="m4v" + +dirs=( '/Users/bruno/Downloads' +# '/dir2' + ) + + +############################################################################### + +echo "# Using HandBrakeCLI at $hbcli" +echo "# Converting $input_file_type to $output_file_type" + +# Convert from one file to another +convert() { + # The beginning part, echo "" | , is really important. Without that, HandBrake exits the while loop. + echo ""# | $hbcli -i "$1" -o "$2" --preset="Apple 720p30 Surround"; +} + +# Iterate over the array of directories +for i in "${dirs[@]}" +do + echo "Processing source directory: " $i + + # Find the files and pipe the results into the read command because the read command properly handles spaces in directories and files names. + find "$i" -name *.$input_file_type | while read in_file + do + echo "Processing file..." + echo ">Input "$in_file + + # Replace the file type + out_file=$(echo $in_file|sed "s/\(.*\.\)$input_file_type/\1$output_file_type/g") + echo ">Output "$out_file + + # Convert the file + convert "$in_file" "$out_file" + + if [ $? != 0 ] + then + echo "$in_file had problems" >> handbrake-errors.log + fi + + echo ">Finished "$out_file "\n\n" + done +done + +echo "DONE CONVERTING FILES" +echo -en "\007" +echo -en "\007" +echo -en "\007" diff --git a/mkdocs.command b/mkdocs.command new file mode 100755 index 0000000..b73167a --- /dev/null +++ b/mkdocs.command @@ -0,0 +1,10 @@ +#!/bin/bash + +cd /Users/bruno/project +mkdocs build +#noti -t 'MkDocs' -m 'Upload termine' scp -P42666 -r ./central_docs bruno@192.168.1.7:/volume1/web +scp -P42666 -r ./central_docs bruno@192.168.1.7:/volume1/web +terminal-notifier -title 'MkDocs' -message 'Envoi terminé !' -sound 'Glass' +#scp -P42666 -r ./central_docs bruno@clicclac.synology.me:/volume1/web +#rsync -rav -e ssh ./central_docs bruno@192.168.1.7:/volume1/web/tt +exit \ No newline at end of file diff --git a/mkdocs.sh b/mkdocs.sh new file mode 100755 index 0000000..7488af9 --- /dev/null +++ b/mkdocs.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd /Users/bruno/project +mkdocs build +#noti -t 'MkDocs' -m 'Upload termine' scp -P42666 -r ./central_docs bruno@192.168.1.7:/volume1/web +scp -P42666 -r ./central_docs bruno@192.168.1.7:/volume1/web +terminal-notifier -title 'MkDocs' -message 'Envoi terminé !' -sound 'Glass' +#scp -P42666 -r ./central_docs bruno@clicclac.synology.me:/volume1/web +#rsync -rav -e ssh ./central_docs bruno@192.168.1.7:/volume1/web/tt