teleren/devto huggingface dataset:
Dart HttpServer   & Systemd 
Tags: dartlang, dart, httpserver, systemd
Published: 2021-04-03 18:13:50


How to setup dart's http server. 
Dartlang support httpserver's function at dart:io.
 
like this.

- ./bin/main.dart

```dart
import 'dart:io' as io;

void main(List<String> arguments) async {
  try {
    print("start bind");
    var httpServer = await io.HttpServer.bind("0.0.0.0", 80);
    print("binded");
    await for (var request in httpServer) {
      print("receive requested ${request.uri}");
      request.response.write("Hello");
      request.response.close();
    }
  } catch (e, s) {
    print("${e}");
    print("${s}");
  }
}
```

but, if you want to use this code. you must to know "how to setup this server on you linux".
 
In this serises, I'll explain about systemd, let's encrypt for dart server. 

## Environment

```
ubuntu 20.04
```

## Firewall

First of all. setup a firewall.

```sh
$ ufw status
Status: inactive
# $ ufw disable 
$ ufw default deny
$ ufw allow 22/tcp
$ ufw allow 80/tcp
$ ufw allow 443/tcp
$ ufw enable
$ ufw status
```

* port 22 is for ssh.you must to allow port 22 if you can access a linux instance to use ssh.


## Setup for Systemd

build dart code to native.

```
$ dart2native bin/main.dart 
$ mv bin/main.exe /opt/main.exe
```

and create entry shell.

- ./darthelloserver.sh  

```sh
#!/bin/sh

#cd /app/hao_dart_server_and_systemd; dart bin/main.dart
/opt/main.exe
```

and write service setting
- ./darthelloserver.service

```
[Unit]
Description=Dart Hello Http Server
After=syslog.target network-online.target

[Service]
ExecStart = /opt/darthelloserver.sh
Restart = always
Type = simple

[Install]
WantedBy=multi-user.target
WantedBy=network-online.target

```

and regist this service setting to systemd.

```
$ cp darthelloserver.sh /opt/darthelloserver.sh
$ chmod 655 /opt/darthelloserver.sh
$ cp darthelloserver.service /etc/systemd/system/darthelloserver.service
$ systemctl enable darthelloserver
$ systemctl start darthelloserver
```

This deamon use systemd-networkd-wait-online. 
if systemd-networkd-wait-online is disable status, this deamin didn't run.

you can check like this.

```
$ systemctl list-unit-files | grep network
$ systemctl enable systemd-networkd
$ systemctl enable systemd-networkd-wait-online
```

# all code 

https://github.com/kyorohiro/hao_dart_server_and_systemd/tree/dev01
Build Google Clone Using HTML & CSS - Beginners Tutorial
Tags: webdev, tutorial, beginners
Published: 2021-04-03 18:12:34

I had lot of fun building this with just HTML & CSS. This was part of a challenge in which i tried to build clones using HTML & CSS.

**Tutorial Video:**

{% youtube zhH9uvTOyQM %}

**CodePen:**

