teleren/devto huggingface dataset:
Progress Update: Advancing Towards the Finish Line
Tags: webdev, javascript, beginners, programming
Published: 2023-05-13 23:44:34

Day 103 of #365DaysOfCode and another step forward in my project. Today, I completed the implementation of the dislike and undo button functionality for all user types. Starting tomorrow, I will begin working on OAuth 2.0. I’m closing in on the finish line! Exciting times lie ahead as I approach the final stages of my project.

In parallel, my #100DaysOfPython journey continues on Day 3. As part of the course curriculum, I built two practical projects — a tip calculator and a program that calculates the remaining days, weeks, and months of one’s life. Memento mori! (Am I right Angela Yu?)

I’m really looking forward to diving into the next modules of this Python course! I can’t wait to see all the cool things I can do with Python in different areas, like machine learning and AI. It’s going to be so much fun!

Keep an eye out for more updates on my project and Python adventure! I’ll be sharing all the ups and downs, challenges, and learning experiences as I go. So stay tuned!
Além dos Números: A Relação entre Matemática e Programação
Published: 2023-05-13 23:20:55

## Introdução

Sobre a boa e velha: **“preciso ser bom em matemática para ser programador?”** Em princípio, todos alegam que a resposta para essa pergunta é negativa. Mas não é esse o rumo que eu quero tomar neste momento, nem ser tão breve em dar uma resposta simplista a uma pergunta que guarda dentro de si algumas particularidades.

O que pretendo é demonstrar um novo ponto de vista a respeito dessa questão, sem a menor intenção de esgotar o tema, a despeito de algumas objeções que muitos possuem em relação ao mesmo. 


## A Verdade por Trás do "Você gosta de matemática?"


Minha reflexão partiu dessa pergunta.

Como dizem: **“gostar é uma palavra muito forte!”**

Para mim isso soa como: “Você gosta da Lei da Gravidade?”. Simplesmente a aceito como parte essencial da nossa existência, e que se não fosse por ela, provavelmente não estaríamos aqui. Logo, não digo que “gosto”, mas aceito e compreendo a sua necessidade em meio ao caos que é a existência.

## Abrindo caminho

Assim sendo, seria interessante tentar quebrar esses concretos que insistem em enrijecer nossa visão sobre a matemática. Primeiro, matemática não é só X, Y, Z, números e toda aquela salada de fórmulas que parecem não ter nem pé nem cabeça. Matemática também se estende ao âmbito da lógica e do pensamento abstrato. E é aí que começamos a construir a ponte que liga matemática à programação.

Programadores criam algoritmos, que nada mais são do que a estruturação de procedimentos, etapas e tarefas necessárias para se resolver um problema. Isso é feito através de raciocínio lógico. Te lembra alguma coisa? Espero que sim.

Aliás, a ligação é tanta que não seria anacrônico ou equivocado da minha parte chamar o conceito de “Algoritmo de Pitágoras”, ou “Algoritmo de Bháskara”. As temidas fórmulas nada mais são que algoritmos. Você tem medo de seguir regras?

Você chega na prova e lhe pedem para achar as raízes de X. “Meu Deus, como vou resolver isso?” Ora, a própria matemática lhe fornece o algoritmo — os passos necessários — para resolver o problema! Essa perspectiva mudou minha relação com a matemática permanentemente. Agradeça a Pitágoras por já ter inventado o algoritmo; você só precisa segui-lo à risca para encontrar a resposta para o seu problema.

## Concluindo
A essa altura já deve ter ficado claro que, no meu ponto de vista, matemática é, sim, necessária ao programador. Ao invés de encarar a matemática como um obstáculo a ser superado, prefiro encará-la como uma ferramenta valiosa que impulsiona nosso potencial criativo e inovador. Não permita que traumas passados cerceiem sua capacidade de evoluir.

