teleren/devto huggingface dataset:
Apache Airflow in Centos 7
Tags: airflow, opensource
Published: 2022-02-08 07:03:43

Apache Airflow is an open-source workflow management platform. It started at Airbnb in October 2014 as a solution to manage the company's increasingly complex workflows. Creating Airflow allowed Airbnb to programmatically author and schedule their workflows and monitor them via the built-in Airflow user interface. 

This document assumes you have a centos 7 VM with internet connectivity and a Sudo user.

* Login as sudo
```
sudo --login 
```

* Update Packages
```
yum update -y 
```

* Install Epel release and yum-utils packages
```
yum -y install epel-release yum-utils
```

* Install Development tools
```
yum groupinstall "Development tools" -y
```

* Install required npm packages
```
yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel python-devel wget cyrus-sasl-devel.x86_64
```

* Install python and python developer tools Packages
```
yum install -y python3 python3-devel 
```
#### Disable SeLinux
```
setenforce 0
```
Make the change permanent by editing
``` 
vi /etc/selinux/config 
```
change value
``` 
SELINUX=enforcing to SELINUX=disabled
 ```

### Install Postgres Database

* Add Postgres repository to centos
```
yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
```

* View info your Postgres repo by running
```
rpm -qi pgdg-redhat-repo
```

* Enable and Install Postgresql
```
yum-config-manager --enable pgdg12

yum install -y postgresql12-server postgresql12 postgresql-devel
```

* Initialize Database
```
/usr/pgsql-12/bin/postgresql-12-setup initdb
```

* Enable and Start Postgresql Service
```
systemctl enable --now postgresql-12
```
Confirm Database is started by Running
```
systemctl status postgresql-12
```

#### Configure a String Administrator Password for Postgres

* Login to Postgresql
``` 
su - postgres 
```
* Open psql shell
``` psql ```

* Run the alter user query
```
alter user postgres with password 'StrongPassword';
```

* Edit the Postgres Service to enable MD5 authentication

` vi /var/lib/pgsql/12/data/pg_hba.conf `

```
# Accept from anywhere
host all all 0.0.0.0/0 md5

# Accept from trusted subnet
host all all 192.168.18.0/24 md5
```
Choose according to your requirement.

