teleren/devto huggingface dataset:
Handling EKS: kubectl, Namespaces, and CRDs
Tags: eks, aws, kubectl
Published: 2024-02-04 20:19:40

Managing EKS clusters from the command line can seem daunting at first, but having a grasp of some key kubectl commands will make you an expert in no time. In this beginner's guide, I'll walk through the most useful CLI commands for inspecting and troubleshooting your EKS workloads, nodes, namespaces and CRDs.
Let's start by looking at namespaces - these allow you to logically organize your cluster resources. To see current namespaces:
`kubectl get namespaces`
You can then specify a namespace when running commands:
`kubectl get rs -n prod` # rs  stands for replica-set
This isolates prod resources from dev and test. Handy for access control between teams!

Here's a trick to set a default namespace so you don't have to enter it each time:
`kubectl config set-context --current --namespace=dev`
This will set the default namespace going forward to "dev". Now all kubectl commands will apply to that namespace by default:
`kubectl describe secrets aws-secret # Describes aws-secret in dev namespace`
And you can still override the default when needed:
`kubectl get pods -n kube-system`
One specially important namespace is kube-system. This houses critical cluster services and addons like:
- CoreDNS - Cluster DNS

- VPC Networking plugins

- Node Termination Handler

Observe but don't modify kube-system to avoid issues!
Now, let's inspect pod workloads, the basic building blocks of EKS services:
`kubectl get pods -n dev`
This lists all pods in dev namespace and their status. To get more info on a specific pod:
`kubectl describe node <node-name>`
See the pattern here? "Get" for an overview, and "describe" for the nitty gritty details. This works for all Kubernetes resource types (e.g. `kubectl get nodes`, `kubectl describe node <name>` etc)
Finally, you can actually shell into a container with exec:
`kubectl exec -it <pod-name> -- bash`
This drops you into a bash shell running inside the pod, where you can inspect files, env vars, check connections, and troubleshoot further.

**Inspecting Custom Resources**

