teleren/devto huggingface dataset:
New developers
Published: 2023-08-04 00:41:16

If you are a new developer you might have found the perfect profile. I am a 15 year old programmer from finland, if you are new my github page is perfect i often have a lot of documentation explaining in details what functions do in my open source projects. So feel free to start following my github and keep a track on my repositories and read my code and documentation.

https://github.com/st1koo
1200 USD gone in unmonitored cloud spending😭😭😭
Tags: google, billing, ai, vertex
Published: 2023-08-03 23:45:59

As a GDE in the GCP category, I consider myself a well-seasoned user in topics such as cloud infrastructure, data and compute migrations, and management of  IaaS/PaaS offerings from GCP. 
GCP has evolved a lot since I became a GDE, with Vertex AI being the technology that I'm trying to catch up on, especially regarding pricing.

The most significant mishap of my learning journey? **1200+ USD of unmonitored spending piled up in VertexAI usage during July of 2023 alone.
**

## The root cause.
I was under the impression that models from Vertex's Model Garden worked in a "per request" or "Per use" model; needless to say, they don't.

The new offerings —Palm2 chat and Text generation, Code completion, and Code Chat— will charge you a small amount per 1000 characters, billing you on a "per-request" or "per-inference". However, deploying models from the Model Garden works differently.

Deploying those models require dedicated CPU, RAM, and GPU; therefore, you're billed for those resources independently. I learned this after the fact.

A post-mortem analysis shows spendings accumulating during the month :

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

## The devil is in the details.

I always set up fairly conservative billing alerts; So, How did 1200 USD disappear without me noticing?

> It turns out, Discount usage does not qualify as Spending in GCP's billing system. 

One could argue that resource consumption causes spending regardless if credits are being consumed or credit cards are being charged, but GCP doesn't work like that at the moment. Link to Documentation.

Due to that subtle difference in terminology, the alert I set up at 200 USD never triggered, and neither did those at 450 USD and 500 USD.

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



## No signs of intrusions or leaked credentials.

At some point, I was afraid I might have leaked credentials in a Jupyter Notebook or that a malicious Notebook author had accessed my GCP project. The proof that seems to discard such a hypothesis is the Vertex AI API logs, which show nothing but sporadic use.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g0pq7wdysuv391ju8czj.png)


## Conclusion.

Regular GCP customers will hardly find themselves in a similar situation; nevertheless, capping API usage is the safest option for preventing unexpected spending.
Also, remember that you can use BigQuery to explore to analyze billing data.
Technicalities aside, keeping an eye on your cloud infrastructure's billing panel and maintaining an inventory will always be in fashion.
Changelog: Don't forget to hit that notification bell
Tags: changelog, meta, howtodevto
Published: 2023-08-03 22:35:07


👋 Hey all,

