teleren/devto huggingface dataset:
Pun-CLI: Unleashing Hilarious Wordplay with a Single Command
Tags: python
Published: 2023-04-10 17:25:13

Do you love puns? Are you constantly on the lookout for new and hilarious wordplay? Look no further than Pun-CLI, the command-line interface for generating random puns!

[Pun CLI](https://github.com/thevahidal/pun-cli) is a Python-based tool that connects to a repository of puns and generates a random one based on optional keyword input. It also supports customization with a variety of characters to display the pun.

## Installation
Pun-CLI can be installed using pip, the Python package installer:

```bash
pip install pun-cli
```

##Usage
Once installed, simply run the pun command in your terminal to generate a random pun:

```bash
$ pun-cli
```

```bash
  _________________________________________________
 /                                                 \
| Why was the math book sad? Because it had too man |
| y problems.                                       |
 \                                                 /
  =================================================
                                                  \
                                                   \
                                                    \
                                                     |\_/|,,_____,~~`
                                                     (.".)~~     )`~}}
                                                      \o/\ /---~\\ ~}}
                                                        _//    _// ~}
```

You can also specify a keyword to search for puns related to a particular topic:

```bash
$ pun-cli --keyword "food"
```

And if you want to display the pun with a specific character, you can use the `--character` flag:

```bash
$ pun-cli --character "cow"
```

## Contributing
Want to contribute your own puns to the repository? Great! Simply fork the [Pun CLI GitHub repository](https://github.com/thevahidal/pun-cli) and add your pun to the `pun_repository.txt` file. Then submit a pull request and your pun will be added to the repository for all to enjoy!

## Conclusion
Pun CLI is a fun and simple tool for generating random puns and bringing a little humor into your day. Install it today and start unleashing hilarious wordplay with a single command!
How to push a Docker image to a Docker registry?
Tags: docker, devops
Published: 2023-04-10 17:11:52

First, you need to have a Docker image built on your local machine. You can do this by running the docker build command with the appropriate options and arguments.

Next, you need to tag your image with the appropriate name and version. You can do this by running the docker tag command.

Finally, you can push your image to the registry by running the docker push command. You will need to specify the name and version of the image you want to push, as well as the address of the registry and any necessary authentication credentials.

Here's an example command sequence for pushing an image to Docker Hub:

```
# Build the Docker image
docker build -t my-image .

# Tag the image with the appropriate name and version
docker tag my-image my-username/my-image:1.0.0

# Log in to Docker Hub (you will need to provide your Docker Hub credentials)
docker login

