l
ls
du du -h --max-depth=1  | sort -h
du -h --max-depth=1  | sort -h
du -h --max-depth=1  | sort -h
du -h --max-depth=1  | sort -h
cd /var/www/api.money.it/
ls
cd web/
ls
ls .la
ls -la
cd lockfolder/
ls
cd ..
du --max-depth=1 -h
ls
cd ..
ls

cd web/
ls
cd lib/
ls
du --max-depth=1 -h
cd tmp
lks
cd ls
ls
ls
du -h --max-depth=1
cd ..
ls
ls -la
cd .
ls
ls -la
cd v2/
ls
du -h --max-depth=1
cd lockfolder/
ls
ls -la
cd ..
ls
ls -la
cd ..
ls
ls -la
cd ..
ls
cd lib/
ls
ls -la
du -h --max-depth=1
cd tmp
l
ls
du -h --max-depth=1
cd api.money.it/
ls
du -h --max-depth=1
cd Files/
ls
cd files/
ls
cd ..
cd ..
ls
cd ..
ls
cd ..
ls
du -h --max-depth=1
ls
cd /var/www/api.money.it/
ls
cd web
ls
cd quotazioni/v2/
ls -la
nano ticker.php 
nano tickersummary.php 
exit
ll
cd ..
ls
cd api.money.it/
cd web/
ls
ls -la
cd lockfolder/
ls -la
cd ..
cd lib
ls 
ls -la
du -h --max-depth=1
ls
cd web/
ls
cd lib/
ls
cd tmp_v6/
ls
cd Auto/
ls
cd ..
cd ..
ls
du -h --max-depth=1
pwd
ls -lh /var/www/api.money.it/web/site-backups/spip4_money.it.tar.gz
   mv /var/www/api.money.it/web/site-backups /var/www/api.money.it/site-backups
