summaryrefslogtreecommitdiff
path: root/en
diff options
context:
space:
mode:
Diffstat (limited to 'en')
-rw-r--r--en/2023/writing-a-gemini-server-in-php.gmi116
-rw-r--r--en/2024/battle-net-on-linux-with-steam-proton.gmi50
-rw-r--r--en/index.gmi12
3 files changed, 178 insertions, 0 deletions
diff --git a/en/2023/writing-a-gemini-server-in-php.gmi b/en/2023/writing-a-gemini-server-in-php.gmi
new file mode 100644
index 0000000..44ee6c6
--- /dev/null
+++ b/en/2023/writing-a-gemini-server-in-php.gmi
@@ -0,0 +1,116 @@
+do it like this lol
+=> https://git.dweipert.de/gemini-foundation/tree/src/Server.php
+
+```
+<?php
+
+namespace GeminiFoundation;
+
+class Server
+{
+ protected string $hostname;
+
+ protected array $certificate = [
+ 'file' => null,
+ 'key' => null,
+ 'passphrase' => null,
+ ];
+
+ protected array $requestHandlers = [];
+
+ /**
+ * @param array $certificate
+ * @param string $hostname
+ */
+ public function __construct(
+ array $certificate,
+ string $hostname = 'localhost'
+ )
+ {
+ $this->certificate = $certificate;
+ $this->hostname = $hostname;
+ }
+
+ public function setCertificate(string $certificateFile, string $keyFile, string $passphrase = ''): static
+ {
+ $this->certificate = [
+ 'file' => $certificateFile,
+ 'key' => $keyFile,
+ 'passphrase' => $passphrase,
+ ];
+
+ return $this;
+ }
+
+ public function onRequest(RequestHandlerInterface|callable $callable): static
+ {
+ $this->requestHandlers[] = $callable;
+
+ return $this;
+ }
+
+ public function listen(int $port = 1965): void
+ {
+ $context = stream_context_create(options: [
+ 'ssl' => [
+ 'local_cert' => $this->certificate['file'],
+ 'local_pk' => $this->certificate['key'],
+ 'passphrase' => $this->certificate['passphrase'],
+
+ 'allow_self_signed' => true,
+ 'verify_peer' => false,
+ ],
+ ]);
+
+ $socket = stream_socket_server(
+ address: "tls://{$this->hostname}:{$port}",
+ context: $context
+ );
+
+ $connections = [];
+
+ while (true) {
+ $connection = stream_socket_accept(
+ socket: $socket,
+ timeout: empty($connections) ? -1 : 0,
+ peer_name: $peer
+ );
+
+ if ($connection) {
+ $connections[$peer] = $connection;
+ }
+
+ if (count($connections) == 0) {
+ continue;
+ }
+
+ $streams = stream_select(
+ read: $connections,
+ write: $write,
+ except: $except,
+ seconds: 5
+ );
+
+ if ($streams) {
+ foreach ($connections as $peer => $connection) {
+ if (feof($connection)) {
+ fclose($connection);
+ unset($connections[$peer]);
+ continue;
+ }
+
+ $request = Request::fromResource($connection);
+ $response = new Response();
+ foreach ($this->requestHandlers as $requestHandler) {
+ $response = $requestHandler($response, $request);
+ }
+ $response->send($connection);
+
+ fclose($connection);
+ unset($connections[$peer]);
+ }
+ }
+ }
+ }
+}
+```
diff --git a/en/2024/battle-net-on-linux-with-steam-proton.gmi b/en/2024/battle-net-on-linux-with-steam-proton.gmi
new file mode 100644
index 0000000..154bd0c
--- /dev/null
+++ b/en/2024/battle-net-on-linux-with-steam-proton.gmi
@@ -0,0 +1,50 @@
+# Running the Battle.net Client on Linux with Steam Proton
+
+### 1. Download the .exe Setup on https://download.battle.net
+
+### 2. Add the Setup as a Non-Steam Game
+
+Select "Browse"
+Choose the "Battle.net-Setup.exe"
+
+### 3. Set Proton version
+
+Right-Click -> Properties -> Compatibility
+
+At time of writing stable and working Proton version is "Proton 8.0-5"
+if that doesn't work or silently crashes at any point, try a different version
+
+### 4. Run the Launcher via Steam
+
+### 5. Install Battle.net
+
+You can leave the install location for the Client unchanged, but then the next time you remove the Setup as a non-steam game and re-add it, you lose the installation and have to do it again.
+
+The persistent way is to choose a directory on your computer, not in the emulated windows environment.
+To select a directory on your computer click the "Change" button when the Installation asks you to select the Install Location. On the left hand side select the "/" directory and navigate to where you want to install the Client to.
+
+=> /img/2024/battle-net-on-linux-with-steam-proton-1.png "Select Folder"
+
+When the installation is done...
+
+### 6. Add the Client as a Non-Steam Game
+
+You can safely remove the Setup at this point as a steam game and add the Client .exe as a non-Steam game. Or you can change the location of the Setup-non-steam-game, either is fine.
+
+After you added the Client as a Non-Steam game don't forget to select the Proton version again.
+
+### 7. Install the games you want via the Battle.net Client
+
+The Install Location for the games should also be on your computer and not be the default, otherwise the same applies and the installation vanishes, when you remove the Client as a non-steam game.
+
+### 8. Customize the Application in Steam (optional)
+
+You can change the name of the entry in the properties from "Battle.net.exe" to just "Battle.net" and also set an icon there.
+
+=> /img/2024/battle-net-on-linux-with-steam-proton-2.png "Set Name and Icon"
+=> /img/2024/battle-net-on-linux-with-steam-proton-logo.png "Logo"
+
+You can right-click the empty gray space above the title and "Set Custom Background".
+
+=> /img/2024/battle-net-on-linux-with-steam-proton-3.png "Set Custom Background"
+=> /img/2024/battle-net-on-linux-with-steam-proton-background.jpg "Background"
diff --git a/en/index.gmi b/en/index.gmi
new file mode 100644
index 0000000..670e3c2
--- /dev/null
+++ b/en/index.gmi
@@ -0,0 +1,12 @@
+# Blog
+
+=> / German version
+
+## Gemini
+
+=> /en/2023/writing-a-gemini-server-in-php.gmi
+
+
+## Gaming
+
+=> /en/2024/battle-net-on-linux-with-steam-proton.gmi