teleren/devto huggingface dataset:
useradd vs adduser: Which command to use?
Tags: linux, beginners, devops, cloud
Published: 2022-05-29 07:35:51

Linux is amazing! Let me tell you what made me say so.

There are multiple ways to perform a function in Linux. Let's say you simply want to print "Hello World" to the screen. To do so, some beginners might create a new file, write "Hello world" to it and then use the `cat` command to print the contents of the file. Some experienced users may use the `echo` command to print the same to the screen. Both of them are correct as the job is done perfectly but the only difference is that using the `echo` command, we can accomplish the job quickly.

In this blog, we are going to discuss about one such function of **creating a new user** using two commands `adduser` and `useradd`. We'll also talk about which command you must use and when.

Let's dive right into it.

## adduser command

The **adduser** command **creates a new user** on a linux system. Apart from this it does the following things:

- Creates a **new group**.
- Creates the **home directory** for new user under /home.
- Asks for the password.
- Asks for additional information such as **Full Name**, **Room number**, **Work phone**, **Home phone** and other information.

> Note that you need `superuser` permissions to execute the command.


![adduser command](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/coqul2e1wss70qfw3853.png)

## useradd command

The `useradd` command does the same thing as `adduser` command i.e **creating a new user** but with few differences.

- It does **not** create a home directory for the new user by default.
- It does **not** ask for password.
- It does **not** ask for any additional information.

> Note that you need `superuser` permissions to execute the command.

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

Although it does not ask for any additional information by default, you can provide them that information using the flags given below:

-c, --command      : GECOS field for the new account.
-D, --defaults     : Create new user with default set values.
-m, --create-home  : Create user's home directory
-p, --password     : Set Password for the account.
-e, --expire       : Set the expiry date for the user.

You can view additional flags by using the command:

```
useradd --help
```

## Which one should I use and when?

Well, in most of the cases you must use `adduser` command. It's easy to set up password, create home directory etc., using this command.

But that doesn't mean `useradd` command is useless. If you temporarily want to create a user without providing much details for the account, you can use the `useradd` command. Generally it's used while executing commands in automated way in scripts.


That's all for the blog. Comment down below your go-to command for creating a user. 

Thank you for reading!
Change faker depending on the value of FuzzyChoice
Tags: python, django, factorybot, faker
Published: 2022-05-29 05:49:11

I use factory_bot and faker with Django.

I want to create User with random gender, and also name related to the gender.(Of course, name does not define gender.)

To do so, I use `FuzzyChoices` and `factory.lazy_attribute`

```python
from django.contrib.auth import get_user_model

import factory
from accounts.models import Gender
from factory import fuzzy
from faker import Faker


class UserFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = UserModel

    gender = fuzzy.FuzzyChoice([Gender.FEMALE, Gender.MALE])

    @factory.lazy_attribute
    def name(self):
        locale = "ja_JP"
        if self.gender == Gender.FEMALE:
            return Faker(locale).name_female()
        else:
            return Faker(locale).name_male()
```

Thanks.
Data Warehouse and Lakehouse Ecosystem
Tags: oraclecloud, datawarehouse, ecosystem, analytics
Published: 2022-05-29 05:30:04

The 𝙥𝙖𝙧𝙩𝙣𝙚𝙧𝙨𝙝𝙞𝙥 between:
(1) Oracle and 
(2) Informatica 
brings together two industry leaders in database and data management to deliver a comprehensive enterprise 𝙙𝙖𝙩𝙖 𝙬𝙖𝙧𝙚𝙝𝙤𝙪𝙨𝙚 𝙖𝙣𝙙 𝙡𝙖𝙠𝙚𝙝𝙤𝙪𝙨𝙚 𝙚𝙘𝙤𝙨𝙮𝙨𝙩𝙚𝙢.

