teleren/devto huggingface dataset:
Modificare allarme di spazio libero per un disco in Netdata
Tags: linux, monitoring, italian, netdata
Published: 2023-03-13 14:01:40

Dall'interfaccia web di Netdata, in alto a destra, si vedono gli allarmi e, nei dettagli di ognuno, sono specificati i relativi file di configurazione.

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

Ad es., dai dettagli sopra si vede che l'allarme è configurato nel file _/opt/netdata/usr/lib/netdata/conf.d/health.d/disks.conf_

Se vogliamo che l'allarme per il disco _/mnt/disco_utenti_ abbia regole diverse rispetto a quelle per gli altri dischi, possiamo modificare la configurazione così:

```bash
nano /opt/netdata/usr/lib/netdata/conf.d/health.d/disks.conf
```

1. Escludo il disco _/mnt/disco_utenti_ dalla configurazione attuale modificando la lista _families_:

```
# -----------------------------------------------------------------------------
# low disk space

# checking the latest collected values
# raise an alarm if the disk is low on
# available disk space

 template: disk_space_usage
       on: disk.space
    class: Utilization
     type: System
component: Disk
       os: linux freebsd
    hosts: *
 families: !/mnt/disco_utenti !/mnt/disco_utenti !/dev !/dev/* !/run !/run/* *
     calc: $used * 100 / ($avail + $used)
    units: %
    every: 1m
     warn: $this > (($status >= $WARNING ) ? (80) : (90))
     crit: $this > (($status == $CRITICAL) ? (90) : (98))
    delay: up 1m down 15m multiplier 1.5 max 1h
     info: disk ${label:mount_point} space utilization
       to: sysadmin
```

1. Aggiungo alla configurazione una nuova sezione per l'allarme del disco _/mnt/disco_utenti_:

```
# -----------------------------------------------------------------------------
# low disk space

# checking the latest collected values
# raise an alarm if the disk is low on
# available disk space

 template: disk_space_usage
       on: disk.space
    class: Utilization
     type: System
component: Disk
       os: linux freebsd
    hosts: *
 families: /mnt/disco_utenti
     calc: $used * 100 / ($avail + $used)
    units: %
    every: 10m
     warn: $this > (($status >= $WARNING ) ? (96) : (98))
     crit: $this > (($status == $CRITICAL) ? (98) : (99))
    delay: up 1m down 15m multiplier 1.5 max 1h
     info: disk ${label:mount_point} space utilization
       to: sysadmin

 template: disk_inode_usage
      on: disk.inodes
    class: Utilization
     type: System
component: Disk
       os: linux freebsd
    hosts: *
 families: !/dev !/dev/* !/run !/run/* *
     calc: $used * 100 / ($avail + $used)
    units: %
    every: 1m
     warn: $this > (($status >= $WARNING)  ? (80) : (90))
     crit: $this > (($status == $CRITICAL) ? (90) : (98))
    delay: up 1m down 15m multiplier 1.5 max 1h
     info: disk ${label:mount_point} inode utilization
       to: sysadmin
```

Riavviare Netdata:

```bash
systemctl restart netdata
```
Pinia: Setup syntax ile oluşturulan depoların sıfırlanması
Tags: vue, vue3, pinia, javascript
Published: 2023-03-13 13:59:31

Pinia ile depo oluşturmanın iki yolu vardır. Function/Setup yöntemini kullanıyorsanız **$reset** metodunun işlevini yerine getirmediğini fark etmiş olabilirsiniz.

```js
<script setup>
import { useStore } from './useStore'

const store = useStore()

store.$reset // 👈

</script>
```

```bash
🍍: Store "main" is build using the setup syntax and does not implement $reset().
```

Metodun Setup syntax ile çalışmasını sağlamak için bir Pinia eklentisi oluşturacağız ✨

**Stores** klasörünüz içerisinde **plugins** isimli bir klasör oluşturun ve içerisinde **resetStore.js** isimli bir dosya oluşturun.

Unutmadan projenize https://www.npmjs.com/package/lodash.clonedeep paketini eklediğinizden emin olun. lodash.clonedeep ile depo'nun başlangıç durumunu derinlemesine kopyalarız ve $reset fonksiyonunu ekleriz. Bu fonksiyon depo durumunu başlangıç değerine sıfırlar. Kopya kendisiyle ilişkili referansları kaldırmak için durumu tekrar derinlemesine kopyalamak önemlidir.