# Push the image to Docker Hub
docker push my-username/my-image:1.0.0
```

This will push the my-image Docker image, tagged with version 1.0.0, to Docker Hub under the repository belonging to the user my-username.
JavaScript for loop
Tags: javascript, programming, tutorial, codenewbie
Published: 2023-04-10 17:05:43

Javascript for loop is used execute a block of code repeatedly, based on a condition, until the condition is no longer true. In this article you will learn how for loop works.

## [Syntax of the Javascript For Loop](https://www.programdoc.com/javascript/for-loop)
```js
for (initialization; condition; increment/decrement) {
  // code block to be executed
}
```
for loop require three element to make it works, 

`initialization` used to declare or set a value before starting the loop.

`condition` block will be executed for each iteration in the loop, this will evaluate from the start. If the condition fails then the loop will be terminated.

`increment / decrement` block will execute at the end of each iteration. It usually increments or decrements the counter variable.

## Javascript Program to Check if a Number is Odd or Even

```js
for (let i = 1; i <= 10; i++) {
    if(i % 2 == 0) {
        console.log(i);
    }
}
```
**Output**
```js
2
4
6
8
10
```

[Learn Javascript Tutorial](https://www.programdoc.com/javascript/intro)
33 berufliches Vorwärtskommen: Der eigentliche Weg – Dein erfolgreicher Weg.
Tags: deutsch, career, motivation, 1min
Published: 2023-04-10 17:03:39

Moin Moin,

nun denn, weitergehen ist angesagt. Nutze die Besinnung auf deine [ursprüngliche Neugierde→](https://dev.to/amustafa16421/22-berufliches-vorwartskommen-ein-gerader-berufsweg-der-anfang-552f) und die dich [inspirierenden Leute→](https://dev.to/amustafa16421/31-berufliches-vorwartskommen-der-eigentliche-weg-erfolgreiche-leute-4m48), um in regelmäßigen Abständen zu prüfen, ob du auf Kurs bist.

Du hast spätestens jetzt die nötigen Werkzeuge, um loszulegen bzw. um weiterzumachen. Gehe also auf [dein Ziel→](https://dev.to/amustafa16421/25-berufliches-vorwartskommen-ein-gerader-berufsweg-das-ende-2n37) zu und konzentriere dich dabei aufs Gehen, nicht darauf was nicht alles fehlen könnte oder schief gehen könnte.
Sollte es Schwierigkeiten geben, so hast du hier eine hilfsbereite Gemeinschaft gefunden – „hebe einfach die Hand“.

Beste Grüße,
Mustafa
Starchart: Release 0.9
Tags: opensource
Published: 2023-04-10 16:44:49

# Starchart: Milestone 0.9 #

This week has been more productive and smoother than previous ones. I focused on improving the certificate section of our project, and gathered valuable user feedback to identify potential areas for enhancement. Also,

## Working with a partner ##

For this week's milestone, I paired up with one of my fellow contributors to work on an issue that touches both our area of expertise. I have always held my fellow contributors in a high standard (doesn't meant I don't right now), and always push myself down as someone who is beneath all of them.

Of course in a sense, they are better than me in regards to their knowledge, but it did fill me with comfort knowing that I can still contribute to the project even by the smallest thing.

There are benefits of working with someone on fixing an issue. One of the main benefits is to foresee oncoming issues quicker and more efficient. When I was writing my code, he told me of bugs I did not even noticed, and probably would have  wasted a lot of my time resolving. 

By the end of our session, we published a PR, and although usually I tend to overlook a bunch of things, and my reviewers points it out, for this week there wasn't much.

## User Feed Back ##

I was tasked to have someone who has no connection with the project to test the website, and write notes on any issues they found, and any improvements that we can work on.

Aside from minor suggestions like using "Create" instead of "Manage" for the button name of the card

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

Most of issued stemmed from "Create New DNS Record" page. There aren't enough information for him to actually know what he's suppose to be doing. The labels provided and tooltip aren't good enough to actually understand anything. Although, I like the idea of a tooltip, but the user seems to ignore this valuable tool.


## Conclusion ##

It was fun working with another person on an issue, and I would want to do it again if given an opportunity. Having to have someone review your project feels nice to have, and an outsider's perspective on teh code does come a long way.
Bash script to find the difference between an epoch timestamp and the current date.
Tags: bash, script, devops, linux
Published: 2023-04-10 16:31:22

Bash script to find the difference between an epoch timestamp and the current date.

Here's an example Bash script to find the difference between an epoch timestamp and the current date:

```
#!/bin/bash

# Enter the epoch timestamp in seconds
epoch_timestamp=1649512800

# Get the current date in seconds since epoch
current_date=$(date +%s)

# Calculate the difference between the two timestamps
difference=$((current_date - epoch_timestamp))

# Print the difference in seconds, minutes, hours, and days
echo "Difference in seconds: $difference"
echo "Difference in minutes: $(($difference / 60))"
echo "Difference in hours: $(($difference / 3600))"
echo "Difference in days: $(($difference / 86400))"
```

Replace 1649512800 with the epoch timestamp you want to compare with the current date. The script will output the difference in seconds, minutes, hours, and days between the two timestamps.

```
dmi@dmi-laptop:~$ cat my_script.sh 
#!/bin/bash