Many EKS addons and controllers introduce their own CustomResourceDefinitions (CRDs) - custom Kubernetes object types defined by scripts rather than baked into the main codebase.
For example, the AWS Load Balancer Controller has a CRD for defining Application Load Balancers.
You can view custom resources by running:
`kubectl get crds`
This will list all CRDs registered on the cluster. You can then operate on the custom resources themselves:
kubectl get albingress -n app-ns`
Here we are listing ingresses from the Application Load Balancer CRD.
CRDs allow developers to extend Kubernetes functionality without having to rebuild the core API. This enables rapid innovation. Definitely important to be aware of CRDs when running addons that enhance EKS!

As you can see, kubectl makes it easy to unlock the power of EKS! With these basic commands, you'll gain visibility and control over your clusters. The official [kubectl cheat sheet](https://kubernetes.io/docs/reference/kubectl/quick-reference/) lists even more goodies to try out.

Happy Kubectl-ing!
Embarking on Your React Learning Journey: Building with React and Beyond
Tags: webdev, beginners, react, programming
Published: 2024-02-04 19:38:38

# Discover Your Drive

Before delving into the world of React or any other language/framework, it's crucial to understand your motivation. What sparks your interest? Identify the driving force behind your desire to learn, and keep it in mind as you progress. Having a project goal can add purpose and excitement to your learning journey.


# Build Your Dream Project

As you venture into the learning process, aim high. Start by conceptualizing and working on your dream project. Don't shy away from the challenges; instead, embrace them. Learning by doing is a powerful approach, and your dream project can serve as the ultimate playground to acquire new skills organically.


# Master the Basics

Begin with a solid foundation. For theory and basic concepts, platforms like W3Schools and Geeks for Geeks can be excellent resources. Dive into the fundamentals and get comfortable with the language or framework's core concepts.


# Bookworm's Delight

To truly immerse yourself, consider turning the pages of some well-curated books. [The Best Books](https://www.best-books.dev/) list provides a wealth of knowledge curated by enthusiasts in the field. These books can offer in-depth insights, helping you grasp the intricacies of React or any other technology.


# Say No to Tutorial Hell

While tutorials are valuable for specific learning points, don't fall into the trap of tutorial hell. Use them strategically to enhance your understanding of specific topics, but avoid blindly following them. Instead, leverage resources like articles, Stack Overflow, and Discord communities to address issues encountered during your project. Engaging with real-world challenges will deepen your understanding and problem-solving skills.


# Some Free Resources (High Seas)

[Books](https://annas-archive.org/)
[Build Your Own X](https://github.com/codecrafters-io/build-your-own-x) - (Not Beginner Friendly but a good resource)
Dive into Update vs. Insert Commands in Cassandra
Tags: cassandra, database
Published: 2024-02-04 19:51:04

Insert and Update commands should not be used interchangeably, as doing so can lead to erratic behavior. Check this post to learn the difference. Feedback is appreciated. 

[Dive into Update vs. Insert Commands in Cassandra](https://medium.com/@HobokenDays/cassandra-commands-unveiled-exploring-the-nuances-of-update-insert-39fdb06eadb0)
Building CodeHub: Crafting the Technology Stack
Published: 2024-02-04 19:50:55

As we continue our journey in building CodeHub, we'll now shift our focus to the technology stack that powers our platform. In case you missed the beginning of our story, you can [catch up on the origins of CodeHub](https://dev.to/codehub/building-codehub-our-journey-begins) to understand how it all began.

## Choosing the right technologies

Given our extensive experience with [TypeScript](https://www.typescriptlang.org/), [React](https://react.dev/), and [Next.js](https://nextjs.org/), choosing these technologies was an obvious decision. We were eager to launch our service as quickly as possible.

For server-to-client communication, we opted for [GraphQL](https://graphql.org/) due to its strong typing, self-documenting capabilities, and the availability of numerous [helpful libraries](https://the-guild.dev/). We selected [Apollo](https://www.apollographql.com/) as our GraphQL server and client. My prior experience with Apollo, along with its built-in [caching features](https://www.apollographql.com/docs/react/caching/overview/) and robust [developer tools](https://www.apollographql.com/docs/react/development-testing/developer-tooling/#apollo-client-devtools), influenced our choice.

Recognizing the relational nature of our data, we embraced [PostgreSQL](https://www.postgresql.org/) for its rich feature set. As our database client, we settled on [Prisma](https://www.prisma.io/client), primarily for its schema prototyping capabilities with db push.

Next, we needed to decide on a user interface library. Our requirements were clear: a library with a rich collection of components. After brief research, we settled on [Chakra UI](https://chakra-ui.com/) for its simplicity, modularity, accessibility, and extensive component library. Its use of [Styled System](https://styled-system.com), with which I was familiar, further solidified our choice.

Finally, we had to select a platform for deployment. Having previously used [Vercel](https://vercel.com) for deploying Next.js projects, it was the natural choice. We also decided to explore Vercel's new offerings, including [serverless PostgreSQL](https://vercel.com/storage/postgres) and [fast object storage](https://vercel.com/storage/blob).

## What's next?

In the upcoming part of this series, I'll share our journey in selecting the code editor for CodeHub. Trust me, it wasn't an easy task to find a solution that met all our needs.

Stay tuned for more.
Lessons That Forever Changes My Software Engineering Career
Tags: career, lessons, growth
Published: 2024-02-04 19:48:52

I learned those lessons during my four years of experience. I hope they help you succeed in achieving your personal career goals. Your feedback is appreciated.

[Lessons That Forever Changes My Software Engineering Career](https://medium.com/@HobokenDays/four-career-lessons-learned-in-2023-that-forever-changed-my-software-engineering-career-52e577b05435)
5W- Who,what,where,when,why... Recursive resolution of semantic meaning
Tags: recursion, meaning, resolve
Published: 2024-02-04 19:12:37

---
title: 5W- Who,what,where,when,why... Recursive resolution of semantic meaning
published: true
description: 5W- what,where,why,who,where,when- Recursive resolution of semantic meaning
tags: recursion,meaning,resolve
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4zx1y7uwco9101rekzjz.png
# Use a ratio of 100:42 for best results.
# published_at: 2024-02-04 19:04 +0000
---
Problem identification process
Describe the ideal, describe the current status quo/state of affairs and describe the deviation from the ideal. These deviations form the basis of the problem- the what. Describe the identifiable and unidentifiable causes of the deviations as the reasons- the why

Problem solution process
involves identifying causes of the deviations and prescribing mitigative or corrective measures  

What, is an interrogative nominative indicator. Asks the recipient of the message to replace
the word "What" with a representation of something pertaining to part of the sentence that follows.
Why asks them to replace the word "why" with a description of the desired resultant state which is intended to be caused by the action; or the prior state that came before which  resulted in the action.   

Where- 
Who- 
When-
These three apply context to the why. Eg. What because why. The what could be a verb or a noun. In the case where the What is a verb: eg. Jump, and the why is the where, you jump because of the position. If the why (reason) is who you are supposed to jump if they are encountered(maybe a game) or the why is a when, you are supposed to jump at a certain time... and so on and so forth. 

https://www.youtube.com/watch?v=E-pfSLHHojU

A recursive reasoning resolving/resolution step involves a (set of one or more) what and (set of one or more) why then to recurse one level deeper, whatever was the why gets promoted to the "what", and the subsequent part of the sentence becomes the why... repeat over and over to the end until the whole sentence is fully resolved.
What is Web Servers.?
Tags: webdev, beginners, opensource, programming
Published: 2024-02-04 18:51:01

**Web Servers** refers as either a <u>Hardware</u> or <u>Software</u> or both of them Working together.

1.On the Hardware side, the Web Server is a Computer that Stores Web Server Software and Website's Component files (for example, HTML documents, images, CSS stylesheets, JavaScript files). The Web Server connects to the Internet and supports physical data interchange with other devices connected to the web.

2.On the Software side, Web Server includes several parts that controls how web users access hosted files. At a minimum, this is an HTTP Server. An HTTP server is a Software that understands URLs(Web Addresses) and HTTP(the protocol your browser uses to view webpages). An HTTP Server can be accessed through the domain names of the websites is stores, and it delivers the content of these hosted websites to the end user's device.

Examples are Nginx, Apache2 and many more.

Apache2 is one of the Widely used Sever, it's a Standard Server. Apache gives the directory /var/www/html/.
Common Beginner Mistakes
Tags: beginners, programming, community
Published: 2024-02-04 18:37:22


## Hello Devs :)
This post focuses on absolute beginners. it's not uncommon for beginners to make mistakes along the way – after all, learning new skills can be challenging. I've encountered my fair share of pitfalls, and I'm here to shed light on one of the biggest mistakes I made as an absolute beginner. 
Let's get started :rocket:.

## Learn the basics first :gear:.
Understand the basic syntax such as looping, conditions, etc. Then start your progress step by step. Play around with the concepts you learned, and expect an answer before executing. After learning  and playing start coding in Platforms like [Hacker rank](https://hackerrank.com/), [Code signal](https://app.codesignal.com/arcade) (Many platforms available). After some experience, you may start coding in [leetcode](https://leetcode.com/)


## Jack of all (coding languages).
Don't just overwhelm yourself with coding languages. I wanted to master every framework and tackle every project under the sun. I made the critical mistake of trying to learn everything at once. Eventually, it turned out I was wasting time not learning advanced concepts.
**Solution:** Choose **ONE** language and learn to build a product with it. 

## Net Surfing:surfer:.
Net surfing is an underrated skill an individual could have. I was not aware of this community for some time. It would be a gem for beginners to find such a huge community for tips and suggestions. Hence search online communities that align with your domain. Many resources are hidden that may help us developers. Keep on exploring the ocean:ocean:. 

## Code daily :computer:
In the coding world there is no saturation point. Be constant and **Don't hesitate to ask for help**:100: in case you need any. Challenge with you friends code enthusiastically but pick at your own size or greater:smile:.Push your limits and grow.

## Curiosity and persistent
When encountering a difficult coding problem my curiosity to search for answers increased. Though I won't search :muscle:. Strive at least for some days. I'll get answers even while dreaming and brushing I think most of the dev have experienced this:sweat_smile:. **Be persistent** to not search for solutions and **Be proud** of yourself for completing the problem. Search for optimized solutions after completing the problem. If it's not possible even after some days(at least 5days) you can go for it. Exploring something new is common in a developer's life you have to learn and just **move forward even after failure**(actual failure).
<img width="100%" style="width:100%" src="https://i1.sndcdn.com/artworks-qGfi1Ennra1tm4iQ-Zl7Bug-t500x500.jpg">

## conculsion
These are some of my insights from my mistakes. We all know that the journey of a developer is filled with highs, lows, and everything in between. Whether you're a seasoned pro or just starting out, your experiences and insights are incredibly valuable. Let's learn from each other and let the community know your stories.

**Happy_Coding:)**
My First Impressions of Odin Programming Language for Game Development
Tags: gamedev, odin, programming, opensource
Published: 2024-02-04 18:34:48

Hey there, fellow **devs** and game enthusiasts! 🎮 I just had to share my recent adventures in the world of game development using **Odin programming language!** It's been an exhilarating ride, and I can't wait to tell you all about it! 🌟

So, two days ago, I decided to dive headfirst into Odin, and wow, what a journey it has been! First things first, let's talk about Odin's syntax – it's clean, it's intuitive, and it just clicks! Seriously, coming from other languages, Odin's syntax feels like a breath of fresh air.

But that's not all! Let me tell you about the fantastic support Odin has in Sublime Text. With the Odin package and OLS Language Server, coding feels like a breeze. It's like having a trusty sidekick by your side as you embark on your coding adventures!

Now, here's the real kicker – Odin comes packed with support for various APIs right out of the box! Whether you're into **raylib, SDL, OpenGL, Vulkan, or any other API**, Odin's got your back with the latest and greatest versions. It's like having a treasure trove of tools ready for you to unleash your creativity!

And can we talk about the community? It's seriously the best! The folks in the Odin community are like your cheerleaders, ready to lift you up and support you every step of the way. From helpful discussions to sharing resources and tips, it's like having a big family of fellow game dev enthusiasts!

Oh, and let me not forget to mention some of the coolest bindings and projects I've stumbled upon! The ImGui binding, for instance, is a game-changer for creating awesome user interfaces. And the projects on GitHub? Mind-blowing! They really showcase the incredible potential of Odin.

In a nutshell, my journey with Odin has been nothing short of amazing! Its clean syntax, superb Sublime Text support, wide range of API coverage, rock-solid reliability, friendly community, and awesome bindings and projects make it an absolute joy to work with.

If you're itching to dive into game development with a language that's as friendly as it is powerful, then Odin is definitely worth checking out! Trust me, you're in for one epic adventure! 🚀

**_Happy coding, and may your games be ever epic! 🎮✨_**
PHP now has support for undefined!?
Tags: php
Published: 2024-02-04 18:27:37

Before you dismiss this post as some cheap clickbait, please take a look at the following code and tell me if this is PHP:

```php
<?php
 