df -h
mv /var/www/api.money.it/site-backups /var/www/api.money.it/web/site-backups
clear
ls
pwd
ls
cd /
ls
cd
ks
ls
exit
ls
cd 
cd /
ls
cd b
cd backup/
ls
cd 
cd roo
cd root
ls
cd /
ls
cd root/
cd home/
ls
cd money/
ls
cd ..
cd var/
ls
cd www/
ls
cd api.money.it/
ls
cd site-backups/
ls
cd ..
cd www/
ls
cd aziende.money.it/
ls
cd ..
cd backend.money.it
ls
cd ..
cd backend.money.it/
cd web/
ls
cd ..
cd staging.money.it/
ls
cd web/
ls
cd ..
cd api.money.it/
ls
cd site-backups/
ls
ls -la
cd ..
cd redazione.money.it/
cat .env
ls
cd web/
ls
cd current/
ls
ls -a
cat .env
cd /var/www/aziende.money.it/
cat .env
cd web/current/
cat .env
cd ..
cd backoffice.money.it/
ls
cd web/
ls
cd current/
ls
cat .env
cd ..
ls
cd spip4_money.it
cd web/
cd config/
ls
cat connect.php
cd ..
ls
cat spip.php
xit
exit
cd /var/www/
ls
cd spip4_money.it/
ls
cd web/
ls
ad
clear
cd /var/www/
ls
cd backoffice.money.it/
ls
cd web/
ls
cd current/
ls
cat .env
cd /var/www/backend.money.it/
ls
cd web/current/
ls
cat .env
clear
cat .env
clear
cat .env
clear
ls
exit
cd /var/www/
ls
cd
exit
cd /var/www/html/
ls
cd ..
ls
cd spip4_money.it/
ls
cd web/
ls
cd /var/www/
ls
cd spip4_money.it/
ls
cd web/
ls
git status
ls
cd ..
ls
exit
cd /var/www/
ls
cd spip4_money.it/
pwd
ls
cd web/
ls
cd vendor/
ls
cd ..
cd money2017
ls
ls -lh
cd ..
ls -lh
du -h --max-depth=1
cd ..
ls
cd web
cd ADNK/
ls
du -h --max-depth=1
cd processati/
du -h --max-depth=1
cd news/
du -h --max-depth=1
ls -la
php -v
clear
exit
cd /var/www/spip4_money.it/web/
du -h --max-depth=1
git init
exit
cd /var/www/html/
cd ..
ls
cd spip4_money
cd spip4_money.it/
ls
cd web
ls -la
ls -la .git
cd ..
ls -la
ls -lh
exit
cd /var/www/spip4_money.it/
git status
ls
cd web
ls
tail -f /var/log/nginx/error.log
cd ..
ls
ls 
ls
cat /etc/nginx/conf.d/default.conf 
cat /etc/nginx/conf.d/money.it.conf
nano
nano .ssh/authorized_keys 
exit
ls
cd /var/www/
ls
cd aziende.money.it/
ls
cd web/
ls
cd current/
ls
cd ..
ls
cd ..
ls
cp -r web/ web-2026-01-07/
sudo cp -r web/ web-2026-01-07/
ls
cd web
pwd
ls
cd ..
ls
cd web
ls
cd releases/
ls
cd ..
ls
cd ..
ls
cd web-2026-01-07/
ls
cd /var/www/aziende.money.it/
cd web/current/
php artisan tinker
cd /var/www/aziende.money.it/
nano .env
cd web/c
cd web/current/
ls
nano .env
exit
cd /var/www/aziende.money.it/web/current/
php artisan tinker
cd /var/www/aziende.money.it/
cd web/current/storage/logs/
ls
cat 
cat laravel-2026-01-19.log
cd ..
php artisan tinker
cat .env
date
cd /var/www/aziende.money.it/web/current/
php artisan tinker
cd /var/www/backoffice.money.it/
ls
cd web/current
ls
cat .emv
cat .env
cd /var/www/backoffice.money.it/
ls
cd web/
ls
cd current
cd storage/logs/
ls
tail -f laravel.log 
tail -f -n 200 laravel.log 
tail -f -n 500 laravel.log 
cd ..
nano .env
tail -f storage/logs/laravel.log 
cd /var/www/backoffice.money.it/
cd web/
nano .env
ls
cd current
tail -f storage/logs/laravel.log 
tail -f -n 200 storage/logs/laravel.log 
nano .env
cd ..
cd aziende.money.it/
cd web/current/
tail -f storage/logs/laravel.log 
cd /var/www/backoffice.money.it/
cd web/current
tail -f storage/logs/laravel.log 
cd web/current
cd /var/www/backoffice.money.it/
cd ..
cd spip4_money.it/
ls
cd web
ls
cat config/connect.php 
tail -f /var/log/nginx/error.log
mysqlbinlog mysql-bin.000001 | grep -i delete
sudo mysqlbinlog --base64-output=DECODE-ROWS -vv /var/lib/mysql/mysql-bin.00288* | grep -n "DELETE FROM \`spip4_money\`\.\`inside_plan_coupon\`"
mysqlbinlog --base64-output=DECODE-ROWS -vv /var/lib/mysql/mysql-bin.00288* | grep -n "DELETE FROM \`spip4_money\`\.\`inside_plan_coupon\`"
exit
cd /var/www/aziende.money.it/
ls
cd web
cd current/
cat.env
cat .env
ls
cd ..
ls
cd ..
ls
mysql -u root -p
mysql -u doadmin -p
mysql -h m0n3yaziende-do-user-2956707-0.i.db.ondigitalocean.com       -P 25060       -u doadmin       -p       --ssl-mode=REQUIRED
mysql -h m0n3yaziende-do-user-2956707-0.i.db.ondigitalocean.com       -P 25060       -u doadmin       -p       --ssl-mode=REQUIRED
mysql -h m0n3yaziende-do-user-2956707-0.i.db.ondigitalocean.com       -P 25060       -u doadmin       -p       --ssl
exit;
ls
curl https://api.stripe.com/v1/customers   -u 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:   -G --data-urlencode "email=amministrazione@novotic.it"
  curl https://api.stripe.com/v1/charges   -u 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:   -G --data-urlencode "customer=cus_TpyLfiYBauo9Ts"      --data-urlencode "limit=1"
  curl https://api.stripe.com/v1/charges   -u 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:   -G --data-urlencode "customer=cus_TpyLfiYBauo9Ts"      --data-urlencode "limit=2"
