teleren/devto huggingface dataset:
DISK USAGE ANALYZER: How To Monitor Disk Usage in Linux
Tags: howto, linux, ubuntu, disk
Published: 2022-02-10 10:08:21

---
title: DISK USAGE ANALYZER: How To Monitor Disk Usage in Linux
published: true
date: 2021-04-19 13:44:44 UTC
tags: HowTo,Linux,Ubuntu,disk
canonical_url: https://fossnaija.com/monitor-disk-usage-in-ubuntu-linux/?utm_source=rss&utm_medium=rss&utm_campaign=monitor-disk-usage-in-ubuntu-linux
---

This is a graphical disk usage analyzer for the GNOME desktop environment. It is an application that gives a graphical representation of a disk drive’s contents to the user. This is done by the application by scanning folders, devices or remote locations and and reports on the disk space consumed by each element. The application provides both a tree-like and a graphical representation.

So if you’re looking for the part of the computer hard drive (HDD) that is taking up memory space that you don’t know about, you now have an idea of an application that can help you find out so that you can take action.

### ENJOY!!!

{% youtube qZFd3-x8rak %}




**Happy Linux’NG!**



The post [DISK USAGE ANALYZER: How To Monitor Disk Usage in Linux](https://fossnaija.com/monitor-disk-usage-in-ubuntu-linux/) appeared first on [Foss Naija](https://fossnaija.com).
These three books have helped shaped my Developer career.
Tags: books, career, programming
Published: 2021-04-19 17:03:12

*"Some books are to be tasted, others to be swallowed, and some few to be chewed and digested."*

Out of the plethora of books I have read through, these three technical and self-help books, for me, undoubtedly fall into the category of being chewed and digested. Why so? Because they have not only impacted the way I think about work or approach a problem but have helped me add order to my life, write improved code, crack interviews, and achieve a few of my biggest goals - YMMV.

1. Atomic Habits
Have you ever wondered why solving one leet code question consistently in the long run always works? Why do you keep getting better and better? 
It is because of the power of consistent small progress that accumulates to give a positive result. This book helped me realize you don't need to start making drastic changes to become successful. Moreover, techniques such as habit stacking helped me form and maintain new habits easily.

2. Pragmatic Programmer
I read this during the 2020 lockdown and was saddened to discover it so late. The beautiful thing about this book is that it sparks ideas when you read it. Can you do something more efficiently? Can you do it more elegantly? The topics introduced in this book are a must to put into practice for every developer to empower their career. The tips are equally good.

3. Cracking the Coding Interview
This book is laden with concise theories and thoughtful questions. Even though there are many online alternatives to it, this has a special place in my heart as it helped me crack the Amazon SDE Intern interview back in 2017 along with many others.

Please share with me books you would say have added value and helped you progress in your career.
Frontity Themes
Tags: react, frontity, headlesscms, frontitytheme
Published: 2021-04-19 16:55:00

### Frontity 
[Frontity](https://frontity.org/) is the react framework for WordPress. You can easily create lighting fast websites using WordPress and React. Frontity is static site generator provide an instant Serverless Pre-rendering (SPR) experience. Frontity is 100% focused on WordPress

### Frontity Themes
Frontity themes are almost similar to WordPress theme, The Theme is placed with package folder of frontity project. You can completely build a theme from scratch or you can use pre-made theme like WordPress.

### Download the Frontity Theme


#### [Portfo- Frontity portfolio theme](https://jstemplate.net/item/portfo-frontity-personal-portfolio-theme/)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vicgwqrkfammmwvb5xh4.jpg)

[Portfo](https://jstemplate.net/item/portfo-frontity-personal-portfolio-theme/) is frontity personal portfolio theme for each designer, developer, content writer and any personal website. You can easily install and customize the theme. The theme has gutenberg integration so you can use gutenberg to change content and design. Portfo also offers Light and Dark version


#### [Twenty Twenty](https://github.com/frontity/frontity/tree/dev/packages/twentytwenty-theme)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/moi71tq8u9wov70eca65.jpeg)

[Twenty Twenty](https://github.com/frontity/frontity/tree/dev/packages/twentytwenty-theme) is one of the best default theme. If you familiar with WordPress you may know this name Twenty Twenty.
Check out all the feature from theme official github [repo](https://github.com/frontity/frontity/tree/dev/packages/twentytwenty-theme)


Get the more frontity theme from [here](https://jstemplate.net/list-of-best-frontity-wordpress-theme-2021/)
TIL: Find alone and find within loops in a shell
Tags: shell, find, for, loop
Published: 2021-04-19 16:51:00

---
title: TIL: Find alone and find within loops in a shell
published: true
description: When to use find alone and when within loops in a shell 
tags: shell, find, for, loop
//cover_image: https://direct_url_to_image.jpg
---
Today I learned a situation in which is good to use a __for loop__ in a shell in moments when the __-exec__ flag alone is difficult to use.

The __find__ command in any case is very powerful and can assist in many shell tasks. Usually when executing commands on a set of file the `find` command, together with the `-exec` expression in the `find $PATH -exec $COMMAND {} \;` instruction, is very useful to write short and meaningful operations like

```bash
find ./ -name $PATTERN -exec cat {} \;
```

to print the content of a list of files denoted by the _PATTERN_ variable.

However, it is not very useful when the situation gets complex like in this scenario.

Suppose we have 2 files:

1. _file1_ with content

    > -l

2. _file2_ with content

    > -a

And we want to run `ls` with the options found in these files.

In this context the command

```bash
find ./ -name "file*" -exec ls $(cat {}) \;
```

would not work (the error would be "_cat: {}: No such file or directory_").

In this situation a classic __for range__ loop will help us achieve this goal. As in this example

```bash
for i in $(find ./ -name "file*"); do ls $(cat $i); done
```

Despite being very unconventional uses of those instructions, I propose these examples to draw a line on where the `find` command manages to do the job alone and where it is more helpful to include its resuls it in a `for range` loop.

Hope this was helpful, thanks a lot for your time reading it!
Unlimited paid time-off. A boon or an accounting trick?
Tags: vacation, pto, companies, benefits
Published: 2021-04-19 16:49:01

---
title: Unlimited paid time-off. A boon or an accounting trick?
published: true
description: Be wary of companies offering paid time off.
tags: vacation, PTO, Companies, benefits
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vvedvbewk6rlhaue69b.png
---

This is coming from someone who has worked at a company having this policy. Before it, we had traditional 24 days paid time off policy and people used to take all of it. After this unlimited paid time off came about, people ended up taking lesser PTO, since it was subject to management's approval. Taking a month off was scoffed at by the management, and they unfortunately used this policy to their advantage and forcing people to work more than earlier.

So whenever you guys join a org having this policy, inquire enough about how they implement the unlimited PTO policy. Do they have a roster within a team, so sufficient people are available in case something needs to be looked at or to have a minimum working capacity? Whose approval you need for it? Inquire enough about this policy and their implementation, until you get the idea, and do ask the engineers interviewing you about how they feel about the policy.

Sure, there is a good chance they could gaslight you, but there is always a chance that you get a red flag from doing this. Sure there will be companies where this would be great. However, in many companies, this policy is nightmare for employees, so be wary of it.

In short, *it depends on the management* and their handling of this. It can be a great benefit to have or can be used to lessen paid leaves and force employees to work for more days per year.

Importantly, it's also an *accounting trick*. ​PTO is carried as a liability on the balance sheet and has to be paid out when an employee leaves. Unlimited PTO has none of these issues and it's actually limited in the real world

Anyone currently working in an org having this policy, please share your experiences.
Laravel 8 - Input live formatting and validation with Livewire
Tags: livewire, formatting, validation, input
Published: 2021-04-19 16:45:36

Sometimes for better user experience need something interactive, something that could guide user in filling form with data. Let's say **dates**, **credit cards numbers**, **bank accounts**, **special codes** and so on. Each of them has special format. For example, let's take Norwegian bank account. String format must be **xxxx.xx.xxxxx**
Let's add simple input and error elements in livewire blade file:
```html
<input type="text" wire:model="bank_account" wire:change="formatBankAccount"  wire:keyup="formatBankAccount"><br />
@error('bank_account') <span class="text-red-500">{{ $message }}</span>@enderror
```
With livewire actions **change** and **keyup** we will call method **formatBankAccount** to format our input in real time. 
In Livewire component file let's add method **formatBankAccount**:
```php
public function formatBankAccount(){
    $bank_account = $this->bank_account;
    $bank_account = preg_replace('/[^0-9]+/', '', $bank_account);
    $bank_account = substr($bank_account, 0, 11);
    $length = strlen($bank_account);
    $formatted = "";
    for ($i = 0; $i < $length; $i++) { 
        $formatted .= $bank_account[$i];
        if($i == 3 || $i == 5){
            $formatted .= ".";
        }
    }
    $this->bank_account = $formatted;
}
```
And after submit form, we need to add validation.
```php
$niceNames = [
    'bank_account' => 'Norwegian bank account',
];
$fields_validation = [
    'bank_account' => 'required|regex:/^[0-9]{4}\.[0-9]{2}\.[0-9]{5}$/'
];
$this->validate($fields_validation, null, $niceNames);
```
So this example can be easily adjusted to any kind of string format like date **xxxx-xx-xx**, bank card number **xxxx-xxxx-xxxx-xxxx** and other.
Remove duplicates from Sorted Array
Tags: twopointerapproach
Published: 2021-04-19 16:41:20

If array is a sorted array, use two pointer approach to find the position of non duplicate items in the array.

public class Solution {
    public int RemoveDuplicates(int[] nums) 
    {
         int len=0;
         if(nums.Length==0)
             { return 0; }
      
        for(int i=0;i<nums.Length-1;i++)
         {
           if( nums[i]!=nums[i+1])
           {
               len=len+1;
               nums[len]=nums[i+1];
           }
         }
       return len+1;
    }
}
Simple CSS Animation!
Tags: html, css, animation, simple
Published: 2021-04-19 16:36:55

{% youtube 9RH_oBhMk_I %}


Let's start by changing the coding language to HTML. Adding the HTML template, and adding a title. I will name this Loading Animation Tutorial. Let's add a button with some text in it. Now let's go to fontawesome.com (the link is in the description) and search for a loading icon. I am gonna choose this icon. If you want you can scroll down and see other icons. Copy the HTML tag, and past it in your HTML file. Save it as HTML.html. Now let's see how it looks. But where is the icon? To can show a font awesome icon you need at the first to make an account and go to kits. And copy the code that they are giving you. After this paste it into the header. Now if we save and reload the page you can see the icon. Now let's start designing. Change the language to CSS. And let's start by removing the default margins. And now let's go to google fonts and choose a font. I will choose Roboto. You can choose whatever font you want. Let's copy this and go to the HTML file and paste this in the header section. Now let's go back to google fonts and copy the font family, and past it in the CSS file. Save this as CSS.css. Now let's add a source tag to our HTML file. Copy the link of the files and paste it in the src section. also, add a link tag with the name of the CSS file. So, now if we refresh the page the margins disappeared. Now let's style the button. I am gonna add 10-pixel padding, set the border and the outline to none. Make the background white. Make the border-radius 10px, the width 200 pixels, and the height 80. I will also add a box shadow of 20px blue. And also position, absolute. Save it and refresh the page. You see that now our button is having a design. But now let's make it to be in the center: top, fifty%, left fifty%. transform, translate -50%, -50%. Font size 25 pixels and cursor pointer. Let's see how it looks. type animation spin 25 linear. To add the animation we need to type keyframes, spin because this is the name of the animation. Zero%, tranform roteate 0deg. And now 100%, transform, rotate three hundred sixty deg. Let's save and refresh the page. Oh! I forgot! We need to make just the icon to be animated! So let's copy the animation. Write fas. If you are using another icon look there to see it is different. Change from 5 to s and add infinite. Now if we save and refresh, you can see that is working!
How to Build an Election Poll in 3D in 15 Minutes or Less
Tags: tutorial, beginners, augmentedreality, showdev
Published: 2021-04-19 16:19:14

Looking to create a visual poll for the 2020 presidential elections that features the latest debase results in a more engaging way? Try using 3D or augmented reality (AR)! Here’s a step-by-step guide to quickly create a simple election demo with Unity, AR Foundation, and echoAR. The full demo can also be found on echoAR’s [GitHub](https://github.com/echoARxyz/Unity-ARFoundation-echoAR-demo-Election/).


![1.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1618849008070/1SIl6krly.gif)

### Register

Don’t have an API key? Make sure to register for FREE at [echoAR](https://console.echoar.xyz/#/auth/register).

### Setup

* Clone the [Unity+ARFoundation with echoAR](https://github.com/echoARxyz/Unity-ARFoundation-echoAR-example) example code.
* Follow the instructions on our [documentation page](https://docs.echoar.xyz/unity/adding-ar-capabilities) to [set your API key](https://docs.echoar.xyz/unity/adding-ar-capabilities#3-set-you-api-key).
* [Add the 3D assets](https://docs.echoar.xyz/quickstart/add-a-3d-model) from the [assets](https://github.com/echoARxyz/Unity-ARFoundation-echoAR-demo-Election/blob/main/assets) folder to the console alongside the metadata CSVs included.
* Overwrite the existing *echoAR/RemoteTransformations.cs* script with the new  *[RemoteTransformations.cs](https://github.com/echoARxyz/Unity-ARFoundation-echoAR-demo-Living-Room-TV/blob/master/RemoteTransformations.cs)* file.

![2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1618849021132/ltnQ_OzpR.png)

### Run
* [Build and run the AR application](https://docs.echoar.xyz/unity/adding-ar-capabilities#4-build-and-run-the-ar-application).

### Real-time updates
Update the value of the votes key associated with the donkey and elephant models and notice that the size of the graph in the 3D scene changes automatically.


![3.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1618849038373/DNWQuMfBu.png)

### Learn more

Refer to our [documentation](https://docs.echoar.xyz/unity/) to learn more about how to use Unity, AR Foundation, and echoAR.

### Support

Feel free to reach out at support@echoAR.xyz or join our [support channel on Slack](https://join.slack.com/t/echoar/shared_invite/enQtNTg4NjI5NjM3OTc1LWU1M2M2MTNlNTM3NGY1YTUxYmY3ZDNjNTc3YjA5M2QyNGZiOTgzMjVmZWZmZmFjNGJjYTcxZjhhNzk3YjNhNjE).

![4.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1618849044846/pM4gV35b8.png)

-----
> echoAR (http://www.echoAR.xyz; Techstars ’19) is a cloud platform for augmented reality (AR) and virtual reality (VR) that provides tools and server-side infrastructure to help developers & companies quickly build and deploy AR/VR apps and experiences.

![5.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1618849050725/jqSdPkyOW.png)
Core Animations in Swift
Published: 2021-04-19 16:17:41

Apple's documentation says that: _Core Animation provides high frame rates and smooth animations without burdening the CPU and slowing down your app. Most of the work required to draw each frame of an animation is done for you. You configure animation parameters such as the start and end points, and Core Animation does the rest, handing off most of the work to dedicated graphics hardware, to accelerate rendering._

The main difference between UIView animations and Core Animations is that UIView animations animate the whole view whereas Core Animations have the ability to animate each sublayer of the UIView. 

You can find all the various types of animations enabled by Core Animation in iOS [here](https://developer.apple.com/documentation/quartzcore).

---

Let's continue with adding a Core Animation to the TODO Application we built in the previous post of this series, or you can find the starter project [here](https://github.com/midhetfatema94/CustomAnimationsStarter).

---

We are going to build a live color changing gradient animation to the _Add ToDo_ button.

![Gradient animation preview](https://media.giphy.com/media/WuqipdJkZamdpQVopL/giphy.gif)

Let's create a method called `animateGradient()` in `NewTodoViewController.swift`.

Add the following code in the method:

```swift
func animateGradient() {
    // cycle through all the colors, feel free to add more to the set
    if currentGradient < gradientSet.count - 1 {
        currentGradient += 1
    } else {
        currentGradient = 0
    }
        
    // animate over 3 seconds
    let gradientChangeAnimation = CABasicAnimation(keyPath: "colors")
    gradientChangeAnimation.duration = 3.0
    gradientChangeAnimation.toValue = gradientSet[currentGradient]
    gradientChangeAnimation.fillMode = CAMediaTimingFillMode.forwards
    gradientChangeAnimation.isRemovedOnCompletion = false
    gradientChangeAnimation.delegate = self
    gradient.add(gradientChangeAnimation, forKey: "gradientChangeAnimation")
}
```

And now you have created your first Core Animation!

Core Animation is a very powerful library and you can do almost all the animations your heart desires. So get a move on and explore the full potential of Core Animations!

That's it for this series on animations and stay tuned for more tips and tricks in iOS :)

![That's a wrap](https://media.giphy.com/media/8JZxSl9H3gsn9vtfYd/giphy.gif)
Algorithms
Tags: algorithms, programming, computerscience
Published: 2021-04-19 15:57:26

##**What’s an algorithm?**
Algorithm is simply a set of instructions implemented to perform a certain task. The word “algorithm” is derived from the name of Al-Khwarizmi and then was Latinized as “Algoritmi”.
##**Complexities:**
Time and Space Complexities are so important and the gate to understand the whole concept of an algorithm. Furthermore, calculation of time and space complexity is so essential to reach the optimum solution to many problems.
Technically, complexity is used to measure performance of your algorithm and to know the best approach to solve the problem.
_**Time complexity:**_ amount of time taken to process the set of instructions in terms of length of input.
_**Space Complexity:**_ amount of space or memory taken by the set of instructions in terms of length of input.
**Big O notation:** is the upper bound of an algorithm, and is notated by **O()**.
So, if we want to search for an element in an array, the worst case scenario is to find this element at last index in the array, which means traversing the whole array of length (N), having a time complexity of O(N) and space complexity of O(1) as we didn’t use any extra space.
**Big 𝛀 notation:** big omega is the lower bound of an algorithm, and is notated by **𝛀()**.
**Big 𝚹 notation:** big theta is tight bound of an algorithm, and is notated by **𝚹()**.
The most used notation is **Big O notation**, because it will give us an upper limit of the execution time i.e. the execution time in the worst case.
Installing and setting up Redis server for Mac OS.
Tags: redis, macos, mac, macbook
Published: 2021-04-19 16:53:48

---
title: Installing and setting up Redis server for Mac OS.
published: true
date: 2021-04-19 15:56:49 UTC
tags: Redis,macOS,mac,macbook
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xaneitdxgqne5059i9vs.jpg
//canonical_url: 
---

Homebrew is one of the nifty command line tools available in Mac OS for quickly and seamlessly installing and configuring development tools.

So let's get a redis server up and running locally in 4 simple steps!

### Installation

- `$ brew install redis` There will be some info about caveats regarding configuration. You can read and leave it for now.

With this simple command, redis is installed on your mac.

### Configuring Redis

**Location of Redis configuration file.**

`$ usr/local/etc/redis.conf` 

### Get Redis package information

`$ brew info redis` 

### Launch Redis when system boots up

`$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents` 

### Starting Redis server via “launchctl”

`$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist` 

### Starting Redis server using configuration file

`$ redis-server /usr/local/etc/redis.conf` 

### Stop Redis on autostart on computer start

`$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist` 

### Uninstall Redis and its files

`$ brew uninstall redis`

`$ rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist`

### Test if Redis server is running

`$ redis-cli ping` 

If it replies **PONG** , then you are good to go!