Compare commits

...

10 Commits

Author SHA1 Message Date
2a39a846ab upgrade_nextcloud 2021-11-11 08:26:45 +01:00
b29574668f 09-03-2021 2021-03-09 06:42:05 +01:00
b2e684f55d after stash 2019-11-08 11:36:37 +01:00
bfa67e5aed Function test_and_copy
-teste si fichier/dossier existe et le copie sur la destination
2019-11-08 08:08:29 +01:00
60d06da8df Suppressions de scripts
déplacés vers le repo bash
2019-10-27 18:42:25 +01:00
6adc6f1f71 reinstall 2019-08-10 09:28:27 +02:00
0957a88ac8 mkbuild 2019-06-19 10:18:43 +02:00
adb4c0029e Mkbuild
-support de Linux
2019-06-11 12:20:04 +02:00
c9a35007ac apache_tools
option switch to php version
2019-05-12 14:57:45 +02:00
faa6fea904 apache_tools.sh
Les chemins des fichiers ne sont plus codés en dur, mais tirés de la configuration courante
2019-03-26 07:20:44 +01:00
13 changed files with 160 additions and 746 deletions

1
EPG.sh
View File

@@ -1 +0,0 @@
/Users/bruno/.wg++/EPG.sh

View File

@@ -1,436 +0,0 @@
# Apps, package, scripts installed:
## Homebrew
### Tap:
cpbotha/marmaduke-chromium
homebrew/apache
homebrew/bundle
homebrew/cask
homebrew/cask-versions
homebrew/core
homebrew/dupes
homebrew/services
homebrew/versions
linux-noah/noah
tideways/profiler
vapor/tap
### Packages:
apr
apr-util
argon2
argyll-cms
aspell
atk
autoconf
bash-completion
boost
borg
brew-pip
brotli
c-ares
cabextract
cairo
chmlib
cmake
composer
ctls
curl
curl-openssl
dashing
doxygen
emscripten
faac
ffmpeg
fontconfig
freetds
freetype
fribidi
gdbm
gdk-pixbuf
gettext
ghostscript
git-ftp
glib
gmp
gnu-getopt
gnu-tar
go
gobject-introspection
graphite2
gtk+
handbrake
harfbuzz
hicolor-icon-theme
highlight
httpd
hugo
icdiff
icu4c
imap-uw
jansson
jemalloc
jpeg
jq
lame
libbpg
libev
libevent
libffi
libiconv
libidn
libidn2
libmetalink
libogg
libpng
libpq
libressl
libsodium
libssh2
libtiff
libtool
libunistring
libvorbis
libvpx
libxml2
libyaml
libzip
little-cms2
lua
makedepend
mariadb
mas
md5deep
md5sha1sum
mongodb
mono
mtr
multitail
nano
ncurses
nghttp2
nginx
nmap
noahstrap
node
noti
nvm
oniguruma
openldap
openssl
openssl@1.1
opus
p7zip
packer
pandoc
pango
pcre
pcre2
perl
php
php-code-sniffer
php@7.2
phpmyadmin
pixman
pkg-config
pv
py2cairo
pygobject
pygtk
python
python3
python@2
readline
rsync
rtmpdump
sdl2
shellcheck
snappy
spdylay
sphinx-doc
sqlite
ssh-copy-id
tcl-tk
terminal-notifier
theora
tidy-html5
tkdiff
trash
unixodbc
unrar
vapor
webp
wget
wine
winetricks
wp-cli
x264
x265
xvid
xz
yuicompressor
zlib
### Casks:
0xed
airy
alfred
appcleaner
atom
bartender
basictex
batchmod
beamer
bettertouchtool
betterzip
bitwarden
cakebrew
cloudtv
coconutbattery
controlplane
cookie
cryptomator
dash
diffmerge
disk-drill
diskmaker-x
displaycal
docker
easyfind
etcher
ff-works
firefox-developer-edition
fork
github
google-earth-pro
graphicconverter
handbrake
harmony
houdahgeo
houdahgps
hubic
ifilex
iina
invisor-lite
iterm2
itsycal
kdiff3
kitematic
launchcontrol
lyn
marked
marmaduke-chromium
meta
molotov
mplayerx
mpv
musicbrainz-picard
name-mangler
nextcloud
nvalt
onyx
pacifist
platypus
plex-media-player
plexamp
poedit
progressive-downloader
purevpn
qlcolorcode
qlmarkdown
qlstephen
qownnotes
screens
stellarium
subler
sublime
sublime-text
superduper
suspicious-package
syncmate
timemachineeditor
tower2
transmission
transmit
tripmode
typora
vagrant
visual-studio-code
vivaldi
vlc
vnc-viewer
waltr
wordpresscom
xact
xld
xnconvert
xnviewmp
xquartz
yate
## mas (Mac App Store)
Mastock (403176537)
SubEthaEdit (728530824)
App Cleaner (1013897218)
JSON Validator (457563999)
Speedtest (1153157709)
ChmPages (1164062917)
Startup Disk Full Fixer (1346655838)
1Blocker (1107421413)
iScheduleTimeMachine (798826767)
Reeder (880001334)
MCG (799178412)
ShutterCount (720123827)
Colibri (1178295426)
CleanMyDrive 2 (523620159)
iMovie (408981434)
MarkNotes (1059403637)
Router (1229416813)
Icon Slate (439697913)
EOBD-Facile (976630793)
Monosnap (540348655)
Audio Converter Lite (703369642)
EtreCheck (1423715984)
SSH Config Editor (1109319285)
RulerSwift (1102341786)
Notebook (1173152781)
SoundConverter (413890028)
HTTP Client (418138339)
Microsoft Remote Desktop (1295203466)
iHex (909566003)
LaunchD Task Scheduler (620249105)
gps4cam (704400176)
GhosteryLite (1436953057)
Flick for Netflix (1120947587)
Xcode (497799835)
PhotoSync (418818452)
Photo Transfer App (509182449)
ExifPurge (784466108)
iMazing HEIC Converter (1292198261)
GarageBand (682658836)
SecSign ID (1038409057)
MDB Tool - For Microsoft Access (513995545)
2STP Companion (1055307502)
Pages (409201541)
Together 3 (641534696)
Simplenote (692867256)
Numbers (409203825)
Network Speed Tester (1217419133)
The Unarchiver (425424353)
Stock + (527270840)
Compressify (414830806)
Keynote (409183694)
iCHM (1243909868)
GPX Editor (924782627)
## PECL extensions
apcu
xdebug
yaml
## Python packages
appnope
autopep8
backcall
bleach
Click
decorator
defusedxml
Django
entrypoints
fontawesome-markdown
html5lib
ipykernel
ipython
ipython-genutils
ipywidgets
jedi
Jinja2
jsonschema
jupyter
jupyter-client
jupyter-console
jupyter-core
livereload
Markdown
MarkupSafe
material
mistune
mkdocs
mkdocs-bootstrap
mkdocs-material
mod-wsgi
nbconvert
nbformat
notebook
pandocfilters
parso
pep8
pexpect
pickleshare
pip
pipdeptree
prometheus-client
prompt-toolkit
ptyprocess
pycodestyle
Pygments
pymdown-extensions
python-dateutil
pytz
PyYAML
pyzmq
qtconsole
Send2Trash
setuptools
simplegeneric
six
terminado
terminaltables
testpath
tornado
traitlets
wcwidth
webencodings
wheel
widgetsnbextension
yolk
yolk3k
## Atom packages
Solis
dash
french-menu
git-plus
## Node.js packages
### Global:
ajv-keywords
cli
dploy
ghost
ghost-cli
npm
npm-install-peers
yarn
### Local:
lg-autoplay
─ jquery
lg-fullscreen
lg-hash
lg-pager
lg-share
lg-thumbnail
lg-video
lg-zoom
lightgallery
livephotoskit
picturefill
uninstall-all-modules