resetStore.js
```js
import cloneDeep from 'lodash.clonedeep'

export default function resetStore({ store }) {
  const initialState = cloneDeep(store.$state)
  store.$reset = () => store.$patch(cloneDeep(initialState))
}
```

Ardından main.js veya Pinia'yı başlattığınız herhangi bir yerde şunları yapın:

main.js
```js
// ...
import { resetStore } from './stores/resetStore'

//...
const pinia = createPinia()
pinia.use(resetStore)

app.use(pinia)

//...
```

Örneğin ben bir projemde <u>vitesse boilerplate</u> kullanıyorum ve pinia **_src_** klasörü altındaki **_modules_** isimli bir klasörün içinde **_pinia.ts_** dosyası içerisinde oluşturuluyor.

src/modules/pinia.ts
```js
import { createPinia } from 'pinia'
import { type UserModule } from '~/types'
++ import storeReset from '~/store/plugins/storeReset'

// Setup Pinia
// https://pinia.vuejs.org/
export const install: UserModule = ({ isClient, initialState, app }) => {
  const pinia = createPinia()
  app.use(pinia)
 ++ pinia.use(storeReset)
  // Refer to
  // https://github.com/antfu/vite-ssg/blob/main/README.md#state-serialization
  // for other serialization strategies.
  if (isClient)
    pinia.state.value = (initialState.pinia) || {}

  else
    initialState.pinia = pinia.state.value
}
```

bundan sonra storeName.$reset() metodu çalışacaktır.

## Örnek kullanım
Kullanıcı sayfadan ayrıldığında store'u sıfırla.

~/src/pages/tonality.vue
```js
onBeforeRouteLeave((to, from, next) => {
  console.log('onBeforeRouteLeave called')
  console.log('to: ', to)
  console.log('from: ', from)
  tonalityGuessingStore.$reset()
  next()
})
```

Faydalanılan kaynaklar:

