teleren/devto huggingface dataset:
systemd-timesyncd を無効化する方法
Tags: linux, ntp, systemd, japanese
Published: 2021-10-22 16:23:03

---
title: systemd-timesyncd を無効化する方法
published: true
description: 時刻同期といえば ntpd が有名ですが、最近は ntpd ではなくて systemd のコンポーネントが使用されるようになってきています。この記事では systemd-timesyncd による時刻同期を無効化する方法を解説します。
tags: linux, ntp, systemd, Japanese
//cover_image: https://direct_url_to_image.jpg
---

## Introduction.

Linux で時刻同期といえば ntpd が有名ですが、最近は systemd のサービスである systemd-timesyncd が使われることが増えています。時刻同期を無効にしたい、けど手元の環境には ntpd が入っていないみたいだという場合はもしかしたら systemd-timesyncd が使われているのかもしれません。

この記事では systemd-timesyncd が使われているのかどうかを調べる方法と、systemd-timesyncd を無効化する方法、再度有効化する方法を解説します。


## systemd-timesyncd が使われているか調べる方法

ターミナルで下記コマンドを実行します。

```bash
systemctl status systemd-timesyncd
```

systemd-timesyncd が使われている場合、下のスクリーンショットのようにコマンドの出力に "Active: active (running)" という文字列が確認できます。

![Result when systemd-timesyncd is active and running](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/teee4yl3oiuu4nc74qhi.jpg)

一方で systemd-timesyncd が使用されていない場合は "Active: inactive (dead)" という文字列が確認できます。

![Result when systemd-timesyncd is inactive and not running](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qkh56yxu9a9l2va5r1rk.jpg)


## systemd-timesyncd による時刻同期を無効化する方法

無効化にはルート権限が必要です。

最初に動作中の systemd-timesyncd サービスを停止します。次のコマンドを実行します。

```bash
sudo systemctl stop systemd-timesyncd
```

次に systemd-timesyncd サービスを無効化します。次のコマンドを実行します。

```shell
sudo systemctl disable systemd-timesyncd
```

最後にサービスの状態を確認します。次のコマンドを実行します。

```shell
systemctl status systemd-timesyncd
```

"Active: active (running)" と表示されていた行が "Active: inactive (dead)" に変わっていれば無効化は完了です。OS 再起動の必要はありません。

![disable systemd-timesyncd](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bows26wzqxt3aws0zykf.jpg)

## systemd-timesyncd を再度有効化する方法

再有効化にはルート権限が必要です。

最初に systemd-timesyncd サービスを有効化します。下記のコマンドを実行します。

```shell
sudo systemctl enable systemd-timesyncd
```

次にサービスを起動します。有効化しただけではサービスが起動していないからです。

```shell
sudo systemctl start systemd-timesyncd
```

最後にサービスの状態を確認します。下記コマンドを実行します。

```shell
systemctl status systemd-timesyncd
```

"Active: inactive (dead)" と表示されていた行が "Active: active (running)" に変わっていれば再有効化は完了です。OS 再起動の必要はありません。

![re-enable systemd-timesyncd](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dd6fnwfwiwl2q5vzmzqi.jpg)
Now you can event create series on @dsabyte.com
Tags: javascript, webdev, beginners, programming
Published: 2021-10-22 16:10:51

