teleren/devto huggingface dataset:
FastAPI Boilerplate: Build a High-Octane Web App with Swagger and GitHub Codespaces!
Tags: python, fastapi, dx, boilerplate
Published: 2023-08-31 23:48:11

## Introduction

Are you a developer who's tired of spending more time configuring than coding? FastAPI might just save you from that soul-sucking routine. In this hilarious and snarky article, I'll introduce you to a project that's here to rescue you: the FastAPI Boilerplate. Get ready for a rollercoaster ride of development speed and laughter!

## What's FastAPI Anyway?

FastAPI is a Python web framework known for its speed, automatic Swagger documentation generation, and data validation magic. It's like that unicorn in your dreams that actually exists, and it's here to make API development fun again.

The Boilerplate

Let's talk about the FastAPI Boilerplate – your ultimate antidote to monotonous development. It's got it all, and by "all," I mean:

The Hermit Developer's Dream: Docker comes to the rescue with an isolated development environment. No more dependency drama, no more pulling your hair out – Docker takes care of it all.

API Comedy Club: Inside this project, you'll find a hilarious example of a FastAPI endpoint. Witness the glorious spectacle of creating endpoints that actually do something meaningful, like telling you "Hello, FastAPI!"

Swagger Stand-up: What's an API without Swagger? FastAPI has your back, generating Swagger documentation on the fly. Explore and interact with your APIs right from your browser – because who doesn't love interactive documentation?

## Getting in on the Joke

Ready to join the party? Here's your backstage pass:

