teleren/devto huggingface dataset:
How to Secure Nginx WeB-Server From HACKERs | Tip
Tags: nginx, webserver, security, ubuntu
Published: 2022-02-04 11:15:00

- **How to Hide Nginx Server Version in Linux?**
- **Disable server_tokens directive in NGINX?**
- **Is it possible to change server_tokens?**

In this short article, we will show you how hide Nginx server version on error pages and in the “Server HTTP” response header field in Linux. This is one of the key recommended practices in securing your Nginx HTTP and proxy server.

The “server_tokens” directive is responsible for displaying the Nginx version number and Operating system on error pages and in the “Server” HTTP response header field as shown in the following screenshot.


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

**Description:**

The _server_tokens_ directive is responsible for displaying the NGINX version number and operating system version on error pages and in the Server HTTP response header field. This information should not be displayed.

**Rationale:**

Attackers can conduct reconnaissance on a website using these response headers, then target attacks for specific known vulnerabilities associated with the underlying technologies. Hiding the version will slow down and deter some potential attackers.

**Audit:**

In the NGINX configuration file _nginx.conf_, verify the _server_tokens_ directive is set to _off_. To do this, check the response headers for the server header by issuing this command: 

> curl -I 127.0.0.1 | grep -i server



Add the following line to http context as shwon in the screen shot below.

> server_tokens off;

Note: This will only hide the server version number, but not the server signature (name).

Thankyou! DONE
😮Setup Analytics using bit.ly on website from php/backend or frontend
Tags: javascript, tutorial, php, tricks
Published: 2022-02-04 11:05:54

It was a random thought 🤔 in my mind that how will we monitor our website's traffic from backend languages like php 🤦🏽‍♂️ because in frontend you can put the script tags of many websites like Google Analytics, Plausible, Addthis to know about your traffic.

But for Specially sites like API providing site (i.e. WhollyAPI). Which give the results in JSON format or any other and can't print script tag on html. ⚡

# Frontend (i.e. HTML)

> So, Then I remembered I was using this trick in frontend for example you are using `bootstrap` on your website and you are using CDN like this :-
```<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css">```

