teleren/devto huggingface dataset:
How to get or list all the users in Linux?
Tags: resource
Published: 2021-07-28 00:00:00

---
  title: How to get or list all the users in Linux?
  published: true
  tags: Resource
  date: Wed Jul 28 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/get-or-list-all-users-in-linux
  cover_image: https://melvingeorge.me/_next/static/images/main-708d87dd925108f3f9fb7512958860b8.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/get-or-list-all-users-in-linux)
  
To list all the users, we can view all the users stored inside of the `/etc/passwd` file using the `cut` command. The `/etc/passwd` stores all the login information of all the users in Linux.

### TL;DR

```bash
# List all users in Linux
cut -d : -f 1 /etc/passwd

# OUTPUT
# ------
#
# root
# daemon
# _uucp
# ...
# ...
# ...
```

The `/etc/passwd` is the file in Linux, which stores the information regarding all the users. It is used more while a user is logging into the Linux system.

If we try to view the contents of the `/etc/passwd` file usign the `cat /etc/passwd` command, we would get an output something like this,

```bash
# Example of contents inside the /etc/passwd file
root:*:0:0:System Administrator:/var/root:/bin/sh
_mcxalr:*:54:54:MCX AppLaunch:/var/empty:/usr/bin/false
_appleevents:*:55:55:AppleEvents Daemon:/var/empty:/usr/bin/false
.....
.....
.....
```

This may look daunting at first 🤯, but the information we need is only the names of all the users in Linux. If we look closely at the second line in the above output which is,

```bash
root:*:0:0:System Administrator:/var/root:/bin/sh
# "root" is one of the users in this Linux system
```

The name of a single user is defined before the first occurrence of the `:` (colon character), which is the `root`. So `root` is a single user in the system. Like that, every single line inside the `/etc/passwd` file has the information of a single user in the Linux system.

Now instead of trying to get the output in an unreadable format, let's make this entire thing into a human-readable format using the `cut` command where we will get only the name of the users in Linux.

To do that first, we can use the `cut` command followed by the delimiter flag (`-d`) then pass the delimiter which is the colon character (`:`) then the field selection flag (`-f`) then selecting the first field of `1` and then the name of the file which is the `/etc/passwd` file.

So in the end, the `cut` command will look like this,

```bash
# List all users in Linux
cut -d : -f 1 /etc/passwd
```

and the output will be in a human-readable format only showing the users in the Linux system.

It will look like this,

```bash

# Output of the above command
# ---------------------------
#
# root
# daemon
# _uucp
# ...
# ...
# ...
```

