diff --git a/12345.sh b/12345.sh index e1806c20..00472dd2 100755 --- a/12345.sh +++ b/12345.sh @@ -16,9 +16,9 @@ ME="${0##*/}" MOATS=$(date -u +"%Y%m%d%H%M%S%4N") IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -myDOMAINName=$(hostname -d 2>/dev/null) +myDOMAINName=$(hostname -d 2>/dev/null || domainname 2>/dev/null) myHOSTName=$(hostname |sed 's/\.'${myDOMAINName}'$//') [ -n "$myDOMAINName" ] && myHOSTName="${myHOSTName}.${myDOMAINName}" || myDOMAINName=${myHOSTName#*.} [ -z "$myDOMAINName" ] && myDOMAINName=localhost diff --git a/20h12.process.sh b/20h12.process.sh index ddf233b6..39f1fa37 100755 --- a/20h12.process.sh +++ b/20h12.process.sh @@ -12,7 +12,7 @@ espeak "Ding" > /dev/null 2>&1 myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" ## CLEANING ~/.zen/tmp diff --git a/ASTROBOT/G1Voeu.sh b/ASTROBOT/G1Voeu.sh index 3fb38e1f..6e34be63 100755 --- a/ASTROBOT/G1Voeu.sh +++ b/ASTROBOT/G1Voeu.sh @@ -64,7 +64,7 @@ echo # CRYPTO BUG. TODO use natools to protect and share key with Ŋ1 only ;) myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" echo " Passerelle : $myIP" diff --git a/ASTROBOT/PLAYER.refresh.sh b/ASTROBOT/PLAYER.refresh.sh index 9cec09ca..7503e7dc 100755 --- a/ASTROBOT/PLAYER.refresh.sh +++ b/ASTROBOT/PLAYER.refresh.sh @@ -58,7 +58,7 @@ for PLAYER in ${PLAYERONE[@]}; do mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/ myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" echo "Getting latest online TW..." diff --git a/ASTROBOT/VOEUX.create.sh b/ASTROBOT/VOEUX.create.sh index b05c2018..11566b16 100755 --- a/ASTROBOT/VOEUX.create.sh +++ b/ASTROBOT/VOEUX.create.sh @@ -23,7 +23,7 @@ ASTRONAUTENS=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1) [[ ! $ASTRONAUTENS ]] && echo "$PLAYER IPNS INTROUVABLE" && exit 1 myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" ## EXPORT [tag[voeu]] diff --git a/ASTROBOT/VOEUX.refresh.sh b/ASTROBOT/VOEUX.refresh.sh index 36ae7c97..fb5fec86 100755 --- a/ASTROBOT/VOEUX.refresh.sh +++ b/ASTROBOT/VOEUX.refresh.sh @@ -31,7 +31,7 @@ MOATS=$(date -u +"%Y%m%d%H%M%S%4N") IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu diff --git a/_12345.sh b/_12345.sh index e3fbba2e..611b23af 100755 --- a/_12345.sh +++ b/_12345.sh @@ -12,7 +12,7 @@ MOATS=$(date -u +"%Y%m%d%H%M%S%4N") IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" PORT=12345 diff --git a/adventure/rooms/gameroom.sh b/adventure/rooms/gameroom.sh index 37fb53a9..52319535 100755 --- a/adventure/rooms/gameroom.sh +++ b/adventure/rooms/gameroom.sh @@ -17,7 +17,7 @@ echo "y est raccordé... D'autres fils sortent de l'appareil. Une webcam. Une i echo echo "Que voulez vous faire?" myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" while true; do diff --git a/ajouter_media.sh b/ajouter_media.sh index 6c85a744..be700125 100755 --- a/ajouter_media.sh +++ b/ajouter_media.sh @@ -67,7 +67,7 @@ IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) BROWSER=$(xdg-settings get default-web-browser | cut -d '.' -f 1 | cut -d '-' -f 1) ## GET cookies-from-browser myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" if [ $URL ]; then @@ -274,12 +274,11 @@ rm -Rf ${YTEMP} espeak "Mirror web site" cd ~/.zen/tmp/ - URL=$(echo $URL | grep -Eo '^http[s]?://[^/]+') [ ! $2 ] && [[ $URL == "" ]] && URL=$(zenity --entry --width 300 --title "Lien du site Web à copier" --text "Indiquez le lien (URL)" --entry-text="") ## Extract http(s)://domain.tld - URL=$(echo $URL | grep -Eo '^http[s]?://[^/]+') # URL="https://discuss.ipfs.io" - DOMAIN=$(echo $URL | rev | cut -d '/' -f1 | rev) # DOMAIN=discuss.ipfs.io + URLSOURCE=$(echo $URL | grep -Eo '^http[s]?://[^/]+') # URL="https://discuss.ipfs.io" + DOMAIN=$(echo $URLSOURCE | rev | cut -d '/' -f1 | rev) # DOMAIN=discuss.ipfs.io ARR=($(echo $DOMAIN | sed "s~\.~ ~g")) # ARR=discuss ipfs io NIAMOD=$(printf '%s\n' "${ARR[@]}" | tac | tr '\n' '.' ) # NIAMOD=io.ipfs.discuss. NIAPATH=$(echo $NIAMOD | sed "s~\.~\/~g") # NIAPATH=io/ipfs/discuss/ @@ -311,7 +310,7 @@ rm -Rf ${YTEMP} espeak "Let's go. " ###################### HTTRACK COPYING - httrack -wxY --sockets=99 −−max−rate=0 --disable-security-limits −−keep−alive --ext-depth=0 --stay-on-same-domain --keep-links=0 -V "echo \$0 >> $FILE_PATH/files" "$URL" -* +*/$DOMAIN/* -*wget* # -%l "fr" + httrack -wxY --sockets=99 −−max−rate=0 --disable-security-limits −−keep−alive --ext-depth=0 --stay-on-same-domain --robots=0 --keep-links=0 -V "echo \$0 >> $FILE_PATH/files" "$URL" -* +*/$DOMAIN/* -*wget* # -%l "fr" mv $FILE_PATH/external.html $FILE_PATH/$DOMAIN/ ## G1PUB ENCODE.16 MEDIAKEY diff --git a/command.sh b/command.sh index 726c38de..faf6cad8 100755 --- a/command.sh +++ b/command.sh @@ -7,7 +7,7 @@ MY_PATH="`dirname \"$0\"`" MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" ME="${0##*/}" diff --git a/install.sh b/install.sh index f4c87fcc..56b23dd3 100755 --- a/install.sh +++ b/install.sh @@ -92,12 +92,19 @@ sudo npm install -g tiddlywiki echo "#############################################" echo "######### PATIENCE #################" -echo "#############################################" - -# echo "## INSTALLATION AstroGEEK OpenCV = 'Intelligence Amie' - DEV - " +echo "############################################# +### PROPOSITION DE LOGICIELS COMPLEMETAIRES +############################################# +## OpenCV = 'Vision par Ordinateur en Intelligence Amie' # sudo apt-get install python3-opencv -y ## CONVERT AUDIO TO MIDI # pip install basic-pitch +## CACHER LES VISAGES +# python3 -m pip install 'git+https://github.com/ORB-HD/deface' +## ... +## DES SUGGESTIONS ? +## CONTACTER support@qo-op.com +#################################################" ## MAILJET SSMTP RELAYING : ADD YOUR CREDENTIALS sudo cp ~/.zen/Astroport.ONE/templates/.ssmtprc /etc/ssmtp/ssmtp.conf diff --git a/start.sh b/start.sh index 2921a743..b0b1ea01 100755 --- a/start.sh +++ b/start.sh @@ -7,7 +7,7 @@ MY_PATH="`dirname \"$0\"`" MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" ME="${0##*/}" diff --git a/tools/Connect_PLAYER_To_Gchange.sh b/tools/Connect_PLAYER_To_Gchange.sh index 8a3bcbc5..b9beed40 100755 --- a/tools/Connect_PLAYER_To_Gchange.sh +++ b/tools/Connect_PLAYER_To_Gchange.sh @@ -4,7 +4,7 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" IPFSNODEID=$(ipfs id -f='\n') diff --git a/tools/VISA.new.sh b/tools/VISA.new.sh index bcc0b54c..d853cfd8 100755 --- a/tools/VISA.new.sh +++ b/tools/VISA.new.sh @@ -28,7 +28,7 @@ LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) ################################################################################ myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="localhost" [[ $isLAN ]] && myIPFSGW="http://ipfs.localhost:8080" && myASTROPORT="http://astroport.localhost:1234" ## LAN STATION diff --git a/tools/VISA.print.sh b/tools/VISA.print.sh index 0ac7f70e..34fd73a3 100755 --- a/tools/VISA.print.sh +++ b/tools/VISA.print.sh @@ -50,7 +50,7 @@ sudo brother_ql_print /tmp/toprint.bin $LP ################################################################ ### PRINT PLAYER TW myIP link myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" TUBE=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 3) diff --git a/tools/VOEUX.print.sh b/tools/VOEUX.print.sh index bb2a24a8..419ede31 100755 --- a/tools/VOEUX.print.sh +++ b/tools/VOEUX.print.sh @@ -20,7 +20,7 @@ ASTRONAUTENS=$(ipfs key list -l | grep -w "${G1PUB}" | cut -d ' ' -f 1) MOATS=$(date -u +"%Y%m%d%H%M%S%4N") IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" diff --git a/tools/ipfs_config.sh b/tools/ipfs_config.sh index a99c3e64..febb410b 100755 --- a/tools/ipfs_config.sh +++ b/tools/ipfs_config.sh @@ -3,7 +3,7 @@ # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ################################################################################ myIP=$(hostname -I | awk '{print $1}') -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") ########################################### ### IMPORTANT !!!!!!! IMPORTANT !!!!!! diff --git a/tools/ipfs_setup.sh b/tools/ipfs_setup.sh index a35959b9..188feb16 100755 --- a/tools/ipfs_setup.sh +++ b/tools/ipfs_setup.sh @@ -23,7 +23,7 @@ err() { # CHECK node IP isLAN? myIP=$(hostname -I | awk '{print $1}') -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") YOU=$(ipfs swarm peers >/dev/null 2>&1 && echo "$USER" || ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); MACHINE_TYPE=`uname -m` diff --git a/tools/make_video_gifanim_ipfs.sh b/tools/make_video_gifanim_ipfs.sh index c1f690cc..db193532 100755 --- a/tools/make_video_gifanim_ipfs.sh +++ b/tools/make_video_gifanim_ipfs.sh @@ -14,15 +14,23 @@ MIME=$(file --mime-type -b "${path}${file}") FILE_RES=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "${path}${file}" | cut -d "x" -f 2) RES=${FILE_RES%?}0p +FILE_BSIZE=$(du -b "${path}${file}" | awk '{print $1}') + DURATION=$(ffprobe -i "${path}${file}" -show_entries format=duration -v quiet -of csv="p=0" | cut -d '.' -f 1) DUREE=$(ffprobe -i "${path}${file}" -show_entries format=duration -sexagesimal -v quiet -of csv="p=0"| cut -d '.' -f 1) PROBETIME=$(echo "0.618 * $DURATION" | bc -l | cut -d '.' -f 1) [[ ! $PROBETIME ]] && PROBETIME="1.0" +## How many seconds are encoded by Mo ? +VTRATIO=$(echo "$DURATION / $FILE_BSIZE * 1024 * 1024" | bc -l | xargs printf "%.2f") + +## CREATE SOME INDEX HOOKS +# ffmpeg -skip_frame nokey -i ${path}${file} -vsync 0 -r 30 -f image2 thumbnails-%02d.jpeg + rm -f ~/.zen/tmp/screen.gif ffmpeg -loglevel quiet -ss $PROBETIME -t 1.6 -loglevel quiet -i "${path}${file}" ~/.zen/tmp/screen.gif ANIMH=$(ipfs add -q ~/.zen/tmp/screen.gif) -echo "export ANIMH=$ANIMH PROBETIME=$PROBETIME DURATION=$DURATION DUREE=$DUREE RES=$RES MIME=$MIME" +echo "export ANIMH=$ANIMH PROBETIME=$PROBETIME DURATION=$DURATION DUREE=$DUREE RES=$RES MIME=$MIME VTRATIO=$VTRATIO" exit 0 diff --git a/tools/new_file_in_astroport.sh b/tools/new_file_in_astroport.sh index c91d682d..8110925a 100755 --- a/tools/new_file_in_astroport.sh +++ b/tools/new_file_in_astroport.sh @@ -22,7 +22,7 @@ IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) MOATS=$(date -u +"%Y%m%d%H%M%S%4N") IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" alias zenity='zenity 2> >(grep -v GtkDialog >&2)' @@ -320,6 +320,7 @@ then "duree": "'${DUREE}'", "duration": "'${DURATION}'", "giftime": "'${PROBETIME}'", + "vtratio": "'${$VTRATIO}'", "gifanime": "'/ipfs/${ANIMH}'", "type": "'${TidType}'", "mime": "'${MIME}'", diff --git a/tools/vlc_webcam.sh b/tools/vlc_webcam.sh index 3a629fe0..e1277566 100755 --- a/tools/vlc_webcam.sh +++ b/tools/vlc_webcam.sh @@ -26,7 +26,7 @@ LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d MOATS=$(date -u +"%Y%m%d%H%M%S%4N") IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) myIP=$(hostname -I | awk '{print $1}' | head -n 1) -isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +isLAN=$(echo $(ip route list match 0/0 | awk '{print $3}') | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost" mkdir -p ~/.zen/game/players/${PLAYER}/vlog