teleren/devto huggingface dataset:
How to get the IP address of the website in Linux?
Tags: resource
Published: 2021-07-15 00:00:00

---
  title: How to get the IP address of the website in Linux?
  published: true
  tags: Resource
  date: Thu Jul 15 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/get-the-ip-address-of-website-linux
  cover_image: https://melvingeorge.me/_next/static/images/main-959adeddc5f6efa137a4a8109d45b47e.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/get-the-ip-address-of-website-linux)
  
To get the IP address of a website URL or a domain name, you can use the `ping` command followed by the website URL in the terminal on Linux.

For example, to get the IP address of the website `google.com` you can use the `ping` command like this,

```bash
# Get IP address of website
ping google.com
```

The command will output some information like below,

![ping command output showing the IP address of website](https://melvingeorge.me/_next/static/images/ping-command-ip-address-output-74948befe7dce1596bb7cece1471e65b.png)

As you can see from the output, the IP address of the website is shown after the website URL inside the brackets.

That's all 😃!

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

---
Automating Lagoon Image updates from Upstream Source images
Tags: docker, dockerimages, images, updates
Published: 2021-07-14 23:58:04

As Lagoon images ordinarily extend “Docker Official” images with tooling and configuration necessary for Lagoon, we have a dependency on these upstream images. To date, we haven’t been able to exert much control over which versions of these images we use to build our versions. As we were refactoring the release process anyway, it made sense to look more closely at which exact versions of upstream images we consume, and how we could avoid additional burden in tracking them.

We identified that to specify exact versions in our Dockerfiles, and then to have an automated dependency resolution system watch these, and submit pull requests to us for any updates would be the most automated solution to this. We selected [Whitesource Renovate](https://www.whitesourcesoftware.com/free-developer-tools/renovate/) for this purpose – the level of control over how these updates are selected was by far the most customizable for our needs. We didn’t want a situation where a Node.js 14 update was submitted for a Node.js 12 image, or where the PHP base version for two different images wasn’t simultaneously updated. We also wanted to be able to control whether a particular image got updates based on patch or minor releases.

We are always actively working on the [configuration](https://github.com/uselagoon/lagoon-images/blob/main/renovate.json) for Renovate and will continue to fine-tune it. Having pull requests created for every upstream version change will also optimise the generation of automated changelogs (using the excellent [Release Drafter](https://github.com/marketplace/actions/release-drafter) GitHub Action we were already using on Lagoon).

In early 2020, we made the first steps in aligning all our base images on Alpine 3.11, and because of this work, it has been much easier to upgrade to Alpine 3.12 and 3.13 along the way.  Now that Alpine 3.14 has been [released](https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0) we will continue to monitor our upstreams, and once the balance of our images is available, we will commence the testing process.

We've also integrated vulnerability scanning into the CI process - using Aqua Security's [Trivy](https://github.com/aquasecurity/trivy) scanner to scan each image as it's created and saving the results in the CI run.  We'll cover securities and vulnerabilities in a later post!
How to use Tailwind CSS in an ExpressJS app.
Tags: node, tailwindcss, express, npm
Published: 2021-07-14 23:40:10

#This post will guide you if you want to use Tailwind CSS without having to use any bundler.

First use your terminal to change directory to your express application. Then install tailwind in your express app using:

```npm i tailwindcss ```

Run this command to generate the tailwind configuration file. This will create a tailwind.config.js file in your root directory.

```npx tailwindcss init```

Create a tailwind.css file in your public folder, I would advice you to create a stylesheets folder under the public folder to properly seperate your files(public/stylesheets/tailwind.css). After that copy and paste the following code in the tailwind.css file.

```
@tailwind base;

@tailwind components;

@tailwind utilities; 
```

Install postcss globally. This allows us to use postcss in other projects without reinstalling for each projects.

```npm install -g postcss-cli```

Create a postcss configuration file in your root directory and call it postcss.config.js. Then copy the following configuration into your postcss.config.js file:

```
module.exports = {
  plugins: [
    // ...
    require('tailwindcss'),
    require('autoprefixer'),
    // ...
  ]
}
```

Add a build:css script to your package.json file so you can always build your css by running the command: ```npm run build:css```
```
"scripts": {
     "build:css": "postcss public/stylesheets/tailwind.css -o public/stylesheets/style.css"
  },
```

Import style.css in your application as you normally would and run your app. Congratulations.
Cara Automount Drive di Linux
Tags: linux
Published: 2021-07-14 23:19:14

Rasanya males kalau harus mount manual hardisk eksternal tiap kita colok di os linux, yap distro linux dari bawaan khususnya yang gapake GUI belum bisa menge "mount" drive secara otomatis ke file system.

Langsung saja saya kasitau cara automount yang simpel pakai bantuan fstab.

Apa itu fstab (file system table)? intinya dia adalah sebuah file list konfigurasi yang ada di `/etc/fstab` berisi semua partisi drive kita yang perlu di mount sistem ketika booting.

Berarti disini tinggal kita tambahin partisi drive kita ke fstab biar di mount otomatis yakan, gimana caranya?

Pertama caritau dulu id dari si device kita pakai `blkid`
```
sudo blkid
```
Nanti bakal keluar list block device yg tersedia, terus cari namanya apa di bagian `LABEL` terus catet `UUID` nya

Terus kita bikin dulu direktori atau mount point nya mau dimana.
```
sudo mkdir /mnt/hdd-ext
```

Terakhir kita edit file fstab dan tambahin di line paling bawah.
```
nano /etc/fstab
```
```
UUID=<ISIUUIDYGTADI>  /mnt/hdd-ext  ntfs  defaults  0  2
```
Contoh diatas bakal mount partisi hardisk dengan file sistem `NTFS` ke direktori `/mnt/hdd-ext` di sistem. Sesuaikan file sistem nya jangan sampai salah, kalau format hardisk nya bukan `NTFS` berarti ganti aja contoh `exFAT` `FAT32` dll.

Sampai sini kalau kita restart sitem maka sudah bisa automount

Tapi kalau mau melihat hasil nya tanpa restart bisa pakai command ini
```
sudo mount -a
```
Artinya bakal me mount semua yang ada di fstab tadi

Beres deh, simpel kan.
FUNDAMENTALS OF HTTP REQUEST IN PYTHON
Tags: python, api, django, http
Published: 2021-07-14 23:13:52

An HTTP request is made by a client, to a named host, which is located on a server. The aim of the request is to access a resource on the server.

To make the request, the client uses components of a URL (Uniform Resource Locator), which includes the information needed to access the [resource](https://www.ibm.com/docs/en/cics-ts/5.3?topic=protocol-http-requests).

In python, a standard module is used for this task, urllib which involves manual addition of query strings to your url or to form-code your POST. It is actually a boring stuff and is highly prone to error.

Request has come to salvage this situation. Requests is an open source python library which helps to do this task seamlessly and with a little lines of code. The components of URL which involves PUT, GET, POST, DELETE can be done by just creating the object of the request.

Before you start, you have to pip install  requests on your engine using the code.
'''
pip install requests

'''
Then, you import it into your python file using the command import

'''
import requests

'''

Then, you can now call any of the component by creating an object of it. Perfect examples of this is this:
'''
r = requests.put('https://httpbin.org/put', data {'key':'value'})
r =requests.delete('https://httpbin.org/delete')
r = requests.head('https://httpbin.org/get')
r = requests.options('https://httpbin.org/get')

'''

To practice, you can copy the code above.

That is all to get started with request. 

Passing Parameters in URL will be discussed in the future article.

Thank you for taking your time through this piece. 

Please comment and share

Please refer to [Requests Doc](https://docs.python-requests.org/en/master/user/quickstart/#make-a-request) for more information about request.
Using reflect.DeepEqual to compare data structures in Go
Tags: go
Published: 2021-07-14 22:22:38

## Intro

When I started using Go, I would compare two slices by writing a for loop and iterating over both to make sure they were equal. After seeing some sample code using the `reflect` package, I realized this is totally unnecessary. We can compare slices, maps, structs (anything!) simply by passing them into `reflect.DeepEqual(x,y)`, which reports whether two variables are "deeply equal."


## Slice/Array Example

Let's take this function that reverses a slice: 

```go
func ReverseSlice(s []string) []string {
	reversedSlice := make([]string, len(s))

	for i, j := len(s), 0; i > 0; i, j = i-1, j+1 {
		reversedSlice[j] = s[i-1]
	}

	return reversedSlice
}
```

Now, I have written a test that shows the usage or comparing two slices:

```go
func TestReverseSlice(t *testing.T) {
	got := ReverseSlice([]string{
		"person1",
		"person2",
		"person3",
		"person4",
	})
	
	want := []string{
		"person4",
		"person3",
		"person2",
		"person1",
	}

	if !reflect.DeepEqual(got, want) {
		t.Errorf("got %q slice but expected %q", got, want)
	}
}
```

So, pretty straightforward! However, it's really important to note that the two arrays **must be in the same order**. They cannot have the same values but be in a different order. The function comments specifically state: `Array values are deeply equal when their corresponding elements are deeply equal.`

## Map Example

Maps are a little different! By default, they are *not* going to have a specific order. For instance, a `map[string]string` is going to be constructed with a potentially random order.

So how are they compared with `DeepEqual`? They will both need to either be nil, or not nil, have the same length, and the same corresponding key/values. 

In this case, I'm going to just use `main()` to showcase a few of these points with print statements:

```go
func main() {
	m1, m2 := make(map[string]string), make(map[string]string)

	m1["person1"] = "person1"
	m1["person2"] = "person2"

	m2["person2"] = "person2"
	m2["person1"] = "person1"

	fmt.Printf("type=%T -- addr=%p -- len=%d\n", m1, &m1, len(m1))
	fmt.Printf("type=%T -- addr=%p -- len=%d\n", m2, &m2, len(m2))

	if reflect.DeepEqual(m1, m2) {
		fmt.Println("they are equal")
	} else {
		fmt.Println("they are NOT equal")
	}
}
```

Specifically, we're looking to compare the type, address, and length of the map. We'll need the type and length to be the same, but the addresses should be different (but not `nil`). 

Once running, you should see output similar to this:


```sh
type=map[string]string -- addr=0xc0000b0018 -- len=2
type=map[string]string -- addr=0xc0000b0020 -- len=2
they are equal
```

I'd also encourage reading the full documentation for this function in the [Go docs](https://pkg.go.dev/reflect#DeepEqual) :)
How to create URL in NodeJS?
Tags: node, npm, nodemodules, nodejstutorials
Published: 2021-07-14 21:47:32

Nodejs is an open-source, cross-platform JavaScript framework. Due to its single threaded in nature it is used for modern websites development, backend API services, real-time applications, event-driven servers etc. When we are creating websites using Nodejs then we needs to access our webpages through URLs. And we can do this using the URL module, HTTP module and FS module. Please see the detailed article about creating URL in NodeJS here https://www.w3courses.org/how-to-create-url-in-nodejs/
Day 408 : Fire
Tags: hiphop, code, coding, lifelongdev
Published: 2021-07-14 21:31:58

_liner notes_:
- Professional : Whew...another brain draining day. haha One of my meetings got cancelled so I didn't have 3 back to back meetings, so that was good. I helped out with some community questions. Had the first meeting. Then I had a meeting where I got to pair program with a coworker. We are building a sample application to work with a new integration that is coming out. By working on the sample app, we can see what we can do to better the integration so it's easier for other developers. It was a good session. Then I started on my workshop for tomorrow. I created the final demo project that I'll be showcasing. It actually came together pretty good. Just need to clean up the other demo projects, work on an outline, and make my slides. I'll work on that later this evening.

- Personal : Went through some tracks for the radio show this week. Watched another episode of "Fire Force". I realized that there a lot of episodes I need to watch to catch up. I guess it's been a long while since I watched some anime. haha. Also tried to get the webhook working with the API I'm trying to integrate into https://untilit.works Did multiple things and my webhook endpoint would not receive a request from the service even though the video was finished processing. Weird. I sent a direct message to the company on Twitter and they ask for me email so the support team can reach out. We'll see what they say. 

![Photo of a New Orleans Bayou, LA, USA with with mangrove trees sticking out of the water](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l8c1h2rjdjlglqa6g3qd.jpg)

Going to watch the season finale of "Loki" while eating dinner. After that, I want to get the outline for my workshop finalized, clean up the code for the sample applications and get at least a first draft of my slides completed. That'll probably be all I do so I can get up early tomorrow.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube reCixCJMzDs %}
🎬Vertical Slider | Vanilla JavaScript✨
Tags: html, css, javascript, webdev
Published: 2021-07-14 21:22:03

Hey DEVs, in today’s episode we are going to build a Vertical Slider using JavaScript; basically, we have content on both sides and 2 buttons in the middle, once you click it one side goes up and another one goes down, but it brings into place the correct text and correct image; its a really cool look slide you can use any type of content.

---

{% youtube laNpbZISwjY %}


---

**Live Version | Source Code** 👀:
https://bit.ly/3raRQqD

---

📚**Resources:**
Pictures used in the project: https://www.pexels.com 
Font-Awesome: https://cdnjs.com/libraries/font-awesome 

---
Error 404 : Page not Found
Tags: webdev, programming, beginners, 404
Published: 2021-07-14 21:16:57

**W**hen you click on a link, but instead of arriving to the site you want, an error message appears, stating that the page you requested is unavailable. It should be something along the lines of '404 Not Found.'
#####A 404 error is an HTTP status code that indicates that the website's server does not have the page you were searching for.
When website content is deleted or relocated to another URL, an error 404 message is commonly shown.

>**The 404 status code is the most common HTTP status code.**



##What are HTTP status codes?
A server answer to a browser's request is an HTTP status code. When you visit a website, your browser makes a request to the server, which the server responds to with a three-digit code called the HTTP status code.

* These status codes represent a communication between your browser and the server over the Internet. They convey if things are fine😊, touch-and-go👍, or if something is wrong😕 between them.



##Common HTTP status code classes:
![http status codes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5a2m8wds7fp58k6j0zfx.png)

Each three-digit status code starts with one of five integers, ranging from 1 to 5, and is written as 1xx or 5xx to signify status codes in that range. For example, 200, 301, 404, 500, and so on...
```
100–199 - Informational responses: The server is thinking through the request.
200–299  - Successful responses: The request was successfully completed and the server gave the browser the expected response.
300–399  - Redirection: You got redirected somewhere else.
400–499  - Client errors: Page not found. The site or page couldn’t be reached. 
500–599  - Server errors:  A valid request was made by the client but the server failed to complete the request.
```


` HTTP Status Code 200 - OK`
The 200 (OK) status code indicates that the request has succeeded. This is your ideal status code for your normal, everyday, properly functioning page.

` HTTP Status Code 301 - Permanent Redirect`
A 301 redirect should be utilized any time one URL needs to be redirected to another permanently.
Visitors and bots who come on that page will be sent to the new URL through a 301 redirect.

` HTTP Status Code 500 - Internal Server Error`
This status code indicates a server fault rather than a problem with pages missing or not found. A 500 error is a common server issue that will prevent visitors from accessing your website.


>**HTTP 404 errors can decreases a website’s ranking and reputation.**
Once the crawlers have determined that 404 codes are being returned for a large number of queries, they will proceed to the next step. This might result in a significant drop in the number of visitors to the website.




👉[Read more here (RFC 7231)](https://datatracker.ietf.org/doc/html/rfc7231#section-6.2.1)


>Getting bored😑
Try this once :`https://http.cat/[status_code]`
For example : 
https://http.cat/404
https://http.cat/450
https://http.cat/500

<!-- Images use in this article is self created/designed by author-->
----------------------------------------------
Choosing an IOT framework for homemade projects
Published: 2021-07-14 17:28:55

My project is still going on, I've some other posts in draft ready to post but before I need to put some more details. 

Now, I learned that low cost 433Mhz radio stuff is almost shit and for this reason I moved to a different technology. 

In my environment all the spaces inside as well as outside are well covered by wifi. I think this is a quite common situation and in the worst cases I can install some hardware to increase the signal power so ok: this solution sounds quite good and also SoCs are very cheap and simple to use. 

Today's goal is choose an IOT cloud framework to let my little IOT objects communicate between them without reinventing the wheel. 

I started from [hackster.io](https://www.hackster.io/channels/platforms?sort=last_project) by looking on Platforms ordered by last updated: 

##1. Grandeur
Build, scale and manage IoT products with Grandeur as your universal backend.
10 projects and 27 members

quite young system, open source. Not so bad: a nice example [here](https://www.hackster.io/grandeurtech/pi-switch-a1c9f8)

_but it seems more related to dev html pages and control devices or monitor variables, this is not what I want, I beleave in manual, toucheable, sensefull controls (buttons, scrolls, visibile leds, I'd like to avoid smartphone apps, one more drop into the sea of useless notifications!). I need an IOT framework to draw workflows._

##2. Blynk
Blynk is the most popular IoT platform designed to connect your devices to the cloud, create apps to control them, and manage thousands of deployed products
564 projects and 8,123 members

_I think I'll try to make a prototype with this! It permit to define devices with virtual pins used to get and post messages from the cloud. 
It's shipped with a nice [wifi provisioning library](https://docs.blynk.io/en/getting-started/activating-devices/blynk-edgent-wifi-provisioning) that uses a firmware part and a blynk application to do it. I'll append three stories to my github issues: - PoC for WiFi provisioning, PoC for sending data, PoC for reading data and see what happen!_

##3. Microsoft
Connect your assets with Microsoft's IoT software and hardware, gain deep insights—improve your decision making, in real-time.
1,777 projects and 61,046 members

_Maybe later, maybe never_

##4. ThingSpeak
Collect IoT sensor data, analyze and transform data with MATLAB, and act with IFTTT. Join the community of 350,000 makers, students, and engineers building IoT.
334 projects and 3,163 members

_Matlab plugin to integrate IOT devices and data. The main purpose is data anaysis, this is not what I'm looking for_

##5. Particle
Build internet-connected hardware. Particle gives you the tools to connect everyday electronics to the internet.
1,545 projects and 18,099 members

_This will be probably the next :) It seems nice and I need to deepen._
How to code better and faster: lessons from research into Google developers
Tags: refactorit, opensource, microservices, learning
Published: 2021-07-14 20:38:35

I stumbled upon a [research paper](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43835.pdf) that used both surveys and log analysis to understand developer behavior at Google.

This is intended to be a *collaborative* post, meaning it's an open invitation to connect and discuss.

Why?

Because I believe the results of the research point to an interesting way for you to:

* Learn how to code faster
* Learn someone else's code faster
* Ship code faster
* Reduce errors
* Collaborate better
* Get out of refactor jail faster
* Reduce technical debt


What was interesting to me was the results from the logs (although the surveys helped to provide valuable qualitative coloring).

The internal tool that they used was a "code search" tool.  Most devs use their IDE, Github, or *grep* when doing code search.  So the concept of searching for code isn't new or breaking ground.

However, the use-cases and frequency of code search made me realize that a purpose-built tool would enable new kinds of behavior for developers outside of Google.

I recognize that Google would build their own code search because of their "Big Code."  And for those working on small code bases, the use cases and capabilities don't apply.

However, I don't think having as much internal code as Google is the threshold for achieving "Big Code" and the associated problems.

Not to belabor it since it's not the purpose of this post, but the top three reasons more and more developers should learn how Google devs leverage code search are because more developers will have environments that are similar:

1. Open source actually makes the code base big faster
2. Micro-services and active M&A results in multi-repo environments
3. Remote dev creates the same demands on context and collaboration as being in the belly of a massive corporation

## What were developers at Google trying to do?

The list, below, is probably *not* surprising.  You may have a similar list.

But that's the point: if Google is using a special tool with their own course on how to do so, perhaps this is helpful for developers not at Google.

Here are the major categories of what they are trying to do:

* Looking for Example Code (How)
* Exploring or Reading Existing Code (What)
* Code Localization (Where)
* Determine Impact (Why)
* Metadata (Who and When)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6m6pf68mw4fogx66kuby.png)

## What helps you the most?
The research was helpful at a high-level.

But what is the problem to solve and outcome that *you* would be most interested in help in?

What saves you the most time and broadens your opportunities?

I am honing in on:

1. How to understand new code (open source or new private code) faster
2. How to refactor existing code in less time and fewer mistakes

Are there other things that would be helpful?

What do you think of this concept?

Thanks!