teleren/devto huggingface dataset:
Cloud Field Day 17 Recap
Tags: kubernetes, cloud, devops, git
Published: 2023-06-01 17:50:23

Below is a short blog post and overall recap for Cloud Field Day 17.

## HYCU

- Big investors (Cisco, Bain, Okta, etc.).
- Never charge for professional services and support.
- HYCU isn’t building integrations. They’re giving the ability to build the integration to the vendor. For example, NetApp builds an integration into HYCU vs the other way around/\.

HYCU sits in the middle as an API/external control plane for all of your data to be backed up

You could, for example, use HYCU to back up all of your Kubernetes environments (if you're multi cloud or hybrid cloud) from one API and one location. It makes the job much easier.

## Morpheus

https://morpheusdata.com/

- One central self-service portal to do all things DevOps
- Internal Developer Platform (IDP) on-demand instead of building it yourself

Morpheus is an IDP that you don't have to build yourself. This takes a lot of the headaches away from Platform Engineering teams. You can, for example, deploy k8s clusters with Morpheus on the UI and with the API.

Below are some links to the open-source versions.

morpheusdata.com/community

developer.morhpeusdata.com

## RackN

- Build, deploy, and manage infrastructure with any IaC tool.
- Fully vendor agonistic.
- Has both a Ops and Dev platform.

The idea with RackN is instead of using something like Terraform Cloud where you're locked into one IaC tool and one platform, it gives you the ability to deploy with any IaC tool to any environment (cloud, on-prem, Kubernetes, etc.).

## Zerto (VMWare-based platform)

- Backup based detection.
- Alerting for all warnings at the VM level.
- Replicas data between data stores.
- Detects suspicuous writes as they stream in and flag for admins to investigate.

Backups and backups, and they're great, but what about the recovery? The reality is that many products can do a backup. Your iPhone can do a backup to Apples cloud. The challenge is how you can restore successfully.

Most organizations are backing up between 2-4 times per day and many aren't testing their recoveries, so when things go wrong, they aren't prepared.

## Couchbase

- NoSQL database
- Lowers DB cloud cost, so a bit of cost optimization available.
- The primary goal is to supply data to applications.
- Works for various application stacks (microservices, mobile apps, edge apps, etc.).
- Couchbase outperforms competitors by nearly 400% and costs up to 90% less to operate.

Couchbase gives you the ability to have a NoSQL solution that's vendor agnostic.

There's some capabilities with Couchbase Capella to run on Kubernetes. It comes pre-packed with a few other CNCF-related tools like Grafana.

## JetStream

- Architected with a cloud-native approach
- Multiple levels of administration
- Self-service capability
- VMWare only

If you have a large scale VMWare environment (or even a small one) and you need the ability to have true DR, Jetstream is a great way to go as they focus solely on VMWare. That means their focus isn't fragmented with various other bells and whistles.
Understanding Relational Database Management Systems (RDBMS)
Tags: database, relational, management, datascience
Published: 2023-06-01 17:48:50

In the world of data management, Relational Database Management Systems (RDBMS) have been the backbone of countless applications and organizations. RDBMS provide a structured and efficient approach to storing and retrieving data.
**
What is an RDBMS?**
A Relational Database Management System (RDBMS) is a software system designed to manage relational databases. It is based on the relational model, which organizes data into tables with rows and columns. RDBMS provide a set of operations and tools to create, modify, and query these databases.



**Key Features of RDBMS:**

**Data Integrity: **RDBMS enforce data integrity rules, such as entity integrity (primary key uniqueness) and referential integrity (relationship between tables).

**ACID Properties:** RDBMS ensure transactional integrity through ACID properties (Atomicity, Consistency, Isolation, Durability), allowing for reliable and robust data operations.
**SQL Support:** RDBMS use SQL as the standard language for interacting with databases, making it easy to query, manipulate, and retrieve data.

**Data Relationships:** RDBMS facilitate establishing relationships between tables using primary and foreign keys, enabling efficient data retrieval through joins.
Indexing: RDBMS support indexing mechanisms to improve query performance by allowing faster data access.

**Scalability:** RDBMS can scale vertically (adding more resources to a single server) or horizontally (distributing data across multiple servers) to handle growing data volumes and user loads.

**Popular RDBMS:**

**MySQL:** An open-source RDBMS widely used for web applications and small to medium-sized databases.

**Oracle Database:** A commercial RDBMS known for its scalability, reliability, and extensive feature set.

**Microsoft SQL Server:** A relational database system developed by Microsoft, offering excellent integration with the Microsoft technology stack.
**
PostgreSQL:** An open-source RDBMS with advanced features and strong adherence to standards.

**IBM Db2:** A robust RDBMS designed for enterprise-level applications and known for its performance and scalability.

**Conclusion:**
Relational Database Management Systems (RDBMS) have played a vital role in managing structured data for decades. With their emphasis on data integrity, flexibility, and scalability, RDBMS provide a reliable and efficient solution for storing and retrieving data. Understanding the principles and features of RDBMS is crucial for developers, data analysts, and anyone involved in working with data.
Coding Game: Quick Code Reading
Tags: career, programming, beginners, tutorial
Published: 2023-06-01 17:21:28

If you're into coding, you'll know that Leetcode challenges aren't much of a hurdle anymore. The real challenge nowadays is how fast you can pick up and understand your tasks as a software developer. It's about speed, agility, and the ability to absorb new information like a sponge.

Being able to read code is the golden skill for today's developers. Why is it so valuable? Because the ability to decipher and understand pre-written code opens up limitless possibilities. And here's a heads up - this skill is set to become even more valuable in the future, especially when everyone starts using AI assistants like ChatGPT for coding help!

You might ask, "Why is reading code becoming increasingly important?" Well, in our rapidly evolving tech world, the pace of work is only getting faster. Companies are constantly pushing for quicker development cycles and shorter time-to-market. They want to stay ahead of the competition, and that means developers need to keep up.

In this high-speed environment, it's not just about writing code anymore. It's about quickly understanding and modifying existing code, integrating new components, and troubleshooting issues swiftly. This is where reading code comes in. Being proficient at interpreting code allows developers to adapt rapidly, making them invaluable assets in this fast-paced industry. So, the faster you can read and understand code, the more likely you are [to stay in the game](https://store.steampowered.com/app/2436030?utm_campaign=dev_speed).
getting error on react js when ading user
Published: 2023-06-01 16:20:10

``i am working on project and i have to add user in react js with api endpoints. Still the code not working. when i click on add user it add user but when i login it doesnt work. the user with api tsted on postman and works but not working on code.




import React, { useState } from "react";
const AddUser = ({ setTokenValue }) => {
  const [isSubmitting, setIsSubmitting] = useState(false);
  const [errorMessage, setErrorMessage] = useState("");
  const [name, setName] = useState("");
  const [email, setEmail] = useState("");
  const [phone, setPhone] = useState("");
  const [password, setPassword] = useState("");

  const handleSubmit = async (event) => {
    event.preventDefault();
    setIsSubmitting(true);
    try {
      const response = await fetch("https://api.store.ellcart.com/users", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "Authorization": `Bearer <eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2FwaS5zdG9yZS5lbGxjYXJ0LmNvbS91c2Vycy9sb2dpbiIsImlhdCI6MTY4NTYzNDY1MCwibmJmIjoxNjg1NjM0NjUwLCJqdGkiOiJBZ2doWFpiT1VxeGF4QTBvIiwic3ViIjoiMjA0IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.28tizEstlORenFGcDin-3RSFgtHzJpnoA2UYI7A2sJ0>`,
        },
        body: JSON.stringify({
          name: name,
          email: email,
          phone: phone,
          password: password,
        }),
      });
      if (!response.ok) {
        throw new Error("Failed to add user");
      }
      const data = await response.json();
      if (data && data.authorisation && data.authorisation.access_token) {
        const token = data.authorisation.access_token;
        setTokenValue(token);
        setName("");
        setEmail("");
        setPhone("");
        setPassword("");
        setErrorMessage("");
      }
    } catch (error) {
      setErrorMessage(error.message);
      console.error("Failed to add user:", error);
    } finally {
      setIsSubmitting(false);
    }
  };
  return (
    <form onSubmit={handleSubmit}>
      {errorMessage && <p>{errorMessage}</p>}
      <label>
        Name:
        <input type="text" value={name} onChange={(e) => setName(e.target.value)} />
      </label>
      <label>
        Email:
        <input type="email" value={email} onChange={(e) => setEmail(e.target.value)} />
      </label>
      <label>
        Phone:
        <input type="phone" value={phone} onChange={(e) => setPhone(e.target.value)} />
      </label>
      <label>
        Password:
        <input type="password" value={password} onChange={(e) => setPassword(e.target.value)} />
      </label>
      <button type="submit" disabled={isSubmitting}>
        {isSubmitting ? "Submitting..." : "Add User"}
      </button>
    </form>
  );
};
export default AddUser;`
Create API Routing in Express with Vite
Tags: express, node, vite, api
Published: 2023-06-01 17:05:07


### Introduction

In this tutorial, we will learn how to enhance API routing in Vite using the "vite-plugin-api" plugin. This plugin improves visibility and project structure in Node.js and Express by mapping the directory structure to route rules.

### Prerequisites

Before we begin, make sure you have the following:

- Basic knowledge of ViteJS, Node.js, and Express.
- An existing Vite project.

### Step 1: Installation

To install the "vite-plugin-api" plugin, run the following command:

```bash
yarn add vite-plugin-api
```

### Step 2: Configuration

In your Vite project, open the `vite.config.ts` file and add the following code:

```js
import { defineConfig } from "vite";
import { pluginAPI } from "vite-plugin-api";
export default defineConfig({
  plugins: [
    pluginAPI({
      // Configuration options go here
    }),
  ],
});
```

### Step 3: Directory Structure

Next, let's create the API directory structure in your project's source folder (`src/api`). Here's an example structure:

```bash
> tree src/api/
src/api/:
├───v1
│   │   auth.js
│   │   index.js
│   ├───auth
│   │       login.js
│   │       status.js
│   └───user
│           $userId.js    //Remix Format
│           [userId].js    //NextJS Format
│           index.js
```

### Step 4: Exporting Route Rules

In each API file within the directory structure, you can export the allowed request methods. For example, in the `src/api/v1/user/$userId.js` file, you can export the `DELETE` and `PUT` methods:

```js
//file:src/api/v1/user/$userId.js
export const DELETE = (req, res, next) => {
  res.send("DELETE REQUEST");
};
export const PUT = async (req, res, next) => {
  res.send("PUT REQUEST");
};
```

Similarly, the file names `[userId].js` or `$userId.js` will be exported as request parameters, such as `/user/:userId`, following the Next.js/Remix framework.

### Step 5: Run the Server

Now, you can start the server using ViteJS, and the API routes will be automatically generated based on the directory structure and exported route rules.

You can see the full example in: https://github.com/yracnet/vite-plugin-api

### Conclusion

Congratulations! You have successfully enhanced API routing in your Vite project using the "vite-plugin-api" plugin. This improves project structure and simplifies configuration, making your development process more efficient.
Remember to refer to the plugin's documentation for more advanced configuration options and customization possibilities.
Happy coding!
How to cache MRSK deployments in CI
Tags: ruby, rails, kamal, githubactions
Published: 2023-06-01 17:04:39

Caching is a key strategy in optimizing Docker deployments. But because CI don't saves previous docker layers, and, unfortunalety, MRSK doesn't have options like `--cache-to`, MRSK rebuilds each Docker container from scratch, leading to a slower deploys. 

There are two methods to implement caching with MRSK in GitHub Actions: pulling the Docker image before deployment and using the --skip_push option with the build command.

## Method 1: Pull the Docker Image before Deployment
This approach is suitable for simple Dockerfiles. 
First, the Docker image is pulled from the registry, then the MRSK deploy command is run. By pulling the Docker image first, MRSK can use the layers from the previously built image, reducing the need for a complete rebuild.

```yaml
- name: Login to DockerHub
  uses: docker/login-action@v2
  with:
    username: ${{ secrets.DOCKERHUB_USERNAME }}
    password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Pull Docker Image
  run: docker pull ${{ secrets.DOCKERHUB_USERNAME }}/your-image-name || true

