teleren/devto huggingface dataset:
Autenticação REST via API KEY em Golang
Published: 2024-07-05 10:00:13

A autenticação por chave de API (API key) é uma abordagem simples e eficaz para proteger suas aplicações REST.

# Passos para Autenticação via Chave de API

1. **Criação de um Middleware de Autenticação**:
   - O middleware intercepta as requisições HTTP, captura os cabeçalhos necessários e valida as chaves de API.

2. **Captura dos Cabeçalhos da Requisição**:
   - **X-API-KEY**: Chave de API que autentica a requisição.
   - **X-User-ID**: Identificador do usuário associado à chave de API.

3. **Validação das Chaves**:
   - O middleware verifica se os valores dos cabeçalhos correspondem aos valores armazenados em uma estrutura segura.

# Vantagens

- **Armazenamento Seguro**: Ideal para ambientes de produção, especialmente em aplicações governamentais, onde as chaves de API são armazenadas em uma base de dados segura para garantir melhor governança e controle.
- **Simples e Eficiente**: Oferece uma camada adicional de segurança com mínima sobrecarga.

Essa abordagem protege suas requisições, garantindo que apenas usuários autenticados possam acessar os recursos da aplicação.

Código Fonte:
- https://github.com/ortizdavid/go-nopain/tree/main/httputils
- https://github.com/ortizdavid/go-nopain/blob/main/_examples/auth/api_key_user.go


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


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


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


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


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


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wpmdkgd9o1ted5dxdq2w.png)
Understand DI Containers: Intro
Tags: ioc, depenedencyinjection, javascript, csharp
Published: 2024-07-05 09:59:37

---
series: DI Containers made simple. 
---


I’m excited to start this new series and dig deeper into dependency injection!! 

We are going to use JavaScript and C# in this series.

After this tutorial we will have a solid understanding of DI Containers and be able to adopt our knowledge when we work with frameworks like `.Net`, `Spring Boot` and `Nest.JS` etc 😎. 

## What we will learn. 

* What is Dependency Injection.
* What are interfaces.
* Create a `DI Container from scratch` with different life cycles using JavaScript. 
* Use the DI Container in .NET. 

We are going to take it one step at the time, stay tuned!
What is toxicology drug testing?
Published: 2024-07-05 09:59:34


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdpq7kdq1gqty65uj88d.jpg)Toxicology drug testing is a process of analyzing biological samples, such as urine, blood, or hair, for the presence or absence of specific drugs or their metabolites (breakdown products). Drug testing can detect both legal and illegal drugs, such as alcohol, opioids, cocaine, marijuana, amphetamines, and more.https://mycarelabs.com/
Integrate LLMs into spaCy NLP Pipeline
Tags: llm, spacy, nlp, ai
Published: 2024-07-05 09:40:50

