some cleaning

This commit is contained in:
fred 2022-10-28 20:18:00 +02:00
parent 005de5eb72
commit a48542d522
9 changed files with 7 additions and 160 deletions

View File

@ -32,7 +32,7 @@ echo ; echo "Mise à jour des dépots de votre distribution..."
sudo apt-get update
for i in x11-utils xclip zenity kodi; do
for i in x11-utils xclip zenity; do
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
[[ $XDG_SESSION_TYPE == 'x11' ]] && sudo apt install -y $i;
@ -48,8 +48,8 @@ for i in git fail2ban npm netcat-traditional inotify-tools curl net-tools libsod
fi
done
for i in qrencode jq bc file gawk yt-dlp ffmpeg sqlite dnsutils v4l-utils espeak vlc mp3info musl-dev openssl* detox nmap httrack html2text msmtp imagemagick ttf-mscorefonts-installer; do
# removed : sqlite
for i in qrencode jq bc file gawk yt-dlp ffmpeg dnsutils v4l-utils espeak vlc mp3info musl-dev openssl* detox nmap httrack html2text msmtp imagemagick; do
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
sudo apt install -y $i
@ -64,13 +64,6 @@ sudo npm install -g tiddlywiki
[[ $? != 0 ]] && echo "INSTALL tiddlywikiFAILED." && echo "INSTALL tiddlywiki FAILED." >> /tmp/install.failed.log && continue
##########################################################
########### KODI + kodi_uqload_downloader
if [[ $(which kodi) ]]; then
echo ">>> Installation kodi_uqload_downloade <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
${MY_PATH}/kodi_uqload_downloader.sh
[[ $? != 0 ]] && echo "INSTALL kodi_uqload_downloader FAILED." && echo "INSTALL kodi_uqload_downloader FAILED." >> /tmp/install.failed.log && continue
fi
echo "## INSTALLATION AstroGEEK OpenCV = 'Intelligence Amie' - DEV - "
# sudo apt-get install python3-opencv -y
@ -108,7 +101,7 @@ if [[ "$USER" == "pi" ]]; then ## PROPOSE QR_CODE PRINTER SUR RPI
echo "Ambassade? Ajouter imprimante 'brother_ql'? Saisissez OUI, sinon laissez vide et tapez sur ENTRER"
read saisie
if [[ $saisie != "" ]]; then
sudo apt install printer-driver-all cups -y
sudo apt install ttf-mscorefonts-installer printer-driver-all cups -y
sudo pip3 install brother_ql
sudo cupsctl --remote-admin
sudo usermod -aG lpadmin pi
@ -249,7 +242,7 @@ echo "$USER ALL=(ALL) NOPASSWD:/usr/local/bin/brother_ql_print" | (sudo su -c 'E
[[ "$USER" != "xbian" && -d ~/Bureau ]] && sed "s/_USER_/$USER/g" ~/.zen/Astroport.ONE/astroport.desktop > ~/Bureau/astroport.desktop && chmod +x ~/Bureau/astroport.desktop
[[ "$USER" != "xbian" && -d ~/Desktop ]] && sed "s/_USER_/$USER/g" ~/.zen/Astroport.ONE/astroport.desktop > ~/Desktop/astroport.desktop && chmod +x ~/Desktop/astroport.desktop
mkdir -p ~/.zen/tmp
# MAIN # -f ~/.zen/secret.june (ISOConfig déjà lancé) ##
else

View File

@ -14,7 +14,8 @@ MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
###################################################
killall 12345.sh; killall nc; killall tail
~/.zen/Astroport.ONE/12345.sh > ~/.zen/tmp/12345.log &
cd ~/.zen/Astroport.ONE/
./12345.sh > ~/.zen/tmp/12345.log &
tail -f ~/.zen/tmp/12345.log &
echo "1234 PORT SPIDER http://$myIP:1234"
###################################################

View File

@ -1,4 +0,0 @@
#!/bin/bash
######################################################################### ADD ASTROPORT DESKTOP SHORTCUT
[[ -d ~/Bureau ]] && sed "s/_USER_/$USER/g" ~/.zen/astrXbian/.install/astroport.desktop > ~/Bureau/astroport.desktop && chmod +x ~/Bureau/astroport.desktop
[[ -d ~/Desktop ]] && sed "s/_USER_/$USER/g" ~/.zen/astrXbian/.install/astroport.desktop > ~/Desktop/astroport.desktop && chmod +x ~/Desktop/astroport.desktop

View File

@ -1,34 +0,0 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
################################################################################
# PREPARE BROTHER QL STICKERS
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
[[ ! -f ~/.zen/game/players/.current/QR.png ]] && echo "ERROR. Cannot find current connected player" && exit 1
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo)
PLAYER=$(cat ~/.zen/game/players/.current/.player)
PASS=$(cat ~/.zen/game/players/.current/.pass)
SALT=$(cat ~/.zen/game/players/.current/login.june | head -n 1)
PEPPER=$(cat ~/.zen/game/players/.current/login.june | tail -n 1)
LP=$(ls /dev/usb/lp*)
convert ~/.zen/game/players/.current/QR.png -resize 300 /tmp/QR.png
convert ${MY_PATH}/../images/astroport.jpg -resize 300 /tmp/ASTROPORT.png
convert -gravity northwest -pointsize 20 -fill black -draw "text 20,20 \"$PSEUDO $PLAYER\"" ${MY_PATH}/../images/extension_territoire.jpg /tmp/pseudo.png
convert -gravity northest -pointsize 20 -fill black -draw "text 20,20 \"$PASS\"" /tmp/pseudo.png /tmp/pass.png
convert -gravity northwest -pointsize 20 -fill black -draw "text 20,180 \"$SALT\"" /tmp/pass.png /tmp/salt.png
convert -gravity northest -pointsize 20 -fill black -draw "text 20,180 \"$PEPPER\"" /tmp/salt.png /tmp/done.jpg
brother_ql_create --model QL-700 --label-size 62 /tmp/done.jpg > /tmp/toprint.bin 2>/dev/null
sudo brother_ql_print /tmp/toprint.bin $LP
exit 0

