<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Blog Alexandre Flach</title><link>https://blog.flach.dev/en/</link><description>Recent content on Blog Alexandre Flach</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 29 Feb 2024 10:00:00 -0300</lastBuildDate><atom:link href="https://blog.flach.dev/en/index.xml" rel="self" type="application/rss+xml"/><item><title>Brazil: The New World Gold?</title><link>https://blog.flach.dev/en/posts/brazil-new-world-gold/</link><pubDate>Thu, 29 Feb 2024 10:00:00 -0300</pubDate><guid>https://blog.flach.dev/en/posts/brazil-new-world-gold/</guid><description>Analysis of Brazil&amp;#39;s potential as a global economic power and the challenges to be overcome.</description></item><item><title>Weekly Analysis: Top Economic Headlines</title><link>https://blog.flach.dev/en/posts/april-3-economic-news/</link><pubDate>Thu, 29 Feb 2024 10:00:00 -0300</pubDate><guid>https://blog.flach.dev/en/posts/april-3-economic-news/</guid><description>A summary of the week&amp;#39;s most important economic news, including inflation, interest rates, and market trends.</description></item><item><title>Setting up Jellyfin with Docker on Ubuntu</title><link>https://blog.flach.dev/en/posts/jelyfin-docker-ubuntu/</link><pubDate>Fri, 27 Oct 2023 00:00:00 +0000</pubDate><guid>https://blog.flach.dev/en/posts/jelyfin-docker-ubuntu/</guid><description>&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Ubuntu installed&lt;/li&gt;
&lt;li&gt;Docker installed&lt;/li&gt;
&lt;li&gt;Docker Compose installed&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="step-1-create-directories"&gt;Step 1: Create Directories&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir -p ~/jellyfin/config
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir -p ~/jellyfin/data
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="step-2-create-the-docker-composeyml"&gt;Step 2: Create the &lt;code&gt;docker-compose.yml&lt;/code&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;version&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#34;3.9&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;services&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;jellyfin&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;image&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;jellyfin/jellyfin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;container_name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;jellyfin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;user&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;1000&lt;/span&gt;:&lt;span style="color:#ae81ff"&gt;1000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;network_mode&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#34;host&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;volumes&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#ae81ff"&gt;/home/$USER/jellyfin/config:/config&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#ae81ff"&gt;/home/$USER/jellyfin/data:/data&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#ae81ff"&gt;/path/to/your/media:/media&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;restart&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;unless-stopped&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Replace &lt;code&gt;/path/to/your/media&lt;/code&gt; with the actual path to your media.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id="step-3-start-jellyfin"&gt;Step 3: Start Jellyfin&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd ~/jellyfin
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker-compose up -d
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="step-4-access-jellyfin"&gt;Step 4: Access Jellyfin&lt;/h2&gt;
&lt;p&gt;Open your browser and go to &lt;code&gt;http://localhost:8096&lt;/code&gt;. Follow the instructions in the web interface to set up Jellyfin.&lt;/p&gt;</description></item><item><title/><link>https://blog.flach.dev/en/posts/bot-discord/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://blog.flach.dev/en/posts/bot-discord/</guid><description>&lt;pre tabindex="0"&gt;&lt;code&gt;---
title: Creating a Simple Discord Bot with Python
date: 2023-10-27
draft: false
description: A step-by-step guide to creating your first Discord bot using Python and the discord.py library.
categories: [&amp;#34;Discord&amp;#34;, &amp;#34;Bots&amp;#34;, &amp;#34;Python&amp;#34;]
tags: [&amp;#34;Discord&amp;#34;, &amp;#34;Bot&amp;#34;, &amp;#34;Python&amp;#34;, &amp;#34;discord.py&amp;#34;]
---
# Creating a Simple Discord Bot with Python
In this guide, we will build a basic Discord bot using Python and the powerful `discord.py` library. This bot will respond to simple commands, and we&amp;#39;ll learn the fundamentals to expand it in the future.
## Prerequisites
* **Python:** Make sure you have Python installed (version 3.7 or higher).
* **discord.py:** Install the library using `pip install discord.py`.
* **A Discord account:** You&amp;#39;ll need a Discord account and a server where the bot can operate.
## Creating a Bot on Discord (Step-by-Step)
1. **Create an Application on the Discord Developer Portal:**
* Go to the [Discord Developer Portal](https://discord.com/developers/applications).
* Click &amp;#34;New Application&amp;#34; and give your bot a name.
2. **Turn the Application into a Bot:**
* In your application&amp;#39;s menu, go to &amp;#34;Bot&amp;#34;.
* Click &amp;#34;Add Bot&amp;#34;. Confirm the creation.
3. **Get the Bot Token:**
* On the Bot page, copy the &amp;#34;Token&amp;#34;. **Keep this token a secret!**
4. **Invite the Bot to your Server:**
* Go to &amp;#34;OAuth2&amp;#34; -&amp;gt; &amp;#34;URL Generator&amp;#34;.
* Select the &amp;#34;bot&amp;#34; scope and, under &amp;#34;Bot Permissions&amp;#34;, choose the permissions your bot needs. To start, &amp;#34;Read Messages/View Channels&amp;#34; and &amp;#34;Send Messages&amp;#34; are sufficient.
* Copy the generated URL and paste it into your browser. This will redirect you to add the bot to your server.
## Python Code
Create a Python file (e.g., `my_bot.py`) and paste the following code:
```python
import discord
# Replace with your token!
TOKEN = &amp;#39;YOUR_TOKEN_HERE&amp;#39;
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print(f&amp;#39;Logged in as {client.user}&amp;#39;)
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith(&amp;#39;!hello&amp;#39;):
await message.channel.send(&amp;#39;Hello!&amp;#39;)
elif message.content.startswith(&amp;#39;!ping&amp;#39;):
await message.channel.send(&amp;#39;Pong!&amp;#39;)
client.run(TOKEN)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Code Explanation:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title/><link>https://blog.flach.dev/en/posts/post/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://blog.flach.dev/en/posts/post/</guid><description>&lt;p&gt;&lt;strong&gt;Inglês&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-markdown" data-lang="markdown"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;---
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;title: &amp;#34;Important Economic News Today&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;date: 2024-02-29T10:00:00-03:00
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;draft: false
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;description: &amp;#34;A summary of the main economic news of the day, including inflation, interest rates, and global markets.&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tags: [&amp;#34;economics&amp;#34;, &amp;#34;news&amp;#34;, &amp;#34;finance&amp;#34;, &amp;#34;financial market&amp;#34;]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;categories: [&amp;#34;Economy&amp;#34;]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;---
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;## Today&amp;#39;s Highlights
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Today was marked by important events in the field of economics, with reflections on both the national and international markets.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;### Inflation Surprises
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;The Consumer Price Index (CPI) showed an increase of [insert percentage here]% in the last month, surprising analysts who expected a lower number. This increase in inflation puts pressure on the Central Bank to raise interest rates at the next meeting of the Monetary Policy Committee (COPOM).
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;*&lt;/span&gt; &lt;span style="font-weight:bold"&gt;**Impact:**&lt;/span&gt; Increased inflation may lead to an increase in the Selic rate, impacting credit and consumption.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;### Interest Rates in Focus
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Experts debate whether the Central Bank will actually raise the Selic rate. Some argue that the increase in inflation justifies the measure, while others fear that it could further slow down the economy.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;*&lt;/span&gt; &lt;span style="font-weight:bold"&gt;**Prediction:**&lt;/span&gt; A decision is expected next week after the COPOM meeting.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;### Global Markets React
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Global stock markets showed volatility due to uncertainties regarding monetary policy in the United States and the war in Ukraine. The Ibovespa closed the day with [insert percentage here]% [increase/decrease].
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;*&lt;/span&gt; &lt;span style="font-weight:bold"&gt;**Analysis:**&lt;/span&gt; Investors should closely monitor global developments to make informed decisions.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;### Other News
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;*&lt;/span&gt; [Insert a brief summary of another relevant matter here]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;*&lt;/span&gt; [Insert a brief summary of another relevant matter here]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;This is just a brief summary of today&amp;#39;s top economic news. Stay tuned for more updates and detailed analysis.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item></channel></rss>