teleren/devto huggingface dataset:
How to set an expiry date for a user account in Linux?
Tags: resource
Published: 2021-08-01 00:00:00

---
  title: How to set an expiry date for a user account in Linux?
  published: true
  tags: Resource
  date: Sun Aug 01 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/set-expiry-date-for-user-account-linux
  cover_image: https://melvingeorge.me/_next/static/images/main-cdccf9feed285d265e43411a8147a94c.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/set-expiry-date-for-user-account-linux)
  
To set an expiry date for a specific user, you can use the `usermod` command followed by the `-e` flag (expiry flag), then the expiry date in `YYYY-MM-DD` format, and then the name of the user to set the expiry date in Linux.

As an example, suppose we have a user called `John`, and we want to set the expiration date for this user account to `12th March 2022`. Thus, when expressed in the `YYYY-MM-DD` format, it would be `2022-03-12`.

Now let's use the `usermod` to set the expiration date. it can be done like this,

```bash
# Set an expiry date for a user account
# In our example, the expiry date
# is 12th March 2022 for the user 'john'
sudo usermod -e 2022-03-12 john
```

- Sometimes you may need to use the `sudo` command before the `usermod` command to obtain the correct privileges to execute the command.

Now to verify whether the expiration date is set correctly, you can use the `chage -l` command followed by the name of the user in Linux. It can be like this,

```bash
# View user account expiry information
chage -l john
```

The output of the above command may look like this,

