teleren/devto huggingface dataset:
Why your web app should have ssl certificate
Tags: ssl, security, programming
Published: 2023-01-10 08:40:11

In this article, I will show you how you can add a free SSL certificate to your Nginx server with Certbot.

Before we start, let's understand what SSL is.



## What is SSL?

SSL(Secure Socket Layer) is a protocol for establishing authenticated and encrypted links/connections between connected computers.
 

## What is SSL certificate and why do we need it?

An SSL certificate (also known as a TLS or SSL/TLS certificate) is a digital document that binds the identity of a website to a cryptographic key pair consisting of a public key and a private key.

The public key, included in the certificate, allows a web browser to initiate an encrypted communication session with a web server via the TLS and HTTPS protocols. The private key is kept secure on the server and is used to digitally sign web pages and other documents (such as images and JavaScript files)
(source: ssl.com )

## Reasons your web page/application should have an SSL certificate: 

### **It protects you and your web page/app users against hackers.**

Since the connection is secured in a way that the information from your app's visitors' devices and your app is encrypted, it's hard for a hacker to know the information being shared.

When you buy something online, you share your payment information with the site you are using (credit cards, PayPal,…). 

Ex: In this case, if the site is not using SSL, it's easier for a hacker to grab the information being shared.
But in the other case where you are using a secure connection (SSL), even though the hacker can be able to intercept the connection, he can't be able to know the information being shared since it's encrypted. 



### **Increases trustworthy in your users**

Users trust your page/app more since they are confident that the information they share with or 
through it is secure.



### **Improves your app's SEO**