# Enter the epoch timestamp in seconds
epoch_timestamp=1649512800
echo "epoch_timestamp: $(date -d "@${epoch_timestamp}" "+%Y %m %d %H %M %S")"

# Get the current date in seconds since epoch
current_date=$(date +%s)
echo "current_date: $(date -d "@${current_date}" "+%Y %m %d %H %M %S")"

# Calculate the difference between the two timestamps
difference=$((current_date - epoch_timestamp))

# Print the difference in seconds, minutes, hours, and days
echo "Difference in seconds: $difference"
echo "Difference in minutes: $(($difference / 60))"
echo "Difference in hours: $(($difference / 3600))"
echo "Difference in days: $(($difference / 86400))"
```

The script first finds the current epoch timestamp using the date +%s command. It then finds the difference between the two timestamps in seconds and prints it. 

The script uses the date -d command to convert the epoch timestamp to the desired format. 

The output will look like this:

```
dmi@dmi-laptop:~$ ./my_script.sh 
epoch_timestamp: 2022 04 09 17 00 00
current_date: 2023 04 10 19 23 09
Difference in seconds: 31630989
Difference in minutes: 527183
Difference in hours: 8786
Difference in days: 366
dmi@dmi-laptop:~$ 
```
Learning more and more and more.....and.....
Tags: beginners, codenewbie, discuss, devjournal
Published: 2023-04-10 16:28:16


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

I know that we have all heard a similar thing if we have attended or thought of attending a bootcamp. "It's like drinking from a fire hose!"

I could not have understood how true that statement would be, lol. A lot of the time I find myself mirroring what is being taught as opposed to immediately trying to commit certain tips, tricks, or important syntax to memory. I find myself trying to understand less and trying to "keep-up" more and more.

Though it may be tough from time to time, I also find that I am actively challenging myself more and more each session I attend. Even though the understanding of the content doesn't immediately get converted in my mind whilst it is being presented, it forces me to go through the steps once again and possibly do some more research to figure out the problem or necessity for certain things.

All in all, for those that are attending or have been planning on attending a bootcamp, please make sure to use your resources and reach out to those that have presented themselves willing to help!

HTML and CSS were not as difficult as I had once believed, but the next challenge is getting through being proficient in JavaScript and learning more about WebAPIs! I hope to understand it more and more, but it will definitely be a difficult journey that I hope to understand well very soon!

{% embed https://youtu.be/VDFMAst6o-U %}
Precision and Passion: Comparing the Art of Butoh with the Science of Algorithms
Tags: algorithms, beginners, programming
Published: 2023-04-10 16:07:13

[Algorithms](https://en.wikipedia.org/wiki/Algorithm) and [Butoh](https://en.wikipedia.org/wiki/Butoh) might seem like two very different things, but both have their own unique ways of expressing complex ideas and concepts. While algorithms are often associated with precision and objectivity, Butoh is a form of dance that emphasizes subjectivity and raw emotion. However, by exploring the parallels between these two seemingly disparate fields, we can gain a deeper appreciation for both.

At its core, an algorithm is simply a set of rules or instructions that are used to perform a specific task. In many ways, algorithms are like the choreography of a Butoh dance – they provide a framework for the performer to follow, but they also allow for creativity and improvisation. Just as a Butoh dancer may interpret a choreographed movement in their own unique way, a programmer may use their own creativity and expertise to develop an algorithm that achieves a specific outcome.

Another key similarity between algorithms and Butoh is their use of patterns and repetition. In Butoh, performers often use repetitive movements and gestures to convey a sense of emotional and physical struggle. Similarly, algorithms often rely on repeated patterns of input and output to achieve their goals. In both cases, the repetition of certain actions can create a sense of tension and intensity that draws the audience in.

However, there are also some fundamental differences between algorithms and Butoh. While Butoh is a highly subjective and emotional form of expression, algorithms are often viewed as being objective and precise. Algorithms rely on strict rules and logical processes, whereas Butoh is more concerned with exploring the limits of the human body and mind.

Despite these differences, there is still much that algorithms and Butoh can teach us about the world around us. Both offer unique ways of understanding and exploring complex ideas, and both have the power to captivate and inspire us in different ways. By exploring the parallels between these two seemingly disparate fields, we can gain a deeper appreciation for the ways in which art and technology intersect, and the ways in which they shape our understanding of the world.
Zig Pointer Cheat Sheet
Tags: zig, cheatsheet, pointer
Published: 2023-04-10 15:55:22

Zig Pointer Cheat Sheet for personal reference. Taken from [ziglings](https://github.com/ratfactor/ziglings) #54

```
u8           |  one u8                                    