> "Matemática é o alfabeto com o qual Deus escreveu o universo." - Galileu Galilei
When FTP Stands for -Frustrating Transfer Problem
Tags: ftp, vpn, networking, pfsense
Published: 2023-05-13 22:48:15


Let's talk about FTP file transfers, shall we? Picture this: A typical day, armed with FileZilla (for adhoc testing) and a Ruby script employing `Net::FTP gem`, tasked with the simple job of uploading files to a remote ProFTPD server. Sounds like a snooze-fest, right? Oh, how wrong you'd be!

In the office, everything was smooth sailing. File uploads were as effortless as breathing. But from home, connected through OpenVPN, I was greeted with an error so cryptic it might as well have been written in hieroglyphics: `Net::FTPTempError: 450 Transfer aborted. Link to file server lost.`

And so began my descent into the swirling vortex of troubleshooting. pfSense firewall settings, NAT configurations, FTP server settings—everything was under scrutiny. 

###5 hours in...

Tried every trick in the book: switching between active and passive FTP, peering into the soul of the OpenVPN configuration, allowing ALL traffic between LAN & OpenVPN (a big no-no), trying every possible permission configuration, ProFTPd config changes, even blaming poor FileZilla for a hot second. But alas! I was no closer to a solution.

Yes. This too was not out of the question.