exit;
cd /var/www/html
ls
cd cd ..
cd ..
ls
cd backoffice.money.it/
cd web/releases/current
cd web/releases/20260226-123605
php artisan tinker --execute="
\Stripe\Stripe::setApiKey(config('services.stripe.secret'));
\$inv = \Stripe\Invoice::all(['subscription' => 'sub_1NQux1HmTy5AQ9gvsHduIRLS', 'limit' => 1]);
\$one = \$inv->data[0] ?? null;
echo \$one ? json_encode(['subscription_id' => 'sub_1NQux1HmTy5AQ9gvsHduIRLS', 'time' => date('Y-m-d H:i:s', \$one->created), 'price' => \$one->amount_paid / 100]) : 'No invoice';
"
php artisan tinker --execute="
\Stripe\Stripe::setApiKey(config('services.stripe.secret'));
\$sub = \Stripe\Subscription::retrieve('sub_1NQux1HmTy5AQ9gvsHduIRLS');
echo json_encode(\$sub->toArray(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
"
php artisan tinker --trust-project --execute="
\Stripe\Stripe::setApiKey(config('services.stripe.secret'));
\$invoices = \Stripe\Invoice::all(['subscription' => 'sub_1NQux1HmTy5AQ9gvsHduIRLS', 'limit' => 5]);
\$out = ['subscription_id' => 'sub_1NQux1HmTy5AQ9gvsHduIRLS', 'records' => []];
foreach (\$invoices->data as \$i) {
  \$out['records'][] = [
    'subscription_id' => 'sub_1NQux1HmTy5AQ9gvsHduIRLS',
    'start' => date('Y-m-d H:i:s', \$i->period_start ?? \$i->created),
    'end' => isset(\$i->period_end) ? date('Y-m-d H:i:s', \$i->period_end) : null,
    'price' => (\$i->amount_paid ?? 0) / 100
  ];
}
echo json_encode(\$out, JSON_PRETTY_PRINT);
"
cd ..
cd /var/www/backoffice.money.it/web/releases/20260226-123605
sudo chown -R apimoney:apimoney storage bootstrap/cache
cd /var/www/backoffice.money.it/web/current
php artisan tinker --execute="
\Stripe\Stripe::setApiKey(config('services.stripe.secret'));
\$invoices = \Stripe\Invoice::all(['subscription' => 'sub_1NQux1HmTy5AQ9gvsHduIRLS', 'limit' => 5]);
\$out = ['subscription_id' => 'sub_1NQux1HmTy5AQ9gvsHduIRLS', 'records' => []];
foreach (\$invoices->data as \$i) {
  \$out['records'][] = [
    'subscription_id' => 'sub_1NQux1HmTy5AQ9gvsHduIRLS',
    'start' => date('Y-m-d H:i:s', \$i->period_start ?? \$i->created),
    'end' => isset(\$i->period_end) ? date('Y-m-d H:i:s', \$i->period_end) : null,
    'price' => (\$i->amount_paid ?? 0) / 100
  ];
}
echo json_encode(\$out, JSON_PRETTY_PRINT);
"
curl -s -H "Authorization: Bearer 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"   "https://api.stripe.com/v1/invoices?subscription=sub_1NQux1HmTy5AQ9gvsHduIRLS&limit=5" |   jq '{subscription_id: "sub_1NQux1HmTy5AQ9gvsHduIRLS", records: [.data[] | {subscription_id: "sub_1NQux1HmTy5AQ9gvsHduIRLS", start: (.period_start | tonumber | strftime("%Y-%m-%d %H:%M:%S")), end: (.period_end | tonumber | strftime("%Y-%m-%d %H:%M:%S")), price: ((.amount_paid // 0) / 100)}]}'
curl -s -H "Authorization: Bearer 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"   "https://api.stripe.com/v1/invoices?subscription=sub_1NQux1HmTy5AQ9gvsHduIRLS&limit=5"
exit
ls
cd /var/www/
ls
cd backoffice.money.it/
// Use your live key (or rely on .env if it's set)
\Stripe\Stripe::setApiKey(env('STRIPE_SECRET') ?: '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');
$subId = 'sub_1NQux1HmTy5AQ9gvsHduIRLS';
// Latest 10 invoices for this subscription (these are the "transactions" from Stripe)
$invoices = \Stripe\Invoice::all(['subscription' => $subId, 'limit' => 10]);
// Inspect
$invoices->data;
// Or a simpler list: id, status, amount_paid, created
collect($invoices->data)->map(fn ($i) => [
    'id' => $i->id,
    'number' => $i->number ?? null,
    'status' => $i->status,
    'amount_paid' => $i->amount_paid / 100,
    'created' => date('Y-m-d H:i:s', $i->created),
])->toArray();
php artisan tinker
cd ..
cd aziende.money.it/
php artisan tinker
find /var/www -name "artisan" -type f 2>/dev/null
cd ..
cd backoffice.money.it/web/releases/20260223-063356
php artisan tinker
cd backoffice.money.it/web/releases/20260223-063356
php -r "echo extension_loaded('xml') ? 'yes' : 'no';"
php81 -r "echo extension_loaded('xml') ? 'yes' : 'no';"
ls
cd ..
ls
zip -r api.money.it.zip web
rm -f /var/www/api.money.it/api.money.it.zip
exit;
cd /var/www/backoffice.money.it/
cd web/
cat .env
php -v
cd /var/www/api.money.it/web
ls -l quotazioni/v2/simplechart.php
git status -sb
git pull
cd /var/www/api.money.it/web
cp quotazioni/v2/simplechart.php quotazioni/v2/simplechart.php.bak-2026-11-02
cp quotazioni/v2/tickersummary-daily.php quotazioni/v2/tickersummary-daily.php.bak-2026-11-02
cat quotazioni/v2/simplechart.php
grep -n "CacheUtil::set\|3600\|900" quotazioni/v2/tickersummary-daily.php
cd /var/www/api.money.it/web
cat > /tmp/patch_simplechart.php <<'EOF'
<?php
$f = 'quotazioni/v2/simplechart.php';
$s = file_get_contents($f);
$old1 = <<<'A'
    $key = 'simplechart3_' . $symbol . "_" . $interval;
    $key = preg_replace("/[^a-zA-Z0-9_]/", "", $key);
A;
$new1 = <<<'A'
    // md5 del simbolo: togliendo solo i caratteri speciali "S&P 500" e "SP500" finivano nella stessa cache
    $key = 'simplechart4_' . md5($symbol) . "_" . $interval;
A;
$old2 = <<<'A'
                and time >= :fromDate
                and  dayofweek(from_unixtime(time))  = 6
                order by time desc
                limit 2160;", [
                        ":symbol" => $symbol,
                        ":fromDate" => $fromDate->getTimestamp(),
                    ]
                )->fetchAll();
