<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.sash.pw/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki.sash.pw/feed.php">
        <title>Saschas Wiki - misc:code_snippets</title>
        <description></description>
        <link>https://wiki.sash.pw/</link>
        <image rdf:resource="https://wiki.sash.pw/_media/wiki:logo.png" />
       <dc:date>2026-04-28T14:37:08+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.sash.pw/misc:code_snippets:nginx?rev=1502657545&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.sash.pw/misc:code_snippets:python?rev=1491923634&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.sash.pw/misc:code_snippets:shell?rev=1763802606&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.sash.pw/_media/wiki:logo.png">
        <title>Saschas Wiki</title>
        <link>https://wiki.sash.pw/</link>
        <url>https://wiki.sash.pw/_media/wiki:logo.png</url>
    </image>
    <item rdf:about="https://wiki.sash.pw/misc:code_snippets:nginx?rev=1502657545&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-08-13T20:52:25+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>nginx</title>
        <link>https://wiki.sash.pw/misc:code_snippets:nginx?rev=1502657545&amp;do=diff</link>
        <description>Codeschnipsel für nginx Konfigurationen

Einige nützliche Codeschnipsel für Methoden und Aufgaben mit nginx.

nginx Version nicht senden


server_tokens off;


SSL/TLS erzwingen


# enforce SSL
server {
    listen 80;
    listen [::]:80;
    return 301 https://$host$request_uri;
}</description>
    </item>
    <item rdf:about="https://wiki.sash.pw/misc:code_snippets:python?rev=1491923634&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-04-11T15:13:54+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python</title>
        <link>https://wiki.sash.pw/misc:code_snippets:python?rev=1491923634&amp;do=diff</link>
        <description>Codeschnipsel für Python

Eine kleine Sammlung an Codefragmenten und Routinen für Python.

try main Block mit Exception Handling


import sys

if __name__ == &#039;__main__&#039;:
    try:
        main()
    except KeyboardInterrupt:
        print(&#039;\nCtrl+C detected, will abort process&#039;)
        sys.exit(0)
    except Exception as e:
        print(&#039;\nAn error occured during execution:&#039;)
        print(e)
        if &#039;-v&#039; or &#039;--verbose&#039; in sys.argv:
            raise e
        sys.exit(1)</description>
    </item>
    <item rdf:about="https://wiki.sash.pw/misc:code_snippets:shell?rev=1763802606&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-11-22T09:10:06+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>shell</title>
        <link>https://wiki.sash.pw/misc:code_snippets:shell?rev=1763802606&amp;do=diff</link>
        <description>Codeschnipsel für Shell-Programmierung

Eine kleine Auswahl an Codeschnipseln für bestimmte Aufgaben in Shell-Skripten.

Sichere Verwendung von Variablen
${VAR:?}
Überprüft, ob die Variable gesetzt ist statt eines leeren Strings zu verwenden.

Negativbeispiel:</description>
    </item>
</rdf:RDF>
