teleren/devto huggingface dataset:
An Introductory Explanation of NAT and NAPT
Tags: network, web, beginners
Published: 2021-01-16 12:25:07

#What is NAT?
NAT stands for Network Address Transition. As the name suggests, NAT was developed to convert an IP address into a different one. NAT is mainly used to change a global IP into a private IP and vice versa. Let's take an example to understand how NAT works. Your PC has a private IP address (e.g. `192.168.10.xxx`), and it is usable only in a local network such as your home network. If you use an Windows PC, you should enter `ipconfig` on the command prompt to see the private IP assigned to your PC. When your PC attempts to access to the Internet, a global IP (e.g. `34.203.75.ZZZ`) has to be assigned to it. This is where the NAT technique comes in. NAT assigns a global IP to your PC so that it can reach the Internet.

#What problem does NAT have?
NAT is not a perfect solution to get Internet access. Imagine that your PC (`192.168.1.xxx`) and tablet (`192.168.1.YYY`) attempt to get some data from the Internet at the same time. They have the same global IP on the Internet and it will be converted back into their each private IP by the router of your local network. Here is the problem. When the router tries to convert the global IP into a private IP, will the router convert it into the PC's private IP (`192.168.1.XXX`) or the tablet's private IP (`192.168.1.YYY`)? Since the global IP doesn't have information to distinguish your PC and table, the question is impossible to answer. Given this factor, NAT can not let multiple devices access the Internet simultaneously.

#What is NAPT?
NAPT technique can solve the aforementioned problem. In addition to an IP address, NAPT also converts a port number. As I said above, you can not distinguish your PC and tablet only from the global IP. However, if different port numbers are assigned to your PC and tablet, let's say... `192.168.1.XXX:10000` => `34.203.75.ZZZ:20000` (PC) and `192.168.1.YYY:10000 => 34.203.75.ZZZ:30000` (tablet), the router can clearly distinguish your PC and table, which makes it possible to let multiple devices reach the Internet simultaneously.
A remote-only jobs newsletter using NextJS and AWS SES
Tags: showdev
Published: 2021-01-16 02:56:20

I decided to start a newsletter a couple of weeks ago and while I never expected a high number of subscribers, I still wanted to avoid unnecessary costs, so I built it from scratch.

Here's the stack for anyone interested (most are free, open source or with a generous free tier plan)