- [Dev.to](https://dev.to/the_one/pinia-how-to-reset-stores-created-with-functionsetup-syntax-1b74)
- [Stack Overflow](https://stackoverflow.com/questions/71690883/pinia-reset-alternative-when-using-setup-syntax)
Migrating to CephAdm Orchestration: A Comprehensive Tutorial
Published: 2023-03-13 13:52:28

---
title: Migrating to CephAdm Orchestration: A Comprehensive Tutorial
published: true
description: We look into how to migrate your Ceph cluster to use orchestration using the CephAdm service. The video will cover how to prepare the systems, install the service, adopt legacy services, and add the hosts. Lastly, we will upgrade the system to Quincy's last version and discuss the pros and cons of using CephAdm orchestration.
tags:
cover_image: https://i.ytimg.com/vi/ZaIy11MY6tQ/maxresdefault.jpg
---

{% youtube ZaIy11MY6tQ %}

We look into how to migrate your Ceph cluster to use orchestration using the CephAdm service. The video will cover how to prepare the systems, install the service, adopt legacy services, and add the hosts. Lastly, we will upgrade the system to Quincy's last version and discuss the pros and cons of using CephAdm orchestration.
Continuous Integration
Published: 2023-03-13 13:51:56

Continuous Integration (CI) is a software development practice that optimizes efficiency by automating many of the steps in the development process as changes are being committed and pushed to a shared repository. This method ensures that everything is in testing the code to make sure that no errors exist and that the project is always in working order. CI is essential when an application has many contributors to ensure the stability of code, in this post I will cover the basics of how it works, why it is so important, and what options are available.

## What is Continuous Integration?

CI involves merging changes into a shared repository as frequently as possible. Whenever new code is committed, before it is merged, the new code is verified to ensure that no errors exist and there will be no conflicts.  The typical process involves first automating the compiling/building, testing, and checking for errors.  Notifications are sent out of the results and the code will deploy if no issues are detected. The goal of CI is to catch issues early in the development process before they become a larger problem.  CI can catch syntax errors, and conflicts with existing code as well as identify issues that could become problems.  

## Why is it important?

CI offers several benefits to a software development team by streamlining and automating the development process.  It abstracts away the crucial but mundane tasks letting developers focus on writing code instead of performing repetitive tasks.  By testing the code locally before it is accepted into the organization's repo, one bug written by a developer can be prevented from breaking the whole application. The process leads to a reduction and errors that can be resolved quickly, leading to easier collaboration and sharing of code leading to faster development.  

## Options for Continuous Integration

There are numerous options for tools that deliver CI capabilities to choose from, each with its own set of unique capabilities. One of the most popular tools is Jenkins, which is open-sourced and offers support for multiple languages.  Jenkins is flexible, customizable, and can run on many different platforms. Another popular option is Travis CI, a cloud-based, intuitive platform that provides seamless integration with GitHub and is well-suited for both open-source and private projects. CircleCI is also cloud-based, easy to use, provides fast speedy builds and testing, and offers integration with GitHub, BitBucket, and other DevOps tools. These are just a few of the many options available to provide CI to a project.     

## Conclusion

Continuous Integration is an invaluable tool that can outsource many of the mundane and repetitive tasks that are crucial to any project's success. CI lets developers focus on writing high-quality code and provide insurance and confidence that errors will be caught and there will be no disruption to the development process. Many options exist, but it is worth the investment of time during the set-up of a project to find the right one to best optimize your performance.
How to change Mac folder color with CLI
Tags: opensource, python, github, tooling
Published: 2023-03-13 13:49:10

![movie](https://user-images.githubusercontent.com/99246880/224244901-8ff520df-f383-4c35-a185-dba17773eabd.gif)

There are some methods to change Mac folder color with GUI, but it takes time. So, I created OSS named 'colormkdir' to change Mac folder color and manage a color list with CLI. It is so useful for Mac users. 
You can download it from GitHub. Please check it out!!
https://github.com/mimomimoto/colormkdir
ESSENTIAL SQL COMMANDS FOR DATA SCIENCE
Published: 2023-03-13 13:47:12

SQL (Structured Query Language) is a powerful language used to communicate with relational databases. As a data scientist, you will be working with large datasets and will need to extract, transform, and analyze data. SQL is an essential tool that will help you query and manipulate data efficiently. In this article, we will cover some of the essential SQL commands for data science.

1.SELECT
The SELECT command is used to query data from one or more tables. It is the most commonly used command in SQL. The basic syntax for the SELECT command is:
`SELECT column1, column2, ...
FROM table_name`
`
2.WHERE
The WHERE command is used to filter data based on a condition. It allows you to select only the rows that meet the specified criteria. The basic syntax for the WHERE command is:
`SELECT column1, column2, ...
FROM table_name
WHERE condition
`
3.GROUP BY
The GROUP BY command is used to group data based on one or more columns. It allows you to perform aggregate functions such as COUNT, SUM, AVG, etc. on the grouped data. The basic syntax for the GROUP BY command is:
`SELECT column1, column2, ..., aggregate_function(column)
FROM table_name
GROUP BY column1, column2, ...
`
4.ORDER BY
The ORDER BY command is used to sort data in ascending or descending order based on one or more columns. The basic syntax for the ORDER BY command is:
`SELECT column1, column2, ...
FROM table_name
ORDER BY column1 ASC/DESC, column2 ASC/DESC, ...
`
5.JOIN
The JOIN command is used to combine data from two or more tables based on a common column. It allows you to extract information from multiple tables in a single query. The basic syntax for the JOIN command is:
`SELECT column1, column2, ...
FROM table1
JOIN table2
ON table1.column = table2.column`

In conclusion, SQL is an essential tool for data science. The commands listed above are just a few of the many powerful commands that SQL offers. As a data scientist, mastering SQL will help you to extract, transform, and analyze data efficiently.
Resolvendo problemas no HackerRank: Professor revoltado
Tags: javascript, beginners, programming
Published: 2023-03-13 13:45:51

Olá, seja bem vindo a mais um Resolvendo problemas no HackerRank: no problema de hoje,o professor colocou uma condição para sua turma indiciplinada. Vejamos qual foi.

**Angry Professor -**

Um professor decidiu que não dará aula se um determinado número de alunos chegarem atrasados.

- int k: o número limite de alunos
- int a[n]: os horários de chegada dos alunos

- Retornar as strings: "NO", ou "YES"

- Caso tivessem 3 estudantes, a aula iria começar, n guarda os horários dos alunos, com números negativos sendo os que chegaram antes do horário, e positivos os que chegaram atrasados: a = [-2,-1,0,1,2]

Vejamos como fazer um código que irá ser executado:

```
function angryProfessor(k, a) {
    // Write your code here
    // k= limite de estudantes, a= horarios de chegada deles
  let onTime = 0;
    
    for (let student of a) {
        if (student < 1) onTime++;
    }
    
    if (onTime >= k) 
    return "NO";    
    return "YES"
}
```

A função carrega os dois parâmetros anteriormente citados( k= limite de estudantes, a= horarios de chegada deles). Também criamos uma variável chamada `onTime` com valor inicial 0.

Fizemos um laço for que declara uma variável `student` para o parâmetro a, e que se student for menor que 1, devemos adicionar +1 a variável `onTime`. E caso `onTime` seja maior ou igual ao parâmetro guardado `k` retornaremos uma string "NO", caso contrário "YES".


O resultado será:

```
2
4 3
-1 -3 4 2
4 2
0 -1 2 1

YES
NO
```
Com isso, concluímos mais um desafio do _Resolvendo problemas no HackerRank:_ . Até a próxima!!!
E a gente continua codando... Compartilhe sua história.
Tags: wecoded, braziliandevs
Published: 2023-03-13 13:32:08

Olá pessoas lindas do meu Brasil <3

Todo ano, o dev.to, trás no mês da mulher, um espaço pra que nós e outras pessoas que não se identificam como homens cis, compartilharmos nossas histórias. 

E eu quero aproveitar isso, pra ir um passo a frente, e incentivar a gente a contar nossas histórias, em português, para além de aumentar a representatividade de gênero, também aumentarmos a presença Brasileira aqui. 

Vamos celebrar quem somos, e o que conquistamos!

O legal é que o post só se torna publico depois de que o time do Dev.to de uma olhada, pra ver se ele confiz com a atividade.

## Como faço Pachi?
O time do Dev trás um templates com algumas ideias, você escolhe uma das frases, e completa com sua resposta. Aqui estão os templates trduzidos:

- Prometo abraçar a igualdade na tecnologia ao...

- Uma experiência que tive no local de trabalho que me fez sentir validada foi...

- As iniciativas de diversidade e inclusão impactaram positivamente meu local de trabalho ao...

- Vou me comprometer a me educar sobre...


E compartilho [meu post de 2022](https://dev.to/feministech/apesar-de-tudo-paxixa-codou-em-2022-3kkd), pra mais inspiração.

## E os homens cis?
Pois eles também podem participar, e usar isso como um compromisso para serem melhores aliados e aprenderem mais sobre nossa luta.
E acima de tudo, ler nossas histórias! Essa é a mellhor maneira de aprender.

## Meu #wecoded 2023
Vou usar esse espaço pra preencher o template que mostrei, com minhas respostas:

- **Prometo abraçar a igualdade na tecnologia ao** continuar apoiando mulheres e pessoas não binárias que tem interesse ou já estão na área. Fazer meu melhor para ser uma pessoa que além de inspirar, ajuda com ações.

- **Uma experiência que tive no local de trabalho que me fez sentir validada foi** e na verdade é, trabalhar em um time que tem mais mulheres do que homens. 

- **As iniciativas de diversidade e inclusão impactaram positivamente meu local de trabalho ao ** demonstrar que trabalho em uma empresa que se importa e com esses assuntos.

- **Vou me comprometer a me educar sobre** inclusão. Muito se fala sobre diversidade, mas diversidade sem inclusão é como nadar e morrer na praia, então quero aprender mais sobre como incluir, de maneira efetiva.
Latest Solcial Updates
Published: 2023-03-13 13:29:31

Four months ago, we launched Solcial, a web3 permissionless social network that initially operated on an invite-only basis. The experience has been incredible, and we would like to showcase the improvements we've made to the platform since then, thanks to the help of our community. So, let's dive in!

🚀Here's a list of all the latest updates to Solcial.

⭐️Firstly, we're excited to announce that Solcial is now open to everyone. Head to https://solcial.io to create an account and start exploring and creating content.

⭐️ As a web3 platform built on a blockchain, you can create an account using either a Solcial wallet or any Solana wallets, such as Phantom or Solflare. And the best part? You don't need to provide any personal information, such as your email or phone number, during registration, ensuring your privacy is protected. We've also improved the onboarding process, making it easier for users unfamiliar with web3 to create an account and start using Solcial.

⭐️We've released Moderation V2, which still has centralized components, but we plan to launch the fully decentralised V3 soon. Some notable features include a sensitivity content filter with options ranging from “Safe Space” to “MadMax”, NSFW tags for 18+ content, and posts reporting. You can also mute users who annoy you, so you don't see their comments or posts, but other users can.

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

⭐️Our biggest achievement yet is the release of our iOS and Android apps, so you can use Solcial on your phone without opening it inside external apps, like most Dapps works.

⭐️We've also added a video feature, allowing you to upload videos directly on IPFS, with client-side encoding and compression, ensuring no-one edit your video afterward.

⭐️Additionally, we've released a poll feature and updated our referral program, giving you your own referral link to invite friends and earn 5% commission as SLCL rewards from their trading on Solcial.

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

⭐️ We've also made several UI and UX improvements, making your stay on the platform comfortable and smooth. We've separated content from the trading tab, added more filters for feeds, improved the Users' Leaderboard, and made tons of other updates. Our verified badge and badges for Scouts (ambassadors of Solcial) have also been deployed recently.

🎯With over 30k+ views, 4500+ active users, and tons of amazing content, we're just getting started. We'd love for you to join us on Solcial and share any questions, feedback, or even just say hi!
Street Programmer: OG:IMAGE Rest Generator
Tags: api, node, javascript, webdev
Published: 2023-03-13 13:27:54

If you're looking to take your social media game to the next level, **OG:IMAGE REST Generator** is the tool for you. Our powerful yet user-friendly RESTful API makes it easy to create stunning Open Graph images for your website or application. Whether you want to promote a new blog post, showcase a product, or simply increase engagement, our customizable images will make your content pop on social media platforms like Facebook, Twitter, and LinkedIn. Best of all, our tool is completely free - so why wait? Try **[OG:IMAGE REST Generator](https://github.com/darkterminal/og-image-rest-generator)** today and take your online presence to the next level.

Welcome to Contribute
{% embed https://github.com/darkterminal/og-image-rest-generator %}
Laravel service providers explained in depth
Published: 2023-03-13 13:27:40

Laravel is completely a mystery because even if you are an experienced developer you will toil hard to learn its core functionality. One of the functionalities is, its Service Providers , on which I am going to give a detailed overview. These are really simpler than you have imagined, I hope so.. Therefore lets bootstrap..

What are service providers in laravel?
Service providers in laravel application is the central place where application is bootstrapped. That is, laravel’s core services and our application’s services, classes and their dependencies are injected in service container through providers. 

More simpler definition may be given as, providers are funnel/nozzle through which we pour fuel called classes into a fuel tank called service container of an engine called Laravel.


'providers' => [

        /*
        * Laravel Framework Service Providers...
        */
        Illuminate\Auth\AuthServiceProvider::class,
        Illuminate\Broadcasting\BroadcastServiceProvider::class,
        Illuminate\Bus\BusServiceProvider::class,
        Illuminate\Cache\CacheServiceProvider::class,
        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
        Illuminate\Cookie\CookieServiceProvider::class,
        .
        .
        .
],


How to create service provider in laravel ?
You might know, Laravel provides an artisan command to create service provider.

| php artisan make:provider MyServiceProvider |

This command will create a service provider at App/Providers/ directory with name as MyServiceProvider. As a laravel convention we append ServiceProvider with class name whenever a new provider class is created so that we can just get to know that this particular file is of service provider type easily.

Each provider class extends base ServiceProvider class.
The ultimate guide to ChatGPT
Published: 2023-06-12 17:15:27

---
title: The ultimate guide to ChatGPT
published: true
date: 2023-03-13 12:59:39 UTC
tags: 
canonical_url: 
---

Welcome to the ultimate guide to ChatGPT!

You may already know what ChatGPT is, but for those who don't, let me give you a quick rundown. ChatGPT is a state-of-the-art artificial intelligence language model developed by OpenAI. It is designed to generate human-like responses to text-based prompts and has been trained on an enormous dataset of diverse texts.

So, why should you care about ChatGPT? Well, for starters, it can be an incredibly useful tool for generating content, answering questions, and even just having a conversation. But to get the most out of ChatGPT, there are a few things you should know. Here are my top tips for using ChatGPT like a pro:

1. **Be clear and specific in your prompts** - ChatGPT works best when you give it clear, specific prompts. Don't be vague or overly general in your requests.

2. **Keep it concise** - While ChatGPT can generate long, detailed responses, it's often better to keep your prompts short and sweet. This helps ChatGPT focus on the most important aspects of your request.

3. **Use it to generate ideas** - If you're stuck on a writing project, try using ChatGPT to generate some ideas or inspiration. You might be surprised by what it comes up with!

4. **Don't take everything it says as gospel** - While ChatGPT is incredibly smart, it's not infallible. Always double-check any information you get from ChatGPT before relying on it.

5. **Have fun with it!** - ChatGPT can be a great way to kill time or just have some fun. Don't be afraid to ask it silly or random questions - you never know what kind of response you'll get!

ChatGPT is an incredible tool that can be incredibly useful in a variety of contexts. By following these tips, you'll be well on your way to becoming a ChatGPT expert. So what are you waiting for? Give it a try and see what it can do for you!