Auf dem Desktop-Rechner wird man normalerweise den Desktop-Synchronization-Client installieren. Doch was, wenn man headless auf dem Server arbeitet? Dafür bietet sich rclone an.
Continue reading “Howto: rclone mit Nextcloud-Remote”Author: georg
CMake: Parent directory and trailing slashes
The task is to get the parent directory of a given directory where the given directory is already known to be a directory.
An example where the input directory is already known to be a directory (and not a file) is a target include directory (properties INCLUDE_DIRECTORIES
and INTERFACE_INCLUDE_DIRECTORIES
).
With CMake prior to version 3.20 there is the get_filename_component
function:
get_filename_component(filename_component "${directory}" DIRECTORY)
With CMake >= 3.20 get_filename_component is deprecated in favor of cmake_path
. A naive way would be to directly call this function:
cmake_path(GET directory PARENT_PATH cmake_path_naive)
But there is a glitch with cmake_path
when directory
already contains a trailing slash (“/”).
Fun with CMake version ranges
Since release 3.19 CMake allows to specify a range in find_package() calls:
find_package(Dummy minVersion...maxVersion)
Although currently not much find modules support version ranges one might want to set the upper end to a maximum version the code is compatible with. This can be seen as a safeguard against breaking changes in an unknown future major version.
Let say we have a package “Dummy” whose major versions 1 and 2 are known to work with our own code. One might be tempted to specify the version range like the following:
find_package(Dummy 1...2)
This works well with 1.0.0, 1.5.0 or 2.0.0, but will break with 2.0.1 or 2.1.0.
Instead use the following syntax to include major versions 1 and 2:
find_package(Dummy 1...<3)
But why so?
Continue reading “Fun with CMake version ranges”SWAG and WordPress in a subfolder
Desired setup
A SWAG reverse proxy should forward requests to WordPress running in the official wordpress docker image. The URL which is served by the reverse proxy is not the domain root, but a subfolder “blog”: https://www.example.com/blog.
What does not work
Letting the docker image itself serve wordpress in the root folder and write some clever proxy / rewrite rules. At first it seems to work, but when it comes wp-admin URLs like https://www.example.com/blog/wp-admin a magic redirection happens to https://www.example.com/wp-admin which points to outside the WordPress installation.
Fiddling around with RELOCATE
, WP_HOME
and WP_SITEURL
does not solve the problem.
As it turns out WordPress needs to know the fact that it is installed in a subfolder, quote:
Continue reading “SWAG and WordPress in a subfolder”What you’ll want to do is run your WordPress container with WORKDIR set to /var/www/html/lab so it knows it is in a subdirectory and acts accordingly.
Howto backup hosted nextcloud
In a hosted environment you ususally don’t have direct access to the database where calendars and contacts are stored.
And even when the provider has some sort of backup
- you don’t really own it, because you can’t download it
- e.g. you don’t can’t just migrate in case you are locked out for some reason
- its an “all or nothing” story when it comes to restores
- the whole instance/account is reset to some point in time
- any change in between the last backup is effectively overwritten
Enter backup_hosted_nextcloud_database.sh:
Continue reading “Howto backup hosted nextcloud”