*u8          |  pointer to one u8                         

[2]u8        |  two u8s                                   

[*]u8        |  pointer to unknown number of u8s          

[*]const u8  |  pointer to unknown number of immutable u8s

*[2]u8       |  pointer to an array of 2 u8s              

*const [2]u8 |  pointer to an immutable array of 2 u8s    

[]u8         |  slice of u8s                              

[]const u8   |  slice of immutable u8s                    

```
Linux Administration 101
Tags: systemadministration, sysops, devops, linux
Published: 2023-04-10 15:22:39

If you're pursuing a SysOps Administration career, it's very important to be familiar with the common commands to get around in the Linux system. I always tend to forget these commands so I'm writing them down as my personal reference.

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

## Basic

## Intermediate

1. Get the system OS 

```
cat /etc/os-release
```
2. Show Linux Kernel Version

```
[root@ip-100-104-110-48 karina.alvarado]# uname -r
4.14.77-81.59.amzn2.x86_64
```
Building a new shift-left approach for alerting
Tags: opensource, monitoring, discuss, devops
Published: 2023-04-10 15:19:50

**Hi Community!**
Looking forward to hearing your thoughts on this!

[Keep](https://github.com/keephq/keep) is an open-source alerting CLI tool that @shaharglazner and I wrote out of a pain we felt throughout our careers as developers and developers managers.
Alerting (aka monitors/alarms) always felt like a second-class citizen within all the different monitoring/observability/infrastructure tools with a very narrow feature set, which in turn results in poor alerts, alert fatigue (yes, your muted Slack channel), unreliable product and a complete alerting-hell.

![Alerts as part of SDLC](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4w3etjoubncni2chkhoi.png)

It's not only that we couldn't create better applicative/infrastructure alerts, but it's also that it is tough to maintain them and ensure they work over time.

Organizations today have so many tools they use for alerting that it's becoming an absolute nightmare.

## Alerting as a first-class citizen

The best way to describe what we had in mind when we first built Keep is how one of our first users puts it:

> Keep is doing to alerting what GitHub actions did to CI/CD

There were three main guidelines when we started coding:

1. **Good alerts** are not just over thresholds/logs **BUT** should be treated as workflows with multiple "tests" (steps/actions).

2. **The tool should be 100% data agnostic** - agnostic to where data resides (& not only "traditional" data sources but also a DB, for example). There's no real reason why it shouldn't be abstracted from developers.

3. **Maintained and lives in your code** - allowing it to be integrated with all CI/CD processes (imagine a gate that fails your PR when you break alerts).


![Multi-step alert example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gwkzlq8zw3mgvgb8tccf.png)

## What's Ahead?

We constantly try to improve with our promised:

> Try our first mock alert and get it up and running in <5 minutes

So we're adding plenty more deployment options, providers, and functions. We're working on simplifying the syntax furthermore.

What do you think about the need for this kind of "abstraction"? What do you think about alerts as post-production tests? How do you manage and control your alerting chaos right now?

Would love to hear your thoughts; feel free to comment here / on our [Github repo](https://github.com/keephq/keep) / in [our Slack](https://keephq.dev/slack)
Que signifie l'erreur "Volume node affinity conflict" ?
Tags: kubernetes, sre, devops
Published: 2023-04-10 14:56:00

Quand vous déployez un pod, que vous effectuez une mise à jour de cluster ou que vous videz un noeud, vous pouvez avoir des pods qui sont bloqués dans un état "**Pending**". 

En regardant les **Events** du pods, vous pourrez remarquer l'erreur suivante 
```bash
2 node(s) had volume node affinity conflict.
```

Cette erreur signifie que le noeud sur lequel est déployé votre pod ne correspond pas aux exigences du volume qui lui est associé.

Si on prend un exemple, vous avez déployé vos services dans AWS et avez fait ce qu'il faut pour qu'ils soient hautement disponibles en répliquant les services et les volumes associés dans deux AZ d'une même région. *(us-east-1a & us-east-1b par exemple)* 
Si dans votre cluster EKS vous bloquez les déploiements sur us-east-1a, les volumes qui sont censés être liés à des pods sur us-east-1b ne vont pas être content et vont vous générer cette erreur.

---

## Trouver l'affinité de votre volume
Afin de voir quel est la source du problème, il vous faut trouver le volume persistant *(persistent volume)* et regarder sa définition.

Vous pouvez partir du pod pour trouver le **PersistentVolumeClaim** associé
```bash
$ kubectl describe pod my-pod
Name:           my-pod
Namespace:      default
(...)
Volumes:
  volume:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  volume-my-prod
    ReadOnly:   false
