teleren/devto huggingface dataset:
Rollback and Updating Deployment
Tags: tutorial, kubernetes, devops, beginners
Published: 2023-01-09 17:29:08

**Scaling a deployment:** 
```
kubectl scale <object_type> <object name> --replicas=<count_of_objects_needed>
```

**Updating a deployment:**
```
kubectl get deployments
kubectl set image deployment <name_of_deployment> <name_of_new_image_that_you_want_to_give / old_image_name>=<actual_name_of_image(full path of repository)>:<tag>
```

Now what it does is, this command basically looks for the actual_name_of_image on docker repository, and downloads it from there. Now after downloading it updates the current image of deployment with this downloaded image, and that's how a deployment is updated.

**Note**: Images are differentiated on the basis of tags, i.e K8s re-downloads the image if and only if a new tag is passed to it, if the tag is not mentioned while updating a deployment, it will not update the image. Hence, passing a tag while executing a set image command is necessary.

To check **status of updation**, one can execute:
```
kubectl rollout status deployment <name_of_deployment> 
                          OR
kubectl rollout status deployment/<name_of_deployment>
```

Now, what if the tag passed doesn’t actually exists? I.e. 
```
kubectl set image deployment/<name_of_deployment> <old_image_name>=<repo_name/image_name>:<some_random_value>
```

It will still show that the deployment is updated although the deployment has not actually updated. To check if the deployment is actually updated, one can test it via:
```
kubectl rollout status deployment/<name_of_deployment>
```

This will lead to an infinite loop of updation of deployment as, k8s follows rolling strategy, but since the tag passed doesn’t exists, the image will not be downloaded, and hence the new pod that's trying to spinnup will not get live, and the old pod will not terminate, and will be stuck in this. 
In such cases, we need to **rollback to the previous deployment** by the following command:
```
kubectl rollout undo deployment/<name_of_deployment>
kubectl rollout status deployment/<name_of_deployment>
```

We can check the **history of deployment** by following command:
```
kubectl rollout history deployment/<name_of_deployment>
```
This wil list out all the deployments in the form of revisions.

To particularly **inspect a deployment**, we can use:
```
kubectl rollout history deployment/<name_of_deployment> --revision=<nth_deployment>
```
This also prints the image which was used in that deployment.
Habits of Billionaires
Tags: habit, billionaires, advice, changing
Published: 2023-01-09 19:00:09

1. **Wake Up Early**: Billionaires typically start their day early, often before 6am.

2. **Read**: Billionaires typically read books, magazines, and industry publications to stay informed.

3. **Exercise**: Billionaires understand the importance of physical fitness and make time for exercise.

4. **Network**: Billionaires often use their contacts to create business opportunities and build their wealth.

5. Invest: Billionaires know that investing is one of the best ways to grow their wealth.

6. **Take Risks**: Billionaires are not afraid to take calculated risks in order to reap the rewards.

7. **Think Big**: Billionaires look beyond the current landscape and set lofty goals.

8. **Prioritize**: Billionaires are able to focus on the most important tasks and let the rest go.

9. **Stay Focused**: Billionaires stay focused on their goals and don’t get distracted by the small stuff.

10. **Give Back**: Billionaires understand the importance of giving back to the community and often donate to charities.


![Habits of Billionaires](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kgynkh6qi1kfznqdqg5v.jpg)
Hosting providers to deploy your Next.js app
Tags: javascript, nextjs, webdev, react
Published: 2023-01-09 18:59:18

## Vercel
Vercel is a hosting platform developed by the creators of Next.js. It is an excellent choice for those looking to use the latest features of Next.js with ease. As the creators of Next.js, Vercel is able to provide excellent support for the framework and ensure that users can take advantage of all the latest updates and capabilities.

## Render
Render offers a variety of features and tools to assist developers in building, deploying, and managing their apps. Some of these features include free TLS certificates, a global CDN, DDoS protection, private networks, and automatic Git deploys.

