diff options
-rw-r--r-- | 2023/gemini-server-mit-php-programmieren.gmi | 116 | ||||
-rw-r--r-- | 2023/label-mit-libreoffice-spreadsheet-erstellen.gmi | 49 | ||||
-rw-r--r-- | en/2023/writing-a-gemini-server-in-php.gmi | 116 | ||||
-rw-r--r-- | en/2024/battle-net-on-linux-with-steam-proton.gmi | 50 | ||||
-rw-r--r-- | en/index.gmi | 12 | ||||
-rw-r--r-- | img/2023/label-mit-libreoffice-aus-spreadsheet-erstellen-4.png | bin | 0 -> 58233 bytes | |||
-rw-r--r-- | img/2024/battle-net-on-linux-with-steam-proton-1.png | bin | 0 -> 48497 bytes | |||
-rw-r--r-- | img/2024/battle-net-on-linux-with-steam-proton-2.png | bin | 0 -> 33966 bytes | |||
-rw-r--r-- | img/2024/battle-net-on-linux-with-steam-proton-3.png | bin | 0 -> 746904 bytes | |||
-rw-r--r-- | img/2024/battle-net-on-linux-with-steam-proton-background.jpg | bin | 0 -> 312286 bytes | |||
-rw-r--r-- | img/2024/battle-net-on-linux-with-steam-proton-logo.png | bin | 0 -> 15417 bytes | |||
-rw-r--r-- | index.gmi | 11 |
12 files changed, 354 insertions, 0 deletions
diff --git a/2023/gemini-server-mit-php-programmieren.gmi b/2023/gemini-server-mit-php-programmieren.gmi new file mode 100644 index 0000000..44ee6c6 --- /dev/null +++ b/2023/gemini-server-mit-php-programmieren.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/2023/label-mit-libreoffice-spreadsheet-erstellen.gmi b/2023/label-mit-libreoffice-spreadsheet-erstellen.gmi new file mode 100644 index 0000000..c5813e1 --- /dev/null +++ b/2023/label-mit-libreoffice-spreadsheet-erstellen.gmi @@ -0,0 +1,49 @@ +# Label mit LibreOffice aus Spreadsheet erstellen + + +Folgender Use-Case wird dargestellt: +* Benötigt werden Schilder für die Bilder bei einer Kunstausstellung +* Die Schilder sollen möglichst platzsparend ausdruckbar sein +* Daten liegen als Zeilen in einer Excel-Datei vor + + +## 1. Excel-Datei in ods-Datei umwandeln + +Excel-Datei einfach in LibreOffice Calc öffnen +und dann als .ods Speichern + + +## 2. Datenbank aus ods-Datei erzeugen + +* LibreOffice Writer öffnen +* File > Wizards > Address Data Source + +* Other external data source +* Settings > Database type: Spreadsheet > ods Datei auswählen +* "Tabelle", also Sheet auswählen +* "Field Assignment" überspringen +* "Data Source Title" = Name der Datenbank + + +## 3. Label erstellen + +* LibreOffice Writer Instanz weiterverwenden +* File > New > Labels + +### 3.1 Labels > Inscription + +* "Database", "Table" und "Database field" auswählen > Auf Pfeil nach links klicken um Felder ins Label zu schreiben +* Das "Label text" Feld ist ein Freitext-Feld, kann also beliebig arrangiert werden + +### 3.2 Labels > Format + +Brand: "A-one" +Type: Keine Ahnung welcher der "richtige" A4-Type ist, der erste taugt + +Auf "New Document" klicken + + +## 4. PDF erzeugen + +=> /img/2023/label-mit-libreoffice-aus-spreadsheet-erstellen-4.png "Save Merged Documents" +"Save as a single large document" > "Save Documents" 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 diff --git a/img/2023/label-mit-libreoffice-aus-spreadsheet-erstellen-4.png b/img/2023/label-mit-libreoffice-aus-spreadsheet-erstellen-4.png Binary files differnew file mode 100644 index 0000000..bbd6247 --- /dev/null +++ b/img/2023/label-mit-libreoffice-aus-spreadsheet-erstellen-4.png diff --git a/img/2024/battle-net-on-linux-with-steam-proton-1.png b/img/2024/battle-net-on-linux-with-steam-proton-1.png Binary files differnew file mode 100644 index 0000000..de7bda0 --- /dev/null +++ b/img/2024/battle-net-on-linux-with-steam-proton-1.png diff --git a/img/2024/battle-net-on-linux-with-steam-proton-2.png b/img/2024/battle-net-on-linux-with-steam-proton-2.png Binary files differnew file mode 100644 index 0000000..acf438d --- /dev/null +++ b/img/2024/battle-net-on-linux-with-steam-proton-2.png diff --git a/img/2024/battle-net-on-linux-with-steam-proton-3.png b/img/2024/battle-net-on-linux-with-steam-proton-3.png Binary files differnew file mode 100644 index 0000000..211b58f --- /dev/null +++ b/img/2024/battle-net-on-linux-with-steam-proton-3.png diff --git a/img/2024/battle-net-on-linux-with-steam-proton-background.jpg b/img/2024/battle-net-on-linux-with-steam-proton-background.jpg Binary files differnew file mode 100644 index 0000000..44678fe --- /dev/null +++ b/img/2024/battle-net-on-linux-with-steam-proton-background.jpg diff --git a/img/2024/battle-net-on-linux-with-steam-proton-logo.png b/img/2024/battle-net-on-linux-with-steam-proton-logo.png Binary files differnew file mode 100644 index 0000000..bb45da2 --- /dev/null +++ b/img/2024/battle-net-on-linux-with-steam-proton-logo.png diff --git a/index.gmi b/index.gmi new file mode 100644 index 0000000..9dff3bb --- /dev/null +++ b/index.gmi @@ -0,0 +1,11 @@ +# Blog + +=> /en English version + +## Gemini + +=> /2023/gemini-server-mit-php-programmieren.gmi + +## LibreOffice + +=> /2023/label-mit-libreoffice-spreadsheet-erstellen.gmi |