function greeting(string $name, string|null|undefined $title = undefined) {
    $greeting = 'Hello';
    $greeting .= match ($title) {
        null => ' ',
        undefined => ' ??? ',
        default => " $title ",
    };
    $greeting .= $name;
    return $greeting;
}
 
echo greeting('John Doe');
```

Drumroll… it actually is perfectly valid PHP code.

I know what you are thinking: “This is not JavaScript. PHP does not have `undefined`.” And you would be correct. This is where I need to qualify my previous statement. The above code may be valid PHP but it does not execute successfully. Turns out, PHP really does not know about `undefined`.

> Fatal error: Uncaught Error: Undefined constant “undefined”
>
> — The PHP runtime

But no worries, we can fix this minor problem with only two lines of code.

```php
<?php
 
enum undefined { case undefined; }
define('undefined', undefined::undefined);
```

## How it works

To make the function `greeting()` work, we need two things:

a) First, we need to have a type called `undefined` for the type annotation of the function parameter. An [enum](https://www.php.net/manual/en/language.enumerations.overview.php) will do. A single enum case is required, otherwise we would not be able to do anything with it. The name of the case is irrelevant.

b) Second, we need a constant called `undefined` for the default argument value. The syntax `function ($x = undefined)` may look unfamiliar, but all it says is that the default value for `$x` is equal to the constant named ‘undefined’. The built-in function `define()` lets us create a global constant with that name.

## What’s missing?

We have no language support for `undefined` whatsoever. Meaning, neither the [null-safe](https://php.watch/versions/8.0/null-safe-operator) nor [null-coalescing](https://php.watch/articles/php-ternary-and-coalescing#null-coalescing) operators work like they do in JavaScript:

```php
<?php
 
