teleren/devto huggingface dataset:
Cloud native homelab, Part 2: Kubernetes + Ceph
Tags: raspberrypi, homelab, kubernetes, ceph
Published: 2023-10-25 01:57:08

---
series: Build a cloud native homelab
---

In Part 1 of this series we went over the hardware you'll need to get started on your cloud native homelab, where hopefully I've convinced you to choose Raspberry Pi boards and a cooling solution.

For the best performance we'll use SSDs for the boot partition as well as the storage cluster. This will give us a huge advantage over microSD cards in both speed and reliability.

In this example we'll use: 
* 2 Raspberry Pi 4B boards. I used an 8GB model for the control plane node and a 4GB model for a worker node.
* 2 SATA SSDs with USB adapters (ASMedia chipset).
* 1 microSD card to flash the USB bootloader to the Pis.
* Cluster case with fans.

Here's what my homelab looks like. It also has a Raspberry Pi 2 that serves as a retro gaming console but for this post we'll be focusing on the Kubernetes cluster.


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


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

Our cluster will have a lightweight distribution of both Kubernetes and Ceph, a unified storage service with block, file, and object interfaces.

I've documented how to set up a Raspberry Pi and SSD in an automated, cloud native way in my notes here:

[Raspberry Pi](https://santisbon.github.io/reference/rpi/)

Follow those instructions to:

1. Set up your Pi to **boot from SSD**.
2. **Get the OS image** (Ubuntu for Raspberry Pi).
3. Following the instructions on the **setup** section, **flash the image** on the SSD.
4. **Verify** that the automatic setup worked correctly. Do not continue without first fixing any errors found.

Repeat the process for each Raspberry Pi you have. Once you're done you'll have your Pi devices with MicroK8s installed, all software updated, and relevant kernel modules added.

Now it's time to configure our MicroK8s and MicroCeph cluster. I documented the process in my notes here: 

[MicroK8s](https://santisbon.github.io/reference/microk8s/)

Follow those instructions to set up:

1. MicroCeph cluster.
2. MicroK8s cluster.
3. Connect MicroK8s to the external MicroCeph cluster.
4. (Optional) MicroK8s dashboard.

🎉 You're done! 🍾

Here's what a Ceph cluster looks like with 2 nodes and 3 (virtual) disks on each node/SSD:

![Cluster status](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/86xao3ftbytir2myg61b.png)

Come back soon for part 3 where we'll deploy some workloads to our cluster.
Memes - 1
Tags: jokes, watercooler
Published: 2023-10-25 01:17:03

Enjoy these Memes!

![Why](https://i.imgflip.com/83lqmz.jpg)


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


![Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdzftirh7t968du6jdyl.png)
Next shadcn firebase auth boilerplate
Tags: boilerplate, firebase, nextjs
Published: 2023-10-27 06:36:44

---
title: Next shadcn firebase auth boilerplate
published: true
date: 2023-10-25 00:17:00 UTC
tags: Boilerplate,Firebase,Nextjs
canonical_url: https://reactjsexample.com/next-shadcn-firebase-auth-boilerplate/
---

## Next Shadcn Firebase Auth Boilerplate
 ![Next shadcn firebase auth boilerplate](https://reactjsexample.com/content/images/2023/10/Code_2023-10_22-12-02.jpg)

This is a Boilerplate that uses `NEXTJS` – `SHADCNUI` – `REACT HOOK FORM` – `ZOD` – `FIREBASE` to create an authentication system.

You must therefore create your firebase project at home and fill in this information in your `.env` file

```
NEXT_PUBLIC_FIREBASE_API_KEY="xxx"
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="xxx"
NEXT_PUBLIC_FIREBASE_PROJECT_ID="xxx"
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="xxx"
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="xxx"
NEXT_PUBLIC_FIREBASE_APP_ID="xxx"
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID="xxx"

```

![Next shadcn firebase auth boilerplate](https://user-images.githubusercontent.com/62269693/277043409-bcb549fe-e46a-45b4-9b0b-2ba5d5286057.png)

## Authentication methods

Currently there are 3 authentication methods:

- Google
- Email/Password
- GitHub

To add one of these methods, you must enable it in your firebase console

### GOOGLE

![Next shadcn firebase auth boilerplate](https://user-images.githubusercontent.com/62269693/277034936-ed0787d2-9eb2-4bef-a977-71ae7a16820d.png)

### EMAIL / PASSWORD

![Next shadcn firebase auth boilerplate](https://user-images.githubusercontent.com/62269693/277034970-e2f13346-9cec-4454-932d-ae40e6a1614c.png)

### GITHUB

You must create your application on your github to have this information [https://github.com/settings/developers](https://github.com/settings/developers)

![Next shadcn firebase auth boilerplate](https://user-images.githubusercontent.com/62269693/277034874-1fe2520c-3b8b-4149-9929-a7bc042931c0.png)

## GitHub

[View Github](https://github.com/ln-dev7/next-shadcn-firebase-auth-boilerplate?ref=reactjsexample.com)
Phalcon v5.4.0 Released
Tags: phalcon, phalcon5, release
Published: 2024-02-08 18:03:17

---
title: Phalcon v5.4.0 Released
published: true
date: 2023-10-25 00:01:02 UTC
tags: phalcon,phalcon5,release
canonical_url: 
---

We are happy to announce that Phalcon v5.4.0 has been released!


This release fixes a few bugs and introduces the ability to reset HTML `meta` tags on demand.

A huge thanks to our community for helping out with bug fixing and more importantly bug reporting!

## Changelog

### Changed

- Changed `Phalcon\Mvc\Model::getMessages()` to also filter with an array of fields [#16265](https://github.com/phalcon/cphalcon/issues/16265)
- Changed `Phalcon\DataMapper\Query\Select::columns()` to accept an array of columns (keys as aliases) instead of `func_get_args` [#16451](https://github.com/phalcon/cphalcon/issues/16451)
- Changed `Phalcon\Html\Helper\AbstractSeries::__invoke()` to no longer clear the internal store when called [#16441](https://github.com/phalcon/cphalcon/issues/16441)

### Added

- Added the ability to define interpolator characters for the `Phalcon\Logger\Formatter\Line` [#16430](https://github.com/phalcon/cphalcon/issues/16430)
- Added `Phalcon\Html\Helper\AbstractSeries::reset()` to clear the internal store when needed [#16441](https://github.com/phalcon/cphalcon/issues/16441)

### Fixed

- Model Annotation strategy did not work with empty\_string [#16426](https://github.com/phalcon/cphalcon/issues/16426)
- View::reset() sets content to null instead of default empty string [#16437](https://github.com/phalcon/cphalcon/issues/16437)
- Fixed `Phalcon\Filter\Validation\Validator\Size\*` validators to correctly detect the size of uploaded files [#16390](https://github.com/phalcon/cphalcon/issues/16390)

## Upgrade

Developers can upgrade using PECL

```
pecl install phalcon-5.4.0

```

To compile from source, follow our [installation document](https://docs.phalcon.io/5.0/en/installation)
Is Comfort Overrated?
Tags: discuss, codenewbie, beginner
Published: 2023-10-25 00:00:00

---
published_at : 2023-10-25 00:00 +0000
---
How do you interpret the quote by Rumi, "Forget safety. Live where you fear to live. Destroy your reputation. Be notorious," in the context of your own journey and aspirations?

Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*
Key Python Concepts for Your Coding Journey?
Tags: discuss
Published: 2023-10-25 00:00:00

---
published_at : 2023-10-25 00:00 +0000
---
Python enthusiasts and programmers, which Python concepts do you believe have the most significant impact on your programming journey?

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
Base64 problem solved
Tags: javascript, webdev, programming, opensource
Published: 2023-10-24 23:35:53

I just published an [npm package](https://www.npmjs.com/package/base64-transcode) that tackles the challenges associated with Base64 encoding and decoding in both browser and Node.js environments, while also offering support for handling binary files.

## Problem 🤔
If you've ever encountered issues with the `atob` and `btoa` methods when working with `utf-8` strings on the frontend, you know the kind of challenges they can pose. These built-in methods do not handle utf-8 characters correctly and can result in errors. The [base64-transcode](https://www.npmjs.com/package/base64-transcode) npm package aims to address this problem and provide a solution.

## How It Solves the Problem 🛠️
The package enables seamless Base64 encoding and decoding on both the frontend and backend. This means you can use the same package and syntax in both the browser and Node.js environments. Furthermore, the package supports handling binary files, making it easy to work with them on the backend.

## Compatibility 🌟
This package supports `CommonJS`, `ES Modules`, and `IIFE` (Immediately Invoked Function Expression) formats. You can safely use both `require` and `import` statements in any environment. `TypeScript` also supported.

## A simple example of how to use it 🚀
It's a simple way to convert data to and from Base64 encoding in modern JavaScript. 
```javascript
// Don't forget to install the package...
// "yarn add base64-transcode" or "npm i base64-transcode"
import Base64 from 'base64-transcode';

// Decoding
const decodedData = Base64.decode('SGVsbG8gV29ybGQh');
console.log(decodedData); // "Hello World!"

// Encoding
const encodedData = Base64.encode('Hello World!');
console.log(encodedData); // "SGVsbG8gV29ybGQh"
```

## How you can use it with traditional html 💪
And the same example for raw html, in case you don't use any bundler.
```html
<script src="https://unpkg.com/base64-transcode/dist/browser.js"></script>
<script>
  // Decoding
  const decodedData = Base64.decode('SGVsbG8gV29ybGQh');
  console.log(decodedData); // "Hello World!"

  // Encoding
  const encodedData = Base64.encode('Hello World!');
  console.log(encodedData); // "SGVsbG8gV29ybGQh"
</script>
```

## API documentation 📚
You can find documentation and detailed information 
- on the [GitHub Repo](https://github.com/toviszsolt/base64-transcode)
- on the [Npm Package](https://www.npmjs.com/package/base64-transcode)

## Final words 🌈
In a world where data encoding and decoding are vital tasks for web development, the [base64-transcode](https://www.npmjs.com/package/base64-transcode) package emerges as a savior. It seamlessly resolves the quirks and challenges of Base64 operations, making life easier for developers on both the frontend and backend. 

With its support for binary files and compatibility across various module systems, this package simplifies the handling of data. Embrace [base64-transcode](https://www.npmjs.com/package/base64-transcode) and unlock the power of smooth, hassle-free Base64 operations in your projects.

Happy coding! 😊🚀
O uso antiético de um leitor de código de barras
Tags: security
Published: 2023-10-24 23:30:55

## BadBarcode

Recentemente, durante uma manutenção de automação comercial com qual eu estava trabalhando, me deparei com uma vulnerabilidade alarmante que poderia ser explorada utilizando um leitor de código de barras. Vou explicar o porquê.

Para entendermos o cenário, é essencial compreender o funcionamento básico de um leitor de código de barras. Segundo a Wikipedia, esses dispositivos utilizam um raio laser como fonte de luz e geralmente contêm um espelho ou prisma rotativo para escanear o feixe de laser e receber os dados do código de barras. O processo envolve a análise da luz refletida a partir do código de barras por um fotodiodo, que mede a intensidade da luz refletida. Tanto os leitores de caneta quanto os scanners a laser interpretam a luz emitida pelo leitor por meio de variações nos padrões de reflexão, usando esses padrões para receber dados. 

> É essencial notar que o leitor de barras envia as informações para o computador simulando um teclado.

Os códigos de barras, conhecidos por sua representação de dados por meio da reflexão ou absorção de luz, consistem em sequências de zeros e uns, semelhantes a um QR code, mas de forma mais simples. Importante destacar que os códigos de barras seguem padrões globais para garantir sua utilidade em todo o mundo. Alguns dos padrões mais conhecidos incluem EAN-13, EAN-9, CODE-39, CODE-128 e PostNet. Entretanto, nosso foco será no CODE-128. Diferentemente de outros padrões, o CODE-128 aceita não apenas caracteres hexadecimais clássicos, mas também símbolos como barras e colchetes, oferecendo diversas possibilidades de exploração.

Para ilustrar essa vulnerabilidade, apresento um exemplo prático em [um vídeo](https://www.youtube.com/watch?v=raheL4DOfkM). Nele, você poderá observar como um atacante utiliza um QR code para armazenar informações, mas o conceito se aplica igualmente a códigos de barras.

Para testar essa vulnerabilidade na sua casa, você pode utilizar um aplicativo que emula um leitor de código de barras, como [este](https://barcodetopc.com/), e capturar os atalhos do seu teclado com um keylogger, como [este](https://github.com/Thoffyy/keypy). 

Se você deseja criar um código de barras de teste, pode fazê-lo [aqui](https://barcode.tec-it.com/en/Code128?data=%5Cx03). O código de barras no link já contém a informação "\x03", que representa o comando ctrl+c. Vale mencionar que você pode encontrar várias combinações rapidamente com o keylogger, já que não encontrei documentação específica sobre essa interpretação de teclas na internet.

(Uma observação importante: esta "falha" já havia sido descoberta anteriormente por chineses da "Tencent Security Xuanwu Lab" [site deles](https://xlab.tencent.com/en/)). Apesar disso, considero minha "descoberta" uma redescoberta interessante 😁 [Link do relatório deles](https://xlab.tencent.com/badbarcode/#:~:text=Symbologies%20such%20as%20Code%20128,combined%2C%20become%20a%20security%20vulnerability).

[HackTheWorld](https://github.com/Thoffyy)
how does GPS (global positioning system)work
Tags: webdev, data
Published: 2023-10-24 23:28:10

The Global Positioning System (GPS) is a navigation system owned by the United States government that's made up of three main segments²:

1. **The Space Segment**: This is a navigation system of at least 31 satellites, 24 (or more) of which are usually in flight and operational. These satellites fly within Earth's orbit at an altitude of 12,550 miles.
2. **The Control Segment**: This is an international network of control stations that track, monitor, and maintain the satellites in orbit.
3. **The User Segment**: This is for civilians and our GPS devices, also known as GPS receivers since they receive signals from the satellites in orbit to pinpoint our locations.

A device with built-in GPS – whether it’s a dedicated in-car GPS navigation unit or a smartphone – only acts as a GPS receiver. A device with GPS isn’t actually “contacting” satellites to determine its location. Instead, it’s just listening for the radio signals that are being broadcast from these satellites all the time.

Once the receiver calculates its distance from four or more GPS satellites, it can figure out where you are. They can usually determine where you are within a few yards of your actual location. More high-tech receivers, though, can figure out where you are within a few inches!

As for the code used in GPS, there are two main types: the coarse/acquisition (C/A) code and the precision (P) code. The C/A code is freely available to the public, while the P-code is usually reserved for military applications. The P code is called the Precise code. It is a particular series of ones and zeroes generated at a rate of 10.23 million bits per second. Each GPS satellite is assigned a part of the P-code all its own and then repeats its portion every 7 days. This assignment of one particular week of the 37-week-long P-code to each satellite helps a GPS receiver distinguish one satellite’s transmission from another.
Shell script for laptop warranty info
Tags: atera, shell, script, warranty
Published: 2023-10-24 23:10:23

Hi there dev community.

I am fairly new to shell scripting.

Objective:
Run a script centrally to populate custom fields in Atera

I have been working on a script **(Script1)** to populate custom fields in Atera.  The script  is deployed to Atera and works fine on each workstation but I realized that I could run it once centrally to not have to wait for each workstation to come online.(Since Atera already has all the serial numbers for all the machines in our fleet) 

I have another script **(Script2)** which pushes data into an array. 

Can I take the data created in **Script1** (filter for machines without warranties set) and put them through the warranty check portion of **Script2** to populate the warranty fields for all the machines in Atera. 

If you can think of a better way to do it be my guest.

I am happy to share the script I have done so far.

Thank you dev community for your help!!
🎬 Video - Page load in default page tutorial on CodeBehind framework
Tags: csharp, html, css, dotnet
Published: 2023-10-24 22:09:09

Elanat framework new video on YouTube channel.

YouTube channel link:
[https://www.youtube.com/@elanatframework](https://www.youtube.com/@elanatframework)

In this tutorial, we want to teach how to dynamically call pages using the CodeBehind framework.

The audio on the video is the English text read by google translate and allows you to access a quality subtitle in all languages of the world.

Note: The size of the video is very small; watch in 1080 quality (29 minutes in only 216 MB).

{% embed https://www.youtube.com/watch?v=tUujTKOHFq8 %}

CodeBehind in NuGet:
[https://www.nuget.org/packages/CodeBehind](https://www.nuget.org/packages/CodeBehind)

CodeBehind repository link:
[https://github.com/elanatframework/Code_behind](https://github.com/elanatframework/Code_behind)

CodeBehind page in Elanat website:
[https://elanat.net/page_content/code_behind](https://elanat.net/page_content/code_behind)
Hey guys, how are you with Hacktoberfest, let's talk!
Tags: discuss, hacktoberfest, hacktoberfest23
Published: 2023-10-24 21:39:27

Hey guys, how are you?!

[Hacktoberfest](https://hacktoberfest.com/) is happening and I see a lot of really cool movements, like articles here on Dev and in the community on Discord! (And that's really cooooll)

I made some contributions and I'm working on three [Angular Issues](https://github.com/angular/angular/issues), take a look:

- [docs(docs-infra): add new component imports documentation structure](https://github.com/angular/angular/pull/52282)
- [docs(docs-infra): change elements theme color variable in dark mode](https://github.com/angular/angular/pull/52125)
- [docs(docs-infra): add version information element to the header](https://github.com/angular/angular/pull/51789)

___

And you, how are you?!

How are the contributions?!

How is the experience of looking at countless repositories in different ways?! 

Are you having difficulties?!

Let's talk, help our contributing partners or just chat! 😄😄🤟🤟
KPC ELEC : Votre Électricien à Grenoble pour un Travail de Qualité à un Tarif Raisonnable
Tags: electricien, grenoble
Published: 2023-10-24 21:08:20

Lorsque vous recherchez un électricien à Grenoble pour vos besoins résidentiels ou commerciaux, il est essentiel de trouver une entreprise fiable qui offre un travail de qualité supérieure à un tarif raisonnable. C'est là qu'intervient KPC ELEC, une entreprise qui se démarque par son engagement envers la satisfaction des clients et son suivi méticuleux des travaux.

1. L'importance de choisir le bon électricien à Grenoble

Le choix de l'électricien qui s'occupera de vos projets électriques est crucial pour la sécurité et la fonctionnalité de votre maison ou de votre entreprise. KPC ELEC est une entreprise locale qui comprend l'importance de ce choix.

2. KPC ELEC : Votre partenaire de confiance

En tant qu'entreprise établie à Grenoble, KPC ELEC a bâti une solide réputation pour son professionnalisme, son expertise et sa qualité de travail supérieure. Ils ont les compétences et l'expérience nécessaires pour répondre à tous vos besoins électriques.

3. Un tarif raisonnable pour tous les budgets

KPC ELEC s'engage à proposer des tarifs raisonnables à ses clients. Ils comprennent que les besoins électriques peuvent varier, c'est pourquoi ils proposent des solutions personnalisées qui respectent votre budget.

4. Qualité de travail supérieure à chaque étape

KPC ELEC ne fait pas de compromis en matière de qualité. Leur équipe d'électriciens qualifiés utilise les meilleures pratiques de l'industrie pour garantir que chaque projet est réalisé avec une qualité supérieure.

5. Suivi de travaux transparent et méticuleux

KPC ELEC est déterminé à maintenir une communication transparente avec ses clients à chaque étape du processus. Ils assurent un suivi méticuleux des travaux pour s'assurer que tout est conforme à vos attentes.

6. Services résidentiels et commerciaux

Que vous ayez besoin de services électriques pour votre maison ou votre entreprise à Grenoble, KPC ELEC peut répondre à vos besoins. Leur expertise couvre une large gamme de services électriques.

7. Des solutions durables et éco-responsables

KPC ELEC est également soucieuse de l'environnement. Ils proposent des solutions électriques durables et éco-responsables qui contribuent à réduire votre empreinte carbone.

8. Des recommandations positives de clients satisfaits

La satisfaction des clients est une priorité pour KPC ELEC. Leurs nombreuses recommandations positives témoignent de leur engagement envers un service de qualité.

9. Contactez KPC ELEC dès aujourd'hui

Si vous recherchez un électricien à Grenoble offrant un tarif raisonnable, une qualité de travail supérieure et un suivi de travaux méticuleux, contactez KPC ELEC dès aujourd'hui. Ils sont prêts à répondre à vos besoins électriques de manière professionnelle et fiable. Votre satisfaction est leur priorité absolue.
Announcing v1.3.0 of my queue package implemented in Golang
Tags: go, programming, opensource
Published: 2023-10-24 20:41:24

https://github.com/adrianbrad/queue

I'm happy to announce that I've released v1.3.0 of my #queue #golang package: A Linked Queue implementation was added, complementing the Circular, Blocking, and Priority queues. All structures align with the standard Queue interface.

The package also contains various artifacts that could interest a broader audience. These artifacts include: CI scripts(coverage, lint, testing), golang-ci lint config file, commitizen, example tests, benchmarks and documentation provided by godoc.
Industrial Grade Codebase: Associations and Validations
Published: 2023-10-24 20:39:26

Some additional notes about ways you can modify your tables in your ActiveRecord migrations:

-You can use `index: false` to shut off indexing. This is useful because each index you add to your table increases how much storage space it takes up. This is especially important if the size of your table is large. Additionally, indexes slow down Create, Update, and Delete operations because the index needs to be updated along with the rest of that data.

-`null: false` makes it so that this column cannot be empty.

-You have to use a `class_name: "Example"` in your association in the case that you are deviating from convention. Conversely, you use `foreign_key: "example_id" when the foreign key deviates from convention. Class_name specifies the model you are connecting to with the association, whereas foreign_key specifies the column in the table that connects to the model.

**Association Accessors**

**belongs_to**

`belongs_to` is a direct association accessor. It adds an automatic validation to foreign key columns making a foreign key required unless you override this by adding `optional: true`. If you remove `null: false` from any foreign key column in the migration file, you must add `optional: true` to the corresponding `belongs_to`.

**counter_cache**

`counter_cache` can be added to any `belongs_to` to keep track of the number of children objects.