This 𝙧𝙚𝙛𝙚𝙧𝙚𝙣𝙘𝙚 𝙖𝙧𝙘𝙝𝙞𝙩𝙚𝙘𝙩𝙪𝙧𝙚 shows how Informatica 𝙄𝘿𝙈𝘾 𝙎𝙚𝙘𝙪𝙧𝙚 𝘼𝙜𝙚𝙣𝙩 operates in Oracle 𝘾𝙡𝙤𝙪𝙙 𝙄𝙣𝙛𝙧𝙖𝙨𝙩𝙧𝙪𝙘𝙩𝙪𝙧𝙚 (𝙊𝘾𝙄)
(1) Data is 𝙚𝙭𝙥𝙤𝙧𝙩𝙚𝙙 from Oracle 𝙀-𝘽𝙪𝙨𝙞𝙣𝙚𝙨𝙨 𝙎𝙪𝙞𝙩𝙚 and 
(2) 𝙞𝙢𝙥𝙤𝙧𝙩𝙚𝙙 data into an Oracle 𝘼𝙪𝙩𝙤𝙣𝙤𝙢𝙤𝙪𝙨 𝘿𝙖𝙩𝙖𝙗𝙖𝙨𝙚 
to be consumed by either analytics or data science processes.

In general, the architecture includes the following 𝙡𝙤𝙜𝙞𝙘𝙖𝙡 𝙙𝙞𝙫𝙞𝙨𝙞𝙤𝙣𝙨:
(1) 𝘿𝙖𝙩𝙖 𝙧𝙚𝙛𝙞𝙣𝙚𝙧𝙮
(2) 𝘿𝙖𝙩𝙖 𝙥𝙚𝙧𝙨𝙞𝙨𝙩𝙚𝙣𝙘𝙚 platform (curated information layer)
(3) 𝘼𝙘𝙘𝙚𝙨𝙨 𝙖𝙣𝙙 𝙞𝙣𝙩𝙚𝙧𝙥𝙧𝙚𝙩𝙖𝙩𝙞𝙤𝙣

𝘿𝙚𝙥𝙡𝙤𝙮 𝙖𝙣 𝙖𝙣𝙖𝙡𝙮𝙩𝙞𝙘𝙨 𝙥𝙡𝙖𝙩𝙛𝙤𝙧𝙢 𝙛𝙤𝙧 𝙄𝙣𝙛𝙤𝙧𝙢𝙖𝙩𝙞𝙘𝙖 𝙄𝘿𝙈𝘾 𝙤𝙣 𝙊𝙧𝙖𝙘𝙡𝙚 𝘾𝙡𝙤𝙪𝙙
https://docs.oracle.com/en/solutions/informatica-on-oci/img/informatica-oci.png

𝙎𝙩𝙖𝙮 𝙩𝙪𝙣𝙚𝙙 𝙗𝙮 𝙛𝙤𝙡𝙡𝙤𝙬𝙞𝙣𝙜
https://www.linkedin.com/feed/hashtag/?keywords=did_you_know_that


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

https://www.linkedin.com/posts/mahmoudrabie2004_didabryouabrknowabrthat-oracle-oracleace-activity-6936549119607910400-ViJ4?utm_source=linkedin_share&utm_medium=member_desktop_web
NextJS add lang attribute to HTML tag
Tags: nextjs, a11y, beginners, webdev
Published: 2022-05-29 04:47:54

When working on accessibility, a common issue you might come across is that your HTML tag doesn't have a lang attribute.

The lang attribute tells the user which language the page is written in.

Some examples of valid lang attributes are:

```html
<!-- French content -->
<html lang="fr"></html>
```