enum undefined {
    case undefined;
    public function foo() {
        return 'Foo';   
    }
}
define('undefined', undefined::undefined);
 
var_dump(undefined ?? 'Fallback'); // Prints enum(undefined::undefined)
 
$obj = undefined;
var_dump($obj?->foo()); // Prints string(3) "Foo"
```

## Wrapping up

Should you introduce this pseudo language extension into your production code base? Definitely not. In the end it is just minor syntactic sugar for referencing an enum case.

While I do think that singleton symbol-like objects may sometimes come in handy ([see example](https://dev.to/hbgl/elegant-immutable-object-pattern-in-php-1dg3)), it is better to be explicit about it.

The post [PHP now has support for undefined!?](https://hbgl.dev/php-has-support-for-undefined/#more-811) appeared first on hbgl.
UI package: Gather user feedback in your React apps
Tags: react, shadcnui, tailwindcss, typescript
Published: 2024-02-04 18:19:34

I spent the weekend diving into publishing an npm package that I'm thrilled to introduce: react-user-feedback. If you're a React/FE developer, you know the importance of collecting user feedback to continually improve your applications.

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



react-user-feedback is an npm package I created that provides a `<UserFeedback/>` React UI component powered by the dynamic combination of TailwindCSS, shadcn/ui, zod and react-hook-form.

Now it’s time to get started:

**1. Install the NPM package**

```bash
npm install @ntheanh201/react-user-feedback
```

**2. Import the component and stylesheet**
    
You can render the component globally or have the component be scoped to a specific page.
    

```tsx
import UserFeedback from "@ntheanh201/react-user-feedback";

