teleren/devto huggingface dataset:
Configurare un Helm Repository su OpenShift
Published: 2023-10-03 14:25:09

---
title: Configurare un Helm Repository su OpenShift
published: true
date: 2023-01-19 00:00:00 UTC
tags: 
canonical_url: 
---

Helm è un gestore di pacchetti software che semplifica la distribuzione di applicazioni e servizi per Kubernetes e per OpenShift Container Platform.

Helm utilizza un formato di packaging chiamato _Chart_. Ma come funziona su OpenShift?

Vediamo un esempio pratico con Bitnami!

# Cosa vedrai

- [Definizione](#definizione)
- [Crea un HelmChartRepository](#crea-un-helmchartrepository)
- [Aggiorna il catalogo](#aggiorna-il-catalogo)

# Definizione

> Un Helm Chart è una raccolta di file che descrive le risorse necessarie per il deploy di un’applicazione.

Un’istanza in esecuzione del chart in un cluster è denominata _release_. Viene creata una nuova versione ogni volta che un grafico viene installato nel cluster.

Ogni volta che viene installato un chart o una release viene aggiornata o ripristinata, viene creata una nuova versione con numero incrementale.

Un _esempio_ di chart è disponibile a [questo](https://helm.sh/docs/topics/charts/) link.

# Crea un HelmChartRepository

Come prima cosa, dovrai ottenere le informazioni sul repository Helm che ti interessa; per impostazione predefinita, OpenShift 4 include il repository RedHat Helm Charts, and that’s it.

Per impostarne uno nuovo, modifica le informazioni poste tra parentesi quadre e salva il contenuto del file in un file in formato YAML:

```
apiVersion: helm.openshift.io/v1beta1
kind: HelmChartRepository
metadata:
 name: [NOME] # nome del repository
spec:
 name: [NOME] # nome del repository
 connectionConfig:
 url: [URL] # URL del repository.

```

Ad esempio, per aggiungere il repository di Bitnami, dove sono disponibili diversi prodotti come Airflow,[PostgreSQL](https://www.postgresql.org/), [Cassandra](https://cassandra.apache.org/_/index.html), [Keycloak](https://www.keycloak.org/) e molto altro, questo è il file da utilizzare:

```
apiVersion: helm.openshift.io/v1beta1
kind: HelmChartRepository
metadata:
 name: bitnami
spec:
 name: bitnami
 connectionConfig:
 url: https://charts.bitnami.com/bitnami

```

Accedi alla console OpenShift e utilizza il comando seguente per **aggiungere** l’oggetto HelmChartRepository:

```
oc login -u [USER] https://api.[HOST]:[PORT]
oc apply -f [FILE].yml

```

# Aggiorna il catalogo

Se l’installazione ha esito positivo, <ins>troverai il nuovo repository di Bitnami nel Catalogo</ins>(prospettiva “_Developer_”, in alto a sinistra nel menù!), come mostrato nella figura seguente:

![Bitnami repository](https://theredcode.it/img/bitnami-repository.png) _Bitnami repository_

# Risorse utili

- [Docker](https://amzn.to/3cSVvUG) - per cominciare bene con Docker e Kubernetes
- [Kubernetes](https://amzn.to/44bLfyR) - Guida per gestire e orchestrare i container
5 Free AI 🤖 websites to turn hours of work into minutes 🔥
Tags: ai, programming, webdev, productivity
Published: 2023-01-18 23:27:01

- Artificial Intelligence is no longer a fantasy of the future, rather a reality of the present.
- As the name suggests, it is employed in making intelligent decisions by machines.
- The following are the top 5 AI websites that will help you to do your job faster.

Happy working

🎥 {% youtube 5NCNkFgCyXg %}


####Bonus

#### Web developers tools 🛠️ you need to know💡👩‍💻

🎥 {% youtube lj4ZBJbV5yk %}

#### 7 programming 👩‍💻 tools 🔧 you should be using in 2023🎏

🎥 {% youtube djONtv0TM_E %}

#### 5 websites will make you a smarter 🏆 developer👩‍💻 

🎥 {% youtube LgkcEWC6uKY %}


### Connect with Me 😊

#### 🔗 Links

[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/mahmoud-el-kariouny-822719149/)

[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/Mahmoud42275)
3 atalhos do VS Code que você precisa conhecer (+ 1 bônus)
Published: 2023-01-18 23:24:27

Olá, pessoa. Espero que você esteja bem!

Programar é muito mais que digitar código rápido. Planejar, estruturar e produzir código legível e de fácil manutenção são de longe características mais desejáveis em um programador que a velocidade para escrever o código em si.

Ainda assim, convém ter algumas cartas na manga que acelerem alguns processos para a gente, ou que diminuam atividades repetitivas. Isso é quase um lema para nós programadores, né? Por isso vim aqui dividir com vocês as três funcionalidades do VS Code que eu uso sempre que estou programando

## Comentar bloco de código

A arte de comentar (ou não) o código rende um artigo à parte, mas não entraremos nessa seara: o fato é que todo mundo comenta o código em algum momento, seja como um recado para o seu eu do futuro, ou como uma instrução para outros devs, ou apenas para neutralizar alguns fragmentos do código durante um processo de ~~dedetização~~ debugging. Para comentar um bloco de código, o VS Code tem dois atalhos:

```
alt + shift + a

ctrl + /
```
 

## Mover fragmento de código

Suponhamos que você tomou pouco café, e que acabou colocando o seu footer antes do header. Uma solução possível é dar `ctrl + x` para recortar o footer todo, e `ctrl + v` para colar ele no lugar certo. Resolvido, muito bom.

Você também poderia fazer isso usando os atalhos:

```
alt + ↑
alt + ↓
```
Você pode usar eles em uma linha ou bloco de código. Se for uma linha, não precisa selecionar ela inteira. O atalho vai funcionar só de estar com o cursor nela. É ótimo para fazer pequenos ajustes, e movimentar blocos de código, reordenar listas, tirar ou colocar um elemento dentro de outro, etc.

## Alterar múltiplas linhas

Esse daqui é o meu favorito. Imagine que você estruturou sua navbar toda bonitinha. De repente você percebe que não colocou o href dentro da tag a. Bateu um desânimo? Não precisa mais chorar! O VS Code tem os seguintes atalhos:

```
ctrl + d
alt + click
```
Com esses atalho você pode multiplicar o seu cursor e alterar, acrescentando ou apagando, diversas linhas de código ao mesmo tempo. Nesse caso, teríamos duas alternativas:
1) Selecionar a tag `<a>` clicando e arrastando o mouse, e apertar o `ctrl + d` até que todas estejam selecionadas. Então você digita o href somente uma vez para todas.
2) Você poderia ainda segurar o `alt` e clicar em todas as linhas que quer alterar. Estando com todas selecionadas, é só inserir a informação que ficou faltando.

Depois de ter feito isso, é só apertar o `esc` que tudo volta ao normal.


## Eu prometi um bônus, né?

Essa não vale pelo atalho em si, mas para acessar outros atalhos do VS Code. Utilizando `ctrl + shit + p` e digitando "Open Keyboard Shortcuts" você tem acesso a uma lista vertiginosa de atalhos. Divirta-se.
Running Tracetest and the OpenTelemetry Demo App on HashiCorp Nomad
Tags: tutorial, nomad, tracetest, opentelemetry
Published: 2023-01-18 23:17:51

This quick little video gives a high-level overview of 
running Tracetest and the OpenTelemetry (OTel) Demo App on HashiCorp Nomad. In this demo, I run tests against traces generated by a couple of gRPC services in the OTel Demo App. 

I run Nomad locally using [HashiQube](https://github.com/avillela/hashiqube).
Open AI Codex. Your new BFF <3
Published: 2023-01-18 22:55:23

OpenAI is an AI research and deployment company. Codex, the AI coding software, was built on OpenAI’s language generation model, GPT-3, and acts as a translator between users and computers. Codex was created to be an improvement on GPT-3. Instead of being trained on web content in general, its developers specifically used open-source code repositories they scraped from various parts of the web.


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

Working with Codex is like talking to a virtual assistant such as Alexa, Siri, or Google. You ask the software to do what you want the same way you’d ask a friend for a favor.

For instance, if you’re designing a website, you can type in commands like “Display this image of a cat: https://bit.ly/3fsc0rH”

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

and "Make it 20%"

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

You can also instruct it to adjust elements by changing their font, size, or orientation. While this may seem relatively straightforward and obvious to you, to Codex, it’s a series of commands.

**Keynotes:**

-  Uses natural language to communicate 

-  Uses open-source code repositories from varies parts of the web
-  Makes fewer mistakes and unlikely to develop a 100% accuracy rate
-  The more complex the command is the harder it is to communicate it properly to the software
-  It's most capable in Python and proficient in over a dozen languages including JavaScript, Go, Perl, PHP, Ruby, Swift, TypeScript, SQL, and even Shell.
HTTP request in Javascript?
Tags: javascript, beginners, api, http
Published: 2023-01-18 22:53:19

There are several ways to make an HTTP request in JavaScript, but the most commonly used method is the XMLHttpRequest object, which is built into most modern web browsers.

Here's an example of how to use XMLHttpRequest to make a GET request to a specified URL:

```
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://example.com', true);
xhr.send();
```

You can also use the fetch() method which is more modern and easier to use

```
fetch('https://example.com')
  .then(response => response.text())
  .then(data => console.log(data))
```
You can also use libraries such as axios or superagent to handle http requests.

```
axios.get('https://example.com')
  .then(response => console.log(response.data))
```

```
const request = require('superagent');
request
  .get('https://example.com')
  .end((err, res) => {
    if (err) { console.log(err); }
    console.log(res.text);
  });
```
Also, you can use async/await feature with fetch or libraries such as axios or superagent to make your code more readable.
Plus Minus
Tags: hackerrank, python, algorithms
Published: 2023-01-18 22:47:59

Although I feel more comfortable coding in C++ and JavaScript, I've been brushing up on my Python for interview practice. The below is a walk though of how I solved the Plus Minus problem, then refactored my original answer.

The problem:
"Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with 6 places after the decimal."

How I solved it (pseudo code):

Input: Array
Output: Decimal

What I'll need:
- Because our input is an array I will either need a loop or a method that iterates through that loop.
- I’ll have to divide by the total number of items in the array, so I'll need the array length. 
- Finally I'll need to keep a tally of how many elements are in each bucket. 

I’m sure I could do this with a filter, but I’m going to smash and grab it to start so I'm going to use a for loop, use len() to grab the array length and I'll create buckets for negatives, positives, and zeros.

From there I'll use several if statements to check to see if the item falls under certain conditions, and if it does, the corresponding bucket will be incremented. All three buckets will then be printed divided by the length of the original array.

The code:
`  neg = 0
    pos = 0
    zero = 0
    length = len(arr)
    for item in arr:
        if item < 0:
            neg+=1
        if item == 0:
            zero+=1
        if item > 0:
            pos+=1
    print(pos/length)
    print(neg/length)
    print(zero/length)`

Refactoring:

Once I pressed “run code” and verified my code worked I went back and researched how to use filter for Python. 

Looking up filter I found I could use it like so to check to see if the item (x) is larger than 0 and thus positive:
`filter(lambda x: x > 0, arr)`

The filter method returns an array so I need to chain it with list to print it out: `list(filter(lambda x: x > 0, arr))`

From there I can chain it to len() to get the length or size of that array: 
`len(list(filter(lambda x: x > 0, arr)))`

The length will directly correlate to the number of items that are positive, negative, or zero. 

From there I could divide the length of my filtered array by len(arr), the size of the original array, to print out the decimal value of each fraction. 

My final code:

`print(len(list(filter(lambda x: x > 0, arr)))/len(arr))
 print(len(list(filter(lambda x: x < 0, arr)))/len(arr))
 print(len(list(filter(lambda x: x == 0, arr)))/len(arr))`
Day 676 : always
Tags: hiphop, code, coding, lifelongdev
Published: 2023-01-18 22:39:25

_liner notes_:
- Professional : Pretty productive day. I finished up some documentation and published the Web Component I was working on yesterday. Ran into an issue with a certain plugin not being available so I figured out a way around it so that it doesn't need it. Had a meeting with some folks for a project that we'll be doing later. Got a request to update some dependencies in a GitHub repo, so I knocked that out. Started working on a new Web Component. Not a bad day at all.

- Personal : Went through some tracks for the radio last night and bought some albums on Bandcamp. Did some more research on the infrastructure for my next side project. I think I may have figured out a place that will give me everything I'm looking for. Next step to build out something quick to verify and then start working on the project. Didn't get to watch "Bullet Train" though.

![A lake that formed in a crater surrounded by mountains that go into the distance in Empakaai Crater, Tanzania](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nrs8d9ib57zl0b7tpeqw.jpg)

Now that I know a place that has what I need for this project, my next step is to see if I can get all the pieces working together. Going to try to deploy a "Hello World" type of application that has the basics of all the things I want. Then I'll try and mold everything to how I want and get the different parts interacting with each other. I want to go through tracks for the radio show and hopefully watch "Bullet Train". We'll see. There's always something to work on. haha

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube ySpUmzs0Wjs %}
Building habits will change your life: 3 lessons from “Atomic Habits” to build habits and stick with them.
Tags: career, writing, productivity, watercooler
Published: 2023-01-18 22:36:21

Want to skyrocket your productivity and conquer your goals?

Here are the top 3 takeaways on habit building from the NYT bestseller "Atomic Habits" by James Clear. 🔥💪📚

---

**Habits are one of the most impactful factors that can alter your life.**

Building habits can help you succeed in your personal and professional lives and achieve most of your goals. "Atomic Habits" by James Clear is one of the most well-known books on habit-building.

I read it and summarized the top three points so you can save time and begin habit-building immediately.

## Small changes will have a big impact.

**Small, consistent behavioral changes will have a large impact over time.**


Concentrate on developing small (atomic) habits. They are small, specific, and easily incorporated into daily routines, and they will gradually build momentum to help you achieve your goals. Once you've mastered the small habits and are "in motion," you can combine them with others to achieve larger goals.

Building momentum is crucial. You need to walk in order to reach the goal line.

## Habits are formed by the cue, craving, response, and reward cycle:

All habits are enabled by a single loop:

1. **A cue** that causes a behavior to occur
2. **A craving** caused by the cue (a desire to fulfill a specific need)
3. **A reaction** to satiate that desire (the actual habit)
4. **The reward** (the satisfaction of fulfilling that craving)

Understanding this loop is essential for unlocking your habit-building potential.

You can use this loop to either incentivize "good" or de-incentivize "bad" habits.

**Incentivize good habits by placing more cues** in your environment. For example, pack your gym bag before bed, so it's the first thing you see in the morning. Preparing your environment the right way will give you more cues that trigger your "good" habits.

Use the same strategy to **discourage bad behavior by hiding cues** that cause a craving you don't like. If you want to eat fewer snacks, avoid leaving the cookie jar on the table. 

**Create an environment that makes it easy to stick to your habits.**

## Focus on systems rather than goals.

Targeting a goal will make it more challenging to achieve.

Instead, **concentrate on creating a system that supports your goal**. A key concept here is to become the ideal person who achieves your goals.

Instead of becoming healthy, strive to become a person who makes healthy choices. This method is also useful when making decisions. Consider what the person you want to be would do.

**By consistently doing, what your ideal person would do, you will eventually become that person.**
Why cloud hosting is better than self-hosting.
Tags: cloud, computing, servers, technology
Published: 2023-01-18 22:35:51

---
title: Why cloud hosting is better than self-hosting.
published: True
description: 
tags: Cloud, computing, servers, technology
cover_image: https://images.pexels.com/photos/4508751/pexels-photo-4508751.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2
# Use a ratio of 100:42 for best results.
# published_at: 2023-01-18 22:21 +0000
---

Cloud hosting is rapidly becoming the preferred method of hosting for businesses and individuals alike, and for good reason. In this post, I will explore the many benefits of cloud hosting over self-hosting, including cost savings, scalability, and reliability.

One of the biggest advantages of cloud hosting is cost savings. With self-hosting, you are responsible for purchasing, maintaining, and updating your own servers and hardware. This can be a significant expense, especially for small businesses or individuals who may not have the budget for expensive equipment. With cloud hosting, however, you pay only for the resources you use, and you never have to worry about the cost of maintaining or upgrading your own hardware.

Another major benefit of cloud hosting is scalability. Self-hosting can be problematic when it comes to scaling up your website or application to meet increased demand. With cloud hosting, however, you can easily scale up or down as needed, without the need to purchase additional hardware or worry about the cost of maintaining it. This makes cloud hosting a much more flexible option for businesses and individuals who need to be able to quickly adapt to changing traffic levels.

Reliability is another key advantage of cloud hosting. With self-hosting, if a server goes down, your website or application will be unavailable until the problem is resolved. With cloud hosting, however, your website or application is automatically distributed across multiple servers, so if one goes down, the others will pick up the slack. This means that your website or application will be less likely to go down, and if it does, it will be back online much more quickly.

Cloud hosting also provides additional benefits such as security, ease of use, and disaster recovery. Cloud hosting providers typically invest a lot in security, which can help protect your website or application from cyber attacks. Additionally, cloud hosting is typically much easier to use than self-hosting, especially for those without a lot of technical expertise. And if a disaster occurs, cloud hosting providers often have backup and disaster recovery plans in place to ensure that your data is safe and can be restored quickly.

In conclusion, cloud hosting is a better option than self-hosting for businesses and individuals looking to host their website or application. With cost savings, scalability, and reliability, cloud hosting offers several advantages over self-hosting. Additionally, cloud hosting also provides improved security, ease of use, and disaster recovery options. If you are currently self-hosting, it is definitely worth considering moving to a cloud hosting solution.
SRE book notes: Monitoring Distributed Systems
Tags: sre, books, monitoring
Published: 2023-01-18 22:29:23

These are the notes from [Chapter 6: Monitoring Distributed Systems](https://sre.google/sre-book/monitoring-distributed-systems/) from the book [Site Reliability Engineering, How Google Runs Production Systems](https://sre.google/sre-book/table-of-contents/).

This is a post of a series. The previous post can be seen here:

{% embed https://dev.to/bitmaybewise/sre-book-notes-eliminating-toil-5am5 %}

---

> you should never trigger an alert simply because "something seems a bit weird."

> Effective alerting systems have good signal and very low noise.

---

> to keep noise low and signal high, the elements of your monitoring system that direct to a pager need to be very simple and robust. Rules that generate alerts for humans should be simple to understand and represent a clear failure.

---

> Your monitoring system should address two questions: what’s broken, and why?

> The "what’s broken" indicates the symptom; the "why" indicates a (possibly intermediate) cause.

> "What" versus "why" is one of the most important distinctions in writing good monitoring with maximum signal and minimum noise.

---

> The four golden signals of monitoring are latency, traffic, errors, and saturation. If you can only measure four metrics of your user-facing system, focus on these four.

> If you measure all four golden signals and page a human when one signal is problematic (or, in the case of saturation, nearly problematic), your service will be at least decently covered by monitoring.

---

> an HTTP 500 error indicates a failed request, factoring 500s into your overall latency might result in misleading calculations. On the other hand, a slow error is even worse than a fast error! Therefore, it’s important to track error latency, as opposed to just filtering out errors.

> Note that many systems degrade in performance before they achieve 100% utilization, so having a utilization target is essential.

Saturation can be defined as:

> How "full" your service is.

> saturation is also concerned with predictions of impending saturation, such as "It looks like your database will fill its hard drive in 4 hours."

---

> It’s important that decisions about monitoring be made with long-term goals in mind. Every page that happens today distracts a human from improving the system for tomorrow

---

If you liked this post, consider subscribing to my newsletter [Bit Maybe Wise](http://bitmaybewise.com/).

You can also follow me on [Twitter](https://twitter.com/bitmaybewise) and [Mastodon](https://mastodon.online/@bitmaybewise).

---

Photo by [Chris Liverani](https://unsplash.com/@chrisliverani) on Unsplash