{% embed https://www.youtube.com/embed/p85xwZ_OLX0 %}

Oh, and let's not forget the ghost files! Every failed attempt at uploading a file would result in the creation of a zero-sized file on the server. It was like the server was pointing and laughing at me, creating an empty shell of a file, a cruel reminder of my predicament.

Just when I was about to call it a day and accept defeat, I stumbled upon a tidbit of advice: _"Some VPN configurations may have compression enabled, which can cause issues with certain types of traffic. You can try disabling compression on your OpenVPN configuration to see if it resolves the issue."_ I thought to myself, "Could it be that simple?"

But wait! Plot twist! **My OpenVPN configuration already had compression disabled.** So, in an act of sheer desperation, I decided to go against the grain. I enabled compression, held my breath, and... Eureka! It worked. I kid you not. It worked faster too!

So there you have it, folks. The thrilling saga of FTP troubleshooting, where the hero turns out to be the unsuspecting compression feature, the very thing that was supposedly the villain of the piece. Just goes to show, when it comes to networking, expect the unexpected.

If there's a moral to this story, it's this: The answer might not always be where you expect it to be. And sometimes, you just gotta switch things on instead of off. So, here's to more head-scratching adventures in the world of IT. Because let's face it, we wouldn't have it any other way! Happy troubleshooting!
Join my wild Cloud Computing journey at SheCodeAfrica! I'll share all the ups and downs as a newbie. Fasten seatbelts and enjoy!
Tags: shecodeafrica, cloudskills, cloudschool, azure
Published: 2023-05-13 22:21:38

Hey there, fellow explorers! I'm thrilled to share my exhilarating journey through the cloud at SheCodeAfrica. In just seven short weeks, I've uncovered the secrets of cloud computing and how it powers various applications. Ready to embark on this adventure with me? Let's dive into what I've discovered!

##Week 1: The Basics
I started with the basics of cloud computing and learned how it differs from local servers. I also discovered the various cloud service and deployment models, including IaaS, PaaS, SaaS, public, private, hybrid, and multi-cloud. Exciting stuff!

##Week 2: Service Models
Next, I explored the three cloud service models in detail. I learned how IaaS provides infrastructure resources on demand, PaaS offers a platform for developing and deploying apps, and SaaS delivers software over the internet on a subscription basis.

##Week 3: Deployment Models
In week three, I got to know the different deployment models available. From the public cloud that's open to everyone to the private cloud used by single organizations and the hybrid/multi-cloud that combines multiple providers - I now know which one to choose for my projects!

##Week 4: Security
Things got serious in week four as I learned about the various security measures to keep data secure in the cloud. From firewalls to data encryption, access control to identity and access management (IAM), I've got a solid foundation on how to keep my data safe.

##Week 5: Virtualization
Week five was all about virtualization. I found out how to create multiple virtual instances of a physical server, which is a smart way to utilize resources and ensure flexibility in the cloud.

##Week 6: Containers
In week six, I learned about containers and how they provide a lightweight, portable way to package apps and their dependencies. This made app deployment and management in the cloud so much easier.

##Week 7: Serverless Computing
In the final week, I discovered the magic of serverless computing - running code in the cloud without the hassle of server management. This frees up developers to focus solely on coding and not get bogged down with managing servers.

After spending seven weeks at SheCodeAfrica, I can confidently say that I've gained a wealth of knowledge about cloud computing. From the basics of cloud computing to understanding deployment models, security measures, virtualization, containers, and serverless computing, I've learned so much. Although my journey is coming to an end, I still have a few classes left on Azure migration and microservices, which I'm looking forward to completing.

Now equipped with this newfound knowledge, I can't wait to dive into my upcoming projects and create amazing things in the cloud. I had a fantastic time sharing my journey with you, and I hope you had as much fun reading about it as I did experiencing it. Together, let's soar high in the cloud and explore all the exciting possibilities it has to offer!
Building a RESTful API with Node.js and MongoDB
Tags: webdev, node, api, mongodb
Published: 2023-05-13 22:18:30

Introduction:
RESTful APIs play a crucial role in web development, offering several benefits. This tutorial will guide you through the process of creating a RESTful API using Node.js and MongoDB.

Step 1: Project Setup
To begin, set up a new Node.js project. Install the necessary dependencies such as Express (a popular web framework for Node.js) and Mongoose (an object modeling tool for MongoDB).

Step 2: Defining the Data Model
Define the data model using Mongoose schema, which provides a way to represent data and its structure. Map the schema to MongoDB collections, enabling seamless interaction with the database.

Step 3: Implementing API Routes
Create routes for the API to handle various CRUD (Create, Read, Update, Delete) operations. Express and Mongoose make it easier to define and manage these routes efficiently.

Step 4: Testing the API
Ensure the API functions correctly by testing its endpoints. Tools like Postman allow you to make HTTP requests and interact with the API, verifying its functionality and response.

Step 5: Error Handling and Data Validation
Implement error handling mechanisms to catch and handle potential errors. Validate user input data to maintain data integrity and improve security.

Conclusion:
In conclusion, this tutorial has provided a comprehensive guide to building a RESTful API using Node.js and MongoDB. By following the steps outlined, you can create a powerful and efficient API that facilitates data manipulation and retrieval. Understanding RESTful API development with Node.js and MongoDB is essential for building robust web applications.


"Ready to geek out and level up your tech game? Follow my blog page for the latest tech trends, tips, and geeky delights!"
Creating a New User Account in Azure Active Directory
Tags: azure, beginners, cloud, cloudcomputing
Published: 2023-05-13 22:02:20

Azure is a cloud computing platform that offers developers and organisations a variety of services. Azure Active Directory (Azure AD), which provides identity and access management services, is one of the core services provided by Azure. This blog article will walk you through the process of creating an Azure user.

Before we begin, it is important to keep in mind that you will require an [Azure account](https://azure.microsoft.com/en-gb/free/) to complete this course. After you've created your account, go to the Azure [portal](http://portal.azure.com/) to get started.

## Step 1: Create a new Azure AD user
To create a new Azure AD user, you will first need to navigate to the Azure portal. From there, select the Azure Active Directory option from the left-hand menu. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fa8dk1m071rxadsuctm3.png)

This will take you to the Azure AD dashboard. Once you are on the Azure AD dashboard, click on the Users option from the left-hand menu. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wj43teeoe12ninqqct2l.png)

This will take you to the users page. Next, click on the "**_New User_**" button at the top of the page and select create new user.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3srczc8srsscvhba8ri6.png)

## Step 2: Fill in user details

