teleren/devto huggingface dataset:
Weekly 0037
Tags: weeklyretro
Published: 2022-11-20 20:05:15

### Monday

Woke up early because I have a lot of stuff to do until the end of the morning.
After planning my entire week, I started to create (and study) the test plan for Red Origin.
We are using Azure DevOps and we will use the “Test Plans” feature included in the product and licenses that we have.

![https://learn.microsoft.com/en-us/azure/devops/test/media/create-a-test-plan/drag-drop-test.png?view=azure-devops](https://learn.microsoft.com/en-us/azure/devops/test/media/create-a-test-plan/drag-drop-test.png?view=azure-devops)

Link to the documentation: [https://learn.microsoft.com/en-us/azure/devops/test/overview?view=azure-devops](https://learn.microsoft.com/en-us/azure/devops/test/overview?view=azure-devops)

Then I had a meeting with a colleague of mine to explain our strategy for testing with our colleagues.

**Mood:** 🧑‍💻

### Tuesday

Spent the day to writing tests for Red Origin: at the end of the day we have our first 120+ tests.
We sent the email to the testers in the late afternoon but they didn’t expect too much tests to do. 🙂

Let’s see how much they test.

In the late evening I worked a little bit to my Digital Garden template for Notion. I have created a demo version with some fake contents, just to show to the customers how the template looks like with some data.

Tomorrow I will publish everything on LinkedIn.

**Mood**: 😒

### Wednesday

In the morning I worked on Second Brain template for Notion. I published a post on LinkedIn with the template and a 50% discount on the final price.
You can find the post at the following link: 
{% embed https://www.linkedin.com/posts/bartolesiemanuele_productivity-secondbrain-digitalgarden-activity-6998573396468850688-Pl7S %}

I have also sent an email to all my customers (more or less 100+) where I told to them about some updates on the template and share the news about the demo content for the Digital Garden.

For the rest of the day I have created tests on Red Origin and share the final version of the test to the testers (three people in our team).
We have created, at the end, more than 120+ tests but I think we can create other 30 to 40 tests more.

In the late evening I have worked on the first version of the Brandplane Quick Assessment based on AI.

**Mood: 🤪**

### Thursday

I spent many hours to work on the Brandplane Quick Assessment and I have released the first official version at the end of the day.

In the middle of the morning I had a meeting with a customer of SoftwareONE to make some decisions about the future of two projects. It went well.

**Mood: 🤖**

### Friday

I have added some feature to the Brandplane Quick Assessment and I sent out the current version to the rest of the company.
They are enthusiast about the results but I have a lot of stuff to include in the next version.

**Mood: 🤖**
Mastodon tips
Tags: mastodon
Published: 2022-11-20 19:45:58


With the recent changes to the bird app, Many people have been moving towards Mastodon. I had an account a long time ago but that instance closed and I had to find a new one. I didn't use it much then but now I'm figuring out the site.

Here, are a few tips I've learned from about a month on Mastodon.

**Find your twitter contacts**

There are a lot of great people in tech twitter, I hate to lose all those voices in the move.

Use [Fedifinder](https://fedifinder.glitch.me/) to find people you follow on Twitter that are on Mastodon. Fedifinder will check a user's name, pinned tweet, and description for a Mastodon Instance. 

Fedifinder looks for @user@host.tld, user@host.tld and host.tld/@user in the name, description, location, url field, and pinned Tweet. 

```
Make sure to add your mastodon address in your twitter name or description so your followers can find you.

You need your username and the instance name. @JarvisScript@mastodon.social
```

It will give a list of accounts, then you can click and follow. It's easier and quicker to follow this way that going through twitter itself and clicking on a users profile.

```
When someone follows you, you get a notification, click the follow icon to follow back.
```

**Enable advanced web interface**

If you want multiple columns similar to tweetdeck enable advance wen interface. Click the preferences icon then under appearances check Enable advanced web interface. 


![4 columns of text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/go2ac8xhwrs560vdy4q1.jpg)


**Emojis in username**

You can use emojis in your posts. Just click the in emoji icon but you can also add them to your screen name. The format is `:clippy:` 

Each instance will have its own set of emojis to see them all use.  `https://emojos.in/{yourinstance}` Tap and copy to the clipboard the post in your username. Some instances even have a :verified: emoji.

**Follow Hashtags**

You can follow hashtags. Click a hashtag and then click the follow button. If you see an interesting post follow that user. You can search for hashtags or click ones in a post.

Mastodontips is a good one to follow to help onboard you. You could also follow the account @feditips@mstdn.social. 

**More Tips**

Do you have any tips and tricks for Mastodon?
Small tools challenge
Published: 2022-11-20 19:34:25

Hey all!

As you might've figured out from my older posts, I'm working on a video conferencing platform where everyone fly around - [flat.social](https://flat.social)! It can be used as a fun alternative to [Microsoft Teams](https://flat.social/alternative/microsoft-teams) or [Gather Town](https://flat.social/alternative/gather-town)

As a side challenge, I'm going to be building some very small but useful tools that will accompany the website. The first one that I have just released is a [webcam test](https://flat.social/webcam-microphone-test). 

Coming up next are [Free Zoom Background Creator](https://flat.social/tools/free-zoom-background-creator), [Free Microsoft Teams Background Creator](https://flat.social/tools/free-microsoft-teams-background-creator), online planning poker and an [online screen recorder](https://flat.social/tools/free-online-screenrecorder). Also maybe one for [Skype](https://flat.social/tools/free-skype-background-creator).

Which one should I pick up for next week? :)
Api rate limiting with NGINX in a nutshell
Tags: webdev, nginx, api, dos
Published: 2022-11-20 19:05:41


In this article I will be talking about how we can limit our api with nginx, be it GET or POST to prevent Dos or Ddos attacks. In simple words we can limit the http requests a user can make in a certain period of time. 
To get started add this line in your configuration -
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;

Here we have used the limit_req_zone directive provided by ngx_http_limit_req_module. We will also be using limit_req directive for context.
Key- here $binary_remote_addr holds the binary address of the client's ip. 
Zone- it lets you define a space for the incoming requests. Each zone has their own memory given, in our case its 10 megabytes. 
Rate- zones are given a rate, all the requests coming to the same zone are counted with the same rate.
Here in this example we have set our rate to 10 requests per second. NGINX considers 600r/m the same as 10r/s. Here one request is made in 0.1 seconds. 

Our job is not finished yet. We have just defined a zone with some shared memory and rate. To actually limit the request, we have to apply the limit to a location or server. 

location /login/ {
    limit_req zone=mylimit;
    proxy_pass http://my_upstream;
}

Here we are limiting the location /login/, we gave the zone as “mylimit” which we defined earlier. This limits any requests to 10r/s , everything else will be rejected. 
But we can tweak our rates with optional parameters in limit_req directive. Burst and delay. 

limit_req zone=mylimit burst=20 nodelay;
Burst defines how many exceeding request you can accept over the base limit. In simple words lets say you define 10r/s but 35 requests are made. That means at first 10 requests will be processed as it is but extra 20 requests will be kept in the queue to be processed further. Hence 10+20 requests will be processed and 5 extra requests will be rejected. Extra requests will take some time to be processed. To remove that extra time we introduce nodelay which tells NGINX to process the extra request like regular requests without any delay. 

![illustration of rate limiting with rate = 5r/s , burst = 12 and delay = 8](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dvxftwl6ob6n0tll9jcf.png)


Here’s an illustration of rate limiting with rate = 5r/s , burst = 12 and delay = 8. 
At first 8 requests are proxied and  4 requests are kept in queue and extra 3 requests are rejected.
Helpers in Ruby on Rails
Tags: rails, ruby, programming, webdev
Published: 2022-11-20 18:56:48

In this post i will discuss about helpers. I will cover all questions related to helpers in rails. 

**Why we need helpers?**
A helper is a method that is (mostly) used in your Rails views to share reusable code. Rails comes with a set of built-in helper methods

**How we can write helpers?**
- Create a new file under app/helpers.
- Name it something like user_helper. rb.
- Add a new module which matches the file name

```
`# app/helpers/user_helper.rb
module UserHelper
  def format_name(user)
    if user.gender == "M"
      "Mr. #{user.name}"
    else{% embed  %}
      "Ms. #{user.name}"
    end
  end
end`
```


According to me helpers used in views. Never write your logics in views because that's like mess with views. your logics should be seprate from your views. For learn more watch this [video](https://www.youtube.com/watch?v=9x7zO5kJsJw)
How to highlight a cell or cells in Google Sheets for a value or given set of values
Tags: excel, googlesheets
Published: 2022-11-20 18:47:42

In this help article, I will be showing you how to highlight a cell in 'Google-sheets' if the number in that cell is greater than _**10**_

Cells, rows, or columns can be formatted to change text or background color if they meet certain conditions in this help article when the number is greater than ten (10).

For this example, I have created a _Google-sheets_ with a list of twenty-two items and their corresponding values, as shown in the image below :


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

---


In the values column, we have a minimum value of 1  and a maximum value of 250. Since we are interested in highlighting only the cells with values greater than 10, To do this, do the following :

### 1. Highlight all the Values Column B 

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

---

### 2. Click 'format' -> 'Conditional formatting' a toolbar will open to the right

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

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

#### _Select the following format rules in the format rules: format cells if value is "greater than" and value "10"; apply a desirable color; and click "done."_
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7dhu8f7v4esxi8nrkkfu.png)

---

### 3. The cells with values greater than '10' are automatically selected. 

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

---


### End of article

I hope the help article was helpful in providing the needed information to carry out similar tasks in your worksheets.

Kindly drop your comments and questions in the message box, and I will attend to them.
Visual Gherkin Manager - devlog#1
Tags: devlog, react, qa, automation
Published: 2022-11-20 14:47:39

In this project, the idea is to provide a tool to visually help Gherkin tests management. It will be developed a tool that allows you to model Gherkin test flows using activity diagrams and it will be able to convert this flows to tests specifications. 

For this, the first step is to think about how to convert the diagrams to test specification. At first it might be something simple, maybe using a graph representation and an algorithm to traverse the graph to find all possible graph combinations.

The second step is create an React SPA (Simple Page Application) with the basic necessary features. Some components for the first project version

1. A canvas to model the flows: This "modeler" will be implemented using the [Storm React Diagrame](https://github.com/projectstorm/react-diagrams) that allows to create beautiful and consistent diagrams. It must be possible to generate a diagram like this:

    ![Sequence diagram with an example of shopping cart flow of an eCommerce website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9tnawxc9vrjgsvp23zr8.png)

1. A text output: I am looking for some already existent solution, one that I really liked was [React Gherkin Editor](https://github.com/SmartBear/react-gherkin-editor) that supports Gherkin style. The ext output must be something like this:

    
![Sequence diagram converted to gherkin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/709hcdsfdvaodlddi8x8.png)



I will work in this project and for the next post, I hope to have at least some results to show.
Redis Autoincrement: The Missing Piece in the Puzzle of In-Memory Databases
Tags: redis, redisautoincrement, autoincrement, redisdb
Published: 2022-11-20 18:39:12

Redis, with its blazing speed and versatility, is like the superhero of the database world. It can juggle data like nobody's business and fetch records at the blink of an eye. However, there's one feature that's notably absent from Redis: autoincrement. In this article, we'll explore why this feature isn't part of Redis, when it's needed, and how to implement it.

## Redis: The Speedster of Databases

Before we dive into the world of autoincrement, let's talk about Redis. It's an in-memory database, which means it stores data in your computer's memory (RAM) rather than on disk. This makes it incredibly fast. It's the Usain Bolt of databases, built for lightning-quick data retrieval and storage.

## The Missing Autoincrement

So, what's this autoincrement thing we're talking about? Autoincrement is a feature in databases that allows you to automatically generate unique numeric IDs for your data entries. Think of it as a ticketing system at a deli counter – each customer gets a unique number, and there's no confusion.

In Redis, this feature doesn't exist natively. But why? The answer lies in Redis's design philosophy. Redis is simple, and it values speed above all else. To maintain this blazing speed, Redis avoids complex features that could potentially slow it down.

## When Do You Need Autoincrement?

Autoincrement is handy in scenarios where you need unique IDs for your data, such as:

**User IDs:** In a web application, you want to assign a unique user ID to each new user.

**Order Numbers:** In an e-commerce platform, you might want a unique order number for each purchase.

**Message IDs:** In a chat application, messages could have unique IDs for easy retrieval.

## Implementing Autoincrement in Redis

Now, the fun part – how do you implement autoincrement in Redis if it doesn't come out of the box?

One common approach is to use Redis's built-in atomic operations. You can create a key that acts as a counter and increment it each time you need a new ID. Here's a simple example in Python:


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



This code snippet uses the INCR command to atomically increment a key in Redis, ensuring that each ID generated is unique. You can use this approach to generate autoincremented IDs for various purposes.

## Conclusion

While Redis may not come with autoincrement built-in, its simplicity and speed more than compensate for this missing feature. By using Redis's atomic operations, you can easily implement autoincrement where needed in your applications. Redis remains a powerful and efficient tool in the world of databases, even without this one feature. So, go ahead and embrace the simplicity and speed of Redis for your data storage needs!
The dark truth behind Cryptocurrencies
Tags: crypto, blockchain, bitcoin, ethereum
Published: 2022-11-20 18:05:52

**The environmental impact of blockchains** and cryptocurrencies cannot be overlooked. In particular Proof-of-Work systems such as Bitcoin have a huge (understated) energy footprint. In conventional cryptocurrency systems, tokens are awarded to “miners” for successfully mining blocks on the blockchain. The core problem is that mining consumes incomprehensible amounts of electrical energy.


![Source: https://www.bbc.com/news/science-environment-56215787](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7b4gdf25ip6lgv93pb6g.png)

**How bad is it?**
According to several studies ([link](https://www.statista.com/statistics/881541/bitcoin-energy-consumption-transaction-comparison-visa/)), a single Bitcoin transaction requires 2,180kWh, with this amount of energy you can execute over 1.4 million Visa transactions, or fully charge 29 Tesla cars (Model 3, 75kWh). Another research reveals Bitcoin system alone consumes half of the energy of the banking industry ([source](https://www.nasdaq.com/articles/research%3A-bitcoin-consumes-less-than-half-the-energy-of-the-banking-or-gold-industries)). Pretty bad is an understatement...

If you ask any expert, Bitcoins are a **dramatic waste of natural resources**. Even if Bitcoin is fully run on renewable energy, its benefits will never outweigh the energy consumption (mind the natural resources, maintenance & production, material waste from solar panels, wind turbines, etc). You may also have seen articles trying to debunk Bitcoin fuds, but if you conduct some research, many of those authors are merely crypto influencers, acting as Hollywood scientists ([examples](https://endthefud.org/)).

## How can we solve this?
I’m building the Carbon3 cryptocurrency that does not use a blockchain (requires no mining). It has better security and privacy wallet aspects than existing cryptocurrencies, stimulates good capitalistic behavior and enforces eco-friendly consumerism.

**About me**
I work in the web3.0 industry with a particular stake in the decentralized-identity space. Whether we like it or not, blockchain technologies (in particular PoW ~ Bitcoin) are wasting precious energy resources from our planet 🌎, but fail to universally solve the centralized monetary issues 💰. The big institutions still dominate the financial sector, and are dominating the crypto industry as well. And with enforced Travel Rule worldwide, crypto loses its face as an anonymous system. 

Get in touch to learn more https://www.linkedin.com/in/iljanevolin/
Python script to automate the installation of several cms in Devilbox
Tags: webdev, docker, devilbox
Published: 2022-11-20 17:47:54

I won't explain in detail as the repo is simple to use but I will just write the structure of the repo, and you are welcome to try and give your suggestions or contributions.


**Installation script**
 -
 **Installation steps**
 
 * clone this repository: https://github.com/bashebr/cms-installation-script.git
 * create virtualenv: virtualenv venv --python=3.6( or any python3 version)
 * Follow the instruction to install python3 in devilbox written in the wiki
 * Your devilbox directory name should be `devilbox`
 
The instruction script has the following directories

* Applicaitons 
* Config
* Core

Finally, the script that runs the application
* install_script.py

**Applications**
--
This directory consists of all applications that need to be installed, such as

* Drupal
* Magento
* plugins
* Prestashop
* WordPress

Each of the above directories contains a python script that installs the application.

**Config**
--
The config directory consists of the following config files

* general_config.py

   * Method: `grep_container` returns both `mysql_container` && `php_container`
   
* versions.py

   * This file contains versions that need to be installed
   * Here in this file you can see, the version you want to install 
   * Only set the version of the Application you want to install
   
**Core**
  --
  
  The core directory has the following files
  
  * `db.py`: This file creates the database

***Some Extra config***
--
Some installations may complain about the PHP memory unit limit, so we should set to all containers default as unlimited by the following.
* Goto devilbox/cfg/php-ini-phpversion(eg 4.5)
* then create a new file, that with `ini` extension, as `devilbox-php.ini`, then paste the following code
* Then you need to restart your container once
* code is

--
```
; Memory
; Note: "memory_limit" should be larger than "post_max_size"
memory_limit			= -1
```

***Changes to script on how to install python3 in devilbox***

Copy and paste( actually replace it with) the following script to the former script in devilbox, //python3.sh//

<code>
#!/usr/bin/env bash

root="/shared/httpd"

cd ${root}

apt-get update
apt-get install -y python3
apt-get install -y python3-pip
apt-get install python3-distutils

PYTHON3="/usr/bin/python3"
PIP3="/usr/bin/pip3"
if [ ! -L ${PYTHON3} ] && [ ! -L ${PIP3}]; then
  ln -s /usr/bin/python3 ${PYTHON3}
  ln -s /usr/bin/pip3 ${PIP3}
fi
</code>

***NOTE REGARDING Magento 2.4.2 FATAL ERROR***

During Magento 2.4.2 installation the following fatal error occurred. According to the GitHub link

https://github.com/jbboehr/php-psr/issues/78#issuecomment-722290110

Then, I create the following workaround:

In your .env file inside the devilbox, search for `PHP_MODULES_DISABLE` and add `psr` to the list and save and restart docker.
so, finally, it will be:

**Note**
The `phalcon` module is also added because it depends on `psr`

PHP_MODULES_DISABLE=oci8,PDO_OCI,pdo_sqlsrv,sqlsrv,rdkafka,swoole,psr,phalcon