teleren/devto huggingface dataset:
We launched an open source ClickHouse Knowledge Base
Tags: clickhouse, database, serverless, sql
Published: 2022-10-24 15:12:02

ClickHouse is an incredible database. We want to help our community learn how to better use it for realtime analytics.


![clickhouse knowledge base](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jxzd7mydw62rnhiyacb2.png)

We are very excited to announce that we've launched an [open source ClickHouse Knowledge Base](https://www.tinybird.co/clickhouse/knowledge-base/). Please feel free to check it out, and if you are so inclined, contribute to the [public repo](https://github.com/tinybirdco/clickhouse_knowledge_base).

Tinybird is built on top of [ClickHouse](https://github.com/ClickHouse/ClickHouse/), and we employ several ClickHouse developers who contribute daily to the lightning-fast open-source database to make it… well… lightning-faster.

In fact, our team has over 40 years of combined experience working with ClickHouse. Not bad for a database whose initial release was only 6 years ago.

Over the course of the time that we’ve been building Tinybird and contributing to ClickHouse, we’ve learned a lot about the column-oriented OLAP. The more we know, the more we love. It’s a perfect analytical database to solve the problems that data companies are trying to solve right now: namely operationalizing complex analytical queries and building products on top of them.

We’ve launched this knowledge base to celebrate our continued investment in the ClickHouse open source project, and to help our customers, friends, and the broader ClickHouse community make the most of this incredible OLAP powerhouse. We intend to add new tips almost daily.

Feel free to check it out. If you learn something, please share it wherever you scroll. And if you’ve got some ClickHouse magic up your sleeve that you want to share, please contribute!
NGINX
Tags: nginx, server
Published: 2022-10-24 14:53:51

# Installing in Debian/Ubuntu Machine
## Installing from Ubuntu repository
```
$ sudo apt-get update
```
```
$ sudo apt-get install nginx
```
To verify the nginx installation

```
$ sudo systemctl status nginx
```

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


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

## Uninstalling Nginx
```
$ sudo apt-get purge nginx nginx-common
```
> from Ubuntu repo we get outdated nginx version so for latest we can install from nginx repo 


## Installing from Official Nginx repository

```
$ sudo wget https://nginx.org/keys/nginx_signing.key
$ sudo apt-key add nginx_signing.key
```
```
$ sudo vi /etc/apt/sources.list
```
*Here i am using vi editor to save the changes use Esc :wq
*Add the below two lines into this sources.list 
`deb https://nginx.org/packages/mainline/debian/ <CODENAME> nginx
deb-src https://nginx.org/packages/mainline/debian/ <CODENAME> nginx`
Here replace CODENAME with your OS CODENAME
to know CODENAME use this cmd
```
$ sudo cat /etc/lsb-release
```

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

```
 $ sudo apt-get update
```
```
$ sudo apt-get install nginx
```

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

* To know nginx status 

```
$ sudo systemctl status nginx

```

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

* using PS we can get the nginx status

```
$ ps -ef | grep nginx
```
You will find master and worker process then its working fine

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

`http://localhost/`

* Nginx by default runs on port 80, HTTP server

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

* Start nginx
```
$ sudo systemctl start nginx
```

## Key nginx folders,files,cmds

`/etc/nginx/` - default nginx configuration files located here


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

`/etc/nginx/nginx.conf` - default nginx configuration entry point used by nginx service.Contain the global settings like logs location,workers, files locations etc

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

`/etc/nginx/conf.d` - default http server configuration file,which is added in http directive of nginx.conf referred using inculde(include /etc/nginx/conf.d/*.conf;)

`/var/log/nginx` - store the access and error log of nginx server.
access.log - logs each request
error.log - logs error events and for debugging 

```
$ nginx -v
$ nginx -V
$ nginx -t
$ nginx -v
$ nginx -h

```


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

Thanks for reading
My first day working
Published: 2022-10-24 14:41:37

Hello, I'm Tue and my full name is Nguyen Chi Tue. I'm very self-deprecating on social media as Facebook, Instagram,... But in here, when anyone know who i am, I will write anything about me.
Today is the first day I go to work. I'll be developer from now. I fell good today when i go to work. It's so great.
I were very nervous so I got up very early today. I went to work early because I didn't want to be late for work. Hahaha
But it's not as difficult as i thought it would be. Anything is OK. I doing job which i don't know before. I learned about website, write api,... but i don't know anything about d-com server. I thought I don't work it. But I decided try it. This is my chance for me learn something new. It's more difficult than I thought. But the challenges are chances.
I'll try to learn it. I can do it. Try hard and the success will come to me ^^
Music Monday — What are you listening to? (Soul Music Edition)
Tags: watercooler, discuss, music
Published: 2022-10-24 14:30:55

_cover image source: [Johnnny2X4](https://giphy.com/Johnnny2x4/)_ 

**This past week I got turned on to [The Soulquarians](https://www.youtube.com/watch?v=bWzzkD78ETA&t=618s), a collective of musicians from the late 90's who all took hip hop into a more soulful, jazzy territory. So, I'm asking y'all to hop on the soul train with me and share some of your favorite soulful tunes. Old school soul and neo soul are both welcome here!**

![Erykah Badu's Mama's Gun album](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nqw5shh9qt813780l29y.gif)

***

## How we do 

In this weekly series, folks can chime in and drop links to whatever it is they've been listening to recently + browse others suggestions.

If you like talking about music, consider following the org [#music discussions](https://dev.to/music-discussions) for more conversations about music!

{% embed https://dev.to/music-discussions %}

***

Lookin' forward to hearing some of y'all's favorite soul musicians! _Note: you can embed a link to your song using the following syntax `{% embed https://... %}`. This should work for most common platforms!_

I look forward to listening to y'all's suggestions! 👂 🎶
DevOps Real time Scenario Based Interview Question And Answers #Episode1 #AWS #DevOps #Git
Tags: devops, aws, firstpost
Published: 2022-10-24 14:28:19

Hey Everyone 🙂, Sudarshan here👽. Firstly, Happy Diwali 💣 Bhailog and Didilog ! Let's get to the point. I have been preparing for my DevOps Interview and for me like first two three interview were like ohhh ! bhai ye bhi pending hai ! ye bhi nahi kiya.... ! wo command kya tha and I was getting panicked, but only after facing interview you get the confidence to get better at it. And in my opinion, DevOps is very huge. It is not possible to learn and hands on every tool, and you can't be sure that your role will exactly require that skill set. While interviewing If search DevOps interview question and answers, we get huge thousands of different site, and we get confused which one to pick. So I thought I will suggest what actually interviewers demands from candidate. In this series, I will include both scenario based and theoretical questions I have asked. I hope this finds you helpful. If you have any suggestion or comments feel to contact.

1.Consider I'm working on some functionality on local repo, I have made some changes but haven't committed yet, and my boss calls me and says hey don't commit your changes first pull all the new changes and then start working on your task. What would you do to not lose all your changes ? 

- Use **git stash** when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit. 
[For more detailed information about stash, please refer to this link](https://www.atlassian.com/git/tutorials/saving-changes/git-stash#:~:text=The%20git%20stash%20command%20takes,committed%3A%20new%20file%3A%20style.)

2.How can we resolve conflict ?

- For this, you can structure your own answer. I answered, we can directly edit the conflicted file and check what lines causing the merge conflict. We will delete unwanted line and will commit files with the required lines of code.


3.What is the difference between NAT gateway and NAT Instance ?

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

4.What is SSH port number ?
- Port 22 is used for SSH communication and allows remote administration access

5.What is public and private subnet, and how can we identify them?
- Public subnet: The subnet traffic is routed to the public internet through an internet gateway or an egress-only internet gateway. For more information, see Connect to the internet using an internet gateway.
- Private subnet: The subnet traffic can't reach the public internet through an internet gateway or egress-only internet gateway. Access to the public internet requires a NAT device.


6.How can I have internet connectivity to an instance in my private subnet ?
- Using NAT Gateway and updating route table, we can have internet connectivity to an instance in private subnet

And that's wrap guy's ! 🚀
What are your Goals for the week? HacktoberFest week 4
Published: 2022-10-24 14:17:34

What are your goals for this week? 

It's the last full week of  Hacktoberfest, are you contributing to or maintaining projects this year? 

Have you done so previously?

- What are your goals for the week?   
- What are you building? 
- What will be a good end result by week's end?
- Are you working on Hacktoberfest?
- Did you meet your goals last week?

**Last Week's Goals**
 How did I do?

- [:white_check_mark:] **Continue Job search.** Sent DMs, talked to some people, filled out a few applications. 
- [:white_check_mark:] **Get more PR accepted for HacktoberFest.** 4/4 for Hacktoberfest goal with one PR waiting on being approved. Working on another. 
- [:x:] **Create CSS art.** Didn't do new art work

- [:white_check_mark:] **Blog on any CSS art.** Have not written the blog yet. I did blog on HacktoberFest update.
- **Update content on a web site:** Information not released in time. Will do it this week. 
- No decorating, Did go on trip. 

**This Week's Goals** 

- Continue Job search.
- Create CSS art.
- Blog on any CSS art.
- Update content on a web site.
- Process photos from trip. 
- Decorate for Halloween. 

```
-$JarvisScript git push
```
1. Two Sum
Tags: leetcode, algorithms, python
Published: 2022-10-24 13:32:08

---
slug: '1-two-sum'
title: '1. Two Sum'
subtitle: ''
series: 'Leetcode'
description: 'Solution to Leetcode 1. Two Sum'
cover_image: 'https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbhlwcj5pic26zj8r6k3.png'
local_image: ''
publishedAt: '2022-10-23T09:00:00.000Z'
tags: 'leetcode, algorithms, python'
published: true
---

## Python

Solution walkthrough: https://twitter.com/lloydtao/status/1584288569622790145

### 🥇 Hash table - O(n)

Method: Take each number and check if its complement has been seen before. If not, add it to the list of known complements along with its index.

- Time complexity: O(n)
- Space complexity: O(n)

```python
class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        """Take each number and check if its complement has been seen before. If not,
        add it to the list of known complements along with its index.

        Args:
            nums (List[int]): Input array of integers
            target (int): Target integer

        Returns:
            List[int]: Indices of the two integers that sum to target
        """
        # Initialise hash map to store known integers
        complements = {}
        # Iterate through the list
        for i in range(len(nums)):
            # Check if the current number's complement has been seen before
            complement = target - nums[i]
            if complement in complements:
                return [complements[complement], i]
            # Add the current number to the list of known complements
            complements[nums[i]] = i
```

### 🥈 Check pairs - O(n²)

Method: Take each pair of numbers and see if they add up to the target.

- Time complexity: O(n²)
- Space complexity: O(1)

```python
class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        """Take each pair of numbers and see if they add up to the target.

        Args:
            nums (List[int]): Input array of integers
            target (int): Target integer

        Returns:
            List[int]: Indices of the two integers that sum to target
        """
        # Get length of input array
        n = len(nums)
        # Iterate over all pairs (i,j)
        for i in range(n):
            for j in range(i + 1, n):
                # Check if this pair equals the target
                if nums[i] + nums[j] == target:
                    return [i, j]
```
GoLang - How to use maps
Tags: go
Published: 2022-10-24 13:15:00

When we start in Go and we already developed in another language, we can be perturbed about how maps works.

### Declaration
The object type `map` doesn't exist in Go. A key word exist instead and it helps to create an object type based on maps with the following structure: 
> map[<key type>]<object type>

*Examples*
```go
map[string]string
```

For example, to create a map which will link a string key to a number, you will use : `map[string]int`

For a map used to link a rune to a `book` object : `map[rune]book`

### Details on object type
As map object type doesn't directly exist, object types are identicals only if they have the same key type and value type.

map[rune]book != map[string]int
map[rune]book != map[string]book
map[rune]book != map[rune]int
map[rune]book == map[rune]book

### Utilization
```go 
m := map[string]string{}   // Declare a map

m["p"] = 3                 // Add a value
m["p"] = 4                 // Update a value
fmt.Println(m)             // Print a map: "map[p:4]"

v := m["p"]                // Get a value: v == 4
v = m["p2"]                // Value not found: v == 0 (zero)

_, found := m["p"]         // found == true
_, found = m["p2"]         // found == false

if x, found := m["p"]; found {
    fmt.Println(x)
}                           // Print "4"

delete(m, "p")              // Delete a map
```

---

I hope it will help you! 🍺

---

<center><h3>You want to support me?</h3></center>
<a href="https://www.buymeacoffee.com/mxguilbert7" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
GoLang - Comment utiliser des maps
Tags: go, french
Published: 2022-10-24 13:15:00

**Quand on débute en Go et qu'on a déjà développé dans un autre langage, on peut être perturbé sur la déclaration des maps en Go.**

### Déclaration
Le type d'objet `map` n'existe pas en Go. Il existe par contre un mot clé `map` qui permet de créer un type d'objet basé sur les maps avec la structure suivante : 
> map[<key type>]<object type>

*Exemples*
```go
map[string]string
```

Par exemple, pour créer une map qui permettrait de lier une chaine de caractère en tant que clé avec un chiffre vous utiliseriez : `map[string]int`

Pour une map permettant de lier une rune avec un objet `book`, on aurait : `map[rune]book`

### Détail sur le typage
Vis-à-vis de ce qui a été dit plus tôt, vu que le type d'objet map n'existe pas, les types d'objets créé à partir de map ne sont les même que si ils ont le même type de clé et d'objet.

map[rune]book != map[string]int
map[rune]book != map[string]book
map[rune]book != map[rune]int
map[rune]book == map[rune]book

### Utilisation
```go 
m := map[string]string{}   // Déclarer une map

m["p"] = 3                 // Ajouter un nouvel élément dans la map
m["p"] = 4                 // Mise à jour d'un élément
fmt.Println(m)             // Afficher la map: "map[p:4]"

v := m["p"]                // Récupérer une valeur: v == 4
v = m["p2"]                // Valeur non trouvée: v == 0 (zero)

_, found := m["p"]         // found == true
_, found = m["p2"]         // found == false

if x, found := m["p"]; found {
    fmt.Println(x)
}                           // Affiche "4"

delete(m, "p")              // Supprimer un élément dans la map
```

---

J'espère que cela vous aidera! 🍺
How to Improve your Code With easy Refactorings
Tags: webdev, beginners, programming, tutorial
Published: 2022-10-24 13:04:34

*Refactorings are amazing to grow and improve our code*

> TL;DR: Let's start addressing our code smells

I have been writing a series on Code Smells for a long time.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}

There are a lot of (possible) problems

Let's go for the solutions!

{% post https://dev.to/mcsee/refactoring-001-remove-setters-26cg %}

{% post https://dev.to/mcsee/refactoring-002-extract-method-1eee %}

{% post https://dev.to/mcsee/refactoring-003-extract-constant-4j5p %}

{% post https://dev.to/mcsee/refactoring-003-extract-constant-4j5p %}

{% post https://dev.to/mcsee/refactoring-005-replace-comment-with-function-name-4lpf %}

{% post https://dev.to/mcsee/refactoring-006-rename-result-variables-2fmd %}

{% post https://dev.to/mcsee/refactoring-007-extract-class-18ei %}

{% post https://dev.to/mcsee/refactoring-008-convert-variables-to-constant-4ahj %}

* * *

Photo by <a href="https://unsplash.com/ja/@norevisions">No Revisions</a> en <a href="https://unsplash.com/es/s/fotos/cleaning">Unsplash</a>

* * *

Part of the objective of this series of articles is to generate spaces for debate and discussion on software design.

{% post https://dev.to/mcsee/object-design-checklist-2p4 %}
Node.JS: a wise choice for your project?
Tags: javascript, node, webdev, programming
Published: 2022-10-24 12:43:09

My first [article](https://bogdancotoara.substack.com/p/nodejs-a-wise-choice-for-your-project) is up, check it out! If you liked it, consider subscribing to my newsletter to be amongst the first ones to get notified when I post.
New Website, Who Dis?
Tags: website, javascript, terminal, project
Published: 2022-10-19 12:02:36

---
title: New Website, Who Dis?
published: true

tags: ["Website", "Javascript", "Terminal", "Project"]
canonical_url: https://blog.arisamiga.rocks/post/website/
---

For a long time, I have had a website called [arisamiga.rocks](https://arisamiga.rocks) which was made using Basic HTML & CSS, and Javascript. 

I have been using this website for a long time for experimenting with website making and I always wanted to revamp it.

![Old Website](https://blog.arisamiga.rocks/img/Website-pre.jpg)

(_This is how it looked._)

I have been interested in the design of Terminals and especially Ubuntu Terminals

![Ubuntu Terminal](https://blog.arisamiga.rocks/img/ubuntu-terminal.jpg)

So I decided that maybe I can make a website that behaves kinda like a terminal and have all the information in the form of commands.

![New Website](https://blog.arisamiga.rocks/img/New-Website.jpg)

_I also turned my Profile Picture to Ascii which is a pretty cool feature of the website._

The commands are handled by a Javascript file which calls upon a list of commands and their functions that are stored in a JSON file which is read by the Javascript file.

So it is also much easier to add commands in the future. Special commands such as "Start", "blog" and "nocss" are handled by the Javascript file itself.

If you want to check the Javascript file you can at [arisamiga.rocks](https://arisamiga.rocks).

Also if you are not tech-savvy you can still use the website by typing the "start" command on the terminal.

The website is still a work in progress and I will be adding more features to it. I am also thinking for the holidays I might add some special commands or "apps" that you can do...



-
Originally Posted on: https://blog.arisamiga.rocks/post/website/
The best sites, apps, platforms and their alternatives
Tags: webdev, beginners, tutorial, opensource
Published: 2022-10-24 12:24:33

Have you ever searched as a programmer for the best CSS Framework, Modern Javascript Frameworks or the best Web Hosting or domain server?
If the answer is yes, then you must know more about (**top-alternatives.online**)

**What is top-alternatives.online**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xs4oalwqoploxqyuwegm.png)

([Top Alternatives](https://top-alternatives.online)) helps you find similar, alternative or related sites, apps and platforms to any website instantly in all categories on all platforms (web, desktop, android). The main function of this website allows visitors to search similar websites by providing website name or URL.
SPEAK BOT
Tags: speakbot, python, programming
Published: 2022-10-24 12:19:20

```
import pyttsx3**__**
machine=pyttsx3.init()
machine.say("HII THERE , I AM YOUR SPEAK BOT . ENTER HERE WHAT YOU WANT ME TO SPEAK")
machine.runAndWait()
speak = input('ENTER WHAT YOU WANT ME TO SPEAK =\t')
print(""+speak)
machine.say(""+speak)
machine.runAndWait()
machine=pyttsx3.init()
machine.say(" . , THANKS FOR USING ME ..!")
machine.runAndWait()
```