View File

@@ -1,36 +0,0 @@
#!/usr/bin/env bash
echo -e "\033[1mApache Tools: \033[0m"
editeur=/usr/local/bin/bbedit
v_apa=$(httpd -V | grep 'SERVER_CONFIG_FILE')
conf_apa=$(echo "$v_apa" | awk -F "\"" '{print $2}')
v_php=$(php --info | grep -E 'usr.*ini')
conf_php=$(echo "$v_php" | grep 'Loaded Configuration File' | awk '{print $NF}')
v_mysql=$(mysql --help | grep -A1 'Default options')
options=(
"Apache (r)estart"
"(E)dit httpd.conf"
"error_log Apache"
"access_log Apache"
"Edit (P)HP.ini"
"Apache/PHP/MySQL (V)ersion"
"Apache/PHP/MySQL (C)onfiguration files"
"(Q)uit"
)
select option in "${options[@]}"; do
case "$REPLY" in
1|r|R) sudo apachectl -k restart ;;
2|e|E) "$editeur" "$conf_apa" ;; # httpd.conf
3) tail -f /usr/local/var/log/httpd/error_log ;;
4) tail -f /usr/local/var/log/httpd/access_log ;;
5|p|P) "$editeur" "$conf_php" ;; # php.ini
6|v|V) apachectl -v && echo ' ' && php -v && echo ' ' && mysql --version ;;
7|c|C) echo -e "\033[4mApache:\033[0m " && echo $v_apa && echo ' ' && echo -e "\033[4mPHP:\033[0m " && echo $v_php && echo ' ' && echo -e "\033[4mMySQL:\033[0m " && echo $v_mysql ;;
8|q|Q) break ;;
esac
done

