Skip to content
Elemmire edited this page Oct 10, 2023 · 11 revisions

Recurring tasks and other useful stuff…

Update system

Install updates and remove packages

sudo apt full-upgrade
sudo reboot

git

Niemals git-Kommandos als root-Nutzer oder mit dem sudo-Befehl ausführen.

Update application

Get latest source code from git for Aquila HGV and the update HTML files for HGV Texte

cd /var/www/aquila
git fetch
git merge edelweiss/symfony5
composer update

Do not run Composer as root/super user! See Composer documentaion for details

(for dev cd into /var/www/aquila_dev)

Update git submodule HGV.Texte

first update in dev, commit and push; then pull in prod and update again (!?)

cd /var/www/aquila_dev
git submodule update --remote
git add public/texte
git commit -m 'update HGV.Texte'
git push edelweiss symfony5_papy:symfony5

cd /var/www/aquila
git fetch
git merge edelweiss/symfony5
git submodule update --remote

Clearing the application cache

cd /var/www/aquila
sudo php bin/console cache:pool:clear cache.global_clearer
sudo rm -rf  var/cache/prod/*

(for dev cd into /var/www/aquila_dev)

Show all available commands

cd /var/www/aquila
php bin/console

SQL

pictureLink

Find duplicate images entries

SELECT hgv_id, url, COUNT(*) AS c, GROUP_CONCAT(id) FROM `pictureLink` WHERE 1 GROUP BY hgv_id, url HAVING c > 1 

Add unique contraint to pictureLink::hgv_id and pictureLink::url

ALTER TABLE pictureLink ADD UNIQUE unique_hgv_url (hgv_id, url(512))

Insert new urls into pictureLink, avoiding duplicates and ignoring HGV ids that don’t exist

Vorab VLOOKUP-Abgleich mit hgv::tmNr und hgv::id aus Aquila-HGV, um a, b, c und X, Y, Z zu ergänzen.

INSERT IGNORE INTO pictureLink (hgv_id, institution, url) VALUES
('14547', 'papyri.uni-leipzig.de', 'https://papyri.uni-leipzig.de/receive/BonnPapyri_schrift_00001450'),
('14548', 'papyri.uni-leipzig.de', 'https://papyri.uni-leipzig.de/receive/BonnPapyri_schrift_00000050');

Delete url clusters from pictureLink

DELETE FROM `pictureLink` WHERE url LIKE '%www.altegeschichte.uni-bonn.de%'