<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Uncategorized &#8211; Det&#039;s Blog</title>
	<atom:link href="https://dplehn.uber.space/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>https://dplehn.uber.space</link>
	<description></description>
	<lastBuildDate>Tue, 28 Jan 2025 17:53:32 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>

<image>
	<url>https://dplehn.uber.space/wp-content/uploads/2022/12/cropped-Detlef-scaled-e1671530799257-32x32.jpg</url>
	<title>Uncategorized &#8211; Det&#039;s Blog</title>
	<link>https://dplehn.uber.space</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>python decorator deutsch &#8222;von ChatGPT&#8220;</title>
		<link>https://dplehn.uber.space/uncategorized/python-decorator-auf-deutsch-von-chatgpt/</link>
					<comments>https://dplehn.uber.space/uncategorized/python-decorator-auf-deutsch-von-chatgpt/#respond</comments>
		
		<dc:creator><![CDATA[DPlehn]]></dc:creator>
		<pubDate>Fri, 03 Mar 2023 11:11:21 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://detsblog.ga/?p=370</guid>

					<description><![CDATA[Ich habe einfach mal die obige Frage bei ChatGPT gestellt. Die Antwort hat mich schon erstaunt. In Python ist ein Decorator eine spezielle Funktion, die eine andere Funktion als Eingabe ...]]></description>
										<content:encoded><![CDATA[
<p>Ich habe einfach mal die obige Frage bei ChatGPT gestellt. Die Antwort hat mich schon erstaunt.</p>



<p>In Python ist ein Decorator eine spezielle Funktion, die eine andere Funktion als Eingabe erhält, das Verhalten der Eingabefunktion modifiziert und dann die modifizierte Funktion zurückgibt. Decorators werden typischerweise verwendet, um neuen Funktionen zu bestehenden Funktionen hinzuzufügen, ohne den Quellcode direkt zu ändern.</p>



<p>Hier ist ein Beispiel für einen einfachen Decorator, der Logging-Funktionalität zu einer Funktion hinzufügt:</p>



<pre class="wp-block-code"><code>def log_decorator(func):
    def wrapper(*args, **kwargs):
        print(f"Rufe Funktion {func.__name__} mit Argumenten {args} und Schlüsselwortargumenten {kwargs} auf")
        return func(*args, **kwargs)
    return wrapper

@log_decorator
def meine_funktion(x, y):
    return x + y
</code></pre>



<p>In diesem Beispiel ist <code>log_decorator</code> die Decorator-Funktion, die <code>meine_funktion</code> als Eingabe erhält. Die <code>wrapper</code>-Funktion wird innerhalb von <code>log_decorator</code> definiert und als modifizierte Funktion zurückgegeben. Die <code>wrapper</code>-Funktion protokolliert den Funktionsnamen und ihre Argumente, ruft dann die Originalfunktion (<code>meine_funktion</code>) auf und gibt ihr Ergebnis zurück.</p>



<p>Die Syntax <code>@log_decorator</code> ist eine Kurzschreibweise, um den <code>log_decorator</code> auf <code>meine_funktion</code> anzuwenden. Es ist äquivalent zur Anweisung <code>meine_funktion = log_decorator(meine_funktion)</code>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://dplehn.uber.space/uncategorized/python-decorator-auf-deutsch-von-chatgpt/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Beschreibung um eine Flask-App auf Uberspace bereitzustellen</title>
		<link>https://dplehn.uber.space/uncategorized/beschreibung-um-eine-flask-app-auf-uberspace-bereitzustellen/</link>
					<comments>https://dplehn.uber.space/uncategorized/beschreibung-um-eine-flask-app-auf-uberspace-bereitzustellen/#respond</comments>
		
		<dc:creator><![CDATA[DPlehn]]></dc:creator>
		<pubDate>Sat, 25 Feb 2023 14:32:45 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://detsblog.ga/?p=351</guid>

					<description><![CDATA[So habe ich meine Flask-App auf Uberspace bereitgestellt. Hier ein Beispiel mit dem Verzeichnis basic_flask unter dem die Anwendung entwickelt wurde..]]></description>
										<content:encoded><![CDATA[
<p>So habe ich meine Flask-App auf Uberspace bereitgestellt. Hier ein Beispiel mit dem Verzeichnis basic_flask unter dem die Anwendung entwickelt wurde..</p>



<p></p>



<pre class="wp-block-code"><code>cd basic_flask
python3.9 -m venv ENV
source ENV/bin/activate
pip install flask uwsgi

Create the ini file ~/basic_flask/uwsgi.ini with the following content:

&#91;uwsgi]
module = app:app
pidfile = basic_flask.pid
master = true
processes = 1
http-socket = :1024
chmod-socket = 660
vacuum = true


cd basic_flask
source ENV/bin/activate
uwsgi uwsgi.ini

Create ~/etc/services.d/flask.ini with the following content:

&#91;program:flask]
directory=%(ENV_HOME)s/basic_flask
command=%(ENV_HOME)s/basic_flask/ENV/bin/uwsgi uwsgi.ini


supervisorctl reread
SERVICE: available
supervisorctl update
supervisorctl status
</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://dplehn.uber.space/uncategorized/beschreibung-um-eine-flask-app-auf-uberspace-bereitzustellen/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Connect to remote PostgresDB from local Development-Server</title>
		<link>https://dplehn.uber.space/uncategorized/connect-to-remote-postgresdb-from-local-development-server/</link>
					<comments>https://dplehn.uber.space/uncategorized/connect-to-remote-postgresdb-from-local-development-server/#respond</comments>
		
		<dc:creator><![CDATA[DPlehn]]></dc:creator>
		<pubDate>Sun, 01 Jan 2023 13:44:29 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://detsblog.ga/?p=310</guid>

					<description><![CDATA[Mein Problem war, dass ich lokal mit Python entwickle, jedoch auf meine Postgresql-DB auf dem Uberspace-Server zugreifen möchte. Hierzu war es notwendig einen SSL-Tunnel mit der Python-Library &#8222;sshtunnel&#8220; einzurichten.]]></description>
										<content:encoded><![CDATA[
<p>Mein Problem war, dass ich lokal mit Python entwickle, jedoch auf meine Postgresql-DB auf dem Uberspace-Server zugreifen möchte. Hierzu war es notwendig einen SSL-Tunnel mit der Python-Library &#8222;sshtunnel&#8220; einzurichten.</p>



<p> </p>



<pre class="wp-block-code" style="font-size:10px"><code>import psycopg2
from sshtunnel import SSHTunnelForwarder

try:
    uberspace_server = 'xxx'
    my_ssh_username = 'xxx'
    my_ssh_password = 'xxx'
    my_ssh_port = xxx
    my_postgres_db = 'xxx'
    my_postgres_user ='xxx'
    my_postgres_password = 'xxx'

    with SSHTunnelForwarder(
         (uberspace_server, 22),
         ssh_username = my_ssh_username,
         ssh_password = my_ssh_password, 
         remote_bind_address=('localhost', my_ssh_port)) as server:
         server.start()
         print ("server connected")
         params = {
             'database': my_postgres_db,
             'user': my_postgres_user,
             'password': my_postgres_password,
             'host': 'localhost',
             'port': server.local_bind_port
             }
         conn = psycopg2.connect(**params)
         curs = conn.cursor()
         print("database connected")
except:
    print("Connection Failed")</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://dplehn.uber.space/uncategorized/connect-to-remote-postgresdb-from-local-development-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