View File

@@ -1,45 +0,0 @@
#!/bin/bash
if [ "$1" == "-h" ]; then
echo -e "\033[93mbackup-conf.sh\033[0m"
echo "Backup several files and folders:"
echo
echo " - httpd.conf"
echo " - httpd-vhosts.conf"
echo " - php.ini"
echo " - .bash_profile"
echo " - .gitconfig"
echo " - .wg++"
echo " - .nanorc, .nanosyntax"
echo " - .ssh"
echo " - .vnc"
echo " - .kymsu"
echo
echo "USAGE: backup-conf"
echo
echo " -h display this help"
echo
exit 0
fi
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'

28
color-bash.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# https://misc.flogisoft.com/bash/tip_colors_and_formatting
# prints a color table of 8bg * 8fg * 2 states (regular/bold)
echo
echo Table for 16-color terminal escape sequences.
echo Replace ESC with \\033 in bash.
echo
echo "Background | Foreground colors"
echo "---------------------------------------------------------------------"
for((bg=40;bg<=47;bg++)); do
for((bold=0;bold<=1;bold++)) do
echo -en "\033[0m"" ESC[${bg}m | "
for((fg=30;fg<=37;fg++)); do
if [ $bold == "0" ]; then
echo -en "\033[${bg}m\033[${fg}m [${fg}m "
else
echo -en "\033[${bg}m\033[1;${fg}m [1;${fg}m"
fi
done
echo -e "\033[0m"
done
echo "--------------------------------------------------------------------- "
done
echo
echo

22
isfolder.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
test_and_copy() {
if [ -d $1 ] ;
then
cp -R $1 $2
fi
}
if [ -f $1 ] ;
then
cp $1 $2
fi
}
a=auguste
folder=$HOME/Documents/2FA
dest=$HOME/Desktop
test_and_copy "$folder" "$dest"

1
kymsu
View File

@@ -1 +0,0 @@
/Users/bruno/.kymsu/

View File

@@ -1,33 +0,0 @@
#!/bin/bash
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo -e "\033[93m\033[1mkymsu2\033[0m"
echo ""
echo "Keep Your macOs Stuff Updated 2"
echo "a fork from kymsu https://github.com/welcoMattic/kymsu"
echo
echo "USAGE: kymsu2"
echo
echo "Commandes: "
echo " -h, --help display this help"
echo " --nodistract no distract mode (no user interaction)"
echo " --cleanup removing any older versions of installed formulae and clearing old downloads from the Homebrew download-cache"
echo " --npm_cleanup cleaning npm cache"
echo
exit 0
fi
# à renseigner avec le répertoire contenant tes script
SCRIPTS_DIR=/Users/bruno/.kymsu/plugins.d
cd "$SCRIPTS_DIR"
# On boucle sur tous les fichiers du répertoire…
for script in $(find . -name '[_0]*' -maxdepth 1 | sort); do
# si le fichier est exécutable…
if [ -x "$SCRIPTS_DIR/$script" ]; then
# on lexécute ; le $@ permet de passer à chaque
# script les arguments passés à *ce* script
$SCRIPTS_DIR/$script $@
fi
done

View File