// tailwindcss, shadcn/ui
import "@ntheanh201/react-user-feedback/dist/styles.css";

function App() {
  return (
        <UserFeedback
          disabled={false}
          allowImage={true}
          feedbackTypes={[
            { value: "general", label: "General" },
            { value: "bug", label: "Bug" },
            { value: "idea", label: "Idea" },
          ]}
          onSubmit={(values, onError) => {
            console.log("values: ", values);
          }}
        />
  );
}
```

**3. Collect valuable feedback** 
    
That's it! One more step is that you need to send the feedback to your server and you're ready to gather user feedback efficiently and effectively in your React application.
    
Enjoy the benefits of react-user-feedback and elevate your development process.
    

I created it to solve a personal problem as a hobby developer. I hope you find the package helpful. If you wanna contribute to this package, feel free to check: https://github.com/ntheanh201/react-user-feedback#contributing

Happy coding!
Android Activity Lifecycle
Tags: android, androiddev
Published: 2024-02-04 18:07:20

In an Android app, the Android system uses activities to run code. The activity lifecycle is the different states that an activity can go through, from when the activity first initializes to its destruction. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ct5mw45dikwbglhnx23v.png)
The `Activity` class provides 7 callback methods that let the activity know when a state changes:  `onCreate()`,  `onStart()`, `onResume()`, `onPause()`, `onStop()`, `onRestart()`, `onDestroy()`.

**onCreate()**
The `onCreate()` lifecycle method is called once, just after the activity initializes—when the OS creates the new Activity object in memory. After `onCreate()` executes, the activity is considered created.

**onStart()** 
The `onStart()` lifecycle method is called just after `onCreate()`. After `onStart()` runs, your activity is visible on the screen to the user. Unlike `onCreate()`, which is called only once to initialize your activity, `onStart()` can be called by the system many times in the lifecycle of your activity.

**onResume()** 
This method is called when the activity will start interacting with the user. The user starts interacting with your app for this to happen.

**onPause()** 
Always called after `onResume()` and when the user is no longer actively interacting with the activity but the activity is still visible on the screen.

**onStop()** 
This is called when the activity is no longer visible on the screen to the user. 

**onRestart()**
Called when the current activity is being redisplayed to the user. From the Stopped state, if the activity comes back to interact with the user the system invokes `onRestart()`.

**onDestroy()** 
is called before the activity is destroyed. The system invokes this callback either because, the user dismisses the activity, or there is a configuration change such as device rotation.

Thank you for reading this article. Happy Coding.