teleren/devto huggingface dataset:
Traffic Mirroring with GoReplay
Tags: linux
Published: 2020-06-21 09:35:10

## What is GoReplay?
Github: https://github.com/buger/goreplay


- It captures HTTP requests received by the server and then  duplicate the traffic to another server.

- For example, when you test the new version of your application on the stating environment, you can check the behavior of the application by replicating the trrafic using GoReplay.
- This can be done without affecting existing application and traffics. (Because GoReplay uses libpcap, which retrieves packets at the L2 level, as well as tcpdump)
- Solves the problem of shadow proxies which is used for similar purposes. ( it can be a critical path of the traffic.)

### You can do for example, 
- Capture HTTP request packets and duplicate them
- Save the packet on the file, restoring it from the file
- Filtering request packets
- Rewriting request headers 

## How to install
You can download rpm, deb and tar.gz from
https://github.com/buger/gor/releases


For AmazonLinux, you can get a tar.gz of the executable binary. If you get the tar.gz and decompress it, you get "gor".

## Simple Usage.

```sh
$ sudo ./gor --input-raw :8000 --output-stdout
```

By default, no response contents are received.
you can receive them by adding --output-http-track-response option.

Replaying Packets.
```sh
$ sudo ./gor --input-raw :8000 --output-http="http://localhost:8001"
```
Save the requests 
 to a file
```sh
$ sudo ./gor --input-raw :8000 --output-file=requests.gor
```
Restore and send the requests stored in the file
```sh
$ sudo ./gor --input-file requests.gor --output-http="http://localhost:8001"
```
You can also specify multiple IP addresses to send requests 
 by round-robin feature.

The response body is designed to receive up to 200KB by default.

Supports BASIC authentication. You can specify user:pass@ before the URL.
You can specify user:pass@ before the URL.

```sh
$ sudo ./gor --input-raw :80 --output-http "http://user:pass@staging.com"
```
Filtering Requests.
Replay only requests to /api
```sh
$ sudo ./gor --input-raw :8080 --output-http staging.com --http-allow-url /api
```
Excluding only requests to /api
```sh
$ sudo ./gor --input-raw :8080 --output-http staging.com --http-disallow-url /api
```


## Example Use Case 1
- Capture HTTP packets to /production/submission on port 80
- The path changes from  /production/submission to /staging/submission/ 
- Saving the source IP addresses of the packets
- Replay the packet to https://staging.abc.com


```sh
$ sudo ./gor --input-raw :80 --output-http 'https://staging.abc.com '
--http-allow-url /production/submission
--http-rewrite-url /production/submission:/staging/submission --input-raw-realip-header "X-Real-IP" 
```

## Example Use Case 2
Capture the requests and save it to a file.
AUTH-TOKEN is rewritten to an arbitrary value for the test user on the staging environment.
Do not save requests for sign_in, sign_out operation. 
```sh
$ sudo ./gor --input-raw :80 --output-file=requests.gor 
--input-raw :80 --output-file=requests.gor
--http-set-header "X-HTTP-AUTH-TOKEN: abcdefghijk"
--http-disallow-url /sign_in
--http-disallow-url /sign_out
```
GO ile GTK uygulaması geliştirme - 1
Tags: gtk, go, dev
Published: 2020-07-15 14:53:35

GO dili ile GTK3 kütüphanesi kullanarak geliştirme yapabilirsiniz.

## GOlang uygulamasının kurulumu

Debian tabanlı sistemlerde golang dilini kurabilmek için golang paketini yüklemeniz gerekmektedir. Bu paket kendisi diğer bağımlılıklarını yüklemektedir:

```bash
sudo apt install golang
```

## GTK geliştirmek için gerekli paketlerin kurulumu

GOlang paketini yükledikten sonra GTK arayüzü geliştirmek için ise aşağıdaki 3 paketi ve gerekli bağımlılıkları yüklemeniz gerekmektedir:

