teleren/devto huggingface dataset:
My Ad-Blocking and Rewriting adventure with NextDNS
Tags: dns, networking
Published: 2023-06-24 19:29:13

A few months ago, I was on the lookout for a customizable DNS server, which would let me block ads, monitor traffic, and redirect custom domains to local IP addresses; akin to that of a [PiHole](https://pi-hole.net/), but without needing to run a DNS server 24x7.

On my search, I stumbled upon [NextDNS](https://nextdns.io/), which is a DNS service that lets you do all of the above, and more. It has a very generous free tier (300k requests p/m[^1] [^2]), offering both DNS and DoH (DNS-over-HTTPS). I've been using it for a few months now, and I'm very happy with it.

---

The setup process was a breeze—I just had to create an account, and create a profile with my required settings. Afterwhich, I just had to configure my devices to use the NextDNS servers, and I was good to go.

Ad-blocking works fine as well, and I haven't noticed any issues with it. You can mix-and-match various blocklists, I've found AdGuard's ones to be the best. They can also block trackers, and affiliate links if you wish. Custom blocklists/allowlists are also supported, but I haven't tried them out yet. I've also set up a few custom rules to redirect some domains to local IP addresses, and that works fine as well.

The logging features are good, and you can choose where you'd like to have the logs stored (US/UK/EU/Switzerland) and for how long (1 hour -> 2 days). You can choose what to log as well, which seems like a plus point to me.

The speed is decent as well, and I haven't noticed any issues with it. A `bulldozher` test shows that's its faster than Cloudflare's, and marginally slower (+- 1ms) than Google's.

```
█ Cloudflare DNS
  1.1.1.1
   22.1 ms  32.6 ms 809.4 ms
  ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▆▆▆▆▆▆█████████████████

█ Quad9 DNS
  9.9.9.9
  272.4 ms 288.8 ms 293.5 ms
  ██████████████████████████████████████████████████

█ Google DNS
  8.8.8.8
    4.6 ms 380.0 ms 389.5 ms
       ▁▁▁▁▁▁▁▁▁▁▁▃▃▃▃▃▃████████████████████████████

█ Verisign DNS
  64.6.64.6
   60.6 ms  64.0 ms 197.0 ms
  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇███████████████████████

█ 45.90.28.60 DNS
  45.90.28.60
    5.0 ms   5.7 ms 308.5 ms
  ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▂▂▂▂▂▂▂▂▂▂▃▃▃▃▃▃██████

█ Mozilla DoH
  https://mozilla.cloudflare-dns.com/dns-query
   23.3 ms  24.8 ms 482.6 ms
  ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▅▅▅▅▅▅██████
```

They also claim to offer malware and phishing protection, but I haven't gotten around to testing that out yet.
[^1]: [NextDNS Pricing](https://nextdns.io/pricing)
[^2]: At the time of writing, once the 300k requests are exhausted, the service will only work as a normal DNS resolver (i.e., no ad-blocking/rewrites/logging/analytics) until the next month.
Grub does not hide though GRUB_TIMEOUT=0
Tags: grub, dual, kernel, ubuntu
Published: 2023-06-24 19:27:17

I'm running Ubuntu 22.04.2 LTS and have dual boot windows 11. I'm trying to hide grub menu while booting and automatically boot ubuntu as I have seen that can be done with changing GRUB_TIMEOUT to 0 in /etc/default/grub and run sudo update-grub but grub doesn't hide and sets time to 10 seconds. I am able to change the timer to be different even -1 but 0 does not work for whatever reason. I have also come across the solution that in /etc/grub.d/40_custom I should add at the end of the file: set default="0" set timeout=0 . While this works I'm concerned that when some error occurs I would not be able to get into ubuntu advanced options because it disables grub menu in the boot time so I decided not to use it.

Here is my /etc/default/grub: GNU nano 6.2 /etc/default/grub

If you change this file, run 'update-grub' afterwards to update
/boot/grub/grub.cfg.
For full documentation of the options in this file, see:
info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0 GRUB_TIMEOUT_STYLE=hidden GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian GRUB_CMDLINE_LINUX_DEFAULT="quiet splash loglevel=0" GRUB_CMDLINE_LINUX=""

Uncomment to enable BadRAM filtering, modify to suit your needs
This works with Linux (no patch required) and with any kernel that obtains
the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

The resolution used on graphical terminal
note that you can use only modes which your graphic card supports via VBE
you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1" GRUB_DISABLE_OS_PROBER=false

I would be really grateful for any advice as to why my grub menu does not hide. Thank you in advance
Tratando colunas no DataFrame com Pandas
Tags: python, datascience, tutorial, beginners
Published: 2023-06-24 18:44:57

Neste tutorial, vamos explorar algumas técnicas básicas de tratamento de dados utilizando a biblioteca pandas no Python. 

Abordaremos tópicos como inclusão e exclusão de colunas, renomeação e ordenação de colunas, ajuste dos valores para letras maiúsculas e minúsculas.

**Importando o pandas**

Não esqueça de importar o pandas para executar os nossos exemplos:

```
import pandas as pd
```

**Adicionando novas colunas**

Podemos incluir uma nova coluna utilizando diferentes tipos de dados, inclusive fatores lógicos.

Por exemplo, vamos adicionar uma coluna chamada ‘aprovado’ que indica se um aluno foi aprovado ou não com base em sua nota. Suponha que a nota de aprovação seja 7.

```
df['nota'] = [8, 6, 7, 9, 5]

df['aprovado'] = df['nota'] >= 7
```

Neste exemplo, a nova coluna ‘aprovado’ terá o valor True para as notas maiores ou iguais a 7 e False para as notas menores que 7.

**Excluindo colunas**

Para excluir uma coluna, utilizamos o método drop(). O parâmetro axis=1 indica que queremos excluir uma coluna (e não uma linha).

```
df = df.drop('coluna_indesejada', axis=1)
```

**Renomeando colunas**

Podemos renomear colunas utilizando o método rename().

```
df = df.rename(columns={'coluna_antiga': 'coluna_nova'})
```

Ajustando as letras para maiúsculas ou minúsculas

Para converter todos os valores de uma coluna para letras maiúsculas, utilizamos o método str.upper().

```
df['coluna'] = df['coluna'].str.upper()
```

Para converter para letras minúsculas, utilizamos o método str.lower().

```
df['coluna'] = df['coluna'].str.lower()
```

**Ordenando colunas**

Para mover uma coluna para o início do Dataframe, podemos utilizar a seguinte sintaxe:

```
df = df[['coluna_movida'] + [coluna for coluna in df.columns if coluna != 'coluna_movida']]
```

Essa sintaxe cria uma nova ordem para as colunas, colocando ‘coluna_movida’ no início e mantendo a ordem original das demais colunas.

Para mover uma coluna para o fim, podemos usar a seguinte sintaxe:

```
df = df[[coluna for coluna in df.columns if coluna != 'coluna_movida'] + ['coluna_movida']]
```

**Conclusão**

Neste tutorial, aprendemos algumas técnicas básicas de tratamento de dados no Python. Aproveite para explorar esses conceitos nos seus projetos.
Previsão de Vendas com Regressão Linear
Tags: python, tutorial, datascience, beginners
Published: 2023-06-24 18:55:14

Uma técnica valiosa para prever as vendas é o uso de algoritmos de Machine Learning, como a regressão linear. 

Neste tutorial vamos apresentar um exemplo prático usando código Python para ilustrar a aplicação da regressão linear nesse contexto.

**Regressão Linear**

A regressão linear é um método estatístico que permite relacionar uma variável dependente (vendas, neste caso) com uma ou mais variáveis independentes (investimento em marketing). O objetivo é encontrar a melhor linha reta que descreve a relação entre essas variáveis, permitindo-nos fazer previsões com base nessa relação.

**Exemplo Prático:**

Para demonstrar o processo de previsão de vendas usando regressão linear, usaremos um exemplo fictício. Vamos supor que temos uma loja de roupas online e queremos prever as vendas com base no investimento mensal em marketing. 

Aqui está um exemplo de como poderíamos organizar nossos dados:

```
import pandas as pd

# Criando um dataframe de exemplo
data = {'Investimento_Marketing': [20, 25, 40, 52, 67, 72, 81],
        'Vendas_Mensais': [118, 142, 225, 260, 295, 335, 364]}

df = pd.DataFrame(data)
```

Neste exemplo, temos duas colunas: "Investimento_Marketing" e "Vendas_Mensais". Cada linha representa um mês, e os valores nas colunas indicam o investimento e o total de vendas para aquele mês.

Podemos ver melhor os dados usando o comando .head():

```
df.head()
```

Agora, vamos realizar a análise de regressão linear para prever as vendas com base no investimento. 

Usaremos a biblioteca scikit-learn, que fornece uma implementação fácil de usar da regressão linear em Python:

```
from sklearn.linear_model import LinearRegression

# Separando as variáveis independentes (X) e a variável dependente (y)
X = df[['Investimento_Marketing']]
y = df['Vendas_Mensais']

# Criando uma instância do modelo de regressão linear
model = LinearRegression()

# Treinando o modelo
model.fit(X, y)
```

Vamos definir um target de 63k para nosso modelo:

```
investimento_novo = [[63]]  # target
previsao_vendas = model.predict(investimento_novo)
```

**Retornando o resultado final:**

```
print("A previsão de vendas é de:", previsao_vendas[0])
```

**Plotando o resultado em um gráfico:**

```
import matplotlib.pyplot as plt
import numpy as np

plt.scatter(df['Investimento_Marketing'], df['Vendas_Mensais'])
plt.scatter(63, reg.predict([[63]])[0], color="k")
x = np.array(df['Investimento_Marketing'])
y = reg.intercept_ + x*reg.coef_
plt.plot(x,y,"r")
plt.show()
```

**Conclusão:**

Neste exemplo, utilizamos o modelo de regressão linear para prever as vendas com base em um investimento em marketing de $63k. A previsão de vendas é retornada como resultado.

A regressão linear é uma técnica muito utilizada para este tipo de pergunta em cenários de negócio. Ao usar a regressão linear, podemos identificar padrões e tendências na relação entre variáveis, permitindo que façamos previsões confiáveis das vendas futuras.
The Unhinged Pursuit: Unraveling the Mad Scientist's Motivation
Published: 2023-06-24 18:20:35

Welcome, fellow seekers of the extraordinary! Step into the chaotic laboratory of innovation known as Rogue Paradigms. I, your mad scientist of coding, am here to unleash mind-bending utilities and modules that defy the ordinary.

In the realm of software development, where conformity reigns supreme, I emerge as a whirlwind of unconventional brilliance. Why settle for the mundane frameworks and industry standards when we can concoct our own elixirs of technological marvels? Behold, as we sprint through the corridors of core programming capabilities, leaving a trail of groundbreaking solutions in our wake!

This blog is the sanctuary for those who crave the thrill of uncharted territories. Forget the familiar script and embrace the exhilaration of experimentation. From manipulating intricate data structures to summoning the powers of intricate algorithms, we shall dare to tread where others fear to code.

Whether you're an audacious novice seeking to bend the rules or an experienced maestro ready to shatter the status quo, Rogue Paradigms shall be your catalyst for audacious innovation. Through my ramblings, you shall unlock the secrets of unseen potential, unveiling the true essence of programming's untamed wilderness.

No time for trivialities, my comrades! Together, we shall redefine the very fabric of possibility. Let us surge forward, tearing through barriers with our swift strokes of brilliance, sculpting software that not only echoes the industry but transcends it.

Join me on this electrifying quest as we seize the true essence of coding's core capabilities. Brace yourself for an adrenaline-fueled journey, where inspiration and madness entwine, and creativity knows no bounds.

Now, haste awaits us! Together, let's scribble this introduction and embark on an extraordinary adventure, for greatness favors those who fearlessly push the boundaries.

Onward, my fellow mad scientists of the digital realm! Let chaos reign supreme!
Episode 01 - How to check the Palindrome in JavaScript
Tags: javascript, interviewquestions, programming, frontend
Published: 2023-06-24 18:05:45

One of the famous JavaScript interview questions. How to check the palindrome in JavaScript. A palindrome is a word or phrase that reads same in the reverse order also. Some of the examples are  civic, rotor, noon, level, mom, madam and racecar.

Now lets see how to solve this in JavaScript. Most of the programmers would go on in a straight-forward way and uses for loop to solve this. Lets explore that way first:

```
const isPalindrome = (string) => {
  const length = string.length;
  if (!string) return false;
  for (let i = 0; i < length; i++) {
    if (string[i] !== string[length - i - 1]) {
      return false;
    }
  }
  return true;
}

// isPalindrome('madam') prints true
// isPalindrome('hello') prints false

```
This is good and solves the problem at our hand. But can we improve anything in this program. If you see, to confirm if the string is a palindrome or not, we only need to check half of the string. For example, if the string is 10 characters in length, we can check and compare only 5 characters to verify the palindrome. If the string length is an odd number, lets say 5 characters, we need to check only 2 characters. The string is palindrome regardless of the mid character if rest of the characters

Now applying this to our program, we can reduce the loop iteration to half.

```
const isPalindrome = (string) => {
  const mid = Math.floor(string.length / 2);
  const length = string.length
  if (!string) return false;
  for (let i = 0; i < mid; i++) {
    if (string[i] !== string[length - i - 1]) {
      return false;
    }
  }
  return true;
}

// isPalindrome('rotor') prints true
// isPalindrome('hello') prints false
```
As usual this is one of the way to solve the problem. Comment below your solution.

Check Palindrome in our YouTube
 
{% embed https://youtu.be/Lc24Vv5DTVU %}
Looking for Crypto DEV partenership.
Published: 2023-06-24 17:55:11

hello i looking for a partenership to create token.
if you know about the domain, contact me on Telegram at @YamWeb. i'm actively looking for someone who would be able to create a token with me. i'm able to create the token without any problems and promote it. i'd just like a good partnership to help me 
with. Telegram: @YamWeb
Installing Postgresql 16beta1 along with AGE
Published: 2023-06-24 17:37:43

Converting your current relational database into a graph database can be done easily by incorporating an extension. Apache AGE serves as a PostgreSQL extension that grants graph database capabilities, allowing users to utilize a graph database alongside their existing relational databases.

We will explore the following:

1. The process of installing Postgres from its source.
2. Installing and configuring Apache AGE in conjunction with Postgres.

## Creating Folders

```
mkdir age_installation
cd age_installation
mkdir pg
cd pg
```

## Dependencies

```
sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison
```

## PostgreSQL

Currently AGE is officially supported for PG 11 and 12 but suuport for PG 15 & 16 are in progress. So right now we will install postgresql 16beta1

```
wget https://ftp.postgresql.org/pub/source/v16beta1/postgresql-16beta1.tar.gz && tar -xvf postgresql-16beta1.tar.gz && rm -f postgresql-16beta1.tar.gz

```

## Installation
Next, we will proceed with the installation of "pg". The "--prefix" option specifies the directory path where we want to install "psql". In this instance, we will be installing it in the current directory using "pwd".
```

cd postgresql-16beta1

# configure by setting flags
./configure --enable-debug --enable-cassert --prefix=$(pwd) CFLAGS="-ggdb -Og -fno-omit-frame-pointer"

# now install
make install

# go back
cd ../../

```

## AGE
We will be using ths repo as it has the latest most compatbile verion of AGE

```
git clone https://github.com/panosfol/age
```

```
cd age
git checkout PG16
```

## Installing 






```
# install
make PG_CONFIG=/home/yourusername/age_installation/pg/postgresql-16beta1/bin/pg_config install
```

```
# install check
make PG_CONFIG=/home/yourusername/age_installation/pg/postgresql-16beta1/bin/pg_config installcheck
```

Currently 19 out of 24 test cases fail for AGE in postgresql 16beta1. You can contribute to this open source project and help in its development.
The 15th day of the 100 Days of Code challenge
Published: 2023-06-24 17:30:11

Today, I reduced the latency in my project that books restaurant reservations over the phone using AI. I didn't notice that I kept loading the transcription model over and over again when transcribing files, thus causing a big rise in latency. Reduced it to transcribe files in about 0.5 seconds on average rather than 2.5 seconds on average. 

Now working on real-time transcription with Whisper. However, I was stuck all day on sending audio from my React front-end to my Flask server and I still don't have it quite figured out. One of those problems you can spend hours about even though they don't sound too intimidating. Gonna fix it tomorrow and then work more on this!

The goal of these projects is to become familiar with the leading AI tools coming from OpenAI, I'm getting a lot of hands-on time with them and that is something I see a lot of value in.

Once my hands are dirty enough, I'll move on to larger projects that involve the usuals. Authentication, databases, large API's and AI!

An example of this would be the pomodoro app I've been talking so much about during the challenge.

Happy coding!
How to run a Neural Network(RNN) training pipeline on Airflow and deploy the AI model to AWS ECS for Inference
Tags: aws, devops, neuralnetwork, python
Published: 2023-06-24 17:23:37

In today’s fast-paced world, artificial intelligence (AI) has become an indispensable tool for solving complex problems and making informed decisions. As businesses strive to harness the power of AI, it’s crucial to have a robust and efficient pipeline for training AI models. Also its all the more important now for developers to learn about AI and AI models. So I started delving into different AI topics and tried training and deploying my own AI models to AWS.

In this blog post, we will explore the step-by-step process of setting up an AI training pipeline using Airflow and deploying the trained model on AWS ECS for efficient and cost-effective inference.  

More details: https://amlanscloud.com/deploymlmodel/
Hasura x MEWS
Tags: hasura, mews, graphql, glitch
Published: 2023-06-24 17:21:24

---
title: Hasura x MEWS
published: true
description: Integrate MEWS API with Hasura using Remote Schema
tags: hasura, mews, graphql, glitch
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uw28g3qnfdo3j3ysdds5.png
# published_at: 2023-06-24 16:00 +0000
---
[Hasura](https://hasura.io/) gives you instant GraphQL / Rest API on top of SQL databases like Postgres and MySQL. You can also use Hasura Remote Joins to join data from your Postgres database with MEWS API in GraphQL. 

## Step 1: Setup Hasura Instance
* Signup to [Hasura Cloud](https://cloud.hasura.io/signup)
* Create a free tier project

## Step 2: Configure & Deploy Custom Resolver
* I've created a project in Glitch so you can remix and spin up your own project. 
[![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button-v2.svg)](https://glitch.com/edit/#!/remix/hasura-mews)
* MEWS has a demo environment which you can use to test the integration. Get the environment's credentials [here](https://mews-systems.gitbook.io/connector-api/getting-started#quick-start)
* Now head over to `.env` file in Glitch and add these
 * `MEWS_BASE_URL`
 * `MEWS_CLIENT_TOKEN`
 * `MEWS_ACCESS_TOKEN`
 * `MEWS_CLIENT`
* Click on **Share** at the top of the Glitch UI and copy the 'Live Site' URL.

## Step 3: Add Remote Schema
In Hasura Console, go to the **Remote Schemas** tab.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l04mn1naprkmbzd19lmn.png)
## Step 4: Start querying reservations
```
query getReservationsFromMEWS($startUTC: String!, $endUTC: String!) {
  getReservations(startUTC: $startUTC, endUTC: $endUTC) {
    Reservations {
      Id
      CustomerId
      AssignedResourceId
      Customer {
        Id
        FirstName
      }
      Room {
        Id
        State
      }
    }
  }
}
```

Add variables to the query
```
{
  "startUTC": "2023-06-01T00:00:00Z",
  "endUTC": "2023-06-02T00:00:00Z"
}
```
Voila!
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldlivfcqp92ws5xgrhdb.png)
Primeiro Post
Tags: 100daysofcode, beginners, programming
Published: 2023-06-24 17:14:40

## Primeiro post: Expectativas e Jornada.
--------------------------------------------------------------
###Apresentação;


Olá! Meu nome é Pedro, tenho 20 anos e sou brasileiro. Atualmente, sou estudante de Análise e Desenvolvimento de Sistemas e tenho grandes aspirações de me tornar um estudante de FullStack e entusiasta do mundo da Cibersegurança.

No momento, estou imerso no estudo do roadmap de desenvolvedor FullStack e achei interessante documentar minha evolução nesse caminho. Encontrei como opção e inspiração o desafio #100daysofcode, e por isso criei um perfil no Twitter (@b0yc0de) para compartilhar diariamente minha evolução, além de um perfil aqui mesmo no DEV.TO.

Vale ressaltar que minha jornada como desenvolvedor FullStack é um pouco diferente, pois estou planejando uma jornada de 180 dias. Durante esse período, pretendo publicar posts registrando o final de cada semana e compartilhando minha evolução.

Espero aprender muito ao longo desses 180 dias, explorando todas as vertentes do desenvolvimento FullStack, aprimorando minhas habilidades e expandindo meus conhecimentos. Estou animado para compartilhar essa jornada com a comunidade DEV.TO e receber feedbacks e sugestões valiosas.

Junte-se a mim nessa aventura! Vamos aprender juntos e alcançar nossos objetivos no mundo do desenvolvimento!

-----------------------------------------------
Top Beginner-Friendly Linux Distributions for Easy Start
Tags: linux, ubuntu, beginners, distro
Published: 2023-06-24 17:08:31

---
title: Top Beginner-Friendly Linux Distributions for Easy Start
published: true
description: 
tags: #linux #ubuntu #beginner #distro
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-05-17 16:32 +0000
---
Are you a beginner looking to dive into the world of Linux? Discover the best Linux distributions tailored for newcomers in this informative video. From intuitive user interfaces to comprehensive documentation and community support, these Linux distributions are perfect for those starting their Linux journey. Join us as we explore the most beginner-friendly options, highlighting their features and benefits to help you choose the perfect Linux distribution for your needs. Get ready to embark on an exciting open-source adventure with the best Linux distributions for beginners!


{% youtube xgDukd7a2o8 %}