## Netlify
If you are looking to deploy a static site with Next.js, Netlify is a strong option to consider. It provides a number of tools for managing and optimizing your site, including A/B testing, form handling, and analytics.
Netlify has developed its own Next.js middleware that allows for HTML rewrites, page data transforms, and access to the response body.

## Digital Ocean
Digital Ocean App Platform is a fully-managed solution for quickly building, deploying, and scaling apps. It allows you to easily deploy code from your GitHub or GitLab repositories and automatically updates your app whenever you push changes to your source code.

## Heroku
Heroku offers a variety of features and tools that make it easy to deploy, run, and scale Next.js applications. These features include support for automatic scaling, easy rollbacks, and access to a wide range of add-on services. This makes Heroku a powerful platform for developing and running Next.js apps.

## AWS Amplify
AWS Amplify is a service that allows you to build and deploy cloud-based web applications. It is a part of the Amazon Web Services (AWS) suite of products and provides easy integration with other AWS services, such as Amazon Cognito for user authentication and Amazon S3 for file storage.

## Google Cloud App Engine
Google Cloud App Engine is a platform that automatically scales your application based on traffic and demand, and provides load balancing to distribute traffic across multiple instances of your app. It is also integrated with other Google Cloud Platform (GCP) services, such as Cloud Storage, BigQuery, and Cloud Functions, allowing you to easily build and deploy cloud-based applications.

---

I'm Pierre the maker of [NextJS Devs](https://nextjsdevs.net/) a reverse job board for Next.js developers
If you're looking for a Next.js job don't hesitate to create a profile!
The Everyday Life of an HNG Intern; Isaac Ojerumu’s Story
Tags: beginners, programming, career, community
Published: 2023-01-09 18:57:42

**Task 9**
Stage 9 is what I would love to call judgment day.😂 This was the stage in which the fate of interns that made it this far was determined. It was during this stage that groups got to see the result of their accumulated labour in building projects.
The ninth and final task of the HNG internship was for the groups that interns were shared into in **stage 3** to carry out a thorough check and review of the projects that they built. Team Axle, Isaac's team, carried out a detailed review of their project; **The Engineering 360**. After reviewing, the errors that were found were corrected, necessary addition and omission were made and a final test run of the project, an app, was carried out.
After rounding up with the test, **Team Axle** made a demo of the app and forwarded it to their mentors for scrutiny and assessment. Interns whose projects were deemed effective enough were declared finalists.
Yes, after seven weeks and three days; 52 days of hard work, determination, perseverance, and teamwork, interns that proved to be effective, efficient, and hardworking received the fruits of their labour. The reason why developers like Isaac joined this internship has finally been fulfilled.
Finalists were congratulated for a job well done. Offers were presented to them as a reward for their hard work and diligence;

1. Merging all products built in the course of the internship together as a single company and making finalists co-owners of it.
2. A paid-internship opportunity at hotel.ng. This offer was exclusive to PHP and Python developers.
3. Returning to one's life before the internship. Funny, right?

Finalists were also made members of the HNG Network. This gives them access to amazing opportunities in their Tech career.
Dear reader, it's the final stage of the internship.🥳 This is me saying a big thank you to you for sticking with me on this. Although it's the last stage, this is not the final episode of my series. I will be releasing one more episode which will be the icing on this nine-layer chocolate cake of mine.🤭 I hope to see you on the next page.
Please, let's get in touch on Medium; **Zini Zada**, and Twitter; **Zada_Zini**