My name is Phil, and I’m Senior Product Manager at [Forem](https://www.forem.com/), the folks behind the DEV Community. It’s great to be a part of such a vibrant and enthusiastic community and I’m really excited to bring some new features to the platform to help you all find great content and connect with other passionate DEVs from around the world.

We want DEV to be a great place for discussion, whether that be the latest front-end framework that you’re interested in, your favourite open-source repo you’ve contributed to, through to the intricacies (and dangers!) of using inline assembly. That’s why you can find great topics at [#discuss](https://dev.to/t/discuss) and also on the thousands of great posts that hit your feed every week. 

At DEV, you’ve always been able to stay up-to-date with the new comments on posts you want to keep track of, through **post subscriptions**, which you can activate using the subscribe button above the comment box.

![An arrow pointing to the "Subscribe" button shown above the comment box shown on a DEV post](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6s01q4yo23u97k5yim5v.png)

I’m pleased to update everyone a new feature we’ve shipped to DEV - subscription indicators in `/notifications`. You can see them in action now by heading over to [your notifications page](https://dev.to/notifications).

![An arrow pointing to the "Subscribe to comments" button shown on a new article notification](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nzut6gk4s5jfbq2yxcn0.png)

These give you the option to subscribe to new articles that come through from users or organizations you follow, but also through any of your existing comment subscriptions - meaning you can easily unsubscribe from any article or thread that’s getting a bit too popular. This way you can never miss out on an interesting discussion on DEV, as it's happening.

We’re excited to bring new improvements to notifications, subscriptions and the feed over the next few weeks. So, stay tuned for more updates on [#changelog](https://dev.to/t/changelog)!

I'm always open to any feedback or ideas. Let me know in the comments below, or send me an email at philip@forem.com - I'd love to hear from you!
Day 797 : Travel the Map
Tags: hiphop, code, coding, lifelongdev
Published: 2023-08-03 22:29:22

_liner notes_:
- Professional : Had a couple of meetings. It was good to see everyone. I wrapped up small details to finish up to get some documentation I was working on. Answered some questions. Started on some more updates to documentation for things coming in the future. Had a some questions so I sent a message to the engineering team to get some clarification. Not a bad day.

- Personal : Last night, I put together a bunch of tracks to buy on Bandcamp on Friday so that artists can get more off each sale. Worked a little on my side project. Ended the night watching "Guardian of the Galaxy vol. 3".

![View from shore of a lake looking at a mountain on the other side with at its base a forest with yellow, red, green and orange trees in Lake Willoughby, VT, USA](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vnnmiptg3f7uh6kcrd32.jpg)

Going to finish putting together the list of Bandcamp tracks for the different social media networks. I'm also going to add some upcoming trips to my travel the map site https://dwane.in If I have time, I want to work on my side project.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube FGTRNsPa-KE %}
Announcing ComposableNOW!
Tags: event, composable, decoupled, headless
Published: 2023-08-03 22:24:59

Join amazee.io at ComposableNOW, a free half-day event on October 16 in Lille, France - the day before DrupalCon Lille starts. 

Explore the latest innovations in decoupled, headless, open source, & composable web. Learn about app development, deployment, & infrastructure options. Register now: https://www.amazee.io/composablenow-2023
VScode Arduino Giga R1 Wifi Board Problems. Help!
Tags: vscode, arduino
Published: 2023-08-03 22:04:48

I'm using the Microsoft Arduino Extension as Platform IO Extension does not have the new Arduino Giga R1 Wifi board available.

I finally have VScode working with the Arduino Uno but when switching to the Arduino Giga R1 Wifi board it won't work.

Problems include:

1 - "cannot open source file \"PinNamesTypes.h\" (dependency of \"C:\\Users\\vEdit\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_giga\\4.0.4\\cores\\arduino\\Arduino.h\")"

2 - "no instance of overloaded function \"arduino::UART::begin\" matches the argument list",

**Here is the code:**

```
void setup() {
Serial.begin(9600);
Serial.println("This is vscProject_GigaR1");
}

void loop() {
}

```
**Here is the json file:**

```
{
    "configuration": "target_core=cm7,split=100_0",
    "board": "arduino:mbed_giga:giga",
    "port": "COM4",
    "programmer": "cmsis-dap",
    "output": "C:/Users/vEdit/Documents/Arduino/vscProject_GigaR1_output",
    "sketch": "vscProject_GigaR1.ino"
}
```
There is another "Programmer" available... the
STMicroelectronics STlink
but that doesn't work either.

Been trying to get VScode to work for 3 days and am about to ditch it but hopefully some kind soul can walk me through getting it to work with the Arduino Giga R1 Wifi board.

Thanks for any help.
Behind the Helm (July 2023)
Tags: news, kubernetes, community, crossword
Published: 2023-08-03 22:00:00

_This is the web edition of the Behind the Helm, Scaleway's monthly Kubernetes newsletter. For the best Kubernetes news in your inbox every month, [subscribe today](https://www.scaleway.com/en/kubernetes-newsletter/)!_

Hi, lovely subscribers!

I hope you’ve had a great summer so far. At Scaleway, we’ve been hard at work releasing new features - check out our [changelog](https://t.elements.scaleway.com/c/?t=b15feda-4mc-qeec-lk4-!3qql)!

Argonaut have released [a technical exploration of their CI pipelines](https://t.elements.scaleway.com/c/?t=b15feda-4mc-qee1-lk4-!3qql), which is absolutely fascinating. If you’d like a peek under the hood of one of the most popular deployment tools for K8s, this is a must-read.

IstioCon will be happening on [the 25th & 26th of September](https://t.elements.scaleway.com/c/?t=b15feda-4mc-qeex-lk4-!3qql), with a mix of virtual and in-person content scheduled. If you want to keep up with the movers and shakers in the service mesh world, give it a look. In the meantime, you can read about Istio’s authentication and authorization policies in [this cool article](https://t.elements.scaleway.com/c/?t=b15feda-4mc-qefm-lk4-!3qql) from InfraCloud!

Also from InfraCloud is [this primer on MLOps](https://t.elements.scaleway.com/c/?t=b15feda-4mc-qefl-lk4-!3qql) - if you’ve been wondering about whether machine learning technology has a place in your workflow, now is the time to find out.

Our Kubernetes meetup, KubeTalks, is taking a summer break - the [next edition](https://t.elements.scaleway.com/c/?t=b15feda-4mc-qef5-lk4-!3qql) will be on the 28th September at our Paris office!

Finally, if your work is slowing down over the summer, and you find yourself with some time spare to catch up on everything cloud-native, you can never go wrong with the CNCF’s [excellent course of Online Programs](https://t.elements.scaleway.com/c/?t=b15feda-4mc-qefk-lk4-!3qql).

May your deployments be smooth and your pipelines never fail,
[Eli](https://twitter.com/eliholderness) & the rest of the [Scaleway team](https://twitter.com/Scaleway_devs)

p.s. It’s too warm to think very hard right now, so this month’s crossword isn’t cryptic! Enjoy 🙂

![A Kubernetes-themed crossword puzzle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uj53rhks1n626po5v3w3.png)
Short Introduction
Published: 2023-08-03 21:50:30

Hey. I'm René. 

Joined to be a bit more online engaged. Started publishing some pet projects, stumbled upon a dev community. I dev, i use code, might as well learn how to use git, might as well. Better late than never.

When it comes to coding, i am more stubborn than smart. Also do some electronic design, and hardware, and music as hobby. Jack of all trades, master of none. Yet, would call programmer as my profession.

Never engaged too much in OS development, but since i figured those pet projects may be useful. Call it lazy, call it shame, but something in me told me to just git the shit up. That's how i got here.
Bandit Level 9 Level 10
Tags: bandit, ctf, overthewire, writeup
Published: 2023-08-03 21:33:15

### Introduction

Bandit10 is the eleventh level in the OverTheWire Bandit wargame. In this level, we are given a file named "data.txt" and we are required to find a string of text that occurs only once in the file and contains only letters and spaces.

### Steps

1. Open your terminal application.
2. Enter the following command to ssh into the remote server using the credentials for Bandit9:
    
    ```
    ssh bandit9@bandit.labs.overthewire.org -p 2220
    ```
    
3. Enter the password for Bandit9 `EN632PlfYiZbn3PhVK3XOGSlNInNE00t` when prompted.
4. Once you are logged in, enter the following command to read the contents of the "data.txt" file:
    
    ```
    cat data.txt
    ```
    
5. You will see that the file contains a lot of random text.
6. Next, enter the following command to extract all the printable strings from the file:
    
    ```
    cat data.txt | strings
    ```
    
7. You will see that the output includes some text surrounded by multiple equal signs.
8. To filter out only the strings that contain letters and spaces and are surrounded by equal signs, enter the following command:
    
    ```
    cat data.txt | strings | grep '^=\\{2,\\}' | awk -F " " '{print $2}' | tr '\\n' ' ' | xargs echo
    ```
    
Let's break down this command:
    
- `cat data.txt`: display the contents of the file data.txt.
- `strings`: extract human-readable strings from the binary file data.txt.
- `grep '^=\{2,\}'`: search for lines that start with two or more equal signs (==).
- `awk -F " " '{print $2}'`: print the second field of each matching line, which is the password.
- `tr '\n' ' '`: replace the newline character with a space character.
- `xargs echo`: pass the output of the previous command to echo.
    
 After running the command, the password for the next level `G7w8LIi6J3kTb8A7j9LgrywtEUlyyp6s` will be displayed.

Congratulations! You have successfully completed Bandit10 and found the flag.
Open-Source Favicon Provider
Tags: opensource, news, startup, webdev
Published: 2023-08-03 21:31:23


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

Hi Dev Community,

We've been searching for a stable favicon service for our CRM but didn't have much luck. Many existing options, such as FaviconKit and Google faviconV2, proved problematic due to rate limits, inconsistent performance, and varying icon sizes.

**We needed a solution with four main qualities:**

  1. Reliability to prevent downtime.
  2. Precision in delivering specific icon sizes, optimizing user bandwidth.
  3. High-quality resolution, offering the finest available icon for any requested size.
  4. Open-source availability, as it's a universal requirement and should be accessible for contributions and hosting.

**Here's a simple breakdown of how our solution works:**

We've crafted some strategies to acquire favicons, such as extracting them from HTML meta/link tags and utilizing Google's Favicon API. The images are then saved to S3. Generally, when the image is requested next time, it's served directly from our CDN cache. If not, it's pulled from S3.

**Our code can be found at:** https://github.com/twentyhq/favicon

As for hosting:

We have our server up and running at favicon.twenty.com. As we're using it for our CRM, Twenty, it will be well-maintained and always on. You're welcome to use it as well, just embed the images like this: https://favicon.twenty.com/google.com or https://favicon.twenty.com/google.com/64

To get a deeper look into our project, check out: https://github.com/twentyhq/twenty.
8 great software & tech podcasts 2023
Tags: programming, productivity, career, learning
Published: 2023-08-03 20:40:40

Podcasts come and go. Time and energy to listen to them also. And what a wonderful innovation they are, especially when you are learning or working in a field like software and tech.

Millions of developers means the complexity of the industry, business, culture, news, and let's not forget... the technology itself, is seemingly endless.

All you must ask is "What do I need to learn today?" and the answer will reveal itself quickly with a few keystrokes. Yet, with countless options and podcasters talking about their perspective on everything from AI to apple pie, how will you narrow it down?

To help with that, today we're sharing the [AppMap](https://appmap.io/) team's favorite podcasts. Enjoy, and let us know what you're listening to!

[Out now! [Early access to AppMap for GitHub Actions](https://info.appmap.io/early-access-to-appmap-for-ci)]

## Software & tech podcasts

[Software Engineering Radio](https://www.se-radio.net/)
The self-proclaimed "authority on translating software theory into practice." 

[Arrested DevOps](https://www.arresteddevops.com/)
Want to maximize your DevOps-ing? Check it out. One of our team has been a guest here, too!

[Data Engineering Podcast](https://www.dataengineeringpodcast.com/)
Get the goods on data management with guest engineers and entrepreneurs who are shaping the industry.

## Language-specific podcasts

[airhacks.fm podcast with Adam Bien](https://airhacks.fm/)
Stellar discussions on Java, serverless, cloud, architecture, and web!
 
[The Ruby on Rails Podcast](https://www.therubyonrailspodcast.com/)
Still going strong, this podcast is a weekly conversation about Ruby on Rails, open source software, and the programming profession.

[The Python Podcast.__init__](https://www.pythonpodcast.com/)
Another one where we've been a guest, this is a podcast about Python and the people who make it great.

## Deeper stuff

[Darknet Diaries](https://darknetdiaries.com/)
The description says it all: "Explore true stories of the dark side of the Internet with host Jack Rhysider as he takes you on a journey through the chilling world of hacking, data breaches, and cyber crime." 

[The Lex Fridman Podcast](https://lexfridman.com/podcast/)
One for that higher level, about the nature of intelligence, consciousness, love, and power. Oooo!

What would you add to this list? Any favorites to share with us? We'd love to hear about them and give them a listen!
SvelteKit: How to make code-based router, instead of file-based router [August 2023]
Tags: svelte, sveltekit
Published: 2023-08-03 20:32:42

## I. Create `urls.js` somewhere you like it:
```javascript
const urls = {
    '/'          : {re: /^\/$/,            page: 'src/home.svelte',     layout: 'src/base.svelte', error: 'src/error.svelte'},
    '/signin'    : {re: /^\/signin\/?$/,   page: 'src/signin.svelte',   parent: '/'},  // layout and error will be inherited from url with key '/'
    '/settings'  : {re: /^\/settings\/?$/, page: 'src/settings.svelte', parent: '/', layout: 'src/user.svelte'},  // layout from parent will be combined with custom layout
    '/[username]': {re: /^\/([\w]+)\/?$/,  page: 'src/feed.svelte',     parent: '/', layout: 'src/user.svelte'},
}

export function getRoutes() {
    let result = {}
    for (const [id, item] of Object.entries(Urls)) {
        const parent = item.parent ? result[item.parent] : null;
        const route = {
            id: id,
            pattern: item.re,
            params: item.params || [],
            layout: item.layout ? {
                child_pages: [],
                universal: item.universal,
                server: item.server,
                component: item.layout,
            } : null,
            leaf: {
                universal: item.universal,
                server: item.server,
                component: item.page,
            },
            error: {component: item.error || parent?.error?.component},
            endpoint: item.endpoint ? { file: item.endpoint } : null,
            parent: parent,
        }

        if (!route.params.length) {
            const matches = id.match(/\[([^\]]*)]/g) || [];
            for (const match of matches) {
                route.params.push({
                    name: match.replace('[', '').replace(']', ''),
                    matcher: undefined,
                    optional: false,
                    rest: false,
                    chained: false
                })
            }
        }

        result[id] = route;
    }
    return Object.values(result);
}
```

## 2. Add routes to `svelte.config.js`
```javascript
import {getRoutes} from './urls.js';

const config = {
    ...
    routes: getRoutes(),
    ...
}
```
## 3. Open `create_manifest_data/index.js`

> node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/index.js

**a) Find:**
```javascript
prevent_conflicts(routes);

const root = routes[0];
```
**b) Past between that two lines:**
```javascript
routes.length = 0;
routes.push(...config.routes);
```
**c) Find:**
```javascript
routes: sort_routes(routes)
```
**d) Replace with:**
```javascript
routes: routes
```

## 4. One could install `patch-package`, so this changes will be automatically applied in future without manual hacks:
```
> npm i patch-package
> npx patch-package @sveltejs/kit
```
`package.json`:
```js
{
  ...
  "scripts": {
    ...
    "postinstall": "patch-package" // <— add this
```

_That's all!_
Mastering Environment Variables in Vite+TypeScript+React
Tags: vite, typescript, react, environmentvariables
Published: 2023-08-03 20:20:07

---
title: "Mastering Environment Variables in Vite+TypeScript+React"
published: true
description: "A step-by-step guide to setting up and using environment variables in a Vite, TypeScript, and React environment, and troubleshooting common issues."
tags: vite,typescript,react,environmentvariables
---


## Table of Contents

1. Introduction
2. Setting up Environment Variables in Vite
3. Different Environment Variables for Local and Production Environment
4. Resolving 'Property 'env' does not exist on type 'ImportMeta''
5. Conclusion

## 1. Introduction

Hello everyone! Today, we'll be discussing how to utilize environment variables in a Vite + TypeScript + React setup, as well as how to resolve some common issues that may arise.

## 2. Setting up Environment Variables in Vite

First, let's look at the basic steps to set up environment variables in Vite.

1. Create a `.env` file in the root directory of your project.
2. Set your environment variables in the `.env` file. For example:

```bash
VITE_APP_TITLE=My App
```

3. Access the environment variable in your TypeScript and React code with `import.meta.env.VITE_APP_TITLE`:

```typescript
console.log(import.meta.env.VITE_APP_TITLE); // "My App"
```

## 3. Different Environment Variables for Local and Production Environment

Next, we'll see how to set up different environment variables for local and production environments.

1. Create two files in the root directory of your project: `.env.development` and `.env.production`.
2. In the `.env.development` file, set the environment variables for your local development environment. For example:

```bash
VITE_APP_TITLE=My App (Development)
```

3. In the `.env.production` file, set the environment variables for your production environment. For example:

```bash
VITE_APP_TITLE=My App (Production)
```

4. Access the environment variable in your TypeScript and React code with `import.meta.env.VITE_APP_TITLE`:

```typescript
console.log(import.meta.env.VITE_APP_TITLE); // "My App (Development)" or "My App (Production)"
```

## 4. Resolving 'Property 'env' does not exist on type 'ImportMeta''

When using environment variables in Vite, you may encounter an error saying "Property 'env' does not exist on type 'ImportMeta'". To resolve this issue, follow these steps:

1. Create a file named `vite-env.d.ts` in the root directory of your project.
2. Add the following content to this file:

```typescript
/// <reference types="vite/client" />
```

With these changes, TypeScript will recognize the type of `import.meta.env`, and the error should be resolved.

## 5. Conclusion

In this guide, we discussed how to set up and use environment variables in a Vite + TypeScript + React environment, and how to troubleshoot common issues. Vite is a powerful tool for making frontend development more efficient, but its configuration and error messages can sometimes be challenging to understand. Once you understand them, however, you can leverage its flexibility and power to the fullest.

Happy Coding!