Clone the repository from this [link](https://github.com/Trusted97/fast-api-boilerplate).
Install Docker and bring your sense of humor along.
Run docker-compose up inside the project directory to start the show.
Open your browser and visit [http://localhost:8000](http://localhost:8000) to receive your warm "Hello, FastAPI!" greeting.
Hit up the Swagger comedy club at [http://localhost:8000/docs](http://localhost:8000/docs) for a laugh-filled interaction with your APIs.
Customization and Leveling Up the Laughs

You can also take advantage of GitHub Codespaces to spin up a development environment without any setup hassles!

Once you're in on the joke, it's your show! Customize the project, add your hilarious endpoints, experiment with authentication, bring in your favorite databases – it's your world, and FastAPI's just living in it.

## Enjoying the FastAPI Boilerplate?

If you've found the FastAPI Boilerplate helpful or entertaining, why not give it a star on [GitHub](https://github.com/Trusted97/fast-api-boilerplate)? Your support is greatly appreciated and will motivate me to keep adding more fun to the project.


## In the End, It's All Fun and Games

With FastAPI and the Boilerplate Comedy Show, you're in for a hilarious and productive ride in Python API development. Say goodbye to overthinking and hello to witty APIs. It's like the stand-up comedy of web frameworks, and you're the headliner. Start cracking up and coding today!
HWID Spoofers
Tags: hwid, reverseengineering, gamehacking
Published: 2023-08-31 23:39:42

### Understanding HWIDs

Hardware ID, commonly abbreviated as HWID, is a unique identifier that represents specific components or the entire makeup of a device. This identifier plays a significant role in various security and licensing mechanisms. For instance, software publishers often use HWID to enforce licensing restrictions, ensuring that software is only utilized on the authorized hardware. More on HWID specifics can be explored in this detailed [post](https://guidedhacking.com/threads/what-is-an-hwid.18571/).

### HWID Spoofers

So, what exactly is an HWID spoofer? At a high level, an HWID spoofer is a piece of software that allows a user to mask or change their device's actual hardware identifier. This is often done to bypass bans in online games, where the ban is tied to a specific hardware ID rather than an account. But how does this spoofing mechanism operate under the hood? The process is akin to modifying certain low-level system details to generate a fresh or altered HWID, rendering the original HWID unrecognizable to external systems.
{% embed https://youtu.be/ClqPkffPx5M %}

### Why are these used?

The primary motivation for most users leveraging HWID spoofers relates to gaming. Some online gaming platforms ban players based on their HWID, as it is a more persistent method than banning an account. If a player's HWID is banned, merely creating a new account on the same device won't circumvent the ban. This is where an HWID spoofer can come into play. A spoofer allows banned players to return to the game as if they were on a new device. For those keen on diving deeper into gaming-specific HWID spoofing, this [article](https://guidedhacking.com/threads/gamersclub-hwid-spoofer.11935/) provides a detailed analysis.

### Key Function of HWID Spoofers

An effective HWID spoofer often interacts with the operating system at the kernel level, requiring elevated privileges. Such spoofers often change serialized numbers of disk drives, MAC addresses, and other component identifiers. Moreover, a sophisticated spoofer will ensure that the changes it makes are consistent across the system, so as not to raise suspicions or create system instability. If you're looking for an insightful look into the actual code and mechanics of how a spoofer functions, this [post](https://guidedhacking.com/threads/reverse-engineering-a-hwid-spoofer.20413/) delves into reverse-engineering an HWID spoofer, providing a practical perspective.

### Potential Risks and Considerations

It's worth noting that using an HWID spoofer is not without risks. Many online platforms view spoofing as a breach of their terms of service. Furthermore, given the deep system-level changes a spoofer makes, there's potential for system instability or data loss if something goes awry. Additionally, some spoofers, especially free or lesser-known ones, may contain malware. Before getting into them, it would be wise to explore this [article](https://guidedhacking.com/threads/what-is-the-best-free-hwid-spoofer.18488/), which evaluates the merits of various free HWID spoofers.
September Sparks: Ignite Creativity and Coding Joy! 🔥
Tags: motivation
Published: 2023-08-31 23:15:53

Hey Devs,

Welcome to September, a fresh new month bursting with coding adventures! 🚀 It's time to revitalize your coding mindset, explore new ideas, and embark on a journey of tech-tastic possibilities that will light up your screen.


![Happy new month: minions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tz5fp54p31oor6anseaf.gif)



Just like September ushers in a season of change 🍂, let coding transform your ideas into digital wonders. Whether you're a frontend pro, backend maestro, or full-stack artist, remember, every line of code is a stroke of innovation. Debugging can be fun! Turn it into a dance-off; every bug squashed deserves a victory dance 💃🕺. Feel the algorithms' rhythm as you optimize your code – turn your codebase into a dance floor of efficiency.

Let curiosity guide you through September. Dive into new technologies, explore libraries, and read that documentation 📚. Uncover the next big thing that can elevate your projects beyond imagination. Coding fuel? Snacks are your allies. Power your coding sessions with delicious treats 🍕🍩. Pizza, donuts, or carrot sticks – whatever fuels your genius.



Share the September tech love. Engage, uplift, and support your DEV community 👥. Share insights, collaborate, earn those badges, stay consistent, and craft the future, one code snippet at a time. Let this September be a month where your code is elegant, your creativity boundless, and your passion infectious.

Happy coding in September! 💻🎉


![cheers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6w0jp0eeq9ondcsxo73e.jpeg)
Navigating React Applications with useNavigate() Hook
Published: 2023-08-31 23:14:22






Routing is a fundamental aspect of web applications that enables users to move between different views or pages without the need for a full page refresh. In a React application, managing routing used to involve using external libraries or higher-order components. However, with the introduction of React Router v6, the useNavigate() hook was born, offering a more elegant and intuitive approach to navigation.

The useNavigate() hook is essentially a function that allows you to programmatically navigate between different routes within your application. Unlike the more familiar useHistory() hook, useNavigate() provides a declarative way to trigger navigation without accessing the history object directly.

By using useNavigate(), you can streamline your code and make it more readable. Instead of dealing with complex history manipulations, you can focus on expressing the intent of navigation directly in your code. This hook abstracts away some of the underlying complexity while providing a clean and efficient method of handling navigation.

#The Uses:

There are many ways to incorporate useNavigate into your React applications. The following are a few key examples of where it would be used in a typical application.

Button Click Navigation: Imagine you have a button that, when clicked, should take the user to a different page. By using useNavigate(), you can trigger the navigation action directly from the button's click handler. 

Form Submission Redirection: After a successful form submission, you might want to redirect the user to a confirmation page. With useNavigate(), you can easily achieve this by invoking the hook once the form submission is complete, guiding the user to the desired route.

Conditional Navigation: In some scenarios, you might need to navigate based on certain conditions. The useNavigate() hook can be used within conditional statements to guide users to different routes based on their interactions or the data they've provided.

Programmatic Redirects: Sometimes, you might want to redirect users programmatically based on the application's logic, such as authentication status or user roles. useNavigate() makes this process straightforward, enabling you to manage redirections seamlessly.

Navigation in Custom Hooks: If you're building custom hooks that require navigation, integrating useNavigate() can simplify your hook's interface and enhance its usability.


#Conclusion

We can see just how powerful useNavigate is in React Router v6. Our websites can be made infinitely more dynamic with it. In an ever evolving tech world, we must be able to make sights that feel intuitive and responsive, and useNavigate is a key function for that purpose.
How to use Cloudflare Warp as a socks proxy on your local computer
Tags: wireguard, warp, vpn, censorship
Published: 2023-08-31 23:05:28

Cloudflare Warp is a wonderful VPN. It's very fast and with the Plus account you can enjoy virtually unlimited traffic.

One great thing about Warp is that you can run it in proxy mode. This is useful if you don't want your entire traffic to go through the Warp network.

In order to use Cloudflare warp in socks proxy mode you can use [Wireproxy](https://github.com/pufferffish/wireproxy).

Wireproxy is a wireguard client that exposes itself as a socks5/http proxy or tunnels.

There is a very handy [script](https://gitlab.com/fscarmen/warp) to automatically install and configure Wireproxy with Cloudflare Warp on either a vps or your local machine.

```
wget -N https://gitlab.com/fscarmen/warp/-/raw/main/api.sh && bash api.sh [option]

```

Just run and follow the steps. In the end you'll have a locally running socks proxy that you can use in your web browsers, Telegram and other apps.

The default host:port is **127.0.0.1:40000**. 

The script creates a systemd service for controlling wireproxy.

To change Wireguard/warp parameters you can edit this files:

```
nano /etc/wireguard/proxy.conf
```
For example you can change the dns to 162.159.36.1 (recommended) and modify the endpoint as well.

To find a fast endpoint you can run [this script](https://gitlab.com/Misaka-blog/warp-script/-/tree/main/files/warp-yxip) as root:

```
wget -N https://gitlab.com/Misaka-blog/warp-script/-/raw/main/files/warp-yxip/warp-yxip.sh && bash warp-yxip.sh
```


If you prefer to run warp in VPN mode instead of proxy mode, check out the following:

https://gitlab.com/Misaka-blog/warp-script

WGCF：https://replit.com/@misaka-blog/wgcf-profile-generator
WARP-GO：https://replit.com/@misaka-blog/warpgo-profile-generator
Sing-box：https://replit.com/@misaka-blog/warpgo-sbfile-generator
How do I stack individual channels using Rust&amp;#39;s image crate?
Tags: image, rust
Published: 2023-08-31 23:00:15

How do I stack individual channels using Rust's image crate?
------------------------------------------------------------

When working with images in Rust, the `image` crate is a powerful tool that provides various functionalities. One common task you may encounter is stacking individual channels of an image to create a new composite image. In this article, we will explore how to accomplish this using the `image` crate.

To get started, make sure you have the `image` crate added to your project's dependencies in the `Cargo.toml` file:

    [dependencies]
    image = "0.23.14"

Now, let's assume you have an image and you want to stack its individual channels to create a new image. Here's a step-by-step guide:

1.  Load the image using the `image::open` function:

    use image::GenericImageView;
    
    fn main() {
        let image = image::open("path/to/your/image.png").unwrap();
    }

3.  Extract the individual channels using the `channels` method:

    let (red, green, blue, alpha) = image.channels();

5.  Create a new image with the same dimensions as the original image:

    let mut stacked_image = image::ImageBuffer::new(image.width(), image.height());

7.  Iterate over the pixels of the new image and set the corresponding channels:

    for (x, y, pixel) in stacked_image.enumerate_pixels_mut() {
        let r = red.get_pixel(x, y)[0];
        let g = green.get_pixel(x, y)[0];
        let b = blue.get_pixel(x, y)[0];
        let a = alpha.get_pixel(x, y)[0];
    
        *pixel = image::Rgba([r, g, b, a]);
    }

9.  Save the stacked image to a file:

    stacked_image.save("path/to/save/stacked_image.png").unwrap();

And that's it! You have successfully stacked the individual channels of an image using Rust's `image` crate. You can now use the resulting image for further processing or display it as needed.

Remember, working with images can be a lot of fun, especially when you get to play with individual channels. So go ahead, experiment, and create some amazing compositions!

### References:

*   [Rust's image crate on crates.io](https://crates.io/crates/image)
*   [image crate documentation](https://docs.rs/image/0.23.14/image/)
Introduction to Git
Tags: git, programming, softwaredevelopment, beginners
Published: 2023-08-31 21:51:04

### Introduction to Git & Software Development

One of the first things a new developers might question is, "Why is Git so essential?" To dive deeper into its utility and mechanics, the post titled [Introduction to Git Repos](https://guidedhacking.com/threads/introduction-to-git-repos.19916/) offers a nuanced view. This post not only covers the basic concepts surrounding Git repos but also walks the reader through its necessity and best practices. For those just starting out, it serves as a solid Intro to Git.
{% embed https://youtu.be/qj5AgSsn-DA %}

However, mastering Git is just the tip of the software development iceberg. A programmer needs a multifaceted skill set, ranging from coding to understanding intricate software architectures. A visit to the [Programming section](https://guidedhacking.com/categories/programming.7/) can prove enlightening. It's a repository (pun intended) of numerous topics that cater to both the novice and the experienced. From data structures to intricate algorithms, the content here complements the foundational knowledge of Git for beginners.

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

The visual aspects of software development, especially in game development and advanced UI design, hinge on Graphics APIs (Application Programming Interfaces). For those intrigued by the challenge of rendering, shading, or simply putting pixels on screens in the most efficient ways, the [Graphics API Programming section](https://guidedhacking.com/categories/graphics-api-programming.459/) serves as an invaluable resource. Here, one can deep dive into OpenGL, DirectX, Vulkan, and other critical technologies that push the boundaries of what software can visually represent.

While understanding how to craft software is vital, recognizing the vulnerabilities in one's code and ensuring its security is equally crucial. After all, what's the point of creating a remarkable application if it's easily exploitable? For insights into safeguarding your projects, the [Information Security Tutorials forum](https://guidedhacking.com/forums/information-security-tutorials.470/) is a treasure trove. From the basics of encryption to advanced penetration testing techniques, this section equips developers with the tools to shield their software.

While our Intro to Git can help you noobies improve your software development skills, there is an insane number of different specialties in this field to explore. Git for beginners is a doorway, but the ocean of software engineering is vast and diverse, and the rooms of knowledge are endless.
HackerRank Greedy Florist
Tags: python, challenge, hackerrank
Published: 2023-08-31 21:47:26

This is the solution for the HackerRank Greedy Florist problem, in python. This is a problem in the Interview Preparation Kit > Greedy Algorithms and is considered medium.

The problem is as follows:
- The greedy florist wants to maximize his price
- He has a formula to the price: (n + 1) * original price
- n is the number of flowers previously purchased

So, if you buy one flower, it will be the original price. If you buy a second flower, the price is 2 * original price.

I think that the problem never left clear that the expensive flowers must be purchased first, but that's in the answer.

## Solution 

The first problem we must solve is to put the array in a reverse price order.

```py
    c.sort()
    c.reverse()
```

So we can traverse it and buy the flowers. For each item, we must find:
- n
- current cost

We can find `n` by integer (or floor) dividing the array position with the number of friends `k`

```py
    for i in range(len(c)):
        n = i // k
```

So, the first round of purchases will have n = 0, the second, n = 1, and so on.

The cost is straight to the formula:

```py
        flower_cost = c[i]
        cost = (n + 1) * flower_cost
```

And that's it. The complete solution is as follow:

```py
def getMinimumCost(k, c):
    total = 0
    c.sort()
    c.reverse()

    for i in range(len(c)):
        n = i//k
        flower_cost = c[i]
        cost = (n + 1) * flower_cost
        total += cost
    return total

```
Have you ever doubted if you are in the right field?: CodeNewbie Podcast
Tags: discuss, codenewbie, career, podcast
Published: 2023-08-31 21:39:09

[Vanessa Vun](https://twitter.com/nessar00) came on the podcast yesterday to talk about her journey as a self-taught coder, finding a job after a bootcamp, and keeping up motivation towards your passions.

Vanessa Vun started her self-taught coding journey in 2022 after quitting a 10-year career as a clinical laboratory scientist. About 14 months later, she landed a job as a Frontend Engineer at SciShield, which provides a platform of solutions for research laboratories.

On the podcast, Vanessa talked quite a bit about redirecting your focus towards a new job goal, specifically from medicine to coding.

She shared:

> ### “I left myself notes around my computer saying like, ‘Pressure makes diamonds,’ or, ‘Always have a learning mindset. Stay curious, collaborate, and remember the truth.’

> ### ... Basically I need[ed] to remember my truth and use that truth to empower me to keep going.”

It's extremely challenging to switch fields and to find a job that fits your needs as a creator.

We want to know:

- Have you ever doubted if you are in the right field?

- What helps you better understand these thoughts?


---

_ICYMI— find that episode below or wherever you get your podcasts_:

{% embed https://dev.to/codenewbieteam/self-taught-coding-stories-of-a-former-lab-scientist-codenewbie-podcast-s25e3-geh %}

---

_Send us your thoughts below and don't forget to give it a listen here or wherever you listen to your podcasts!_ 💜
A Mastodon bot to find EV charging stations
Tags: civictech, kubernetes, raspberrypi, python
Published: 2023-08-31 21:38:05

I have a new addition to my homelab. I wanted to do a project that was fun to build but also let me apply a few different technical concepts. Read along if you're interested in any of the following:

* Homelabs based on Raspberry Pi.
* Mastodon and the wider Fediverse.
* Civic tech.
* Electric vehicles.
* Loosely-coupled microservices.
* Message brokers with long-running producers and consumers.
* Caching.
* Container orchestration.
* Secrets management.
* Handling server-sent events from a streaming API.
* Consuming REST APIs.

The goal was simple: a bot that, whenever you mention it with a location, will reply with a list of nearby EV charging stations. It must also display the type of connectors available and link to the location of each station using Apple or Google Maps, depending on the user's device.

Once you've [set up your Raspberry Pi](https://santisbon.github.io/reference/rpi/) and [lightweight Kubernetes distribution](https://santisbon.github.io/reference/k8s/#microk8s), it's time to think about our architecture.

Our solution has: 
* A *watcher* that keeps track of Mastodon notifications for mentions of our bot account and prepares a request for the task to be done.
* A *worker* that fulfills the task of putting together the response and sending it to the user.
* A message broker that the watcher and the worker will use to communicate with each other.
* A cache to store the responses from the external service that helps us translate user requests into a geographic location.
* A Mastodon instance hosting our bot account and offering a streaming API with notifications and a web API for posting.
* A third-party API with a geocoding service.
* A third-party API with charging station locations.

Here's the high-level architecture

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

We'll take advantage of Docker container images to package our two microservices (watcher and worker) and their dependencies. We'll also use Kubernetes for container orchestration. 

Each microservice consists of:
* App container.
* Configuration and secrets.
* Horizontal autoscaling to meet an increase in demand.
* Init container to delay the creation of the app container until the message broker is available.
* In the case of the worker, a cache to avoid unnecessary calls to the geocoding API as required by its terms of service.

Dive into the instructions, code, a detailed diagram of the Kubernetes objects, and documentation here:
{% embed https://github.com/santisbon/evstations %}