teleren/devto huggingface dataset:
Wednesday JavaScript Challenge
Published: 2021-09-23 15:02:52

*(check out [my blog](https://raffaelepizzari.com/))*

Hello everyone,

I'm happy to announce that we are going to start the second round of the **Wednesday JavaScript Challenge**.

Every Wednesday from 29.September to 27.October we are going to work on a different JS exercise. 

This time we introduce the "**challenge buddy**" initiative: if you'd like to work on the challenge with one or more buddy, or if you just need to share the journey with somebody to get and give motivation, feel free to drop your name here or in our [Slack channel](https://join.slack.com/t/codejourneys/shared_invite/zt-vwmaz79s-nfXtsjjcxW9D8plZerloFg).

Everyone is welcome to share their solution on [GitHub](https://github.com/codejourneys-org/wednesday-javascript-challenge) (adding the solution to any “challenge”), on [JsBin](https://jsbin.com/?html,output) or just in our [Slack channel](https://join.slack.com/t/codejourneys/shared_invite/zt-vwmaz79s-nfXtsjjcxW9D8plZerloFg).

Once a week we [meet each other on Slack and Zoom](https://join.slack.com/t/codejourneys/shared_invite/zt-kreea6v7-s~xMerv7Ek2kHPCDcOAx3Q) and talk about the solutions together.

**No matter how much experience you have, everyone is very welcome.**

Have a nice day! :sunny:
How To Install Open edX with One-Click on DigitalOcean
Tags: django, python, devops, cloud
Published: 2021-09-23 14:53:50

If you want to install it right away please visit https://marketplace.digitalocean.com/apps/cubite

{% youtube 5TCeokDaipo %}

## What id Digitalocean 1-click

DigitalOcean has a Marketplace where there are applications that we can deploy with 1-click.

![tj4veafcve01vq1ipwdy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ghkln3en8b5dn589b5r.png)

There are popular tools we can install quickly like WordPress, Ghost CMS, Strapi, Node, and more.

## Using the Cubite Flavor of Open edX DigitalOcean 1-Click 

Visit https://marketplace.digitalocean.com/apps/cubite and Click on Create Cubite Droplet

![Screen Shot 2021-09-23 at 09.28.13](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/54xy34gt4imv6sbj8b9k.png)

You can also search for `cubite` or `openedx` in the search box to find it.

![Screen Shot 2021-09-23 at 09.28.57](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hf1u3j9gp7t2dz6cshtw.png)

## Setup your Server
- Keep the $48 server, that's the minimum requirement for an Open edX instance
![Screen Shot 2021-09-23 at 09.29.30](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/opbuq1lkv3ja2998jzkp.png)
- Pick the region you want to host your server in
![Screen Shot 2021-09-23 at 09.30.26](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5x94s2hj7xjic9nsmpd5.png)
-  Choose existing SSH key or create New one to be able to access your server via SSH. It's important to set SSH for future server configuration and maintenance
![Screen Shot 2021-09-23 at 09.31.02](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qft5rggnk9izp7mutun4.png)
- Pick a name for your server
![Screen Shot 2021-09-23 at 09.31.54](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i4zkc0hz7szxtvohg0m9.png)
- Click on Create Droplet and wait for a couple of minutes
![Screen Shot 2021-09-23 at 09.51.38](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mrm7icxvfqqthoj56yxg.png)
- Your Open edX instance should be ready and LMS should be accessible by your server IP address and Studio via IP:18010
- To set Custom Domain, SSL certificates and create Superuser follow our doc here https://marketplace.digitalocean.com/apps/cubite  
- If you need any help contact us at hello@cubite.io
OpenNMS joins Hacktoberfest 2021
Tags: blog, event, contributing, hackathon
Published: 2021-09-28 13:47:34

---
title: OpenNMS joins Hacktoberfest 2021
published: true
cover_image: https://pbs.twimg.com/media/E__iwhzVIA8rZJc?format=jpg&name=medium
date: 2021-09-23 14:30:27 UTC
tags: Blog,Event,contributing,hackathon
canonical_url: https://www.opennms.com/en/blog/2021-09-23-opennms-joins-hacktoberfest-2021/?utm_source=rss&utm_medium=rss&utm_campaign=opennms-joins-hacktoberfest-2021
---

 ![hacktoberfest 2021 logo](https://www.opennms.com/wp-content/uploads/2021/09/logo-hacktoberfest-2021-300x116.png "logo-hacktoberfest-2021")

There will be just one Hacktoberfest 2021 and it is coming soon!

The OpenNMS community will participate and we are looking for contributors who want to join us in October.

[Hacktoberfest](https://hacktoberfest.digitalocean.com/) is an annual, month-long celebration of open source software driven by [Digital Ocean](https://www.digitalocean.com/). During this event everyone can support open source by contributing changes, and earn some limited-edition swag.

We would like to invite you to participate and contribute to the OpenNMS project. There are many ways to contribute: you can work on code or documentation. Generally speaking, any pull request in our GitHub repositories qualifies.

## Where to contribute

Our software is developed under AGPLv3 on [GitHub](https://github.com/OpenNMS). You are welcome to contribute to any repository in this organization. The procedure on how we manage and track issues and deal with pull requests is described in our [how to contribute](https://opennms.discourse.group/t/how-to-contribute/1768) guide in our [Discourse forum](https://opennms.discourse.group). You will also find information on [how to connect with](https://opennms.discourse.group/t/where-can-i-talk-with-people-and-find-help/1769) people in our community for further questions and help.

You can freely create an account in our [JIRA](https://issues.opennms.org/secure/Signup!default.jspa). We have collected some issues that are reasonable candidates to claim for the event. The filter is called [Hacktoberfest - Quickwin](https://issues.opennms.org/issues/?filter=18808). Claim a ticket by assigning it to your user name and click the "Start Progress" button.

If you have any further questions, please don't hesitate to ping us on [Mattermost](https://chat.opennms.com/opennms/channels/opennms-discussion).

Hack the planet!
Basic Redis Commands
Tags: database, devops, redis, node
Published: 2021-09-23 14:26:00

starting the server:-
    *redis-server
running the client:-
    *redis-cli

Command:-

```
    > exists key                                                     //Test if specified key exists.
    > del key1 key2 ... keyN                                         //Remove the specified keys.
    > ttl key                                                        //Returns remaining time to live, in seconds, for a key with EXPIRE set.
    > set key value                                                  //Sets the value of key to the string value.
    > get key                                                        //Gets the value of key
    > rpush key string or
    > lpush key string                                               //Adds the string to the head (rpush) or tail (lpush) of the list at key. 
    > llen key                                                       //Returns the length of the list at key.
    >lrange key start end                                            //Returns the elements of list at key, zero-based. Negative numbers are offset from the end of the list.
    >lset key index value                                            //Sets the element of list key at index to the specified value.
    >lrem key count value                                            //Removes count number of items from the list that have the specified value.
    >lpop key string or
    >rpop key string                                                 //Atomically removes and returns the first (lpop) or last (rpop) element from list key.
    >sadd key member                                                 //Adds member to the set stored at key.
    >srem key member                                                 //Removes member from set key.
    >spop key or
    >srandmember key                                                 //Returns random element from set key. spop will remove the element.Return element, or nil object if key is empty or doesn't exist
    >smembers key                                                    //Returns all of the members of set key.
    >HSET KEY field value                                            //Set field and value in HASHMAP
    >HGET key field                                                  //GET Key value from HASHMAP
    >HDEL key field                                                  //Delete a pair from HASHMAP
    >HEXISTS KEY FIELD                                               //Check if field exits in HASHMAP

Channel Command:
    >SUBSCRIBE Channel_Name                                          //Starts getting broadcast from a Channel
    >UNSUBSCRIBE Channel_Name                                        //Unsubscribe channel
    >PUBLISH Channel_Name Message                                    //Sends BroadCast Message to all SUBSCRIBERS
    >PSUBSCRIBE D*                                                   //Subscribes all channel starting from Delete
    >PUNSUBSCRIBE D*                                                 //Unsubscribe all channels starting from D

```
Showcase Wakatime Statistics on Github Profile
Tags: github, showdev, webdev
Published: 2021-09-23 14:19:24

If you’ve ever checked users' profiles on GitHub you may have noticed some user profiles have been personalized with images, trophies, skill badges, activity trackers, etc. This feature was introduced by GitHub sometime in July 2020, allowing users to showcase skills and badges on their profile.

If you are yet to personalize your profile on Github, you can follow the instructions [in this post](https://medium.com/nerd-for-tech/stand-out-by-personalizing-your-github-profile-f0a5d73f2b4d)

Today, I want to share how I integrated my Wakatime dashboard stats on my Github profile. 
First, Wakatime is an IDE plugin that helps you keep track of the amount of time you've spent coding, the projects you've worked on, the languages you've recently used, etc.

It is a very useful tool and helps programmers keep track of how much time you've spent working.


To do this, you must first have an account on Wakatime, if you're yet to do that, you can easily create an account [here](https://wakatime.com/signup). 

Follow the instructions [here](https://wakatime.com/plugins) to integrate wakatime on your IDE, they support almost every IDE you can think of, just in case you don't find your IDE, you can reach out to them also.

Now, to the main reason why we are here...
After creating your account and integrating with your IDE, you can easily share your dashboard statistics on your Github profile. 

Go to your [wakatime dashboard](https://wakatime.com/dashboard) and click on the share option as shown below:
![Wakatime dashboard showing share option](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rjxlhpwi9c99fypcy2hz.PNG) 

From the options available, click on [Embeddable charts](https://wakatime.com/share/embed) 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xoi0sw4csp36rbo2h0nj.PNG) 
You'll be presented with options to customize just as shown below, 
customize as you wish

![Wakatime embed chart options](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lhqnxpmc4nkxa66xiweb.PNG)

Once you're done with that, click on embed code and you're almost good to go,

Copy the code shown and then paste into your Github readme file.

You can check out how I did it in my [Github profile](https://github.com/Osalumense) dont forget to give me a star if you like it.

Thanks for reading.
How to search google lik a pro
Tags: tips, seo, googlesearch, productivity
Published: 2021-09-23 14:13:01

## Search Exact words 
Usage: "yourword"
Example: "How to learn JavaScript"

## Search free ebooks
Usage: yourword filetype: pdf
Example: Think And Grow Rich filetype: pdf

## Search in one website
Usage : site:URL yourword
Example: site:http://facebook.com "Scope in Javascript"

## Search some missing words
Usage: *
Example: think and * rich

##  Search specific year 
Usage : yourwords in year, your words between2020..2021
Example: coup in 2021 or Bitcoin price between 2000..2021

## Search the latest update of the website
Usage : cache: http://Facebook.com

##  Find login page on the website
Usage : site: URL link:"login"
Example : site: http://facebook.com link:"login"

##  Find similar images reverse search
Usage: goto http://image.google.com upload your image search

I hope this will be helpful to you. Happy Coding .

PS:This is my first article.I am waiting to hear your feedback.
C# CreateDefaultBuilder
Tags: csharp
Published: 2021-09-23 14:03:52

`Host.CreateDefaultBuilder(args)`

The host is responsible for app startup and lifetime management. At a minimum, the host configures a server and a request processing pipeline. The host can also set up logging, dependency injection, and configuration.

`CreateDefaultBuilder` a generic Host builder in .NET and ASP.NET Core plays an important role in initializing the Host and its configuration like getting access to applications host details including app configuration, logger configuration, user secretes, getting access to environmental configuration etc.

	
`var builder = Host.CreateDefaultBuilder().Build();`

Let see in detail how `CreateDefaultBuilder` helps us managing all the above details.

## Access to Application Configuration in ASP.NET and NET Core

Please note that when you define your host with `CreateDefaultBuilder` it loads Application Configuration in ASP.NET Core `appsettings.json` in ASP.NET Core.

If you are using a non-prod environment like DEV or TEST then such environment-specific configuration details will also be available from `appsettings.[EnvironmentName].json`


## Turning Our App Into A Windows Service

`Microsoft.Extensions.Hosting.WindowsServices`

`.CreateDefaultBuilder(args).UseWindowsService()`

Running our application normally is just the same and everything functions as it was. The big difference is that we can now install everything as a service.

To do that, first we need to publish our application. In the project directory we run :

`dotnet publish -r win-x64 -c Release`

Note in my case, I’m publishing for Windows X64 which generally is going to be the case when deploying a Windows service.

The below three methods define the lifetime of the services,

The lifetime of the service depends on when the dependency is instantiated and how long it lives. And lifetime depends on how we have registered those services.

### AddTransient
Transient lifetime services are created each time they are requested. This lifetime works best for lightweight, stateless services.

### AddScoped
Scoped lifetime services are created once per request.

### AddSingleton
Singleton lifetime services are created the first time they are requested (or when ConfigureServices is run if you specify an instance there) and then every subsequent request will use the same instance.
Move fast move to Playwright 
Tags: testing, react, cicd, automation
Published: 2021-09-23 14:02:26

After working in several big compony that include testing and automation I discover Playwright.
I think that Playwright is very simple and fast tool for development.
You can create a Nodejs script for making automation of flow in your system or web scraping.
You also can use Playwright as E2E, an integration testing platform.
Playwright has its own test runner - @playwright/test that you can install as simple as NPM package.

##Playwright test runner allows to:

* Run tests across all browsers.
* Execute tests in parallel.
* Enjoy context isolation out of the box.
* Capture videos, screenshots, and other artifacts on failure.
* Integrate your POMs as extensible fixtures.
* automate scenarios that require authentication (I think this feature is very useful).
* Visual compare screenshots. 
* Customize reports.
* Easy to debug.

Enjoy 😊
showdev: Serverless IoT Dashboard
Tags: webdev, javascript, showdev, serverless
Published: 2021-09-23 13:48:30

I want to showdev how I built a serverless IoT (internet-of-things) dashboard for a Tasmota / BME680 air quality sensor.

Preview of the real-time dashboard:
![Dashboard Graph and data table](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4atqvnm6ube7qgp54uu.png)

Live Demo / Repository:
{% github barakplasma/Browser-MQTT-Dashboard/ %}

The hardware:
Prototype:
![ESP8266 + BME680 on a breadboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/304qk1rx75021ny63rka.jpg)
![ESP8266 + BME680 air quality sensor soldered together in a cardboard case](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r2ag778tfm6kd5hrv9u0.jpg)
(I made the case out of corrugated cardboard I had lying around, and sealed it up with a few more sheets of cardboard glued together. I did leave vents so that it can detect the actual air too)

The [architecture](https://mermaid-js.github.io/mermaid-live-editor/edit/?gist=https://gist.github.com/barakplasma/2a7e257740750a658699da0effe44c9f):
![UML diagram of architecture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/29r17g64ojgnrcigp1uq.png)

The data is collected using [Tasmota](https://tasmota.github.io/docs/) on an ESP8266. I soldered a [BME680](https://www.bosch-sensortec.com/products/environmental-sensors/gas-sensors/bme680/) directly to the ESP8266 pins and mapped the pins accordingly using the web config. I configured Tasmota  to send the data to a free public MQTT broker provided by [emqx](https://www.emqx.com/en/mqtt/public-mqtt5-broker). It would be ok to self host broker, but that wouldn't be as serverless. The Tasmota/ESP8266 is connected to my home wifi, and since it's only sending messages out, no special NAT changes or Port Forwarding was required.

The serverless static site architecture is based on MQTT.js reading from an MQTT broker, and displaying the data using Chart.js with chartjs-plugin-streaming for real-time chart updates.
I decided to use vanilla javascript DOM updates to keep it simple. The static site stores the messages within the browser for historical purposes, and to enable the first load to happen with live data. Static site hosting and CI/CD is done through Github (Pages and Actions).

{% github mqttjs/MQTT.js %}
{% github chartjs/Chart.js %}
{% github nagix/chartjs-plugin-streaming %}
Top six dev tools to start with React
Tags: react, tutorial, javascript, webdev
Published: 2021-09-23 13:47:21

Most web applications today are built using React.js, a JavaScript library. Approximately 8 thousand industries globally use React.js for app and web development. Even the popular Fortune 500 companies that we all are acquainted with use React.js.The list includes popular tech houses like Facebook, Instagram, WhatsApp, Netflix, etc. A number of Javascripts version are available in the market that has dominated the global web development scenario including Angular and Vue.js. To those just starting out with dev tools, it is important to understand the building blocks of React.js presented in this post.

<h2>What is React?</h2>
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h8mfayzal4o9py4b4rb9.jpg)
Developed by Facebook, React.js is an open source JavaScript library to build a single-page application. This layer handles apps both on the web and mobile devices. You can even create UI components using React. If Facebook can launch its news feed, and Instagram its website with an open source tool then think of its brilliancy as a JS library. Moreover, React allows developers to easily update large web applications without reloading the page. If I have to use three words to define React, I shall use; Simple, scalable, and fast. It only works on user interfaces within applications. According to the MVC template, this would correspond to the view. The library and framework can be used in combination, for example, with Angular JS in an MVC application.

<h2>What is JavaScript Library?</h2>

A JavaScript library contains prewritten JavaScript code so that JavaScript-based applications, particularly those using AJAX or other web technologies, can be developed easily and be used and reused to perform standard JavaScript functions. You can plug JavaScript library code into the rest of your project as needed. Consequently, the development will be faster, and errors were less likely to occur.
<h2>What Makes ReactJS a Go-To Tool for Web Developers?</h2>
There are a lot of open source platforms for making front-end web application development more accessible. Even Angular is contributing its bit. While with technology upgrades, it is difficult to keep a track of different web development frameworks, especially when that framework may not hold up in the long run, ReactJS has proved to be a versatile option. Take a closer look at some of React's most important features that makes it scalable and developers' personal favourite.

<a href="https://aviyel.com/post/873/top-six-dev-tools-to-start-with-react">More reading</a>
 

‌


‌
[DopeTales] HackScripts Memory Allocation Testing
Tags: malloc, cpp, hackscripts
Published: 2021-09-23 13:42:06

---
title: [DopeTales] HackScripts Memory Allocation Testing
published: true
description: Check System Limitation manually 
tags: malloc,cpp,HackScripts 
//cover_image: https://direct_url_to_image.jpg
---
Very often we want to test maximum memory that can be allocated at user space. It has interesting use cases. Mine relates to 4gb memory shadow creation. Basically I implemented sample DDR of size 4gb and took snapshot of simulated memory at intervals. so i need to know before hand if i have that much memory available before running actual application. Following script allows me to do that in simple loops.

```C
#include <stdio.h>
#include <stdlib.h>

#define MINREQ      0xFFF   // arbitrary minimum
int main(void)
{
    unsigned int required = (unsigned int)-1; // adapt to native uint
    void *mem = NULL; 
    while (mem == NULL) {
        printf ("Required %X\n", required);
        mem = malloc (required);
        if ((required >>= 1) < MINREQ) {
            if (mem) free (mem);
            printf ("Cannot allocate enough memory\n");
            return (1);
        }
    }

    free (mem);
    void * array[4096];
    unsigned int count  =0;
    for( ;count < 4096; count++) {
    mem = malloc (required);
    if (mem == NULL) {
        printf ("Cannot enough allocate memory  %d \n",count);
        break;
    }
       array[count] = mem;
    }

    printf ("Memory size allocated = %X\n", required );
    for(int  i = 0  ; i <count ; i++)
    free (array[i]);
    return 0;
}
```
It tries to allocate minimum size then goes on continuously till largest possible at current moment.

Happy Hacking!