```bash
sudo apt install libgtk-3-dev libcairo2-dev libglib2.0-dev
```

## Güncel GOTK3 kütüphanesini kullanmak

Gerekli paketler kurulduktan sonra komut satırından aşağıdaki komut ile GTK3'ün GO dili bağlayıcısını indirmeniz gerekmektedir:

```bash
go get github.com/gotk3/gotk3/gtk
```

Ve tabi bu adımdan sonra sisteminiz artık GTK ile uygulama geliştirmek için hazır.

## Örnek GTK uygulaması inşa etmek

Bu işlem için GOTK3 kütüphanesindeki ilk örneği yapabiliriz. Yorum satırlarını da bilerek kaldırmadım detaylı inceleyebilirsiniz. Bu örnek ve daha fazla örneği ise [bu adres](https://github.com/gotk3/gotk3-examples)te bulabilirsiniz. Aşağıdaki içeriği örneğin **ilkornek.go** adıyla kaydedebilirsiniz.

```go
package main

import (
    "github.com/gotk3/gotk3/gtk"
    "log"
)

func main() {
    // Initialize GTK without parsing any command line arguments.
    gtk.Init(nil)

    // Create a new toplevel window, set its title, and connect it to the
    // "destroy" signal to exit the GTK main loop when it is destroyed.
    win, err := gtk.WindowNew(gtk.WINDOW_TOPLEVEL)
    if err != nil {
        log.Fatal("Unable to create window:", err)
    }
    win.SetTitle("İlk Örnek Başlık")
    win.Connect("destroy", func() {
        gtk.MainQuit()
    })

    // Create a new label widget to show in the window.
    l, err := gtk.LabelNew("Merhaba gotk3 Dünyası!")
    if err != nil {
        log.Fatal("Unable to create label:", err)
    }

    // Add the label to the window.
    win.Add(l)

    // Set the default window size.
    win.SetDefaultSize(800, 600)

    // Recursively show all widgets contained in this window.
    win.ShowAll()

    // Begin executing the GTK main loop.  This blocks until
    // gtk.MainQuit() is run.
    gtk.Main()
}
```

Dosyayı kaydettiğiniz yerde aşağıdaki komutu kullanarak inşa edebilirsiniz. Bu komut çıktısında ilkornek adında bir çalıştırılabilir ikili dosya oluşturulmaktadır:

```bash
go build ilkornek.go
```

## Uygulamayı çalıştırmak

Oluşturulan ikili dosyayı aşağıdaki gibi çalıştırarak "Merhaba gotk3 Dünyası!" yazısını görebilirsiniz:

```bash
./ilkornek
```

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/w1cnc6azucdob5unkzqa.png)

Nihil novi sub sole
Have you tried Github profile readme?
Tags: github, profile, readme, news
Published: 2020-07-15 14:46:02

A new feature has come up in Github where you can add a README file for your profile! Yes finally we can have a short description about yourself on the profile page in GitHub.

It is really simple to get started with having your own GitHub profile Readme.

First just head over to create new repository and give the repo name same as your GitHub username (in my case it's madhuresh97) and you will see a green message box like the photo below:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/uh5yomr1x4sm4mmdkzo9.png)


Make sure you have checked "Initialize this repo with a README" as this is the place where you will be writing about yourself which will be displayed in your GitHub profile.

Now commit your content what you would like any person visiting your GitHub profile to know about you.

Finally git commit your changes.

That's it!! 🚀

This is what my GitHub profile README looks like:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/poftjiwb1gog946wmyfy.png)
Algumas das fases que passei no aprendizado de programação orientada a objetos
Tags: oop, braziliandevs
Published: 2020-07-15 14:45:22

Eu passei por algumas fases diferentes no aprendizado para tentar ter um código mais orientado a objetos (desde 2014). Entre essas fases então:

* Quase desistir de um curso técnico em 2011 quando tive o primeiro contato com a orientação a objetos.