View File

@ -1,53 +0,0 @@
#!/bin/bash
########################################################################
# Version: 0.3
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
[[ $PLAYER == "" ]] && PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null)
[[ $PLAYER == "" ]] && echo "PLAYER manquant" && exit 1
PSEUDO=$(cat ~/.zen/game/players/$PLAYER/.pseudo 2>/dev/null)
[[ $G1PUB == "" ]] && G1PUB=$(cat ~/.zen/game/players/$PLAYER/.g1pub 2>/dev/null)
[[ $G1PUB == "" ]] && echo "G1PUB manquant" && exit 1
ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
[[ $ASTRONAUTENS == "" ]] && echo "ASTRONAUTE manquant" && exit 1
for v in $(cat ~/.zen/game/players/*/voeux/*/.title); do
g1pub=$(grep -r $v ~/.zen/game/players/*/voeux/ $v 2>/dev/null | rev | cut -d '/' -f 2 | rev )
echo "$v : $g1pub"
echo '------------------------------------------------------------------'
vlist=($v:$g1pub ${vlist[@]})
done
echo "${vlist[@]}"
PS3='Choisissez le TW à exporter ___ '
voeux=($(ls ~/.zen/game/players/$PLAYER/voeux 2>/dev/null) "QUITTER")
select voeu in "${vlist[@]}"; do
case $voeu in
"QUITTER")
exit 0
;;
*) echo "OK pour $voeu"
voeu=$(echo $voeu | cut -d ':' -f2) ## Get G1PUB part
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
VOEUNS=$(ipfs key list -l | grep -w $voeu | cut -d ' ' -f1)
echo "/ipns/$VOEUNS"
ipfs --timeout 12s cat /ipns/$VOEUNS > ~/.zen/tmp/index.html
[[ ! -s ~/.zen/tmp/index.html ]] && echo "TIMEOUT ERROR" && break
tiddlywiki --load ~/.zen/tmp/index.html --output ~/.zen/tmp --render '.' 'tiddlers.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[ipfs]]' ## TUBE.copy.sh Tiddlers
cat ~/.zen/tmp/tiddlers.json | jq -r
;;
esac
done

View File

@ -1,18 +0,0 @@
#!/bin/bash
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
# Check who is .current PLAYER
PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 )
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 )
G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 )
IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 )
# Check if Astroport Station already has a "captain"
source ~/.zen/ipfs.sync; echo "Le capitaine de cet Astroport est actuellement $CAPTAIN"
echo "Astronaute $PLAYER ($PSEUDO) "

View File

@ -1,18 +0,0 @@
#!/bin/bash
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
# Check who is .current PLAYER
PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 )
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 )
G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 )
IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 )
# Check if Astroport Station already has a "captain"
source ~/.zen/ipfs.sync; echo "Le capitaine de cet Astroport est actuellement $CAPTAIN"
echo "Astronaute $PLAYER ($PSEUDO) "

View File

@ -1,10 +0,0 @@
#!/bin/bash
################################################################################
source ./header.sh
player=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f 1)
moa=$(ipfs key list -l | grep -w moa_$PLAYER | cut -d ' ' -f 1)
qoop=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f 1)
xdg-open "http://127.0.0.1:8080/ipns/$player"

View File

@ -1,10 +0,0 @@
#!/bin/bash
################################################################################
source ./header.sh
player=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f 1)
moa=$(ipfs key list -l | grep -w moa_$PLAYER | cut -d ' ' -f 1)
qoop=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f 1)
xdg-open "http://127.0.0.1:8080/ipns/$player"