@@ -1,161 +0,0 @@
#!/bin/bash
<<COMMENT
underline=`tput smul`
nounderline=`tput rmul`
bold=`tput bold`
normal=`tput sgr0`
echo "toto"
echo -e "\033[1m bold \033[0m"
echo -e "\033[3m italic \033[0m"
echo -e "\033[4m underline \033[0m"
echo -e "\033[1;3;31m Red bold+italic \033[0m"
echo -e "\033[9m strikethrough \033[0m"
echo -e "\033[31m Red World \033[0m"
echo -e "\033[93m Yellow World \033[0m"
echo -e "\033[32m Green World \033[0m"
COMMENT
brew=0
casks=0
mas=0
function usage {
cat <<EOM
Create Homebrew 's packages and Casks installed list:"
a brew-install.sh script is created next to this script..."
Usage: $(basename "$0") [OPTION]...
-b brew
-c casks
-m mas
-h display help
EOM
exit 2
}
while getopts ":bcmh-:" option; do
if [ "$option" = "-" ] ; then
case $OPTARG in
help) option=h;;
brew) option=b;;
casks) option=c;;
mas) option=m;;
*) echo "Option $OPTARG inconnue";;
esac
fi
case "$option" in
b) brew=1;;
c) casks=1;;
m) mas=1;;
h) usage;;
?) echo "Option -$OPTARG inconnue"
usage;;
esac
done
shift $((OPTIND - 1))
if [ -f brew-install.sh ]; then
echo -e "The file \033[93mbrew-install.sh\033[0m already exist! We erase it."
rm brew-install.sh
fi
echo '#!/bin/bash' >> brew-install.sh
# function for installing homebrew
echo '
installHomebrew() {
echo -e "/n Installing Homebrew"
#/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#sudo chown -R $USER /usr/local/
#export $PATH=/usr/local/bin:$PATH
brew update
}' >> brew-install.sh
#if type xcode-select >&- && xpath=$( xcode-select --print-path ) &&
# test -d "${xpath}" && test -x "${xpath}" ; then
# #... is correctly installed
#else
# #... isn't correctly installed
#fi
# test if CLT is installed
echo '
# test if CLT is installed' >> brew-install.sh
echo '
clt=$(xcode-select --install 2>&1 | grep installed)
if [ -n "$clt" ]; then
echo "Command Line Tools (CLT) for Xcode already installed";
else
echo "Installing Command Line Tools (CLT) for Xcode";
fi' >> brew-install.sh
# test if homebrew is installed
echo '
# test if Homebrew is installed' >> brew-install.sh
echo '
if [[ $(command -v brew) == "" ]]; then
installHomebrew
else
echo "Updating Homebrew"
brew update
fi
' >> brew-install.sh
# test if mas is installed
echo '
# test if mas is installed' >> brew-install.sh
echo '
if [[ $(command -v mas) == "" ]]; then
brew install mas
else
echo "mas already installed"
fi
' >> brew-install.sh
if [[ "$brew" -eq 1 ]] || [[ "$casks" -eq 1 ]] || [[ "$mas" -eq 1 ]]; then
echo -e "\n# Brew tap list.\n" >> brew-install.sh
echo -e "🍺 Get Homebrew \033[3m\033[93mtap\033[0m list"
brew tap | sed -e 's/^/brew tap /' >> brew-install.sh
fi
if [ "$brew" -eq 1 ]; then
echo -e "\n# Brew packages that I use alot.\n" >> brew-install.sh
echo -e "🍺 Get Homebrew \033[3m\033[93mpackages\033[0m installed list"
brew list | sed -e 's/^/brew install /' >> brew-install.sh
fi
if [ "$casks" -eq 1 ]; then
echo -e "\n# Some casks packages that I like.\n" >> brew-install.sh
echo -e "🍺 Get Homebrew \033[3m\033[93mCask\033[0m installed list"
brew cask list | sed -e 's/^/brew cask install /' >> brew-install.sh
fi
# https://github.com/mas-cli/mas
if [ "$mas" -eq 1 ]; then
echo -e "\n# Mac App Store applications list.\n" >> brew-install.sh
echo -e "🍏 Get Mac App Store \033[3m\033[93mapplications\033[0m list"
#mas list | awk '{print $1}' | sed -e 's/^/mas install /' >> brew-install.sh
appfrommas=$(mas list)
while read -r line; do
number=$(echo "$line" | awk '{print $1}')
name=$(echo "$line" | awk -F "(" '{print $1}' | awk {'first = $1; $1=""; print $0'} | sed 's/^ //g')
echo "#$name" >> brew-install.sh
echo "mas install $number" >> brew-install.sh
echo " " >> brew-install.sh
done <<< "$appfrommas"
fi
chmod +x brew-install.sh
terminal-notifier -title 'brew-list' -message 'Packages & casks list created !' -sound 'Glass'

View File

@@ -1,33 +0,0 @@
#!/bin/bash
if [ "$1" == "-h" ]; then
echo -e "\\033[93mmkbuild.sh\\033[0m"
echo "Build MkDocs project and send him on server"
echo
echo "USAGE: mkbuild"
echo
echo " -h display this help"
echo
exit 0
fi
user="bruno"
server="clicclac.synology.me"
destination="/volume1/web"
local_folder="central_docs"
cd /Users/bruno/project || exit
/usr/local/bin/mkdocs build --clean
scp -P42666 -pr ./$local_folder $user@$server:$destination
#rsync -avz --stats --progress /Users/bruno/project/central_docs/ $user@$server::$dest
result=$?
if [ -x "$(command -v terminal-notifier)" ]; then
if [ $result -eq 0 ]; then
terminal-notifier -title 'MkDocs' -message "Envoi terminé sur $server !" -sound 'Glass'
else
terminal-notifier -title 'MkDocs' -message "Echec lors de l'envoi sur $server : erreur $result" -sound 'Basso'
fi
fi
#rsync -rav -e ssh ./central_docs bruno@192.168.1.7:/volume1/web/tt

