NextCloud v33 requests that a "serverid" is set in the configuration - this is an integer between 0 and 1023 (ie 10-bit).
I looked at generating a stable value based on machine-id, with the hope that there would be no clash for a small number of servers.
sha256sum /etc/machine-id | head -c4 | od -An -tu2 | tr -d ' ' | awk '{print int($1) % 1024}'- get the first 4 hex characters from the sha256sum of the machine-id - although the SHAing is probably redundant
- convert the input into 2 unsigned decimals, and truncate their representations into one value