teleren/devto huggingface dataset:
How to fix common error using Azure Kubernetes AKS from WSL2
Tags: kubernetes, aks, azure
Published: 2022-12-27 02:06:17

---
title: How to fix common error using Azure Kubernetes AKS from WSL2
published: true
description: Running Kubernetes on WSL2.
tags: #kubernetes #aks #azure
# cover_image: ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7xdbmn2mkb10pnm01iu7.jpg)
# Use a ratio of 100:42 for best results.
# published_at: 2022-12-27 01:01 +0000
---

When you use Kubernetes CLI tool: `kubectl` that is installed while you installed Docker Desktop for Windows, there is a small glitch that it will fail the `kubectl` commands, because of Kubeconfig file.

Let's supposed you want to create a new cluster on AKS, as follows:

```bash
az aks create --resource-group MyResourceGropu --name MyMicroserviceCluster --node-count 1 --enable-addons http_application_routing --generate-ssh-keys
```

And then you need to set that new cluster as your default cluster to work on, so you use 

```bash
az aks get-credentials --resource-group MyMicroserviceResources --name MyMicroserviceCluster
```

The previous command will retrieve the credentials of the newly created cluster and store it in the kubeconfig file, and make the newly cluster as the current default cluster, so any subsequent `kubectl` command will run against that cluster.  
If you run the previous command from WSL2 terminal, you will get the following message:  

```bash
Merged "MyMicroserviceCluster" as current context in c:\Users\<username>\.kube\config
```

Because Kubernetes CLI tool is installed with Docker Desktop for windows, so it default the config location to windows location.  
But later any subsequent `kubectl` command from WSL2 terminal, will use the linux path for kubeconfig which is `~/.kube/config`.   
So, if you run the following command:  

```
kubectl config current-context
```
you will see that the current context still the current context in linux config file, which most probably is the default **docker-desktop**.  

To fix the problem, you can specify the config file as environment variable **KUBECONFIG**.  
So modify the profile file **~/.profile** by adding the following:  

```bash
export KUBECONFIG=/mnt/c/Users/<windows user>/.kube/config
```
This will point the config file to the windows config file.
What is a blockchain?
Tags: beginners, programming, blockchain, web3
Published: 2022-12-27 11:26:22

**A blockchain has a list of blocks. It starts with a single block, called the genesis block.**

👀 index: the position of the block in the chain.

👀timestamp: a record of when the block was created. This is typically a UNIX timestamp, aka: the number of seconds since January 1st, 1970. This data is important since it establishes a blockchain as a chronological time-based structure.

👀hash: this is commonly referred to as the block hash or block header. As opposed to what the demo says, this piece of data is NOT stored in the block but is actually a digital fingerprint representing the block's contents.

👀previous hash: the hash of the previous block.


👀nonce: the nonce is the number used to find a valid hash.

The number of leading zeros required is the difficulty.
The process of finding valid hash outputs, via changing the nonce value, is called mining.

A miner starts a "candidate block" with a nonce of 0 and keeps incrementing it by 1 until we find a valid hash.
Does Angular support generic component types?
Published: 2022-12-27 11:26:01

typed generics
Typescript Generics is an absolutely powerful resource. Through generics, we can modify an existing interface for a specific use case. For example, you could have a grid to display rows of information. By making the network component conventional, customers can provide their own interface that represents their line facts and present that interface used throughout the network component homes. [camzap](https://cam-zap.com) [bazoocam](https://bazo-cam.com/)

Why will we need a generic component?
Before we dive into the technicalities of the prevailing ingredients, I suppose it's essential to understand why we need to have standard support for our additives.

Let's say we have a grid problem that displays widgets and fires an event while customers select a row. Without Generics, we need to specify the row info type as any because we need to reuse this grid factor with different statistical units.
How music inspires app developers and programmers
Tags: music, inspiration
Published: 2022-12-27 11:00:42


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vcjtw20galpjxfaluzyo.jpeg)
Music can be a source of inspiration for app developers and programmers in a number of ways.

One way that music can inspire app developers is by providing a sense of motivation and focus. For example, a programmer who is working on a particularly challenging project may find that listening to music helps to keep them motivated and focused as they work.

Music can also inspire app developers and programmers by serving as a source of creative ideas. For example, a programmer who is working on developing a new music app may be inspired by the music they listen to and incorporate elements of that music into their app design.