- NextJS
- Vercel (these guys are amazing for small to medium project hosting, as I'm sure many of you already know)
- mjml (email-ready HTML is a pain without it)
- FaunaDB (generous free tier plan, friendly UI)
- AWS SES (it's hard to beat their $0.1 for 1K emails, first 62K free)


About the newsletter:

I feel like most of the job postings out there are generic and missing lots of important info:

- tools & processes (i.e. [teamrank.dev](https://teamrank.dev) questions)
- salary (at least a range)
- how long has the position been open
- how many candidates applied (at least an estimate)
- detailed tech stacks
- coworkers expertise and company culture

[startremote.dev](https://startremote.dev) is an effort to improve that.
Hello world in 16 languages
Tags: programming, computerscience
Published: 2021-01-16 12:01:31

Hi I want to show you "hello world" in 16 programming languages
# 1 C++
```c++
int main() {
    std::cout << "Hello world!\n";
}
```
# 2 Java
```java
public class Main {
    public static void main(String[] args) {
    system.out.println("Hello world!");
    }
}
```
# 3 Python
```python
print "Hello world!"
```
# 4 Python3
```python
print("Hello world!")
```
# 5 C
```c
#include<stdio.h>

int main(void) {
    puts("Hello World!");
    return 0;
}
```
# 6 Csharp
```c#
class HelloWorld {
    static void Main() {
        System.Console.WriteLine("Hello World!");
    }
}
```
# 7 Javascript
```javascript
(function main() {
    console.log('Hello World!');
}());
```
# 8 TypeScript
```typescript
(function main() {
    console.log('Hello World!');
}());
```
# 9 Ruby
```ruby
#!/usr/bin/env ruby
puts "Hello World!"
```
# 10 Swift
```swift
print("Hello world!")
```
# 11 Go
```go
func main() {
    fmt.Printf("Hello, World!")
}
```
# 12 Bash
```bash
echo 'Hello, world'
```
# 13 Scala
```scala
object Main extends App {
    println("Hello, World!")
}
```
# 14 Kotlin
```kotlin
fun main(args: Array<String>) {
    println("Hello, World!")
}
```
# 15 Rust
```rust
fn main() {
    println!("Hello, World!");
}
```
# 16 PHP
```php
echo "Hello world";
```
Be happy! :)

<a href="https://www.buymeacoffee.com/mohammadhassani"><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--epLLqT_x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1gn0quro9llouuhzkxbj.png" alt="buy me a coffee" loading="lazy" width="170" height="37"></a>
Desert Safari - A Wholesome Adventure, Fun, & Entertainment

Tags: desertsafari, desertsafaridubai, dubaicitytour
Published: 2021-01-16 11:51:32

Dubai is the finest destination to have a meeting with deserts. This golden city of the UAE is Situated right in the middle of the Arabian Deserts, it attracts lots of tourists all over the world and the locals. Most probably because of the tour called desert safari. This tour has a lot more to provide than being just a tour package. It encompasses an extensive range of elements related to adventure, fun,  joy, luxury, leisure, and thrill. Which makes your holiday perfect and complete. 

So what makes a <a href="https://www.happydesertsafari.com/">desert safari</a> in Dubai so famous? The desert destination adds a unique holiday experience; where you get to see multiple facets of Nature. Whether it is morning, evening, or overnight. The desert in Dubai gives a fine view where Nature paints everything in shades of yellow, ochre, and orange. To enjoy and cherish the sun rising behind dunes of the Arabian desert is a sight to behold. Similarly, travelers and visitors camp after a desert safari tour, the soothing ambiance, and open-air settings will bring in a relaxing effect in your mood. On the other side, those who are seeking a thrill or adrenaline rush, find dune bashing on high red dunes quite exciting. Where one can scale the vast looking dunes, up and down, on 4X4 Land Cruiser or Hummer at full speed. Besides, taking the quad bike, one can go ahead to explore the Arabian sand on their own. So, to admire this thrill add a touch of adventure to your vacation. 

After outdoor activities, this tour is inclusive of some laid-back features. There is a  desert camp specially set upright in the mid of deserts where you will be taken to after finishing your adventurous desert rides. Here you will be served complimentary snacks and refreshments, enjoy live entertainment like belly dancing, fire show, and Tanoura dance. Cherish the Arabic culture in the desert camp and few shops in the camp sell items and curios as well as have Arabic dress (for photography). Wearing these costumes you can click pictures; plus standing next to camels or holding a wild falcon in your hands.
Update:  🏆  GitHub Profile Trophy / Add dynamically generated GitHub Trophy on your readme
Tags: showdev, github, typescript, opensource
Published: 2021-01-16 11:43:11

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jnzue4q3vah2brftwh3m.png)
I made some updates about [GitHub Profile Trophy](https://github.com/ryo-ma/github-profile-trophy).

https://github.com/ryo-ma/github-profile-trophy

# Quick start
https://github.com/ryo-ma/github-profile-trophy#quick-start

# Transpalent background

You can turn the background transparent.

```
https://github-profile-trophy.vercel.app/?username=ryo-ma&no-bg=true
```
![TranspalentBackground](https://dev-to-uploads.s3.amazonaws.com/i/rd68utogujsopbhhwxi2.png)


# Hide frame
You can hide the frames around the trophies.

```
https://github-profile-trophy.vercel.app/?username=ryo-ma&no-frame=true
```

![HideFrame](https://dev-to-uploads.s3.amazonaws.com/i/bqovzk4i8tbwtjdlyap4.png)


# New themes

https://github.com/ryo-ma/github-profile-trophy#apply-theme

### chalk

```
https://github-profile-trophy.vercel.app/?username=ryo-ma&theme=chalk
```

<p align="center">
  <img width="660" src="https://user-images.githubusercontent.com/6661165/94294003-1de7d300-ff9a-11ea-91d1-60417a4d919b.png">
</p>

### nord

```
https://github-profile-trophy.vercel.app/?username=ryo-ma&theme=nord
```

<p align="center">
  <img width="660" src="https://user-images.githubusercontent.com/6661165/94346857-7ab2be80-006a-11eb-9082-36d377ae2531.png">
</p>


### alduin

```
https://github-profile-trophy.vercel.app/?username=ryo-ma&theme=alduin
```

<p align="center">
  <img width="660" src="https://user-images.githubusercontent.com/6661165/99085932-2a88bf00-260c-11eb-9b26-d2f125773831.png">
</p>

### darkhub

```
https://github-profile-trophy.vercel.app/?username=ryo-ma&theme=darkhub
```

<p align="center">
  <img width="660" src="https://user-images.githubusercontent.com/6661165/102801126-249ab080-43f8-11eb-91c8-f56f94c35777.png">
</p>

### juicyfresh

```
https://github-profile-trophy.vercel.app/?username=ryo-ma&theme=juicyfresh
```
<p align="center">
  <img width="660" src="https://user-images.githubusercontent.com/6661165/104810094-edbc8c80-5835-11eb-8c20-a76192a00728.png">
</p>

[More themes](https://github.com/ryo-ma/github-profile-trophy#apply-theme)




# Repository

https://github.com/ryo-ma/github-profile-trophy

Please try this!😁
How to undo a git commit
Tags: git
Published: 2021-01-16 11:40:42

Most of the time you just need to delete the last commit because you haven't had enough coffee and have made a mistake! - we are human! To do this run:
`git reset --hard master~1`

<i>Notes on this: 
<ul>
<li><i>This will also delete the changes in the files associated to this last commit</i></li>
<li><i>You can replace master with any branch you want.</i></li>
<li><i>Change 1 to a different number to remove more commits on that branch</i></li>
</ul>
</i>

To specify a certain commit e.g.:
`git reset --hard 0ad5a7a6`

If you run it with the soft tag it will not delete the files in the directory:
`git reset --soft master~1`
MLH Local Hack Day 2021 Experience | Major League Hacking
Tags: mlh, localhackday, majorleaguehacking, 2021
Published: 2021-01-16 11:25:06

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/syldaqng07qge07jgqdr.jpg)
# Day-1: 
Everything was started with daily challenges & week-long challenges, and I've to say that the challenges aren't only 
pro hackers friendly but also they were beginner-friendly.
And at the end of the day, My score was 12, and the Guild's(Rank 30th) score was around 18.

# Day-2 to Day-3:
Still, I had the hope that we can make it nevertheless we were competing with the awesome hacker so I guess we did our best!
at the end of the day-3, My score was 32, and the Guild's score was around 64.

# Day-4 to Day-5:
Now the Guild's score is not that high but we were planning to attend as many challenges as we can and at the end of the day we were around 132
(I know that is a really small number, But we're really proud that we have attended such an event by MLH).

# Day-6:
Updating soon!🔜

# Fun Facts😂
I don't know exactly which day it was but we shared our meals(I know that sounds weird, but we did it virtually),</br>
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/fef3huyynjemmy7f4xsk.png)</br>
and also I have taken many sessions to teach my fellow hackers! Yeah, I enjoyed each moment!
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3besxx3nq2zti5jx4jzd.png)


# What I achieved:🤩
Learned Github, git, IntelliJ Idea, how to make a bot, etc.
Overcome the fear of attending Hackathons! I don't know why? 
But I used to be afraid of Hackathon, like what I'll do, how I'll do, I don't know to communicate, and many more 

# Advice for everyone:😇
First, join the event then predict your stand! Afterward, work for it.

Pardon For My English😅
Using Laravel Sail (docker composer for Laravel) on a existing application
Tags: laravel, docker, sail, php
Published: 2021-01-16 11:10:12

sources: https://laravel.com/docs/8.x/sail#installation and https://laracasts.com/series/whats-new-in-laravel-8/episodes/12
requirements: Your project must be using Laravel 8

Install docker: https://docs.docker.com/get-docker/
run: `composer require laravel/sail --dev`
run: `php artisan sail:install`
run: `./vendor/bin/sail up`

That's it! Gets rid of the errors that occur with homebrew and valet sometimes and isolates your app from your local machine. It is a docker compose set up basically, so you can cd into your proj folder and run `docker compose up` and this will do the same as `./vendor/bin/sail up` - or you can use your docker GUI to stop and start sail.

Other useful link: https://mattstauffer.com/blog/how-to-use-takeout-to-add-new-services-to-laravel-sail-and-save-ram/

If a port is already taken (which is an error that may occur when you run ./vendor/bin/sail up) you can specify a different port to use. e.g. if you are using port 3306 for mariadb on your mac then you can use 3307 for mariadb with your container instead by editing your docker-compose.yml file: ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ztteoc42kuoom9ws7gsl.png)

If the APP Port is in use and you cannot stop it you can run it on a different port instead:
```APP_PORT=89 sail up``` for example to change it from port 80 to 89 OR do the following in the docker-compose.yml file to avoid typing the app port every time:
```ports:
# - '${APP_PORT:-80}:80' # WHAT IS WAS BEFORE
  - "8084:80"
```

Though bear in mind that you will have to view the port using the new port number: i.e. http://localhost:8084/ instead of the default http://localhost:8080/
LOCAL HACK DAY(2020)
Tags: mlh, majorleaguehacking, localhackday
Published: 2021-01-16 10:55:29

Local Hack Day is a week-long event conducted by "Major League Hacking" between 10th January-18th January, Globally.

The main agenda of this event is to empower passionate people by providing hands-on experience and collaborating in an open environment.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pqgdesltw6nhsdjv8vi3.png)

If you're a beginner like me, LHD is a perfect opportunity to get started, since there many people with distinct experience levels and even projects for all of them...

The great thing about this is the exposure you get here, many hackers join this community and collaborate to complete their challenges filled with lots of fun.

The main skills focussed in this event are Learning, Building and Sharing.
How  to know the analyzer of Elasticsearch tokenize
Tags: elasticsearch
Published: 2021-01-16 10:49:16

Sometimes, you may be curious about what a given analyzer is tokening your queries to your code that you're working on it.

For example. Let's say your index's mapping look like as given below;

```json
{
  "mappings": {
    "user": {
      "properties": {
        "fullname": {
          "type": "text"
        },
        "email": {
          "type": "text",
          "analyzer": "keyword_ngram_analyzer",
        }
      }
    }
  }
}

```
Let's check one by one.

First, `properties` uses the default analyzer because there is no specified analyzer. See [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-standard-analyzer.html) for more details)

So we're trying to debug by using `analyze` with the query is `Scott Leblanc` then.

```json
POST /_analyze
{
  "analyzer": "standard",
  "text": "Scott Leblanc"
}
```

Output will be

```json
{
  "tokens" : [
    {
      "token" : "scott",
      "start_offset" : 0,
      "end_offset" : 5,
      "type" : "<ALPHANUM>",
      "position" : 0
    },
    {
      "token" : "leblanc",
      "start_offset" : 6,
      "end_offset" : 13,
      "type" : "<ALPHANUM>",
      "position" : 1
    }
  ]
}

```

Second, What about `keyword_ngram_analyzer` that defined to `email`?

```json
POST /_analyze
{
  "analyzer": "keyword_ngram_analyzer",
  "text": "joh@m.co"
}
```
Output will be

```json
{
  "tokens" : [
    {
      "token" : "joh",
    },
    {
      "token" : "joh@",
    },
    {
      "token" : "joh@m",
    },
    {
      "token" : "joh@m.",
    },
    {
      "token" : "joh@m.c",
    },
    {
      "token" : "joh@m.co",
    },
    {
      "token" : "oh@",
    },
    {
      "token" : "oh@m",
    },
    {
      "token" : "oh@m.",
    },
    {
      "token" : "oh@m.c",
    },
    {
      "token" : "oh@m.co",
    },
    {
      "token" : "h@m",
    },
    {
      "token" : "h@m.",
    },
    {
      "token" : "h@m.c",
    },
    {
      "token" : "h@m.co",
    },
    {
      "token" : "@m.",
    },
    {
      "token" : "@m.c",
    },
    {
      "token" : "@m.co",
    },
    {
      "token" : "m.c",
    },
    {
      "token" : "m.co",
    },
    {
      "token" : ".co",
    }
  ]
}
```
Above the sample, you can query/filter by entering these tokens such as `joh@` or `@m.co` or referring to resulting tokens.

Conclusion

If you want to know, each analyzer of Elasticsearch tokenizes your queries. You can use Analyze API to analyze it.

See more [Analyze API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html#indices-analyze) for more details.
First Experience with MLH Local Hack Day
Tags: mlh, majorleaguehacking, localhackday
Published: 2021-01-16 10:48:39

Hello guys, In this blog post I'm going to discuss about my experience with MLH Local Hack Day. Before getting started with my experience let's first understand what MLH Local hack Day means. 

##What is MLH?
MLH stands for Major League Hacking and It is a global hacker community whose mission is to empower hackers. Also It is the official hackathon league for Students. This league power more than 200 weekend-long hackathons which inspire innovation, cultivate healthy communities and teach computer science to different enthusiasts around the world. 
By participating in these hackathons a student can benefit in ways like mentorship and advice, Onsite hackathon support, Hardware and Swags fulfilment and shipping (This is one of the most exciting practices to encourage students to participate and learn more..😀). 

##What is Local Hack Day?
Local Hack is an event which is divided into 3 parts which are:
* Learn(October 2020): Learn is a global day-long conference that allows your community to pick up new skills and show off how much you’ve learned on a leaderboard.
* Build(January 2021): Build is a week-long celebration of creating hacks/projects both big and small.
* Share(Spring 2021): Yet to happen..

##What are Guilds?
MLH Local Hack Day is a huge community with lakhs of students from different countries, therefore the concept of guilds has been introduced where each guild has a goal and the guild members help each other with the challenges and strive to be in the top of leaderboard. Guilds follow the concept of community inside the community. 

##How is my experience with MLH Local hack day?
I started this week by registering myself in the MLH local hack day for  the first time and joined the DevScript Winter of Code Guild. Everyday I have checked-in the events and workshops. Also I have challenged myself to complete the Build Challenges within the deadlines, which I have completed successfully. Also the guild members were amazingly supportive and I have learnt a lot from them and from the challenges of Build. I have registered myself in the hackathons of MLH like Rose hack, Hack the northeast. I'm planning to participate more in the hackathons in future. Today morning(16th January), I woke up and read this mail from swift from MLH saying that I'm receiving a letter swag. 
A letter swag will have:
* An MLH Sticker
* An Ellie Season Sticker
* A Local Hack Day: Build Hexagon Sticker
* A Thank You Postcard
This letter is separate from additional swags that one might get by checking in to events everyday. By doing this one can get a bonus of 6 hexagon stickers. 

##Conclusion
I am really excited to participate in Share(Spring 2021) and know more about it. Also I would like to thank all my guildmates, support staff and MLH coaches for making this entire hackathon fun and insightful.
Gaming On Linux!!! All you need to know on a single command-line!!!
Published: 2021-01-16 10:43:13

Want to play games on Linux? Are you tired about spending time on torrent sites, and messing up with software that won't let your laptop or desktop to live for more then a couple decent years? So here's what you have to do. If you are on Ubuntu 20.04 LTS, open up your terminal and type the following command:

```
$sudo apt-get install -y $(sudo apt-cache pkgnames games)
```

to remove everything you just installed

```
$sudo apt remove -y $(sudo apt-cache pkgnames games)
```

what this command shall do is pretty easy and straightforward. it shall install all the available games on the default Linux Repos, leaving you with an impressive collection of more then 12 Gbs of games. Hope you find this useful.

Love!!!
T.
Please, allow me to control my router from a Python script
Tags: python, router, web, scrapping
Published: 2021-01-16 10:38:34

Somebody that looks at my github could think that I hate the web: I have done lot of work trying to avoid connecting to web pages. That's not the case, anyway: I _love_ the web, but I'm not sure if I love opening a browser, starting a session, and using the mouse for very simple tasks. Anyway, I understand that the web is the standard interface (no more apps!) and I'm ok, as far as they let me interact with the webpages on my own way.

One thing that is sometimes interesting is to know which machines are connected to my home WiFi router: this needs to connect to the `192.168.1.1`, login to a 'webpage' (remembering the password, or looking for it in you password manager), waiting, going to the adequate link, waiting, and looking in a quite inconvenient result for the expected connected devices.

I have the [MitraStar GPT-2541GNAC
](http://en.techinfodepot.shoutwiki.com/wiki/MitraStar_GPT-2541GNAC) which my provider installed and this seems to be possible (with my previous provider we had a router with a 'web page' that used JavaScript intensively and it was more difficult). I found this project [mitrastar reset](https://github.com/hcordobes/mitra_reset) and decided to give it a try.

My goal was not to reset the router but I found there the main steps needed to connect to the devide and start interacting so, this is the result: [my mitrastar router project](https://github.com/fernand0/mitra_router).
There we have the new option `-l` (based on `networkmap.html` URL) that:

- Gets the URL content (with `requests`)
- Processes the results (with [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/); some day these devices will have an API).
- Eliminates duplicates with a dictionary (dont't ask me why there are some duplicate IPs).
- Shows then in the standard output.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/irf8qk55jxingqjwnvwn.png)

As I don't like remembering passwords nor storing them in programs, I also have added the `keyring` module to store `safely` (I'm not sure about the level of this safety, it is just a matter of separating code from passwords). Some info about this in [Storing credentials of your Python programs in the keyring](https://makingfernand0.wordpress.com/2016/01/24/storing-credentials-of-your-python-programs-in-the-keyring/).

Next steps? You know: I'll integrate this code as an ErrBot command and I'll be able to call them from anywhere I'll be in that moment.
How is code review organized in your company? 
Tags: code, review, programming, coding
Published: 2021-01-16 10:37:54

---
title: How is code review organized in your company? 
published: true
description: 
tags: code, review, programming, coding
//cover_image: https://direct_url_to_image.jpg
---

*Code review* is a process, which has a goal to assure the quality of delivery. In this specific case, the team is reviewing the quality of the code. This is accomplished by one or more developers examining the code which their colleagues wrote.

How are you doing code review? Do you pick someone who will review your code or is it voluntary? How much time does it take? When do you do it?