See the execution of the above command live in [repl.it](https://replit.com/@melvin2016/list-all-the-users-in-the-linux#main.sh).

That's all 😃!

### Feel free to share if you found this useful 😃.

---
I'm just a girl, in front of a computer, trying to fix a bug.
Tags: womenintech, girlcodes, begginers, introduction
Published: 2021-07-27 23:15:07

Once, I read in a book that I don't remember, when we decide not to share what we do, because of shame or fear, we are stealing something that is valuable from the world.

That makes me think... What would have happened if Ada Lovelace hadn't shared her love of mathematics, even if the world wasn't so fair to her?

What would have happened if Katherine Johnson had not dared to share her knowledge and her passion for numbers? In such a hostile environment!

What would have happened if … Such a question!

So let's start sharing with love what we are and what we have to give to the world. 

If there's one thing I consider myself terrible at, it's presentations. But here I go: I'm Anto, I'm 26 years old and I love to explore, innovate and create new things. I’m a Software Engineer from Santa Fe, Argentina.

I am currently working as a developer (and in constant training). I love animals. I love reading. I am a fan of TV series. I fight for a more diverse and inclusive world. In a world of ones and zeros, we have to go for diversity.. 
My hair is generally a mess. I am a fan of beer. I like to take pictures of nature and look at the moon.

I'm here to improve my skills, to broaden my knowledge about software development and to improve my English, of course (actually, I started blogging to improve my English. So, sorry for the mistakes). Also, to sharing my knowledge and learning with you.

And what about you? 😊
Learn F# this week with Free Events & Live Streams
Tags: fsharp, dotnet, beginners
Published: 2021-07-27 22:18:35

There are several upcoming events and live streams focus on all things [F#](https://dotnet.microsoft.com/languages/fsharp), an open-source language that makes it easy to write succinct, robust, and performant code. Check them out!

# [.NET Conf - Focus on F#](https://focus.dotnetconf.net/)

{% youtube i3qEhwcG7ps %}

.NET Conf: Focus on F# is a free, one-day livestream event that features speakers from the community and Microsoft teams working on and using the F# language. Learn how F# lets you write succinct, performant, and robust code backed by a powerful type system and the .NET runtime you can trust to build mission-critical software.

Hear from language designers and experts using F# in a variety of ways from building minimal web APIs to performing data manipulation, interactive programming, machine learning, and data science.

## When
**Thursday July 29th 08:00 (PT) | 15:00 (UTC)**

## Where
Tune in at [https://focus.dotnetconf.net/](https://focus.dotnetconf.net/) on July 29, ask questions live, and learn about what F# can do.

## Agenda 
Browse the full agenda for the 8 hours event at  [https://focus.dotnetconf.net/agenda](https://focus.dotnetconf.net/agenda)

# [Let's Learn .NET - F#](https://aka.ms/letslearndotnet)

{% youtube u92dj5h4nrA %}

[Let's Learn .NET](https://aka.ms/letslearndotnet) is a monthly beginner series that walk through the fundamentals of F# (pronounced “F-sharp”). F# is a functional programming language that runs on .NET and supports object-oriented programming. The type system and unique features of this language make a great fit for data science and ML. Come learn something new and leave with something that we all built together, live with experts. Streaming LIVE on Learn TV!

## When
**Friday, July 30th at 8:30 AM - 10:30 AM (PT) | 15:30 - 17:30 (UTC)**

## Where

Streaming live for FREE on [Microsoft Learn TV](https://docs.microsoft.com/learn/tv/?WT.mc_id=dotnet-17847-jasingl). Sign-in, ask questions, and learn how to start building accessible apps.

## Agenda
Come learn something new and leave with something that we all built, together, live with experts. Here is the agenda for the event:

* Introductions: Meet the team!
* Fundamentals: [Introduction to F#](https://aka.ms/Fsharp_Resources) (20 mins)
* Workshop I: [F# - Hello World](https://dotnet.microsoft.com/learn/languages/fsharp-hello-world-tutorial/intro/?WT.mc_id=dotnet-29448-jasingl)
* Q&A (10 mins): Get your questions answered live!
* Workshop II (35 mins): [Introduction to Funcational Programming](https://docs.microsoft.com/dotnet/fsharp/introduction-to-functional-programming/?WT.mc_id=dotnet-29448-jasingl)
* Q&A (10 mins): Get your questions answered live!

## RSVP Today
Head to [aka.ms/letslearndotnet](https://aka.ms/letslearndotnet) to RSVP today!

## Looking for more?
- [F#resources](https://aka.ms/Fsharp_Resources)
- [.NET 101 Videos](http://dot.net/videos)
Day 417 : Still Broke
Tags: hiphop, code, coding, lifelongdev
Published: 2021-07-27 22:05:49

_liner notes_:
- Professional : Pretty chill day. Had a meeting. Worked on a blog post and worked on a demo. Pretty much it.

- Personal : Last night, I finished up the dashboard to be able to get the video details from the API and save it to the database. I just need to be able to list it out in the dashboard and then also in the front page of the site. I watched an episode of "Fire Force" and went through some tracks for the radio show. Oh and I also fixed the issue I had with https://otech.events not updating but just upgrading the version of Node since the one I used when creating the application originally is deprecated. I'm also researching on where else I can invest my money. I have a good amount in a savings account and a small amount in stocks because I live like I'm still broke haha in addition to stuff from work, but I'm looking to see what else is out there. 

![A very lush green jungle with a lot of trees and a waterfall.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9t3ozchi47hpoj5k4pjq.jpg)

Going to get the data that I saved to the database to show up in the dashboard and on the video details page of the website. After that, I want to go through some tracks for the radio show. Of course, watch an episode of "Fire Force". I have so many episodes to catch up on. Oh and a think I ordered for the van build came in so I'll be checking that out. Think that's it. I'm out!

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube mX4h4xN1dsk %}
useful array methods
Published: 2021-07-27 22:01:54

Map

Contains

Reduce

Filter

forEach - ``` 
var test = [5, 6, 2]


var maxNumDeclarative = function(array) {
  // your code here
  var maxi = array[0]
  

  array.forEach((item) => { 
    if (item > maxi) 
    maxi = item;
   })


  // array.forEach(function (item) {
  //   if (item > maxi) {
  //     maxi = item;
  //   }
  // })

  
  return maxi;
};

maxNumDeclarative(test); ```
Managing packages on Windows 10
Tags: beginners, codenewbie, productivity, news
Published: 2021-07-27 21:39:24

For many years I used the Linux system and now I'm using Windows. I came across difficulties in installing many programs without having any automation in this process. Search about and I found the [community chocolatey](https://community.chocolatey.org/) that say have the largest registry of Windows packages. They are similar to the **apt** in Linux and **homebrew** in MacOs, the Chocolaty it suits for manager packages for windows, it's amazing.

To install firstly, you have to open your terminal preferably the **PowerShell** and enable permission with the command.

```Java
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
```

It's will enable that chocolaty can install and manage packages on your machine. Read [this](https://docs.microsoft.com/pt-br/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1) for knew more

In the second step, you will run this command:

```Java
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
```

This command will install in your machine the Chocolaty and dependencies that are necessary, if all occurs well, you must execute this command in your terminal.

```Java
choco or choco -
```

This command will show all options for using the Chocolaty.

Now, with Chocolaty installed can create files (.ps1) for automation of installation of programs with the example below.

```Java
"Installing program anki"
sleep(2)
choco install anki
sleep(2)
cls


"Installing program VLC"
sleep(2)
choco install vlc
sleep(2)
cls
```

In this example, was installed Anki and VLC for my studies.

This program is very good for avoiding searching the packages .exe for install and facilitating the installation of many packages the once, and others management in the system.
Top 7 Featured DEV Posts from the Past Week
Tags: top7
Published: 2021-07-27 21:17:34

---
title: Top 7 Featured DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---
_Every Tuesday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week._ 


## Embracing your unique learning style

@naalaryea is doing exactly that! Don't miss this inspiring look inside one developer's journey with ADHD and learning software development. 

{% link https://dev.to/naalaryea/my-learning-styles-as-a-software-developer-with-adhd-3m83 %}

## Slowing down to go faster and other tech lead insights

@dvddpl recently switched from being an engineer to a tech lead, and while a lot of their responsibilities remained the same, they had to undergo a shift in how they approached their work. Great read!

{% link https://dev.to/dvddpl/from-engineer-to-tech-lead-doubts-and-challenges-4n9e %}


## Finding the business case

If you've ever struggled to identify the business use-case for your app, this post by @kritika27 is a nice starting point.

{% link https://dev.to/kritika27/how-to-think-while-building-applications-13eh %}

## Git-ing a solid foundation for the rest of your career

@anaveecodes is here to help you get a bit more familiar with git, regardless of your level. Why? Because visiting or revisiting those introductory git concepts helps with so many other areas of development — and can even help you stand out in an interview. 

{% link https://dev.to/anaveecodes/how-to-get-better-with-git-25d1 %}

## Getting closure

With closures in JS, that is! @amrtaher1234 wishes that someone explained this concept in simpler terms 

{% link https://dev.to/amrtaher1234/closures-and-their-practical-uses-19fm %}

## Intermediate Python, from tuples to encapsulation

Are you past the novice stage but not quite an expert when it comes to Python? @grayhat could be a great resource for you! This post covers the basics of a handful of "level 2" Python concepts. Take a look 👀 

{% link https://dev.to/grayhat/python-102-introduction-to-python-intermediate-concepts-1881 %}

## Portfolio Perspective

@silviaespanagil knows that while a portfolio is meant to show _other_ people your skills, it's also a great learning experience for _you_ if you have the right mindset. 

{% link https://dev.to/silviaespanagil/things-i-learned-doing-my-portfolio-1he6 %}



_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Tuesday!_
Github Action for Gatsby Publish
Tags: gatsby, github, devops
Published: 2021-07-27 21:29:22

## Why?
The gatsby template includes scripting to deploy from whereever you cloned your code.  It works just fine and is reliable when everything is set up on my machine.  The package.json includes the deploy script:

```javascript
  "scripts": {
      ...
    "deploy": "gatsby build --prefix-paths && gh-pages -d public"
  },
  ```

However, there are 2 drawbacks for my workflow (and my goal to start writing more):

1. You can deploy without a commit and push to the repository
1. You can't deploy without running the deploy script, so any work on the site on Github or my iPad won't get deployed until I commit and push on one device and then pull and deploy to the same repo on my computer.  Ain't nobody got time for that.

I was using a Github Action for my Jekyll site, prior to moving to Gatsby, and that worked when I pushed to branch and kickoff the publish action.  This action was a bit more involved as I was using Azure for a host and it required a few more configuration hurdles to set it up.

For my current site, I thought it has to be pretty simple - push to main branch, trigger an action, copy to gh-pages branch and that's that.  Turns out, that is that and I was able to get it working pretty fast.

I documented my steps in case I need to go back and change anything - e.g. I would like to update the siteMetadata.version in the gatsby-config.js file at some point.  Here are the steps

## Steps to publish a Gatsby site to gh-pages 


1. Create a new workflow in the repository Actions section

``` yaml
name: Gatsby Publish

on:
  push:
    branches:
      main

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: enriikke/gatsby-gh-pages-action@v2
        with:
          access-token: ${{ secrets.ACCESS_TOKEN }}
          deploy-branch: gh-pages
```

2. Create a personal access token (PAT), select the *repo* permission.

    [Authentication in a Github Action Workflow](https://docs.github.com/en/actions/reference/authentication-in-a-workflow)

3. Create a Secret in the repo: ACCESS_TOKEN and use the new PAT token (note the workflow YAML file specifies the ACCESS_TOKEN parameter).

4. Build should kick in and go green

5. Profit?

    And lo and behold, my site is passing (hopefully this shows it's passing):
    [![Gatsby Publish](https://github.com/roxberry/gatsby-roxberry/actions/workflows/main.yml/badge.svg)](https://github.com/roxberry/gatsby-roxberry/actions/workflows/main.yml)


## Next things

- [ ] Improve this post with images from Github
- [ ] Add embedded gist for the main.yml
- [ ] Config version update (need to think about - should only happen on non posts)
- [ ] Create a tweet with the title if a post

https://gist.github.com/roxberry/f6f58e2212346fd8c699c1d8c8cf8bcf.js
Dev Note - HttpClient in Salesforce Commerce Cloud  SFRA
Tags: sfcc, sfra, javascript, salesforce
Published: 2021-07-27 21:26:02

## Using HttpClient in Salesforce Commerce Cloud

I needed a quick way to get a model for a view.  For our API calls, I created services, profiles and credentials that are managed by SFCC.  But that's overkill for a one off call.  HttpClient is a way to make external calls, in SFCC/SFRA there's a little twist.  Code to use the TypeScript HTTPClient in cartridge code:

```javascript
function callExternalUrl(parameters) {
    var HTTPClient = require('dw/net/HTTPClient');
    var Logger = require('dw/system/Logger');

    if (!empty(parameters)) {
        var url = parameters.url;
        var userId = parameters.userId;
        var password = parameters.password;

        var httpClient = new HTTPClient();
        httpClient.setTimeout(2000);
        httpClient.open("GET", url, userId, password);
        httpClient.send();

        if (httpClient.statusCode == 200) {
            //confirm response
            Logger.getLogger("shop").info(
                httpClient.text
            );

            // do something with response object
            // var sourceObject = JSON.parse(httpClient.text);

            }
        } else {
            // error handling
            Logger.getLogger("shop").error(
                "An error occured with status code " + 
                httpClient.statusCode
            );
        }
    }

// ...
// var parameters = {
//     url: "",
//     userId: "",
//     password: ""
// }
// callExternalUrl(parameters)
```
What I learned from CREATIVITY, PIXAR Director's Book
Tags: reading, improvement, lessons, life
Published: 2021-07-27 21:20:52

This is indeed an amazing book! I have enjoyed reading every single page!

Many topics such as:

* How Computer Graphics got its beginnings and evolution
* How technology and art can co-exists
* How it is like going from a research team to build a company
* How PIXAR started (and where the name comes from)
* How to handle honesty <> candor! Importance of feedback
* Creating a workspace that inspire for creativity
* Involving your thousands employees into important decisions from the company
* Not loosing the company’s culture even if you were bought (Disney bought it)
* The importance about the tech people “building up” the movie getting involve into the whole process of development of the movie’s “story”

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

* Never lower your quality and excellence! (this was greeatly explained when they faced the challenge to come up with Toy Story 2, for example)

* Team work! Really important… build a great team! and people > ideas
*“give an idea to a mediocre team, they will destroy it; give any idea to a brilliant team and they will surprise you”*

and yeah… overall how to deal with Steve Jobs 🤓

Psss The name “Pixar” comes from a combination of “radar” and “pixer,” a made-up Spanish word.
Threshold Experiments for  scene change detector
Published: 2021-07-27 20:48:17

### Fast version's threshold
I experimented with threshold of the fast version of the algorithm:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a7pqtopbqtyxov48902z.png)
This picture shows F score on testing dataset, X axis shows the number of the video, the Y axis - F score on this video. Lines represents different versions of the algorithm according to the legend.
It can be seen that increasing the threshold value improves the F score of the algorithm and does not affect the processing speed.

Here is the table of mean F score on datasets for different versions:

| Version | F score on BBC Planet Earth|F score on open source videos|
| --- | ---:| ---:|
|Fast with thr = 12 (current)|0.5939|0.6011|
|Fast with thr = 15 |0.6490|0.6361|
|Fast with thr = 16 |0.6961|0.6375|
|Fast with thr = 17 |0.7393|0.6623|
|Fast with thr = 18 |0.7441|0.6652|
|Fast with thr = 20 |0.7795|0.6244|
|Slow |0.7024|0.5628|
|Slow improved|0.8081|0.6515|

I chose optimal value of the threshold as 18.

### Slow version's threshold

After experiments, the threshold for slow version was reduced by a factor of 2.2. Here you can see charts of performance (F score, precision and recall) of the algorith depending on the threshold reduction factor. These results were obtained with open-sourced videos from youtube.com and vimeo.com
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ttodfkd2sku61basvx57.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/747caqwhnz1q2em3yt2t.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ma8vfvjv6z2n8q4efgb3.png)

Here also the results on BBC Planet Earth datset:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rva4r30vpwrbpl0temb4.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ilmo9bhgq93ce94qh9rd.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7keabmbbpvj32i5t5mek.png)
And precision-recall curve:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emvqhgte8av30aywh7ok.png)


### Improvement of the metric
To make the peaks of the metric more distinguishable for the threshold, I applied numerical differentiation to its values. Here is the example of the outcome on one of the videos:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vhm4qvkq2blgohnvsjmg.png)
The top picture shows original metric values, the bottom one shows metric after improvement. 
You can see that the peaks with the scene changes became more distinct, so the threshold is easier to tune.
Need your Help to Optimize WordPress Website's Speed.
Tags: wordpress, website, speedoptimization, help
Published: 2021-07-27 20:07:16

H there,
I just build a website about Juicers Blenders https://juicersblenders.org/ on WordPress. I upload theme set up everything very well. I starts working and doing good so far. But when I open my website on mobile it  takes more loading time then Laptop or PC. 
I read somewhere that it's because of Load time. Now I have 2 problems.
1.How to find out the load time, is there any free tool for that?
2.How to fix that?

Kindly let me know if you can help me with this.
Cheers