7
modified.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
dir="/usr/local/etc/httpd"
name="httpd.conf"
test=$(find $dir -name "$name" -mmin -2 -maxdepth 1)
#[ ! -z $test ] && echo "$name was modified in the last 2 minutes"
[ ! -z $test ] && echo -e "\033[1;31m❗ $name was modified in the last 5 minutes\033[0m"

53
tabColor.sh Executable file
View File

@@ -0,0 +1,53 @@
#!/bin/bash
# Texte de l'exemple ( >= 3 caractères ) :
TEXT=" Bash " ;
# Couleur du texte :
declare -a FG=('' '1' '4' '5' '7' '30' '31' '32' \
'33' '34' '35' '36' '37') ;
echo
# Première ligne :
printf "FG \ BG\t%${#TEXT}s" ;
for bg in {40..47} ; do
printf "%${#TEXT}s" "${bg} " ;
done
echo ;
# Création du tableau de présentation des combinaisons :
for fg in ${!FG[*]} ; do
echo -ne "${FG[fg]}\t\033[${FG[fg]}m$TEXT" ;
for bg in {40..47} ; do
echo -ne "\033[${FG[fg]};${bg}m$TEXT\033[0m" ;
done
echo ;
done
# Comment déclarer une couleur :
cat <<_eof_
Format de déclaration : \\033[XXm où XX prend les valeurs
de FG ou BG" ;
Retour aux paramètres par défaut : \033[0m" ;
Pour plus de détails : http://www.admin-linux.fr/?p=9011
ST: Style (0 à 9)
FG: Foreground (30 à 37)
BG: Background (40 à 47)
\\033[STm (ex Style Bold \\033[1m)
\\033[FGm (ex Text Red \\033[31m)
\\033[BGm (ex Background Red \\033[41m)
\\033[FG;BGm (ex Rouge sur fond Vert \\033[31;42m)
\\033[ST;FGm (ex Jaune souligné \\033[4;33m)
\\033[ST;FG;BGm (ex Jaune sur fond Bleu souligné \\033[4;33;44m)
_eof_

50
upgrade_nextcloud.sh Executable file
View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
host=$(hostname)
if [ "$host" = "DS916" ]; then
php_version=73
php_bin=/usr/local/bin/php$php_version
nc_dir=/volume1/web/nextcloud
cd $nc_dir || exit
sudo -u http /usr/local/bin/php74 -d memory_limit=1024M occ maintenance:mode --on
sudo -u http /usr/local/bin/php74 -d memory_limit=1024M occ maintenance:repair
echo ""
echo -e "\033[4mWhen the message 'Should the \"occ upgrade\" command be executed? [Y/n]' is displayed, you must choice 'n' (no)\033[0m"
echo ""
sudo -u http /usr/local/bin/php74 -d memory_limit=1024M updater/updater.phar
# Should the "occ upgrade" command be executed? [Y/n] n
# non
echo ""
echo -e "\033[4mLa version par défaut de PHP est la 5.6.11, ce qui est insuffisant (7.2 requis). On relance la suite avec la bonne version de php\033[0m"
echo ""
sudo -u http /usr/local/bin/php74 -d memory_limit=1024M occ maintenance:mode --on
sudo -u http /usr/local/bin/php74 -d memory_limit=1024M occ upgrade
sudo -u http /usr/local/bin/php74 -d memory_limit=1024M occ maintenance:mode --off
elif [ "$host" == "localhost" ]; then
ip=$(hostname -I | awk '{print $1}')
if [ "$ip" = "212.227.191.167" ]; then
php_version=7.3
php_bin=/opt/plesk/php/$php_version/bin/php
nc_dir=/var/www/vhosts/maboiteverte.fr/httpdocs/nextcloud
cd $nc_dir || exit
sudo -u bruno $php_bin occ maintenance:mode --on
sudo -u bruno $php_bin occ maintenance:repair
sudo -u bruno $php_bin updater/updater.phar
sudo -u bruno $php_bin occ upgrade
sudo -u bruno $php_bin occ maintenance:mode --off
fi
fi