Link to next episode:
https://dev.to/zadazini/the-everyday-life-of-an-hng-intern-isaac-ojerumus-story-f9i
Get Help From World's No.1 Online Tutoring Company
Published: 2023-01-09 10:03:15


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/of3dp61t4994q3hv0kk4.jpg)
MyAssignmenthelp is the leading [assignment help](https://myassignmenthlp.com) service in Australia that has been successfully serving the students of Australia for almost ten years. Our Ph.D. Qualified [online assignment help](https://myassignmenthlp.com/online-assignment-help/) experts cover a wide range of subjects for the students of top colleges and universities, and we have become a trusted partner in academic support.

We are proud that we have a team of the best academic writers. Our [all assignment help](https://myassignmenthelp.com.au/all-assignment-help/) writers have years of experience with essay writing, solving case studies, and providing students with thesis help, dissertation help, and coursework help. Writing essays or solving case studies is not difficult at all, however, it’s the time that it takes to write an essay and to solve a case study that most of the students don’t have, as they are already bombarded with many assignments and other projects.

So if you are after [instant assignment help](https://myassignmenthlp.com/instant-assignment-help/) and want excellent grades then simply order your next assignment through our order form and one of our expert writers will be in touch with you. Similarly, you can chat with one of our [online assignment help](https://myassignmenthlp.com/online-assignment-help/) experts and discuss your assignment needs before ordering.
 
Get a FREE Quote: https://myassignmenthlp.com/quote/
Chat with us 24/7: https://lc.chat/now/9400525
Email us at: contact@myassignmenthlp.com
Chat on WhatsApp: https://wa.me/61416195006?text=Hi%2C+I+am+looking+for+Assignment+Help
How to create a JSON field in Django to store an array from frontend
Tags: django, python
Published: 2023-01-09 18:46:55

1. pip install django-jsonfield
2. Example to import it in model
```python
import jsonfield
from django.db import models
class StudentData(models.Model):
   name=models.CharField(max_length=100)
   standard=models.CharField(max_length=100)
   section=models.CharField(max_length=100)
   the_json = jsonfield.JSONField()
```
3. How to use it in views? Example
```python
from django.shortcuts import render
from . import models
import json
from django.http import JsonResponse


# Create your views here.
def test(request):
    if request.method == 'GET':
        alldata = models.dataM.objects.values('data')
        return render(request, 'index.html', {"datas": alldata})
    else:
        print("value1: " + request.POST['data'])
        data = models.dataM.objects.create(data=request.POST['data'])
        data.save()
        alldata = models.dataM.objects.values('data')
        return render(request, 'index.html', {"datas": alldata})

```
As you can see I am getting values of json field data and simply sending to html
Python Programming Bootcamp #15 - list methods, FIFO, LIFO
Tags: python, programming, beginners, tutorial
Published: 2023-01-09 18:40:57

---
title: Python Programming Bootcamp #15 - list methods, FIFO, LIFO
published: true
description: Python lists can be used as queues or stack, but there is also deque for that.
tags: python, programming, beginners, tutorial
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-01-09 18:38 +0000
canonical_url: https://code-maven.com/programming-bootcamp-for-scientists-15
series: bootcamp
---

{% youtube r3ghO5OYt2U %}

* 00:00 Lists chapter from [split](https://code-maven.com/slides/python/split) till first exercises.
* 00:50 for loop on lists (for in)
* 02:25 in list (in)
* 03:00 Where is the element in the list  (index)
* 05:25 Index improved
* 06:30 insert element into list ([insert](https://code-maven.com/slides/python/list-insert))
* 08:25 append element to the end of a list ([append](https://code-maven.com/slides/python/list-append))
* 08:45 remove element from list by value. ([remove](https://code-maven.com/slides/python/list-remove))
* 10:15 remove element from list by location (by index) (pop)
* 11:35 Why is it called pop?  (Discussing queues FIFO and stacks LIFO)
* 14:24 Remove first element of a list (shift, pop(0))
* 15:20 Remove several elements, a sublist, from a list.
* 16:48 Use a [list as a queue](https://code-maven.com/slides/python/list-as-a-queue).
* 20:27 Use deque from collections to be a queue.
* 23:20 Use a [list as a stack](https://code-maven.com/slides/python/list-as-a-stack).
* 24:50 Use deque from collections to be a stack.
* 25:30 Exercise: Queue
* 27:00 Exercise: Stack (Reverse Polish Calculator)
* 31:15 Exercise: MasterMind
Prime your dev stack by installing brew on Ubuntu
Tags: ubuntu, webdev, beginners, tutorial
Published: 2023-01-09 18:39:56

Before great apps can be developed you need a development stack to work from. https://brew.sh/ takes the dependency headaches away!

I show you how to install brew so you can be on your way to more exciting topics.

{% embed https://youtu.be/k_0AyA54KG0 %}

References:

* https://brew.sh
* https://ubuntu.com/
HTML Validation for Nuxt
Tags: html, vue, javascript, webdev
Published: 2023-01-09 18:38:37

I always like to take a look at the nuxt modules created by the community and just recently I discovered a module that was on the list for some time already but was not as popular. So in today article, I will take a look at html-validator module for Nuxt!

This module is actually based on another JS library -> https://html-validate.org/

So the module is mainly a wrapper around it that allows for easier usage in nuxt apps.

## What is `html-validate`?

It is an Offline HTML5 validator that validates either a full document or a smaller (incomplete) template, e.g. from an AngularJS or Vue.js component. It comes with several functionalities out of the box:

* Fragments and components
* Offline
* Strict parsing
* HTML5 content model
* Accessibility tests
* Extendable
* Frameworks support

Basically, it will work like this:

![Html Validate usage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jnoez1z6c2znwvma12l9.png)
 
And this:

![Html Validate usage WCAG](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4p9vgh7yolpa9dokqmp6.png)

## Usage in Nuxt

As explained before, Nuxt module is mainly a wrapper that comes with:

* Zero-configuration required
* Helps reduce hydration errors
* Detects common accessibility mistakes

The usage is very simple. Add `@nuxtjs/html-validator` dependency to your project:

```bash
yarn add @nuxtjs/html-validator # or npm install @nuxtjs/html-validator
```

Add `@nuxtjs/html-validator` to the `modules` section of `nuxt.config.ts`:

```ts
export default defineNuxtConfig({
  modules: ['@nuxtjs/html-validator'],
})
```

And that's it! You will have accessibility and content checks from now on enabled!

## Summary

If you would be interested in learning more about this module and how it works, I highly recommend to check out following resources:

* https://html-validator.nuxtjs.org/
* https://github.com/nuxt-modules/html-validator
5 Tips for Boosting Your Twitter Account
Tags: twitter, tips, tricks, grow
Published: 2023-01-09 18:32:02

_Twitter is a popular social media platform with over 330 million monthly active users. If you're looking to boost your Twitter account, here are five tips to help you get started:_

**1. Tweet regularly:** To keep your followers engaged, it's important to tweet regularly. This can be as often as a few times a day, or a few times a week, depending on your content and audience.

**2. Use hashtags:** Hashtags are a great way to get your tweets seen by a larger audience. Use relevant hashtags to make it easier for people to find your tweets.

**3. Interact with other users:** Twitter is a social platform, so be social! Retweet and like other users' tweets, and respond to comments and mentions. This can help to build relationships and grow your audience.

**4. Include visuals:** Tweets with images and videos tend to get more engagement than text-only tweets. Consider including visuals in your tweets to grab the attention of your followers.

**5. Use Twitter analytics:** Twitter provides a free analytics tool that allows you to track the performance of your tweets. Use this tool to see which types of tweets are most successful, and adjust your strategy accordingly.

##Conclusion:

By following these tips, you can boost your Twitter account and reach a larger audience. Remember to tweet regularly, use hashtags, interact with other users, include visuals, and track your analytics to optimize your performance on the platform. With a little bit of effort, you can grow your Twitter presence and engage with a larger audience.

_I hope these tips were helpful in giving you some ideas on how to boost your Twitter account!_
Everyone Struggles
Tags: opensource, outreachy, beginners
Published: 2023-01-09 18:16:43

This is the second part of a series of blogs I will be writing as part of my outreach internship with Bioconductor.

In open source, most of the thing we do are learnt from others, the community or through research. When you start contributing to open source you are likely to meet new concepts, words, ways of doing thing and so on. Open mindedness will take you far in Open source. Being able to be open to asking questions, answering questions and seeking help whenever you need it, goes a long way in making your open-source journey easier.

When I started at Bioconductor, I struggled with several things. One of them was learning the language and context of [sweave](https://en.wikipedia.org/wiki/Sweave) documents. R programming back then and now have different syntax and that was somehow confusing and made me struggle a bit.

Another thing was the different package names. In Bioconductor, there are so many packages available. Knowing which name was for a package, function or class was something I struggled with. I had to go back to confirm on the documentation many times just to start getting them.

I also struggled with asking for help. Sometimes I would get stuck and the spend a lot of time doing research and trying to solve everything on my own. This resulted to me spending more time actually struggling to get a solution when a solution was just a text away. I would have simply asked my mentor or community members.

How what did I do about my struggles?

1. **Ask my mentor to help** when I am stuck. I always ask questions or links to resources whenever I feel I need something. My mentor has really been supportive no matter how simple or hard my question is. I always get answer or recommendations on time.
2. **Ask my community for help**. Other members of the community may understand something very well and might be very resourceful with what you are struggling with.
3. **Research**. In open source, research is very important. Trying to figure out if there is documentation about something or how other people solved or overcame some of the things that you are struggling with. Using resources like [Google search engine](https://www.google.com/), [stack overflow](https://www.google.com/) or [cheat sheets](https://www.google.com/) can help.
4. **Giving myself a timeline**. If I struggle with something for more than a set period of time then next would to ask my mentor. This actually helped reduce time trying to get a solution by myself and enabled me do more work.

If you are struggling with a vocabulary or concept, it is good to first learn that all of us struggle with something. Next is to take action, you can use some of the methods I have shared and try figuring out what works for you. More importantly, you should try and understand why you are struggling with something. It might be because you are new to the concept or you need to learn a few things to help you understand things better.

Remember, everyone struggles!
An Introduction to Artificial Intelligence: What is AI and How Does it Work?
Tags: ai, career, beginners
Published: 2023-01-09 18:14:16

##Introduction:

Artificial intelligence (AI) is a rapidly evolving field that has the potential to revolutionize many aspects of our lives. From self-driving cars to intelligent virtual assistants, AI is already starting to have a significant impact on our world. In this article, we'll take a closer look at what AI is and how it works.


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


##What is Artificial Intelligence?

Artificial intelligence is the ability of a machine to mimic human intelligence and behaviors, such as learning and problem-solving. There are several different types of AI, including:

1. Narrow or weak AI: This type of AI is designed to perform a specific task, such as playing a game or recognizing speech. It is not designed to be general purpose.
2. General or strong AI: This type of AI is designed to be able to perform any intellectual task that a human can. It is not currently possible to create a machine with this level of intelligence, but it is an active area of research.

##How Does Artificial Intelligence Work?

_There are several approaches to creating artificial intelligence, including:_

- Rule-based systems: This approach involves coding a machine with specific rules and algorithms that allow it to perform a specific task.
- Machine learning: This approach involves training a machine on a large dataset and allowing it to learn and improve performance over time. There are several different types of machine learning, including supervised learning, unsupervised learning, and reinforcement learning.
- Neural networks: This approach involves creating a machine that is designed to mimic the way the human brain works. Neural networks consist of layers of interconnected "neurons" that can process and transmit information.

##Applications of Artificial Intelligence

_Artificial intelligence has many practical applications, including:_

- Natural language processing: AI can be used to understand and generate human-like speech, allowing for the creation of intelligent virtual assistants such as Siri and Alexa.
- Computer vision: AI can be used to analyze and interpret images and video, allowing for applications such as self-driving cars and facial recognition.
- Predictive analytics: AI can be used to analyse large datasets and make predictions about future outcomes, which can be useful for a variety of applications such as marketing and finance.

##Conclusion

Artificial intelligence is a rapidly evolving field with the potential to revolutionize many aspects of our lives. From natural language processing to self-driving cars, the possibilities are endless. As the technology continues to develop and mature, we can expect to see even more exciting and innovative applications of AI in the future.