5 Commits

Author SHA1 Message Date
2bb6671836 installed.sh
-les fichiers Brewfile_* vieux de plus de 10 jours sont supprimés
-la section paquets Atom est désormais optionnelle
2025-04-17 09:31:08 +02:00
ea87685dde venv.sh
soco-cli est désormais installé avec pipx
2025-04-17 09:26:37 +02:00
ce8d9b799e Update Python for PEP668 2024-08-05 23:18:29 +02:00
2124781520 nodejs.sh
-update for latest npm / node compatibility
2024-05-14 07:05:53 +02:00
dc4764c832 Test connection
-replace google.com by apple.com
2024-05-14 07:04:20 +02:00
10 changed files with 166 additions and 51 deletions

View File

@@ -152,7 +152,7 @@ get_info_pkg() {
echo -e "${bold}🍺 Homebrew ${reset}" echo -e "${bold}🍺 Homebrew ${reset}"
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}" echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !" echo -e "Exit !"
@@ -504,6 +504,11 @@ echo -e "\n🍺 ${underline}The Doc is checking that everything is ok...${reset}
brew doctor brew doctor
echo "python-cryptography required by certbot"
echo "python-certifi required by certbot and yt-dlp"
echo "numpy required ffmpeg and openvin"
# suprimer: python-packaging python-argcomplete
brew missing brew missing
status=$? status=$?
if [ $status -ne 0 ]; then brew missing --verbose; fi if [ $status -ne 0 ]; then brew missing --verbose; fi

View File

@@ -14,12 +14,14 @@ chemin=$HOME/Documents/kymsu
#version: pip ou pip3 #version: pip ou pip3
pip_version=pip3 pip_version=pip3
# #
# https://github.com/atom/apm/tags
apm=false
######################################### #########################################
#if [ ! -d chemin ]; then mkdir $chemin; fi #if [ ! -d chemin ]; then mkdir $chemin; fi
mkdir -p $chemin mkdir -p $chemin
now=$(date +"%d-%m-%Y_%T") now=$(date +"%d-%m-%Y_%T" | sed 's/://g')
mac=$(hostname -s) mac=$(hostname -s)
file=$mac"@"$now file=$mac"@"$now
filename="Installed_$file" filename="Installed_$file"
@@ -152,24 +154,25 @@ echo ''
# atom # atom
echo -e "⚛️ Get \033[3m\033[93mAtom editor packages\033[0m installed list" if [ "$apm" = "true" ]; then
atom=$(apm list | grep 'Community Packages' -A 100 | sed '1,1d') echo -e "⚛️ Get \033[3m\033[93mAtom editor packages\033[0m installed list"
{ atom=$(apm list | grep 'Community Packages' -A 100 | sed '1,1d')
echo '## ⚛️ Atom packages' {
echo '' echo '## ⚛️ Atom packages'
echo "\`\`\`bash" echo ''
echo "\`\`\`bash"
while read -r line; do while read -r line; do
a=$(echo "$line" | awk -F "@" '{print $1}' | awk '{print $2}' ) a=$(echo "$line" | awk -F "@" '{print $1}' | awk '{print $2}' )
#atom_pkg=${a:4} #atom_pkg=${a:4}
echo "$a" echo "$a"
done <<< "$atom" done <<< "$atom"
echo "\`\`\`"
echo ""
echo ''
} >> $chemin/Installed.md
echo "\`\`\`"
echo ""
echo ''
} >> $chemin/Installed.md
fi
# Node.js packages (npm) # Node.js packages (npm)
echo -e "🌿 Get npm \033[3m\033[93m node global packages\033[0m installed scripts" echo -e "🌿 Get npm \033[3m\033[93m node global packages\033[0m installed scripts"
@@ -235,11 +238,16 @@ echo ''
echo -e "🍺 Create a \033[3m\033[93mBrewfile\033[0m:" echo -e "🍺 Create a \033[3m\033[93mBrewfile\033[0m:"
echo "list all of the installed brew packages, cask applications, and Mac App Store applications currently on the machine..." echo "list all of the installed brew packages, cask applications, and Mac App Store applications currently on the machine..."
brew bundle dump brew bundle dump
echo '' echo -e "To restore everything listed in that file, run \033[3m\033[93m'brew bundle'\033[0m in folder that contains the Brewfile."
echo -e "To restore everything listed in that file, run \033[3m\033[93m'$ brew bundle'\033[0m in folder that contains the Brewfile."
echo '' echo ''
mv Brewfile "$chemin/Brewfile" mv $chemin/Brewfile "$chemin/Brewfile_$file".md
y=$(find . -type f -name 'Brewfile*' -mtime +10 -maxdepth 1)
if [ -n "$y" ]; then
nb=$(echo "$y" | wc -l)
echo "$y" | xargs rm
[ $? ] && echo -e "\033[93m$nb Brewfile_*\033[0m files removed !"
fi
#iconv -f macroman -t utf-8 Installed.md > Installed-utf8.md #iconv -f macroman -t utf-8 Installed.md > Installed-utf8.md
#mv Installed-utf8.md "$filename".md #mv Installed-utf8.md "$filename".md

