teleren/devto huggingface dataset:
Linux Commands to boost productivity
Published: 2022-05-04 06:01:20

I have been using the terminal for quite a long time. And few of these commands which I recently came across have changed the way I use the terminal. Hope you guys will find these useful as well.

Let's get started with the commands,

## Quickly navigating directories

One quick tip is to navigate to home, we can use
```bash
->cd ~
```
Similarly, we can use - to navigate back to the previous working directory
```bash
->cd -
```

## Clear screen

We usually type clear to clear the screen, alternatively just press **Ctrl + L** to move the prompt to the first line. This just moves the prompt to the top of the screen. This is quite quick and I started using this quite frequently compared to clear.

## Minimize a program

Okay, technically we are not minimizing in the sense. But we can press **Ctrl + Z** to move the code to pause the program. So, we can be editing in vim and press Ctrl + Z and pause it, do something else, then get back to editing by using the **fg** command.

## Repeating the last command with sudo

We missed adding sudo to a command. This happens so often that it's frustrating to hit home and type sudo or retype the entire command after sudo. One simple way to get over it is to use the following command.

```bash
->sudo !!
```

!! is referred to as bang bang. So this command is referred to as *sudo bang bang*.

## Review command history

We know about history command. But press **Ctrl + R** to open up a search. This is far more convenient and easier to search. Press Ctrl R to cycle through the commands.

## Run command from history

Execute the history command, note the number before the command you want to run. Type bang followed by the number to execute the command.

```bash
->history
1 apt get update 
2 apt get upgrade
->!2
```

## Clear line

Press **Ctrl + U** to clear the entire line.

## Go to start and end of line

Press **Ctrl + A** to go to start of the line
Press **Ctrl + E** to go to end of the line

## Chaining commands

We can use ; or && chain commands.

```bash
->ls -a test; echo hello
ls: cannot access 'test': No such file or directory
hello
->ls -a test && echo hello
ls: cannot access 'test': No such file or directory
```

As you can see the key difference is that; doesn't care about the output of the previous command. Whereas, when we chain with & it needs the previous command to complete successfully for the second command to execute.

## Column command

This is just to prettify columnar outputs. Any jumbled output can be made easier to read with a column command. This can be used to format output as required as well.

```bash
mount| column -t
```

## Increase and decrease font size

This is one thing I have seen new developers struggle with. A quite intuitive command set to increase and decrease font sizes are 

**Ctrl + +** to increase font size
**Ctrl + -** to decrease font size

I will be on the look out for more commands that can help me in my daily work flow. Please feel free to let me know in the comments below about any more commands that might be useful.
Simply ✨Catching Up✨
Tags: updates, showdev
Published: 2022-05-04 05:48:54

I've got a lot of projects going on so here are a list of them. I'll make separate posts accompanying the largest ones when I have time, but this post will serve as a backlog of my others.

