teleren/devto huggingface dataset:
Bandwidth Limiting Applications
Tags: linux, networking
Published: 2023-01-06 01:14:04

---
title: Bandwidth Limiting Applications
published: true
date: 2020-10-23 01:51:27 UTC
tags: Linux,Networking
canonical_url: https://brandonrozek.com/blog/bandwidthlimitingapps/
---

Whether it’s web scraping or testing low latency connections, we want to be able to bandwidth limit certain applications. I’ve written about [rate limiting network interfaces](/blog/limitbandwidth/) before. This post focuses on the application level instead.

First if the application has an option to rate limit, then we should prefer that. Here are the ways you can rate limit in some common terminal applications. Let’s say you set the bandwidth limit as `$max_kbps`

```
rsync --bwlimit $max_kbps ...


curl --limit-rate $max_kbps ...


wget --limit-rate $max_kbps ...

```

If the application you want to rate limit does not have a convenient flag and is dynamically linked, then we can use the application [`trickle`](https://github.com/mariusae/trickle).

```
trickle -s -d $max_kbps -u $max_kbps

```

| Flag | Description |
| --- | --- |
| `-s` | Standalone Mode |
| `-d` | Download Bandwidth Consumption Rate (KB/s) |
| `-u` | Upload Bandwidth Consumption Rate (KB/s) |

Trickle works by replacing the socket library that is dynamically linked.
Minha Participação no hacktobefest
Tags: hacktoberfest
Published: 2020-10-23 01:31:04


### [Minha Participação no hacktobefest]
<! - Estou na faculdade de Sistema de Informação. No grupo da faculdade mencionaram sobre o hacktobefest, pois vi a oportunidade de atribuir meus conhecimentos ao mundo dos códigos abertos ->

### Fundo

<! - Comecei a contribuir no código aberto, graças ao hacktobefest. Já venho programando há um tempo, mas é a primeira vez que contribuo no mundo de código aberto→

### Progresso

<! - Eu fiz as 4 solicitações de pull e foram aceitas ->

### Contribuições

<! - Criei um repositório no git e postei alguns códigos que fiz de questões do URI.
Link do repositório: https://github.com/LaryssaDias09/QUESTOES-URI ->


### Reflexões
<! - Eu participaria sim de outro hacktobefest, pois além de contribuir no aprendizado de outros programadores, pude adquirir novos conhecimentos também ->
Dealing with long strings in YAML
Tags: puppet, yaml, hiera, ruby
Published: 2020-10-23 00:38:06

---
title: Dealing with long strings in YAML
published: true
tags: puppet, yaml, hiera, ruby
//cover_image: https://direct_url_to_image.jpg
---

We have a step in our Puppet CI/CD Pipeline that lints YAML data using [adrienverge/yamllint](https://github.com/adrienverge/yamllint). One of the rules limits the number of characters on a single line. Normally not a huge deal... except when dealing with long URIs or other long strings.

The problem is, I have to change URI Hiera data so infrequently that I always forget exactly what the syntax is. Admittedly, this post is really for me to look back on and reference, but why not share?

And while we're on the topic:

* [YAML Cookbook for Ruby](https://yaml.org/YAML_for_ruby.html) is an awesome resource for YAML syntax in general.
* Puppet parses YAML using the following function in Ruby:
  ```ruby
  YAML.safe_load(File.read(path), [Symbol], [], true)
  ```
  Combine with Interactive Ruby Shell or `ruby -e` for a quick and easy way to test any YAML file you create.

## Plain Style

### "Flow" Styles

No character escaping, or characters matching `/[#:]/`.

```yaml
---
key: This is a very
     long string.
```

```ruby
{ "key" => "This is a very long string." }
```

### Single-quoted style

No special characters, no escaping. Literal `'` must be doubled-up (`''`).

```yaml
---
key: 'This isn''t
     a very short string.'
```

```ruby
{ "key" => "This isn't a very short string." }
```

### Double-quoted style

Characters matching `/[\\"]/` must be escaped by a `\` character. Common escape sequences may be used. Line concatenation with a trailing `\`. 

*VERY* useful for long URIs.

```yaml
---
key: "http://this.is.my\
     .very.long.string"
```

```ruby
{ "key" => "http://this.is.my.very.long.string" }
```

## Block Notation

### Literal Style

```yaml
---
key: |
  This is a very
  long string.
```

```ruby
{ "key" => "This is a very\nlong string.\n" }
```

### Folded Style

```yaml
---
key: >
  This is a very
  long string.
```

```ruby
{ "key" => "This is a very long string.\n" }
```

### Block chomping indicator

You may notice that both strings have newlines attached to the end. Want those gone? Use a different chomping indicator:

* `|`, `>`: "clip". Keeps the newline.
* `|+`, `>+`: "keep". Keeps the newline, and also keeps tailing blank lines.
* `|-`, `>-`: "strip". Removes the newline.

```yaml
---
key0: >
  Do. Or do not.
  There is no try.

key1: >+
  I find your lack of
  faith disturbing.
  
key2: >-
  The Force will be
  with you. Always.
```

```ruby
{
  "key0" => "Do. Or do not. There is no try.\n",
  "key1" => "I find your lack of faith disturbing.\n\n",
  "key2" => "The Force will be with you. Always."
}
```

Source: [YAML v1.2 Specification](https://yaml.org/spec/1.2/spec.html)
Notification data model
Tags: database, webdev, discuss
Published: 2020-10-23 00:31:20

I'm writing this post hoping to start a discussion about a good database model (Relational primarily) to serve most of the use-cases that require storing notifications in the database.
By notification, I mean something like "John commented on your post" or "Doe likes your profile".

I have been using polymorphism for the notification source and notification destination. I would use sometimes a JSON column to store arbitrary data, but I really hate it and would like to improve my methods.

Here are some points to discuss:
* How to store notification source?
* How to handle different notification types?
* Notification messages?
* Status?
* Should a single notification instance be linked to multiple destinations or just duplicate for each destination?
* What is an efficient query to list and paginate notifications when a user has different roles?

*Cover image credit: https://www.kindpng.com/*
Waiting time API at OPT.nc
Tags: docker, kubernetes
Published: 2020-10-23 00:04:36

# Context

Just using this post to share the API usage with collaborators. This shows how to locally deploy and use the API to get waiting times in agencies.

# Run it!

To be up and running, just:

```shell
docker pull rastadidi/opt-temps-attente-agences-api:latest
docker images
docker run -d -p 8081:8081 rastadidi/opt-temps-attente-agences-api:latest
docker ps

# Pour essayer l'API
sudo apt-get install httpie jq -y
http http://127.0.0.1:8081/temps-attente/agence/4161
http http://127.0.0.1:8081/temps-attente/agence/4161 | jq '.idAgence'
```

# Resources

- [Source code repository](https://github.com/adriens/opt-temps-attente-agences-api)
- [Image on DockerHub](https://hub.docker.com/r/rastadidi/opt-temps-attente-agences-api)
How to remove focus from the input HTML tag using JavaScript?
Tags: javascript
Published: 2020-10-23 00:00:00

---
  title: How to remove focus from the input HTML tag using JavaScript?
  published: true
  tags: JavaScript
  date: Fri Oct 23 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/remove-focus-input-element-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-9d8d24f3cee5b25eaa542db2e890de11.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/remove-focus-input-element-javascript)
  
To remove the focus on an `input` tag element in HTML, you can use the `blur()` method on the element using JavaScript.

```js
// remove focus from the element
element.blur();
```

Let's say we have an `input` tag and a `button` like this,

```html
<!-- Input tag -->
<input id="myInput" type="text" placeholder="Enter some text here" />

<!-- Button -->
<button id="myBtn">Click to remove focus from input</button>
```

This input tag will be already focussed when a user visits the website and we want to remove the focus when we click the `button` below it.

We can achieve this functionality using the `blur()` method on the `input` element.

```javascript
// first get a reference
// to the input tag and button
const input = document.querySelector("#myInput");
const button = document.querySelector("#myBtn");

// use the focus method
// to focus input tag
// when user visits
input.focus();

// attach a click handler
// to button element
button.addEventListener("click", () => {
  // when user clicks the button
  // remove the focus form the input tag
  // We can use the blur() method on the
  // input element to acheive that
  input.blur();
});
```

Now the `input` tag focus will be removed when clicked on the `button` element.

See this example live in [JSBin](https://jsbin.com/pecohisare/edit?html,js,output).

### Feel free to share if you found this useful 😃.

---
Goodbye Google
Tags: opensource, openbsd, selfhosting
Published: 2020-10-24 03:27:19

---
title: Goodbye Google
published: true
date: 2020-10-23 00:00:00 UTC
tags: opensource, OpenBSD, selfhosting
canonical_url: https://www.lifewaza.com/posts/goodbye-google/
---

I’ve been a gmail user since it first came out, and I used to be a fan of google, but now I find myself more and more concerned with their data gathering practices. I’ve decided to move all of my personal services off of google onto open source self hosted alternatives. This page will act as a checklist for each of the services I’m able to get off of. Each of the links below will talk about what I’m using now and how I set it up.

## Google Services To Replace

- [x] [search](#search)
- [x] [browser](#browser)
- [x] [email](#email)
- [x] [calendar](#calendar)
- [ ] [photos](#photos)
- [ ] [contacts](#contacts)
- [ ] [maps](#maps)
- [ ] [android](#android)
  - [x] [authenticator](#authenticator)
  - [x] [play store](#play-store)

### Search

This one was the easiest of the bunch. Instead of using google.com as a search engine, I now use duckduckgo.com. I’ve made duckduckgo.com my default search engine for _everything._ There’s even a command line tool that lets you search from the cli: [https://github.com/jarun/ddgr](https://github.com/jarun/ddgr)

### Browser

Instead of using chrome, I’m now exclusively using [Firefox](https://getfirefox.com).

### Email

Email was complicated since there are so many moving parts. Instead of gmail, I’m now using a combination of [OpenBSD’s smtpd](https://man.openbsd.org/smtpd), the [dovecot imap server](https://www.dovecot.org/), and [OpenBSD’s spamd](https://man.openbsd.org/spamd) hosted on a [Vultr VPS](https://www.vultr.com/) running [OpenBSD](https://www.openbsd.org). To read and send mail I’m now using [aerc](https://git.sr.ht/~sircmpwn/aerc) as well as [Thunderbird](https://www.thunderbird.net/en-US/) as my local clients. I don’t do webmail anymore.

### Calendar

For my calendar, I’m now using [simple calendar](https://www.simplemobiletools.com/calendar/) synching to a self hosted instance of [kcaldav](https://kristaps.bsd.lv/kcaldav/). I pretty much only use my calendar on my phone so I don’t currently have a web version.

### Photos

No good solution for photos yet.

### Contacts

Haven’t tried to figure out contact syncing yet.

### Maps

While I’ve used [openstreetmap](https://openstreetmap.org) it’s not very effective where I live. I’ve been contributing to it when I can, but it can’t yet replace google maps for me.

### Android

I know there are some open source forks of Android out there and I’ve tried [CyanogenMod](https://en.wikipedia.org/wiki/CyanogenMod) previously (which I guess is now called [LineageOS](https://lineageos.org/)), but I think ideally I’d like something like the [PinePhone](https://www.pine64.org/) to fully opt out of the Android ecosystem.

#### Authenticator

Instead of Google Authenticator I’m using [andOTP](https://f-droid.org/en/packages/org.shadowice.flocke.andotp/).

#### Play Store

Instead of the play store, I’m using [F-Droid](https://f-droid.org/en/) a catalog of open source software for Android.
Inspiration logins forms
Published: 2020-10-22 22:31:02

Animated Login Forms Using Only HTML,CSS & JS | Formularios Animados (Logins) con HTML, CSS y JS.

Hello this time I present some very good animated logins for your projects.

[![](http://img.youtube.com/vi/ow7YMKnHZMQ/0.jpg)](http://www.youtube.com/watch?v=ow7YMKnHZMQ "Amazing Login Form inspiration")

Come back recharged and I bring some very good videos, but let's start little by little, to start a little inspiration so that you can create incredible forms to log in to your projects I hope and you like it, leave me a like and subscribe for more videos.
 Have an excellent day!!


[![](http://img.youtube.com/vi/4Q0r6FPvZxw/0.jpg)](http://www.youtube.com/watch?v=4Q0r6FPvZxw "Amazing Login Form inspiration")

If you liked, like it and subscribe for more videos [Here](https://www.youtube.com/channel/UCjsuii8mIixAPEvarIxOZuQ?sub_confirmation=1). !!

If you want the code just comment to get in touch [Here](https://www.youtube.com/channel/UCjsuii8mIixAPEvarIxOZuQ?sub_confirmation=1). !!
Hello DEV Community!
Tags: meta
Published: 2020-10-22 22:22:39

Hey everyone! I'd like to introduce myself. I'm Erin, and starting this week I'll be helping out the DEV team as a part-time social media coordinator.

I don't know if you all have noticed, but DEV has an incredibly robust and engaged social media presence! So many feeds, so much great content. I'm delighted about the opportunity to help manage DEV's social channels, and I can't wait to dig in and get to know this wonderful community better. 

__Some fun facts about me:__
☕️I'm a full-time freelancer.
✋🏻 I live in Kalamazoo, Michigan, and I am an annoyingly proud Midwesterner.
🐱 I am the proud parent of a giant cat named Goose.
🌐 I'm a big advocate for a11y and inclusivity, especially as it relates to my work in content creation and social media management (I'm seriously considering taking the [WAS certification exam](https://www.accessibilityassociation.org/wascertification) in 2021, so if you've got advice for me, let's chat!).
💃 I'm a big pop culture geek & RuPaul's Drag Race superfan.

I'm so excited to get started in this new role, and I look forward to having a hand in delivering the freshest, pithiest, and most informative community-authored content on the web directly to your devices.
Animate objects along a user editable path in two lines of JavaScript.
Tags: canvas, zim, zimjs, amazing
Published: 2020-10-22 21:58:40

In [ZIM](https://zimjs.com), we can do so much with so little!  We are constantly coming in at 25%-50% the code of competing platforms - wow!  Here is an example - copy this and paste it at https://zimjs.com/lab/ to try it out:

```javascript
const track = new Beads(new Blob({
    borderColor:dark,
    borderWidth:50, 
    radius:200
}), new Circle(20,[pink,orange,blue])).center();
track.beads.animate({
    props:{path:track.path},
    time:10,
    loop:true,
    ease:"linear"
});
```
ZIM Beads is just one of many things you can do with ZIM on the Canvas. Here is a link to the [Beads&nbsp;Mini-site](https://zimjs.com/ten/beads/). There are tabs at the top right of the site for more examples.

---

If you have not checked out the Canvas recently - you simply must!  Here is the [ZIM&nbsp;Dev&nbsp;Site](https://dev.zimjs.com) and some [In-depth&nbsp;Guides](https://drabstract.medium.com/) by Dr&nbsp;Abstract including [Your Guide to Coding Creativity on the Canvas](https://drabstract.medium.com/your-guide-to-coding-creativity-on-the-canvas-ada0996298f6).
Permissão acumulável
Published: 2020-10-22 21:42:34

Esse sistema de permissões é semelhante ao modo octal de permissões do Linux onde se tem um numero para cada tipo de permissão:

| Chave | Descrição                 |
|-------|---------------------------|
| 1     | Permissão para visualizar |
| 2     | Permissão para criar      |
| 4     | Permissão para editar     |
| 8     | Permissão para remover    |

E pode se fazer combinações por exemplo: 1 + 2 = 3 dando assim permissão de leitura e criação.

Caso seja necessário outros tipos de permissões, pode ser adicionados mais por meio de uma [progressão geométrica](https://pt.wikipedia.org/wiki/Progress%C3%A3o_geom%C3%A9trica), por exemplo se eu quiser adicionar uma 5 chave de permissão eu vou utilizar o 16, e a 6 chave seria 32.

Lembrando que a descrição das chaves podem ser alteradas para cada sistema, a única restrição é que se a somatória for definida com uma certa intenção (como no exemplo da tabela em cima) essa somatória deve ser utilizada apenas com essa intenção, caso contrário a permissão será corrompida.

## Exemplos

```php
// Visualizar + Criar + Remover: 11
$permissao = 1 + 2 + 8;

// Visualizar + Editar: 5
$permissao = 1 + 4;
```

### Outros tipos de intenção

O exemplo abaixo é uma descrição de intenção onde se tem uma somatória para cada produto de uma ordem de serviço, essa permissão armazenada em cada item da O.S. indica se um campo do item pode ser visualizado, dessa forma um usuário que faz a moderação de cada item pode definir se o campo de um item (como a descrição por exemplo) pode ser visualizado pelos usuários que tem essa regra de visualização mais restrita

| Chave | Descrição                 |
|-------|---------------------------|
| 1     | Visível campo 1           |
| 2     | Visível campo 2           |
| 4     | Visível campo 3           |


# Verificando a permissão

Para verificar a permissão do sistema acima é necessário utilizar essa expressão `(PERMISSION / TYPE) % 2 >= 1` ou `(PERMISSION / TYPE) % 2 < 1`, onde `PERMISSION` corresponde a somatória das permissões e `TYPE` corresponde a chave da permissão que deseja saber se é permitido.

## Exemplos
No exemplo abaixo eu quero verificar se um usuário tem a permissão para editar algum item:

```php

/**
 * somatória das permissões do usuário
 * a um determinado item
 */
$permissao = 11;

/**
 * chave do tipo de permissão
 * 4 = Permissão para editar
 */
$tipo = 4;

/**
 * O resultado da expressão '($permissao / $tipo) % 2'
 * vai retornar 0 se o $tipo não estiver incluído na
 * somatória de $permissão
 */


if (($permissao / $tipo) % 2 >= 1) {
    // o usuário possui permissão para alterar o item
}


if (($permissao / $tipo) % 2 < 1) {
    // o usuário não possui permissão para alterar o item
}

```
Criando servidor de backup no Google Cloud Platform
Tags: googlecloud
Published: 2020-10-22 21:53:31

Olá, me chamo André Pereira, e esse é o meu primeiro post aqui no dev.to. Geralmente atuo como fullstack nos projetos que desenvolvo e por conta da responsabilidade que isso me traz, acabo não tendo oportunidade de trabalhar com infraestrutura.
https://100001.onl/ https://1921681254.mx/
Porém, recentemente eu resolvi fazer uma tarefa referente a infraestrutura de um projeto. A ideia era programar o Crontab da instância de produção para copiar os dados para uma instância de backup, ambas hospedadas no GCP. Aparentemente é uma tarefa simples, mas pode se tornar complicada para inexperientes em infraestrutura ou GCP.
What's the pros and cons of using a non-building framework today?
Published: 2020-10-22 21:48:50

Context: We have a huge legacy web app, with first commit 2003. It's based on the Yii PHP framework. Now we're thinking of moving beyond jQuery on the client side. We tried so far with multi-root Vue, but it ended up "suboptimal" and now we're actually reverting the changes back to vanilla PHP framework with a very thin layer of JavaScript. This "thinness" is relative, though, and we must prepare another way forward. Both Flow and TypeScript work on vanilla JS, so this can be included, as well as linting (NB: we have the luxury to assume support of ES8 in our administration interface). VueJS seem to "work" without any build system, which could be a gentle step out of jQuery/vanilla, but are there too many drawbacks? Feel free to leave any feedback. :)
2020 Streaming / EdgeAI Events Report
Tags: apachekafka, apacheflink, apachenifi, streaming
Published: 2020-10-22 20:36:15

August 13 - Industry Event - Including a FLaNK
August 28 - 11:30-12:20 - Apache Beam Digital Summit
https://2020.beamsummit.org/sessions/leukemia-early-detection-apache-beam/
https://2020.beamsummit.org/speakers/timothy-spann/



Lightning Talk - Using the Mm FLaNK Stack for Edge AI (Flink, NiFi, Kafka, Kudu) 0.1





September 16-17 - https://www.cloudera.com/about/events/cloudera-now-cdp.html
Sept 29 - Oct 1 - Apache Con https://apachecon.com/acna2020/

I have some talks here and I am bringing in some superstars to assist me! It's a dream team of speakers that I will be collaborate with. I will release names when we get closer. So I will be covering Apache MXNet, Apache NiFi, MiNiFi, Apache Flink, Apache Kafka, Apache Hue and Apache Kudu. I would be surprised if Apache Spark, Apache Hadoop, Apache Hive, Apache HBase, Apache Phoenix, Apache Zeppelin, Apache Livy

Incrementally Streaming RDBMS Data to Your DataLake Automagically



Apache Deep Learning 301



Using the Mm FLaNK Stack for Edge AI (Apache MXNet, Apache Flink, Apache NiFi, Apache Kafka, Apache Kudu) 0.2



Utilizing Apache NiFi and MiNiFi for EdgeAI IoT at Scale



Edge to AI: Analytics from Edge to Cloud with Efficient Movement of Machine Data



Real-Time Stock Processing With Apache NiFi, Apache Flink and Apache Kafka 






Sept 29 - Apache Streaming Meetup - https://www.meetup.com/futureofdata-princeton/events/272337950/ - Done and Recorded.



Overview: https://speakerdeck.com/tspannhw/2020-conference-talk-preview

October 9 - Ukraine DevOps Stage 2020 11am Ukraine Time - Apache NiFi Talk

https://www.datainmotion.dev/2020/05/cloudera-flow-management-101-lets-build.html

https://devopsstage.com/speakers/timothy-spann/







Oct 19 - 22. Flink Forward - Mm FLaNK Stack for Edge AI (Flink, NiFi, Kafka, Kudu)

Oct 22 - 1pm EST - https://www.flink-forward.org/global-2020/conference-program#using-the-mm-flank-stack-for-edge-ai--flink--nifi--kafka--kudu--


There's a few more coming this year, including Nethope, OSS and Big Data Conference.
Day 240: Control
Tags: hiphop, code, coding, lifelongdev
Published: 2020-10-22 21:41:59

_liner notes_:

- Professional : Ahhh after doing so well yesterday, I get stuck on something that was working last week. I was able to create a new demo for my blog post that uses one of the company's products and the Web Component I created. This will be the second framework I'm using with the same Web Component doing a different function. I want this series to showcase how a developer can use one Web Component in different frameworks instead of having to remake them each time.

- Personal : Last night, I edited the recording of the last radio show and submitted to the station. Went through some tracks and worked on my side project. Did some layout work for the chat room and called it a night.

![Aerial view of the snow capped mountain of Aconcagua, Argentina](https://dev-to-uploads.s3.amazonaws.com/i/larxnwzmlracaa2n91qs.png)

Going to spend the rest of the night finishing up the blog post. I really want to get it done. Been taking way too long. haha Hopefully this one demo will start working randomly at some point. The joys of using the latest version of frameworks you don't control haha.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube bhQzWbyw0VI %}
Hacktoberfest 2020: Looking for a small project to contribute to
Tags: hacktoberfest, opensource, 100daysofcode
Published: 2020-10-22 21:26:56

It's never too late to make your pull requests. Even though today is the 22nd day, you can still be a part of [hacktoberfest](https://hacktoberfest.digitalocean.com/) by contributing to this small Javascript projects
 
10 Days of JS: https://github.com/fobabs/10-Days-of-JS
Date Picker: https://github.com/fobabs/date-picker
Hacked!!!
Tags: hacktoberfest
Published: 2020-10-22 20:55:47

## What I Learned From Hacktoberfest

<!--I majorly submitted my developed algorithms and codes in the hacktoberfest competition. I think this was great beginner experience and this opportunity made me want to contribute to the  the opensource community. To all the beginner coders submitting the algorithms and correcting the codes can be a very good opportunity to enhance your skill ,increase your efficiency in problem solving and boost up your confidence  -->