Go [here](https://www.dsabyte.com/posts/publish) and see `series` and `post` button below. 

Click on `series` if you want to create `series` and click on `post` if you want to create single post.

## benefit of series
You can add more posts togather, you don't need to  put links of all series, it'll visible by default to the reader

## [example-series](https://www.dsabyte.com/posts/blog/Publishing-a-post-on-dsabyte/6172a87cf383201ed5427513)

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


## Thank You
8 other ways to comment in HTML
Tags: html
Published: 2021-10-22 16:05:55

---
title: 8 other ways to comment in HTML
published: true
description: I thought there was only one way to comment something in HTML, but the specification is pretty broad on what it turns into comments.
tags: HTML
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/us7mvh6h8sfpg80aoewe.png
---

If you're someone who's found themselves knee deep in HTML, you'll know that even this so called "not a programming" language has comments. They're pretty obvious:

```HTML
<!-- this is a comment in HTML -->
```

That's it. There's no other way to write comments in HTML. Well...

![Anakin & Padme meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a899nganq9m16q0k8hd3.jpg)

OK, so officially `<!-- comment -->` is how comments should be written. But the specification will turn your HTML into a comment at the drop of a hat. 

Let's have a look at the many and varied ways that parser errors should result in comments!

## 1. Not dashing enough
`<!-->` and `<!--->` 

## 2. Too much bang for your buck
`<!-- comment --!>`

## 3. My hyphen key broke
`<! whatever ` or `<! whatever >`  (yes, it can even end with the EOF)

## 4. You can question my comments
`<?whatever etc.` or `<?whatever etc.>`

## 5. I don't think you should be here
`<![CDATA[whatever]]>` (this only applies in "non-foreign" content)

## 6. It started so well
`<!-- comment` (EOF in comment)

## 7. This script is too short
`<script><!-- comment` (EOF in script)

## 8. Learn the rules of tag
`<666></666>` (opening part is treated as text, the closing part is a comment)

On top of all those non-comment comments, a final extra quirk: the second `-->` in `<!-- <!-- I wish I could nest comments --> -->` is treated as mark up!
Top 10 trending github repos of the week🐮.
Tags: datascience, dataanalysis, goplus, datatech
Published: 2021-10-22 16:01:16

---
title: Top 10 trending github repos of the week🐮.
published: true
description: Most popular trending Github repos in this week.
cover_image: https://source.unsplash.com/featured/?coding
tags: datascience,dataanalysis,goplus,datatech
series: Weekly Github top 10
---
GitHub is where over 65 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and features, power your CI/CD and DevOps workflows, and secure code before you commit it.

Here is the most popular repos published on this platform.

## #1
![social banner of repo](https://opengraph.githubassets.com/ddfad2add5263a97b576699d7e7fc1b84ce559dc13fe7b85894417e37cff9e15/goplus/gop)
{% github goplus/gop %}

## #2
![social banner of repo](https://opengraph.githubassets.com/70144009495422b0b64f4c23f6ede7096e0732f7ae86261d7b2c0dc5b55f3c94/k4zmu2a/SpaceCadetPinball)
{% github k4zmu2a/SpaceCadetPinball %}

## #3
![social banner of repo](https://repository-images.githubusercontent.com/348822769/13e83cf5-edce-432b-8437-2725c92819e2)
{% github nuxt/framework %}

## #4
![social banner of repo](https://repository-images.githubusercontent.com/415421172/44213d64-6546-4d9d-a39c-8c8617a20603)
{% github AveYo/MediaCreationTool.bat %}

## #5
![social banner of repo](https://opengraph.githubassets.com/56238a23f5e724e0274aadb538818d89397ec1c3d75b152159c20ec5921189fe/KieSun/all-of-frontend)
{% github KieSun/all-of-frontend %}

## #6
![social banner of repo](https://opengraph.githubassets.com/3eb6238177d2be76092a4d83a5a3cd44e1131ee184cf9f6d05947bc69d59b66b/john-smilga/node-express-course)
{% github john-smilga/node-express-course %}

## #7
![social banner of repo](https://opengraph.githubassets.com/940a5a915948dc60d2a5c6157466e837d7f3b00cd4f78dbe956e763c33a3307b/qiurunze123/miaosha)
{% github qiurunze123/miaosha %}

## #8
![social banner of repo](https://opengraph.githubassets.com/72a7dcaa900cdc46d6ad9f72ba5d9fec58e738af1e9d5302e31ac73f0e17e9ca/apple/swift-markdown)
{% github apple/swift-markdown %}

## #9
![social banner of repo](https://opengraph.githubassets.com/f292f4b3bc5a699b11c4c9467c3585470804cd3569f3e840b8db2475075a48bc/sveltejs/kit)
{% github sveltejs/kit %}

## #10
![social banner of repo](https://opengraph.githubassets.com/c0d3025298773d98d2949509ad66b2de625b6881fa205f01cc609babec7aa1a5/logseq/logseq)
{% github logseq/logseq %}

Enjoy these repos.
Follow me for more articles.
Thanks 💖💖💖
Copy text to clipboard in JS(two ways)
Published: 2021-10-22 15:40:26

Of course the user can just select the text and copy it but giving them a button that they can click to copy it seems like a better idea(better UX). So in this article I will show you how you can copy text to clipboard using JavaScript.

## 1. Old method
the old way to copy text to clipboard is
* create a textarea(Or input)
* put the text you want to copy in that textarea
* add textarea to your page
* select the text in textarea
* execute **copy** command
* remove it from your page
```js
function copyToClipboard(text){
    const textArea = document.createElement("textarea")
    textArea.value = text
    
    document.body.appendChild(textArea)

    textArea.focus()
    textArea.select()
    
    document.execCommand('copy')
    
    document.body.removeChild(textArea)
}
```

## 2. New method
For newer browsers we can simply use the `navigator.clipboard` to copy text
```js
function copyToClipboard(text){
    navigator.clipboard.writeText(text)
}
```

## 3. Bonus
Now we can combine these two approach and create a function that would use the `navigator.clipboard` in modern browsers and fall back to old approach when needed
```js
function copyToClipboard(text){
    if(navigator.clipboard){
        navigator.clipboard.writeText(text)
        return //codes below wont be executed
    }
    const textArea = document.createElement("textarea")
    textArea.value = text
    
    document.body.appendChild(textArea)

    textArea.focus()
    textArea.select()
    
    document.execCommand('copy')
    
    document.body.removeChild(textArea)
}
```


Make sure you check out my other articles and YouTube channel.
{% link https://dev.to/0shuvo0/lets-create-a-screen-recorder-with-js-3leb %}
{% youtube mD_QQvJYQAI %}
How to disable systemd-timesyncd (NTP service via systemd).
Tags: linux, systemd, gpsd, ntp
Published: 2021-10-22 15:16:52

---
title: How to disable systemd-timesyncd (NTP service via systemd).
published: true
description: This article provides you the way to check status of systemd-timesyncd and disable it.
tags: linux, systemd, GPSD, NTP
//cover_image: https://direct_url_to_image.jpg
---

# TL;DR

1. Stop `systemd-timesyncd`

    ```shell
    sudo systemctl stop systemd-timesyncd
    ```

2. Disable `systemd-timesyncd`

    ```shell
    sudo systemctl disable systemd-timesyncd
    ```

Done!

## Introduction.

Today, so many things depend on *accurate* time-keeping. Thus we don't need to disable time sync usually, but sometimes -- workaround to [annoying GPSD bugs](https://www.zdnet.com/article/thanks-to-a-nasty-gpsd-bug-real-life-time-travel-trouble-arrives-this-weekend/) and so on -- we need to disable it.

In the past, it was common to use `ntpd` for time sync. Since systemd-216, the `systemd-timesyncd` is often used.

This article provides you "how to check `systemd-timesyncd` is being used", "how to disable `systemd-timesyncd`" and "how to re-enable `systemd-timesyncd`".


## How to check `systemd-timesyncd` is being used.

Run following command in a terminal.

```shell
systemctl status systemd-timesyncd
```

If `systemd-timesyncd` is being used for time synchronization, you can see "Active: active (running)" in the result like following screenshot.

![Result when systemd-timesyncd is active and running](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/teee4yl3oiuu4nc74qhi.jpg)

On the other hand, `systemd-timesyncd` is not used, you can see "Active: inactive (dead)" in the result like following screenshot.

![Result when systemd-timesyncd is inactive and not running](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qkh56yxu9a9l2va5r1rk.jpg)


## How to disable `systemd-timesyncd`.

At the first, you need to stop the service. To do this, run following command in a terminal.

```shell
sudo systemctl stop systemd-timesyncd
```

Then disable systemd-timesyncd, run following command in a terminal.

```shell
sudo systemctl disable systemd-timesyncd
```

![disable systemd-timesyncd](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bows26wzqxt3aws0zykf.jpg)


## How to re-enable systemd-timesyncd.

First, set 'enable' for systemd-timesyncd. To do this, run:

```shell
sudo systemctl enable systemd-timesyncd
```

Then start the service of systemd-timesyncd. To do this, run:

```shell
sudo systemctl start systemd-timesyncd
```

Finally, let's see systemd-timesyncd is really enabled. Run:

```shell
systemctl status systemd-timesyncd
```

![re-enable systemd-timesyncd](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dd6fnwfwiwl2q5vzmzqi.jpg)

done!
API - What is it ? P-2
Tags: programming, webdev, tutorial, beginners
Published: 2021-10-22 15:11:19

* Types of **API**

1. Public
2. Partner
3. Private or Internal

* Public **API**

> Available to any third party developers.

> API's are publicly available to developers and other users with minimal restriction. They may require registration, use of an **API** Key or OAuth, or maybe completely open.

* Partner **API**

> Partner APIs are APIs exposed by/to the strategic business partners.

> They are not available publicly and need specific entitlement to access them.

* Private **API**

> Private APIs, are hidden from external users and only exposed by internal systems.

> Internal APIs are not meant for consumption outside of the company but rather for use across different internal development teams for better productivity and reuse of services.
EMMET: Saviour of Developers
Tags: webdev, beginners, tutorial, productivity
Published: 2021-10-22 15:04:43

Emmet a plugin for everyone who couldn't remember the whole syntax.
<h1>HTML</h1>
The basic Boilerplate Generator `!`
Just type `!` and hit enter.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dqhma2ns71ulfey69nwy.gif)

<h3>Classes and Id</h3>
Classes:- `div.className`
ID:- `div#idName`
hit enter, and Emmet completes it for you !

<div class="highlight"><pre class="highlight html"><code><span class="nt">&lt;div class="className"&gt;&lt;/div&gt;</span></code></pre></div>

same goes for `section`
`section.className` and `section#idName`

<h3>Duplicating</h3>
`ul>li*3`
<pre class="highlight html"><code><span class="nt">&lt;ul&gt;</span>
    <span class="nt">&lt;li&gt;&lt;/li&gt;</span>
    <span class="nt">&lt;li&gt;&lt;/li&gt;</span>
    <span class="nt">&lt;li&gt;&lt;/li&gt;</span>
<span class="nt">&lt;/ul&gt;</span>
</code></pre>

<h3>Grouping of Tags</h3>
`div>(hdr>ul>li*2>a)`

<div class="highlight"><pre class="highlight html"><code><span class="nt">&lt;div&gt;</span>
    <span class="nt">&lt;header&gt;</span>
        <span class="nt">&lt;ul&gt;</span>
            <span class="nt">&lt;li&gt;&lt;a</span> <span class="na">href=</span><span class="s">""</span><span class="nt">&gt;&lt;/a&gt;&lt;/li&gt;</span>
            <span class="nt">&lt;li&gt;&lt;a</span> <span class="na">href=</span><span class="s">""</span><span class="nt">&gt;&lt;/a&gt;&lt;/li&gt;</span>
        <span class="nt">&lt;/ul&gt;</span>
    <span class="nt">&lt;/header&gt;</span><pre></div>

Part 2 incoming !!! Stay Tuned <3
Typing game but for programmers
Tags: programming, javascript, tutorial, beginners
Published: 2021-10-22 15:01:44

Lets be honest writing codes is nothing like typing regular text.
Though is not a huge factor for everyday coding. But  I'd still love to have a tool help me with practicing to write codes. So I **made** *that* `tool`. Although it doesn't have assessments of a full blown IDE, it's pretty decent and have syntax highlighting, preserving indentation and auto bracket closing feature. And its opensource so fell free to have a look at [the codes](https://github.com/0shuvo0/protyping).
You can [play it here](https://0shuvo0.github.io/protyping/)
[![typing game for programmers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ryakfnu95u8wv1zhdlc6.png)
 ](https://0shuvo0.github.io/protyping/)

{% user 0shuvo0 %}
Unearthing Observability with New Relic
Tags: techtalks, opensource, database, podcast
Published: 2021-10-22 15:01:23

Is observability mission critical at this point? The folks at New Relic think so. And they’re not alone, according to their recent whitepaper on observability 90% of respondents believe observability is strategically important to their business. It’s becoming increasingly difficult to understand what’s going on within software development organizations.

New Relic’s GVP & GM Buddy Brewer and SVP Greg Perotto join the podcast to discuss observability best practices, how to avoid data silos, the value of telemetry across the entire software life cycle and the five key insights of [New Relic’s Observability Forecast](https://newrelic.com/resources/white-papers/2021-observability-forecast).

#**Listen to the full episode**
{% spotify spotify:episode:7AHliriId2lwHGivF8nUsQ %}

## Episode Highlights Include:
* Achieving full-stack observability
* Avoiding data silos by consolidating monitoring tools
* Open source adoption
* The utility of telemetry data

## Join the Dev Interrupted Community
With over 1900 members, the Dev Interrupted Discord Community is the best place for Engineering Leaders to engage in daily conversation. No sales people allowed. [https://discord.com/invite/devinterrupted](Join the community >>)

![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tgynr8n6nd6rqud6y3s.png)

*Originally published at [https://devinterrupted.com.](https://devinterrupted.com/podcast/unearthing-observability-with-new-relic/)*
CodeChef - Sum Of Digits Of a Number
Tags: codechef, java, programming
Published: 2021-10-22 14:45:42

Problem Code:- FLOW006

>Problem Statement:- You're given an integer N. Write a program to calculate the sum of all the digits of N.

### Input
The first line contains an integer T, the total number of testcases. Then follow T lines, each line contains an integer N.

### Output
For each test case, calculate the sum of digits of N, and display it in a new line.

### Explanation
As said in the problem statement, we have to find the sum of all the digits of a number. For Example:- 321 will be 3+2+1 = 6.

For this we use basic math rule which is of division when we do the 10 modulo of any number we get the last digit of that number as the output, using this principle we get the last digit of 321 number which is 1. After that we divide n by 10  which will be 321/10 = 32.1 but as we have declared n as integer the value taken by the complier will be 32 and we save 32 in n. After that we repeat the above steps until the value of n becomes 0 and in last we print the sum. The below code explains it.

In each program we take T as a Test cases so that we can supply multiple input to the program in a single run and get the output for all of them in one step rather than running the program multiple times for each input. Basic *for loop* is used for this purpose.
 
```
while(n!=0) {
			sum = sum+n%10;
			n=n/10;
		}
		System.out.println(sum);
```
Input:

```
3
321
4252
1556434
```

Output:
```
6
13
28
```

Link to original problem [https://www.codechef.com/problems/FLOW006](https://www.codechef.com/problems/FLOW006)

Run the program from here:- [Click Here](https://blog.atharvasid.me/codechef-sum-of-digits-of-a-number)

> Add input in Stdin Inputs

LIKE! SHARE! COMMENT!
Open Source With Hacktoberfest
Tags: opensource, webdev, hacktoberfest, javascript
Published: 2021-10-22 14:36:15

##What is Hacktoberfest
Open Source is changing the world, one contribution at a time.
**Hacktoberfest** is a month-long celebration of open source development run by **Digital Ocean**. It is open to everyone, from firs-time contributors to seasoned open source developers.
Your journey starts with a pull request. After submitting four pull requests, you get the chance to win a `T-Shirt` or `Plant a tree`
This year's hacktoberfest is presented by **DigitalOcean**, **AppWrite**, **Intel**, **DeepSource**.

##Contribute
Anyone around the globe who desires to help drive the growth of open source and make positive contributions to an ever-growing community. All backgrounds and skill levels are encouraged to participate and learn more.
>To contribute, Always look for repositories on GitHub with the #hacktoberfest-2021 or #hactoberfest tag
>[Hacktoberfest Link](https://www.hacktoberfest.digitalocean.com)

###Ways To Contribute To Repositories:
* Bug Fixes
* Writing tests for projects
* Writing of Documentations/Technical Writing
* and many more

##Some Projects To Contribute:
1. **Hoppscotch**:
Hoppscotch is an open source API Development ecosystem. You can test, save, share, collaborate, document API's in real-time and many more.

#####Stats for hoppscotch
* Used by 500,000+ developers
* Over 32,000 GitHub stars
* 21,000+ monthly users
{% github hoppscotch/hoppscotch no-readme%}

2.**TheDevDojo/Wave**
{% github thedevdojo/wave no-readme%}

3.**TheDevDojo/Tails**
{% github thedevdojo/tails no-readme%}

Thanks for your time and don’t forget to be friends with me on:
* [Twitter](https://www.twitter.com/set_addo)
* [GitHub](https://www.github.com/seths10)
Programming Fundamentals - 1 - Variables
Tags: dart, programming, beginners, tutorial
Published: 2021-10-22 14:34:42

#What are Variables?

When I think of variables I imagine something like a `bucket`.
A Bucket that contains a value. It may be a alphabet, some words, numbers, both or can be a shopping list.

This Defination may be apt for understanding what is a variable.

Variables are the building blocks of any program.

They store a value that can be used in any part of the program
Dart Programming 
Tags: dart, flutter, programming, fundamentals
Published: 2021-10-22 14:21:50

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


Starting a blog series for `DART`.


Dart is a programming language designed for client development, such as for the web and mobile apps. 

It is developed by Google and can also be used to build server and desktop applications. 

Dart is an object-oriented, class-based, garbage-collected language with C-style syntax.

Dart is so famous because of flutter framework. 

The Flutter framework allows the building of cross platform mobile apps.

Now Since I assume that you all are beginners. I will start from basic concepts like variables, functions etc.
DNS - Domain Name System (simplified)
Tags: webdev, devops, inthirtyseconds, beginners
Published: 2021-10-22 14:21:23

##  DNS

  **What?** 🤔
 The Domain Name System (or DNS) converts human readable domain names (like: www.google.com) into Internet Protocol (IP) addresses (like: 173.194.39.78)

 **Why?** 🤔
Computers can only communicate using a series of numbers, so DNS was developed as a sort of “phone book” that translates the domain you enter in your browser into a computer readable IP.

 **Process**  ⚙️
 

## ☑️ *`Check your device cache`*
 
 When you search for a website or web-page , your browser will not know the i.p address of the web server. Your browser will first check its cache memory to see if it has the DNS records for that domain cached. It also checks the `hostfile` of your computer/mobile for the ip address.


## ☑️ *`Check with your ISP`*
 
Your ISP (Internet Service Provider) caches popular sites like Google.com , Netflix.com , (facebook?), Youtube.com etc. If they have the record in their cache, you would skip the rest of the DNS lookup process.

## ☑️ *`Root DNS server & TLD server`*

 Top Level Domains are `.com`  `.gov`  `.net`  `.in` etc. 
 Top Level Domain servers have information about the  `Master/Authoritative DNS servers` which actually contain the server information.
 Root DNS servers are tasked to find and point to the Top Level Domain Servers.
 
 
## ☑️ *`Super Fast! ⚡`*
 
 This entire DNS lookup process happens in just a couple milliseconds. For perspective, we blink our eyes in roughly 50 milliseconds. We can resolve most DNS queries in under 30 milliseconds.👀
 

## ☑️ *`References`*
  1. [DNSmadeEasy](https://dnsmadeeasy.com/support/what-is-dns/)

___

| Post by | Aftab Faisal  |
|--|--|
| 🔗 |https://www.linkedin.com/in/aftab22/  |
| 🔗 |https://github.com/aftab22  |
| 🔗 |https://dev.to/aftab22  |