- name: Deploy with MRSK
  run: mrsk deploy
```
In this code snippet, the docker pull command pulls the Docker image from the registry. The || true part ensures that the workflow doesn't fail if the image doesn't exist yet (for instance, during the first run).

But the problem with this method is that it's not working for workflows where only final Docker image is pushed.

## Method 2: Use the --skip_push Option and Build Command before Deployment

This method is for complex workflows, for example for Dockerfiles which have separated final and builder images. Because in such Dockerfiles we push only final image, we can't get builder cache from pulling latest image.

The `--skip_push` option in MRSK not only skips the push, but also the Docker build process. Therefore, we can perform the build manually and then use MRSK for deployment only.

```yaml
- name: MRSK envify
  env:
    VERSION: ${{ github.sha }} # set version to ensure we'll build the same version
  run: 'mrsk envify -v'

- name: Set up Docker Buildx.
  uses: docker/setup-buildx-action@v2

- name: Build and push
  uses: docker/build-push-action@v4
  with:
    context: .
    push: true
    tags: ${{ secrets.DOCKERHUB_USERNAME }}/your-image-name:${{ github.sha }},${{ secrets.DOCKERHUB_USERNAME }}/your-image-name:latest
    cache-from: type=gha # https://docs.docker.com/build/cache/backends/gha/
    cache-to: type=gha,mode=max