You should shorten the URL `https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css` with bit.ly ([bit.ly/bscdn](https://bit.ly/bscdn)) and Use the CDN Like this :-

```<link rel="stylesheet" href="https://bit.ly/bscdn
">```

Because bit.ly doesn't block cross origin it will work same but you are getting a plus point as analytics on your bit.ly dashboard.

**What If you are not Using any CDN or external library**

You can use Blank Files Instead of a bootstap or something containig URLs

You can get blank files CDNs from here.

Github :- https://github.com/SH20RAJ/blankfiles

## CDNs

> Txt File :- 
> ```html
> https://cdn.jsdelivr.net/gh/SH20RAJ/blankfiles/blank.txt
> ```
> 
> Css File :- 
> ```html
> https://cdn.jsdelivr.net/gh/SH20RAJ/blankfiles/blank.css
> 
> ```
> JS File :- 
> ```html
> https://cdn.jsdelivr.net/gh/SH20RAJ/blankfiles/blank.js
> ``` 

and Use these CDNs to short using bit.ly


# Backend (i.e. php)

In php you can echo the link tag containing shortened URL but here a thing when you don't want to show this on website. You want all the process in backend.

> Here https://bit.ly/blank-txt will refer to https://cdn.jsdelivr.net/gh/SH20RAJ/blankfiles/blank.txt?devarticle

So You can Use `file_get_contents();` at last of your php code.

> Use alternative function for other languages.

```php
file_get_contents('https://bit.ly/blank-txt');
```

So, that you file call will be done on server side and no extra load on server or internet of user 🤭 because the files are blank. 😌

### And Hence you will get all traffic information on your bit.ly dashboard .🎉🥳


##### How was it ?🔆
RSS to HTML
Tags: go, programming
Published: 2022-03-10 07:12:56

---
title: RSS to HTML
published: true
date: 2022-02-04 10:20:00 UTC
tags: Go, programming
canonical_url: https://defer.cc/b/rsstohtml/
---

Inspired by [engineeringblogs.xyz](https://engineeringblogs.xyz/) ([GitHub](https://github.com/peterc/engblogs)). Generate a HTML output from several rss feeds.

```
go run Reader.go example-urls > example-output.html
```

[PREVIEW](https://htmlpreview.github.io/?https://github.com/mnlwldr/rss-reader/blob/main/example-output.html)

[rss-feeds-to-html on GitHub](https://github.com/mnlwldr/rss-feeds-to-html/)
Why Creative Website Designs are Crucial for Every Website
Published: 2022-02-04 10:19:36

<p>Your business website is an essential tool for your business. It keeps you connected with your audience. Creating a simply designed website is not enough. With the increasing competition, you need to adopt creative website designs for your website. Implementing the new changes in your website design will help in boosting your interactions with your customers.</p>
<h2>Creative Website Design</h2>
<p>Here are some reasons that you need to work continuously on user-oriented creative designs. These key components are also used by the top-rated <a href="https://www.webomindapps.com/web-designing-company-bangalore.html"><strong>web design company</strong></a> for creative web designs:</p>
<ul>
<li>
<h3>Reflecting Purpose of your Brand</h3>
</li>
</ul>
<p>Website visuals help the user to understand the main aim behind your brand. If your website design is not able to reflect the meaning of your business, it will ruin the user sessions and impact the conversions.</p>
<ul>
<li>
<h3>Visually Appealing</h3>
</li>
</ul>
<p>A website plays a crucial role to convince your customers why you are better than your competitors. So, it needs to appeal users to engage and assure them about the services and products you are offering.</p>
<ul>
<li>
<h3>Maintains Consistency</h3>
</li>
</ul>
<p>We all know consistency is the key to everything in the digital world. If you are not proactive for your customers, it will be a massive drawback for your website. So, it would help if you worked consistently on different elements or sections of the website.</p>
<ul>
<li>
<h3>To Make Website Design More Responsive</h3>
</li>
</ul>
<p>If you work with new technologies and developments, you find specific ways to make your website more user-friendly or responsive for all the platforms. You can remove the elements disturbing the mobile-friendly design of your site to make it effective.</p>
<h4>Final Remark</h4>
<p>Hence, now you know the importance of working on website design and adversely impacting your website engagement rate. You can give these tips a try to make the website design more accurate and creative.</p>
Se reconvertir dans le développement web 👩‍💻👨‍💻
Tags: webdev, beginners, codenewbie, french
Published: 2022-02-04 09:54:14

Viens découvrir les premiers articles de notre série d'interviews au format court sur la reconversion dans le développement web.

Chez [Kinoba](https://kinoba.fr), nous avons des profils très différents. Six membres de l’équipe se sont reconvertis dans le développement web après s’être essayés à des métiers divers et variés. Ils témoignent de leur reconversion dans cette série d’interviews au format court :

- [Épisode 1 - Sharon](https://kinoba.medium.com/se-reconvertir-dans-le-d%C3%A9veloppement-web-t%C3%A9moignages-de-la-team-kinoba-1-5-1fce0b91f8e4) 
- [Épisode 2 - François](https://kinoba.medium.com/se-reconvertir-dans-le-d%C3%A9veloppement-web-t%C3%A9moignages-de-la-team-kinoba-2-6-f3a7543a748f)
- [Épisode 3 - Émilie](https://kinoba.medium.com/se-reconvertir-dans-le-d%C3%A9veloppement-web-t%C3%A9moignages-de-la-team-kinoba-3-6-8c493742e37b)
- [Épisode 4 - Émilie (une deuxième Émilie)](https://medium.com/@kinoba/se-reconvertir-dans-le-développement-web-témoignages-de-la-team-kinoba-4-6-c16be200ec77)
- [Épisode 5 - Mickaël](https://medium.com/@kinoba/se-reconvertir-dans-le-développement-web-témoignages-de-la-team-kinoba-5-6-43af34bb77a5)
- [Épisode 6 - Clément](https://medium.com/@kinoba/se-reconvertir-dans-le-développement-web-témoignages-de-la-team-kinoba-6-6-ccb3810b875f)

Et toi, comment as-tu vécu ta reconversion ? ⬇️ ⬇️ ⬇️
5/2 - Groundhog week
Tags: umbraco, windows, groundhog
Published: 2022-02-04 09:40:52

The 2nd Feb was Groundhog day 🐗, a perfect excuse - if you needed one - to watch your favourite groundhog movies, and if you are tired of watching the same old movie every year (oh the irony). then you could do worse than watching [Palm Springs](https://www.imdb.com/title/tt9484998/) or [The Map of Tiny Perfect Things](https://www.imdb.com/title/tt11080108/)

---

Carol Rennie Logan has a really good post on [using the cache tag helper for asp.net core in Umbraco](https://carole.dev/blog/using-asp-net-cache-tag-helper-in-umbraco-9/). Its a useful reminder to take a look at all the cool extra things that are now available to us Umbraco devs now we are using dotnet core. The community package [Our.Umbraco.TagHelpers](https://github.com/umbraco-community/Our-Umbraco-TagHelpers) also has a bunch of useful Umbraco specific tag helpers which are well worth a look. 

--- 

I got a new PC this week 🥳 which does mean I am going through the ~~pain~~ Joy of setting everything up again. 

One of the little things that makes a big difference, especially when you need to test code works on different platforms, is [making a folder case sensitive on Windows](https://www.windowscentral.com/how-enable-ntfs-treat-folders-case-sensitive-windows-10). Its not the only thing you need to do when testing things work on Linux but it does make testing a lot quicker. 

_Of course I will also [setting up the Windows Terminal the Scott Hanselman way](https://www.youtube.com/watch?v=VT2L1SXFq9U). dropping in [UmbSense](https://marketplace.visualstudio.com/items?itemName=KevinJump.umbsense-vscode) for Umbraco back office intelisense, and putting in some custom PowerShell scripts so I can[ install and run new Umbraco sites in ~30 seconds](https://gist.github.com/KevinJump/a0bd8b69c41fdd762e68728f326d1569)_

---

In the Umbraco world there has been quite a bit of discussion about IIS vs IIS Express vs Kestrel this week and the best way to develop with an Umbraco 9 site. Personally I am embracing my new netcore overlords, and trying things with `dotnet run` and vscode. This article on [How to configure urls for Kestrel, WebListener and IIS express in ASP.NET Core](https://andrewlock.net/configuring-urls-with-kestrel-iis-and-iis-express-with-asp-net-core/) is worth a read. 

The thing I've learnt about `launchSettings.json` this week, is that you can put wildcards in the host names for Kestrel, so https://*:54221 will allow you to work with different host names while testing. 

--- 

An finally in response to a post from [Warren Buckley](https://twitter.com/warrenbuckley). Marc Goodson reminded me of probably one of the best simple tips there is when working with Umbraco. 

{% twitter 1488843075434725376 %}

_I sometimes like to also up the units for each level i go, (e.g using 100, 1000, 10000 as i go down the tree) but that really just shows my age because no one uses inherited content types anymore right ?_
What and Why of Data Science?
Tags: data, datascience, science
Published: 2022-02-04 09:37:42

[Data Science](https://www.mitzon.com/udemy/what-and-why-of-data-science/) is an art of making data driven decisions. To make that data driven decision it uses scientific methods, processes, algorithms to extract knowledge and insights from data. It is used for examining, cleaning, manipulating, transforming and generating information from the data. Now a days in Business world data analytics plays a vital role to form decisions more scientifically and help to increase operational efficiency.
Petite astuce pour commenter du code ayant déjà des commentaires
Tags: cpp, french
Published: 2022-02-04 09:37:03

---
layout: post
title: Petite astuce pour commenter du code ayant déjà des commentaires
published: true
tags: [Cpp, French]
---

## Contexte
Imaginez-vous en train de débugger votre programme : soudainement, vous voyez une fonction avec une partie de son contenu qui vous semble étrange. Vous vous dites que cela pourrait être intéressant de voir le comportement de votre programme sans ce bout de code.

Vous essayez donc de le mettre en commentaire (avec le raccourci de votre éditeur préféré, qui met automatiquement les caractères __/* \*/__, et là, vous remarquez dépité que seul le début de l'extrait de code a été commenté car il y a déjà des commentaires multilignes (utilisant __/* \*/__).

Vous êtes bien embêté, mais vous avez plusieurs solutions en tête, plus ou moins pratiques, pour palier ce problème. Supprimer le code, utiliser des commentaires mono-lignes ou bien mettre un `if (false) {}`, par exemple. Je vais vous parler d’une autre technique toute simple.

## L'astuce
Il vous suffit de mettre le code que vous souhaitez commenter entre un `#if 0` et le `#endif` correspondant. 

Voici un exemple :
```C++
int big_and_ugly_function(int cost, const std::string& name)
{
	apply_margin(cost);

	#if 0
	/* Best comment ever ! */
	std::cout << "Hi: " << name << std::endl;
	apply_reduction(cost, name);
	
	/* Usefull comment. */
	apply_taxes(cost);

	/* This comment is blowing your mind. */
	std::cout << "The cost is: " << cost << std::endl;
	#endif

	return cost;
}
```

Si jamais vous voulez décommenter temporairement le code, il suffira de remplacer le `#if 0` par `#if 1` comme ceci :
```C++
int big_and_ugly_function(int cost, const std::string& name)
{
	apply_margin(cost);

	#if 1
	/* Best comment ever ! */
	std::cout << "Hi: " << name << std::endl;
	apply_reduction(cost, name);

	/* Usefull comment. */
	apply_taxes(cost);

	/* This comment is blowing your mind. */
	std::cout << "The cost is: " << cost << std::endl;
	#endif
	
	return cost;
}
```
Voilà, c’est tout pour cette astuce ! Il est probable que vous la connaissiez déjà, si vous avez un peu d’expérience, mais une piqûre de rappel ne fait pas de mal !
Setting Custom Bracket Colors with VSCode
Tags: vscode, programming, tutorial, productivity
Published: 2022-02-04 09:31:49

## I love Bracket Pair Colorizer

And I was extremely excited when VSCode picked it up to be included with no extensions! However... they changed the way that you set it up.

Here's an example snippet of my current bracket pair settings in my `settings.json`: 

```json
{
  // enables colors
  "editor.bracketPairColorization.enabled": true,

  // define what colors you want
  "workbench.colorCustomizations": {
    "editorBracketHighlight.foreground1": "#dfbaff",
    "editorBracketHighlight.foreground2": "#bae1ff",
    "editorBracketHighlight.foreground3": "#baffc9",
    "editorBracketHighlight.foreground4": "#ffffba",
    "editorBracketHighlight.foreground5": "#ffd3a1",
    "editorBracketHighlight.foreground6": "#ffb3ba"
  }
}
```

And here's what these specific colors look like: 

![Color listing of bracket highlights](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1z8edev7w42uhr344wrq.png)
 
What it looks like in your editor with some code:

![[...nextauth].ts file with Nord Theme, Hasklig, and Bracket Pair Colorizer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lcyu3aq9cijwf31g25fq.png)

In case anyone is wondering, I use [Nord theme](https://marketplace.visualstudio.com/items?itemName=arcticicestudio.nord-visual-studio-code) and [Hasklig font](https://github.com/i-tu/Hasklig) with font ligatures on.

Hope this helps anyone else who is looking to add some customization into their VSCode!

![Lots of brackets with "enjoy" in the center of it](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/idv57ddn78pz1gd4r7e9.png)
Fixing vulnerabilities found in a dependency tree
Tags: yarn, npm, dependency, security
Published: 2022-02-04 09:24:45

I'm working on the app that is not yet publicly available and during the preparation for the launch, we made a full code scan to find any vulnerabilities.
We discovered that some of the dependencies used in our codebase depend on old and potentially harmful packages. 

It was like we need `packageA` but that library  depends on the vulnerable library `packageB`.

We needed to take proper action as soon as possible.

## Yarn solution
What I've found was the fact that it's relatively easy to force some deeply nested dependencies in the yarn package manager:

Yarn supports [selective version resolutions](https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/), which lets you define custom package versions or ranges inside your dependencies through the resolutions field in your `package.json` file.

### How to use it?
We need to add `resolutions` to our `package.json` instructing Yarn how to handle dependencies:

```
{
  "name": "project",
  "version": "1.0.0",
  "dependencies": {
    "left-pad": "1.0.0",
    "c": "file:../c-1",
    "d2": "file:../d2-1"
  },
  "resolutions": {
    "d2/left-pad": "1.1.1",
    "c/**/left-pad": "^1.1.2"
  }
}
```

That will install version 1.0.0 of `left-pad` alongside locally stored `c` and `d2`. But it will install version 1.1.1 of `left-pad` for `d2` and version ^1.1.2 for any dependencies requiring `left-pad` somewhere under `c`.

## NPM implementation
If you use npm instead of yarn, you can achieve a similar effect using the [overrides setting](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides) in `package.json`. There are some differences though.

We can't use glob matching (double asterisk -  `**`) instead, we have to nest dependencies:

```
{
  "overrides": {
    "foo": {
      ".": "1.0.0",
      "bar": "1.0.0"
    }
  }
}
```

In that example, we're overriding `foo` package to be at version 1.0.0 and making `bar` at any depth beyond foo also 1.0.0.

## Final words
With those, maybe, lesser-known options, we can force a newer (or simply other) version of any deeply nested package. This is a way for fixing issues when one of our dependency packages relies on e.g. not maintaining any more packages containing e.g. vulnerabilities.
A great blog post about senior programmer roadblocks
Published: 2022-02-04 09:24:21

---
title: A great blog post about senior programmer roadblocks
published: true
description: Just wanted to share a post I like to go back to and help evaluate my current actions with my future goals.
tags: 
//cover_image: https://direct_url_to_image.jpg
---

https://levelup.gitconnected.com/this-is-why-most-programmers-fail-to-become-senior-developer-143bc8c1342d
Personal website with parallax effects and optimized animations
Published: 2022-02-04 09:01:42


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qhf0v8gdu6y80yzmdslo.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/srgfeesxfkc1wb00qvyc.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/655xvhlu38yjbo8fq1cc.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zhw8uhzipv0fehy33t1x.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/65ye59ykwbh2tegzwuu0.png)
Free Bootstrap 5 Ecommerce UI Kit
Tags: bootstrap, ecommerce, uiweekly, kit
Published: 2022-02-04 08:54:53

## Components You Get in Ecommerce UI KIT
Beautiful UI Components of Bootstrap 5

- Trending Products

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

- Flash Sale


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

- Single Product


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

- Shopping Cart


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

Download Free UI Kit: 
[Hamro Templates](https://hamrotemplates.com/ecom-ui.html)
What's your thought on Web 3.0?
Tags: webdev, discuss, watercooler, web3
Published: 2022-02-04 08:44:05

# Introduction

Web 3.0 has exploded recently. We can see web 3.0 discussions everywhere. It is reaching more developers day by day. 


![Web 3.0](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xa2041xd4hov2imyauhz.png)


Developers have a contrasting opinion on web 3.0. Some are calling it revolutionary that will change the web. Some are calling it a trend that will fade in the future. You can be on either side.

So today, I would like to share my opinion on web 3 and would love to see your thoughts on it.

# 🚀My Opinion 

- Web 3 comes with the solution to any problem that we used to face such as centralization of data🏢.
- Web 3 is not to replace web 2, it's an extension to web 2. Both web 2 and web 3 will be going to stay together🤝.
- I believe in Web 3 not just the concept but also the project that is being made under web 3. It solves certain problems. If anything can solve the problem, it will gonna stay📈.
- It's pretty new, but has the potential to change the web for good cause🌱.

# Things to discuss
- What are your thoughts on the concept?
- What are potential threats to web3?

# Last Note

*I would love to read your thoughts on web3. Thanks in advance for your comment.*
How to define and use variables in sass
Tags: scss, css, codever, snippets
Published: 2022-02-04 08:41:01

Use the `$` sign to define the variable `$variable_name: variable_value`. Below we define `anthracite-gray` colour in the `_colors.scss` file used in the [Codever](https://www.codever.land) project. Then we reference the variable in the class definition:

```scss
$anthracite-gray: #4A5054;

.anthracite-gray {
  color: $anthracite-gray;
}
```

<span style="font-size: 0.9rem">
  <strong>Reference - </strong>
  <a href="https://sass-lang.com/documentation/variables" target="_blank" style="font-weight: lighter">
     https://sass-lang.com/documentation/variables
  </a>
</span>

<hr>

> Shared with :heart: from [Codever](https://www.codever.dev/snippets/61caeb32c25ba5706f39610e/details). Use :point_right: [**copy to mine**](https://www.codever.dev/snippets/61caeb32c25ba5706f39610e/details) functionality to add it to your personal snippets collection.
How to delete a kubernetes deployment with kubectl
Tags: kubernetes, kubectl, codever, snippets
Published: 2022-02-04 08:21:26

First select the deployment name in the current context you, if you don't know it with the following command:

```shell
kubectl get deploy
```

You should get a list of deployments similar to the following:

```
NAME                                       READY   UP-TO-DATE   AVAILABLE   AGE
pdv-location-batch-test                    0/1     1            0           2m12s
connector-partner-service                  1/1     1            1           330d
```

<hr>

Then use `kubectl delete deploy <deployment name>` to delete the deployment, in my case `pdv-location-batch-test` was the deployment I was looking for:

```shell
kubectl delete deploy pdv-location-batch-test
```

You should get something similar to the following:

```
deployment.apps "pdv-lokation-batch-test" deleted
```

<hr/>

> Shared with :heart: from [Codever](https://www.codever.dev/snippets/61fa84d488422d447cdeb1e4/details). Use :point_right: [**copy to mine**](https://www.codever.dev/snippets/61fa84d488422d447cdeb1e4/details) functionality to add it to your personal snippets collection.