To leverage the power of LLM models in NLP workflows, need to integrate LLMs into the spaCy NLP pipeline. spaCy is a popular **[NLP library](https://www.codetrade.io/blog/the-battle-of-the-nlp-libraries-flair-vs-spacy/)** that offers robust tools for various language processing requirements.

Combining the strengths of spaCy with the flexibility of the LLM prompt using the **‘spacy-llm’** library helps to enhance NLP capabilities. 

Here let’s explore steps to know how to integrate LLMs into spaCy NLP pipeline.

## **Steps to Integration of LLMs into spaCy NLP Pipeline**


![Steps to Integration of LLMs into spaCy NLP Pipeline](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x3zdo4709kbvigyocrkh.png)

For the integration of LLMs into spaCy we use the spaCy-llm library. Our **[AI and ML software development](https://www.codetrade.io/ai-ml-development/)** experts provide a complete example of LLM provider OpenAI. (We can also use other LLMs compatible APIs to execute this example).

**Step 1:** **Install Required Libraries**
Ensure the following libraries are installed in your Python environment.

```
$ pip install spacy
$ pip install spacy-llm
```

**Step 2:** **Import Necessary Modules**
For this example, we need to import spacy and os modules to execute the complete process.

```
import spacy
import os
```

**Step 3:** **Set Up Your LLM API Key**
If you intend to use a cloud-based LLM, obtain an API key from the provider (e.g., OpenAI) and set the OPENAI_API_KEY environment variable:

```
os.environ["OPENAI_API_KEY"] = "your_api_key"  # Replace with your actual key
```

**Step 4:** **Load a Blank spaCy Model (or Create a Custom One)**
Create a blank spaCy nlp object to serve as the foundation for your custom pipeline:

```
try:
    nlp = spacy.blank("en")
```

**Step 5:** **Create the NER Component and Add it to the Pipeline**
Extend the nlp pipeline by adding the llm_ner component using nlp.add_pipe().

```
llm_ner = nlp.add_pipe("llm_ner")
```

**Click the given link to read the full article in detail.**

**[Simple Way to Integrate LLMs into spaCy NLP Pipeline](https://www.codetrade.io/blog/simple-way-to-integrate-llms-into-spacy-nlp-pipeline/)**

---
Vegas 79 – Cá Cược Euro NẠP - RÚT 5 PHÚT
Published: 2024-07-05 09:33:33

Vegas 79 – Cá Cược Euro NẠP - RÚT 5 PHÚT 
Vstar79 Blog là website cá cược thể thao, bóng đá trực tiếp UY Tín nhất hiện nay, mới nhất 2024. Nạp - RÚT chỉ trong vòng 5 phút. Hoạt động về mảng cá cược trực tuyến cho đến nay hơn 10 năm, 
Xem thêm tại : https://vstar79.blog/

Đánh giá NHÀ CÁI VEGAS 79
Hoạt động về mảng cá cược trực tuyến cho đến nay hơn 10 năm, Vegas 79 đã cận kề được con số hơn Tỷ lệ người chơi đánh bạc, hàng ngày với hàng Tỷ lệ truy cập vào web mỗi ngày.
Chính vì thế đội ngũ nhân viên đã khảo sát qua từng dân chơi và đưa ra những ưu & nhược điểm của Vegas 79 cho mọi người tham khảo một cách khách quan nhất :
Ưu điểm Vegas79 :
+ Uy tín – Minh bạch – Bảo mật
+ Thương hiệu nhà cái đứng đầu tại Việt Nam
+ Giao diện đơn giản, dễ thao tác
+ Hệ thống game đa dạng, nhiều game độc ​​quyền trên Vegas 79
+ Rút tiền – Nạp tiền đa dạng dạng, xử lý nhanh
+ Hỗ trợ đa ngôn ngữ : Tiếng Anh, Tiếng Việt
+ CSKH nhiệt tình, nhanh chóng 24/7
Khuyết điểm Vegas 79 : 
+ Không quảng cáo rầm rộ, hạn chế dân chơi biết đến
+ Màu sắc website đơn thuần, không bắt mắt
+  m thanh, màu sắc trong game còn hạn chế
Nhà cái Vegas 79 phát triển đa nền tảng các thể loại cá cược đủ loại hình . Cá cược thông qua các môn thể thao lớn trên thế giới như cá cược bóng đá , cá cược bóng rổ hay game esports .
Các giải bóng đá có sự góp mặt của Vegas79 trong bản quyền xem free trực tuyến bao gồm
Xem bóng đá trực tiếp ngoại hạng Anh
Xem bóng đá trực tiếp La Liga
Xem bóng đá trực tiếp C1 – Champions League
Xem bóng đá trực tiếp vòng loại World Cup
Xem bóng đá trực tiếp Euro cấp Châu Lục
Các thể loại game có sự góp mặt của vegas79 bao gồm
Game bắn cá đổi thưởng
Game đánh bài đổi thưởng
Vegas Live Casino
Đá gà trực tiếp máu 67
Bắn cá nổ hũ club vip
Tất cả điểm nổi bật trên là một phần của hệ sinh thái trò chơi tại đây , nếu quan tâm hơn bạn có thể tận tình đến với những thể loại khác như 
Lô đề online
Soi cầu xổ số
Giải mộng giấc mơ
Deccan Odyssey Train: Where History Meets Modernity on Rails
Published: 2024-07-05 09:32:06

Imagine waking up to the gentle clickety-clack of train wheels, sunlight streaming through panoramic windows, and the majesty of a bygone era unfolding before your very eyes. This is the magic of the Deccan Odyssey train, a luxurious journey through India that seamlessly blends the rich tapestry of history with the unparalleled comfort of modern amenities.
History Unveiled: A Journey Through Time

Your Deccan Odyssey adventure begins as you delve into the heart of India’s historical legacy. The Golden Triangle, a must-see for any traveler, awaits with its iconic monuments. Here, you’ll stand in awe of the shimmering white marble of the Taj Mahal, a timeless testament to love. The Agra Fort, a powerful Mughal stronghold, whispers tales of emperors and battles. Fatehpur Sikri, a deserted yet magnificent city, offers a glimpse into the grandeur of a bygone era.

But the Deccan Odyssey’s journey doesn’t stop there. As you travel beyond the Golden Triangle, prepare to be further enchanted by a treasure trove of historical sites. The Ajanta and Ellora Caves, with their intricate carvings and frescoes, are a marvel of ancient Indian art. Hampi, the erstwhile capital of the Vijayanagara Empire, transports you back to a time of opulence and power. In Khajuraho, the magnificent temples, adorned with exquisite sculptures, stand as a testament to India’s artistic heritage.
A Modern Marvel on Rails: The Deccan Odyssey Experience

While steeped in history, the Deccan Odyssey train offers the ultimate in contemporary comfort. Imagine stepping into a palace on wheels. Your opulent cabin, complete with plush furnishings and a private bathroom, becomes your haven of relaxation. Fine dining experiences tantalize your taste buds with delectable Indian and international cuisines. An onboard spa provides a sanctuary of pampering, allowing you to unwind after a day of exploration.
Experiences Beyond Compare: Curated Tours and Local Immersion

The Deccan Odyssey train goes beyond sightseeing. Expertly curated tours and activities bring the past to life. Explore charming villages, embark on heritage walks through ancient cities, and witness captivating cultural performances. These immersive experiences provide a window into the soul of India, allowing you to connect with the warmth and vibrancy of its local life.
A Journey Like No Other

The Deccan Odyssey train is more than just a journey; it’s an experience that lingers long after the final whistle blows. It’s a chance to weave through the corridors of time, to marvel at architectural wonders, and to create memories that will be cherished forever.
Embark on Your Deccan Odyssey

Are you ready to embark on a voyage where history meets modern luxury? Visit the official website of the Deccan Odyssey to explore the various itineraries and book your unforgettable adventure. The Deccan Odyssey train awaits to take you on a journey unlike any other.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pdppot9yes7ikuc04z1u.jpg)
How to run SQL Server on M1/M2 with Docker
Tags: mssql, m1, m2, docker
Published: 2024-07-05 09:20:29

Pull the image by opening up a terminal and running the command 

```
docker pull mcr.microsoft.com/azure-sql-edge`
```

```
docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=your_strong_password' -p 1433:1433 --name azuresqledge -d -v sqlvolume:/var/opt/mssql mcr.microsoft.com/azure-sql-edge
```


 **–cap-add SYS_PTRACE** – here is Microsoft’s note on this line: The --cap-add SYS_PTRACE flag is required for non-root SQL Server containers to generate dumps for troubleshooting purposes

**-e ‘ACCEPT_EULA=1’** is an environment variable, which is saying that we will accept the End User License Agreement.

**-e ‘MSSQL_SA_PASSWORD=your_strong_password’** – this is setting the password for the sa (the system administrator) user. This is how you will log into the database. By default the username is ‘sa’.

**-p 1433:1433** is mapping ports. The left side of the colon is the port on the host (your mac). The right side is the port used inside the container

**–name azuresqledge** is just giving the container a more user-friendly name after it starts running

**-d** is detached mode. This means that the terminal won’t attach to the process, which means it’ll start the container up and then give you terminal control back, so you can run other commands.

**-v sqlvolume:/var/opt/mssql** is to persist the data 
    
**mcr.microsoft.com/azure-sql-edge** is last and it’s the name of the image. This is the same name used in the docker pull command
Ventilation Fan Solutions: Choosing the Right Option for Your Space
Tags: design
Published: 2024-07-05 09:18:26

One important part of keeping air fresh within the home is by using a ventilation fan. It operated by drawing outside air into the building and exhausting stale indoor air. This is necessary to ensure a healthy atmosphere inside the building. So today we will explore the world of ventilation fans to realize how important they are and what you can do for your living.

In-Depth Look: How Does a Ventilation Fan Work?
A fan for ventilation is a mechanical device that moves air in such a way If it helps;base_fan. This ladder formation contributes to the regulation of temperature and humidity in space. The ventilation fan also helps to clean the indoor air by removing dust and pollen, thereby creating a fresher garden atmosphere.

Advantages of Ventilation Fans
Benefits of Using Ventilation Fans For one thing, they help improve the quality basement exhaust fan of indoor air which is very important because believe it or not, indoor air can be up to 5X more polluted than outside. In itself, it purifies the environment by eliminating pollutants and allergens resulting in a complete sense of health. In addition, the fans help to regulate radiation temperature and humidity for a more comfortable level of energy consumption. In addition, it hinders the buildup of moisture that can lead to molds and mildew if unattended.

How Ventilation Fans Operate
How Is A Ventilation Fan Used? First and most importantly, make sure you have installed the fan correctly. Once installed, you can turn the fan on to allow fresh air extractor fan in and stale air out. Use the control switch to regulate how fast you want the fan going. It is suggested to keep fan running continuously or have it on specific timings for better results.

The Safety of Using Ventilation Fans
Safety Takes Priority When Using Ventilation Fan To assure yourself that the product complies with strict safety regulations, confirm it has been certified by a reputable safety agency like UL or ETL - your life depends on it. Proper installation is also important for preventing any risks that improper placement could lead to.

Finally: taking the good with the bad when it comes to ventilation fans

To sum up, exhaust fan that purlins offer is irreplaceable for ensuring a fresh and healthy indoor environment. Picking the best fan and arming it to work can drastically refine your home air curtain commercial quality. When choosing a ventilation amb in your family to rest, you need all kinds of consideration for safety and quality so that makes the residential buildings are safer but also comfortable as possible for occupancy.
How to use NVM in Laravel Forge
Tags: laravel, forge, nvm, ubuntu
Published: 2024-07-05 09:18:19


1. SSH to forge server and run this command

```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
```


2. In forge site deployment script. add this script to install and change the version

```
echo 'configuring nvm...';
. ~/.nvm/nvm.sh
nvm install v20.0.0
nvm use v20.0.0

echo 'Running > npm install';
npm install

echo 'Running > npm run build';
npm run build
```
Serverless Application using AWS Lambda ,Api Gateway,AWS Amplify
Tags: aws, api, cloud, html
Published: 2024-07-05 08:56:39


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8su5twjkl1eh8irycb4j.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rg19lnriopif3wtu9t8j.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1wkai83ssey2ddhkvevj.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/voeg9izf36dm9zprbypf.png)
**Creating a serverless application using AWS Lambda, API Gateway, and AWS Amplify involves several steps:**

1. **Initialize Project**: Set up your project with `npm init` and install the Amplify CLI.
2. **Configure Amplify**: Run `amplify configure` and follow the prompts to set up AWS credentials.
3. **Initialize Amplify**: Use `amplify init` to configure the project settings and environment.
4. **Add Lambda Function**: Run `amplify add function`, choose a runtime (e.g., Node.js), and customize the function code.
5. **Set Up API Gateway**: Add a REST API with `amplify add api`, link it to your Lambda function, and define endpoints.
6. **Deploy Backend**: Deploy the Lambda function and API configuration using `amplify push`.
7. **Add Hosting**: Configure hosting with `amplify add hosting`, selecting manual or continuous deployment.
8. **Build Frontend**: Create and build your frontend code, placing it in the appropriate directory.
9. **Deploy Frontend**: Deploy your frontend using `amplify publish`.
10. **Access and Test**: Access the deployed application via the provided URL and test the API endpoints.
"How to Easily Access YouTube TV Using tv.youtube.tv/start"
Published: 2024-07-05 08:52:44

Accessing YouTube TV is simple with the tv.youtube.tv/start link. Begin by visiting tv.youtube.tv/start on your device. You'll be prompted to enter a unique activation code displayed on your TV screen. Enter the code accurately, then log into your YouTube TV account. If you're not already signed in, you'll need to do so. For an alternative method, you can use <a href="https://ytbeeactivate.com/"> Yt.com/activate</a>. Both options streamline the process, allowing you to quickly enjoy YouTube TV's vast selection of live TV channels and on-demand content. This seamless activation ensures you can start watching your favorite shows and movies without any hassle.
Automating User and Group Management with Bash Script
Tags: linux, bash, devops, automation
Published: 2024-07-05 08:51:47

---
title: "Automating User and Group Management with Bash Script"
published: true
tags: linux, bash, devops, automation
---
Managing user accounts and groups is a crucial job for system administrators, especially in environments where many new users are frequently added. Automating this process can save significant time and reduce the risk of human error. 

In this article, we will demonstrate how to automate user and group management using Bash script. This script will read a text file containing usernames and group names, create the users and groups as specified, set up home directories, generate random passwords, and log all actions.

## Script Overview

The script **`create_users.sh`** performs the following tasks:

1. Reads a text file where each line contains a username and a list of groups, separated by a semicolon (**`;`**).

2. Creates a personal group for each user.

3. Creates user accounts with their respective personal groups.

4. Adds users to additional groups as specified.

5. Sets up home directories with appropriate permissions.

6. Generates random passwords for each user.

7. Logs all actions to **`/var/log/user_management.log`**.

8. Stores the generated passwords securely in **`/var/secure/user_passwords.txt`**.


## Prerequisites

Ensure you have the necessary permissions to create users, groups, and modify system files. The script needs to be executed with superuser privileges.

## The Bash Script: [create_users.sh](https://github.com/Hayzedak/HNG1/blob/main/create_users.sh)

## Preparing the Input File

Create a text file named **`user_list.txt`** with the following format:

```
azeez;developers,admins
hng;developers
nora;admins
```

Each line contains a username and a list of groups separated by a semicolon (**`;`**). Multiple groups are separated by commas (**`,`**).

## Running the Script

**Make the Script Executable:**

`sudo chmod +x create_users.sh`

**Execute the Script:**

`sudo ./create_users.sh user_list.txt`

## Verifying the Script Execution

**Check the Log File:**

`sudo cat /var/log/user_management.log`

**Check the Password File:**

`sudo cat /var/secure/user_passwords.txt`

**Verify User Accounts:
**
`cut -d: -f1 /etc/passwd | grep -E 'azeez|hng|nora'`

**Verify Group Membership:**

```
groups azeez
groups hng
groups nora
```

## Conclusion

Automating user and group management with a Bash script can enhance the efficiency and accuracy of administrative tasks. This script provides solution for creating users, managing group memberships, setting up home directories, and ensuring secure password handling. By following this guide, system administrators can save time and reduce errors, particularly in environments with frequent user account changes.
How to Become a Freelance Python Developer in 2024
Tags: freelancepythondeveloper, pythondeveloper
Published: 2024-07-05 08:40:19

With the growing demand for Python developers, now is a great time to [start freelancing](https://www.pangaeax.com/become-a-freelancer/). This guide covers essential tips, tools, benefits, and strategies to help you succeed as a freelance Python developer.

## Python’s Popularity and Demand in Freelancing
Python remains a top choice for freelancers due to its versatility. It’s widely used in web development, data analysis, AI, and machine learning. The TIOBE Index ranks Python among the top programming languages, reflecting its popularity. Platforms like LinkedIn and Pangaea X offer numerous freelance Python developer jobs. The software development field, including Python, is expected to grow significantly.

## Benefits of Becoming a Freelance Python Developer
Freelance Python developers enjoy several advantages:
**•	High Earnings**: The median salary in the U.S. is around $110,000 per year.
**•	Work-Life Balance**: Set your own hours and work from anywhere.
**•	Job Options**: Many opportunities on platforms like Pangaea X, Upwork, and Fiverr.
**•	Global Opportunities**: Work with clients worldwide.
**•	Business Skills**: Develop skills in client management, negotiation, marketing, and financial planning.

## Steps to Become a Freelance Python Developer
1.	Visit [Pangaea X](https://www.pangaeax.com/) and create an account.
2.	Bid on Projects matching your skills and experience.
3.	Get Hired by reputable companies.
4.	Deliver Work and receive payment upon completion.

## Overcoming Challenges
**1.	Finding Clients**: Build a strong portfolio and network on platforms like Pangaea X.
**2.	Building a Reputation**: Deliver high-quality work and seek testimonials.
**3.	Staying Updated**: Continuously learn through courses and webinars.
**4.	Handling Client Relations**: Define project scopes clearly and maintain open communication.
**5.	Managing Finances**: Save during high-income periods and use financial tools.

## Growing Demand in Various Industries
Python’s versatility drives demand in industries like:
**•	Data Science and Analytics**: Essential for data manipulation and visualization.
**•	AI & Machine Learning**: Key for developing models and applications.
**•	Automation and Scripting**: Ideal for automation tasks.
**•	Finance and Fintech**: Used for quantitative analysis and risk management.

## About Pangaea X
Pangaea X connects skilled data analysts and developers with companies seeking top talent. Its user-friendly interface helps freelancers find projects, showcase skills, and manage work efficiently.

## Conclusion
Becoming a freelance Python developer in 2024 offers high demand and rewarding opportunities across various industries. Platforms like Pangaea X help you secure projects and build a successful career. Embrace the benefits, overcome challenges, and stay updated with industry trends to thrive.

For more detailed insights, visit [Pangaea X](https://www.pangaeax.com/2024/07/04/how-to-become-a-freelance-python-developer-in-2024/).