* Aprender a fazer algumas classes ruins (usando varíaveis globais para passar a pdo para a classe) e (achar esse código ruim) o máximo.


* Insistir em estudar e começar a ter mais conforto com objetos por volta da metade de 2013.

- Ter um código com muita herança, onde tudo estava estendendo de um model mais genérico que era gigante.

- Entender injeção de dependência se empolgar e querer parametrizar tudo (até o que nem precisaria variar).

- Criar um framework próprio (aka framework caseiro) em 2014 e se empolgar (atualizando o código com o que eu ia aprendendo).

- Ler muitos artigos que questionam getters, setters, entidades e outras práticas e achar que tinha descoberto o jeito "certo" e passar a achar que determinadas práticas são sempre ruins sem analisar.

- Ler muitos artigos e achar que código estáticos são sempre ruins, o que é uma generalização sem análise da situação.

- Eu gosto muito do conceito de interfaces, logo acabei criando interfaces para todas as classes, até as que não precisariam de uma interface por não exigirem novas implementações diferentes.

- Ter interfaces e classes com o mesmo nome separadas por um prefixo I e não enxergar que isso era um sinal de erro de abstração.

- Começar a rever as minhas posturas sobre as opniões que eu tinha formado e ir ficando menos intrasigente (mais flexível). Com isso, comecei a reavaliar as práticas que eu aplicava cegamente. Disso surgiram as etapas a seguir.

- Ver que código estático nem sempre é um problema e pode ser aplicado para coisas simples como factorys e operações simples que agem com funções e não precisam ser trocados (através de injeção de dependência).

- Ver que nem toda classe precisa de interface para variar a sua implementação.

- Usar array para tudo e achar entidades desnecessárias pela complexidade adicionada (sem enxergar o contexto/informação sobre o domínio/regras de negócio que elas dão).

### As mudanças de 2020

Antes [eu acha que para seguir DIP era só depender de abstrações com uma interface e classe abstrata](https://dev.to/raphaeldasilva/poo-revisando-o-principio-da-inversao-de-dependencia-dip-19cj), sem entender a relação entre o que está baixo nível (infraestrutura) e o que está alto nível (domínio).

Depois disso passei a buscar expressar o domínio de forma mais intuitiva e nítida, por isso estou tentando usar alguns conceitos mais simples de DDD (entidades, value objects). 

Junto com os conceitos de DDD também estou tentando aplicar a separação do código de infraestrutura e domínio, pois só depois dessa separação eu comecei a entender o que realmente significa o princípio da inversão de dependência do SOLID.
อะไรคือ Deno?
Tags: deno
Published: 2020-07-15 14:43:16

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/dd7itkywnyuf14cjxmzp.png)
Deno เป็น Runtime สำหรับ JavaScript และ TypeScript ที่ใช้ V8 และสร้างขึ้นบน Rust เพื่อลบข้อผิดพลาดหรือปัญหาต่างๆ ที่ทำไว้ตอนที่สร้าง node.js ขึ้น ซึ่งมีผู้สร้างเดียวกันกับ node.js คือ Ryan Dahl

