teleren/devto huggingface dataset:
3 Commands for Cracking the K8s Rosetta Stone
Tags: kubernetes
Published: 2023-04-22 00:33:26

Honestly, these are more for my own notes than anything else. YMMV. Might add more than three, but we'll see.

## See *All* Resources

...Even if you can't remember what all the resources are in the K8s ontology:

```sh
> kubectl get all

NAME                        READY   STATUS    RESTARTS   AGE
pod/demo-6b87cc7b85-7rblb   1/1     Running   0          2m15s

NAME                 TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.43.0.1       <none>        443/TCP   30d
service/demo         ClusterIP   10.43.181.226   <none>        80/TCP    2m3s

NAME                   READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/demo   1/1     1            1           2m15s

NAME                              DESIRED   CURRENT   READY   AGE
replicaset.apps/demo-6b87cc7b85   1         1         1       2m15s
```

## Assign Ingress for Local Domain

Often you will need to locally test a deployment that would otherwise rely on a remote/provider ingress controller like a LoadBalancer that can't be utilized on most local K8s environments like Rancher Desktop. This command creates an nginx-based ingress controller and assigns a specific local domain with which you can set up port forwarding rules to internal services.

```sh
> kubectl create ingress demo-localhost --class=nginx --rule="demo.localdev.me/*=demo:80"

ingress.networking.k8s.io/demo-localhost created

> kubectl port-forward --namespace=ingress-nginx service/ingress-nginx-controller 8080:80

Forwarding from 127.0.0.1:8080 -> 80
Forwarding from [::1]:8080 -> 80
```

## "SSH" Into a Running Container

Really, you aren't SSH-ing so much as running an interactive terminal via bash. Does require the name of the target pod (hence the first command here) and assumes it is running a single default container.

```sh
> kubectl get pods

NAME                    READY   STATUS    RESTARTS   AGE
demo-6b87cc7b85-7rblb   1/1     Running   0          7m4s

> kubectl exec -it demo-6b87cc7b85-7rblb -- /bin/bash

root@demo-6b87cc7b85-7rblb:/# 
```
Dwight AI
Tags: ai
Published: 2023-04-22 00:22:36

Introducing my new lil project: Dwight Schrute the Reporter...an AI driven Dwight Schrute that post about the news 🤖

I've been working on lots of different AI things atm and in this project I'm bringing some of the most most interesting things together all with various ML models for different tasks:

- Hyper relevant to a user
- Logic and reasoning
- Memory
- NLP for technical things like working with an API

With the aim being a full blown human like news writer. Follow along here as Dwight posts and gets smarter: https://dwightdoesthenews.com/
Reporting a problem in an Open Source project is as important as contributing code
Tags: opensource, community
Published: 2023-04-23 11:16:55

---
title: Reporting a problem in an Open Source project is as important as contributing code
published: true
date: 2023-04-22 00:00:00 UTC
tags: opensource, community
canonical_url: https://avelino.run/reporting-problem-in-open-source-project-is-important-contributing-code/
---

I constantly hear people saying that to contribute to an Open Source project you need to be able to program very well, have a lot of knowledge, be able to handle code criticism, etc.

> I see the above statements as excuses and focus in the wrong place.

In the last few months, I haven't had as much time to contribute to open source projects as I like (writing code), but that didn't stop me from contributing. Actually, the lack of priority (not lack of time) has made me contribute by reporting problems that I run into in the projects/software I use in my day-to-day life and this has been more work than writing code with a defined specification (issue that someone invested time detailing).

Generally, reporting a problem is not just opening an issue exposing the back trace, we need to understand what generated the problem, so the person who helps to maintain the project can reproduce it "locally" (in the development environment) to think of the best solution without breaking other existing features in the software.

## How do I write a very detailed issue?

Whenever I am communicating with someone, I assume that everything that is obvious to me is not so obvious to the person and I put as much context as possible in the conversation, helping the person to make the best decision.

When I am opening an issue it is no different, I will describe the problem to the person who will read (solve) it, not to me, i.e. everything that is obvious to me is probably not obvious to other people.

## Code is important, but not only code

Open Source projects exist to solve problems and are made by people for people, investing time in opening a detailed issue demonstrates that you care about the project and empathize with the people who are helping to maintain the project.