(...)
```

De là, vous pouvez trouver le **PersistentVolume** associé au **PersistentVolumeClaim**
```bash
$ kubectl get pvc
NAME                                          STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
volume-my-prod                 Bound    pvc-toto   200Gi      RWO            ebs-gp2        41d
```

Et de là, vous pouvez détailler le **PersistentVolume** pour voir, par exemple, qu'il a besoin être dans l'AZ "us-east-1a".

```bash
$ kubectl get pv pvc-toto -o yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pvc-toto
spec:
  (...)
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: topology.ebs.csi.aws.com/zone
          operator: In
          values:
          - us-east-1a
  (...)
```

Une fois que vous avez cette information, vous devriez être en mesure de comprendre ce qui ne va pas avec le noeud où il se trouve actuellement et donc être capable de résoudre la situation.

---
J'espère que ça vous aidera! 🍺

---

<center><h3>Vous voulez me supporter?</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>
What does the error "Volume node affinity conflict" mean ?
Tags: devops, sre, kubernetes
Published: 2023-04-10 14:55:00

When you deploy a pod, are doing a cluster update or you are just cleaning a node, you can have pods stuck in a ""**Pending**" state.

If you describe the pod, you may see an event with the follow error : 
```bash
2 node(s) had volume node affinity conflict.
```

This error means that the node where your pod is deployed doesn't match with the affinity of a volume attached to the pod.

For example, you have deployed your services in AWS and setup high availability for your volumes & services. Using AZ us-east-1a & us-east-1b in our case.
If you block the deployment on all nodes in us-east-1a and you have volumes which requires to be in us-east-1b, you will have this issue.

---

## How to find the volume affinity
To find the volume affinity, you need to find the **PersistentVolume** linked to your pod and check its definition.

You can start from the **Pod** to find the associated **PersistentVolumeClaim**
```bash
$ kubectl describe pod my-pod
Name:           my-pod
Namespace:      default
(...)
Volumes:
  volume:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  volume-my-prod
    ReadOnly:   false
(...)
```

Then from the **PersistentVolumeClaim**, find the **PersistentVolume**
```bash
$ kubectl get pvc
NAME                                          STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
volume-my-prod                 Bound    pvc-toto   200Gi      RWO            ebs-gp2        41d
```

And then, describe the **PersistentVolume**

```bash
$ kubectl get pv pvc-toto -o yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pvc-toto
spec:
  (...)
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: topology.ebs.csi.aws.com/zone
          operator: In
          values:
          - us-east-1a
  (...)
```

In this case, we can see that the volume needs to be in the us-east-1a AZ, so the related pod too.

Now that you have this information, you should be able to understand what is going wrong with the current node and resolve the issue.

---
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>