- name: MRSK deploy
  run: 'mrsk deploy -vvvv --skip_push'
```

In that way we could fully embrace CI cache and speedup deployments.


## Links
* https://cloud.google.com/build/docs/optimize-builds/speeding-up-builds#using_a_cached_docker_image Best practices to speedup deploys with Docker
* https://github.com/mrsked/mrsk/pull/159 Closed PR about --cache-to option in MRSK
* https://github.com/mrsked/mrsk/pull/111 Discussion about --skip_push option 
* https://docs.docker.com/build/cache/backends/gha/ Github Actions backend for cache
Apresentando GitHubBrasil.com
Tags: githubbrasil, braziliandevs, opensource, community
Published: 2023-06-01 16:45:40


Olá comunidade, como vão?

  

O artigo de hoje vai ser especial, hoje vamos falar sobre o site que lançamos em Maio, o [https://githubbrasil.com/](https://githubbrasil.com/)

  

Vocês devem ter notado que nesse último ano o GitHub tem investido no relacionamento com a comunidade brasileira, por isso sentimos falta de um espaço exclusivo do Brasil para mostrarmos o trabalho que nosso povo tem feito em Open Source, e com isso nasceu o GitHubBrasil.com, com o objetivo de apoiar a comunidade de desenvolvimento e de código aberto no Brasil.

  

## Projetos Open Source do Brasil

Existem muitos projetos Open Source que foram criados por pessoas brasileiras, da linguagem de programação Elixir, até um dos temas mais usados para o VS Code, o Drácula, por exemplo, e muitas pessoas nem sabem.

Um dos objetivos principais do site é apresentar para a comunidade brasileira o representação nossa que já existe e inspirar outras pessoas a contribuírem e criarem seus próprios projetos.

  

## Pessoas Mantenedoras Brasileiras

Outro destaque que achamos importante colocar no site são essas pessoas que já representam o Brasil dentro do Open Source, então o site tem uma seção específica com pessoas mantenedoras brasileiras para você conhecer.

Como o site é open source, você pode mandar PRs para adicionar tanto novas pessoas mantenedoras, quanto novos projetos.

  

## Programas

É normal pensarem que GitHub é apenas uma ferramenta de armazenamento de código, mas o GitHub oferece muito mais, inclusive vários programas voltados para a comunidade, no site você pode aprender um pouco mais sobre:

- GitHub Education
    
- GitHub Stars
    
- GitHub Community Líders
    
No [www.GitHubBrasil.com](http://www.githubbrasil.com) você também pode encontrar conteúdo em português do Brasil e guias sobre como aprender mais e contribuir com o Open Source.

  
  

## Contribua com o site!

No fim dos meus artigos eu sempre gosto de trazer uma ação prática para vocês, e hoje é que você contribua com o site, adicionando um projeto ou uma pessoa mantenedora que merece estar lá mas ainda não está.

O que acharam do site? Comenta ai seu Feedback! 💖
New features in the OWASP Juice Shop
Tags: security, owasp
Published: 2023-06-01 16:40:57

![OWASP Juice Shop Banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zcz1cf7dagoiu09er25.jpg)

I just got back home from the [German #OWASP Day](https://god.owasp.de/2023/), and one of the great presentations was [Björn Kimminich's](https://www.linkedin.com/in/bkimminich/) session where he demonstrated some interesting new features of the [OWASP Juice Shop](https://owasp.org/www-project-juice-shop/), including chatbot vulnerabilities and code-fixing challenges, which I can't wait to try out myself!

If you haven't heard of The OWASP Juice Shop yet, it is an intentionally insecure web application which can be used as a personal learning tool, in security trainings, awareness demos, and CTFs.

You can learn more and check it out yourself on the [project page at OWASP](https://owasp.org/www-project-juice-shop/) or at [github.com/juice-shop](https://github.com/juice-shop "github.com/juice-shop").

Thanks to Dan Gora, Jonas Becker, Dirk Wetter, and the entire organizing team for a great community event with fun, informative, and educational sessions across all things #security! I'll definitely come back next year 😀
Single-Digit Spotlight v2
Tags: singledigit
Published: 2023-06-01 16:00:00

---
title: Single-Digit Spotlight v2
published: true
description: A selection of articles that haven't yet received the attention they may deserve 🌱
series: Single-Digit
tags: singledigit
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5bxahrkbr0iba71tbp6r.jpeg
# Use a ratio of 100:42 for best results.
published_at: 2023-06-01 12:00 -0400
---
Welcome to "Single Digit" Spotlight, a selection of articles published **_within the last week_** that have **_fewer than 10 total reactions_** (at the time of the post's publishing).

The goal is to highlight posts published on DEV that haven't yet received the attention they may deserve 🌱

Hope you enjoy!

{% embed https://dev.to/nfrankel/health-check-response-format-for-http-apis-2g4j %} 

{% embed https://dev.to/maxime1992/rxjs-avoid-an-easy-mistake-when-using-startwith-4ano %} 

{% embed https://dev.to/kelvinskell/a-practical-guide-to-deploying-a-complex-production-level-three-tier-architecture-on-aws-2hf0 %} 

{% embed https://dev.to/pmbanugo/how-to-measure-your-servers-round-trip-time-in-remix-react-4kj2 %} 

{% embed https://dev.to/iamschulz/view-transition-api-4l4o %} 

{% embed https://dev.to/thawkin3/using-render-log-streams-to-log-to-papertrail-j4g %} 

{% embed https://dev.to/kylegalbraith/the-fundamentals-of-building-a-docker-image-43k7 %} 

Shout out to @maxime1992, @nfrankel, @kelvinskell, @iamschulz, @pmbanugo, @thawkin3, and @kylegalbraith!

---
<a href="https://www.freepik.com/free-photo/golden-number-one-with-gold-crown-top-floor-champion-winner-yellow-background-by-3d-render_25829004.htm#query=spotlight%20on%20a%201&position=38&from_view=search&track=ais">Image by DilokaStudio</a> on Freepik
flutter row widget example
Tags: flutter, dart, widget, row
Published: 2023-06-01 15:51:28

```
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: RowWidget(),
    );
  }
}

class RowWidget extends StatelessWidget {
  const RowWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Row Widget'),
      ),
      body: Container(
        height: 400,
        child: Row(
          // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            Container(
              height: 100,
              width: 100,
              color: Colors.red,
            ),
            Container(
              height: 100,
              width: 100,
              color: Colors.black,
            ),
            Container(
              height: 100,
              width: 100,
              color: Colors.amber,
            ),
          ],
        ),
      ),
    );
  }
}

```