In addition, [music](https://mp3-lucky.com) can serve as a source of inspiration for app developers and programmers by providing a sense of relaxation and stress relief. After a long day of coding, listening to music can help to clear the mind and provide a sense of relaxation, which can be beneficial for both the creative process and overall well-being.

Overall, music can be a powerful source of inspiration for app developers and programmers, helping to keep them motivated, focused, and creative as they work.
A Year of Growth and Impact: Reflections on 2022 as a Woman in Tech
Tags: womenintech, empowerness, tech, writing
Published: 2022-12-27 10:30:16

As the year 2022 comes to a close, it's time to reflect on the accomplishments and successes of the past year. As a **female** voice in the tech industry, I have made it my mission to inspire, educate, and empower others through my blog and newsletter.

Throughout the year, I have written a number of **technical articles** that have received a great deal of positive feedback. These articles have aimed to demystify **complex topics** and make them accessible to a wider audience.

In addition to sharing my knowledge through my writing, I have also launched a [**newsletter**](https://letsmakecloud.beehiiv.com/subscribe) to further disseminate my ideas and insights. This has allowed me to reach an even larger audience and help more people learn about the exciting world of technology.

As a woman in tech, I understand the importance of **representation** and **diversity** in the industry. It's vital that all voices are **heard** and that everyone has the **opportunity** to learn and grow. That's why I strive to be a positive role model and to use my platform to **inspire** and **empower** others, particularly other **women** and **girls** interested in tech.

Overall, the year 2022 has been a fulfilling and successful one, and I am grateful for the opportunity to **share** my knowledge and insights with the world. I look forward to continuing this work in the coming year and beyond, and to helping make the tech industry a more **inclusive** and **equitable** place for all.
Adding Cool Badges to Your GitHub Repository
Published: 2022-12-27 10:29:30

## Introduction

Adding badges to your GitHub repository is a great way to show off your work and share important information with others. It can also help you to stand out from the crowd, attract more visitors to your repo and showcase the skills that you have. In this blog post, we'll look at what badges are, how to add them to your repository, and the different types of badges that you can use.

## What are Badges?

Badges are small icons or images that are used to communicate important information. They usually contain a logo or icon, along with a short text message. Some of the most common badges are those that show the status of a project, such as whether it is complete or still in progress. Other badges are used to indicate the type of license the project is using, or the language it was written in.

## How to Add Badges to Your Repository

Adding badges to your repository is relatively easy. First, you'll need to find the badge you want to add. There are many websites that offer free badges, or you can design your own. Once you've chosen your badge, you'll need to add it to your repository. This can be done by inserting the badge's code into your README file, or by adding it as a new file.

## Types of Badges

There are many types of badges that you can add to your repository. Some of the most popular ones include:

- Build status badges, which show the current status of a project
- License badges, which indicate the type of license a project is using
- Code coverage badges, which show the percentage of code covered by tests
- Dependency badges, which show the version of a dependency
- Version badges, which show the version of a project
- Open source badges, which show that a project is open source

## Conclusion

Badges are a great way to add value to your GitHub repository and show off your skills. Adding badges is relatively easy and can help you to stand out from the crowd and attract more visitors. There are many different types of badges available, so you can find the ones that best suit your project.
What's New in Flutter 3 | Deep Dive into Our Latest Release
Tags: flutter
Published: 2022-12-27 10:23:36

A small icon on your phone that occupies less than one percent of the total space represents an app. However, do not let its size fool you. An app might be small in size but it transports you to an entirely different world. The methods available to develop a mobile app are as many as their uses. However, like every other industry, there are a few dominant players in this field too. A major name in the mobile application industry is flutter. development

## What is Flutter?

In May 2017, the tech giant Google launched a free and open-source mobile UI framework. The reason why mobile app development with flutter got extremely popular is that it solved a major problem for many developers. Earlier coders and mobile application developers had to use separate codebases to create a native app. Flutter allows you to do the same using a singular codebase only.

## Flutter Updates

We live in a world where the chances that a piece of technology would go dormant before it even launches are very high. This is why software, especially one used to create new software or tech pieces always has to keep updating itself to stay at its top game. Flutter is no different. Flutter app development has been a class apart ever since the tech piece was first launched because of constant updates and developments. It has evolved to the point where flutter 3, has only recently been launched.

## What is Flutter 3?

Recently the video gaming industry has been the talk of the town. It feels as if the phenomenon of online gaming just took over the world by storm and soon everyone, kid, teenager, and even adult was engaging in it. Like every other company with half a brain, Flutter development company too moved towards a more gaming-oriented development. The latest version of flutter focuses primarily on the gaming industry.

## What is New in Flutter 3?

While there are multiple minor changes that provide smoother running of the application, a major change is that [flutter 3](https://www.sterlingtechnolabs.com/whats-new-in-flutter-3/) now allows international text input is now available. This feature has proven to be an absolute game changer for flutter and has eliminated whatever threat it was facing due to upcoming mobile application development platforms entirely.
Successful mobile application development with flutter is regarded as a huge milestone for any developer. Becoming an app developer is no easy task, let alone by using flutter. More than the quantitative result of flutter, in the form of an app, the application proves to be a testimonial of a developer’s calibre and capabilities. While many software has come and gone, flutter and its latest developments in a successful attempt to tighten its grip on the market have only proven that this application is here to stay.
A Risk Management System Is An Investment For Your Lending Business
Published: 2022-12-27 10:23:09

If the loan underwriting is not done carefully, getting into the lending business can be rather risky. There is a chance that the borrowers will prove to be dishonest and default on the loan. In order to manage lending risk, it is advantageous to outfit your lending company with automated loan underwriting software and a [risk management system](https://deciphercredit.com/loan-platform/risk-management-system) that notifies you of any dangers related to a given loan application. To learn more, connect with Decipher.
Project Euler #1 - are we fizz-buzzing?
Tags: kotlin, projecteuler, beginners, programming
Published: 2022-12-27 10:18:31

> **Disclaimer**
> 
> This blogpost provides solution to the first problem from Project Euler. If 
> you want to figure out a solution yourself, go to the
> [Problem 1's page](https://projecteuler.net/problem=1) and come back later :)

This is going to be a very brief post as the problem is very simple as well. 
It's similar to pretty well known `FizzBuzz` problem, which is a basic 
recruiting task or a simple task at the beginning of one's programming-learning journey.

> **The Problem**
> 
> If we list all the natural numbers below 10 that are multiples of 3 or 5, 
> we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.

The simplest `O(n)` solution would be iteration over the numbers and find multiples of 3 and 5.

## Solution

The simplest solution using a loop would like something like this:
```kotlin
private fun loopApproach(input: Int): Int {
    var acc = 0
    for (i in 3 until input) {
        if (i.mod(3) == 0 || i.mod(5) == 0) {
            acc += i
        }
    }

    return acc
}
```

To be more `kotlin` you could use `fold` instead of usual `for-loop`:
```kotlin
private fun foldApproach(input: Int): Int =
    (3 until input).fold(0) { acc, value ->
        if (value.mod(3) == 0 || value.mod(5) == 0) {
            acc + value
        } else {
            acc
        }
    }
```

The `fold`, however, is a bit slower. With large input value 
(`1_000_000_000` instead of `1_000` and I need use `Long` for that) which takes in both cases almost 3 seconds on my computer, the difference is over 
`100ms`.

## Conclusion

The simplest problem is done. Let's move on to the next and let's see what we can get out of it.

Thank you for your time and see you in the next one!
I am creating a new ✨JavaScript✨ Framework
Tags: webdev, javascript, opensource, api
Published: 2022-12-27 10:14:48

Okay so here's the plan. I will try to create a new javascript backend framework (most probably not because I'm just trying to rewrite pre-existing backend frameworks). My plan for now is to Understand how all of this works. So My first step is to re-create what others have already made, And then I'll move on to making and architecture of the "new" framework.


## Introducing **Ramen 🍜**

![Ramen Logo which I got from the internet hehe](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nfg8h1baize3kntwatl5.png)


yet another open source backend rest API framework! For now all this is, is a cheap copy of [Express](https://github.com/expressjs/express) 

You can find the repository for ramen [here](https://github.com/ohayouarmaan/ramen) Currently as of when I'm writing this post, Ramen has the functionality to 

* Detect query parameters
* Route parameters
* Get all the headers 
* Send / write a response object

and it follows the route-by-route kind of routing, Where if a user goes to let's say 'http://ip:port/something/id' it will try to match this with different kind of functions provided to the server. And whichever function comes first (i.e. whichever function was appended first) will be used to process that request. It is also capable of finding query parameters, for example if you go to the URL 'http://ip:addr?foo=bar' you can access the value of foo by the Request object provided to you by Ramen simply by doing
`req.queryParams` I'll try to log all the developments I make in Ramen here only. And somehow this will keep me motivated to keep this project alive all the time :)

![Cat with super powers](https://media.giphy.com/media/VbnUQpnihPSIgIXuZv/giphy.gif)
Micro frontend
Published: 2022-12-27 09:43:28

## What & Why

Micro Frontend คือการพัฒนา Frontend โดยการแบ่งย่อยส่วนต่างๆ ให้เล็กลงและแยกจากกัน โดยที่แต่ละส่วนจะเป็นอิสระต่อกันในการพัฒนา, แต่ละส่วนจะสามารถมีทีมของตัวเองรับผิดชอบกับความต้องการทางธุรกิจที่เฉพาะเจาะจงได้

หาก Application ในปัจจุบันมีโอกาสสูงที่อนาคตจะมีความซับซ้อนมากขึ้นจาก service ที่มี ทำให้ความต้องการ (requirement) ที่ซับซ้อนมากขึ้น การใช้ codebase Frontend ตัวเดียวรับรองทุก business logic อาจจะมีปัญหาตามมาเรื่องความซ้ำซ้อนและและแยกกันไม่ขาดได้ จาก Frontend เช่น

- Map service: ที่ปัจจุบันยังใช้ third party แต่หากในอนาคตจำเป็นต้องพัฒนา service ของตัวเอง ตัว development cycle อาจจะไม่สามารถรวมกันกับ web architecture ปกติได้
- หากว่าในอนาคต service มีมากขึ้น และแต่ละ service มี requirement ของตัวเอง การแบ่งทีมพัฒนาแต่ละส่วน แยก testing, deployment แต่ยังรวมกันเป็น 1 เว็บได้ ถือเป็นเรื่องสำคัญ

หน้าตาของ Micro frontend

## Values & Enablers

- การแยกส่วน frontend component เปรียบได้กับ domain ต่างๆ ซึ่งจะสร้างความคล่องแคล่วในการพัฒนาได้มากขึ้น
- การพัฒนา testing, deployment จะแยกออกจากกัน ทำให้แต่ละทีมทำงานโดยไม่ต้อง depend กับใคร เช่น หาก team a จะใช้ frontend stack ต่างกับ team b ย่อมทำได้
- การพัฒนา platform จะรองรับขนาดทีมที่ใหญ่ขึ้น feature ที่ซับซ้อนขึ้น และการทำงานที่แยกขาดจากกันมากขึ้น
- หากภายใน project Micro Frontend จำเป็นต้อง update version ทั้งของ libary, framework หรือแม้กระทั่งปล่อย release ใหม่ แต่ละ project สามารถทำได้แยกจากกัน และไม่กระทบซึ่งกันและกัน

## Guidelines

- Spike เครื่องมือสำหรับทำ Micro Frontend เช่น [Piral](https://piral.io/)
- เลือก service ที่มีความเป็น domain ชัดเจน
- แยก Service นั้นออกมาทำ Micro Frontend ผ่านเครื่องมือ (แยก Repo)
- ประมินผลลัพท์และหากเหมาะสม ค่อยเริ่มทะยอยทำ Micro Frontend ภายใน service ต่างๆ โดยดูจากความชัดเจนในตัว domain และผลกระทบต่อ platform

## Cautions

- ระวังเรื่องการแบ่ง Micro fronend หรือ component หากไม่ได้ออกแบบหรือวางแผนให้ดีก่อนเริ่มทำ อาจทำให้เกิดความซับซ้อนเพิ่มมากขึ้นในระบบ
- ควรมี knowleage และ resource ที่พร้อมเพียงพอก่อนเริ่ม

## Alternatives

- อาจพิจารณาทำเป็น Monolith แต่ให้คำนึงถึงการออกแบบ component ออกมาให้ให้เป็นสัดส่วนที่ชัดเจน เพื่อที่จะสามารถนำไป reuse ได้ง่าย หรือการที่จะนำไปแบ่งเป็น Micro Frontend ในอนาคต

## References

- [Micro Frontend](https://martinfowler.com/articles/micro-frontends.html)
- [Micro frontends: pros and cons](https://fabrity.com/blog/technical/micro-frontends-pros-and-cons/)
- [Demo](https://mife-demo.florian-rappl.de/products)
What are the advantages of artificial intelligence?
Tags: ai, android, ios, mobile
Published: 2022-12-27 09:33:55

Artificial intelligence, or AI, is a computer technology designed to mimic human intelligence and behaviors. It can be used to automate tasks, analyze data, and make decisions, and it has the potential to bring the following benefits and advantages 

**Increased efficiency**: AI can automate tasks and processes, allowing organizations to complete tasks faster and more accurately.

**Improved decision-making**: AI can analyze large amounts of data and identify patterns and trends that may not be visible to humans. This can help organizations make more informed decisions.

**Enhanced productivity**: AI can handle routine tasks, freeing up human workers to focus on more complex and creative tasks.

**Increased competitiveness**: Organizations that adopt AI can gain a competitive edge by operating more efficiently and effectively.

**Improved customer service**: AI can be used to provide personalized and efficient customer service, improving the customer experience.

**Increased innovation**: AI can be used to identify new opportunities and generate creative solutions to complex problems.

**Enhanced security**: AI can be used to identify and prevent cyber threats and fraudulent activity.

Overall, AI has the potential to bring significant benefits to a wide range of fields and industries. It is important, however, to carefully consider the potential impacts and ethical implications of AI, and to ensure that it is developed and used responsibly.

To know more:http://bitly.ws/xSNh
Why Is Open Source CRM Software Beneficial to Your Business
Tags: opensourcecrm, opensource, opensourcecrmsoftware, crm
Published: 2022-12-27 09:27:00

CRM tools are employed to keep track of all customer interactions, including those that are service-, sales-, and marketing-related. Traditional, or proprietary, CRM tools are pre-built and available for use as soon as the software is installed.

Open-source CRM software is different. It was created using publicly accessible open-source code that anyone can use and alter. Open-source CRM software allows for complete customization, allowing for changes to be made to everything from the user interface to the software's special features.


![Why Is Open Source CRM Software Beneficial to Your Business](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qxn4r7yo639d4zx5tmgv.png)

Businesses can use open-source CRM software to build a custom CRM solution that fits their specific goals and workflows.

### Uses of open-source CRM

Open-source CRM software is employed by organizations of all sizes and across all sectors. For a variety of reasons, a business may favor open-source CRM over conventional CRM.

A company may use several specialized apps that it wants to integrate with a CRM, e.g. Open-source CRM software enables businesses to build any custom integrations they need, whereas a traditional CRM vendor does not allow integration with these apps due to conflict or any other incompatibilities.

Open-source CRM supports businesses in growth mode better. This type of CRM is often offered free or at a low cost, allowing new businesses to take advantage of CRM without the financial investment. Plus, businesses can customize CRM to fit their current workflows and make changes as their business model evolves.

###What Are Open-Source CRM Software's Main Features?

The main characteristics of [Open Source CRM software](https://krayincrm.com/) are the same as those of conventional CRM solutions. For example, an open-source CRM tool offers:

- **Contact Management:**
A feature for collecting and storing customer and lead contact information.

- **Workflow automation:** 
CRM tools use pre-set triggers to perform actions that move work forward without human intervention.

- **Marketing Automation:** 
Open-source CRMs use automation to manage and complete marketing campaign tasks across different channels.

- **Reporting:** 
Reports showcase data insights drawn from the information stored within CRM. Businesses can use the reports to showcase project progress, revenue, and more.

- **Lead Management:** 
A facility used to capture, qualify, analyze, and nurture incoming business leads.

###Conclusion:
We offer KrayinCRM for optimizing your sales process. We make it unique, and if you want to customize open source [CRM development](https://webkul.com/custom-crm-development/) according to your sales process, contact us and tell us your needs. We'll make it unique for your company!
How to reduce the size for MP4 file
Tags: tutorial, linux
Published: 2022-12-27 09:21:58

## Command

In my case, my MP4 file became `1.1MB` from `16MB` with this:

```
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
```

## Reference

[How can I reduce a video's size with ffmpeg?](https://unix.stackexchange.com/questions/28803/how-can-i-reduce-a-videos-size-with-ffmpeg)