{% codepen https://codepen.io/somanath-goudar/pen/QWdvxMO default-tab=html,result %}

Guys, Feel free to tweak around the code. I tried my best to make it look exactly the same. Cheers!

**Github:** https://github.com/somanath-goudar/html-css-projects

**You may also like my other posts:**

{% link https://dev.to/somanathgoudar/build-a-youtube-clone-with-just-html-css-for-complete-beginners-4fk1 %}

{% link https://dev.to/somanathgoudar/build-a-password-generator-with-react-js-react-toastify-beginners-tutorial-4a9n %}
The easiest way ever to create a Node TypeScript Project!
Tags: javascript, node, webdev, typescript
Published: 2021-04-03 17:45:46

Hello everyone!

Today I would like to share with you a very simple way to get up and running with a new Node TypeScript project.

All it takes is running a single command from your terminal
```bash
$ npx node-ts-new
```
You would then get a Node.js TypeScript project configured with:
- nodemon
- eslint
- prettier
- dotenv

The generated project folder structure looks like this

![Generated Project Folder Structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wjldyp9mu5yp19zf1x1d.png)
 
**Thats it!**. Please feel free to check out the [github repo](https://github.com/ragrag/node-ts-new) for this package and even contribute to it!
MERN Stack social media app with socket.io
Tags: react, webdev, showdev, javascript
Published: 2021-04-03 17:44:57

Hello developers.
I've been recently working on my new personal project. It is a social media platform where you can make posts and chat with other people. It also has support for group chat. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dc80313smq16w2eofy3b.jpg)
I've used socket.io for "real time" chat and posts, it allows to send and receive data with very low latency.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x553kptw2hfd0co7lgoa.jpg)
For front-end, I've used TailwindCSS which makes the styling process very easy and time efficient. And I've also added user authentication with Google and Facebook or you can just signup with username and password. Plase check it out [here](https://ozfam.herokuapp.com) and let me know your thoughts down below. 
https://ozfam.herokuapp.com

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hucojzskdnt6tudvvr2q.jpg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9df5zsi4nhusfx72vgar.jpg)
My Coding Journey - Soldier Who Codes
Tags: webdev, javascript, beginners, programming
Published: 2021-04-03 17:29:30

In January of 2019 I began contemplating my plans for the future.  I was now 37 years old and after spending 17 years in the military in Jamaica I was becoming tired of the routine and needed to move on.

Now moving onto another career in this part of the world is easier said that done, because unlike other parts of the world, Jamaica has a degree culture.  Meaning that no matter how skilled you are both practically and theoretically, it is almost impossible to get a job, especially in a technical area without a degree.

After starting a degree in economics approximately 5 years earlier it fell through because of financial reasons. However, over that time my passion moved from economics to tech. So in August 2019 I enrolled at a local community college and began a degree in Management Information Systems. The first semester to me was tougher that basic military training, literally.

We were first introduced to C# and boy did I struggle with this especially the concept of arrays.  I remember one day I sat and cried and asked myself what the hell was I getting myself into.  But we had a lecturer who would continually reiterate to us, whenever we were not getting a concept, that it was normal and that we should relax.  My acceptance and realization of his reasoning came home one Sunday morning while scrolling through YouTube videos. 

I came upon a video by Gyasi Linje who was basically sharing his own struggles that he went through initially.  From that moment my outlook changed and I began approaching every concept with more positivity.  At the same time I started to understand that even professional programmers used Google and Stack Overflow. 

Two semesters later I got introduced to web development (HTML/CSS, JavaScript).  In that course I struggled with understanding the logic of JavaScript.  I was still able to successfully complete the course, however, I was not comfortable with my understanding of JS.  Once the semester ended I worked on gaining a better understanding of JS and built a travel site using JS.

However, at the end of that process it was apparent that I had rushed through and skipped a lot of the fundamentals.  Nine months later I am slowly going through to ensure that I get a full understanding of JS and I am at a place now where I am lot more comfortable with it. 

###PLANS FOR THE FUTURE

For the near future once I am comfortable that I have covered the fundamentals of JS I will move on to learning NodeJS and then ReactJS or VueJS.  

I still have not made up my mind on what career path in IT I want to follow but for now I'm enjoying the journey.

*Thanks for the taking the time out to read my post. It is truly appreciated.  If you want to know more about my journey follow me at:*

Twitter: @fikra_dev
 
Github: https://github.com/FikraDev
VS Code Tip Of The Day - Selectively Adding Files To A Git Commit
Tags: posts, git, vscode
Published: 2021-04-03 20:38:46

---
title: VS Code Tip Of The Day - Selectively Adding Files To A Git Commit
published: true
date: 2021-04-03 17:26:00 UTC
tags: Posts,git,vscode
canonical_url: https://www.codependentcodr.com/vs-code-tip-of-the-day-selectively-adding-files-to-a-git-commit.html
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/60e2pqnxrs0sqzel4wgl.png
---

Small tip: sometimes when working on something I find myself making changes to many files. I then only want to include a few of those files in my next Git commit. To date I've always just manually done a `git add <file>` in the terminal for each file I want to add, but this is tedious if there's many of them.

Turns out there's an easy way to do this in VS Code. If you go to the Source Control item on the left nav (the icon that looks like a branch), you’ll see a list of all untracked and modified files. For example:

![Showing Modified Files in the Source Control View](https://www.codependentcodr.com/static/imgs/source-control-min.png)

In this screenshot you can see I have a number of files that have been modified (the ones with the "M" beside them) and two new (untracked) files (the ones with the "U" beside them).

If you want to see what's changed in any of the modified files, clicking the item will bring up a diff window. If you then want to include (or "stage") this file for the next commit, right-click it and pick "Stage Changes":

![Selecting Stage Changes](https://www.codependentcodr.com/static/imgs/stagechanges-min.png)

Repeat for each file you want to include, and then do a `git commit` to complete the commit. Alternatively if you're anti-terminal you can click the checkmark on this same view to complete the commit.
몽고디비 리플리케이션 리플리카 셋  방화벽 설정 팁 / MongoDB Replica Set Network(firewall) Setup tip 
Tags: mongodb
Published: 2021-04-03 17:18:29

몽고디비 리플리카 셋 설정 할 때 해당 서버들의 방화벽에 반드시 해당 ip도 등록을 해줘야 한다. 
특히 클라우드 서비스의 경우 공인ip와 내부 서버 설정이 분리되어 있기 때문에 loop back ip로 외부 방화벽이 인식을 안하므로.. 
mongod 프로세스가 셀프 체킹을 할 때 alive check를 하지 못 하는 불상사가 있다.

이틀을 허비 했다. 쉬봉.
나같은 놈이 또있다면, 개꿀 팁일듯.

/

When we setup firewall for MongoDB Repliction,
we need to setup the ip itself.

It seems that mongod process checkup all the connections include itself, and the firewall cuts the connections checkup itself.

This is kind of tricky for me to figure it out;;
All the setup looks like having no problems..

I spent almost two days to figure this simple thing.

Hope to be helpful.
Free and Built-In TLS/SSL certificates in Azure
Tags: azure, ssl, tls, https
Published: 2021-04-03 17:17:30

Today, when a website does not have an **SSL/TSL certificate**, web browsers give you a warning `not secure`. This warning not only scares people but also gives you a disadvantage in search engine ranking. On Azure, web sites have a default https-enabled URL, like `https://sitename.azurewebsites.net/`, but when you have a vanity domain configured, you are missing this secure connection. Luckily there are some free SSL/TLS certificate options to explore. 

## Let's Encrypt

Wait, there is [Let's Encrypt](https://letsencrypt.org/), its free! Why are you not using this excellent service? Yes, that is true, but there are some downsides to use Let's Encrypt (on Azure), like:

* You need an Azure Web App Site Extension to enable and renew certificates, like this one from [Simon J.K. Pedersen](https://github.com/sjkp/letsencrypt-siteextension/).
* Let's Encrypt does not have any official support or SLA model.
* It's complex to implement correctly for all the Azure services you need.
* Let's Encrypt only validates the domain name. There are **no further validations** like other CAs, and certificates are misused for phishing attacks.

## Azure Built-In free certificates

It should be easy and free to enable SSL/TSL certificates in Azure. This was the number one question on [UserVoice feedback](https://feedback.azure.com/forums/170024-additional-services). Microsoft implemented this Built-In free certificate option for some services, like Azure [CDN](https://azure.microsoft.com/en-us/services/cdn/), [Front Door](https://azure.microsoft.com/en-us/services/frontdoor/), [Application Gateway](https://azure.microsoft.com/en-us/services/application-gateway/), etc. When you put one of those services in front of your web site (like what I did with [this blog](https://clemens.ms/)), you can enable an auto-renewable Built-In certificate for free.

![enable TLS certificates](https://clemens.ms/free-and-built-in-tls-ssl-certificates-in-azure/tls.png)

> "[Custom Domain HTTPS feature](https://docs.microsoft.com/en-us/azure/cdn/cdn-custom-ssl) enables you to deliver content to your users securely over your own domain. This is done by encrypting the data between the CDN and your users' clients (typically web browsers) via TLS protocol (which is a successor of the SSL protocol) using a certificate. Using our "CDN managed certificate" capability, you can enable this feature with just a few clicks and have Azure CDN completely take care of certificate management tasks such as its renewal. You can also bring your own certificate (stored in Azure Key vault ) or even purchase a new certificate through Key vault and have Azure CDN use that certificate for securing the content delivery."

## Use your own certificate

There is also an option to use your own certificate, especially when you need a naked domain (without the "www"-prefix). This is not currently possible with the Build-In certificate option. See "[Hosting a Static Site on Azure using CDN and HTTPS](https://clemens.ms/hosting-a-static-site-on-azure-using-cdn-and-https/)" how to fix this.
Digital Marketing: Why Business Should Go For It
Tags: digitalmarketing, digitalmarketingtraining, onlinetraining
Published: 2021-04-03 17:13:42

<p>Digital Marketing is something that every business needs to have. The demand of digital marketing has been seen in last few years with the increase in competition in every sector. With the digital marketing efforts, business can connect to their target audiences and can make them aware of the product/ services being offered by them.</p>
<p><strong>Do Every Business Needs Digital Marketing?</strong></p>
<p>Yes, start up do need search engine optimization to get their website on the Google search engine. The market has competitive day by day and it is very challenging for a new company to make its position among the key players in respective domain.</p>
<p>If your website is fully SEO friendly and have powerful backlinks then you can make your website visibility on search engine. Bur for this, you need to have the right guidance and training about the SEO tactics that may work good for your business.</p>
<p>&nbsp;</p>
<p><strong>Can increase in organic traffic will grow?</strong></p>
<p>There is no rocket science to improve the organic traffic for your website. If your website is satisfying the Google search engine guidelines as well as the user intent then definitely your website will going to be rank on the Google search engine result.</p>
<p>Now the major question is how you could make your content compatible to Google? The answer is simple, don&rsquo;t focus on Google for this. Try to answer the query of the common user who visited your website in search of its answer. If your visitor started to spend more time on your website then it will give a trust signal to the Google and automatically your organic ranking will climb up in the search engine.</p>
<p>Also, link building is a must to rank any keyword. If your webpage/blog is having enough powerful collection of links that are linking back to you then it will boost your website visibility on search engine. You can&nbsp;<a href="https://rhsofttech.com/digital-marketing/">learn the tactics to improve organic traffic</a>&nbsp;from the professional expert in the respective domain also</p>
<p>&nbsp;</p>
<p><strong>Where I Should Go for the digital marketing efforts?</strong></p>
<p>It is difficult to say which the best digital marketing course is.</p>
<p>In my opinion the best course is one that can take you close to your dream job.</p>
<p>If you&rsquo;re satisfied with the ethics of&nbsp;<a href="https://rhsofttech.com/digital-marketing/">digital marketing</a>&nbsp;and your training has taught you with basics to advanced level digital marketing skills then definitely you can say that you was a part of the best course.</p>
49 Days of Ruby: Day 7 - Booleans
Tags: ruby
Published: 2021-04-03 16:40:11

---
title: 49 Days of Ruby: Day 7 - Booleans
published: true
description: Join us on a 49 day learning journey through Ruby!
series: 49 Days of Ruby
tags: #ruby
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/9m73qaetuse3nm3y3it8.png
---

**Welcome to day 7 of the 49 Days of Ruby! 🎉**

Today we are going to discuss another important data type to know about as we begin our journey in Ruby. Today is all about the important *Boolean*.

What does Boolean mean?

The name Boolean comes from the English mathematician, George Boole. His seminal work *The Laws of Thought* gave rise to Boolean algebra. We won't get into too much math 😌, but basically, Boolean algebra is algebra where the values are either **true** or **false**.

As you can probably gather at this point if Boolean algebra is where the values are either true or false then *a Boolean* is a data type equalling either true or false.

Like many programming languages, Ruby offers you the ability to leverage Booleans in your code. Here is a quick example:

```ruby
monday = true

if monday == true
  puts "Today is the first day of the workweek, enjoy!"
end
```  

In the example above we set the variable `monday` to equal `true` and then make a conditional statement based on that value. If `monday` is `true` then we output a string, and if not, we do nothing.

That example is a relatively straightforward use case, but it lays the groundwork for what kind of things you can do with Booleans.

🎓 *Extra credit: What Class do Booleans belong to? You haven't learned about Classes yet. They are a way of organizing types of things together. For example, you might have a `CatClass` for all types of cats. In many programming languages, there is a standard `Boolean` type Class for Booleans. Not in Ruby!*

To find out the Ruby Classes for Booleans go ahead and open up a session of IRB in your terminal:

```ruby
irb> true.class
=> TrueClass
irb> false.class
=> FalseClass
```

That's right! There is not one class for Booleans, but two! The `true` value belongs to `TrueClass` and the `false` value belongs to `FalseClass`.

There are several implications for that. One of them, is you cannot just check if a thing is a Boolean, because it could be either `TrueClass` or `FalseClass`. We'll cover that more later when we get to Classes. 🎓

Besides `true` and `false`, what other things fall into the category of `truthy` or `falsy`?

When it comes to `false` values, there is only `false` itself or `nil`. 

There are more things that are `truthy` though, here are some of them:

* `0`
* `''` (*empty string*)
* `[]` (*empty array*)

You can find more in this [GitHub Gist](https://gist.github.com/jfarmer/2647362).

How will you use Booleans in your Ruby journey? Continue experimenting in IRB and share what you learned in a blog post or on Twitter!

**Come back tomorrow for the next installment of 49 Days of Ruby! You can join the conversation on Twitter with the hashtag [#49daysofruby](https://twitter.com/hashtag/49daysofruby).**
Create your Github portfolio in less than 5 minutes
Tags: github, html, portfolio
Published: 2021-04-03 16:39:28

_Want to show the world your awesome portfolio and don't have the cash to get a custom domain and hosting?_

## GitHub has you covered!

### Prerequisites:
- A GitHub account
- HTML and markdown knowledge or just have in mind you can visit https://www.w3schools.com/html/ and https://www.markdownguide.org/cheat-sheet/

### You got two ways to do this:
1. Create a repository {your-username}.github.io
2. Create a repository {your-username} and add a README.md file

## Creating a markdown README.md file with your username

GitHub allows you to create a special repository with your username and adding a plain README.md markdown formatted file will setup a nice quick readme and frontend resume for your GitHub page such as https://github.com/cmelgarejo
  
## Going with a {your-username}.github.io

Creating a repo {username}.github.io this is a good way to have a static site that it's fully customizable with CSS and javascript, styles and all the fancy animations or images portraying your portfolio

You have to create an index.html file and this will be served statically on the site.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/46ihd0mmirbprpry5beh.png)

You might be wondering about the CNAME file that's on the repo, so, you can additionally add a custom domain, you can do so within the settings of the repository:

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/02cemedslfmumzafgs42.png)
 
And follow the instructions there, basically you will have to add a CNAME entry at your DNS configuration on the domain provider.

So these are the quickest ways to have a nice about page on the internet without having to spend a dime or make a great effort thanks to the usage of markdown

Cheers!~
How will people know I released a new version?
Published: 2023-04-29 21:26:42

---
title: How will people know I released a new version?
published: true
date: 2021-04-03 16:25:05 UTC
tags: 
canonical_url: https://mikestaszel.com/2021/04/03/how-will-people.html
---

I began properly versioning the software I write recently. I’m working on a Python package that I hope others will use. My goal is to iterate and release new features and fixes over time, but I need a way to signal to the world that a new version is available.

## Why You Should Version Your Code

- It’s a best practice.
- It makes you think about supporting users of your code.
- It only takes a few extra minutes during the software development lifecycle.
- You should version your code if you ever want to share it with others.

## Why You Should NOT Version Your Code

- It’s a personal project. Unless your goal is to learn how to properly version your software, this can be a distraction.
- During the very beginning of a project. Making a decision about versioning should happen when you’re ready to share something with others — not before.
- Git and other version control systems version code for you. You can extend this with tags and releases.

## Popular Versioning Schemes

Two popular version schemes are Semantic Versioning and Calendar Versioning. Each have its strengths and weaknesses.

### Semantic Versioning

- Here’s the guide — the summary is exceptionally clear: [semver.org](https://semver.org) [[semver.org](https://semver.org)/]
- This method is more common and you’ve seen it. A version number is based on changes in the software.
- Examples of this: 1.0.0, 1.0.1, 1.1.0, 2.0.0.

### Calendar Versioning

- Here’s the guide: [calver.org](https://calver.org) [[calver.org](https://calver.org)/]
- This method uses the calendar to version software.
- Microsoft is starting to do this with Windows 10 — versions and updates are named after years and months they’re released.
- This is a little bit more loosely defined than Semantic Versioning.
- Examples: 2020.6, 2021.01.01, 21.04.

## When to Use Which

I use both of these approaches depending on what kind of application is being developed.

Even if you use neither of these approaches, consider using git tags, they’re very lightweight and you’ll thank yourself later. It’s like an easy-to-see snapshot your code at a point in time.

For “rolling” and fast-moving applications, I use CalVer:

- An example of this can be something like an ETL pipeline that’s continuously being modified.
- Easier to reason about and set up — it’s just a date.
- This is nicer than using only git for version history.

For slower-moving or shared components and libraries, use SemVer:

- Releases happen infrequently.
- Older releases are supported with patches.
- Great for shared libraries.
- Useful for when you want to provide some guarantees about compatibility to others.