#### Optional Step 
* Enable remote Postgres access ( Not recommended for Production systems

`vi /var/lib/pgsql/12/data/postgresql.conf`
Edit the above file Find the entry named `listen_address`
uncomment the entry and modify it as below.
```
listen_addresses = '192.168.10.10'
```
or ( Not recommended in Production )
``` 
listen_addresses = '*' 
```

*Restart Postgres Service after you are done. 
```
systemctl restart postgresql-12
```
(Premium)OAuth 2.0 (Google) using NodeJS, MySQL, JWT + ReactJS
Tags: oauth2, node, mysql, jwt
Published: 2022-02-08 07:02:55

## Why this blog?
As **OAuth2.0 Authentication** functionality is fundamentally complicated to implement using tech stack such as **ReactJS**, **NodeJS**, **MySQL** & **JWT**. 

I wanted to specifically add Google's oAuth2.0 functionality in one of my Products but this was the thing which I was going to do for the very first time so I was a bit confused about how to recognize or to know whether the user is login or not and many of the developers are comfortable with JWT rather than any other library and the main thing is how to store data in Database and what kind of data to store in a database especially in MySQL.

I haven't found any Repository or Blogs or any YouTube video which will explain oAuth2.0 easily including adding **Tokens in user's cookies** and **Storing Data in MySQL**, So I thought this Repository will help you not to get confused with Google's oAuth2.0

I'm not writing a complete article here, but I have a codebase and I have uploaded it on GitHub also I have added comments so that it will be easy to understand.

GitHub Link - [OAuth2.0](https://github.com/rahulnikam2002/Google-oAuth2.0-ReactJS-NodeJs-Mysql) 
And don't forget to star this Repository👀
Server Ubuntu настройка сервера
Tags: ubuntu, linux
Published: 2022-02-08 06:45:58

### Шаг 1 — Вход с привилегиями root
`ssh root@your_server_ip`

### Шаг 2 — Создание нового пользователя

`# adduser user`
### Шаг 3 — Предоставление административных прав

`# usermod -aG sudo user`

продолжение следует по мере понимания :)
Hello World - MR Tutorials for Nreal light
Tags: nreal, mixedreality, unity3d, tutorial
Published: 2022-02-08 06:40:10


![Image of the completed version](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o68vacl4p4mr9rx3izq0.png)

## Sample Repository

- [mr\-tutorials\-for\-nreal\-light/HelloWorld at main · karad/mr\-tutorials\-for\-nreal\-light](https://github.com/karad/mr-tutorials-for-nreal-light/tree/main/HelloWorld)

## Run the sample

1. Clone Sample Repository, Change current directory to `HelloWorld`. And Open with Unity.
2. (If you don't have NRSDK) Download NRSDK 1.7.0 from [https://nreal-public.nreal.ai/download/NRSDKForUnityAndroid_1.7.0.unitypackage](https://nreal-public.nreal.ai/download/NRSDKForUnityAndroid_1.7.0.unitypackage)
3. Open `Build Setting`, change Platform to `Android`
4. Open `Project`, select `Assets` > `import package` > `Custom Package` and import `NRSDKForUnityAndroid_1.7.0.unitypackage`.
5. Check `Build Settings` > `Player Settings` by referring to [Configure Build Settings](https://nreal.gitbook.io/nrsdk-documentation/discover/quickstart-for-android#configure-build-settings)
6. Press `Build` form `Build Settings` panel
7. Install *.apk on Android or DevKit.

## Tutorial

### 1. Setting up the project for Nreal development

1. See [Quickstart for Android - NRSDK Documentation](https://nreal.gitbook.io/nrsdk-documentation/discover/quickstart-for-android#configure-build-settings) and configure the build settings.
2. (If you don't have NRSDK) Download NRSDK 1.7.0 from [https://nreal-public.nreal.ai/download/NRSDKForUnityAndroid_1.7.0.unitypackage](https://nreal-public.nreal.ai/download/NRSDKForUnityAndroid_1.7.0.unitypackage)
3. Open `Project`, select `Assets` > `import package` > `Custom Package` and import `NRSDKForUnityAndroid_1.7.0.unitypackage`.

### 2. Put a Canvas in the scene

1. Put `Canvas` from `Create` > `UI`
2. Set property on `Inspector` panel
    1. `Render Mode` : World Space
    2. `Pos X` : 0 , `Pos Y` : -0.35 `Pos Z` : 3
    3. `Scale`
        1. `X` : 0.005 , `Y` : 0.005 , `Z` : 0.005

# 3. Put Text in Canvas

1. Put `Text` as a child of `Canvas`
    1. `Pos X` : 0, `Pos Y` : 50, `Pos Z` : 3
2. Change Text to "Hello World!" on Inspector panel.
3. Change color of Text to `#fff`.

# 4. Build

1. Press `Build` form `Build Settings` panel
2. Install *.apk on Android or DevKit.
Hexadecimal to decimal converter in JS
Tags: hex, javascript
Published: 2022-02-08 06:28:28

It's been one year since I am working on an IOT app and finally the project is going to finish. But still, this project is giving me headaches in different ways.

Just recently, my client wanted me to develop a hexadecimal to decimal converter. I was really bad at these conversions during my school. I used to use the online tools for such conversions and now I had to develop such hexadecimal to decimal [tool](https://www.aaryatables.com/numbers/hexadecimal-to-decimal). So, I did research and study for a day and then started developing it.

I thought it would be great if I share the Javascript code here to develop a hex to the decimal tool then it would be beneficial for those working on such converters.

```javascript
  function hexadecimaltodecimal() {
      var input_number = document.getElementById("input_value").value;
      var initialconversion = new BigNumber(input_number , 16);
      var finalanswer = initialconversion.toString(10);
      document.getElementById("ans").innerHTML = finalanswer;
     }
```
In this article, we have used the bignumber.js javascript library that deals with big numbers. If you don't use the library, you might not get the correct answer for large numbers. Copy the following code and paste it into the head tag for bignumber.js.

```javascript
<script src="https://cdnjs.cloudflare.com/ajax/libs/bignumber.js/8.0.2/bignumber.min.js" integrity="sha512-7UzDjRNKHpQnkh1Wf1l6i/OPINS9P2DDzTwQNX79JxfbInCXGpgI1RPb3ZD+uTP3O5X7Ke4e0+cxt2TxV7n0qQ==" crossorigin="anonymous"></script>
```
Make your form to work perfectly with Telegram
Tags: javascript, webdev, beginners, telegram
Published: 2022-02-08 06:22:54

Make unworking contact or feedback forms to work. Here is a simple script that makes your form work. All the form data in your form are sent to you as a Telegram Message.

Here is the Quick Demo

{% codepen https://codepen.io/yogeshwaran01/pen/PoOWaoe %}

Refer GitHub for more details

{% github yogeshwaran01/formBot.js %}
12 commonly used Javascript Array methods that you should know
Tags: codingtutorials, coding, javascript
Published: 2022-02-08 11:40:23

---
title: 12 commonly used Javascript Array methods that you should know
published: true
date: 2022-02-08 06:21:09 UTC
tags: CodingTutorials,coding,Javascript
canonical_url: https://codingislove.com/common-js-array-methods/
---

{% youtube kzhROoVabsQ %}

The post [12 commonly used Javascript Array methods that you should know](https://codingislove.com/common-js-array-methods/) appeared first on [Coding is Love](https://codingislove.com).
[Idea Discussion] Development Environments as a service
Tags: devops, docker, discuss, productivity
Published: 2022-02-08 06:18:08

[Problem Statement] Spinning off a developer environment for a feature testing is a pain. Developers either have to wait for a devops to give an environment or wait for any of the existing environments to be free to test their feature. This severely affects developer productivity.  

[Solution] On demand developer environments as a service with a single click. Wouldn't it be life-saving if one could get environments and required services (databases, memory storage, third party services like sendgrid, etc.) with a single click?

Let me tell you a bit more:
All of these environments are
1. fully isolated
2. secure & private
3. accessible
4. robust
5. scalable
6. ephemeral or permanent (whichever way you like)

& there's a super simple way to spin off  environments (dev, prod, permanent, ephemeral) directly from:
1. Web
2. IDE
3. CLI

Furthermore, you can connect microservices with each other & test the entire stack end-to-end.

Easier said than done, right? Well, we've taken the first baby step towards it & have an MVP that lets you spin off developer environments from your IDE & CLI (web version on it's way).
We are looking for some early customers to give us feedback on our current product and get a sneak peek of our web product.   If you'd like to get access, please fill out this form - https://forms.gle/8BjfXT1kAhFHNBwj7
Timezone for developers
Tags: programming, productivity, opensource, database
Published: 2022-02-08 05:47:00

When it comes to date and time, developers prefer a value of more than just hours and minutes. It should be a precise value that includes seconds, milliseconds, and in some cases, a timezone.

Most of us are familiar with the term timezone. UTC is a timezone that stands for Universal Time Coordinated. It is equivalent to GMT, which stands for Greenwich Mean Time and has a timezone offset of +0:00. The remaining timezones are all relative to UTC. For instance, The Pacific Time (-8:00) is 8 hours behind UTC.

### UTC in database
When storing a date in a database, it is usually in 24-hour format with millisecond precision(`yyyy-MM-dd HH:mm:ss.fff`). For example, '2022-02-01 14:25:43.899'. Furthermore, regardless of the time zones in which the developers/applications are located, always save the date and time in the UTC timezone. When converting a time to UTC, the timezone offset is normally subtracted from the actual time. The offset will be one hour less than usual during daylight saving time (summer).

When returning data to the client (browser), adding a 'Z' at the end of the date allows browsers to identify it as UTC and convert it to local time while showing. Most DateTime pickers in modern frameworks are set to convert to UTC by default. There are also some libraries that convert to and from UTC and handle all cases, including DST.

![UTC Flow chart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/msw1kj3r85yvzhlyie5o.png)

### What if we don't use UTC
User A from Australia (+11:00) uploads a photo at time `2022-02-01 11:30 PM` and the same date and time are stored in the database. User B from Canada (-5:00) opens this photo at the same time will see the uploaded date as `2022-02-01 11:30 PM` where the present time of User B is `2022-02-01 7:30 AM`. The uploaded date shown to User B is a future date and that is wrong.

### How to solve this issue using UTC
User A from Australia (+11:00) uploads a photo at time `2022-02-01 11:30 PM` and the date and time are converted to UTC (`2022-02-01 12:30 PM`) and stored in the database. User B from Canada(-5:00) open this photo at the same time will see the uploaded date as `2022-02-01 7:30 AM` where the present time of User B is `2022-02-01 7:30 AM`. The uploaded date shown to User B is the present date and is correct.

Even though there are many benefits to UTC, there exist cases where we don't need the overhead of using UTC and thus avoid complicating things. Yet, if the date is accessible worldwide then, it is recommended to keep the date in UTC. Since there are different calendar systems in different regions, developers often deal with interesting date and time issues and every new problem is an opportunity to learn.
Papercraft - Composable Templating for Ruby
Tags: ruby, template, html
Published: 2022-02-08 05:45:59

---
title: Papercraft - Composable Templating for Ruby
published: true
description: 
tags: ruby, template, html
//cover_image: https://direct_url_to_image.jpg
---
Papercraft is a new Ruby gem I’ve been working on, that provides a new way to render HTML, XML and JSON using plain Ruby. Here’s what it looks like:

```ruby
require 'papercraft'

greeter = Papercraft.html { |name| h1 "Hello, #{name}!" }
greeter.render('world') #=> "<h1>Hello, world!</h1>"
```

Papercraft templates use explicit parameter passing in order to “bind” template variables, and use application and composition to combine templates in a variety of ways.

For more information on Papercraft, head over to the [Noteflakes website](https://noteflakes.com/articles/2022-02-04-papercraft).
Best Website Design & Development Company in Brentwood, USA
Published: 2022-02-08 05:44:41

[From developing a website to designing it, Allied Technologies is known as a top-rated web development company in the USA. Best Web Development Agency in California, USA.  Their websites are known for generating traffic. Best Virtual Receptionist Service for All Services in Maryland, USA.  These websites are not just soothing to the eyes but also created according to the algorithm of Google and SEO criteria. Best Search Engine Optimization In New York, USA. All you need is to pay for the type of website that you need and you get everything ready. .  Best Social Media Marketing Agency in Brentwood, USA.  for logos and images, website developers work in close cooperation with the graphic designing team.](https://alliedtechnologies.io/web-development/)
  Link - https://bit.ly/3J5S3De

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9d6xoeiutt8weja1a43k.jpg)
Self-Taught Developer Journal, Day 56: TOP Building Rock Paper Scissors UI cont.
Tags: webdev, beginners, codenewbie, devjournal
Published: 2022-02-08 05:32:50

Today I completed the JavaScript code for Rock Paper Scissors.

## Debugging
I debugged the issue with some help from [Aji](https://twitter.com/ajiwagmi) that found a stackoverflow post describing the issue I was having and the solution. In addition to another post I found. To sum up, the window confirm method is processing blocking and not allowing the DOM to update. By using setTimeout() on the confirm call in my gameOver function, I am giving time to for the browser to update the DOM before executing confirm.

![stackoverflow post image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ecnss9ckeu319avr6u1k.png)
 
Source: https://stackoverflow.com/questions/41936043/javascript-alert-supersedes-preceding-code


![stackoverflow post image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0hnrv4l7k5vli6pc2t0w.png)
 
https://stackoverflow.com/questions/17391902/javascript-confirm-execute-before-anything-else

![JavaScript](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/auumpklhgob52le07ch2.png)

![Test output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7jfkiru62qu0885odqet.png)

https://www.w3schools.com/jsref/met_win_settimeout.asp

## CSS Livestream
I started watching a [recorded livestream](https://www.youtube.com/watch?v=g-HttOH1y6w&t=20s&ab_channel=FrontendDivision) with [Shashi](https://twitter.com/shashiwhocodes), [Mike](https://twitter.com/genericmikechen), and [Jhey](https://twitter.com/jh3yy) that Shashi [tweeted]( https://twitter.com/shashiwhocodes/status/1490739810801180681?s=20&t=o7Aghy1xsxgDycF3ff52vA) about earlier today.

I'm still in the process of watching it, but its interesting getting three different developer prospective and approaches. I also loved how they touched on design and got some books recs by Jhey.

Design book recommendations: 
* Refactoring UI
* Inclusive Components

I'm hoping to read them soon. Then I wrote down some notes from the parts I watched:

* always use rems, use for letter spacing and for padding in rare cases

* set padding to the outer elements for clickable elements so the user can interact with the whole area

He also posted a [tweet](https://twitter.com/shashiwhocodes/status/1490828937399701505?s=20&t=o7Aghy1xsxgDycF3ff52vA) with resources mentioned in the stream.

## Resources
[The Odin Project](https://www.theodinproject.com/paths/foundations/courses/foundations/)
[Revisiting Rock Paper Scissors](https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/revisiting-rock-paper-scissors)
Top 4 Tips to Design Amazing Ionic Apps
Published: 2022-02-08 05:27:21

Ionic is an open-source UI toolkit for building performant, high-quality mobile and desktop apps using web technologies — HTML, CSS, and JavaScript — with integrations for popular frameworks like Angular, React, and Vue.  

The Ionic framework mainly focuses on front-end user experience or UI interaction, which handles all the look and feel of your app. It is easy to learn and can integrate with other libraries or frameworks such as Angular, Cordova, etc. It can also be used as a standalone without a front-end framework using a simple script.

Officially, the Ionic framework has integration with Angular, but it also provides support for Vue.js and React.js, which are in development. 

**4 Tips to Develop Ionic Apps:**
**1. Use Native Features**
One of the advantages of Ionic is that you can use native features in your application without coding any native code. These features include a camera, geolocation, push notifications, Bluetooth, and more. You can even use device-specific features like iBeacon and Touch ID on iOS devices.  

**2. Be Selective about Which Components You Use**
There are lots of components that you can use in an Ionic app. But not all of them are necessary to create a successful app. The best idea is to pick only a handful of components that make sense for your project so that you don’t end up over complicating matters unnecessarily. It’s often better to keep things simple than try to cram too much into a single project.  

**3. Build UI That Looks Great on All Devices** 
The point is clear in itself as there are some specific UI factors that should be considered for Android and iOS that make the UI look great on both platforms.  

**4. Hire Dedicated Ionic Developers**
Hiring a professional developer that is an expert in the Ionic framework is the best option to create a high-performing cross-platform application. You can hire a dedicated Ionic Developer from **WebClues Infotech** at a reasonable rate. Their developers aim to reduce the time to market for your product by delivering a build, which meets your requirement, on-time.  

I hope this answer helps you find the best Ionic app developer for your project.
Day 9 of 100DaysOfCode
Tags: 100daysofcode, python, challenge, discord
Published: 2022-02-08 05:25:47

## Day 9 of 100 Days Of Code
_I was too tired for writing a post yesterday._

Here can you find what I learned (& published) yesterday.

### What I published / coded (/ updated) yesterday?
* Day 9 started with writing the [Disweb.py](https://t.co/QXpUOwd4HD) docs for my new wrapper. 
* Improving the disweb error messages 
* coding the userLimiter for the [disweb v1.1.0 update](https://t.co/KewDH4BOWp). 
* The day ended with the blog post.
New Years Resolution - Dev Log 15
Tags: webdev, computerscience, beginners, programming
Published: 2022-02-08 05:20:08

It took an entire weekend and having to get support from the Redis discord, but my API route for removing job listings works. For some reason using Redis OM with Node, when you search out a record using the 'matches' function, you can not access the data on the record that was found. After I changed my schema so that I could use the 'equals' function, I could access the data on the record I found. With this, I was able to access the id of the record and remove that sucker.

I am really liking Redis OM, but the lack of documentation is a little annoying. At the moment, Redis OM is basically brand new, they even say it is not production-ready, but I am using it anyway. Now I currently have the get all job posts, remove a job post, and create a job post routes done. So I just need to implement search with filters. Once that is done, the bulk of the MVP is done.

I am excited because once that is done, I am going to make another YouTube video showing the project off before I add the final touches. After the video, I need to add in stripe for payment processing, and Mail-Gun to send out receipts. I think stripe has a receipt functionality, so I might be able to hold off on the Mail-Gun; that is if stripe lets me customize the receipt email. If not, then Mail-Gun it is. This is because I need to add the unique removal ID that is created upon a job posting to the receipt so that if the user wants to remove their job listing they can. Once all of that is finished, I move on to user input validation and other refinements like SEO, then I launch the MVP. So get excited people (I am aware that no one reads these lol), because I sure am!

If you have not checked out the video discussing the basic UI, please do:

youtube.com/watch?v=jvH9iTYzUbQ
Build a Video Conference App from Scratch using WebRTC,Websocket,PHP +JS Day 32
Tags: webrtc, websocket, javascript, webdev
Published: 2022-02-08 05:06:33

The WebRTC standard provides APIs for accessing cameras and microphones linked to a computer or smartphone while creating for the web. These devices are generally referred to as Media Devices, and they may be accessed through the navigator using JavaScript. The MediaDevices interface is implemented by the mediaDevices object. We can enumerate all connected devices, listen for device changes (such as when a device is attached or removed), and open a device to obtain a Media Stream using this object (see below).

The function getUserMedia(), which produces a promise that resolves to a MediaStream for the matching media devices, is the most typical approach to do this. This function receives a single MediaStreamConstraints object as input, which outlines our needs.


In this video we'll cover how to Get local media

{% youtube FcufJBWV7Sk %}