teleren/devto huggingface dataset:
Create a New Sudo User in AWS EC2 (Ubuntu AMI)
Published: 2020-11-20 14:11:13

 Create a New Sudo User in AWS EC2 
(Ubuntu AMI)
Log in your Ec2 Instance using “ec2-user”
ssh ec2-user@<ip> -i <ssh key>
 Log in to your server as the root user.
ubuntu@ip-172-31-24-53:~$ sudo -i
root@ip-172-31-24-53:~#
 Use the adduser command to add a new user to your system.
adduser <username>
root@ip-172-31-24-53:~# adduser test


Set and confirm the new user’s password at the prompt. Use 
strong password to secure account
root@ip-172-31-24-53:~# passwd test
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Use the usermod command to add the user to the sudo group.
usermod -aG sudo username
root@ip-172-31-24-53:~# usermod -aG sudo test
By default, on Ubuntu, members of the sudo group have sudo privileges.
Test sudo access on new user account
Use the su command to switch to the new user account.
root@ip-172-31-24-53:~# su test
su - username


As the new user, verify that you can use sudo by prepending “sudo” to the command
 that you want to run with superuser privileges.
test@ip-172-31-24-53:/root$ sudo ls -la /root

{% youtube ReNQ33qB3cM %}
How to set Jenkins user as root
Tags: devops, tutorial
Published: 2020-11-20 14:10:18

#jenkins

To set root user for Jenkins to follow below steps for CentOs


1. Open up the script 
vim /etc/sysconfig/jenkins
2. Find this $JENKINS_USER and change to “root”:
$JENKINS_USER="root"
3. Then change the ownership of Jenkins home, webroot and logs:
chown -R root:root /var/lib/jenkins
chown -R root:root /var/cache/jenkins
chown -R root:root /var/log/jenkins
4) Restart Jenkins and check the user has been changed:
service Jenkins restart


{% youtube 3MfFstqup2E %}
Working with HTML Form Fields in Javascript
Tags: beginners, javascript, codenewbie, webdev
Published: 2020-12-11 01:29:43

---
title: Working with HTML Form Fields in Javascript
description: Learn to select form fields, look at and even change their values, and do basic validation.
published: true
date: 2020-11-20 13:57:00 UTC
tags: beginners,javascript,CodeNewbie,webdev
canonical_url: https://raddevon.com/articles/working-with-html-form-fields-in-javascript/
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/1ok9qtqme8eql3bx0h3h.jpg
---
You might want to go back and watch the first two videos in my DOM manipulation series if you haven’t already. This one follows from those two.

Forms and their controls have slightly different methods and properties from the other DOM elements. In this video, I show you a couple of those and demonstrate the foundational concepts of how you’d validate a user’s input.

{% youtube 3sKsoyFAA5A %}