View File

@@ -24,7 +24,7 @@ display_info=true
doctor=true doctor=true
# Set update_node to true to update node. # Set update_node to true to update node.
update_node=false update_node=true
# Local install: # Local install:
# run 'npm init' in local_path to create package.json # run 'npm init' in local_path to create package.json
@@ -46,6 +46,7 @@ underline="\033[4m"
ita_under="\033[3;4m" ita_under="\033[3;4m"
bgd="\033[1;4;31m" bgd="\033[1;4;31m"
red="\033[1;31m" red="\033[1;31m"
green="\033[1;32m"
bold="\033[1m" bold="\033[1m"
bold_ita="\033[1;3m" bold_ita="\033[1;3m"
box="\033[1;41m" box="\033[1;41m"
@@ -78,12 +79,13 @@ echo -e " - install path: ${italic}$node_ins${reset}"
# version courante de npm # version courante de npm
npm_v=$(npm -v) npm_v=$(npm -v)
npm_ins=$(which npm) npm_ins=$(which npm)
old_npm="$npm_v"
echo -e "\n${underline}🌿 npm:${reset}" echo -e "\n${underline}🌿 npm:${reset}"
echo -e " - current version: ${italic}$npm_v${reset}" echo -e " - current version: ${italic}$npm_v${reset}"
echo -e " - install path: ${italic}$npm_ins${reset}" echo -e " - install path: ${italic}$npm_ins${reset}"
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}" echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !" echo -e "Exit !"
@@ -360,58 +362,65 @@ echo ""
if [ "$doctor" = true ]; then if [ "$doctor" = true ]; then
echo -e "${underline}🌿 The Doc is checking that everything is ok.${reset}\n" echo -e "${underline}🌿 The Doc is checking that everything is ok.${reset}\n"
#npm doctor #npm doctor
#doc=$(npm doctor)
doc=$(cd "$local_path" && npm doctor) doc=$(cd "$local_path" && npm doctor)
while IFS= read -r line while IFS= read -r line
do do
if [[ "${line}" =~ "not ok" ]]; then if [[ "${line}" =~ "Not ok" ]]; then
echo -e "${red}${line}${reset}" echo -e "${red}${line}${reset}"
elif [[ "${line}" =~ "Ok" ]]; then
echo -e "${green}${line}${reset}"
else else
echo -e "${line}" echo -e "${line}"
fi fi
done <<< "$doc" done <<< "$doc"
#echo -e "$doc\n" #echo -e "$doc\n"
# search not ok => red # search not ok => red
npm_v=$(echo "$doc" | grep 'npm -v') #npm_v=$(echo "$doc" | grep 'npm -v')
node_v=$(echo "$doc" | grep 'node -v') #node_v=$(echo "$doc" | grep 'node -v')
npm_v=$(echo "$doc" | grep -A2 'Checking npm version')
if [[ " $node_v " =~ " not ok " ]]; then node_v=$(echo "$doc" | grep -A2 'Checking node version')
no=$(grep -o -E "v([0-9]{1,2}\.){2}[0-9]{1,2}" <<< "$node_v")
new_node=$(echo "${no:1}" | sed -n '1p')
old_node=$(echo "${no:1}" | sed -n '$p')
#if [ "$new_node" != "$old_node" ]; then if [[ " $node_v " =~ "Not ok" ]]; then
no=$(echo "$node_v" | sed -n '$p')
new_node=$(echo "$no" | awk '{print $3}' | sed 's/^.//')
old_node=$(echo "$no" | awk '{print $5}' | sed 's/.//;s/.$//')
if [ "$new_node" != "$old_node" ] && [ "$update_node" = true ]; then if [ "$new_node" != "$old_node" ] && [ "$update_node" = true ]; then
#if [ "$update_node" = true ]; then
b=$(echo -e "\nCurrent node: $old_node. Update ${bold}node${reset} to ${bold}$new_node${reset} [y/n] ? ") b=$(echo -e "\nCurrent node: v$old_node. Update ${bold}node${reset} to ${bold}v$new_node${reset} [y/n] ? ")
read -e -p "$b" rep2 read -e -p "$b" rep2
if [ "$rep2" == "y" ] || [ "$rep2" == "Y" ]; then if [ "$rep2" == "y" ] || [ "$rep2" == "Y" ]; then
. $HOME/.nvm/nvm.sh . $HOME/.nvm/nvm.sh
echo -e "\n${bold}Updating node to v$new_node...${reset}" echo -e "\n${bold}Updating node to v$new_node...${reset}"
nvm install $new_node nvm install "$new_node"
echo -e "\n${bold}Updating npm...${reset}" echo -e "\n${bold}Updating npm...${reset}"
npm --location=global install npm npm --location=global install npm
# #
nvm use $new_node nvm use $new_node
echo -e "\n${bold}Reinstall packages from $old_node...${reset}" echo -e "\n${bold}Reinstall packages from v$old_node...${reset}"
nvm reinstall-packages $old_node nvm reinstall-packages "$old_node"
fi fi
fi fi
fi fi
if [[ " $npm_v " =~ " not ok " ]]; then if [[ " $npm_v " =~ "Not ok" ]]; then
np=$(grep -o -E "v([0-9]{1,2}\.){2}[0-9]{1,2}" <<< "$npm_v") np=$(grep -o -E "v([0-9]{1,2}\.){2}[0-9]{1,2}" <<< "$npm_v")
new_npm=$(echo "${np:1}" | sed -n '1p') new_npm=$(echo "${np:1}") # 10.7.0
old_npm=$(echo "${np:1}" | sed -n '$p')
if [ "$new_npm" != "$old_npm" ]; then if [ "$new_npm" != "$old_npm" ]; then
echo -e "${underline}Udpate available for npm.${reset} You should run:" echo -e "${underline}\nUdpate available for npm.${reset}"
echo -e " - ${bold}npm --location=global install npm${reset}" echo -e " - Current: ${red}v$old_npm${reset}"
echo -e " - Update: ${green}v$new_npm${reset}"
echo -e "You should run:"
echo -e " - ${bold}npm --location=global install npm${reset}"
fi fi
fi fi

