From 11484cb1fd6c479330cfbf76aa771d7107876bda Mon Sep 17 00:00:00 2001 From: pezcurrel Date: Tue, 13 Oct 2020 21:12:03 +0200 Subject: [PATCH] ... --- .gitignore | 1 + web/custard.php | 2 +- web/dafa.txt | 1 + web/mustard/clitools/crawl.bash | 30 ++++++++++++++++++++++++++--- web/mustard/clitools/peerscrawl.php | 2 +- 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 28009ce..e6729be 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /web/mustard/clitools/peers /web/mustard/clitools/peers.all /web/mustard/clitools/peerscrawl.log +/web/mustard/clitools/crawl.log /web/mustard/clitools/zzz-materiali/ /web/mustard/sec/mustard.ini /web/mustard/zzz-materiali/mastostart_solo_struttura.sql.gz diff --git a/web/custard.php b/web/custard.php index b014bc1..21fffbc 100644 --- a/web/custard.php +++ b/web/custard.php @@ -195,7 +195,7 @@ else if ($_GET['minki']>100000) $_GET['minki']=100000; $order=array( - 'rand'=>array('t'=>_('Casuale'),'q'=>'rand()'), + 'rand'=>array('t'=>_('Casuale'),'q'=>'Instances.Priority DESC, rand()'), // 'feat'=>array('t'=>_('Prima le consigliate'),'q'=>'Instances.Priority DESC'), // partecipazione: totusers/activeusers // 'part'=>array('t'=>_('Partecipazione (decr.)'),'q'=>'(Instances.UserCount / Instances.ActiveUsersMonth) ASC'), diff --git a/web/dafa.txt b/web/dafa.txt index 1377ea4..1d1fe8b 100644 --- a/web/dafa.txt +++ b/web/dafa.txt @@ -17,6 +17,7 @@ ? mettere da qualche parte che usiamo quella libreria per la rilevazione delle lingue - usare menu.php di mustard, poi modificarlo in modo che da cell si veda menu hamburger - o simili * blacklistare byoblu +- i pad su cisti con il materiale ancora da tradurre per le varie lingue sono morti, sarebbero da resuscitare su soluzione alternativa non effimera - spostare tutta la roba sensibile in una dir "contenitore", tipo fare che la root dir è "/srv/http/mastodon.help/site", e in "/srv/http/mastodon.help" fare dir per logs, per accounts, per ini files, ecc. - rimuovere Instances.Chosen dappertutto diff --git a/web/mustard/clitools/crawl.bash b/web/mustard/clitools/crawl.bash index 170f9ae..7e1ff89 100755 --- a/web/mustard/clitools/crawl.bash +++ b/web/mustard/clitools/crawl.bash @@ -1,9 +1,33 @@ #!/bin/bash + +LOGF="crawl.log" BASEDIR=$(dirname "$0") cd "$BASEDIR" + +# $1: comando; $2: logfile per l'output del comando +function logcmd { + echo "$(date): eseguo «$1»" >> $LOGF + $1 > $2 + ec=$? + echo -n "$(date): fine esecuzione di «$1»: " >> $LOGF + if [ $ec -eq 0 ]; then + echo "riuscita!" >> $LOGF + else + echo "ERRORE: $ec" >> $LOGF + tail $2 >> $LOGF + fi + echo "@@@@@@" >> $LOGF +} + +#logcmd "grep pippo gigi" "grepa.log" +#logcmd "grep pippo bibi" "grepb.log" +#exit + if [ "$1" == "dopeers" ]; then - php peerscrawl.php -e peerscrawl.exclude > peerscrawl.log - php crawler.php -p peers > crawler.log + logcmd "php peerscrawl.php -e peerscrawl.exclude" "peerscrawl.log" + logcmd "php crawler.php -p peers" "crawler.log" else - php crawler.php > crawler.log + logcmd "php crawler.php" "crawler.log" fi + +exit 0 diff --git a/web/mustard/clitools/peerscrawl.php b/web/mustard/clitools/peerscrawl.php index 78ae8ba..3b66309 100755 --- a/web/mustard/clitools/peerscrawl.php +++ b/web/mustard/clitools/peerscrawl.php @@ -414,7 +414,7 @@ echo('DONE CRAWLING! :-)'.N); shutdown(true); $now=time(); echo('Crawl started on '.strftime('%c',$tini).' and ended on '.strftime('%c',$now).'.'.N); -echo(count($ainsts).' URIs checked in '.ght($now-$tini).'; '.count($insts).' responded. Max memory usage: '.memory_get_peak_usage(true).N); +echo(count($ainsts).' URIs checked in '.ght($now-$tini).'; '.count($insts).' responded. Max memory usage: '.ghs(memory_get_peak_usage(true)).N); exit(0); ?>