optimisations

This commit is contained in:
qo-op 2021-04-07 23:01:20 +02:00
parent 8c533fd5ea
commit 55708f8067
5 changed files with 18 additions and 13 deletions

View File

@ -122,12 +122,12 @@ fi
# /_//_/ /____/|__/|__/\__,_/_/ /_/ /_/ /_/\____/ gchange sync
#
##################################################################
#
# TODO: IDEA make gchange/ipfs/ipns refresh speed depending on ipfs swarm size and DEFCON level !
# SYNC GCHANGE EVERY 2 hours +/- 3 minutes
[[ $(($runtime % 120)) == 0 ]] && sleep $((1 + RANDOM % 180)) && $MY_PATH/zen/gchange_INIT.sh && $MY_PATH/zen/gchange_IPFS_swarm.sh &
[[ $(($runtime % 120)) == 0 ]] && $MY_PATH/zen/gchange_INIT.sh && $MY_PATH/zen/gchange_IPFS_swarm.sh &
# SYNC SWARM EVERY 20 minutes +/- 1 minute
[[ $(($runtime % 20)) == 0 ]] && sleep $((1 + RANDOM % 60)) && $MY_PATH/zen/ipfs_SWARM_refresh.sh &
# QUICK SYNC SWARM EVERY 20 minutes +/- 1 minute
[[ $(($runtime % 20)) == 0 ]] && $MY_PATH/zen/ipfs_SWARM_refresh.sh "quick" &
# ~/astroport
# _ _
@ -151,7 +151,7 @@ fi
##########################################################
if [[ "$timebar" == "12:12" || "$timebar" == "00:12" || $(($runtime % 720)) == 0 ]]; then
#### DESYNC
#### timebar DESYNC
sleep $((1 + RANDOM % 5))
##################################################################
#
@ -173,7 +173,7 @@ fi
# MIDNIGHT:01 : CLEANING & UPDATE
##################################################################
##################################################################
if [[ "$timebar" == "00:01" ]]; then
if [[ "$timebar" == "00:01" || "$runtime" == "5" ]]; then
echo '
# ____ ____ ____ ___
# / __ \/ __ \ _ / __ < /
@ -196,8 +196,8 @@ echo '
##################################################################
if [[ $dayoftheweek == 0 ]]; then
# EVERY SUNDAY
if [[ $dayoftheweek == 1 ]]; then
# EVERY MONDAY
# _____ __ __ ___
# / ___// /_____ _________ _____ ____ / |/ /___ __ __
# \__ \/ __/ __ \/ ___/ __ `/ __ `/ _ \ / /|_/ / __ `/ |/_/

View File

@ -14,7 +14,7 @@ then
echo "AstrXbian installateur pour XBIAN (https://xbian.org) et ditributions DEBIAN et dérivées (https://www.linuxmint.com/)"
sudo apt-get update
sudo apt-get install git fail2ban inotify-tools curl net-tools libsodium* python3-dev python3-pip python3-setuptools python3-wheel python3-dotenv mpack libssl-dev libffi-dev -y
sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils vlc mp3info musl-dev openssl* cargo detox -y
sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox -y
[[ ! $(which kodi) && "$USER" != "xbian" ]] && sudo apt-get install kodi -y
[[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils zenity handbrake* -y
## INSTALL PYTHON CRYPTO LAYER

View File

@ -2,5 +2,10 @@
echo "Installation Astroport/RompR et activation du mode JUKEBOX mp3"
if [[ "$jukebox" == "oui" ]] then
sudo apt-get install mariadb-server nginx python3-certbot-nginx certbot ssl-cert php-imap php-cli php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-gettext php-mysql php-fpm -y
sudo apt-get install mariadb-server nginx libnginx-mod-rtmp lsof python3-certbot-nginx certbot ssl-cert php-imap php-cli php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-gettext php-mysql php-fpm -y
fi
# Add user to be able to modify nginx directories
sudo usermod -a -G "$USER" www-data
sudo chmod g+rw /var/www/html

View File

@ -31,6 +31,7 @@ timestamp=$(date -u +%s%N | cut -b1-13)
# Delete "ipfs" & "ipfs_swarm" after reboot
# [[ ! -f /tmp/swarm_cleaned ]] && rm -Rf ~/.zen/ipfs/* && rm -Rf ~/.zen/ipfs_swarm/ && mkdir -p ~/.zen/ipfs_swarm && echo "IPFS CLEANING OK" > /tmp/swarm_cleaned
########################################################################
[[ "$1" == "quick" ]] && echo "" > /tmp/A_swarm || cat ~/.zen/A_swarm_map.txt > /tmp/A_swarm
rm /tmp/treated.ipfs.swarm
touch /tmp/treated.ipfs.swarm
touch ~/.zen/A_dead_swarm.txt
@ -44,9 +45,8 @@ echo "******************************************************************"
echo "RETRIEVING MY OWN DATA FROM IPNS TO ~/.zen/ipfs_swarm"
ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$IPFSNODEID
########################################################################
count=1
for ipfsnodeid in $( (ipfs swarm peers | grep -o '[^/]*$' && cat ~/.zen/A_swarm_map.txt | grep -o '[^/]*$' ) | sort | uniq);
for ipfsnodeid in $( (ipfs swarm peers | grep -o '[^/]*$' && cat /tmp/A_swarm | grep -o '[^/]*$' ) | sort | uniq);
do
## $ipfsnodeid already Treated ?
[[ -f ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid ]] && XID=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid)

View File

@ -7,7 +7,7 @@ ME="${0##*/}"
export IPFSNODEID=$(ipfs id -f='<id>\n')
########################################################################
echo "PUBLISHING ~/.zen/ipfs SELF /ipns/$IPFSNODEID"
echo "PUBLISHING ~/.zen/ipfs SELF http://127.0.0.1:8181/ipns/$IPFSNODEID"
MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1)
OLDCHAIN=$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain)
if [[ "$OLDCHAIN" != "$MIPFS" ]] # MODIFY CHAIN only if something was changed