teleren/devto huggingface dataset:
Get the ip address in Ubuntu without ifconfig or ip command
Tags: ubuntu, linux, cloud, beginners
Published: 2022-12-04 02:49:11

**Question:**
Today I got a new Ubuntu server. I tried to get its IP address with the ifconfig or ip commands.

But I got a command not found error. I searched the errors on Google, and it looks like I need to install package to run these commands.

But I don't have sudo access. Is there any other way to get the IP address without these commands?

**Answer1**:
You can try using Python. It is installed by default on most distributions. It is very easy to use.

```
$python
>>> import netifaces as ni
>>> ni.interfaces()
['lo', 'eth0','eth1','eth2']
>>> ni.ifaddresses('eth0')
{17: [{'addr': '02:93:07:be:da:d9', 'broadcast': 'ff:ff:ff:ff:ff:ff'}], 2: [{'addr': '10.0.0.76', 'netmask': '255.255.255.0', 'broadcast': '10.0.0.255'}], 10: [{'addr': 'fe80::93:7ff:febe:dad9%eth0', 'netmask': 'ffff:ffff:ffff:ffff::'}]}

```

In the above example, there are four interfaces lo, eth0, eth1, eth2. The ip address for eth0 is 10.0.0.76.

A Linux server can have more than one network interface. You can check out my post on my website  [here](https://www.howtouselinux.com/post/check-ip-address-in-linux)  to get more info about this.

This Python script displays the mac address, ip address, netmask for each network interface.

Related:  
[3 Easy Ways to Find IP address in Linux](https://www.howtouselinux.com/post/check-ip-address-in-linux)
[3 Ways to fix ifconfig command not found in Linux](https://www.howtouselinux.com/post/ifconfig-not-found-in-linux)

Here's another way to get the IP address without using a python package:

```
import socket
import fcntl
import struct

def get_ip_address(ifname):
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    return socket.inet_ntoa(fcntl.ioctl(
        s.fileno(),
        0x8915,  # SIOCGIFADDR
        struct.pack('256s', ifname[:15])
    )[20:24])

get_ip_address('eth0')  # '192.168.0.110'

```

You can refer to  [this post](https://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-from-a-nic-network-interface-controller-in-python)  to get more about how to use Python to get ip address.

**Answer2**

If you are simply a  user  on an Ubuntu server, and the administrator has disabled your access to certain tools, it may be difficult to determine  which  tools you have available. The  `ip`  command is typically available to end-users, but perhaps there's a path issue (unlikely):

```
/usr/bin/ip addr show
# or
/bin/ip addr show
# or (could be restricted)
/sbin/ip addr show

```

Alternatively, you can try using  `curl`  to access an external service that will detect your public IP. There are quite a few out there - I just went with the first search result I found:

```
curl ifconfig.me/all
```
How ::before and ::after work
Tags: webdev, css, tutorial, beginners
Published: 2022-12-04 02:45:55



# How they work
The `::before` and `::after` Pseudo-elements are used to add content before and after the main content. As an example, in the codepen below you'll see that the before content (cyan) is before the main content and the after content (red) is after the main content. To make it you first add the element or class you're selecting then add a `::before` or `::after` or both. Then you add the `content` property, without it the psuedo won't be created. After that you can style it in any way you want. 

```css
h1::before {
  content: 'pick';
  background-color: cyan;
}

h1::after {
  content: 'relevent';
  background-color: red;
}
```
{% codepen https://codepen.io/lensco825/pen/JjZedbL %}

<hr>

#The Content
 Strings aren't the only things you can put as content. You can also add images using the `url` constructor, however it won't show any content that you put in it since the computer believes that the image is the content itself. let's say you didn't want to put quotation marks on your main content even though it's a quote, you can type `open-quote` or `close-quote` in the content property. If you're using the before pseudo as a counter for ordered lists, you can use the `counter` constructor and choose the way you want the order to be.

<hr>

#A way to use it
A common way to use it is by giving the user a description of something that they hover over. We simply do this by using either a before or after element, the content will be the description. After that, we stylize it and then position it near the main content. It will have an opacity of 0 but when it's hovered it'll be 100%, we give it the transition by using the `transition` property and setting it to 0.3 seconds. On the codepen below, we'll get its definition if we hover on the word below!
{% codepen https://codepen.io/lensco825/pen/abKQYvQ %}
how to change the account password expiration date in Linux
Tags: linux, beginners, cloudskills, tutorial
Published: 2022-12-04 02:36:29

**Question**:
I am confused about the password expiration date in Linux. Looks like chage command -e changes the account expiration date not the password expiration date. 

Two things are totally different. I can not find any command that can be used to change the password expiration date.

All Linux commands change the user expiration date. is there any way to do this? Thanks a lot.

**Answer**:

Use chage -M. For example, to set 90 days as the maximum before password expiry enter sudo chage -M 90 <username>.

EDIT: To set an exact expiration date you need to figure out how many days that are between the Last password change date (see chage -l) and your desired password expiration date and then use that number in chage -M.

Reference: https://www.howtouselinux.com/post/change-user-password-expiration-date-in-linux
Discord bots are cool!
Tags: opensource, javascript, discord
Published: 2022-12-04 02:05:35

Hey there! 

This post is a follow-up to my previous one, where I discussed my plans for making a bigger contribution than I have ever before. 

If you remember, I was talking about adding a feature to a Discord bot called [wego-overseer](https://github.com/rickklaasboer/wego-overseer). I have made some progress, so let me tell you how it went.

## Project set-up

In regards to installation, there was little to no issues. It is written in TypeScript, and uses yarn as the package manager.

I have never worked with yarn, and downloaded a wrong experimental version by accident... but regardless, everything code-related was set up, but the bot wouldn't just work like that. First, I needed to set up my Discord account and bot.

## Adding an application and a bot to my account

Discord has a very thorough [beginner's guide](https://discord.com/developers/docs/getting-started), which I used as a reference.

First, I created an application for this bot and any potential future ones I might develop. I made sure to capture the Application ID, and went ahead to creating the bot.

Under Bot section, I created a new one and took a note of the token for the project to be able to run. Then, I went to OAuth settings, checked needed permissions and retrieved a bot-invite URL, where I invited the bot to my test server.

All I needed to do from this point on was to run the code, and the bot finally came to life!

## Coding progress so far

I began from creating a simple command like Hello World. Thank you to the project team for the great guide on their README on how to do it!

After I created and tested the new command, I started adding more relatable logic, which included a lot of documentation-searching and researching, since I have never worked with anything like that before.

In the end, I ended up with a simple poll logic of "yes", "no", and "unsure".

## Finishing up (until next addition)

After I have completed a simple implementation of the feature, I opened a [draft pull request](https://github.com/rickklaasboer/wego-overseer/pull/62), and asked the maintainers for some feedback on the work and on my ideas.
MongoDB Atlas Hackathon 2022 on DEV
Tags: atlashackathon22, mongodb, mern, nodej
Published: 2022-12-04 01:11:49

## What I built

I have built a **vanilla JavaScript application** that interacts  with **Node Js and express Js back-end** and a **MongoDB Database** , it uses the  **Atlas search** to suggest for you the best recipes results bases on a search index. Read the Description for more details 
  


### Category Submission
Search No More
### App Link

https://rich-lime-piglet-tam.cyclic.app/

### Screenshots

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/09zhjgnbvx6sc5zwl85i.jpg)

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

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


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

### Description

 **Forkify** is a vanilla JavaScript application that interacts with the **Forkify API**  to fetch and display recipe food data. The user can search for a specific recipe and save it to a favorite list via local storage. The user can easily increase or decrease servings as per his need and can view detailed directions. You can add your own recipe to the list, it will be automatically added to your bookmarks.
the search functionality  is implemented with **MongoDB atlas search** to suggest to you the appropriate recipe for you base on a search index on recipes name.

### Link to Source Code
https://github.com/sohaibMan/FORKIFY-FIND-YOUR-RECIPE
### Permissive License

You can use this project code for learning purposes only 

## Background

(What made you decide to build this particular app? What inspired you?)

I am preparing for MongoDB developer path so I decided to practice a little bit what I've learned with this simple app.


### How I built it
(How did you utilize MongoDB Atlas? Did you learn something new along the way? Pick up a new skill?)

For the _Front end_ I have used **Vanilla js ** with the **MVC** software architecture and **OOP** principles.

For the _back end _**Node js** with **express Js** to build the search API 
finally as a _database_ I have used MongoDB Atlas for managing my database cluster(duplication,Sharding,scalability,hosting,...) and also the embedded full-text  Atlas search engine for the search functionality ,it makes the search queries faster and much easier ,because I didn't need to break my head to sync between the search database for example Elastic search and the backend server. and I have used also the Atlas aggregation pipeline to visualize the flow of the data across all pipeline stages 

### Additional Resources/Info
Don't hesitate to contact me in LinkedIn
https://www.linkedin.com/in/sohaibmanah/
DPS909 Blog: Issue Progression
Published: 2022-12-04 00:57:16

This post is an update on my progress on the issues I selected to work on in [my previous post](https://dev.to/alexsam29/dps909-blog-planning-issues-to-fix-446n) for Release 0.4.

## Progress
I began my work on [issue #201](https://github.com/ayoayco/astro-reactive-library/issues/201). I was initially confused by the the description of the feature to be implemented, so I asked the project maintainer to explain it further. Another project contributor also further explained what was needed and this really helped me out. I also read up further on the Astro framework to understand how the project is put together. I started with the documentation explaining how [Astro components](https://docs.astro.build/en/core-concepts/astro-components/) work and read on from there.

After reading through the Astro documentation and going through the project documentation again, I experimented with the source code for a while just to see how I would implement the requested feature. The most difficult part about this was just trying to figure out how all the files work together. There are a lot of files in this project and it's easy to get lost. By the end, I felt like I knew the ins and outs of the entire project, so I began to code the feature into my forked version of the project.

By the end of the week, I opened a [pull request (PR)](https://github.com/ayoayco/astro-reactive-library/pull/224) with my feature implementation. I described what changes/additions I made and noted areas that require focus after the PR is merged.

The project maintainer and one other reviewer made comments on my PR which I ended up addressing and making the requested changes. Now I am just waiting for any further comments and for the PR to be merged.

## Remaining Issues
Now that I've nearly solved one issue, [issue #211](https://github.com/ayoayco/astro-reactive-library/issues/211) seems like it'll be a smoother process since it is relates to the same area of the project and I've already went through most of the documentation. So my plan for the coming week is to hopefully open a PR quicker than I did for the first issue. If no problems occur and I still have time before the deadline, I will attempt to solve another issue in the project.
Estandares de escritura C# (Parte II)
Tags: csharp, dotnet, programming, spanish
Published: 2022-12-04 00:14:48

Hola amigos, anteriormente hablamos sobre los estsndares de escritura, ahora en este post acompañame a ver las convenciones de lenguaje.

##Tipos de datos String

Para las concatenaciones de estring es recomendsble utilizar las interpolaciones de cadenas.
```csharp
string displsyName = $"{nameList[n].LastName}, {nameList[n].FirstName}";
```
---
##Tipos de datos sin signo

Cuando desarrollamos en C&#35; es mejor utilizar `int` en lugar del uso de tipos sin signo, usar `int` es más común en todo C&#35; y de hecho es más facil de interactuar con otras bibliotecas cuando se usa `int`.

---

##Matrices

Para lasmatrices es mejor utilizar una sintaxis concisa para la inicialización de matrices en linea de declaración.
```csharp
string[] vowels = { "a", "e", "i", "o", "u" };
```

En cuanto a las convenciones y estándares de C# hemos abordado las más importantes y útiles. En el futuro abordaremos los estándares para consultas con  LINQ. Espero les haya gustado. Hasta la próxima.

_*¡Happy Hacking!*_
What is the future of a web dev? What is your destiny?
Tags: webdev, javascript, react, opensource
Published: 2022-12-04 00:01:03

In the Internet culture, at least in the web dev culture, there is a meme about the Javascript frameworks.

We have new frameworks rising every week. And we have companies asking for **2, 3, or more years of experience** in them (_wtf_).
But that is not the problem here.

**The problem is there are no standards.**

Or, at least, _not enough_.

Of course, you could go and use Angular and have a pattern for the project. But **let's focus on the most used technologies in the life of a typical front-end developer**. Let me give you a quick list of things good to know:

- React.js
- Typescript (_obviously_)
- Next.js (_and you should start checking the following changes in Next.js 13_)
- Tailwind
- A UI Kit would be fantastic; maybe Chakra UI, MUI, Mantine…
- Some testing systems, like Cypress

Now, with that, you have the basics. You could even use only Tailwind and not a UI kit.

But, it is good to learn more alternatives. For React, you want to explore also Vue. For Next.js, you could explore **Remix.js**. For Tailwind, you could use CSS modules or maybe integrate Tailwind Elements and use Tailwind more like a UI Kit. For the UI Kit, **you have dozens of alternatives** and, inside of them, different themes and **sub-libraries based on them**. And so on.

I won't say alternatives are inadequate. I love testing new tech every weekend. So **it is not harmful to have different ways** to achieve the same, like using Tailwind classes, a UI Kit component, or plain CSS inside a CSS module.

This is a cool thing to do for a front-end developer with a few years of experience.

But newcomers and juniors **will feel overwhelmed with all the options.** And when they start exploring one and decide to switch to another one, they need to learn a different pattern to develop there.

And let's not talk about every NPM library being developed differently.

**I like options.** But I don't feel like **the solution to a problem is to create a new library.** At least not always. Maybe you can contribute to one of the open-source projects and implement those solutions there.

But I am interested in hearing you, the reader, and my fellow devs. **What do you think about the current and future state of the frameworks and libraries?**

## 🌎 Let's Connect!
- [Twitter: @thenaubit](https://twitter.com/thenaubit)
The Perl outlook for next year is favorable
Tags: perl, c, cpp, linux
Published: 2022-12-03 23:41:26

The Perl outlook for next year is favorable for me.

AI, machine learning and IoT need more and more C/C++ for calculation in low level layer.

SPVM is a Perl module that is created by me. This module ease the binding C/C++/CUDA.

And Perl is good at text processing on Linux that is not good at for C/C++.

The combination of Perl and C/C++ is very good because they complement each other perfectly.
A hacker view of your github profile
Tags: webdev, javascript, react, uiweekly
Published: 2022-12-03 23:37:05

For my next project while learning React.js. I created a app where you can view your github profile with greenish ui.

I just started to create the app and currently working on the mobile view of the profile page.

Check your own profile with the following link format.

`https://githux.vercel.app/{username}`

Github profile: https://githux.vercel.app/github

Repo: https://github.com/junsantilla/githux
🎄 JS Advent #3 - Object.hasOwnProperty()🎄
Tags: javascript, webdev, beginners, programming
Published: 2022-12-03 17:53:12



#### For the month of December I have challenged myself to write 24 articles about JS up until Xmas.
#### The third installment in this series is about Object.hasOwnProperty().

Object.hasOwnProperty() returns a boolean value if the provided property is present on the calling Object.

Example:
```javascript
let obj = { name: 'Sarah', age: 20 };
console.log(obj.hasOwnProperty(name)); // true
console.log(obj.hasOwnProperty(job)); // false
```

Will still return true even if the value is null or undefined: 
```javascript
obj.property = undefined;
obj.anotherProperty = null;
console.log(obj.hasOwnProperty(property)); // true
console.log(obj.hasOwnProperty(anotherProperty)); // true
```

##### hasOwnProperty vs in vs dot/bracket notation
You can also check for a property on an object using the `in` operator or by using dot/bracket notation.

```javascript
name in obj // true
!!obj.name // true
!!obj["name"] // true
```

`Object.hasOwnProperty` does not check for inherited properties, only direct properties. We know that most things in JS inherits from `Object` which has its own methods, one of which is `toString()`.
Dot/bracket notation also checks for inheirited properties.
```javascript
toString in obj // true
obj.hasOwnProperty('toString') // false
obj.toString // function toString()
```

Dot and bracket notation will coerce the value to truthy/valse value so if it is not set correctly it will return false.
`Object.hasOwnProperty` and `in` will still return true.
```javascript
obj.value = 0;

// These blocks will not be executed as 0 is falsy
if (obj.value) { }
if (obj["value"]) { }
```
[< JS Advent 2 - Mutable and Immutable methods](https://dev.to/jtlavs/js-advent-2-mutable-and-immutable-methods-2c29)
SPVM::Resource::SocketUtil 0.01 is released on Perl/CPAN
Tags: spvm, perl, cpan, socket
Published: 2022-12-03 23:28:00

<a href="https://metacpan.org/pod/SPVM::Resource::SocketUtil">SPVM::Resource::SocketUtil</a> 0.01 is released on Perl/CPAN.

This module is a <a href="https://metacpan.org/pod/SPVM::Document::Resource">resource</a> module for socket utilities.

```
  #include "spvm_socket_util.h"
```

Functions:

```
  int32_t spvm_socket_errno (void);

  void* spvm_socket_strerror_string (SPVM_ENV* env, SPVM_VALUE* 

  const char* spvm_socket_strerror(SPVM_ENV* env, SPVM_VALUE* 
```
 

## New Features and Enhancement

<a href="https://github.com/yuki-kimoto/SPVM-Resource-SocketUtil/blob/master/Changes">Changes</a>

```
0.01 2022-12-04
  [Changes]
    * First release.
```
AngularJS ngBootstrap5
Tags: javascript, angular, webdev
Published: 2022-12-03 23:08:50

I finally finished this library in AngularJS I've been working on. its in AngularJS or Angular v1 because I was working on a project that was already done in Angular v1 and bootstrap doesn't have library for their Bootstrap v5 CSS. It's kind of like UI Bootstrap. Any way I put it out there for anyone like me that has to work with an Angular v1 project. You can get it [here](https://github.com/adamclayd/angular-bootstrap-5)

ngBootstrap5 supports and adds convenience to:

Accordions
Collapse
Alert
Progress Bar
Tabs
Resolvable Modals
Tooltips with a template url
Compiled Popovers with a template url
Good Pagination
Star Rating Widget
A Datepicker made in entirely Bootstrap
Full List of NordVPN Accounts
Published: 2022-12-03 23:03:31

Were you looking for free Nordvpn Premium Accounts? Than you have come to the right place.

Here you will find hundreds of Nordvpn Premium Accounts 2022 with username and password.

[Full List of NordVPN Accounts 2023
](https://flotechtips.com/nordvpn-premium-accounts/)
[](https://flotechtips.com/nordvpn-premium-accounts/)
Final Weekend of the MongoDB Atlas Hackathon 2022 on DEV!
Tags: meta, atlashackathon22, mongodb, atlas
Published: 2022-12-03 23:00:01

---
title: Final Weekend of the MongoDB Atlas Hackathon 2022 on DEV!     
published: true
description: It's the final weekend of the MongoDB Atlas Hackathon 2022 on DEV. Don't miss your chance to participate!
tags: meta, atlashackathon22, mongodb, atlas
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x8zmd1e5wkgn1tjvr0ii.png
---

#### *The MongoDB Atlas Hackathon 2022 on DEV closes on Dec 8th @ 11:59 PM UTC. Don't miss your chance to build a new app and win prizes for it!* 

--- 

The MongoDB Atlas Hackathon 2022 on DEV closes next Thursday!

If you haven't joined in yet, we encourage you to consider it — we think many of the folks in this community will enjoy using [MongoDB Atlas](https://www.mongodb.com/atlas?utm_campaign=dev_hackathon&utm_source=devto&utm_medium=referral), a full developer data platform offering built-in data services for full-text search, analytics, data visualizations, edge-to-cloud sync and more.

By submitting a valid project, you stand to win one of five Grand Prize packages, which include... 
- $1,000 USD gift card or equivalent
- $300 USD credit to the Forem Shop
- MongoDB Grand Prize swag package
- $50 in Atlas credits
- DEV Sticker Pack
- DEV “MongoDB Atlas Hackathon 2022” Grand Prize profile badge


In addition, 10 runners-up will win... 
- $500 USD gift card or equivalent
- $150 USD credit to the Forem Shop
- MongoDB Runner-Up swag package
- $50 in Atlas credits
- DEV Sticker Pack
- DEV “MongoDB Atlas Hackathon 2022” Runner-Up profile badge

Finally, ALL participants with a valid project will get a DEV sticker pack and a digital participant profile badge.   


**[>> Click here to read the rules and join in](https://dev.to/devteam/announcing-the-mongodb-atlas-hackathon-2022-on-dev-2107).**


If you'd like to tell us how your project is coming or meet the other participants, check out the MongoDB Atlas Hackathon 2022 [Community Discussion Thread](https://dev.to/devteam/community-discussion-thread-mongodb-atlas-hackathon-2022-on-dev-444l). 

If you need help with your project or have a question about the hackathon rules or MongoDB, pop into the [help thread](https://dev.to/devteam/help-thread-mongodb-atlas-hackathon-2022-on-dev-b0i). We'll be happy to assist you there!


Good luck to everyone who submits a project for this contest.  We hope to see an entry from you!    

---
_Click [here](https://dev.to/devteam/announcing-the-mongodb-atlas-hackathon-2022-on-dev-2107) to find all the info you'll need to get started._ ❤️