It's no secret that having an SSL certificate ranks your site higher in search engines like Google.
Some browsers like chrome block unsecure apps by default from being accessed  (to protect users' online privacy)and that can lead to poor performance for your app and poor SEO.


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


You can learn more about SSL by using these resources.

[ssl.com](https://ssl.com)
Assign a free SSL certificate to an nginx server with certbot
Tags: nginx, ubuntu, ssl, security
Published: 2023-01-10 08:32:07

In this article, I will show you how you can add a free SSL certificate to your Nginx server with Certbot.

Before we start, check my previous article to understand more about SSL, and check here about serving a static app with Nginx.

## What is certbot?

**Certbot** is an open-source automated software that generates Let's Encrypt Certificates. SSL
certificates are provided free of cost by the Internet Security Research Group(ISRG).





## Let's get started 💎

Considering we already have our app being served by Nginx on our server, we can proceed to install certbot first.

Before you get started, I assume that.
- You are familiar with Nginx
- You have Nginx running on an ubuntu Linux server


## Install certbot
 

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

Get SSL/TLS certificate

```
$ sudo certbot --nginx -d example.com
```

Here example.com ☝🏾 is referring to the domain Nginx is using to serve our app.

If successful, you should get a response like below 👇🏽


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

Open the browser and visit your app. 
It should be using HTTPS with a valid SSL/TLS certificate ⚡️
 





Also check 👉🏽 [Serve a static app with Nginx](https://amanieric.com/blog/serve-a-static-app-with-nginx)
The AWS Serverless Badge
Tags: aws, serverless, cloud, skillbuilder
Published: 2023-01-10 08:23:35

## Introduction 👋
Amazon Web Services recently announced at Re:Invent an all-new way to demonstrate your AWS Serverless knowledge and skills with a verifiable, digital badge.

This Serverless Learning Plan has been designed to help you get started building with Serverless technology. AWS experts designed the content to provide a clear learning path to help you develop the skills you need quickly (and best of all, it's completely free!).

Over the holiday period I decided to take some time to sit down and complete the AWS provided learning path and I am happy to say that I received my AWS Serverless Skill Builder Badge from AWS, which you can view [here](https://www.credly.com/badges/d9e68b83-fc11-4365-a172-2d61333867de/public_url).

![AWS Certificate](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lnwwqtdwwbfqdrnb33es.png)


## The Course 📚
This learning plan consists of the following chapters:
1. Getting into the Serverless Mindset
2. AWS Lambda Foundations
3. Designing Event-Driven Architectures
4. Architecting Serverless Apps
5. Scaling Serverless Apps
6. Deploying Serverless Apps
7. Amazon API Gateway for Serverless Apps

Most of the sections take around 1-2 hours of both written and video content so a good size to set yourself a goal of one per day or weekend etc.

## The Exam 📝

![exam result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yrcfk7tl5jtky96eukio.png)


To obtain your serverless badge from [Credly](https://info.credly.com/), you will need to complete the assessment at the end of the learning path with a passing score of 80%. The exam consists of 50 multiple choice questions which you have unlimited time to answer (you may also save your progress and resume the exam at a later time).
One thing to keep in mind is that if you fail an attempt, you must wait 24 hours before you can reattempt the exam. Thankfully, you have unlimited attempts so use these 24 hours to your advantage and do some revision on the areas of the assessment that let you down (at the end of a failed exam, you are not shown which questions you failed on, but you are provided with some guidance on chapters you should focus on).

![question guidance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nr0wh3npt4nx4xbosrrj.png)



## Conclusion 💡
Overall I think the Serverless Learning Plan is a fantastic way to dive right into the serverless mind sight. Whether you're already an AWS Solutions Architect or a Cloud Newbie, this course will walk through a lot of the architect and design best practices that most official documentation just doesn't cover.

Over the next few weeks I will be continuing to publish blog posts that delve into each chapter provided by this course, so please stay tuned 🤠🚀
Incremaent/decrement Operator
Published: 2023-01-10 08:23:16

Increment/Decrement operatorlari o'zgaruvchini bitta oshirib berish yoki kamaytirib berish . `a++`,`++a`,`b++`,`++b`,`a--`,`--a`,`b--`,`--b`.

- Agar ++,-- a yoki boshqa o'zgaruvchilardan oldin kelsa unda o'sha qatordan boshlab hamma pastki qatorlarda o'sha o'zgaruvchi bitta songa oshadi yoki kamayadi.

```cpp

#include <iostream>
using namespace std;
int main (){
  int a = 67;
  int z = 16;
  int c = --a + z++;
  cout << c;
return 0;
}
```

- Agar ++,-- a yoki boshqa o'zgaruvchilardan keyin kelsa unda  pastki qatordan boshlab o'zgaruvchi birga oshadi yoki kamayadi.

```cpp

#include <iostream>
using namespace std;
int main (){
  int a = 67;
  int z = 16;
  int g = a++ + z++;
  cout << g;
return 0;
}
```
@dawroun
Neco timetable 2023
Published: 2023-01-10 08:22:37

[https://multischolar.com/neco-timetable/](https://multischolar.com/neco-timetable/#utm_source=backlinks&utm_medium=search&utm_campaign=darry+ring+us&utm_content=Michelle)
https://plaza.rakuten.co.jp/chenlee/diary/202301090000/
https://www.provenexpert.com/necoexam2023/
https://www.producthunt.com/@necoexam2023
https://www.divephotoguide.com/user/necoexam2023/
https://www.diggerslist.com/necoexam2023/about
http://www.heromachine.com/forums/users/necoexam2023/
https://wakelet.com/@necoexam2023183
https://vocal.media/authors/necoexam2023
https://www.lifeofpix.com/photographers/necoexam2023/
https://seedandspark.com/user/necoexam2023
https://rosalind.info/users/necoexam2023/
http://phillipsservices.net/UserProfile/tabid/43/userId/192577/Default.aspx
https://app.roll20.net/users/11489585/neco-e
http://uid.me/necoexam2023
https://speakerdeck.com/necoexam2023
https://social.msdn.microsoft.com/Profile/necoexam2023
https://www.iheart.com/podcast/269-neco-2023-107001670/
https://active.popsugar.com/@necoexam2023/profile
https://www.longisland.com/profile/necoexam2023
https://camp-fire.jp/profile/necoexam2023
https://plazapublica.cdmx.gob.mx/profiles/necoexam2023/activity
https://www.metal-archives.com/users/necoexam2023
https://artmight.com/user/profile/912055
https://storium.com/user/necoexam2023
https://trabajo.merca20.com/author/necoexam2023/
https://telegra.ph/neco-timetable-2023-01-10
https://www.intensedebate.com/people/necoexam2023
https://www.mifare.net/support/forum/users/necoexam2023/
https://pinshape.com/users/2551229-necoexam2023
http://foxsheets.com/UserProfile/tabid/57/userId/117693/Default.aspx
https://www.credly.com/users/neco-exam/badges
https://www.myminifactory.com/users/necoexam2023
https://www.speedrun.com/user/necoexam2023
https://www.sqlservercentral.com/forums/user/necoexam2023
https://leanin.org/circles/necoexam2023
https://myanimelist.net/profile/necoexam2023
Different environment variables available in Java
Tags: sbwriteups, tipsandtricks, java, linux
Published: 2023-01-10 08:22:26

## Different environment variables available in Java ##

So basically, the requirement was to run a Java application with a system property, which can easily be accomplished by the -D flag while running the application, but I didn't want to hardcode that in the dockerfile.

**INFO:**
```
Syntax:
       -Dproperty=value
           Sets a system property value. The property variable is a string with no spaces that represents the name of the property. The value variable is a string that represents the value of the
           property. If value is a string with spaces, then enclose it in quotation marks (for example -Dfoo="foo bar").

```
The above definition is captured from the Linux manuals, or so to say, man command **_<$ man java | less -p -D>_**
- Just to add here, we are just pipeing man java to the less command, where -p (is used for pattern matching) -D is the pattern which we want to match.
- Since we are pipeing it to less, all the keys w.r.t. less will work without issues (for instance: n for next available match pattern).

And the reason was simple; I wanted to make sure my Docker image is flexible enough to support other values of the property as well.

</br>
My initial impression and approach were that it could be easily accomplished using the JAVA_OPTS environment variable, and that when the application runs, it will automatically take that into account, and my job is done.

But unfortunately, I was wrong, and after setting up that environment value with the intended value, it didn't work. The JVM was not picking that up, and I was really reluctant to hard-code that.

</br>
Later on, I found there are multiple other environment variables as well, and also a quick note about JAVA_OPTS:

- JAVA_OPTS:
>JAVA_OPTS is not an environment variable that the java executable will recognise on its own. Instead, various scripts that wrap the start-up of Java will often use an environment variable named JAVA_OPTS to configure the java executable (for example, the tomcat startup script does this).

Ref: https://community.oracle.com/tech/developers/discussion/1542017/cannot-get-java-opts-to-work for more details.

- JAVA_TOOL_OPTIONS:
>In some scenarios, the CLI is not accessible, like in mine, wherein we cannot pass the intended properties. In those cases, the JAVA_TOOL_OPTIONS environment variable can be useful to append the command with the intended property.

Ref: https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/envvars002.html

- _JAVA_OPTIONS

> For this one, based on my understanding, it is kind of similar in usage to the above one, but it differs in some contexts like order presedence and error handling, and also this one is not that widely used, and unfortunately, was not able to find official documentation about it.

In a nutshell, I **ended up using "JAVA_TOOL_OPTIONS"** and it worked without issues :)

Please feel free to add or correct anything I missed. 

[Feel free to connect over LinkedIn :)](https://www.linkedin.com/in/sunnybhambhani/)
Docker registry API
Tags: docker, linux, sbwriteups, tipsandtricks
Published: 2023-01-10 08:19:26

## Docker registry API ##

Basically, I was attempting to create a workflow in which I needed to retrieve the latest tag (not the name latest, but the actual tag name) for an image that had recently been pushed to a registry, as well as when that image was pushed.

There can be N number of usecases in which this information can be useful, but the top one (based on my usecases) is that we never want to deploy an application with the latest tag. Therefore, there should be a way to find out which is the latest one so that we can persist the image tag and use it as and when required to avoid anamolies.

I assumed this usecase was fairly common and that I would be able to find something like an --orderby flag, etc., but I was unable to find any useful command for it.

</br>
</br>
But later on, I read about the Docker Registry API, and it really helped me a lot. Just to add some of the commands which I found really handy:


- Let's say if you are looking to find out what all the repo's a registry has:
```
curl -X GET -s -u $USERNAME:$PASSWORD https://$REGISTRY/v2/_catalog
```
- Get a list of tags in a particular repo:
```
curl -X GET -s -u $USERNAME:$PASSWORD https://$REGISTRY/v2/$REPO/tags/list
```
- Get the list in pages or limit the output of the above two commands, just append it with the below characters:
```
?n=2
```
- If you want to get detailed information about all the layers when they were created?, What instruction was used per layer?, What is the command or entrypoint?, etc. The below command can be really handy.
```
curl -X GET -s -u $USERNAME:$PASSWORD https://$REGISTRY/v2/$REPO/manifests/$TAG
```

```
Quick information about all the variables and flags that are used here:

$USERNAME: Name of the user by which we need to authenticate, if your docker registry is locally hosted, we can ignore this one.
$PASSWORD: Password of the user by which we need to authenticate.
$REGISTRY: FQDN of the registry. 
$REPO: Specific repository in which we are looking out for details. 
$TAG: Specific tag for which we are looking out for details.
-u: curl's flag for passing username and password.
-s: curl's flag to slient the verbose information.
-X: HTTP request method, here we are doing GET.
```

</br>
I have yet to go into this topic in much detail, since there is a lot that we can do with the Docker Registry APIs.

- Will update this file soon with what all things we can do with this.

</br>
If interested, check this out: https://docs.docker.com/registry/spec/api/

[Feel free to connect over LinkedIn :)](https://www.linkedin.com/in/sunnybhambhani/)
Conversational Programming
Tags: programming, machinelearning, computerscience
Published: 2023-01-10 08:19:13

I heard multiple times Simon Wardley talking about [Conversational Programming as far back as 2019](https://twitter.com/swardley/status/1102889853954478080?s=20&t=8URYAKOdTYQ1kMx1ZCw1Tw), but I think it didn't strike me until I put my hands on it. Yes, as I have shared in this post, [I used ChatGPT to generate about 30%-40% of the code I wrote for octotype](https://octotype.vercel.app/peibolsang/stories/2), and I am still in awe.

Something I noticed is that the model behind ChatGPT is _good enough_ to interpret semi-ambiguous requirements but still needs a considerable deal of *detailed* input that expresses my intent. The same happened when [I re-trained a Stable Diffusion model with selfies to generate cyberpunk-like portraits of myself](https://twitter.com/peibolsang/status/1606318579506454528?s=20&t=RK9Mnof0VooVX8wSUScJHA). That type of thought process to express intent and reduce uncertainty in the input is what many people call **Prompt Engineering**. However, I think this is precisely what Simon Wardley calls **Conversational Programming**.

In other words, Prompt Engineering looks a lot like Programming. When you are programming, there is a process to remove ambiguity and uncertainty, so your intent is understood by the machine, and you express that intent in a language that the machine understands, such as Javascript. Well, that's precisely what we are doing with these AI models, but instead of using a 4GL programming language, we are using our Natural Language.

I said it multiple times, but when you automate something (with AI or otherwise), you are actually **constraining that something with automation**, and you can only constrain something with very low levels of uncertainty. Unfortunately, high-level business requirements to create software are not something that you can automate in full. You still need a process to remove ambiguity and express your intent, and you need to do it iteratively.  You still need to divide and break down your big _uncertain problem_ into smaller, more certain chunks expressed in natural language. Basically, you are programming conversationally.

Maybe, in time, these models get more intelligent so that they offer higher-level abstractions for us to ease the process of removing ambiguity and expressing intent. That is precisely what happened when we moved from assembly to Java! In other words, we may be at the doorstep of a new generation (5GL) of programming languages based on problem-solving using constraints given to the machines rather than commands.
Starting out Small! Avoid Overthinking.
Published: 2023-01-10 08:17:59

So you're thinking about starting a personal project to escape the rat race of the rigged education system, then you start wondering how many users will use your product?  How will you market the product ? How will you get the money needed to maybe run servers, and have a team work with you, etc. After this you end up doing nothing and terminating the project totally only because you thought you wasn't going to be able to market the product you haven't even built.

## Overthinking does no Good
So what do you have to take from this, when thinking about starting a project there are many things to consider but when you overthink and go into every little details there is needed to make the project a successful one you'll end up doing nothing. So instead , first consider the basics things you need to start implementing your idea and then get to work and let life take its course.

## Conclusion
If you try this in every thing you do not only programming projects you'll find that overthinking is a really damaging practice because it usually even make you feel overwhelmed due to too much things you want to figure out before hand.

As usual I'm writing small articles for self improvement and mindset shifting , I'll be going into technical stuff less than this.
Helm dashboard
Tags: helm, kubernetes, tipsandtricks, sbwriteups
Published: 2023-01-10 08:11:15

## Helm dashboard ##

Helm can do a lot, but if we need to further enhance its usability, helm plugins really come in handy.

I was just traversing some articles and came across a plugin called helm dashboard by Komodor which happened to be released at #kubecon , It really looked appealing, so I just thought to give it a try.

PS: If you're interested, you can find some of the plugins here: https://helm.sh/docs/community/related/#helm-plugins 

</br>

>helm plugin [SUB_COMMAND]

is the one which will help you manage all the plugins. 
Ref: https://helm.sh/docs/helm/helm_plugin/

>helm plugin install [PATH/URL]

is the one that will help you install a plugin.
Ref: https://helm.sh/docs/helm/helm_plugin_install/

>helm plugin uninstall [PLUGIN]

is the one by which you can uninstall a plugin.
Ref: https://helm.sh/docs/helm/helm_plugin_uninstall/

</br>

**How this helps:**
1. It gives a UI to see what all helm charts are installed. 
2. It helps to see its revision history. 
4. Graphically browse all the resources that were a part of the helm chart. 
5. It automatically uses KUBECONFIG, so we do not need to make any extra efforts. 
6. You can see all of your helm repositories and add them directly from the UI.
7. It helps to see which charts are part of a repository. 
8. Install the chart from the UI itself. 
9. You can see the k8s manifest outcome on the UI itself and cross check it before installing the chart. 
10. Add user-defined values.
11. It helps in troubleshooting as well, you can check the releases difference from the UI itself.

</br>

**Installation**
</br>

Its installation is relatively simple, 

>helm plugin install https://github.com/komodorio/helm-dashboard.git

**How to access**
</br>

Once the plugin is installed, just fire:

>helm dashboard 

It will open a local browser where you can traverse the UI and see what all magic it can do and how useful it is.

For more details, check this out: https://github.com/komodorio/helm-dashboard 

[Feel free to connect over LinkedIn :)](https://www.linkedin.com/in/sunnybhambhani/)
What do you think the first 3 steps of dev is?
Tags: beginners, tutorial, android, ios
Published: 2023-01-10 08:07:19

Hi there,

I'm new here and new to dev as a whole. Was wondering if anyone could kindly point me in the right direction by helping with the first 3 things to do when starting out. I think I want to go in the app direction, but not too sure.
100. Same Tree
Tags: java, problemoftheday, leetcode, 100daysofcode
Published: 2023-01-10 08:05:21

**Problem Statement:**

Given the roots of two binary trees p and q, write a function to check if they are the same or not.

Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.


**Example 1:**
**Input:** p = [1,2,3], q = [1,2,3]
**Output:** true

**Example 2:**
**Input:** p = [1,2], q = [1,null,2]
**Output:** false

**Example 3:**
**Input:** p = [1,2,1], q = [1,1,2]
**Output:** false
 

**Constraints:**
- The number of nodes in both trees is in the range [0, 100].
- -104 <= Node.val <= 104

**Solution:**

**Algorithm:**

1. If both the trees are empty, return true.
2. If both the trees are not empty, then check if the root node of both the trees are same.
3. If the root node of both the trees are same, then recursively check for the left and right subtree of both the trees.
4. If the root node of both the trees are not same, then return false.
5. If the left subtree of both the trees are not same, then return false.
6. If the right subtree of both the trees are not same, then return false.
7. If all the above conditions are satisfied, then return true.

**Code:**
```
public class Solution {
   
        public boolean isSameTree(TreeNode p, TreeNode q) {
            if (p == null && q == null)
                return true;
            if (p == null || q == null)
                return false;
            if (p.val != q.val)
                return false;
            return isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
        }
    
}
```
**Time Complexity:**
O(n)

**Space Complexity:**
O(n)