You will need to fill in the user details. The required fields are: User principal name, display name and Password. After providing the necessary information, Click on "_**Review + Create**_"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/imymmc2sndfsh5cch4nw.png)

## Step 3: Review and create the user

Once you have reviewed the information, click on "_**create**_".

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4d2s0zcngkzag1yosk27.png)

## Step 4: Verify user account 

Refresh the user page to see the newly created user. The new user will now be able to log in to their newly created account using their credentials.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yoe8ndc5n158u03efaji.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dek98brqh19a2940nine.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sil6m7oufnz77ihvc2qd.png)

Creating an Azure user is a straightforward process. By following the steps outlined in this blog post, you can easily create a new Azure AD user
Using `git bisect` to find the faulty commit
Tags: git, debugging
Published: 2023-05-13 21:46:21

## Introduction

Yesterday I was working on a task and I made changes in a few files. When committing the changes, right before pushing them to a remote branch, I added a couple of more small changes, created a few more commits and done, pushed all the commits. When running the application again I got an error, which I couldn't identify which of the changes or commits was related to.
And that's when `git bisect` came across while I was trying to debug.

## What does the `git bisect` command do?

`git bisect` is a command in [Git](https://git-scm.com/docs/git-bisect) that helps find the commit that introduced a bug or caused a regression in your codebase. It uses a binary search algorithm to efficiently narrow down the range of commits to be examined. By marking specific commits as “good” or “bad”, `git bisect` automatically selects the next commit for testing until it identifies the exact commit that introduced the issue. This process helps identify the faulty commit more quickly and efficiently, enabling developers to pinpoint and fix the problem more effectively.

## An example on how to use it

Using the [GitLens extension in VSCode](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) I picked one of the previous commits guessing it didn’t contain any errors (you can use `git log` to do that as well), and to make sure it was working fine I checked out to that commit and ran the application from that point, checking if the error was there or not. Once it hasn’t any errors I decided to pick that commit to start to bisect.

So I **started** the `git bisect` with the flawed commit id - which was my last commit - to indicate it’s a bad commit:

`git bisect start <flawed_commit_id>`

Git will mark it as a bad commit and then expect for the id of a good commit. So I copied and pasted the id of that commit I ran previously to make sure it wasn’t broken in order to run the following command:

`git bisect good <good_commit_id>`

Git will now automatically checkout a commit in the middle of the range between the known good commit and the bad commit. This commit represents the midpoint of the binary search. So I was able to run my application using the returned commit to test if the application was already crashed or not, so that I could tell Git to mark the commit as good or bad using `git bisect good` or `git bisect bad`.

**Repeat the process:** Git will continue selecting commits for testing based on the binary search algorithm. You repeat the previous step by testing the code and telling Git to mark it as good or bad commit until you narrow down to the exact commit that introduced the bug.

**Finish the bisect:** Once you identify the faulty commit, you can run `git bisect reset` to exit the bisect mode and return to the latest commit.

## Conclusion

By systematically cutting down the range of commits through binary search, `git bisect` helps efficiently locate the faulty commit in your code history.
AWS Certified Developer – Associate
Tags: aws
Published: 2023-05-13 21:14:50

---
title: AWS Certified Developer – Associate
published: true
date: 2023-05-13 21:10:45 UTC
tags: AWS
canonical_url: https://jamienordmeyer.net/2023/05/13/aws-certified-developer-associate/
cover_image: https://jamienordmeyer.net/wp-content/uploads/2023/05/BlogBanner-Dev.png
---

And that’s two down! Last September (2022), I received my AWS Certified Solutions Architect – Associate certification. This last Wednesday, (5/10/2023), I received my AWS Certified Developer – Associate certification. Humorously, I thought that this exam was actually harder than the Solutions Architect exam… yet I scored higher on this exam than the first one. I’m guessing that it’s because going into the Developer exam, I already had the experience, and knew what to expect, whereas my exam for the Solutions Architect certification was the first AWS exam that I’d ever taken. Alas. It’s out of the way now. ![🙂](https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png)

I don’t currently care about getting any additional certifications at this point. So, I have a good 2 years or so before I need to start worrying about studying again. Woot!
Angular Template Driven Form
Published: 2023-04-09 16:39:33

Angular Forms are a powerful feature of the Angular framework that allow you to easily capture user input and validate it before submitting it to the server. There are two types of forms in Angular: Template-driven forms and Reactive forms.

Template-driven forms use directives to bind form controls to properties on a model object. They are easy to use and require less boilerplate code. Here is an example of a template-driven form in Angular:

```
<form #myForm="ngForm" (ngSubmit)="onSubmit(myForm.value)">
  <label>
    Name:
    <input type="text" name="name" ngModel required>
  </label>
  <label>
    Email:
    <input type="email" name="email" ngModel required>
  </label>
  <button type="submit">Submit</button>
</form>
```

In this example, we have a simple form that asks the user for their name and email address. The ngForm directive is used to create a form instance, and the ngModel directive is used to bind form controls to properties on the component. The required attribute is used to ensure that the form controls are not empty.

The ngSubmit event is used to handle the form submission. When the user clicks the Submit button, the onSubmit method is called with the form value as an argument.

Here is an example of how to handle the form submission in the component:

```
import { Component } from '@angular/core';

@Component({
  selector: 'my-app',
  template: `
    <form #myForm="ngForm" (ngSubmit)="onSubmit(myForm.value)">
      <label>
        Name:
        <input type="text" name="name" ngModel required>
      </label>
      <label>
        Email:
        <input type="email" name="email" ngModel required>
      </label>
      <button type="submit">Submit</button>
    </form>
  `,
})
export class AppComponent {
  onSubmit(formData) {
    console.log(formData);
    // Do something with the form data
  }
}
```

In this example, the onSubmit method is called with the form data as an argument when the user clicks the Submit button. You can then use this data to perform some action, such as sending it to the server.

Overall, template-driven forms are easy to use and require less boilerplate code, but they have some limitations when it comes to complex forms. Reactive forms, on the other hand, are more powerful and flexible, but require more code to set up.
Why should you use IMDSv2 and not IMDS on AWS EC2
Tags: ec2, aws, security, devops
Published: 2023-05-13 20:34:58


The Instance Metadata Service (IMDS) is a feature of Amazon Web Services (AWS) Elastic Compute Cloud (EC2) instances that provides a way for EC2 instances to learn about themselves and their environment. Instance Metadata Service (IMDS) allows you to access data about your ec2 instance which you can use to configure or manage a running instance:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xjsyazcoapa8hg6vnd12.JPG)

 
There are two versions of IMDS: IMDSv1 and IMDSv2.

IMDSv2 is the latest version of the service and was introduced to address several security concerns with IMDSv1. Unlike IMDSv1, **IMDSv2 is protected by a session token** that is obtained using instance credentials, making it much more secure. 

Important information about IMDSv2:
- There is no limit to the number of tokens.
- There is no limit to the number of sessions.
- The new version is still limited by normal IMDS connection and throttling limits.
- Sessions can last up to six hours, that is, up to 21600 seconds


Let's go deeper, first **generate a token** with the following command:

```
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"`
```

Now you can **use the token**, for example with the following command:

```
curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/instance-id/
```

If you are interested in the topic, you will learn more about IMDS from my video:

{% embed https://youtu.be/91stm1cEIG4 %}
> [https://youtu.be/91stm1cEIG4](https://youtu.be/91stm1cEIG4)

or from my blog:
{% embed https://lepczynski.it/en/other/information-about-ec2-from-ec2-imds-imdsv2/ %}
> [https://lepczynski.it/en/other/information-about-ec2-from-ec2-imds-imdsv2/](https://lepczynski.it/en/other/information-about-ec2-from-ec2-imds-imdsv2/)