<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by sebdur on Medium]]></title>
        <description><![CDATA[Stories by sebdur on Medium]]></description>
        <link>https://medium.com/@sebdur?source=rss-3b4cb9c967c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*40hPxhndQbalHHY1_q2-FA.png</url>
            <title>Stories by sebdur on Medium</title>
            <link>https://medium.com/@sebdur?source=rss-3b4cb9c967c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:11:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sebdur/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to create and configure an EC2 instance, using a Route 53 subdomain and setup Nginx as a…]]></title>
            <link>https://sebdur.medium.com/how-to-create-and-configure-an-ec2-instance-using-a-route-53-subdomain-and-setup-nginx-as-a-7689c04e4cb5?source=rss-3b4cb9c967c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7689c04e4cb5</guid>
            <category><![CDATA[debian]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[certbot]]></category>
            <category><![CDATA[aws-route53]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <dc:creator><![CDATA[sebdur]]></dc:creator>
            <pubDate>Thu, 24 Nov 2022 15:45:16 GMT</pubDate>
            <atom:updated>2025-12-09T21:50:55.550Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to create and configure an EC2 instance, using a Route 53 subdomain and setup Nginx as a reverse proxy server with SSL certificate</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*if2YFbT1byoqJ6xwp-Z4bg.jpeg" /></figure><p>I remember the first time I launched an EC2 instance. I had a really hard time getting everything to work. This was the main reason why I am writing this document today.</p><p>Most of the guides I found on the internet used the Linux Image from AWS or Ubuntu as OS for the instance. Practically nothing about Debian, which I prefer over the rest.</p><p>Obviously, you need to have created an account in AWS and be logged-in to continue with this guide.</p><h3><strong>AWS EC2</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1eFbbg6A6LbMT7s7JUby3w.png" /></figure><p>Let’s start with EC2.<br>In the sidebar, choose ‘Instances’ and click the ‘Launch Instances’ button in the upper right corner. A creation form will be displayed, where you must fill in these fields:</p><ul><li>‘Name and tags’ give a name to the instance.</li><li>‘Application and OS Images’ choose ***DEBIAN***.</li><li>‘Instance type’ choose according to the project (recommended t2.micro for the free tier).</li><li>‘Key pair (login)’ click on ‘new key pair.’ It will display a form where you must give a name to the key-chain, and check the RSA and .pem options. The key-chain will be automatically downloaded. I recommend you to move this key-chain to ~/.ssh folder.</li><li>‘Network settings’ keep default options, but check the boxes ‘Allow HTTPS traffic from the Internet’ and ‘Allow HTTP traffic from the Internet’.</li></ul><p>After completing these steps, press ‘Launch instance’. The process of creating and launching the instance will begin. It will take a few minutes.</p><p>When the instance finishes initialization, go to the table where the instances are listed, choose the newly created instance and copy ‘Public IPv4 Address’ found in the ‘Details’ tab.</p><h3><strong>AWS Route 53</strong></h3><p>You need to have purchased a domain and created a hosted zone. If you don’t, please check out the docs (<a href="https://docs.aws.amazon.com/route53/index.html">https://docs.aws.amazon.com/route53/index.html</a>)</p><p>Time to create your subdomain. Go to Route 53.</p><p>In the sidebar, choose ‘Hosted zones’. It will show a table of ‘Hosted Zones’. Click on the domain name link.</p><p>Click on ‘Create record’. It will display a form where you must fill in these fields:</p><ul><li>‘Record name’ give the name to the subdomain (example.medium.com).</li><li>‘Record type’ choose ‘A — Routes traffic to an IPv4 address and some AWS resources’</li><li>‘Value’ paste the public IPv4 address that you copied earlier.</li></ul><p>Create the record and wait a few minutes, for the DNS to spread around the world.</p><h3><strong>Server configuration</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*-TFSO8b4oc-Zbt1smQuX-A.png" /></figure><p>Open a new Terminal.</p><p>The first step is to limit the permissions for the key you saved in ~/.ssh (replace &lt;key_name&gt; with your actual key name):</p><pre>chmod 400 ~/.ssh/&lt;key_name&gt;.pem</pre><p>Next, access the instance using the following command, replacing &lt;key_name&gt; and &lt;public_ip&gt; with the public IP of your instance:</p><pre>ssh -i ~/.ssh/&lt;key_name&gt;.pem admin@&lt;public_ip&gt;</pre><p>Once inside the instance, run the following commands to update and upgrade the system packages:</p><pre>sudo apt update &amp;&amp; sudo apt upgrade</pre><p>Install GIT for versioning, HTOP to monitor server status, UFW as firewall and BUILD-ESSENTIAL just in case you need to compile some software:</p><pre>sudo apt install git htop ufw build-essential</pre><p>After the installation is complete, give permissions to port 22:</p><pre>sudo ufw allow OpenSSH</pre><p>Enable the firewall:</p><pre>sudo ufw enable</pre><p>Next, you need to install and configure Nginx as a reverse proxy server:</p><pre>sudo apt install nginx</pre><p>Allow ports 80 and 443:</p><pre>sudo ufw allow &#39;Nginx Full&#39;</pre><p>To verify the UFW rules, you can check the status:</p><pre>sudo ufw status</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xBweMAQXCJkfSkuddNal5g.png" /></figure><p>Check the status of Nginx:</p><pre>sudo systemctl status nginx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bs2_nkiKh9uSWWbRtXs2BA.png" /></figure><p>Open a new tab in your browser and enter the public IPv4 address. It should display the rendered template</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*stE8eBbfeVmn6ePses9_pA.png" /></figure><h3><strong>App Deployment</strong></h3><p>For this post, I will be utilizing a basic Node-express application. Usually, these applications use port 8080, so I will configure Nginx to listen on this port.. It is worth noting that the steps to serve on a different stack or port would be quite similar.</p><p>Let’s go back to the Terminal. <br>I extremely recommend you to use NVM, for management of the different versions of Node.</p><p>Install NVM with this command</p><pre>wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash</pre><p>Restart bash</p><pre>source ~/.bashrc</pre><p>Check if NVM has been properly installed by running the following command (it should output ‘nvm’)</p><pre>command -v nvm</pre><p>Install the LTS version of Node.js</p><pre>nvm install --lts</pre><p>(Or in case you need a specific version)</p><pre>node install &lt;node_version_number&gt;</pre><p>Now that you have Node.js installed and ready, you can generate the id_rsa.pub key by executing the following command:</p><pre>ssh-keygen</pre><p>Press Enter three times (leaving all fields blank) to generate the key. Afterwards, you can print the content of the key using the following command</p><pre>cat ~/.ssh/id_rsa.pub</pre><p>Copy the output and add it as an SSH key on the platform where your project is hosted.</p><p>Once you have done that, clone your project. Navigate to the project folder and execute the following command</p><pre>npm i</pre><p>After the dependencies are installed, you will need to configure the server block.</p><h3><strong>Nginx configuration</strong></h3><p>From now on, you need to replace &lt;your_subdomain&gt; with the name of your subdomain. Execute the following command</p><pre>sudo nano /etc/nginx/sites-available/&lt;your_subdomain&gt;</pre><p>And copy/paste and save (Ctrl+O) the following content:</p><pre>server {<br>   server_name &lt;your_subdomain&gt;;<br>   location / {<br>    proxy_pass <a href="http://localhost:8080;">http://localhost:8080;</a><br>    proxy_http_version 1.1;<br>    proxy_set_header Upgrade $http_upgrade;<br>    proxy_set_header Connection &#39;upgrade&#39;;<br>    proxy_set_header Host $host;<br>    proxy_cache_bypass $http_upgrade;<br>   }<br> }</pre><p>Create a symlink using:</p><pre>sudo ln -s /etc/nginx/sites-available/&lt;your_subdomain&gt; /etc/nginx/sites-enabled/</pre><p>To avoid issues with the memory hash bucket, modify the nginx.conf file:</p><pre>sudo nano /etc/nginx/nginx.conf</pre><p>Uncomment the line that says ‘server_names_hash_bucket_size 64;’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*11Bo-WP9svkppYpVj9P6cA.png" /></figure><p>Check if there’s any syntax problem:</p><pre>sudo nginx -t</pre><p>If it’s successful, restart Nginx by executing:</p><pre>sudo systemctl restart nginx</pre><p>Start the app using pm2. Install it by running:</p><pre>npm install pm2@latest -g</pre><p>Go to your project folder and run:</p><pre>pm2 start index.js</pre><p>Test that everything is fine by entering the URL of our subdomain on the browser.</p><p>It should work, but with insecure connection.</p><h3><strong>SSL Cetificate</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*g9vpmNmlL1K87-VabCrvUw.jpeg" /></figure><p>Use Certbot to encrypt your subdomain.</p><p>Firtst, you must have port 443 enabled on the instance’s firewall.</p><p>For configuring a secure connection, install Certbot to serve on port 443:</p><pre>sudo apt install certbot python3-certbot-nginx</pre><p>When it is finished, run:</p><pre>sudo certbot --nginx -d &lt;your_subdomain&gt;</pre><p>It will asked you for an email address, to notify you about the state of the SSL certificate. Accept all the conditions and execute this command to auto-renew the SSL certificate every 90 days:</p><pre>sudo certbot renew</pre><p>Open the browser and go to your subdomain URL. You should see that you have a secure connection.</p><p>That’s all for today!<br>Thanks for reading. If you have any questions, leave me a comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7689c04e4cb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Daily Machine Thinkpad T400]]></title>
            <link>https://sebdur.medium.com/my-daily-machine-thinkpad-t400-ce95237fbb90?source=rss-3b4cb9c967c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce95237fbb90</guid>
            <category><![CDATA[debian]]></category>
            <category><![CDATA[still-alive]]></category>
            <category><![CDATA[libreboot]]></category>
            <category><![CDATA[upgrade]]></category>
            <category><![CDATA[thinkpad]]></category>
            <dc:creator><![CDATA[sebdur]]></dc:creator>
            <pubDate>Mon, 17 Jan 2022 23:57:41 GMT</pubDate>
            <atom:updated>2023-03-30T02:43:09.656Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_KjY_2MCfFisvzViGDyeiw.jpeg" /></figure><p>In 2005 Lenovo purchased IBM’s PC division.</p><p>Until the model T60, Lenovo kept the IBM logo, but the machines already manufactured in China.</p><p>The next model (Thinkpad T61) was the first model to remove the IBM logo from the lid and the palmrest, and put the Thinkpad logo in replacement. In my opinion, they did it shyly.</p><p>August 2008, Lenovo released the model Thinkpad T400, the first one of T4XX series. In this model Lenovo takes the total control, using their logo on the lid.</p><p>The first thing I want to mention is this website, because all of the major changes I did in my machine are based in this article.<br><strong>Thanks</strong> to McDonnell Tech:</p><p><a href="https://mcdojf.wixsite.com/t400">ThinkPad T400</a></p><p>All the specs:</p><p><a href="https://www.thinkwiki.org/wiki/Category:T400">Category:T400</a></p><p>When I bought my T400, immediately I replaced the old Hard Drive Disk with a Solid State Drive, put 2 RAM memories 4GB DDR3L–8500 (dual channel) and changed the P8400 CPU (2.26GHz, 3MB Cache, 25W TDP) for a P9700(2.8GHz, 6MB Cache, 28W TDP)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*Vm1ahu5nIOQGQSRavf8ZTw.png" /><figcaption>Intel Core2 Duo P9700</figcaption></figure><p>Before, you need to install the latest version of the BIOS (3.24 or 3.25) and whitelist with the modified version. This will allow you to change the WiFi card and the Bluetooth daughter card.</p><p>I replaced the Intel WiFi Link 5100 (a/g/n) with Atheros AR5BXB112 AR9380 (a/g/n) and get and incredible difference on band speed (~40mbps against ~300mbps, measured with <a href="http://speedtest.net/">speedtest</a> in the same place). The Atheros card works perfectly with free drivers and firmware. <a href="https://www.reddit.com/r/libreboot/comments/bdrlwe/best_wifi_card_for_a_t400/">https://www.reddit.com/r/libreboot/comments/bdrlwe/best_wifi_card_for_a_t400/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*OJW-hD3rQC7en170yNdQFA.jpeg" /><figcaption>Atheros AR5BXB112 AR9380 (a/g/n)</figcaption></figure><p>For the Bluetooth daughter card, I followed the McDonnell’s guide to upgrade from Bluetooth 2.2 to Bluetooth 4.0 (60Y3303).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*JQlL42eDd8CCMwCEVfno9Q.png" /><figcaption>Bluetooth daughter card</figcaption></figure><p>The most expensive modification I made, it was the replacement of the 1280x800 CCFL screen with a 1440x900 LED screen (LTN141BT04). <a href="https://www.panelook.com/LTN141BT04-002_Samsung_14.1_LCM_overview_24142.html">https://www.panelook.com/LTN141BT04-002_Samsung_14.1_LCM_overview_24142.html</a></p><p>You have to know that besides from buying your new screen, you will need a new cable for your LED screen and a new inverter (LED indicators). Just search LCD Cable for LED (PN: 93P4592) and LED inverter (42W7949).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*uvMyFdVGGt3l_p4Q27z4tw.png" /><figcaption>LCD Cable (PN: 93P4592)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*ATvhAbKUz_m0mAwz0PuoEg.png" /><figcaption>LED inverter (42W7949)</figcaption></figure><p>I added a Caddy for a second SSD in place of my Multi DVD reader, but you have to look specifically for a model that fits in the Optibay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*SC-a2uDhufZMAPM1ogwzoQ.png" /><figcaption>Caddy</figcaption></figure><p>This model only have USB 2.0 and no SD card slot.</p><p>No problem, I ordered 2 Express Card for resolve that issue. One for USB 3.0 and the other for read SD Cards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*58vs-NVhdIqDfNHhYESBcg.png" /><figcaption>2 port USB 3.0</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*iwYkkYJKhuHcR6j4rw1GLQ.png" /><figcaption>SD card reader</figcaption></figure><p>I use Lenovo ThinkPad Advanced Mini-Dock Port Replicator (250410U) to connect my 2 screens and my PS/2 keyboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_K3GrrtsC3bsE_UIA3eq2Q.jpeg" /><figcaption>Mini-Dock (250410U)</figcaption></figure><p>For GNU/Linux users, you can be able to do Libreboot (<a href="https://libreboot.org/">https://libreboot.org/</a>). Actually, T400 and T400s were the last Thinkpad models to accept this BIOS mod.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0gF_T9mXbD2qbU0KUNMH3Q.jpeg" /><figcaption>FREE AS IN FREEDOM</figcaption></figure><p>I don’t do Libreboot, because I gotta dual boot. In my main SSD Debian 11 (for work), and in my other SSD Windows 10 (for playing games). When you do Libreboot, you cannot run Windows on a Libre system.</p><p>In the next publication, I will show you how I successfully play games in this machine with a eGPU (external GPU).</p><p>Hope it will be useful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce95237fbb90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy your Django App to Heroku with PostgreSQL]]></title>
            <link>https://python.plainenglish.io/deploy-your-django-app-to-heroku-with-postgresql-eb365ec5eaef?source=rss-3b4cb9c967c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb365ec5eaef</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[heroku]]></category>
            <dc:creator><![CDATA[sebdur]]></dc:creator>
            <pubDate>Fri, 09 Jul 2021 19:43:20 GMT</pubDate>
            <atom:updated>2022-08-27T20:04:54.903Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Ey2kcCiWJOqtq3v5iW_JHg.png" /></figure><p>Heroku is an awesome cloud platform (PaaS) that supports a lot of programming languages, among those we can find Python.</p><p>In production environments we can’t use SQLite3 as database engine, so we’ll switch to my favourite, PostgreSQL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*5N0IG8lg279FO8WNdo2Ftg.png" /></figure><p>You must have PostgreSQL installed locally.</p><p>If you don’t have it, check this link <a href="https://www.postgresql.org/download/">https://www.postgresql.org/download/</a> and download the current version, depending on your Operating System.</p><p>We’re going to use the test_app project what I did in this post:</p><p><a href="https://sebdur.medium.com/install-python-3-9-and-django-3-2-5-on-debian-10-ecb432e8774b"><em>Install Python 3.9 and Django 3.2.5 in Debian 10</em></a></p><p>First think we need to do is manually create a database with the same name of the project:</p><pre>$ psql<br>=# CREATE DATABASE test_app;<br>=# \q</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*IaaJ9iV76RQykW6mLlfUXw.png" /></figure><p>After that, we need to install all the necessary dependencies:</p><pre>$ pip3.9 install psycopg2<br>$ pip3.9 install gunicorn<br>$ pip3.9 install django-heroku</pre><p>When everything is installed, open the project with your favourite editor, delete the <strong>db.sqlite3</strong> file, create a new file in the root named Procfile and paste this line inside:</p><pre>web: gunicorn test_app.wsgi</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*2n8HXr8idsf5qfpugRNV_A.png" /></figure><p>Now, go to <strong>test_app/settings.py</strong> and add the following import statement to the top (after the comments):</p><pre>import django_heroku</pre><p>And paste this to the very bottom:</p><pre># Activate Django-Heroku.<br>django_heroku.settings(locals())</pre><p>On the same file, we must to change the DATABASES hash, because the script makes reference to the old database on sqlite3. Replace those lines with this:</p><pre>DATABASES = {<br>    &#39;default&#39;: {<br>        &#39;ENGINE&#39;: &#39;django.db.backends.postgresql_psycopg2&#39;,<br>        &#39;NAME&#39;: &#39;test_app&#39;,<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*DDnRw2GDX7bQwEO6PTmSWg.png" /></figure><p>Generate the requirements for deploy (MUST be exist), and run the server to probe the changes:</p><pre>$ cd test_app<br>$ pip3.9 freeze &gt; requirements.txt<br>$ python3.9 manage.py migrate<br>$ python3.9 manage.py runserver</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a9wxGUPD0xeZ_pIyn1WFYA.png" /><figcaption>Everything is OK</figcaption></figure><h3>Heroku</h3><p>To deploy our application, we need to use <a href="https://devcenter.heroku.com/articles/heroku-cli">The Heroku CLI</a>, and your personal Heroku Account. Check the official documentation of Heroku, it’s very clear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*T-65QI5qbSwjTexKwRkchw.png" /></figure><p>Also, we need to initialize Git on our project, add all archives and do the first commit:</p><pre>$ git init<br>$ git add .<br>$ git commit -m &quot;first commit&quot;</pre><p>Time to create our app and deploy to heroku:</p><pre>$ heroku create<br>$ git push heroku master</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YjHKVLiC8OjSXt9XMfWtFg.png" /><figcaption><a href="https://serene-ocean-29799.herokuapp.com/">https://serene-ocean-29799.herokuapp.com/</a></figcaption></figure><p>You should now be ready to get deep into the code!</p><p><em>More content at </em><a href="http://plainenglish.io/"><strong><em>plainenglish.io</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb365ec5eaef" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/deploy-your-django-app-to-heroku-with-postgresql-eb365ec5eaef">Deploy your Django App to Heroku with PostgreSQL</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install Python 3.9 and Django 3.2.5 on Debian 10]]></title>
            <link>https://python.plainenglish.io/install-python-3-9-and-django-3-2-5-on-debian-10-ecb432e8774b?source=rss-3b4cb9c967c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecb432e8774b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[debian-10]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[sebdur]]></dc:creator>
            <pubDate>Thu, 08 Jul 2021 02:17:20 GMT</pubDate>
            <atom:updated>2021-07-16T04:44:16.182Z</atom:updated>
            <content:encoded><![CDATA[<h3>Install Python 3.9 and Django 3.2.5 in Debian 10</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*5947yHJN908t2yP8nfJ1cg.png" /><figcaption>Photo by <a href="https://www.instagram.com/nessie_fi/">@nessie_fi</a></figcaption></figure><p>By default, the last version of Debian Buster (10.10) it comes with Python version 2.7.16 and version 3.7.3. You can check it with these commands:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*jkuut2_LjtL47N7ER-i5UQ.png" /></figure><p>I preferred not to touch these versions to avoid any conflict with a default dependency. So, let’s get started.</p><p>Install all the necessary dependencies:</p><pre>$ sudo apt update<br>$ sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev</pre><p>Execute these lines, one by one, to <a href="https://www.python.org/downloads/source/">Download</a> the tarball of the last version of Python, in this case the version is Python-3.9.6:</p><pre>$ wget <a href="https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz">https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz</a><br>$ tar -xf Python-3.9.6.tgz<br>$ cd Python-3.9.6<br>$ ./configure --enable-optimizations</pre><p>Next step, start the build process (it takes a few minutes):</p><pre>$ make -j 2</pre><p>After the build process finish, run this command (we’re using altinstall instead of install because later will overwrite the default system python3 binary):</p><pre>$ sudo make altinstall</pre><p>It’s time to corroborate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*gPDeAy-IfIwbQ_lrWOnpyA.png" /></figure><h3>Django</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*N5hd8O4MRL-SUZUtAtmg5g.png" /></figure><p><a href="https://www.djangoproject.com/"><em>Django</em></a><em> is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.</em></p><pre>$ sudo pip3.9 install django</pre><p>Corroborate it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*89ZplZFrJ2so_lHDZ474Fw.png" /></figure><p>Create a test project:</p><pre>$ django-admin startproject test_app<br>$ cd test_app<br>$ python3.9 manage.py migrate<br>$ python3.9 manage.py runserver</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RKKyNPKB3m7jVhheWUliZQ.png" /><figcaption><a href="http://127.0.0.1:8000/">http://127.0.0.1:8000/</a></figcaption></figure><p>Hope you found this useful!</p><p><em>More content at </em><a href="http://plainenglish.io/"><strong><em>plainenglish.io</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecb432e8774b" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/install-python-3-9-and-django-3-2-5-on-debian-10-ecb432e8774b">Install Python 3.9 and Django 3.2.5 on Debian 10</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clean and optimized Jekyll 4 with Bootstrap 5]]></title>
            <link>https://sebdur.medium.com/clean-and-optimized-jekyll-4-with-bootstrap-5-e729af40ad1?source=rss-3b4cb9c967c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e729af40ad1</guid>
            <category><![CDATA[scss]]></category>
            <category><![CDATA[jekyll]]></category>
            <category><![CDATA[bootstrap-5]]></category>
            <dc:creator><![CDATA[sebdur]]></dc:creator>
            <pubDate>Fri, 26 Mar 2021 22:57:22 GMT</pubDate>
            <atom:updated>2026-07-28T06:46:27.595Z</atom:updated>
            <content:encoded><![CDATA[<h3>Jekyll 4 with Bootstrap 5</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*SY-9VBHqN-jrnzowW2zPBg.png" /></figure><p>Jekyll is an awesome tool, but by default it’s missing some things that we’ll cover on this document.</p><p>First thing: install jekyll <a href="https://jekyllrb.com/">https://jekyllrb.com/</a></p><p>Open the terminal and get ready.</p><p><strong>Create new empty project</strong></p><pre>$ jekyll new jekyllbs5 --blank<br>$ cd jekyllbs5<br>$ bundle init<br>$ sudo nano Gemfile</pre><p>Replace #gem &quot;rails&quot; with gem &quot;jekyll&quot; like in the image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*X5atZK5DDHNOE-KlM-bzTg.png" /></figure><p>Ctrl+O and Enter to save.</p><p>Ctrl+X to exit nano.</p><p>And do the bundle:</p><pre>$ bundle</pre><p>Start server:</p><pre>$ jekyll s</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*NbgGDMPBV1USF9T_GMIaug.png" /><figcaption><a href="http://localhost:4000/">http://localhost:4000/</a></figcaption></figure><p>Now, open the project with your favorite editor and do the next steps:</p><p><strong><em>1.-</em> </strong>Remove index.md and create a new file index.html in root.</p><p>Copy/paste this on the first line in index.html file:</p><pre>---<br>layout: default<br>title: Home<br>---</pre><p><strong><em>2.-</em> </strong>Remove all the unnecessary folders. _data, _drafts, _posts, _sass and assets/css</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*349LRfujGyNd1zlZZG5dBw.png" /><figcaption>After the clean</figcaption></figure><p><strong><em>3.-</em> </strong>Download the amazing penibelst’s html compressor for jekyll, because by default it doesn’t bring one.</p><p><a href="https://github.com/penibelst/jekyll-compress-html/releases/tag/v3.1.0">https://github.com/penibelst/jekyll-compress-html/releases/tag/v3.1.0</a></p><p>Download compressor.html file and copy/paste it inside the _layouts folder.</p><p>Go to _layouts/default.html and add this on the first line of the file:</p><pre>---<br>layout: compressor<br>---</pre><p>Need more information about this compressor? <a href="http://jch.penibelst.de/">http://jch.penibelst.de/</a></p><p><strong><em>4.- </em></strong>Taking advantage of the fact that we have the penibelst’s compressor, we’ll load main.scss file inside the &lt;head&gt; tag.</p><p>Replace the default scss calling for the new one.</p><p>The entire _layouts/default.html</p><pre>---<br>layout: compress<br>---</pre><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;{{ site.lang | default: &quot;en-US&quot; }}&quot;&gt;<br>  &lt;head&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;<br>    &lt;meta charset=&quot;utf-8&quot;&gt;<br>    &lt;title&gt;{{ page.title }} - {{ site.title }}&lt;/title&gt;<br>    &lt;style type=&quot;text/css&quot;&gt;<br>    {% capture include_to_scssify %}<br>    {% include main.scss %}<br>    {% endcapture %}<br>    {{ include_to_scssify | scssify }}<br>    &lt;/style&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    {{ content }}<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>Create a new file main.scss in _includes folder.</p><p>Open _includes/main.scss and change the background-color:</p><pre>body {<br>  background-color: #000;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*CR7PzVSaRu0sI_HV-UWDMw.png" /><figcaption>Everything’s OK</figcaption></figure><p><strong><em>5.-</em></strong> Create a new folder in assets named js</p><p>In assets/js create a new file main.js</p><p>Create a new file footer.html in _includes folder.</p><p>Open _includes/footer.html add the script tag pointing to your main.js file:</p><pre>&lt;script src=&quot;./assets/js/main.js&quot;&gt;&lt;/script&gt;</pre><p>At last, do the include after the content, in the &lt;body&gt; tag in _layouts/default.html</p><pre>&lt;body&gt;<br> {{ content }}<br> {% include footer.html %}<br>&lt;/body&gt;</pre><p><strong>Bootstrap 5</strong></p><p>Go to <a href="https://getbootstrap.com/">https://getbootstrap.com</a></p><p>For this project, we’re gonna load BS5 via CDN.</p><p>“Why? We could download it and include in the project”</p><p>That’s right, but without Popper.js. They no longer have a downloadable file.</p><p>“NPM modules?”</p><p>Total overkill…</p><p>So, CDN is not a bad alternative.</p><p>Add the css link tag in &lt;head&gt; before the main.scss include, and the script tag (with Popper.js) in _includes/footer.html before the main.js include.</p><p>To try if everything goes OK, we can run our traditional Tooltips test.</p><p>Go to index.html and copy/paste the tooltips example from Bootstrap 5 documentation, inside a div with the class tooltips:</p><pre>---<br>layout: default<br>title: Home<br>---</pre><pre>&lt;div class=&quot;tooltips&quot;&gt;<br>  &lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data-bs-toggle=&quot;tooltip&quot; data-bs-placement=&quot;top&quot; title=&quot;Tooltip on top&quot;&gt;<br>    Tooltip on top<br>  &lt;/button&gt;<br>  &lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data-bs-toggle=&quot;tooltip&quot; data-bs-placement=&quot;right&quot; title=&quot;Tooltip on right&quot;&gt;<br>    Tooltip on right<br>  &lt;/button&gt;<br>  &lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data-bs-toggle=&quot;tooltip&quot; data-bs-placement=&quot;bottom&quot; title=&quot;Tooltip on bottom&quot;&gt;<br>    Tooltip on bottom<br>  &lt;/button&gt;<br>  &lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data-bs-toggle=&quot;tooltip&quot; data-bs-placement=&quot;left&quot; title=&quot;Tooltip on left&quot;&gt;<br>    Tooltip on left<br>  &lt;/button&gt;<br>&lt;/div&gt;</pre><p>Go to _includes/main.scss and center the div:</p><pre>body {<br>  background-color: #000;<br>}</pre><pre>.tooltips {<br>  text-align: center;<br>  line-height: 100vh;<br>}</pre><p>Open assets/js/main.js and copy/paste this code to enable tooltips everywhere:</p><pre>var tooltipTriggerList = [].slice.call(document.querySelectorAll(&#39;[data-bs-toggle=&quot;tooltip&quot;]&#39;))<br>var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {<br>  return new bootstrap.Tooltip(tooltipTriggerEl)<br>})</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*ltYnPLBzd1Ltb6haMOrutA.png" /><figcaption>Voila!</figcaption></figure><p>That’s all folks.</p><p>Enjoy it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e729af40ad1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rails 6 + Bootstrap 5]]></title>
            <link>https://sebdur.medium.com/rails-6-bootstrap-5-16d8cddcba85?source=rss-3b4cb9c967c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/16d8cddcba85</guid>
            <category><![CDATA[yarn]]></category>
            <category><![CDATA[webpack4]]></category>
            <category><![CDATA[vanillajs]]></category>
            <category><![CDATA[rails-6]]></category>
            <category><![CDATA[bootstrap-5]]></category>
            <dc:creator><![CDATA[sebdur]]></dc:creator>
            <pubDate>Wed, 16 Dec 2020 21:45:06 GMT</pubDate>
            <atom:updated>2026-07-28T06:43:58.325Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*9yHFxwSGhij0vZiddEtv1g.png" /></figure><p>Bootstrap v5.0.0-beta1 was released 10 days ago, and some new awesome features are included. As we’re used to, the docs are very clear.</p><p>You can check the new stuff <a href="https://getbootstrap.com/">https://getbootstrap.com/</a></p><p>In my opinion, the big thing about v5 is the removal of jQuery as a dependency.</p><p>Since 2017, Rails 5.1 was already removed the dependency of jQuery.</p><p>So, that’s the way.</p><p>Specially for me, it meant an extreme change in my JS code, because I get used to handling the DOM with jQuery.</p><p>jQuery is deprecated for many reasons, but it’s not the purpose of my post. You can read this reference in case you’re interested <a href="https://modernweb.com/replacing-jquery-with-vanilla-javascript/">https://modernweb.com/replacing-jquery-with-vanilla-javascript/</a></p><p>In my case, after reading and learning about other JS libraries or frameworks, such as TS, Vue.js, Angular, React…I decided to migrate my jQuery code to Vanilla JS (or Plain JS) for DOM manipulation, because the syntax looks a lot like jQuery (but, in general, it’s very different), and I was excited about the idea of working with the language that browsers read directly, without doing it through a JS library.</p><p>Cominciamo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*tmL2X_ryS3hkQMSp3Y9zQQ.png" /><figcaption>Versions</figcaption></figure><p><strong>Create new project</strong></p><pre>$ rails new railsbs -d postgresql<br>$ cd railsbs<br>$ rails g controller Home index<br>$ rails db:create db:migrate</pre><p>In config/routes.rb<strong> </strong>replace <strong>get ‘home/index’</strong> with <strong>root</strong> <strong>‘home#index’</strong></p><p>Start server:</p><pre>$ rails s</pre><figure><img alt="Everything’s OK." src="https://cdn-images-1.medium.com/max/1024/1*R5wBOFce0BpQReZF2OLHlg.png" /><figcaption>Everything’s OK.</figcaption></figure><p>Next step, install Bootstrap via yarn (and popper.js as dependency)</p><p>Run this command:</p><pre>$ yarn add bootstrap @popperjs/core</pre><p>When the installation is finished, you need to import bootstrap.scss (located in node_modules folder) through app/javascript/packs/application.js</p><p>First, we must use the stylesheet_pack_tag in the application layout app/views/layouts/application.html.erb and don’t forget to include the responsive &lt;meta&gt;</p><p>Your &lt;head&gt; tag it should be like this:</p><pre>&lt;head&gt;<br>  &lt;title&gt;Railsbs&lt;/title&gt;<br>  &lt;%= csrf_meta_tags %&gt;<br>  &lt;%= csp_meta_tag %&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1, shrink-to-fit=no&quot;&gt;<br>  &lt;%= stylesheet_link_tag &#39;application&#39;, media: &#39;all&#39;, &#39;data-turbolinks-track&#39;: &#39;reload&#39; %&gt;<br>  &lt;%= stylesheet_pack_tag &#39;application&#39;, media: &#39;all&#39;, &#39;data-turbolinks-track&#39;: &#39;reload&#39; %&gt;<br>  &lt;%= javascript_pack_tag &#39;application&#39;, &#39;data-turbolinks-track&#39;: &#39;reload&#39; %&gt;<br>&lt;/head&gt;</pre><p>To create a new folder app/javascript/stylesheets and add file app/javascript/stylesheets/application.scss run this:</p><pre>$ mkdir -p app/javascript/stylesheets<br>$ touch app/javascript/stylesheets/application.scss</pre><p>Open the .scss file, and paste this line over the top of the file (line 1):</p><pre>@import &quot;bootstrap&quot;;</pre><p>By doing this, you’ll put your stylesheets in app/javascript/stylesheets folder, so that they can be handled through Webpack.</p><p>Now, we need to go to app/javascript/packs/application.js</p><p>We will define the ‘bootstrap’ in global scope, and declare the require to our new application.scss file.</p><p>Your application.js it should be like this:</p><pre>require(&quot;<a href="http://twitter.com/rails/ujs">@rails/ujs</a>&quot;).start()<br>require(&quot;turbolinks&quot;).start()<br>require(&quot;<a href="http://twitter.com/rails/activestorage">@rails/activestorage</a>&quot;).start()<br>require(&quot;channels&quot;)<br>require(&quot;stylesheets/application.scss&quot;)</pre><pre>window.bootstrap = require(&quot;bootstrap&quot;);</pre><p>To prove it, I will add some tooltips.</p><p>In the same application.js file, you can enable tooltips everywhere (don’t forget to use document.addEventListener(&#39;turbolinks:load&#39;, () =&gt; {}); , to avoid conflicts with turbolinks).</p><pre>require(&quot;<a href="http://twitter.com/rails/ujs">@rails/ujs</a>&quot;).start()<br>require(&quot;turbolinks&quot;).start()<br>require(&quot;<a href="http://twitter.com/rails/activestorage">@rails/activestorage</a>&quot;).start()<br>require(&quot;channels&quot;)<br>require(&quot;stylesheets/application.scss&quot;)</pre><pre>window.bootstrap = require(&quot;bootstrap&quot;);</pre><pre>document.addEventListener(&#39;turbolinks:load&#39;, ()=&gt; {<br>  var tooltipTriggerList = [].slice.call(document.querySelectorAll(&#39;[data-bs-toggle=&quot;tooltip&quot;]&#39;))<br>  var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {<br>    return new bootstrap.Tooltip(tooltipTriggerEl)<br>  })<br>});</pre><p>In app/views/home/index.html.erb you can copy/paste some tooltips from <a href="https://getbootstrap.com/docs/5.0/components/tooltips/">https://getbootstrap.com/docs/5.0/components/tooltips/</a> and then start the server.</p><pre>&lt;h1&gt;Home#index&lt;/h1&gt;<br>&lt;p&gt;Find me in app/views/home/index.html.erb&lt;/p&gt;</pre><pre>&lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data-bs-toggle=&quot;tooltip&quot; data-bs-placement=&quot;top&quot; title=&quot;Tooltip on top&quot;&gt;<br>  Tooltip on top<br>&lt;/button&gt;<br>&lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data-bs-toggle=&quot;tooltip&quot; data-bs-placement=&quot;right&quot; title=&quot;Tooltip on right&quot;&gt;<br>  Tooltip on right<br>&lt;/button&gt;<br>&lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data-bs-toggle=&quot;tooltip&quot; data-bs-placement=&quot;bottom&quot; title=&quot;Tooltip on bottom&quot;&gt;<br>  Tooltip on bottom<br>&lt;/button&gt;<br>&lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data-bs-toggle=&quot;tooltip&quot; data-bs-placement=&quot;left&quot; title=&quot;Tooltip on left&quot;&gt;<br>  Tooltip on left<br>&lt;/button&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwsS7UaEnROUblD3RDfUlQ.png" /><figcaption>Voila!</figcaption></figure><p><strong>ONE MORE THING</strong></p><p>In bootstrap documentation, specifically in <a href="https://getbootstrap.com/docs/5.0/getting-started/download/#npm">downloads/npm</a>, they suggest you to add const bootstrap = require(&#39;bootstrap&#39;) or import bootstrap from &#39;bootstrap&#39; in your app/javascript/packs/application.js instead of my solution line window.bootstrap = require(&quot;bootstrap&quot;)</p><p>I did it on this way, because by doing this, you can declare the variable in global scope, that’s allow us to use it in the entire project. For example, if you use UJS (remote: true), when you do the respond_to via format.js and need to create a new bootstrap component, like a modal, you couldn’t do it with const bootstrap = require(&#39;bootstrap&#39;) (console would print something like: bootstrap variable doesn’t exist).</p><p>That’s all, thanks for reading.</p><p>Enjoy it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16d8cddcba85" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>