Created my repo Shell Scripts
This commit is contained in:
17
_test.sh
Executable file
17
_test.sh
Executable file
@@ -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/
|
||||||
22
backup-conf.sh
Executable file
22
backup-conf.sh
Executable file
@@ -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'
|
||||||
69
handbrake-batchconvert.sh
Executable file
69
handbrake-batchconvert.sh
Executable file
@@ -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"
|
||||||
10
mkdocs.command
Executable file
10
mkdocs.command
Executable file
@@ -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
|
||||||
9
mkdocs.sh
Executable file
9
mkdocs.sh
Executable file
@@ -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
|
||||||
Reference in New Issue
Block a user