Geo-Test
- Details
- Kategorie: Blog
- Veröffentlicht: Samstag, 01. Mai 2021 18:14
- Geschrieben von Martin Wilmes
- Zugriffe: 3625
This is a try how to embed geolocated picture that I made with an arcgis map.
Quite primitive try with a CSV file.
This is a try how to embed geolocated picture that I made with an arcgis map.
Quite primitive try with a CSV file.
After the upgrade the Akonadi server did not start. The respective error messages when starting it manually again pointed to a database problem. The reason was that the maria db server was not allowed to access my personal files thanks to AppArmor. To fix it, I had to apply the following partch to /etc/apparmor.d/usr.sbin.mysqld:
/run/user/7503/akonadi/* rw,
/home/wilmes/.local/share/akonadi/** rwk,
This is very specific to my personal user, so it would be better to replace my user name by some wildcard but I just do not have the time to look deeper into this. This must be sufficient as reminder for the next time this happens ...
Recently I had a problem with virtual machine (vmware, ESX) which had a second disk that was too small. So somebody used vmware to resize the disk but, of course the change was not reflected by Linux since the partition size and the file system size must be changed manually. So I came into the game.
The Linux was an RHEL 6 on vmware. It contained a production level Oracle server that was busy (load constantly at 0.5 at least) and accessing the disk in question.
Since this is not my daily job I searched the Internet for hints on traps you could step into when doing this. First of all was to request a full backup of the disk in question so that took some time to complete and I had time for a rehearsal.
Next step was to negotiate a down time of about 2 hours. That was necessary because the manipulation of the file system implied to stop the Oracle server. It might have worked without but I was not ready to take the responsibility on this, not knowing exactl how important this server was.
Ok, now to the action. Here are the steps I used to complete the job:
The machine should now be in a safe state and usable as a production ready server again. The problem on the whole thing is that if something goes wrong, specifically on resizing the partition or resizing the file system, you will be lost in nowhere and you will ave to restore a backup of the disk.
How to transfer a set of user's grants from one mysql server to another?
There is an answer on serverfault.
The essential part is to define this function in bash:
mygrants()
{
mysql -B -N $@ -e "SELECT DISTINCT CONCAT(
'SHOW GRANTS FOR \'', user, '\'@\'', host, '\';'
) AS query FROM mysql.user" | \
mysql $@ | \
sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}'
}
edit the skript and remove all double backslashes (\\) and then use it like this:
mygrants --host=prod-db1 --user=admin --password=secret | grep rails_admin | mysql --host=staging-db1 --user=admin --password=secret
I need a reminder on how to delete files that are older than a certain date so here it is:
sudo find . -not -newermt "2012-05-11" -type f -print0 | xargs -0 -L 100 sudo rm
This deletes every file in . that is older than 2012-05-11.
The two letters behind the "newer" option define that we are using the modification time of the files and that the parameter to the option is a date rather than a file name.
The xargs argument -L specifies that a maximum of 100 file names will be appended for a single execution of rm.
To also remove all empty directories that remain after this operation issue
sudo find . -type d -empty print0 | xargs -0 -L 1 sudo rmdir