![chage linux command output](https://melvingeorge.me/_next/static/images/chage-linux-command-output-1bd44425bb83b4c7324026972e754662.png)

Yay 🎉! We have successfully set an expiration date for the user account `john`.

Try executing the above commands in this [online terminal](https://copy.sh/v86/?profile=archlinux) to see the results.

That's all 😃!

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

---
Why are you doing that?
Tags: okr, outcome
Published: 2021-08-03 10:20:54

---
title: Why are you doing that?
published: true
date: 2021-08-01 00:00:00 UTC
tags: okr,outcome
canonical_url: https://jhall.io/archive/2021/08/01/why-are-you-doing-that/
---

What did you work on last week? What feature did you add, or what problem did you solve at work? Take a moment to remember…

Now can you answer: **Why?**

“Because the task was assigned to me” doesn’t count. Why was that task assigned to you, or even created, in the first place?

What _business value_ is that task expected to bring? What _outcome_ does it aim to achieve?

“It improves the user experience” or “It improves performance” or “A customer requested it” don’t count either.

How do you know that it improves user experience or performance? And even if it does, who cares? And who cares if a customer requested it. Customers request are [often ridiculous](https://devrant.com/rants/950161/our-website-doesnt-look-the-same-on-phone-and-desktop-please-remove-responsivnes).

Of course improving user experience and peformance, and sometimes implementing feature requests can be good things. But they must be in service of a desired business outcome. “Better user experience”, “better performance” and “new features” are not business outcomes. They are tactics. Choosing which tacticts to employ is the hard part.

To do that, first identify the business outcome you’re hoping to achieve. Joshua Seiden, author of [_Outcomes Over Output_]https://amzn.to/2VezwBo() defines an outcome as “a change in human behavior that drives business results.”

If “more subscriptions” or “reduce costs” or “fewer customer service calls” are your target business results, then our previously mentioned activites might be appropriate:

- If improving user experience leads to more users signing up, then it’s worth while. If it just leads to a warmer, fuzzier feeling in the customers (or more likely, the designers), it’s not worth it.
- If improving performance means you need fewer EC2 instances, then it’s worth while. If it just means your login page does one fewer database queries, and now loads 0.0003s faster, it’s not worth it.
- If implementing a feature request means that fewer customers will call customer service, it’s worth it. If it means some customer [was “just wondering”](https://youtu.be/3CkIMUbQY1M?t=1862), it’s not worth it.

Make sure you understand the business outcome your work is aiming to achieve. And if you can’t determine this, I encourage you to push back. Do your best work, by working on what matters most!

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
API REST ?
Tags: api, rest, http, web
Published: 2021-07-31 23:35:01

## Mas e o protocolo HTTP que é a base para a API REST você conhece ?

### O Protocolo

**API** = Application Programming Interface
**REST** = Representational State Transfer

Basicamente a API REST foi criada para possibilitar a comunicação entre sistemas, e para que seja possível essa comunicação precisamos de um Protocolo, e é ai que entra o HTTP.

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

**HTTP** utiliza o modelo Cliente-Servidor, como a maioria dos protocolos de rede, baseando-se no paradigma de **Requisição** e **Resposta**. 

Um programa requisitante (Cliente) estabelece uma conexão com um outro programa receptor (Servidor) e envia-lhe uma requisição, contendo a **URI**, a versão do protocolo, uma mensagem **MIME** contendo os modificadores da requisição, informações sobre o cliente e, possivelmente, o conteúdo no corpo da mensagem.

O Servidor processa a Requisição(Request) e Responde(Responnse) com um **Status** incluindo sua versão de protocolo e com os códigos de erro informando se a operação foi bem sucedida ou não.
Após o envio da resposta pelo servidor, encerra-se a conexão estabelecida.

### A Mensagem

Uma **Mensagem**, tanto de Requisição(Request) quanto de Resposta(Response), é composta por: Cabeçalhos(**header**) e Corpo(**body**). 

Toda Requisição(**Request**) é enviada através de um Comando ou Métodos HTTP e os mais comum são:
- POST
- GET
- PUT
- PATCH
- DELETE

Toda Resposta(**Response**) segue com um Código de Estado(HTTP **Status**) exemplos: 
- 200(OK)
- 404(Not Found)
- 500(Internal Server Error) 

### Content-Type

Quando uma mensagem HTTP tiver um corpo, poderão ser incluídos cabeçalhos de entidades que descrevem suas características, como por exemplo, o **Content-Type** que informa o tipo **MIME** dos dados no corpo da mensagem. 
Alguns tipos MIME:
- text/plain(Arquivo no formato **Texto** ASCII)
- text/html(Arquivo no formato **HTML**, utilizado como padrão para documentos Web)
- image/gif(Imagem no formato **GIF**)
- image/jpeg(Imagem no formato **JPEG**)
- application/zip(Arquivo compactado)
- application/json(Arquivo no formato **JSON**)
- application/xml(Arquivo no formato **XML**)

> O formato **application/json** é um formato muito utilizado em **API REST**.

### Conceitos

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

A intenção aqui foi fazer apenas uma breve abordagem sobre os **Conceitos** por traz de **API REST**.

Entendendo a base **HTTP** e o problema que a **API REST** se propõe a resolver, conseguimos utilizar as _Linguagens_ de _Programação_ e Frameworks de fato como ferramentas para resolvermos um problema.

E a base sempre será a mesma independente de _Linguagem_ ou _Framework_.

Deixei seu comentário sobre o que achou do Post, compartilhe em suas redes e ajude a fortalecer uma comunidade onde **juntos somos mais fortes**! 

![person3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gm5rca7b8z58f2wr8d1s.png)
tsParticles 1.33.2 Released
Tags: showdev, javascript, webdev, html
Published: 2021-07-31 23:34:00

# tsParticles 1.33.2 Changelog

## New Features

- Added spin movement options
- Bubble color can now be mixed with the original one to have a smoother effect

## Improvements

- Added resize observer, this will replace window.resize if available

## Bug Fixes

- Fixed images shape options
- Fixed broken movement after 1.31
- Fixed frozen frames (more than 1 second), this will fix the issue with pause on blur
- Fixed svelte component
- Improved Absorbers
- Improved Orbits

{% github matteobruni/tsparticles %}
Developers needed for pre-seed Startup (Handsome equity)
Tags: startup, blockchain, javascript, database
Published: 2021-07-31 23:32:19

Seeking a variety of devs to help support a unique global project in Money Remittance. The MVP is ready, but needs to be tested and supported post launch. 

The tech stack is React/Redux, React Native, Javascript, Mongo DB, AWS. 

If interested, please feel free to reach me at:

Email: tochie@ziwwe.com

Regards,

Tochi
Founder, https://ziwwe.com
Functions in javascript 
Tags: javascript, webdev, codenewbie
Published: 2021-07-31 23:23:11

**Functions:-**Functions in JavaScript provide organized, reusable code to perform a set of actions. Functions simplify the coding
process, prevent redundant logic, and make code easier to follow.

####1.Named Function
```javascript
function myfunction(){
    console.log('Budddhadeb Chhetri');
   }
myFunction(); //Prints: Buddhadeb Chhetri
```
####2.Named Function with arguments
```javascript
function myFunction(parameter){ 
   console.log('parameter');                                                       
  }
myFunction(10); //Prints:10
```
####3.Anonymous function
```javascript
const myFunction =function(){
   console.log('Buddhadeb Chhetri');
}
myFunction(); //Prints: Buddhadeb Chhetri
```
####4.Anonymous function with arguments
```javascript
const myFunction = function(parameter){
  console.log (parameter);
}
myFunction(10); //Prints: 10
```
####5.Arrow function with no argument
```javascript
const myFunction = ()=>{
  console.log ('Buddhadeb');
}
myFunction(); //Prints: Buddhadeb
```
####6.Arrow function with a single argument 
```javascript
const myFunction = parameter()=>{
  console.log (parameter);
}
myFunction(20); //Prints: 20
```
####7.Arrow function with a two arguments 
```javascript
const mysum = (param1,param2)=>{
  console.log (param1+param2);
}
myFunction(2,5); //Prints: 7
```
####8.Concise arrow funtion with arguments
```javascript
const mySum = (a,b)=>a+b;
console.log (2,5); //Prints: 7
```
Datastax AppDev Series
Tags: jamstack, node, react, astradb
Published: 2021-07-31 22:57:51

I had a awesome time during the #DatastaxAppDevSeries. During this series I not only learned how to use react, but I was also able to build applications such as a Tik-tok clone, a Todo app and a Netflix-clone using Astra DB along with GraphQL and Document API. This series of workshops were very informative and I enjoyed every minute of them.
HTML Content to Learning - Beginning
Tags: html, roadmap, coding, untalkcoding
Published: 2021-07-31 21:57:05

Welcome.....
HTML is the Standard Markup Language for Web pages.
HTML is easy to Learn.
Please Pay Attention !!!

+++++ Content +++++
- Introduction
- Basic
- Elements
- Attribute
- Heading
- Paragraph
- Style
- Formatting
- Quotation
- Comment
- Color
- CSS
- Link
- Images
- Table
- list
- Block & Inline
- Class
- ID
- IFrame
- JavaScript
- File Paths
- Forms 
- Forms Attributes
- Form Elements
- Input Types
- Input Attribute
- Input Form Attribute


+++++ Website Tutorial +++++
W3School: https://www.w3schools.com/html/default.asp
MDN Web Docs: https://developer.mozilla.org/en-US/docs/Web/HTML
Study To Night: https://www.studytonight.com/code/html-course/


+++++ Link +++++
Facebook: https://web.facebook.com/UnTalkCoding
GraphQL Subscriptions - magic on the frontend
Tags: react, graphql, node, beginners
Published: 2021-07-31 21:52:32

Hello from the Dev cave! 🍻
Hope you are safe and healthy.

This one is a long due about how I implemented a notification system in one of my react projects using Apollo GraphQL subscriptions.

<h2>
Install the dependencies
</h2>
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v9wxhs4n62umwkrhs5cw.png)
 
<h2>
Amending the Apollo Client config
</h2>
<p>
The thing with subscriptions is that it doesn't work on the same http protocol like queries and mutations. Subscriptions work using websockets. So we need to tweak our Apollo Client config to enable and handle this communication.
</p>

<p>
Import the dependencies - 
</p>
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2cpdavmq02f6whv8rt4c.png)
 
<p>
Just like we create a http link to enable communication for queries and mutations, we will create a an instance of WebSocketLink for our subscriptions. 
</p>
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wp8sbitk3vxy2h8job9o.png)

<p>
In the <i>uri </i> property, pass the endpoint for subscriptions which you have defined in your server, something like - ws://server:port/subscriptions.
</br>
In the options property, we pass various config parameters ( like reconnect i.e. auto reconnect once it disconnects) and connection parameters like your auth and other headers.
</p>

<p>
Once done, we inform/configure the Apollo Client how it can differentiate when to use which link. For this, we use the "split" functionality and "getMainDefinition" utility.

Apollo docs explain this extremely clearly - Although Apollo Client can use your WebSocketLink to execute all operation types, in most cases it should continue using HTTP for queries and mutations. This is because queries and mutations don't require a stateful or long-lasting connection, making HTTP more efficient and scalable if a WebSocket connection isn't already present.

Split here basically helps in separating the communication channel. We use the getMainDefinition utility to check whether our operation is a query (or a mutation) or a subscription.
</p>

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

Once done, we feed this splitLink to our client. 

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

<h2>Consuming subscriptions</h2>
<p>
Just like queries and mutations, we have a hook for this!
The useSubscription hooks, consumes the subscription and return data, loading and error variables.

It takes a defined GQL subscription as input along with connection options - like I have use shouldResubscribe here. Doing this, confirms that this is not a one time things and the application should be open to receive updates. 
</p> 

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


Give this a shot and let me know how it worked out for you.

Cheers!
Hello World
Published: 2021-07-31 21:09:54

---
title: Hello World
published: true
description: Hi
tags: 
//cover_image: https://direct_url_to_image.jpg
---

So I am currently in the process of trying to get my portfolio website deployed. Boy oh boy, has this process been a lot more difficult than I thought. I have decided to use React with styled-components to get more comfortable with doing more frontend work. Last time I tried messing with React it was a pretty rough experience. Well, I suppose React wasn't the issue but I could not for whatever reason get my hands around Redux. The library was so small and in theory it made so much sense to me but then every single time I tried to implement state into my program, I was never able to walk through my program logic. But now I have discovered React Hooks and oh my gosh, I ADORE React Hooks. The context API and useEffect are fantastic. Welp, I hope to add more blog posts in the future.
Teaching an old dog new tricks: Datastax's Summer Sessions
Published: 2021-07-31 21:06:41

Many years ago I decided to shift from being a full-stack developer and focused just on back-end development. This meant leaving behind jquery (and it's callback hell) and IE6 patch code. And it was wonderful!

When I switched jobs a couple of years ago, I was exposed to Vue and webpack for the first time, and realised front-end development has progressed quite a lot in those years. Then I heard about Jamstack, Netlify, serverless React apps, and realised there was now a major gap in my skillset as a developer. I've already taken part in various Datastax workshops whilst working towards my Cassandra certification, and was somewhat hyped when I saw they were running a 3-week frontend development course.

## The Summer Sessions course

Over the three weeks, we developed a ToDo list, a TikTok clone, and a Netflix clone. The front-end code was written in React, with the vast majority being done for us. What we focussed on was setting up the Astra database (using the REST, Collection, and GraphQL interfaces), learning how to use those APIs, using Gitpod (never used it before, it's great!), running Netlify locally, then deploying to Netlify prod.

## The result?

I've had my eyes opened to the Jamstack and the power it can bring to bear. My skills lie in the `A` of Jam, the service APIs. But with what I've learnt over these three weeks, I reckon I could take on making some basic front-end apps to consume those APIs.

## Links

If you want to see for yourself, the recording from the third workshop, covering how to create a Netflix clone, is available at https://www.youtube.com/watch?v=4WmafdS66Xo
Create a Netflix clone from Scratch: JavaScript PHP + MySQL Day 5
Tags: javascript, webdev, tutorial, codenewbie
Published: 2021-07-31 20:56:31

Netflix provides streaming movies and TV shows to over 75 million subscribers across the globe. Customers can watch as many shows/ movies as they want as long as they are connected to the internet for a monthly subscription fee of about ten dollars. Netflix produces original content and also pays for the rights to stream feature films and shows.

In this video,we will learn how to style the signup page

{% youtube sL-M0B8xPNA %}

If you like my work, please consider
[![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jm11knj7d8zwcvo150q2.png)](https://www.buymeacoffee.com/cglikpo)
so that I can bring more projects, more articles for you

If you want to learn more about Web Development, feel free to [follow me on Youtube!](https://www.youtube.com/c/ChristopherGlikpo)
Making beautiful websites: Top 5 FREE photo resources
Tags: webdev, design
Published: 2021-07-31 20:31:49



Beautiful and unique high resolution images are the core for every beautiful website.

Check out the top five resources below for stunning images you can use for your project right away.

PS: Don't forget to check the *bonus link*!

## [unsplash](http://unsplash.com)
The internet’s source of freely-usable images. Period.
All photos can be downloaded and used for free, for  commercial and non-commercial purposes. Attribution is appreciated but not required. 

## [pexels](http://pexels.com)
Amazing collection of high quality pictures.
All photos and videos on Pexels are free to use, attribution is not required but always appreciated.
You can freely modify the photos and videos from Pexels. 

## [rawpixel](https://www.rawpixel.com/)
The most interesting part is the large collection of Public domain images which are free for personal and commercial use with no attribution required. 
 
## [pixabay](http://pixabay.com)
Over 2.3 million+ - one of the biggest, if not THE biggest collection of high quality stock images, videos and music. 

## [reshot](https://www.reshot.com/)
Reshot offers a massive collection of amazing pictures.
All pictures under the Reshot Free License can be used in your commercial and non-commercial projects, for free.

## Bonus: [gratisography](https://gratisography.com/)
Gratisography, part of shutterstock offest the world’s quirkiest collection of high-resolution free stock images - images you just won’t find anywhere else. Perfect for standing out 

---

Follow me on [Twitter: @martinkr](http://twitter.com/_martinkr) and consider to [buy me a coffee](https://www.buymeacoffee.com/martinkr)
How To Stop Generating Extra Image Thumbnails In WordPress
Tags: wordpress
Published: 2021-07-31 20:16:46

Did you notice that when you update an image in WordPress, it create different size thumbnails. Basically those thumbnails are required to show in your blog post or page based on different screen size.

For a small blog, these extra images may not be a problem, but when your website grows, you may feel that those extra images are eating your hosting space.

So in this article we will learn how stop generating those extra images.

Fortunately, Wordpress has an option to disable few of the images as shown in the picture.

You need to go to WordPress dashboard-> Settings-> Media and enter 0 to all those setting as shown.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7z6fmnurmn8qqu24giit.JPG)

This will stop generating three image sizes. If you want to stop generating other image sizes, you need to add this piece of code in your theme function.php file. It is preferable to use a child theme to do all these changes.

function shapeSpace_disable_image_sizes($sizes) {
	
	unset($sizes['thumbnail']);    // disable thumbnail size
	unset($sizes['medium']);       // disable medium size
	unset($sizes['large']);        // disable large size
	unset($sizes['medium_large']); // disable medium-large size
	unset($sizes['1536x1536']);    // disable 2x medium-large size
	unset($sizes['2048x2048']);    // disable 2x large size
	
	return $sizes;
	
}
add_action('intermediate_image_sizes_advanced', 'shapeSpace_disable_image_sizes');

If you want to learn more about these kind of tutorials please visit 

<a href="https://www.rianstech.com/review/appsumo-deals/">RiansTech</a> or
<a href="https://www.riansclub.com/solenoid-valve/">RiansClub</a>