> Note: Find [all languages](https://www.w3schools.com/tags/ref_language_codes.asp) codes here.

We can also extend the use-case to define specific versions of a language, for instance, British English.

```html
<html lang="en-gb"></html>
```

## Adding this lang tag to Next.js

In any regular plain HTML website, we would add this tag to the HTML element. However, in the case of Next.js, we don't have direct access to it.

So to add this tag, we need to use the `next.config.js` file.

```js
module.exports = {
  i18n: {
    locales: ['en'],
    defaultLocale: 'en',
  },
};
```

If your website supports multiple languages, you can even put various values in the `locales` array.

The default locales are then used to set the current one.

You can even use this config to set up custom domains, but we might dive into that separately.

## Alternative method

There is an alternative way of adding a custom HTML tag if you want to override multiple HTML properties.

Inside your `pages` directory, you can add a `_document.js` file.

This page will override the default Next.js document.
Inside of it, add the following structure, and you are good to go.

```js
import { Html, Head, Main, NextScript } from 'next/document';

export default function Document() {
  return (
    <Html lang='en'>
      <Head />
      <body>
        <Main />
        <NextScript />
      </body>
    </Html>
  );
}
```

And that's it, two different ways of adding the lang tag in Next.js.
I like to use the config way as it's a bit cleaner and future-proof.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
NoSQL, why? I love transactional database but I'm not sure if I'm missing anything.
Published: 2022-05-29 04:42:13

---
title: NoSQL, why? I love transactional database but I'm not sure if I'm missing anything.
published: true
description: 
tags: 
---

I've developed more than 100 applications over 10 years for my customers and none of them are NoSQL.

I've tried a few like, mongo, dynamo, firebase, but I don't really understand the use case.

Moreover, I'm not sure if I can maintain the software for the next 3-8 years without problems querying older data.

Am I missing anything?

- scaling?
- easier change request?

Which kind of project should I use NoSQL?

thankz!
Find all substring of a given string in O(n^2) time.
Tags: javascript, programming, help, beginners
Published: 2022-05-29 03:54:04

Below is the programmer written in JavaScript to find the all possible substrings of a given string in `O(N^2)` time complexity and an extra `O(1)` space;

### Programme
```javascript
function genSubstrings(inputString){
    debugger;
    let resultArray = [];
    // outer loop to run n times [n = size of string]
    for(let i = 0; i < inputString.length; i++){
        // pushing first char of string as substring
        // as we know that each char will be substring itself too.
        resultArray.push(inputString[i]);
        // inner loop to run n - 1 times;
        for(let j = i + 1; j < inputString.length; j++){
            // get last substring and append the new next char
            resultArray.push(
              resultArray[resultArray.length - 1] + inputString[j]
            );
        }
    }

    return resultArray;
}
```
### Output
```javascript
genSubstrings("abcd");

(10) ['a', 'ab', 'abc', 'abcd', 'b', 'bc', 'bcd', 'c', 'cd', 'd']
```
&nbsp;
I searched internet for a better solution which can run in less then O(N^2) time complexity but didn't find any.

If anyone has a better solution please write in comments, It will be really helpful.
&nbsp;

The thumbnail is taken from [geekforgeek](https://www.geeksforgeeks.org/substring-in-java/)
Awesome cli that you didn't know #3 mysql tools
Tags: linux, mysql, cli, shell
Published: 2022-05-29 03:06:23

When I was working I have projects with a BIG database in MySQL. Big Means as really BIG!!! when you can do a mysqldump it takes hours! If you have some of these problems, these tools will be very helpful.

![big database](https://www.propatel.com/wp-content/uploads/2019/09/import-large-database-mysql.jpg)

**Only for MYSQL**

You have a mysqldump of Gb's of data, to load it you need to wait hours and hours. Imagine you need to update the new structure table in your local environment. To not wait hours and hours loading the new changes, only extract the table you need and load the table only. If you on that situation this tool it's for you: 

## Split your big database dump on tables https://github.com/kedarvj/mysqldumpsplitter


That will process the mysqldump.sql in small chunks of SQL for each table of your database. then you can take only the part you needed.


## MySQL Dumper https://github.com/maxbube/mydumper

When you start FEELING of mysqldump it's not designed for BIG databases because it's very slow and does not show the progress of what happening behind.

This is a mysqldump of the  year 3000! 

Is a tool used for backing up MySQL database servers much faster than the mysqldump tool distributed with MySQL. It also has the capability to retrieve the binary logs from the remote server at the same time as the dump itself. The advantages of mydumper are:

### Features:

* Parallelism (hence, speed) and performance (avoids expensive character set conversion routines, efficient code overall)
* Easier to manage output (separate files for tables, dump metadata, etc, easy to view/parse data)
* Consistency - maintains snapshot across all threads, provides accurate master and slave log positions, etc

I'm fell in love!

bye bye mysqldump welcome mysqldumper


Note: It comes with the myloader the inverse of the dumper :>
How JavaScript became a backend language (node.js)
Tags: javascript, node, webdev, beginners
Published: 2022-05-29 02:51:18

## What is JavaScript

JavaScript was initially introduced to add scripts(JavaScript programs are known as scripts) to web pages in the Netscape Navigator browser, since it's inception all the major browsers have adopted the use of JavaScript. Fast forward to today and you can do much more with JavaScript. When companies started adopting JavaScript, a standard document called ECMAScript standard was written by ECMA International organization to maintain a standard in the language. Theoretically JavaScript can also be called as ECMAScript.

## How come a language developed for writing code for the browser evolve into a server side programming language ?

Today, JavaScript is not limited to the browser, you can write JavaScript on any device that has a JavaScript engine (A JavaScript engine is a software component that executes JavaScript code) Some of the popular JavaScript engines are

V8 - used in chrome, Microsoft edge, Opera, Node.js etc.
SpiderMonkey - used in Firefox
JavaScript Core - used in Safari
All the programming languages were developed with a specific purpose.

JavaScript for the browser

PHP for web server

Swift for IOS applications

etc.

With introduction of Node.js, JavaScript become a backend language as well. Node.js was built on top the v8 engine which already supported JavaScript. What makes Node.js standout is it's non-blocking I/O model which makes it efficient, Node.js can asynchronously continue executing code while listening for other events.

If you are someone new to the world of programming, you could build full stack web applications with the knowledge of one language. Also front-end developers who primarily use JavaScript can work on the backend without learning a new language.

Finally I want to leave this famous quote by Jeff Attwood also known as the Atwood's Law.

> Atwood's Law: any application that can be written in JavaScript, will eventually be written in JavaScript
Get started with Spring Boot Application Development
Tags: spring, java, developer, programming
Published: 2022-05-29 02:44:18


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


 Spring Boot is the world’s leading Java web framework. It’s open source, microservices-based, and helps developers to build scalable Java apps. Developers love Spring because of its auto-configuration, embedded servers, and simplified dependency management. It helps development teams create services faster and more efficiently. Accordingly, users spend very little time on initial setup. That includes downloading essential packages or application servers.

The biggest challenge that developers face with Spring Boot is concurrency — or the need to do too many things simultaneously. Spring Boot may also unnecessarily increase the deployment binary size with unused dependencies. This creates bloated JARs that may increase your overall application footprint while impacting performance. Other challenges include a high learning curve and complexity while building a customized logging mechanism.

How can you offset these drawbacks? Docker simplifies and accelerates your workflows by letting you freely innovate with your choice of tools, application stacks, and deployment environments for each project. You can run your Spring Boot artifact directly within Docker containers. This is useful when you need to quickly create microservices. Let’s see this process in action.

[Read the complete blog](https://www.docker.com/blog/kickstart-your-spring-boot-application-development/)
DEV needs a CSS check!
Tags: dev, watercooler, css, html
Published: 2022-05-29 01:39:37

So I recently got a comment from someone recently, helping me.
And they provided this really long codeblock.
And I first noticed this when I was looking at the notification, but the bug appears both when viewing the comment in notifications AND inline.
![Viewing the comment directly. - `https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w686rhkw7c3f0tlzbc5o.png`](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w686rhkw7c3f0tlzbc5o.png)
![Viewing the comment via the "Notifications" page. - `https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3fr1duclunjuybp5ag13.png`](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3fr1duclunjuybp5ag13.png)
The New Freelance Platform
Tags: webdev, programming, freelance, productivity
Published: 2022-05-28 23:25:16

{% embed https://www.youtube.com/watch?v=N-XA3-PAkvw %}
Join ihireDevelopers! A new platform for Freelancers and Freelance Groups. With industries expanding all the way from Programmers, Artists, Modelers, Animators, Video Editors, Graphic Designers and more coming soon. Money made on our platform is processed to make sure the transaction was safe and secure and if something goes wrong when you hire someone you will get your money refunded. Check the website out here [https://ihiredevs.com] (url)
How To Split A Git Commit Into Multiple Ones?
Tags: git, tutorial
Published: 2022-05-28 23:01:02

Sometimes, a developer might want to split a git commit into multiple ones. The reason for splitting a commit is typically to make the git history more readable or to reorder the commits to avoid conflicts. Luckily, this operation is possible using the reset command or an interactive rebase.

Let's get to it 😎.

![git commit split](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ycrd5146bfivf3puq2sg.jpg) 

## Preparation

The first thing to do is make sure you don't have any changes in your working directory.

This can be done using the [git status](https://timmousk.com/blog/git-status/) command.

When running this command in the terminal, it should show no files. If it does show files, you will need to either commit the changes or discard them.

## How to split the most recent commit?

To split the most recent commit, use the `git reset` command to revert the latest commit.

```bash
git reset HEAD~
```

> `HEAD` refers to the current branch. 
> `HEAD~` refers to the latest commit.

Then, create different commits with the desired files and messages and push them to the remote.

But what if the commit you want to split is not the latest one? 

Easy. Use interactive rebasing.

![interactive rebase](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dn8ceha07flr3ds3128t.jpg) 

## How to split a commit farther back?

You need to rewrite the git history with an interactive rebase to split a commit farther back.

1 - First, find the commit hash with the `git reflog` command.

2 - Then use the `git rebase` command with the commit's hash:

```bash
git rebase -i HASH
```

3 - In the rebase edit screen, find the line with the commit that you want to split and replace `pick` with `edit`.

4 - Save and exit the rebase edit screen.

5 - Reset the state to the previous commit with:

```bash
git reset HEAD~
```

6 - Create different commits with the desired files and messages.

7 - Finish the rebase by typing this command:

```bash
git rebase --continue
```

> If something goes wrong, you can [abort the rebase](https://timmousk.com/blog/git-rebase-abort/) and start over by using the `git rebase --abort` command.

## Conclusion

As you can see, it is easy to split a commit into multiple ones.

However, note that you will need to use the `git push --force` command if you have already pushed to a remote.

![git split commit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fppro7oxeg06kc0zl95l.jpg)
 

Here are some other Git tutorials that I wrote for you to enjoy:

- [How to push an empty git commit?](https://timmousk.com/blog/git-empty-commit/)
- [How to fix "git pre-receive hook declined"?](https://timmousk.com/blog/git-pre-receive-hook-declined/)
- [Delete a remote or local tag in Git](https://timmousk.com/blog/git-delete-tag/)
- [The complete guide on Git tags](https://timmousk.com/blog/git-tag/)
- [How to uncommit your changes in git?](https://timmousk.com/blog/git-uncommit/)
Pop the bubbles! Three.js scene
Tags: codepen
Published: 2022-05-28 22:58:15

<p>Having fun with the raycaster! ^^</p>

<p>Inspired by: <a href="https://www.instagram.com/p/B81yhq1nwHz/" target="_blank">https://www.instagram.com/p/B81yhq1nwHz/</a></p>

{% codepen https://codepen.io/stivaliserna/pen/GRNxGrR %}
Day 50: Hello Tailwind!
Published: 2022-05-28 22:55:52

Hi!
So today I was back to work and I got started configuring Tailwind in my project and I got a chance to learn about PostCSS and it's plugins but currently I have Tailwind configured but not fully working as expected. I noticed that I still need some time to get back into the coding mood 100% after the past few days but I will get there definitely. The plan for tomorrow is to fix whatever making issue with Tailwind probably prepare an article which I hope It won't be long so can be done in a single day, hopefully get started with the real implementations.

So Day 50! unbelievable! I may have learned a lot in the past 50 Days than any other period of my career I plan to make a proper formal separated article about some benefits and challenges I realized during this journey maybe I will do it properly on day 60 but this is really good! I'm  proud!
Signing off...
[3D] Synth Canyon Run
Tags: codepen
Published: 2022-05-28 22:53:10

<p>I wanted to do some experimentation with manipulating geometries and layering several simple shader effects, and this is what I came up with. Enjoy!</p>

<p>The Soundcloud embed is just there for ambiance. Not my music; just something that seemed fitting.</p>

{% codepen https://codepen.io/jhnsnc/pen/GRJeOWZ %}
three.js - flame shader
Tags: codepen
Published: 2022-05-28 22:50:53

<p>inspired by <a href="https://twitter.com/ciaccodavide/status/964407412634472448" target="_blank">https://twitter.com/ciaccodavide/status/964407412634472448</a></p>

{% codepen https://codepen.io/ClementRoche/pen/VJpOWG %}
Checkbox group styled as tiles
Tags: codepen
Published: 2022-05-28 22:42:54

<p>A demonstration of how to create checkboxes that doesn't necessarily looks like... well, checkboxes. </p>

<p>Icons by <a href="https://phosphoricons.com/" target="_blank">https://phosphoricons.com/</a> </p>

{% codepen https://codepen.io/havardob/pen/BapJYMg %}
Dark UI - Bank dashboard concept
Tags: codepen
Published: 2022-05-28 22:38:21

<p>A recreation of this Dribbble shot: <a href="https://dribbble.com/shots/16755073-Almeria-Neobank-Dashboard/attachments/11802960?mode=media" target="_blank">https://dribbble.com/shots/16755073-Almeria-Neobank-Dashboard/attachments/11802960?mode=media</a> </p>

{% codepen https://codepen.io/havardob/pen/ExvwGBr %}
Customer Management UI
Tags: codepen
Published: 2022-05-28 22:37:08

<p>Inspired by  Shuvo Cold
"<a href="https://dribbble.com/shots/14673441-Transport-Service-Dashboard" target="_blank">https://dribbble.com/shots/14673441-Transport-Service-Dashboard</a>"</p>

{% codepen https://codepen.io/TurkAysenur/pen/NWRqoyL %}
Glassmorphism Creative Cloud App Redesign
Tags: codepen
Published: 2022-05-28 22:26:56

<p>Inspired by Mikołaj Gałęziowski
"<a href="https://dribbble.com/shots/14831798-Glassmorphism-Big-Sur-Creative-Cloud-App-Redesign" target="_blank">https://dribbble.com/shots/14831798-Glassmorphism-Big-Sur-Creative-Cloud-App-Redesign</a>"</p>

{% codepen https://codepen.io/TurkAysenur/pen/ZEpxeYm %}
UI04
Tags: codepen
Published: 2022-05-28 22:21:32

<p>A dashboard concept designed by Jordan Hughes: <a href="https://dribbble.com/shots/16506804/attachments/11468776?mode=media" target="_blank">https://dribbble.com/shots/16506804/attachments/11468776?mode=media</a></p>

<p>Icons from <a href="https://phosphoricons.com/" target="_blank">https://phosphoricons.com/</a></p>

<p>Logos from <a href="https://worldvectorlogo.com/" target="_blank">https://worldvectorlogo.com/</a></p>

{% codepen https://codepen.io/havardob/pen/jOwJWOG %}
UI03
Tags: codepen
Published: 2022-05-28 22:18:36

<p>Inspired by: <a href="https://dribbble.com/shots/15346148-Product-List" target="_blank">https://dribbble.com/shots/15346148-Product-List</a></p>

{% codepen https://codepen.io/aybukeceylan/pen/PopNYeJ %}
React Color Gradients
Tags: codepen
Published: 2022-05-28 22:09:47

<p>React Gradients</p>

<p>Inspired by <a href="https://dribbble.com/shots/13662178-Gradients" target="_blank">https://dribbble.com/shots/13662178-Gradients</a></p>

{% codepen https://codepen.io/rogerlu0818/pen/GRQQmLX %}