teleren/devto huggingface dataset:
An Introduction To The Apt Package Manager
Tags: linux, ubuntu, tutorial, beginners
Published: 2020-10-12 23:59:05

[*Original article published on my blog, onyxcode.net*](https://onyxcode.net/apt-intro)
# An Introduction to the Apt Package Manager 

What is Apt? Apt is the default package manager on Ubuntu, a Linux distribution based on the popular Linux operating system, Debian. In this article we will be going over a couple basic features of Apt in order to give you, the user, a basic ability to install, uninstall and update packages.

## 1. Installing packages

Installing a package with Apt is pretty straightforward. First, you need the package name. Let’s use “sl” as an example. sl is a small Linux package that prints a moving steam locomotive across the screen when you type “sl” in the terminal. One thing to always remember. In most cases, unless you are logged in as “root”, you will need to type “sudo” before such a command, because it requires administrator privileges. With this information, to install a package, you need to type the following:

```
sudo apt install sl
```

It should output something similar to this:

(Image on original post)

If it asks you if you wish to continue, press Y on your keyboard. Otherwise, if the output is similar to this, congratulations! You’ve successfully installed your first package with Apt! Type “sl” and press Enter to watch the steam locomotive go by. Choo choo!


> Tip

> Install multiple packages at once by adding a space between each package name.

## 2. Uninstalling packages

Uninstalling packages is just as easy as installing them. Instead of “install”, you simply replace it with “remove”. Let’s use our “sl” package from earlier as an example.

```
sudo apt remove sl
```

Your output should look something like this:

(Image on original post)

As before, if it asks you if you wish to continue, press Y on your keyboard. Otherwise, if the output is similar to this, congratulations! You’ve successfully removed a package with Apt!

## 3. Updating packages
With Apt, updating is a simple process, and it updates all installed packages at once. Simply run this command:

```
sudo apt update
```

I won’t attach an image here because depending on how many packages you have installed, the output can get quite lengthy. However, it will most likely ask for confirmation, so press Y on your keyboard when prompted. update checks all mirrors for the latest version of each package and installs it if the mirror’s version number is higher than your system’s.

## In conclusion
In this tutorial you learned you to install, uninstall and update packages with the Apt Package Manager. If you enjoyed this article, please comment and share!
PostgreSQL cheat sheet for beginners
Tags: postgres, beginners
Published: 2020-10-12 23:42:05


PostgreSQL also called Postgres, is an open-source, object-oriented relational database management system released under the PostgreSQL license. In this post, I wanted to do a little cheat sheet on how to use Postgres with examples, because if you are like me, sometimes I need a little quick glance to the instructions and I thought will be helpful for someone have this info in one place.

#### Create a table
```
CREATE TABLE [IF NOT EXISTS] person(
   document INTEGER NOT NULL,
   documentType SMALLINT NOT NULL
   name VARCHAR ( 50 ) NOT NULL,
   bithDate TIMESTAMP NOT NULL,
   PRIMARY KEY (document , documentType ),
   FOREIGN KEY (documentType)
      REFERENCES type(code),
);
```
#### Drop a table
```
DROP TABLE [IF EXISTS] person
[CASCADE | RESTRICT];
```
If you remove a table that does not exist, PostgreSQL issues an error. To avoid this situation, you can use the IF EXISTS, I always added just in case.
On the other hand, the CASCADE option allows you to remove the table and its dependent objects meanwhile the RESTRICT option rejects the removal if there is any object depends on the table. The RESTRICT option is the default if you don’t explicitly specify it in the DROP TABLE statement.
#### Alter a table 
```
/* Add a column */
ALTER TABLE person 
ADD COLUMN passportNumber INTEGER;

/* Delete a column */
ALTER TABLE person 
DROP COLUMN passportNumber ;

/* Rename the column*/
ALTER TABLE person 
RENAME COLUMN document 
TO documentNumber;

/* Add a constraint at the table */
ALTER TABLE person 
ADD CONSTRAINT unique_passport UNIQUE ( passportNumber );
```
#### Manage data
```
/*Insert to the table*/
INSERT INTO person(document, documentType, name, bithDate ) VALUES (1020754, 2, 'Jane Doe', '13/02/1998');

/*Delete*/
DELETE FROM person
WHERE document = 1020754;

/*Update*/
UPDATE person
SET bithDate = '1998-02-14' 
WHERE document = 1020754;
```
To finish I want to give you a little bonus if you need to insert a lot of registers you could use COPY, It's a convenient way to transfer data between files and tables, but it's also much faster than INSERT when more than a few thousand rows are added at a time.
```
COPY copy_test FROM '/path/sample_data.csv' DELIMITER ',';
```
I hope you find this helpful and thank you for reading!!
My top favorite chrome extensions as a web developer 💻
Published: 2020-10-12 23:36:51

I am currently a junior web dev that focuses mainly on C# and Js and i have a couple of favorite chrome extensions that make my life easier.
You can get all these extensions by visiting [chrome web store](https://chrome.google.com/webstore/category/extensions)

1. **JSON Viewer Awesome 👁**
from the name you can understand what this does... and believe me it is awesome. it makes viewing api calls on the web as elegant as it can be, thew viewer is clean and can be turned off for specific websites in the settings.
Download it [here](https://chrome.google.com/webstore/detail/json-viewer-pro/eifflpmocdbdmepbjaopkkhbfmdgijcc)

2. **Pesiticide 🦟**
Have you ever seen a website and wanted to boil down the layout to divs, well pesitcide does that perfectly, i cannot tell you how useful this extension was for me. Any time i wanted to clone a website for fun, pesticide has always been a first choice for me
Download it [here](https://chrome.google.com/webstore/detail/pesticide-for-chrome-with/neonnmencpneifkhlmhmfhfiklgjmloi) 

3. **ColorPick Eyedropper 🎨**
Ever saw a color on a page and wanted to get the color code? then i suggest you give ColorPick a try!. It can get you the color of almost anything on the page, including images!!
Download it [here](https://chrome.google.com/webstore/detail/colorpick-eyedropper/ohcpnigalekghcmgcdcenkpelffpdolg)

4. **Wappalyzer 👓**
I mainly use this extension for pleasing my curiosity, it enables you to view the stack that a certain website implements, then this allows me to know what companies use the technologies im currently invested in and apply to jobs!!. I think this is a must have for every developer
Download it [here](https://chrome.google.com/webstore/detail/wappalyzer/gppongmhjkpfnbhagpmjfkannfbllamg)

5. **Daily.dev 🛎**
This extension i have been using religiously every day since its release!!. It is basically a one stop shop to view all the latest dev blogs from numerous sources, sounds basic i know but still, i love how it becomes the default page when you open a new tab, so if any blog catches my eye in the moment, i can easily view it.
10/10 would recommend
Download it [here](https://chrome.google.com/webstore/detail/dailydev-news-for-busy-de/jlmpjdjjbgclbocgajdjefcidcncaied)

6. **Font scanner** 
This is the best font finder in my opinion. just click on the text and get the font. very easy, very useful
Get it [here](https://chrome.google.com/webstore/detail/font-scanner/pankoblgliibmjaiapnopacolofdbdpj)

This is my first post on dev!🚀
--Thanks for listening---
Found Solution to a Bug
Tags: webdev, beginners
Published: 2020-10-12 23:32:09

Hey, all.

I had been working on a little frontend project of mine for sometime now and i ran into an issue that took me a couple of days to figure out.

For some reason, the API request was returning an empty data object when called with Axios or fetch API but was working fine and returning the expected data on postman.

After all said and done, i decided to try other browsers( Safari and Chrome) and the requests returned the data as expected. Did some digging and i believe the issue had something to do with CORS(not sure how or why, but yeah lol).

That's all for now guys. We live to solve another bug.


PS: I use Brave as my default development browser
Ohhh, a SIGTERM signal! 
Tags: codenewbie, node, linux, beginners
Published: 2020-10-12 22:46:46

![Red "slo" sign among green trees on modern city street, Photo by Tobi Law from Pexels](https://dev-to-uploads.s3.amazonaws.com/i/obqna60fm2rdqz96lhme.jpg)

Fun fact: When you use `Ctrl + C` to stop your application, that sends a `SIGTERM` signal. 

Oh a `SIGTERM` signal! 🐧🧊
...
What's a `SIGTERM`? 🐧
What's a signal? 🧊

A **signal** is basically a road sign for a computer. Stop, slow down, prepare for a stop, road closed, etc... It's referred to as a form of "inter-process communication" or IPC and is typically used in POSIX-compliant operating systems. POSIX being "Portable Operating System Interface" which is just a set of standards used to help operating systems work well-ish with each other. 

A **`SIGTERM`** is a type of signal, namely of the "prepare for a stop" variety. It's a type of signal that your code can "catch" and use - usually to wrap up any processes you have going on before the application shuts down fully. This is in contrast to `SIGKILL`, which just shuts down automatically.

## Graceful Shutdowns
Why is this important? You can "catch" and handle a received `SIGTERM` to perform a graceful shutdown of an application.

A graceful shutdown can include: 
- Stopping new requests from coming in
- Finishing any ongoing requests
- Cleaning up resources (like database connections)

It leaves your app, resources, and users in a happy place. 

For some apps, this will require a significant amount of configuration. Sometimes though, all you need is a timeout to let a process finish: 

```javascript
process.on('SIGTERM', shutdown);

const shutdown = () => {
  const gracePeriodInMS = 30000;

  setTimeout(() => {
    process.exit(0);
  }, gracePeriodInMs);
}
```

Code well, my friends!

**More resources:** 
[Graceful Shutdown in NodeJS](https://hackernoon.com/graceful-shutdown-in-nodejs-2f8f59d1c357)
[Linux Manual Page - Signals](https://man7.org/linux/man-pages/man7/signal.7.html)
[Graceful Shutdown with NodeJS and Kubernetes](https://blog.risingstack.com/graceful-shutdown-node-js-kubernetes/#settingupgracefulshutdown): *I particularly like the "How does it work" image here. I'm all about the visual representations!*
Why did you decide to study Software Engineering?
Published: 2020-10-12 22:26:07

My name is Hal H. Nader. I was born in Nyack, NY and raised in Port-au-Prince, Haiti. I would like to think that I have my own relationship with technology that contributed greatly in me wanting to be a software engineer today. My real significant interaction was when I accidentally came across a music production software on my uncle's computer called Fruity Loops. I was probably 11 years old. I had no idea what it did and was even more perplexed by the user interface. Nonetheless, my mind was blown when it started making sounds that I had unknowingly programmed into a step sequencer. Fast forward 10 years, I ended up attending Full Sail University and studied the Music Industry. Along the way, I held multiple jobs in the Telecom industry and needless to say that technology was a big part of what I did. More often than not, I'd hear terms like 'software', 'programming' and other similar verbiage thrown around so I eventually caught on. I understood early on the immense power of being able to code and alter the web as you pleased. Being able to make your own content or coming up with algorithms that will change the way things are done in a field or industry. I also got into coding as a way to reinvent myself and switch fields because I hated my life. I want to be able to work, be there for my child and make enough of a salary to be financially free eventually. Another aspect of coding that is very fulfilling for me is solving problems and being challenged by my code. I am very excited about my choice of attending Flatiron and looking forward to my new lifestyle.
MERN stack ecommerce web service FE and BE both...
Tags: react, node, express, mongodb
Published: 2020-10-12 22:07:26

Hello everyone, again its too late when i was creating regularly blogs here. sorry for that. life is too short to all the things🤷‍♀️🤔

Well, recently i started working on a ecomm web service Frontend and Backend both. it is mern stack based project.

it will be a ecommerce product, so it will be having all the features what you expect from a Ecommerce platform.👀😃

i am posting link of my repo, please have a look, ask question, make PRs and learn and grow together. 👍🤳🎉

[Go to repo and download the project](https://github.com/Meenachinmay/MERN_ecomm)


__Project is still going and not completed__

Thanks, see you again.
__would love to know suggestions in the comments__✔🤳🎉👍
What songs help get you "unstuck"?
Tags: productivity, discuss, music
Published: 2020-10-12 22:00:54

---
title: What songs help get you "unstuck"? 
published: true
description: 
tags: productivity, discuss, music
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/f2y630eiwr7o9q6fpjib.jpg
---

Hello friends!

In honor of Monday and the new season swirling around outside my window, I have a simple question about productivity and resetting your brain...

> ### _Assuming music is part of your daily life, **is there a particular song that helps rest your focus?** Maybe you listen to it while coding, or maybe you take a walk around the block with headphones in when you need a context-switch..._

For me, it's Avril 14 by Aphex Twin. I've loved this beautiful melody for a long time, but it actually really helped to clear my writer's block last Friday — _and_ inspired me to buy a keyboard piano over the weekend so I can learn to play it myself! How about you?

Music is magic and the great equalizer, as far as I'm concerned. Happy Monday! Wishing you a productive and melodic week. 

{% youtube F6dGAZTj8xA %}
Day 236: I never knew
Tags: hiphop, code, coding, lifelongdev
Published: 2020-10-12 22:00:51

_liner notes_:
- Saturday : Don't really remember what I did on Saturday. Just know I did the radio show and had a pretty good time! The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Radio show image of a tweet from Scarface looking for a kidney donor with the words Oct 10th 2020 and The fly knows](https://dev-to-uploads.s3.amazonaws.com/i/qm848gkqdr5r51bolojf.jpg)

- Sunday : Again, not sure what I did. Pretty sure I did the post radio show promo work. I remember watching the Walking Dead shows. I also practiced and got my work laptop set up for the live stream show I had early the next morning.

- Professional : Got up early to double check my set up for the show I was going to be on. Did the show. Basically live coded an application for 2 hours straight and explained what I was doing. It was fun and nerve racking. From the stats gathered after the show, it seemed to do pretty well. The chat was pretty engaged and asking questions. I never knew how much of an effect of people watching made on my typing errors. haha I'm normally bad, but it made it worse. haha Had fun and got good feedback. Then the rest of my day was meetings. I was so tired, I had to take a nap. haha

- Personal : Didn't do too much on my side project besides exact the chat/ask questions section into it's own component. Hoping to work on that more. Pretty much after that, I just have to add it to the website that users will be using and it should be pretty ready to go.

![Cliffs of Maui, HI at sunset](https://dev-to-uploads.s3.amazonaws.com/i/vkzpg0ds3tc0zr4sxizy.png)

So, I'm off for the rest of the week and a coworker is in the state visiting some family and asked if we could meet up. I'm going to take the van in for a scheduled maintenance check up. Might be a good opportunity for a road trip. We'll see. I'll be back in about a week!

Have a great night and week!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube AzJ7n3Z4wRM %}
The .NET Docs Show: The .NET Foundation and .NET open-source
Tags: dotnet, opensource, dotnetdocsshow
Published: 2020-10-12 21:53:07

---
title: The .NET Docs Show: The .NET Foundation and .NET open-source
published: true
description: The .NET Docs Show is joined by Claire Novotny for a discussion about the .NET Foundation and .NET OSS.
tags: dotnet, opensource, dotnetdocsshow
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/wdqe09ip170lsh7i4i02.png
---

In this episode of [The .NET Docs Show](https://dotnetdocs.dev/), Claire Novotny ([@ClaireRNovotny](@https://twitter.com/ClaireRNovotny)) shares the what, why, and how of the .NET Foundation.

The #HallwayTrack segment offered insight into why the .NET Foundation exists. Claire explained how a project would apply for membership and what benefits the project would receive. We learned that generous donations from corporate sponsors fund the foundation's efforts. Another smaller chunk of money comes from annual membership dues, which are optional.

This segment also discussed the composition of the board of directors. We heard what each board member is focused on and how that relates to the bigger picture. Additionally, Claire explained how the foundation is supporting user groups during COVID-19. Though Meetup is the foundation's single biggest expense, this virtual user group program is a critical support mechanism for the .NET community during these unprecedented times.

{% youtube RBb-iuElZxI %}

If you liked this video and want to see more of our .NET content, subscribe on [YouTube](https://www.youtube.com/dotnet) and follow us on [Twitter](https://twitter.com/dotnetdocsshow). 

# #CheckUp

- [Open-source library guidance](https://aka.ms/dotnet-open-source)

# Useful links

- [The .NET Docs Show](https://dotnetdocs.dev)
- [Nerdbank.GitVersioning NuGet package](https://www.nuget.org/packages/Nerdbank.GitVersioning)

## .NET Foundation resources

- [All-hands Fall 2020 meeting](https://aka.ms/dnf/all-hands-fall-2020)
- [Mission statement](https://github.com/dotnet-foundation/website/pull/388)
- [New project onboarding details](https://dotnetfoundation.org/projects/submit)
- [Budget](https://dotnetfoundation.org/about/budget)
- [Community and "I am .NET"](https://dotnetfoundation.org/community)
- [Board of directors](https://dotnetfoundation.org/about/board-of-directors)
Bash Cut Operation
Tags: bash, linux
Published: 2020-10-12 21:50:31

As promised, here is the next addition to my bash blog series. In this article, I wanted to cover the cut operation. With knowledge of the cut operation parsing, sorting, and reading data becomes a lot easier in bash. This post covers the basics of cut and should give a good foundation to use it how you see fit. 

##Cut 
To get the information you want from your string, data, or whatever else just follow it with | cut and the flag of your choice. The example below uses the character flag:
```
read line
echo $line | cut -c 3
```
The command above reads in a line and then outputs the third character of whatever was input. This is done by placing the -c(character flag) after cut and then giving the placement of the character you want from the string(starting from 1). This can also be extended to cut multiple characters using either a '-' or ','. For example:
```
read line //=> Hello World
echo $line | cut -c 1-5 //=> Hello
echo $line | cut -c 1,5,8 //=> Hoo
```

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1x9ibs5ronzmxpda4z7j.jpg)

##Cutting Flags
There are many different flags that can be used with cut other than the character flag; read more [here](https://www.folkstalk.com/2012/02/cut-command-in-unix-linux-examples.html). I want to cover two very useful flags the -d, and -f flags. The -d or the delimiter flag specifies what to cut the input on. The -f or field flag allows you to specify the index of the items you want back from what you split with the delimiter flag. These two are often used together to get back specific chunks of information.
For example:
```
read line //=> hi how are you
echo $line cut -d $' ' -f 1-3 //=> hi how are
```
There are many more ways to use this command and other flags to explore. I would love to see any examples I missed here and hear any feedback to make this series better. Next week I will cover reading from a text file.
Explicit Over Implicit: More Code Is Better
Tags: python, codenewbie
Published: 2020-10-12 21:43:28

_Originally posted on [alanwsmith.com](https://www.alanwsmith.com/) by [@TheIdOfAlan](https://twitter.com/TheIdOfAlan)_

---

I’m looking for examples to use as examples (e.g. “lists of names, lists of animals, simple math equations, etc.."). Turns out, it’s hard to look up sets of examples _for_ coding without getting examples _of_ coding<sup>1</sup>. That’s fine, even if it’s a little meta.

During my search I found [this post titled Coding Best Practices](https://www.topcoder.com/coding-best-practices/).

The bullet points make sense. Use consistent indentation, follow the DRY principle, etc… But, I side-eyed the “Keep The Code Simple” example<sup>2</sup>. It says this:

```python
def numbers_are_in_range(*, a, b, c):
    if a < 0 and b > 0 and c == 0:
        return True
    else:
        return False
```

should be written like this:

```python
def numbers_are_in_range(*, a, b, c):
    return a < 0 and b > 0 and c == 0
```

Fewer lines? Sure.

Simpler? Not so much.

That code is harder to understand.

Implicit returns (like the second snippet) take more brain power to deal with than explicit ones (like the first example)<sup>3</sup>. In this case, you know at a glance that the first snippet will return one of two possible values: True or False. In the second snippet, you have to mentally walk through the formula to reason out what the possibilities are.

You don’t notice the effort when you’re writing the initial code. The context is already in your head. It’s every other time we use it that we’ll feel the impact. We spend infinitely more time in the future working on our code than when we first write it. It’s in our best interest to make things as clear (and as explicit) as possible for our future selves.

Equating fewer lines with simpler code is an easy mistake to make. But, it’s not always the case. Don’t be afraid of those extra lines when they add clarity. They’re your friends.

---

_Footnotes_

1. I’ve realized that I can go to the wonderful exercism.io for examples of examples.

2. Yep. I translated the example into python functions. And, while I don’t want to get into it in this post, I wonder if there’s not be a cleaner way to code the conditional as well as.

3. Don’t just take my word for it. The Zen of Python’s second line is literally:

> Explicit is better than implicit.