###ทำไมต้อง Deno?###
-**มีความปลอดภัย** Script ต่างๆจะไม่สามารถเข้าถึงไฟล์ในเครื่องได้โดยไม่ได้รับอนุญาตก่อน
-**สนับสนุน TypeScript** ว่ากันว่า TypeScript นั้นใช้งานได้ดีกว่า JavaScript ทำให้เป็นที่นิยมมาก เพียงแต่ยังใหม่อยู่เท่านั้น
-**มี build-in utilities ให้ใช้** เช่น dependency inspector (deno info) และ code formatter (deno fmt).
-**มีชุดที่ใช้ตรวจสอบมาตรฐานของ Module** ที่รับประกันว่าจะทำงานกับ
Deno: [deno.land/std](https://deno.land/std)

###การติดตั้ง###
Shell (Mac, Linux):

`curl -fsSL https://deno.land/x/install/install.sh | sh`

PowerShell (Windows):

`iwr https://deno.land/x/install/install.ps1 -useb | iex`


#####สามารถศึกษาวิธีติดตั้งเพิ่มเติมได้ที่ https://deno.land/#####

####วิธีใช้งาน####

เริ่มต้นด้วยวิธีอย่างง่าย
``` 
deno run https://deno.land/std/examples/welcome.ts
```

หรือวิธีที่ซับซ้อนหน่อย
```
import { serve } from "https://deno.land/std@0.61.0/http/server.ts";
const s = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of s) {
  req.respond({ body: "Hello World\n" });
}
```

เนื่องจากไม่มีสิ่งใดสมบูรณ์แบบ ทั้ง deno และ node.js ต่างก็มีข้อดีข้อเสียต่างกัน ที่เราทำได้ก็แค่เฝ้าดูไดโนเสารตวนตอไปวาจะวงแซงรนพอยาง node ไดหรอไม
Introducing `bump-cdk`
Tags: showdev, awscdk, aws, node
Published: 2020-07-15 14:21:25

---
title: Introducing `bump-cdk`
published: true
description: Easily manage AWS CDK Dependencies
tags:
- showdev
- awscdk
- aws
- node
---

## Quickstart

From a directory that contains a `package.json` with [aws-cdk](https://github.com/aws/aws-cdk) dependencies run:

```bash
$ npx bump-cdk
```

You should now have those dependencies upgraded and pinned to the same version!

You can check out the source [here](https://github.com/cdk-tools/bump-cdk/tree/master/packages/bump-cdk).

## Why does this exist

A common issue when working with [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/home.html) is version mismatch.

The way CDK's modules interface together requires them to always be on the same version [More Information](https://docs.aws.amazon.com/cdk/latest/guide/troubleshooting.html#troubleshooting_modules).

This for example might cause an error:

```json
{
    "dependencies": {
        "@aws-cdk/core": "1.30.0",
        "@aws-cdk/aws-lambda": "1.51.0"
    }
}
```

This introduces maintenance overhead by forcing you to always have your CDK dependencies on the same version.

Additionally, because of [semver](https://docs.npmjs.com/files/package.json#dependencies), when you add dependencies, you often end up with a dynamic version range:

```bash
$ yarn add @aws-cdk/core
...
{
    "dependencies": {
        "@aws-cdk/core": "^1.30.0"
    }
}
```

This means that the module is "Compatible with version" `1.30.0`, but dependencies added at a later date can get out of sync.

Because of all this, [it is recommended](https://github.com/aws/aws-cdk/issues/3711) to pin the versions without the semver range modifier.

## Issues

Feel free to check it out, and if you find any issues or have suggestions feel free to [open an issue](https://github.com/cdk-tools/bump-cdk/issues/new).
Protocolo HTTP
Tags: html, http, web, server
Published: 2020-07-15 14:15:46

# O que é o protocolo HTTP?

HTTP (HyperText Transfer Protocol) é um protocolo da camada de aplicação do modelo OSI que permite buscar recursos de um servidor na internet (client-server protocol). Isso significa que uma busca que começa pelo client, geralmente usando um browser, retorna um documento criado a partir de diferentes documentos buscados em servidores na internet.

Quando um cliente busca alguma informação de uma página web dizemos que ele está fazendo uma requisição, e tudo que é retornado a partir disso chamamos simplesmente de resposta.

O protocolo HTTP foi criado no início dos anos 90 e sofreu diversas mudanças ao longo dos anos. É um protocolo da camada de aplicação que é enviado por TCP ou por uma conexão TCP criptografada por TLS.

# Componentes dos sitemas baseados no protocolo HTTP

Como já citamos, o protocolo HTTP é um client-server protocol, o que significa que as requisições são enviadas por um usuário, na maior parte do tempo por meio de um browser. Mas as requisições também podem ser feitas por sistemas programados. Cada requisição é enviada para um servidor que faz o tratamento adequado e devolve uma resposta. Mas entre o cliente fazendo a requisição e o servidor devolvendo uma resposta existe uma série de entidades chamadas de proxies que atuam de diferentes formas para armazenar informações em cache ou fazer redirecionamentos para manter em tempo ágil o fluxo da requisição.

# Cliente

O cliente, ou user-agent, é qualquer entidade que seja capaz de realizar requisições para um servidor.
Para apresentar uma página da web, o navegador envia uma solicitação original para buscar o documento HTML que representa a página. Em seguida, analisa esse arquivo, fazendo solicitações adicionais correspondentes a scripts de execução, informações de layout (CSS) a serem exibidas e sub-recursos contidos na página (geralmente imagens e vídeos). O navegador da web combina esses recursos para apresentar ao usuário um documento completo, a página da Web.

# Servidor

No lado oposto ao cliente está o servidor, que devolve como resposta o documento HTML com o que foi solicitado pelo cliente.
Um servidor não é necessariamente uma única máquina, mas várias instâncias de software para servidor podem ser hospedadas na mesma máquina.

# Proxies

Os proxies fazem parte da camada intermediária de um fluxo de requisição-respota. Os proxies tratam as requisições e devolvem as respostas da melhor maneira para manter um bom desempenho. Algumas funções dos proxies:

- cache (armazena informações públicas ou privadas)
- filtragem (verificações de segurança)
- balanceamento de carga (permite que vários servidores atendam a diferentes solicitações)
- autenticação (controla o acesso a diferentes recursos)
- registro (permite o armazenamento de informações)
Using Ele with free BackBlaze bucket
Tags: devops, aws, cmd, fileshare
Published: 2020-07-15 14:12:25


This is in continuation of previous article [How to use Ele](https://dev.to/prakis/upload-download-files-from-command-line-1b8a)
[HelloEle.com](https://helloele.com)

Sharing your documents remotely with your fellow team members? Then say hello to ele. No sharing of lengthy URLs or the hustle of logins. This simple easy-to-use file sharing tool solves it all.

This tutorial focuses on using ele with BackBlaze Cloud Storage, configuration is same for any other S3 comptable cloud storage system.

1. Create an account in BackBlaze.
2. Create a bucket as shown below.
	- Go to Buckets tab under B2 Cloud Storage.
	- Select Create a bucket option.
	- Enter a name for the bucket you are creating.
![](https://helloele.com/images/create-bucket.png)

3. Create secret key for your bucket.
	- Head to the App Keys page
	- Click on Add a New Application Key button.
	- A pop-up appears, enter any key name for your bucket.(Note: This key name will not be used for ele)
![](https://helloele.com/images/app-key.jpg)
	Once the key is created, make sure you copy the Key ID and Application Key listed in the blue box.

4. Install ele using the below command in the terminal.
`	$ npm install -g helloele`
5. Create group using the command,
`	$ ele create-group `

	The create-group command prompts for few inputs:
	- Type of Storage - choose Back Blaze.
	- s3 access key - keyID in the above image
	- s3 secret access key - applicationKey in the above image
	- s3 bucket name - your bucket that you created in BackBlaze
	- group name - group name of your choice
![](https://helloele.com/images/create-group.jpg)
 ##### Once the group is created, share your-group-name.ini file to your group members by email or other means. 

6. The other group members can join this group using the above created group.ini file and the following command,

	`$ ele join <your-group-name.ini> `

7. Now to upload a file in this group run

	`$ ele upload <file-to-be-uploaded> `
	
	**This returns a file-number on the successful upload which can be shared to your team members off-wire. **

8. To download that file run

	`$ ele download <file_number>`

9. To delete the file from group

	`$ ele delete <file_number>`
Did your rankings drop? Follow 13 easy steps to recover
Tags: seo, ranking, marketing
Published: 2020-07-15 13:46:36

Everyone who strives for the highest positions in search engines sometimes experiences the inevitable—the hard-earned rankings suddenly drop.

There are many different reasons why this happens, both internal and external. The cause often reflects changes done to the website or an update to the website’s content that doesn’t turn out well. 

There can also be other factors, such as a search engine’s algorithm update, SERP layout changes, technical issues, or even a Google penalty. Besides, the market is constantly evolving with users changing their preferences and competitors making striking moves. 

But, at the end of the day, ranking is only one of the many parts of SEO.

## When the pandemic hits

We can see a great example of ranking being almost insignificant in the current outbreak of the new coronavirus that has reshaped the users' behavior to an extent no one had foreseen. 

One of the many victims of Covid-19 has been the whole travel industry. Once the pandemic hit the world, people rather barricaded themselves at home and worried more about their well being than their past-time activities on a tropical island. 

Although the ranking of travel-related keywords didn’t change much during the time, people stopped searching for them and the organic traffic went down in a landslide. Simultaneously, health and safety-related search queries increase in volumes. 

This means that a drop in rankings doesn’t mean the end of the world and there are more elements we should monitor as well. 

However, an experienced SEO should always remain prepared for any eventuality. Having a process in place for investigating the possible reason for the drop is highly recommended, so is monitoring and tracking changes to your website’s content and technical foundation. After all, without that information, you’re in the dark.

Once you realize that your rankings have dropped, you should follow these 13 steps.

1. Don’t panic
2. Double Check if your Google Rankings really dropped
3. Scope the impact of the drop
4. Analyze recent changes to the website
5. Look for possible technical issues
6. Check if there wasn't a Google algorithm update recently
7. Or if there wasn’t an update to SERP
8. Reconsider disavowing backlinks
9. Look for possible Google Manual Action
10. Analyze if your website hasn’t been hacked
11. Look at possible changes in search intent and behavior
12. Look for any moves made by your competitors
13. Look for lost backlinks

Need more answers on ranking drops? Read our [extensive guide](https://www.contentkingapp.com/academy/ranking-drop/).
What is nodejs?
Tags: node, javascript, webdev, react
Published: 2020-07-15 13:45:33

##What is nodejs? 

Maybe you are trying to learn backend or server side languages and then you came across this term nodejs. Let me explain it to you in simple terms.

When you write your javascript code and run it in browser, it runs perfectly. But what if you want to run it on server(your computer) and not in some browser. Here comes nodejs. So now you can say that it is a runtime enviornment for your javascript. Just type `node index.js` in your terminal to run your js file. Actually nodejs uses the same engine as that of Chrome's V8 javascript engine.

Nodejs was written by Ryan Dahl in 2009 and is very much used now-a-days.
Open sourcing a SaaS
Tags: news, opensource, saas
Published: 2020-07-15 13:45:14

# Twake is now open source

For several years, the Twake team has been working hard to create high-performance collaborative software. Today, I'm really excited to announce that Twake is open source !

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vef7ei5yx1e1nxgvbv7a.jpg)

## What is Twake
Twake is an open source alternative to Teams and Slack (https://github.com/TwakeApp/Twake). We offer an extended team messaging service through additional modules (player, calendar, task manager).

## Twake goes open source
We have just released our software in open source. This is a big first for us. We are discovering this wide and benevolent world. We see the great number of benefits that open source brings to the project. Within a few days, we have received a lot of support from the community. We can also bring a lot of transparency on the development of Twake.

{% github TwakeApp/Twake no-readme %}

## Business model
Like any business, Twake has to make money. This is one of the difficulties for open source companies, it is necessary to innovate and find a business model that corresponds to the ambitions and values of the company. We took the decision to open source Twake's code in its entirety, that means that all the features are accessible. In addition, we host a SaaS version which is monetized. In this way, we can offer our entire platform to the community and ensure the sustainability of the company.

## Feedbacks
This is our story, I'd like to get your feedbacks and advices on our approach to open source. If you want to support us, leave a star on github (https://github.com/TwakeApp/Twake) ;)

Thank you for reading 🙏