View File

@@ -94,7 +94,7 @@ fi
pecl version pecl version
curl -Is http://www.google.com | head -1 | grep 200 curl -Is https://www.apple.com | head -1 | grep 200
if [[ $? -eq 1 ]]; then if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}" echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !" echo -e "Exit !"

View File

@@ -57,7 +57,7 @@ else
fi fi
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}" echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !" echo -e "Exit !"

View File

@@ -33,7 +33,7 @@ user=""
# Add module to the do_not_update array for prevent to update. # Add module to the do_not_update array for prevent to update.
#declare -a do_not_update=() #declare -a do_not_update=()
#declare -a do_not_update=("parso" "asgiref") #declare -a do_not_update=("parso" "asgiref")
declare -a do_not_update=("geomet") declare -a do_not_update=("pyee")
# #
######################################### #########################################
@@ -78,7 +78,7 @@ if (( ${#do_not_update[@]} )); then
fi fi
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}" echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !" echo -e "Exit !"
@@ -130,7 +130,7 @@ if [ -n "$upd" ]; then
# on filtre les lignes (y = asgiref|setuptools|lunr) # on filtre les lignes (y = asgiref|setuptools|lunr)
y=$(echo "$z" | sed 's/.$//' | sed 's/ /|/g') y=$(echo "$z" | sed 's/.$//' | sed 's/ /|/g')
dependencies=$(echo "$x" | xargs pipdeptree -r -p | grep -E $y) dependencies=$(echo "$x" | xargs pipdeptree -r --python /opt/homebrew/opt/python@3.11/bin/python3.11 -p | grep -E $y)
echo -e "" echo -e ""

View File

@@ -40,7 +40,7 @@ list=$(pipx list --include-injected) # pipx list --quiet
echo -e "\n${underline}List installed packages:${reset}" echo -e "\n${underline}List installed packages:${reset}"
echo "$list" echo "$list"
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}" echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !" echo -e "Exit !"

92
plugins.d/python_668.sh Executable file
View File

@@ -0,0 +1,92 @@
#!/usr/bin/env bash
# pip plugin for KYMSU
# https://github.com/welcoMattic/kymsu
# upgrade pip:
# python -m pip install --upgrade pip
# Configurer pip3:
# pip config edit
#########################################
#
# Settings:
# Display info on updated pakages / casks
#[[ $@ =~ "--info" ]] && display_info=false || display_info=true
display_info=true
# No distract mode (no user interaction)
[[ $@ =~ "-nodistract" || $@ =~ "-n" ]] && no_distract=true || no_distract=false
# Display dependancies on updated pakages / casks
#[[ $@ =~ "--depend" ]] && display_depend=false || display_depend=true
display_depend=true
#version: pip ou pip3
# pip: python3.8 - pip3: python3.9
pip_version=pip3
#user: "" or "--user"
user=""
# Add module to the do_not_update array for prevent to update.
#declare -a do_not_update=()
#declare -a do_not_update=("parso" "asgiref")
declare -a do_not_update=("pyee")
#
#########################################
: <<'END_COMMENT'
blabla
END_COMMENT
italic="\033[3m"
underline="\033[4m"
ita_under="\033[3;4m"
bold="\033[1m"
bold_under="\033[1;4m"
redbox="\033[1;41m"
redbold="\033[1;31m"
red="\033[31m"
yellow="\033[33m"
reset="\033[0m"
command -v pipdeptree >/dev/null 2>&1 || { echo -e "You shoud intall ${bold}pipdeptree${reset} for checking packages dependancies ${italic}($pip_version install pipdeptree)${reset}.\n"; }
command -v $pip_version >/dev/null 2>&1 || { echo -e "${bold}$pip_version${reset} is not installed." && exit 1; }
echo -e "${bold}🐍 $pip_version (Python 3) ${reset}"
echo ""
echo -e "Current ${underline}Python3${reset} version: $(python3 -V | awk '{print $2}')"
echo -e "Current ${underline}pip3${reset} version: $(pip3 -V)"
#$pip_version install --upgrade pip > /dev/null
echo ""
# Do not update packages
if (( ${#do_not_update[@]} )); then
nbp=${#do_not_update[*]}
echo -e "${underline}List of${reset} ${redbox} $nbp ${reset} ${underline}'do not update' packages:${reset}"
echo -e "${redbold}${do_not_update[*]}${reset}"
echo -e "To remove package from this list, you need to edit the ${italic}do_not_update${reset} array."
echo ""
fi
curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !"
exit 1
fi
#Packages update
echo -e "🐍 ${underline}Search for packages update...${reset}\n"
pip_outdated=$($pip_version list --outdated --format columns)
upd=$(echo "$pip_outdated" | sed '1,2d' | awk '{print $1}')

View File

@@ -11,7 +11,7 @@ reset="\033[0m"
echo -e "\n${bold}🦀 Rust${reset}\n" echo -e "\n${bold}🦀 Rust${reset}\n"
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}" echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !" echo -e "Exit !"

View File

@@ -18,7 +18,7 @@ reset="\033[0m"
# Liste des apps: # Liste des apps:
# - le venv doit avoir le même nom que l'app # - le venv doit avoir le même nom que l'app
declare -a apps=("soco-cli" "mkdocs" "streamrip") declare -a apps=("mkdocs")
# Liste des extensions pour Mkdocs # Liste des extensions pour Mkdocs
mkdocs_ext=("mkdocs-material" "mkdocs-material-extensions" "mkdocs-git-revision-date-localized-plugin" "mkdocs-minify-plugin" "fontawesome_markdown" "mkdocs-pdf-export-plugin") mkdocs_ext=("mkdocs-material" "mkdocs-material-extensions" "mkdocs-git-revision-date-localized-plugin" "mkdocs-minify-plugin" "fontawesome_markdown" "mkdocs-pdf-export-plugin")
@@ -48,6 +48,7 @@ if [[ $? -eq 1 ]]; then
exit 1 exit 1
fi fi
echo -e "Venv directory: $v\n"
################################################################################################ ################################################################################################
for app in ${apps[*]} for app in ${apps[*]}