**Major change to point out first: My primary domain for all my projects has changed from [https://playantares.com](https://playantares.com) to [https://antaresnetwork.com](https://antaresnetwork.com)**

## Onto the backlog:
1. My personal website is [this](https://nathen418.com)
2. My website for stuff I do with other people is [this](https://antaresnetwork.com)
3. The status of all of my public and private services in my homelab can be found at my [Status Page](https://status.antaresnetwork.com)
4. I run [Antares Bot](https://bot.antaresnetwork.com)
5. I do all the server and website hosting for [Santa Bot](https://santabot.antaresnetwork.com), A Discord Bot with over 800k users and in over 1.5k servers.
6. I just published a new Discord Bot called [FAQT](https://antaresnetwork.com/faqt), which serves as a custom FAQ and server management bot for the Santa Bot Server.
7. I currently run [CSSC Bot](https://antaresnetwork.com/cssc-bot) which is a custom discord role bot for all the computer science roles in the UWM CS Smart Club Discord server in the UWM Student Hub.
8. I publish all of the code and projects I do in my Information Science and Technology classes at UWM. Check them out at my [GitHub Profile](https://github.com/nathen418)
9. I have a [Base Bot](https://antaresnetwork.com/base-bot)
10. I also have [IridiumScoreBoard](https://antaresnetwork.com/isb) which is outdated now, but was a cool scoreboard plugin for spigot servers that used the plugin IridiumSkyBlock
11. We also made [BASM](https://antaresnetwork.com/basm) or (Bungee Automatic Server Management), an (unfinished) plugin designed to automate the creation, hibernation, and deletion of private Minecraft paper servers behind a Bungee reverse proxy. The plugin let any user that was whitelisted to the network, spin up their own private "realm", which they could invite friends to.
12. We also made [AntaresPrison](https://antaresnetwork.com/antares-prison), which was a prisons plugin custom developed for the Antares Network Minecraft Server when it was still in operation. The plugin was designed to be a learning experiment and did not make any claims of reliability or consistent updates.
12. I have a Dell PowerEdge r720 server at home running Proxmox with ~25 VM's along with a few Dell Optiplex 9010's running things like VPN's, Proxmox Backup Server (PBS), Home Automation, and redundant HA DNS.
13. I'm continuously working on experimenting with Software Defined Networking (SDN) and how it can be integrated into monitoring software, IAM and OpenIDc and other authentication and authorization software's.
AWS Cloud Integration
Tags: aws
Published: 2022-05-04 05:19:20

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

**_Amazon SQS_**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/il2rif0tvtmyqc9estvj.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u7dj5vhomdnaop1r25rp.png)
**_Amazon SNS(Simple Notification Service)_** 
Basically, it helps to manage notifications easily. It is highly available, durable, secure, fully managed pub/sub messaging service that enables one to decouple microservices, distributed systems, and serverless applications.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8zh6v68cc078e8i1yiqv.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ylfh4ccw4bw5jo52dnjm.png)
**_Amazon Kinesis_**
It is basically for real-time streaming updates. It has 4 services: Data Firehose, Data Analytics, Data Streams, Video Streams.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/otc6uvn8ql2b6ixsv9id.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d85cac1e2rusj4n4nhyt.png)
**_Amazon MQ_**
Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbiMQ that makes it easy to set up and operate message brokers in the cloud. Although it does not have that much integration with AWS like SNS, and SQS but can be used for shifting from on-premises to cloud purposes. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mn06e3bqg50n3vr0akjc.png)
_Summary_
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4gsxosz6jnf6lgbfm8jx.png)
I use these chrome extensions
Tags: productivity
Published: 2022-05-04 04:41:14

## AdBlock — best ad blocker
To Block ads and pop-ups on YouTube, Facebook, Twitch, and your favorite websites. Obviously we don't like ads so yes. I know many creators earn from ads but sometimes needed. But sometimes I feel bad so I turn off for particular websites 😌

## Wappalyzer - Technology profiler
I'm always curious about what the technology running behind this website. So, this extension instantly reveal the technology stack any website. Not sure it's accurate or not so I checked on stackshare.io

## WhatFont
The easiest way to identify fonts on web pages. Gives you complete detail like font name, style and more.

## Emoji Keyboard by JoyPixels
I'm emoji guy, so this extension really helpful to just copy and paste directly into the input box.

## Eye Dropper
Eye Dropper is open source extension which allows you to pick colors from web pages, color picker and your personal color history.

## JSON Viewer
The most beautiful and customizable JSON/JSONP highlighter that your eyes have ever seen.

## React Developer Tools
Currently I'm using React so yeah really helpful to debug react stuff.

## Redux DevTools
Redux DevTools for debugging application's state changes.

## Grammarly for Chrome
Yes for grammer correction. But sometimes I ignore it to correct grammer lol 😁😅

## MozBar
For SEO stuff, DA/PA of the web and backlink stuff.

## Similarweb
To see website traffic and key metrics for any website, including engagement rate, traffic ranking, keyword ranking and traffic source.

## Allow CORS: Access-Control-Allow-Origin
Easily add (Access-Control-Allow-Origin: *) rule to the response header.

## Dark Reader
Dark mode for every website. Take care of your eyes, use dark theme for night and daily browsing.

Hey I'm here on [twitter/awwarpit](https://twitter.com/awwarpit/)
Understanding Parts of the Web
Tags: webdev, beginners, writing
Published: 2022-05-04 04:35:16

Simplifying parts of web development that used to confuse me when I started but now makes sense.

## Hosting websites

- **Static hosting** is deploying your simple website on platforms like; Vercel, Github Pages, or Netlify. These websites are static because there isn't any data involved. With these platforms, you don't need to manage the server yourself. Given the website files, they will handle the rest when it comes to putting it on a server. 

- **Managed hosting** requires you to manage the server yourself and all other details.

- **Cloud hosting** hosts your website through the cloud (virtually) instead of a physical server. You need to pay for storage space. It's beneficial in security and scalability. 

**CI/CD** is a development process that involves building, running, and testing your code to ensure the code is good and production-ready. It is a software delivery process teams follow (EX: CircleCi, Github Actions).

**Web Assembly** is used as a compiler for languages like C++, C, or Rust. It is used alongside Javascript on the web to enable web apps built with C++, C, or Rust, to work on the client-side. (Nginx, Caddy2)

**Jamstack** is an architecture that suggests splitting up code by JS, APIs, and markup. Basically, a different way of building websites. The idea is to take a server-less approach to eliminate requests made to the server, which means faster load times and better performance. 

A **web server** is a computer server that holds your website files (HTML, CSS, js, assets, etc.)

**Dockers and Containers** package your web apps and all of their libraries into a "container". It gives you the ability to run the container on any OS(Windows, Linux) that has the Docker runtime installed.
Inception of a pod - behind the scenes
Tags: kubernetes, ckad, beginners
Published: 2022-05-04 04:09:02

A pod is the atomic unit of scheduling and is a run-time entity. It is transient in nature and can have multiple containers within. 
If a pod fails, Kubernetes can automatically create a new replica of that pod to continue operations.
The pod cannot alter/heal it's state directly and an external controller (schedulter, proxy ..) is needed to repair

---

##### States
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0f1x9cu938h5ujomeysw.png)

##### Pending State
The pod has been accepted by the API server. The pod remains in the pending state until the containers are started.

##### Running State
The pod has been scheduled to a node and all the containers in the pod have been created and are running.

##### Succeeded State
The pod has performed the task. All the container(s) exited or terminated with status 0 and after that marked as Succeeded.

##### Failed State
Pod reaches this state when all the containers have exited or terminated but one or more container(s) have returned back with a non-zero status.

##### Unknown State
Occrus when `kubelet` is unable to get the state of the pod due to multiple reasons, like if there is a crash or if `livenessProbe` keeps failing or pod has come-up after `readinessProbe` has timed-out.

---
#### State transitions

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

> Source: [https://livebook.manning.com/book/kubernetes-in-action-second-edition/chapter-6/v-12/5](https://livebook.manning.com/book/kubernetes-in-action-second-edition/chapter-6/v-12/5)
Don't use 100vh for mobile responsive
Tags: javascript, css, html, webdev
Published: 2022-05-04 04:05:37

Generally, we use `height:100vh` for fullscreen layout which is easy hack and convenient way to get better design.

### Example 
```css
.content {
   height: 100vh;
}
```

But when we test our design on actual device, we encounter several issues:

- Mostly Chrome and Firefox browsers on mobile have got a UI (address bar etc) at the top.
- On Safari it get's more tricky address bar is at the bottom.
- Different browsers have different sized viewports
- Mobile devices calc browser viewport as (top bar + document + bottom bar) = 100vh
- Whole document is filled to the page using 100vh

---

## Problems

 - On Chrome

![Chrome 100vh issue](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ul31t034dkeh159exr3.gif)

Scrollbar issues has been detected. Bad user flow and difficult to navigate the content.

_Note: I have also tested this issues on safari which makes more bad user flow_

---

## Solutions

### Detect the height of the app by using JS

Setting the height of the page (using javascript) with the `window.innerheight` property.

```javascript
const documentHeight = () => {
 const doc = document.documentElement
 doc.style.setProperty('--doc-height', `${window.innerHeight}px`)
}
window.addEventListener(‘resize’, documentHeight)
documentHeight()
```

### Using, CSS Variable

```css
:root {
 --doc-height: 100%;
}

html,
body {
 padding: 0;
 margin: 0;
 height: 100vh; /* fallback for Js load */
 height: var(--doc-height);
}
```

Here, documentHeight function sets new style property var('--doc-height') and includes current window height.

---

## Final Results

### Chrome Browser

![CSS 100vh viewport](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9xpnie43afod7in6j3ew.gif)

_Note: There is no any vertical extra scrollbar is appearing now also no issues on Safari too. The bottom address bar of safari is always on the bottom which makes good user flow to the website_

---

Conclusion
👏👏 By coming this far I hope you can solve the mobile devices viewport issues. So, I suggest you give it a try on your project and enjoy it!

Feel free to share your thoughts and opinions and leave me a comment if you have any problems or questions.

Till then,
Keep on Hacking, Cheers
How to Send Bulk Mail Using Queue in Laravel 8
Tags: laravel, laravel8, mail, queue
Published: 2022-05-04 03:13:13

In this tutorial, we will see how to send bulk mail using queue in laravel 8. Laravel queue is used for sending bulk mail with a background process, as we know if we are sending single mail in laravel application it is working properly without taking more time but if you want to send multiple emails in laravel then it will take too much time and also you can not do any operation during this time periods.

if you want to send bulk mail then you need to use laravel 8 queue. using queue we can send multiple emails in laravel 8 with the background process.

So, let's see how to send bulk mail in laravel 8, laravel 8 send email using the queue, mail queue in laravel 8.

```
Step 1 : Change In .env File
Step 2 : Create Route
Step 3 : Create Queue Table
Step 4 : Create Controller 
Step 5 : Create Job
Step  6 : Create Mail Blade
```

---

> **_[Read More : How to Send Bulk Mail Using Queue in Laravel 8](https://techsolutionstuff.com/post/how-to-send-bulk-mail-using-queue-in-laravel-8)_**
Cases
Tags: pascalcas, coding, programming, python
Published: 2022-05-04 01:55:44

1.PascalCase
First letter capitalize
PHILOSOPHY - Blaise Pascal
https://youtu.be/3nb4nYqNXyM

2.camelCase
First word letter small, but second capital

Eg: udemyCoursera

3.snake_case
All letters small, word seprated by underscore 🤞

Eg: shameem_ali

##
Free 10 Chakra UI components - TemplatesKart
Tags: react, webdev, showdev, chakraui
Published: 2022-05-04 01:25:59

Let's find out 10 new chakra-ui components that I added to [TemplatesKart](https://templateskart.com) website.

## Links
Website: [TemplatesKart](https://templateskart.com)
Github Repo: [TemplatesKart Code](https://github.com/MA-Ahmad/templateskart)

## Components overview

1. [Heroes](https://templateskart.com/components/heroes)
  * Simply centred
  * Image on right side
  * Left align content
  * Background image

2. [Blog](https://templateskart.com/components/blog)
  * With border
  * Posts feed

3. [Cards](https://templateskart.com/components/cards)
  * User card
  * Course card

4. [Stats](https://templateskart.com/components/stats)
  * Library stats

5. [Testimonials](https://templateskart.com/components/testimonials)
  * with dotted box

## Some Components Screenshots


*Image on right side*
![Image on right](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/71ayy1uzsuzjo3xsfa7k.png)

*Background Image*
![Background Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zdfhwxdrfh9t5xj4qbn9.png)

*Left align content*
![Big hero](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2yaofoxpbgdyibce7hr1.png)

*User card*
![User card](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ff8h8mwb6lnuk0cvyth.png)

*Library stats*
![Library stats](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sw1j9ajhn2qai6ai0ikq.png)


**Show your support**
Please give a ⭐️ on Github if you like my work! 🙏
Completing Phase 1 (JavaScript & Code Challenge)..
Tags: javascript, beginners, programming, discuss
Published: 2022-05-04 01:23:48

In the past 3 weeks after I wrote my first post in regards to my learning, I have failed to write posts every day. As I do not personally like to give out an excuse, so let a million reasons why I could have not written a single piece of writing about my learning behind and move on. This goes back to 2nd week of my phase 1 which was the most challenging, shocking, and somewhat intimidating moment during my being at Flatiron. 9 days of learning javaScript basics immensely (data type, arithmetic calculation, variable assignment, creating variables & functions, object and a special type of object called arrays, accessing data, fetching, looping, iteration, and more) spending at least 10 hours a day straight, it all came down to facing a mock-up code challenge. A code challenge consists of [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction) (a programming interface for web documents representing the page so that programs can change the document structure, style, and content source: MDN) manipulation including fetching data from a JSON server or API and using event listeners to manipulate the DOM. It would cost a lie to say that I did not expect the code challenge to be a bit of a difficult problem. However, the process of me choosing this career path to become a software developer at the age of 30 and start Flatiron School Bootcamp was already a hack of a decision (more of a life-changing one) so a naive thought of me inside of my mind thinking that I made a tough and critical decision made me feel so confident and relieved in a way that I felt like I could achieve anything and eventually it led me to be blind to see the truth. The truth that making a difficult decision does not help to prevent agony coming from trying, failing, and not passing the code challenge in the first trial. To be continued...
Space Complexity in Algorithm
Tags: javascript, webdev, codenewbie, wecoded
Published: 2022-05-04 01:05:52

When we talk about space complexity, remember that we are talking about  the space that an algorithm takes up as the size of the input increases. We are indicating auxillary space complexity here means we are just focusing on what happens inside the algorithm.

Things to remember in Space Complexity  -

1.  Primitive things like booleans numbers, undefined, null and JavaScript are constant space.
2. Strings require `o(n)` space where n is the length of the string. For example a string with 10 characters take more space than a single character string.  

Let's see an example -
Determine the space complexity of the following -

```
Determine the space complexity for the following function  

function sum(arr) {
let total = 0;
    for (let i = 1; i < arr.length; i++) {
        total+= arr[i];
    }
return total;
}

```
 So this function called sum, it takes an array and it just sums all the items in the array. We have a variable `total` that starts at 0. Then we have the loop that goes from 0 to the end of the array and we're just adding in the value
of each item in the array to the total variable and then we return it at the end. Remember, it is space that we are considering and not time. No matter what the array length is, we have one variable called total one number and then we're
looping through and we have a second declaration inside the For loop. Thus we have only  these two variables and they exist no matter what. We're adding to the total variable, but we're not making a new variable. So that really just means we have constant space of one space.
From 0 to Hero on Kubernetes with Nana Janashia
Tags: kubernetes, devops, webdev, tutorial
Published: 2022-05-04 00:49:54

Join Nana Janashia and Bruno Andrade on **May 11th at 10 AM PT / 1 PM ET** as they discuss how you can go from 0 to Production-ready clusters without all the Kubernetes and infrastructure-related complexity

Sign up is free and available here: [https://devrel.shipa.io/application-ready-with-nana](https://devrel.shipa.io/application-ready-with-nana)
TIL IEX Console #1
Tags: elixir, iex
Published: 2022-05-04 00:27:57

TIL a small trick on Elixir console (`iex`) that is the helper [`i/1`](https://github.com/elixir-lang/elixir/blob/v1.13.4/lib/iex/lib/iex/helpers.ex#L497)

When you type some piece of code on `iex` e.g: 

```elixir
iex(1)> IO.inspect {:a, :b}
{:a, :b}
``` 

And after that you type `i`. This helper will print the type information about the last command typed on `iex`.

```elixir
iex(1)> I
Term
  {:a, :b}
Data type
  Tuple
Reference modules
  Tuple
Implemented protocols
  IEx.Info, Inspect
```

You also can specify a term to the helper as on the example below.

```elixir
iex(3)> i (4 / 2)
Term
  2.0
Data type
  Float
Reference modules
  Float
Implemented protocols
  IEx.Info, Inspect, List.Chars, String.Chars

iex(4)> i "hello"
Term
  "hello"
Data type
  BitString
Byte size
  5
Description
  This is a string: a UTF-8 encoded binary. It's printed surrounded by
  "double quotes" because all UTF-8 encoded code points in it are printable.
Raw representation
  <<104, 101, 108, 108, 111>>
Reference modules
  String, :binary
Implemented protocols
  Collectable, IEx.Info, Inspect, List.Chars, String.Chars
```

And that's it for today.