What counts as self-plagiarism? I'm an undergraduate and would like to write about certain topics and post the documents online, available to everyone to read and probably indexed by search engines very soon.

However, I think that if I do this, I'm very likely to have written about the topics of my bachelor or master thesis/theses before I write it/them. What I post online is planned to be high-quality but of course not scientifically published.

If I copy parts of these works without stating I wrote and made them publicly available earlier, does it qualify as self-plagiarism? If so, does it still count if I create the documents now, copy parts of them into my thesis, but only upload them after I (hopefully) got my degree?

Are the rules the same around the world or does it depend on things like the country, the academic discipline, the university, the kind of degree or other scientific work, or other things? If it does, please tell me what's relevant in the comments so I can add that information. However, since adding the probably most relevant details isn't hard: I'm a German computer science student studying in Germany.

If I post the documents pseudonymously, do I have to prove they are written by me or does the examination office have to attempt to prove they aren't written by me? Does it make a difference whether I use a pseudonym which is clearly not a person's name? If I do, how would I quote myself if I have to?

This question is about a similar topic but I don't think mine is a duplicate of it because the linked question is about publishing in a journal, not about writing one's bachelor or master thesis.
Cite your online reference, just as you would cite some other online reference.  In neither case is it plagiarism, because you're citing it.  And in the case of your own online work, you can take credit for it as if it were not cited, as long as this work does not appear previously to when you published online.