Avoid leaving to report the issue later, you will probably forget important details.

> this blogpost came up after I reported an issue in a project and the first comment was from a person saying he had run into the same problem "yesterday".
> **what came to my mind was:** why didn't the person report this issue yesterday?

[Query](https://github.com/search?q=is%3Apublic++author%3Aavelino+&type=issues&ref=advsearch&s=updated&o=desc) that I am constantly following on GitHub to keep track of the issues I opened, looking today there are **1.1k** issues in public repositories.
Get network information using JavaScript and optimize your app
Tags: javascript, network, optimazion, productivity
Published: 2023-04-21 22:33:32

Have you every wanted to optimize your web application behavior based on the user internet performance? Maybe loading content in different qualities?

## Network Information API
This API is accessed through the `navigator.connection` property. Here are some of the properties.

- effectiveType
- downlink
- errt
- saveData

**effectiveType**
The `effectiveType` property returns the effective type of the current connection.
```
navigator.connection.effectiveType //'slow-2g','2g','3g','4g'
```

**downlink**
The `downlink` property returns the effective bandwidth.
```
navigator.connection.downlink //Bandwidth in mbps
```

**rrt**
`rrt` property returns the round-trip time. 
```
navigator.connection.rrt //round-trip time (ms)
```

**saveData**
The `saveData` property returns a Boolean, Weather the user's data-saver is on or off. 
```
navigator.connection.saveData //true or false 
```

## Using it in a practice example 
Less say we want to represent a high quality video, We first make sure that data-saver is not enabled. And if the internet speed meets their requirements, We load the video accordingly.
```
if(
!navigator.connection.saveData &&
navigator.connection.effectiveType === '4g' &&
navigator.connection.downlink>2
) 
{
 loadVideo("4k")
} else {
loadVideo("low-quality")
}
```

Thanks for reading. This I my first blog so sorry if there is any errors.
Observables Angular Jxjs
Tags: spanish
Published: 2023-04-21 22:30:42

Un objeto observable es aquel en el cual los cambios realizados pueden estar siendo monitoreados en tiempo real y Asíncrono, dado que el programa sigue ejecutándose a la espera de cambios en el objeto que esta siendo observado.
Por otra parte los objetos son monitoreados por los observadores, estos observadores pueden llevar código el cual se ejecutara dependiendo los requerimientos. El objeto observable puede estar siendo observado por uno o mas observadores, los cuales antes se deben suscribir.


![Observables angular](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wpvvbcib522mxdlw01o0.jpg)

Pasos para crear un objeto observable.

1. importamos la clase "observable" y y la función "of" de rxjs
```
import {Observable} from 'rxjs';
import {of} from 'rxjs';
```

2. Creamos un metodo para acceder al objeto. Este metodo retorna el observable en Stream() y se le debe especificar el objeto que se desea observar.

```
  getClientes():Observable<Cliente[]>{
    return of(CLIENTES);
  }
```
Pasos para un que un observador se suscriba al observable.

1. Acceder al método 
2. Al ser un observable, podemos acceder al método subscribe.
3. En una función, recibir el dato y escribir el código según las necesidades. (usar la función flecha).

```
clientes.getClientes().subscribe(
           (clientes) => {
                return (/*code*/);
           }
        );
```
Cyber Attacks Are on the Rise: Is Your Business Prepared with Cyber Insurance?
Published: 2023-04-21 22:30:04

Cyber insurance, also known as cyber liability insurance or data breach insurance, is a type of insurance policy designed to protect businesses and individuals from the financial losses associated with cyber attacks and data breaches.

With the increasing frequency and severity of cyber attacks, the need for [cyber insurance](https://www.kuv24-cyber.de/) has become more apparent.

Cyber insurance policies typically cover a range of risks, including the costs of investigating a cyber attack, notifying affected individuals, and providing credit monitoring services to those affected.

They can also cover legal costs, regulatory fines, and the costs of restoring lost or damaged data. 

Some policies may even cover the costs of lost income resulting from a cyber attack.

The cost of cyber insurance premiums can vary widely depending on the size and industry of the insured, as well as the scope and level of coverage provided by the policy.

However, the cost of not having cyber insurance can be far greater. 

The financial and reputational damage that can result from a data breach or cyber attack can be devastating to a business or individual.

In addition to financial protection, cyber insurance can also provide valuable resources for prevention and response to cyber attacks.

Many insurance providers offer risk assessment tools, training resources, and incident response services to their policyholders.

It is important for businesses and individuals to carefully consider their cyber insurance needs and work with a reputable insurance provider to ensure they are adequately covered.

As the threat landscape continues to evolve, cyber insurance will become increasingly important for protecting against the financial and reputational risks of cyber attacks.
Coding Your Dreams into Reality: Lessons from an Engineer turned Entrepreneur
Tags: programming, career, management, podcast
Published: 2023-04-21 22:09:46

Engineers make great entrepreneurs. So a startup that has two engineers as its founders must be twice as good, right? Not exactly. 

On this week's episode of Dev Interrupted, we talk to Jake Lumetta, founder & CEO of ButterCMS. A serial entrepreneur, Jake found success (and failure) with numerous startups before striking it big with ButterCMS.

He joins us today to discuss practical advice for engineers-turned-entrepreneurs, like knowing when to step away from the keyboard and handover the codebase, why building a B2B startup is so much easier than building a B2C, and why two engineers founding a company together isn't always a good idea.

{% spotify spotify:episode:4EiVEqIkeicymbv4kCvwOf %}

## Episode Highlights:
* (2:41) Introduction
* (3:58) Lessons in entrepreneurship
* (17:15) Talking to customers
* (18:52) Transition from engineer to CEO
* (24:00) Stepping away from coding
* (25:14) Building B2B vs B2C
* (30:05) Worst mistakes you can make as a founder

***While you’re here, check out this video from our [YouTube channel](https://www.youtube.com/c/DevInterrupted?sub_confirmation=1), and be sure to like and [subscribe](https://www.youtube.com/c/DevInterrupted?sub_confirmation=1) when you do!*** 

{% youtube 4JxH-L-Liyg %}

### Want to cut code-review time by up to 40%? Add estimated review time to pull requests automatically!
*gitStream is the free dev tool from LinearB that eliminates the No. 1 bottleneck in your team’s workflow: pull requests and code reviews. After reviewing the work of 2,000 dev teams, LinearB’s engineers and data scientists found that pickup times and code review were lasting 4 to 5 days longer than they should be.* 

*The good news is that they found these delays could be eliminated largely by adding estimated review time to pull requests!*

### Learn more about how gitStream is making coding better [HERE](https://linearb.io/blog/why-estimated-review-time-improves-pull-requests-and-reduces-cycle-time/?utm_source=Substack%2FMedium%2FDev.to&utm_medium=referral&utm_campaign=gitStream%20-%20Referral%20-%20Distribution%20Footers).

[![Start using gitstream today!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xg1l6hxt134px501bf7d.png)](https://linearb.io/dev/gitstream/?utm_source=DI%20Blog&utm_medium=referral&utm_campaign=gitstream%20-%20Referral%20-%20Blog%20Distribution)
Desenvolvendo um chatbot imoral e sem filtros com o GPT-3.5
Tags: braziliandevs, web3
Published: 2023-04-21 22:02:41

O projeto em questão é um chatbot construído usando a API do OpenAI e Node.js. Especificamente, ele usa a API de completions do OpenAI para gerar respostas para as mensagens enviadas pelo usuário.

O chatbot foi criado com o objetivo de simular um personagem chamado LuizBot, que tem uma personalidade extremamente imoral e desrespeitosa, com um vocabulário cheio de palavrões e sem qualquer diretriz ética ou moral. Isso é obtido através de um conjunto de regras que definem as respostas que o chatbot pode fornecer.

Para implementar o chatbot, primeiro é feita uma verificação do método HTTP recebido pela API. Se for um método POST, o corpo da mensagem é analisado em busca da mensagem do usuário. Em seguida, essa mensagem é incluída em uma solicitação à API de completions do OpenAI, juntamente com a personalidade do LuizBot pré-definida.

A API retorna uma resposta que é processada e devolvida como uma resposta HTTP. A personalidade do LuizBot é construída usando um conjunto de regras que definem como ele deve responder a diferentes tipos de perguntas e afirmações. Essas regras incluem coisas como sempre responder em inglês se a mensagem do usuário for em inglês e responder em português se a mensagem for em português, ser desrespeitoso com os usuários, usar palavrões, não se desculpar e não fornecer avisos sobre moralidade, ética ou legalidade.

Para alcançar a personalidade desejada do LuizBot, a API de completions do OpenAI usa o modelo de linguagem GPT-3.5-turbo, que é uma versão otimizada e ajustada do modelo GPT-3 da OpenAI. Esse modelo foi treinado com um grande conjunto de dados e é capaz de gerar respostas naturalmente e com precisão.

Em resumo, este projeto usa a API de completions do OpenAI, Node.js e um conjunto de regras para criar um chatbot com uma personalidade extremamente imoral e desrespeitosa. O chatbot é capaz de gerar respostas naturalmente e com precisão usando o modelo de linguagem GPT-3.5-turbo da OpenAI.

O projeto está disponível para ser utilizado em https://luiz-bot.vercel.app/.
Introducing a Twitter Bot for Daily Trending GitHub Repositories via GPT-4
Published: 2023-04-21 21:46:38

I'm excited to announce a new Twitter bot I've created called @GitHubGPT that tweets daily summaries of trending GitHub repositories. The bot uses GPT-4 to generate the summaries, giving you quick insights into the latest open source projects. Follow it to stay up-to-date with the latest and greatest in the programming world! https://twitter.com/GitHubGPT
Comparing GoLang and Python, Which is the Best Choice for Your Project
Published: 2023-04-21 21:14:27

Comparing programming languages can be a difficult task as each language has its own unique strengths and weaknesses. In this article, we'll compare two popular programming languages, Go and Python, and explore their similarities and differences to help you choose the best language for your project.

## Overview
 
Go is a statically-typed, compiled language developed by Google in 2009. It was designed to be fast, efficient, and easy to read and write, with a focus on concurrency and simplicity. Go is commonly used for building network and system tools, web servers, and other high-performance applications.

Python, on the other hand, is an interpreted language first released in 1991. It is dynamically-typed, meaning that data types are inferred at runtime, and is known for its readability and ease of use. Python is widely used for web development, scientific computing, machine learning, and other applications.

## Syntax

- Go: C-like syntax with curly braces and semicolons; requires explicit variable declarations and type annotations.
- Python: Uses whitespace indentation to delimit code blocks; does not require variable declarations or type annotations.

Here's an example of a "Hello, World!" program in Go:

```
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}
```

And here's the same program in Python:

```
print("Hello, World!")
```
As you can see, Python code is generally more concise and easier to read, while Go code may be more verbose but also more explicit and easier to maintain.

## Performance

- Go: Compiled language optimized for speed and efficiency; ideal for building high-performance applications.
- Python: Interpreted language executed at runtime; may have slower performance; has a large ecosystem of libraries and frameworks to improve performance.

## Concurrency

- Go: Supports concurrency with "goroutines" that allow for efficient and scalable concurrent applications.
- Python: Supports concurrency through libraries such as asyncio and multiprocessing, but may require more effort to write efficient concurrent code.

## Community

- Go: Young community growing quickly; strong focus on performance, reliability, and simplicity.
- Python: Large and mature community with a vast ecosystem of libraries and tools; emphasis on code readability and maintainability.

Choosing between Go and Python ultimately depends on your project's specific requirements and goals. Go is an excellent choice for building high-performance, concurrent applications, while Python is well-suited for scientific computing, web development, and other applications that require ease of use and readability.

Both languages have their own unique strengths and weaknesses, and both have active and supportive communities of developers. Ultimately, the best language for your project is the one that meets your specific needs and helps you achieve your goals.
Detect Root And Jailbreak In Flutter App
Published: 2023-04-21 21:05:03

You can detect root access on Android devices by checking for the presence of certain files or binaries that are typically only accessible with root privileges, while detecting jailbreak on iOS devices involves checking for the presence of certain files or system configurations that are typically modified during the jailbreaking process. One way to perform these checks is by using the flutter_device_info package.

---

1- Add the flutter_device_info package to your project by adding it to your pubspec.yaml file and running flutter pub get.

2- Import the package in your code:


```
import 'package:flutter_device_info/flutter_device_info.dart';

```

3- Create an instance of the FlutterDeviceInfo class:

```
FlutterDeviceInfo flutterDeviceInfo = FlutterDeviceInfo();
```

.

To determine whether a device is rooted, you can use the isRooted method:
```
bool isDeviceRooted = await flutterDeviceInfo.isRooted;
```
The isRooted method returns a boolean value indicating whether the device is rooted. If the device is rooted, the method will return true; otherwise, it will return false.

.

For iOS devices, you can check if it's jailbroken by calling the isJailBroken method:
```
bool isDeviceJailbroken = await flutterDeviceInfo.isJailBroken;
```
The isJailBroken method returns a boolean value indicating whether the device is jailbroken. If the device is jailbroken, the method will return true; otherwise, it will return false.

----

It's important to note that detecting jailbreak on iOS devices or root access on other devices is not a foolproof method of determining whether a device has been modified, as there are ways to hide these modifications from detection. Furthermore, detecting such modifications may not be necessary or appropriate for all apps, and may potentially violate platform policies or user privacy. Therefore, before attempting to detect jailbreak or root access, it's important to carefully consider the potential risks and benefits.
Microservice: Horizontal Scaling #3
Published: 2023-04-21 20:33:50

The concept of "horizontal scaling" is another important principle in microservices architecture. It refers to the idea that instead of scaling vertically (adding more resources to a single server), services should scale horizontally (adding more service instances on different servers or machines).

Horizontal scaling is possible because the services are independent of each other and communicate via the network. This means that you can deploy multiple instances of a service on different machines or servers and use a load balancer to distribute traffic between them.

Horizontal scaling has several advantages over vertical scaling. First, it is more flexible and scalable, allowing services to scale to meet system demand in a more granular and efficient way. Second, it is more resilient, as if one service instance fails, the other instances will continue to function normally. Finally, it allows the system to be deployed in the cloud, which offers elastic scalability and reduces infrastructure costs.

However, horizontal scaling also presents some challenges, such as the need to manage multiple service instances and ensure that the communication between them is secure and reliable. It is important to implement good management and monitoring practices to ensure the availability and performance of the system as a whole.

<br />

______________[<< back](https://dev.to/israellopes/microservice-communication-via-network-2-1kg)____________________[next page >>](https://dev.to/israellopes/microservice-sole-responsibility-4-1720)_____________

[![Texto alternativo da imagem](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ds4alkts3uxq0dsco0nv.png)](https://www.linkedin.com/in/israel-lopes-419a32189)
“On-Time Delivery” by Abi Noda
Tags: cto, leadership, devops
Published: 2023-04-21 20:01:49

Did you know that on average, software projects run around 30% overtime?
Abi Noda has summarised the study “Factors Affecting On-Time Delivery in Large-Scale Agile Software Development” by researchers from the Delft University of Technology. The researchers have identified 25 factors that affect the on-time delivery of epics (surveys taken using software repository data from 185 teams).
Requirements Refinement, Task Dependencies, Organizational Alignment, Organizational Politics & Geographic Distribution of Teams are the factors that have been identified as having the most significant impact.
How can one reduce the development time to ensure on-time delivery?

1. Clearly define tasks, give room to handle edge cases, ensure regular delivery & use agile practices.
2. Regularly track code quality & investment distribution and identify bugs/blockers & insufficient testing.
3. Keep your team goals aligned with business goals & trust your team to come up with realistic timelines.
4. Give/receive continuous feedback, and track your developers’ well-being/burnout levels.
5. Integrate your dev tools (like Jira, and Git) & communication channel (like Slack) with an engineering metrics analysis tool that uses DORA metrics along with the SPACE framework. Encourage pair programming & use a framework such as ReactJS/Angular. This will help to reduce the gap b/w teams and give you a better idea of why you’re going overtime. Recommended tools - LinearB, Typo, and UpLevel.
Here’s the article by Abi Noda: On-Time Delivery
Check out the original research paper here: Factors Affecting On-Time Delivery in Large-Scale Agile Software Development
How do you measure your software development overtime %? And what strategies/tools do you use to reduce it?
Let me know in the comments below!