Even now after writing Javascript almost daily for quite a few years, I still need to look things up, often just to see examples of them in use. I created this cheatsheet so you can have examples of the Javascript basics at the ready. Head over to [this video's page on my site](https://raddevon.com/articles/working-with-html-form-fields-in-javascript/) where you can get your own copy!
Add the pagination on Gridsome site
Tags: vue, gridsome, javascript, graphql
Published: 2020-11-21 02:32:10

---
title: Add the pagination on Gridsome site
published: true
date: 2020-11-20 13:54:52 UTC
tags: vuejs,gridsome, javascript, graphql
canonical_url: https://phongduong.dev/blog/add-the-pagination-on-gridsome-site/
---

To add the pagination for the site, you use `@paginate` in your GraphQL query. The query will receive a `$page: Int` parameter. The default number of nodes per page is 25. 

```
<page-query>
query ($page: Int) {
  allPost(page: $page) @paginate {
    pageInfo {
      totalPages
      currentPage
    }
    ...
  }
}
</page-query>
```

Gridsome provides a `Pager` component for pagination. You import the component from `gridsome` and place it in your template. It requires a page's `info` property. This property is an object that 2 properties: `totalPages` and `currentPage`. You can get these 2 properties from `pageInfo` of your query.

```
<template>
  <Layout>
    <Pager 
      :info="$page.allPost.pageInfo" 
      :showNavigation="false" 
      range="10"
      linkClass="pager-link"
     />
  </Layout>
</template>

<script>
import { Pager } from 'gridsome'

export default {
  components: {
    Pager
  }
}
</script>

<page-query>
query ($page: Int) {
  allPost(page: $page) @paginate {
    pageInfo {
      totalPages
      currentPage
    }
    ...
  }
}
</page-query>
```

You can also customize the `Pager` component's properties like show links and navigation, the number of links to show, or the custom class of links for styling.
It is unclear where React is heading
Tags: react, angular, ember, vue
Published: 2020-11-20 13:52:45

Facebook advocates for using functions, because, like it seems, they are easier to understand than objects essentially advocating for dropping object-oriented programming. With growing adoption of React Hooks the trend becomes even more interesting experiment to watch.

Because, even React Hooks can be described as a great solution for some problems - these problems occurred because Facebook rejects object-oriented programming.

It makes React Hooks nothing more than useful, but a hack to prove React can live without objects. Life that is easier than before, but also a life introducing some  completely new, not systematic rules specific only to React, a library that branches out from the main root, and going into direction of its own.

Time will show if that risk was worth taking, and since React adoption is so wide, we all have to keep the finger crossed that it is.

As you may notice I am critical of the approach taken by social media giant. But I have to accept React Hooks is the only solution Facebook provided for problems it created, and welcome it with open hands as it is.

But still if it comes to almost every solution, no matter who builds it, there is a technical and marketing aspects that have to be separated. Given React Hooks - it solves a problem and is hailed by Facebook as the next big thing.

If we look at it technically, and from wider perspective - it is a solution of a problem that almost nowhere else exists. The head-to-head competitor of React - Angular does not need Angular Hooks.

A wide range of problems React solves with hooks does not exist in Angular for a specific reason. Angular did not reject object-oriented programming. With a dependency injection design pattern, and services, Angular does not have problems that require hooks.

Facebook's team designing React rejection of core programming concepts as for now does not impact development so much. But hook after hook, perspective for a development of the library seems to narrow down. With such wide adoption, there is no way back unfortunately. Facebook has to prove React can solve problems it creates.

Domination in frontend development is something Facebook probably wants to maintain. In this fast-paced race between the biggest corporations social media giant has a great power to change programmers minds including throwing out decades worth of programming research.

But at some point of time people will start to ask if it is worth to maintain an odd library. Actually they ask it nowadays. Some choose to go with Vue.js - an early state library that promises to be something a better than React, but still not definitely competing with fully featured frameworks like Ember or Angular.

Some are giving a try with Angular, or Ember just to discover they don't have to worry about whole sets of problems presentation libraries introduce.

For Facebook, it means it can still try to sell React, introduce something new - a framework, or just leave the race. Most likely, the pressure from competitors will help Facebook reevaluate and improve it's open source offering.
React Hooks with Routing the Easy way
Tags: react, routing
Published: 2020-11-20 13:43:04

*If you are interested in developer trends you should check out my new newsletter at: [unzip.dev](https://unzip.dev)*

---

No need for react-router nowadays, let's use a more simplistic approach with [`Paratron/hookrouter`](https://github.com/Paratron/hookrouter).

## Install
`npm install hookrouter`

## Simple example
In app.js we can write
```
import {useRoutes} from 'hookrouter';
import HomePage from './HomePage';
import AboutPage from './AboutPage';

const routes = {
  '/': () => <HomePage />,
  '/about': () => <AboutPage />,
};

function App() {
  const routeResult = useRoutes(routes);
  return routeResult || <NotFoundPage />;
}

export default App;
```

`HomePage` can look like:
```
import {A} from 'hookrouter';
function HomePage() {
	return (
		<div className="Home">
		Home Page
		Go to <a href="/about">About</a>.
		</div>
	);
}
export default HomePage;
```

### Layout
I've created another tutorial that explains how to structure a project with a layout - [React Hooks, Routing with a Layout](https://dev.to/agamm/react-hooks-routing-with-a-layout-173a).

More examples:
- [Parameters in the URLs](https://github.com/Paratron/hookrouter/blob/master/src-docs/pages/en/03_navigation.md#using-the-link-component)
- [Nested Routes](https://github.com/Paratron/hookrouter/blob/master/src-docs/pages/en/02_routing.md#nested-routing)
- [Server Side Rendering](https://github.com/Paratron/hookrouter/blob/master/src-docs/pages/en/05_serverside-rendering.md)
- [Other helpful features](https://github.com/Paratron/hookrouter/blob/master/src-docs/pages/en/04_other-features.md)
Introduction to WordPress SlotFill
Tags: theblog
Published: 2020-11-20 13:38:25

---
title: Introduction to WordPress SlotFill
published: true
date: 2020-11-20 13:37:43 UTC
tags: TheBlog
canonical_url: https://ryanwelcher.com/2020/11/introduction-to-wordpress-slotfill/
---

In 2019, I was lucky enough to speak at the fantastic [JavaScript for WordPress](https://javascriptforwp.com/conference/) conference. It was my first virtual conference and I had a really great time. It’s a great conference so check it out this year!

Here is the [recording](https://youtu.be/pMD0WpMaXEo) and you can see the [associated repo here](https://github.com/ryanwelcher/extending-gutenberg)


The post [Introduction to WordPress SlotFill](https://ryanwelcher.com/2020/11/introduction-to-wordpress-slotfill/) appeared first on [Ryan Welcher](https://ryanwelcher.com).
Transaction Isolation Levels With PostgreSQL as an example
Tags: database, rdbms, postgres, transactionisolation
Published: 2020-11-20 13:23:55

---
title: Transaction Isolation Levels With PostgreSQL as an example
published: true
description: Transaction Isolation Levels With PostgreSQL as an example
tags: #databases #rdbms #postgresql #transactionisolation
cover_image: https://assets.mkdev.me/posts/covers/000/000/012/original/mkdev_article.png
---
In this video, Boris Strelnikov will explain which transaction isolation levels exist in databases and what you should be aware of as a developer. 

You will see dirty read, lost update, non-repeatable read, phantoms and serialization anomaly, most of them demoed inside PostgreSQL database:

{% youtube G8wDjV0N9tk %}

***

*You can hire Boris as your programming mentor or get a consultation from him [here](https://mkdev.me/en/mentors/risentveber)!*
What are the steps to learn ASP.NET?
Tags: dotnet, career, tutorial, computerscience
Published: 2020-11-20 13:22:43

It is very good to learn the ASP .Net from the basics. Because we should learn any new technology from their basics. You should be very strong in the basics of ASP .Net. Instead of studying from home by searching I suggest you, to learn from a trainer who explains all the basics and other advanced concepts detailly.

Please keep this in mind that your trainers should be a strong industrial expert who currently works in ASP .Net. While I search for such trainers, I found Hope Tutors. They are providing the best ASP .Net training with industrial field experts. Do you know one thing about them. Trainers are preparing the course syllabus and materials. This is the reason for them to provide industrial standard training.

Before starting asp dot net , start studying C# get familiar with c# as you are going to use c# as backend language for asp dot net , but in simple words let me construct a simple road map for you :

c#
database ( ms sql sever )
web forms ( asp dot net )
ado dot net
entity framework
asp dot net MVC
while you studying asp dot net , study side by side JavaScript as will , implementation of JavaScript with asp dot net help you to develop a complete functional websites.

The steps that involve are:

Try to pick a language and read some books.
Create something and watch the ASP.NET from scratch MVC screencasts.
Read Some MVC Books.
Rewrite Something using the MVC Framework.
Follow the Masters.

Meet The Experts : https://nareshit.com/asp-net-mvc-online-training/
Building a HIPAA-compliant rules engine for text-based service company
Tags: python, startup, react, programming
Published: 2020-11-20 13:22:43

MedTech startup, Jiseki Health, is a concierge service that helps its clients take control of their [health](https://evrone.com/ehealth) and improve their wellbeing. Their major clients include well-known electric car manufacturer and several large American insurance companies.

When they were looking for a technological partner, their primary goal was to build a rules engine to control and generate outbound messaging going to their members, patients, and the providers who interacted with them.

[Read a case study](https://evrone.com/jiseki-health) about how Evrone co-created the solution with the client, prepared the user flow and user scenarios, and developed a Python rule-based engine to execute rules according to a particular algorithm.
How I can search for reports in specific table that stores sql code using portgresql?
Tags: help, postgres
Published: 2020-11-20 13:14:31

As I ask in https://dba.stackexchange.com/q/280035/118215 , I have a table that stores sql code for reports named `reports`:


```
report_code PK VARCHAR 5  
report_sql TEXT
```

And I want to search in it the reports codes (from column `report_code` that `report_sql` has sql_code that consumes views and materialized views that are generated from specific tables.

The table `reports` and both the views and the materialized views are located in the same server.
Daily Developer Jokes - Friday, Nov 20, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-11-20 13:00:18

---
title: "Daily Developer Jokes - Friday, Nov 20, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Friday%2C%20Nov%2020%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12592aa5db7.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
Asynchronous JavaScript is amazing.

I Promise you, await and see.
 -->
IPython Interactive Computing and Visualization Cookbook
Published: 2020-11-20 12:57:01

Python is one of the primary open source programs for information science and numerical computing. IPython and the affiliated Jupyter Notebook provide efficient interfaces to Python for information evaluation and interactive visualization, and they constitute an perfect gateway into the stage.

IPython Interactive Computing and Visualization Cookbook, Second Edition includes many ready-to-use, concentrated recipes to get high-performance scientific computing and data analysis, in the most recent IPython/Jupyter attributes to the most innovative tricks, so you can write faster and better code. You may apply these innovative procedures to several real-world examples, demonstrating subjects in applied mathematics, scientific modeling, and machine learning.

The first portion of the novel covers programming methods: code quality and reproducibility, code optimisation, high-speed computing via just-in-time compilation, parallel computing, and graphics card programming.

Characteristics oversaw the Jupyter Notebook for interactive information visualization and science Become a Specialist in high-performance computing and visualization to data analysis and technical modeling a Thorough coverage of computing through many hands on, example-driven recipes using comprehensive, incremental explanations Understand Master all facets of this Jupyter Notebook Code better: compose high quality, readable, and well-tested apps; profile and optimize your code; and run reproducible interactive calculating experiments Picture data and create interactive plots at the Jupyter Notebook Compose blazingly fast Python apps with NumPy, ctypes, Numba, Cython, OpenMP, GPU programming (CUDA), concurrent IPython, Dask, and much more Assess data with Bayesian or frequentist data (Pandas, PyMC( and R), and also learn from real data through machine learning (scikit-learn)

Gain invaluable insights into signs, pictures, and sounds together with SciPy, scikit-image, along with OpenCV Simulate deterministic and stochastic dynamical systems in Python familiarize yourself with mathematics in Python with SymPy and Sage: algebra, analysis, logic, graphs, geometry, and probability theory https://www.javatpoint.com/jvm-java-virtual-machine
🛡 Clickjacking Attacks and How to Prevent Them
Tags: security, attacks, clickjacking
Published: 2020-11-20 12:39:57

📌 Learn how clickjacking attacks implement visual tricks to capture users' clicks, and how you can prevent them by applying client-side and server-side solutions.
[Read more...](https://auth0.com/blog/preventing-clickjacking-attacks/?utm_source=content_synd&utm_medium=sc&utm_campaign=clickjacking)
HTML Tutorial with mobile phone 
Tags: html, tutorial, webdev
Published: 2020-11-20 12:19:10

### **Setting up Acode**
.
We will be continuing the [web development series] (https://dev.to/blackpandan/intro-to-web-development-a-series-html5-to-p2i)  , click the link to check out the previous series, we are going to look at html5

First of all  Goto your phone's appstore search Acode

<img src="https://dev-to-uploads.s3.amazonaws.com/i/w5s2ujios2952xi4l4rn.png" /> 
 or go to their website
https://acode.foxdebug.com

* open the **Acode app**
___

* click the kebab menu
![Alt](https://dev-to-uploads.s3.amazonaws.com/i/z3ucv5qs92rsx5yr06ev.png)

___
* click on open folder
![alt](https://dev-to-uploads.s3.amazonaws.com/i/g7va549hncv96lhqaw1p.png)

___
* click on internal storage
![alu](https://dev-to-uploads.s3.amazonaws.com/i/q4d7w39e6h4ep5v0mud0.png)

___
* click the plus icon
![alt](https://dev-to-uploads.s3.amazonaws.com/i/026bznlo8q9xxb2kv6e6.png)

___
* click on new folder
![Alt](https://dev-to-uploads.s3.amazonaws.com/i/z9llnbwxjydj4bsr3mdy.png)

___
* rename it to learn
![alt](https://dev-to-uploads.s3.amazonaws.com/i/703v0fdtbkalshog2qy9.png) 

___
* search and open the learn folder
![alt](https://dev-to-uploads.s3.amazonaws.com/i/c2gsf50votbqyzmu5bpt.png)

___

![alt](https://dev-to-uploads.s3.amazonaws.com/i/t6sk9e2ip4r6l0m58rlo.png)

___
* click the plus icon again and create new file
![alt](https://dev-to-uploads.s3.amazonaws.com/i/026bznlo8q9xxb2kv6e6.png)

___
* rename the file to index.html
![alt](https://dev-to-uploads.s3.amazonaws.com/i/6vnnegt5a5o2ur5xefp7.png)

___
* click on select folder
![alt](https://dev-to-uploads.s3.amazonaws.com/i/p14yfo166e938fhdrph1.png)

___
* Click the hamburger menu ,then click the learn folder and your index.html 
![alt](https://dev-to-uploads.s3.amazonaws.com/i/p14yfo166e938fhdrph1.png)

___


You just created your first HTML file, we will start talking about HTML tags in the next series

___

cover image source: 
[Greg Rakosy - unsplash](https://unsplash.com/@grakozy)

___
Copy commit from one branch to another without using git merge
Published: 2020-11-20 12:38:46

So I was doing some tests in code today and had to create a test branch.

After the testing was done, I forgot to change the branch back to "master". So all reasonable code that I wrote afterwards was in the test branch. I had already committed and was about to push when I noticed I was on the wrong branch. 

I asked myself how I can pick a commit from one branch and apply it to another (not merging both branches together with redundant/test code). So I remembered a command that Alangi Derick used, **cherry-pick** 

How does git cherry pick works? 

- While on the wrong branch (the one that has the commit), do `git log` and copy the commit hash
- Checkout to the correct branch which you want to apply the commit, eg `git checkout master`
- Now apply the commit to the new branch, `git cherry-pick <commit-hash>` 

You are good to go, all the changes from that commit hash will be copied from the old branch to the new branch. 

Hope this helps someone out there.

_May the source be with you_
My Experience Towards Hacktoberfest on the platform of digital ocean
Tags: hacktoberfest, digitalocean, cpp
Published: 2020-11-20 12:00:27

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title, structure, and words! ✨ -->


### Introduction
<!-- If you are new to the DEV community, introduce yourself and share a bit about why you joined DEV and decided to participate in Hacktoberfest this year.  --> 
<p>Hi, I am Muhammad Sameer Farooq currently studying at FAST NUCES Lahore.</p>


<!-- Are you brand new to open source? What about coding in general? Tell us about how you got here →


<p>I am a competitive C++ programmer and also made several projects in this language.</p>
<!-- Share a bit about where you’re at in your Hacktoberfest journey. What stage are you at? How has the process been?  -->

### Contributions

<!-- This is where you can list the contributions you made and explain why you chose the projects you did. Don’t forget to add links!  -->
<p>This year from the platform of hacktoberfest i got introduced to open source. So, i also made some contributions that you can also view on my profile <a href="../www.github.com/msameerfarooq">www.github.com/msameerfarooq</a></p> 

### Reflections
<p>I contributed first time to open source and it was an amazing experince. I am eagerly waiting for next year's hacktober fest</p>
<!-- Overall, how has your Hacktoberfest 2020 experience been? If you’re a first-timer, will you participate again? What have you learned? Have you made any interesting connections? What is your next step in open source?  -->