A;
$new2 = <<<'A'
                and time >= :fromDate
                order by time desc
                limit 20000;", [
                        ":symbol" => $symbol,
                        ":fromDate" => $fromDate->getTimestamp(),
                    ]
                )->fetchAll();
                // un punto a settimana: l'ultima seduta di ogni settimana in ora italiana (gestisce l'ora legale,
                // che il SET time_zone a offset fisso non gestisce: in estate i venerdì diventavano giovedì)
                $weekly = [];
                $weeks = [];
                foreach ($data as $row) {
                    $week = date('o-W', intval($row["adjtime"]));
                    if (!isset($weeks[$week])) {
                        $weeks[$week] = true;
                        $weekly[] = $row;
                    }
                }
                $data = $weekly;
A;
if (substr_count($s, $old1) !== 1 || substr_count($s, $old2) !== 1) { exit("Blocchi non trovati: nessuna modifica\n"); }
file_put_contents($f, str_replace([$old1, $old2], [$new1, $new2], $s));
echo "simplechart.php aggiornato\n";
EOF

php /tmp/patch_simplechart.php && php -l quotazioni/v2/simplechart.php
sed -i '112s/\$expire = 3600;/$expire = 900;/' quotazioni/v2/tickersummary-daily.php && sed -n 112p quotazioni/v2/tickersummary-daily.php
rm /tmp/patch_simplechart.php
cd /var/www/api.money.it/web
cp calendario/calendario.php calendario/calendario.php.bak-2026-11-03
sed -i "s/^ini_set('display_errors', 1);/ini_set('display_errors', 0);/; s/^ini_set('display_startup_errors', 1);/ini_set('display_startup_errors', 0);/" calendario/calendario.php
grep -n "display_errors\|display_startup" calendario/calendario.php
curl -s "https://api.money.it/calendario/calendario.php?dt=$(date +%F)" | head -c 80; echo
cd /var/www/api.money.it/web
cp calendario/calendario.php calendario/calendario.php.bak-2026-11-03
sed -i "s/^ini_set('display_errors', 1);/ini_set('display_errors', 0);/; s/^ini_set('display_startup_errors', 1);/ini_set('display_startup_errors', 0);/" calendario/calendario.php
grep -n "display_errors\|display_startup" calendario/calendario.php
curl -s "https://api.money.it/calendario/calendario.php?dt=$(date +%F)" | head -c 80; echo
cd /var/www/api.money.it/web
cat > /tmp/patch_simplechart.php <<'EOF'
<?php
$f = 'quotazioni/v2/simplechart.php';
$s = file_get_contents($f);
$nl = strpos($s, "\r\n") !== false ? "\r\n" : "\n";
$n1 = $n2 = 0;
$s = preg_replace_callback('/\$key = \'simplechart3_\' \. \$symbol \. "_" \. \$interval;\s*\$key = preg_replace\("\/\[\^a-zA-Z0-9_\]\/", "", \$key\);/', function () use ($nl) {
    return '// md5 del simbolo: togliendo solo i caratteri speciali "S&P 500" e "SP500" finivano nella stessa cache' . $nl
        . '    $key = \'simplechart4_\' . md5($symbol) . "_" . $interval;';
}, $s, 1, $n1);
$s = preg_replace_callback('/(and\s+time\s*>=\s*:fromDate\s+)and\s+dayofweek\(from_unixtime\(time\)\)\s*=\s*6\s+(order\s+by\s+time\s+desc\s+)limit\s+2160;(.*?->fetchAll\(\);)/s', function ($m) use ($nl) {
    $add = [
        '',
        '                // un punto a settimana: l\'ultima seduta di ogni settimana in ora italiana (gestisce l\'ora legale,',
        '                // che il SET time_zone a offset fisso non gestisce: in estate i venerdi\' diventavano giovedi\')',
        '                $weekly = [];',
        '                $weeks = [];',
        '                foreach ($data as $row) {',
        '                    $week = date(\'o-W\', intval($row["adjtime"]));',
        '                    if (!isset($weeks[$week])) {',
        '                        $weeks[$week] = true;',
        '                        $weekly[] = $row;',
        '                    }',
        '                }',
        '                $data = $weekly;',
    ];
    return $m[1] . $m[2] . 'limit 20000;' . $m[3] . implode($nl, $add);
}, $s, 1, $n2);
if ($n1 !== 1 || $n2 !== 1) { exit("Blocchi non trovati (chiave: $n1, settimane: $n2): nessuna modifica\n"); }
file_put_contents($f, $s);
echo "simplechart.php aggiornato\n";
EOF

php /tmp/patch_simplechart.php && php -l quotazioni/v2/simplechart.php
grep -n "simplechart4_\|limit 20000\|data = \$weekly" quotazioni/v2/simplechart.php
rm /tmp/patch_simplechart.php
exit
