teleren/devto huggingface dataset:
Kubernetes Jenkins setup - Part 10
Tags: kubernetes, docker, devops, linux
Published: 2020-10-11 09:25:18

{% youtube qE_v6HAEgOo%}

In this lab session on installing Jenkins on Kubernetes, we are going to perform - 

1. Setup the Kubernetes cluster from scratch
2. Use Jenkins docker image - jenkins/jenkins:lts
3. Create Kubernetes cluster roles for Jenkins
3. Create cluster role binding for Jenkins
4. Create a persistent volume for storing Jenkins settings
5. Do the Jenkins deployments using Jenkins docker image jenkins/jenkins:lts
6. Expose Jenkins deployment as service using Nodeport
7. Setup admin account for Jenkins 
8. Install Kubernetes plugin inside Jenkins 
9. Connect to Kubernetes from Jenkins using Kubernetes default URL - https://kubernetes.default
How to use Persistent Volume and Persistent Claims | Kubernetes - Part 9
Tags: kubernetes, docker, devops, linux
Published: 2020-10-11 09:23:02

{% youtube 1FTJQOvAGOY%}

For setting up the Kubernetes Cluster using kubespray follow - https://youtu.be/7dG3vZFjQsE

In this lab session on Kubernetes Persistent Volume(PV) and Persistent Volume Claim (PVC) we will be going through - 

1. Concepts behind Kubernetes Persistent Volume(PV) and Persistent Volume Claim (PVC)
2. How to create a Persistent Volume(PV)?
3. Persistent Volume Claim (PVC)?
4. How to create POD and use Persistent Volume(PV) and Persistent Volume Claim(PVC)?
How I setup HaProxy Ingress ingress controller on kubernetes cluster - Part 8
Tags: kubernetes, devops, docker, linux
Published: 2020-10-11 09:21:09

{% youtube yQIbJcg0Ljc%}

In this lab session, we are going to perform the following tasks - 

1. Set up the Kubernetes cluster(If you haven't done before then I would recommend you to follow - https://youtu.be/7dG3vZFjQsE)

2. Install HAproxy load balancer on your Kubernetes cluster

3. Setup Ingress Controller after installing HAproxy.

4. Create Kubernetes deployment, in this lab session we are going to deploy spring boot microservice. (For spring boot deployment please refer - https://youtu.be/ejwiMFJETdQ)

5. Expose the deployment as service using ClusterIP 

6. Create Ingress resource for the exposed service

7. Finally, test the microservice.
Introducing Nice Blogs Gatsby Starter Template
Tags: gatsby
Published: 2020-10-11 09:18:11

A minimalistic, paginated and bundled with some common features needed for a blogging site. Nice blogs is built using Gatsby. Easy to deploy and use and get started on writing some awesome blogs.

Live Demo: https://nostalgic-liskov-e76c32.netlify.app/
GitHub URL: https://github.com/abhaynikam/gatsby-nice-blog

Screenshots:
![Blog Page](https://dev-to-uploads.s3.amazonaws.com/i/36mvrgxjcxrx2gtc3o8n.png)![Landing Page](https://dev-to-uploads.s3.amazonaws.com/i/12380fyytw9x19svcbdx.png)

Feel free to use it as per your need and connect if you need help or have a feature request.

Happy Blogging.
Cross posting from your blog to Dev.to. A good idea?
Tags: meta, blogging
Published: 2020-10-11 09:12:25

Been in a bit of a creative rut recently, and I'm figuring that the best thing to do, the thing I'm most inclined to do, is make blog posts about anything and everything. 

I definitely want to do this as part of my own blog where I fully control the content. I've learned a lesson (nicely articulated by [Austin Kleon](https://austinkleon.com/) in his book _Show Your Work_) when I ran a '[Humans of](https://www.facebook.com/HumansOfWelly/)' page that was a Facebook page only. It now kinda sucks that all of that content is just on Facebook and I've since lost the original photos, the accompanying text only there etc. I wish I'd set up a blog like the original Humans of New York did. 

So the question is - should I cross-publish all of my blog posts to Dev.to and Medium as well? 

Is this a common practice? I've had a quick scroll through my Dev.to feed and I can't see many people back-linking to their blog. 

As I see it: 

Pros | Cons
--- | --- 
More exposure | A bit of work setting it up programatically 
Native conversation/reply functionality within the third party mediums | Back links on the posts look spammy
 | Possible adverse SEO affects for the blog? 


What say you?
Deno: Javascript from the terminal
Tags: deno, javascript, typescript, terminal
Published: 2020-10-11 08:57:02

---
title: Deno: Javascript from the terminal
published: true
description: Javascript has evolved from a script to allow for dynamic HTML in the browser to TVs and a valid solution to execute online Javascript code directly in your terminal
tags: deno,javascript,typescript,terminal
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/k2w16a2re10dlz0frpt7.png
---

> Javascript has evolved from a script to allow for dynamic HTML in the browser to TVs and a valid solution to execute online Javascript code directly in your terminal

I am excited to follow how one of the latest innovation in the domain of Javascript, [Deno](https://deno.land), will impact our world. It is a potential replacement of NodeJS, and it was invented by the guy fostering NodeJS. I will not go into any explanation of that story, I just want to point out that Deno has the potential to add yet another domain to the domains which have embraced Javascript.

## In short...
The cover image of this post shows how easy you can execute javascript (actually Typescript) code which is located somewhere on the internet without having to install anything else than Deno.

First time you run the command `deno run https://deno.land/std/examples/welcome.ts` the code is fetched and executed. It is also stored locally, so that next time you want to run the code you will get the cached version of the code.

## Some ideas
This approach where you can point to an URL containing some javascript/typescript and then execute it allows you to take your javascript skills to a brand new level. You can share your pieces of code online, use from anywhere and with open source community starting to develop pieces of code this way - you could make way for even more cross platform sharing of code.

I am happy to see javascript evolve in this way. Some years back I teased a backend developer that he would soon start coding in javascript, he laughed. Then came NodeJS and he stopped laughing, rightly taking javascript serious. Now I say: "Soon your terminal commands will be using javascript too!" - let's see who will stop laughing now! :-)

PS: Now we just need mobile OS start taking javascript serious too! So that you can execute javascript native on iOS and Android :-)
An Intelligent Tool That Attends Your Meetings For You
Tags: javascript, machinelearning
Published: 2020-10-11 08:38:50

Ever been to meetings you didn't want to be a part of? Meetings you could do better without but, you had to go through thoroughly because you didn't know when your name can be announced and you knew you'd have to respond then. Yeah, we have all been there.

That's where "MSorryWhat!?" - my weekend project comes into play. It's a simple speech-recognition which comes with hot word detection which a user can set, upon complete configuration (which doesn't take more than 5 minutes), MSorryWhat listens to your meeting while you do whatever else it is that you want to do and it notifies you whenever your selected hot word is detected!

It is a simple javascript based application living here. It leverages the Webhooks and Notifications services of IFTTT (If this then that) app, to notify you when your name is announced, on the backend it leverages chrome's speech recognition engine.

I spent 10 minutes creating a demo for the tool which can be viewed [here](https://youtu.be/L2wGfVzeRDg).

I'd love to hear feedback, ideas to improve anything!

Oh, and this was my first Javascript project and my first dev.to post and I am already loving both!

Ta-ta!
What is the Firewall?
Tags: security, internet, firewall
Published: 2020-10-11 08:15:47

A firewall is a guard b/w your computer or your internal network and the outside world or the Internet. A particular firewall implementation may use one or more these types of methods :
1. Packet filtering 
2. Stateful packet filtering 
3. User authentication 
4. Client application authentication

A firewall will filter incoming packets based upon these parameters such as packet size, source IP address, protocol, and destination port. Linux and Windows operating systems come up with a simple firewall. There are two best personal firewall solution provider for individual PCs

* Norton
* McAfee

These firewalls are meant for individual machines. There are many advanced solutions available for network protection.
In an organizational setting, you can establish a dedicated firewall b/w your network and the outside world. This may be a router that also has built-in firewall capabilities. (Cisco Systems is one company that is well-known for high-quality routers and firewalls.) Alternatively, it might be a server that is dedicated to run firewall software. There are many numbers of firewall solutions that you can examine.
Memory Leak - Explained
Tags: java
Published: 2020-10-11 07:56:56

When a computer program fails to release a memory that is no longer in use, this condition is known as a memory leak. As a result, that particular block of memory is always occupied, which could have been used by other computer programs.

**Java Garbage Collector and Memory Leak in Java**
One of the benefits of Java is that it provides out-of-the-box memory management. A programmer decides when to allocate memory in a program, while the inbuilt Java garbage collector takes care of deallocating it. The garbage collector automatically scans the memory and looks for objects that cannot be directly/indirectly accessed from variables in code. These kinds of memory blocks are deallocated and memory is freed.

Checkout full article [here](https://technicalknowledgehub.com/memory-leak-explained/)
Dictionaries and learning
Tags: hacktoberfest, contributorswanted
Published: 2020-10-11 07:51:41

Python 🐍 people, I need help 😊

If you have the time to spare, help me make Mercury better. Mercury 🌑 is a customisable translation app, meant for English learners.

The issues (all #hacktoberfest eligible) are in this repo 👇🏽 
{% github AninditaBasu/mercury %}

(sits back and waits for #community magic to float in 🧚🏽‍♀️🧚🏽‍♂️✨)
About Maven
Tags: java
Published: 2020-10-11 07:43:54

Hello! Lets talk about Maven. :) Maven is a Software building tool.👷‍♀️A build tool typically compiles the source code, runs the tests and creates JAR_files as a result. Maven can also perform other activities, like uploading build results or generating reports.

Maven is especially suited for Java applications. The key features of Maven are:

1. Convention over configuration: you dont have to configure that much yourself because Maven uses some default values and contains project templates

2. Dependency management: Maven resolves dependencies during the build.

3. Repository: Project dependencies can be loaded from the local file system, the internet or public repositories. Maven's public repository is called Maven Central.

4. You can extend the Maven build system via plug-ins.

Read more about Maven here: https://www.vogella.com/tutorials/ApacheMaven/article.html

Source: same link as above.

Which building tools are you using and why? Have a nice day! :)
Introducing BTGen, your new best friend
Tags: btgen, javascript, webdev, cli
Published: 2020-10-11 07:11:15

## Stage 1: The problem

I'm sure you are spending a lot of time setting up your projects, right?

Just, think about it...
You just go to your projects folder, create a new one (the project root folder) within, open the project folder, create the .html, .css, .js, and this is just in the simplest cases.

And the next thing to do is open each file and add all the code you'll need.

Now, in a little project, this takes just a few minutes (2~5), but, what about those projects with dependencies, libraries, a framework, and that kind of stuff?

## Stage 2: A simple idea

What if we take the express-generator concept and get it higher, just one tool, for all (ok, maybe just some) web development environments and projects?

## Stage 3: A simple solution: BTGen

BTGen is a "BoilerplaTe Generator", (I know, it's an incredibly creative name) for web development.

Imagine this:
You're going to start a new AngularJS project, and need an structure like this:

```
myApp/
  css/
    vendor/
      bootstrap.min.css
    master.css
  js/
    vendor/
      angular.min.js
      bootstrap.min.js
      jquery-3.5.1.slim.min.js
      popper.min.js
    app.js
    MainController.js
  index.html
```

So, you have three options:
1. Manual
    - Download bootstrap, popper, jquery, and angular (2~3 mins)
    - Create each file/folder manually (1~3 mins)
    - Start coding
2. CDN
    - Create folders/files manually (1~3 mins)
    - Search and copy/paste each CDN link (1~2 mins)
    - Start coding
3. BTGen
    - $ btgen angular myApp --bt (0~1 min)
    - Start coding

## Stage 4: The difference

You already know all about starting the project manually... Let's talk about BTGen.

BTGen will create/download all files you'll need to start coding, even package.json if it is needed, in some cases with sample code, scripts and recommendations, all in just a few seconds!

All boilerplates are customizable (at least a little bit) and, right now, you have just 8 boilerplates to choose from, but, with your help, we can have many more templates available soon.

## Stage 5: The clousure
It deserve a try, is very light-weight and have not dependencies, and all you need to do in order to get starter is type this in your terminal:

```sh
$ npm i -g btgen
```
And [here](https://kenliten.github.io/btgen-doc/) is the official documentation.

Please, let me know what do you think about my tool and how can I improve it.

Thank you!
AWS Amplify cheatsheet
Tags: aws, amplify, cheatsheet
Published: 2020-10-11 07:03:54

I have created a cheatsheet with the most important capabilities of AWS Amplify. If there are new updates I will add those here. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/snfh572hwxu9u7ybqmpf.jpg)
Analyzing your APK during CI/CD
Tags: android, showdev, githunt, productivity
Published: 2020-10-11 06:24:29

#### Not another “Analyzing Apk” Guide.

While developing any large scale application, there are many things we need to keep in check as it grows. App performance, crashes, app size and many other vitals. The best way to keep a track of these vitals is by integrating it with some of our CI tools Jenkins, Fastlane etc.
App Size is one the vital that is easy to keep track on but most of the time it just increases until you spend some time analysing APK and making out what could you possibly reduce. So here I am, making your life a little simple.

#### Introducing, [ApkSize-Analyzer](https://github.com/amank22/ApkSize-Analyzer) (Well, the names kind of same)

It’s a java jar that analyzes your app using the same Android studio tools and gives you some pretty reports (HTML, PDF, JSON)

So why do you need it?
* You can integrate it with your favourite CI/CD tools and keep tracks of many metrics.
* Analyzes Apk for files, dex, resources.
* You can provide a specific app package prefix which will be reported separately for easy classification. This is specially used when you have a large app and with multidexing, your packages are in separate dex and it’s hard to read the consolidated sizes.
* The report list a separate list of images (jpeg, webp) sorted with size so you can always keep track of image sizes and add restrictions & checks for it.
* Write your own logic, generate a report according to your needs.


The package is highly customizable and you can read all the parameters that it can accept in the Github readme.

Do try it analyzing your APK. Give a star, report bugs and help expand this project.

{% github amank22/ApkSize-Analyzer no-readme %}

__Sample Reports__: https://github.com/amank22/ApkSize-Analyzer/tree/main/samples
Parallel features with Git
Tags: github, git, python, opensource
Published: 2020-10-11 06:14:45

### Summary
I worked on two feature at the same time and then merged it with master branch. Just a recap, the project is a cli tool that check healthy links in HTML files.
[Repo link](https://github.com/HenryZerocool/henz-cli)
[Merge commit](https://github.com/HenryZerocool/henz-cli/commit/13108cebb2ca9b6394b6694bc1e9668ff69998b0)

### Features
First new feature was giving option for users to choose whether they prefer colored output or non-colored output. Second new feature was giving option for users to choose only view healthy links or only bad links or all links.

### Challenges
Adding more options/flags so far for me is add more nesting if checks. Second challenge was working on two feature parallelly and later on merged them. Merging is simple so far but in my experience, it's one of the most painful task in collaboration.

### Lessons
I want to code better when adding more features. I cannot keep adding more nested if check for print every time.
dataSnapshot could not get parent push key value
Tags: android
Published: 2020-10-11 05:50:50

I want dataSnapshot to check if "month" exist in its parents "summary". But dataSnapshot is returning that it does not have "month" in "summary"

My Firebase Database: I want to check the value (blue line) from its parent(red line)

code:
ds = FirebaseDatabase.getInstance().getReference("summary");
 ds.addListenerForSingleValueEvent(new ValueEventListener() {
                            @Override
                            public void onDataChange(DataSnapshot dataSnapshot) {
                                //summary
                                String key = ds.getKey();
                                if (dataSnapshot.hasChild("month")) {

                                    Toast.makeText(newTransaction.this, "got value", Toast.LENGTH_LONG).show();
                                } else {
                                    Toast.makeText(newTransaction.this, "No value", Toast.LENGTH_LONG).show();
                                }
                            }
Do you think GitHub Actions has an overwhelm problem?
Tags: github
Published: 2020-10-11 05:41:18

I’ve spent the past week getting pretty into [GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions), and I think overall it’s a really great automation framework with a dev focus. Find some links I gathered along the way on my [linkblog](https://links.markjgsmith.com/archives/html/2020/10/#10October2020).

The other feeling I got was overwhelm, and I’ve been building workflows for years. There are just [so many workflows](https://github.com/sdras/awesome-actions) built, all doing something slightly different. Perhaps it’s because there isn’t much in the way of a visual UI, though as a developer I actually like the fact that it’s all text files stored in the repo.

I think maybe it’s a bit difficult to conceptualise and plan bigger workflows using the tools available.

Have you found it difficult to put together larger multi job/workflow workflows? What do you think would make it easier?
Updating Iframe height based on his content.
Tags: iframe, postmessage, vue, javascript
Published: 2020-10-11 05:40:40


## Introduction

I know I know we need to avoid use Iframes. But when our client need it... We use it.

Last week, one of my clients complain that his iframe was showing the scrollbar when his height content changes because of the iframed-site-responsivity

Well, that is e real problem. But how to change the iframe height if the host-site doesn't know when the iframe content was updated?

![iframe without auto-height ](https://media.giphy.com/media/6217uC0bdyeNJw9jI9/giphy.gif)

After some research I found a possible solution using the window.postMessage, and here goes it:

## Workflow information

Basically, the idea is recursively to send a postMessage from the 'guest-page' as a signal notifying the actual page height. Now on the other side, the 'host-page' needs to has a listener, catching the message and updated the iframe height.

## The code from guest-side

Here I'm using the vue. The most important lines are:
* line 13: i set the ref of object I want to get the height.
* line 46: I use the method `iframeHeightNotify` to get the page-height by ref and send the postMessage.
* line 39: I set the page to recursively send the height.
* line 43: I finish the recursive operation ;

**IMPORTANT:** As recommended by [Mozzila](https://developer.mozilla.org/pt-PT/docs/Web/API/Window/postMessage) it is not a good choice send messages using broadcast ( the * at line 50), by here is just a sample, set the target origin and validate it on the host side it is on you. 

{% gist https://gist.github.com/getJv/341632f70d1a00db00f58d736b98dac1.js %}

## The code from host-side

Here I'm using the HTML and Jquery. The most important lines are:
* line 16: I set an id to my iframe
* line 7: I set the Listener and update the iframe height based on the incoming message

{% gist https://gist.github.com/getJv/964314d457669e4cf012bd22c34f26a5.js %}

## Final result

And here is the final result

![iframe with auto-height ](https://media.giphy.com/media/EF5S1xVIndLVl4eN3h/giphy.gif)

I hope this content be useful to you. 
My best wishes See you.
Depth-First Search (DFS) with Python
Tags: python, datastructure, algorithms
Published: 2020-10-11 05:22:25

Given a Node class that has a name and array of optional children nodes. When put together, these nodes form a tree-like structure. 

```python

class Node:
    def __init__(self, name):
        self.children = []
        self.name = name
    def addChild(self, name):
        self.children.append(Node(name))
        return self
    def depthFirstSearch(self, array):
        array.append(self.name)
        for child in self.children:
            child.depthFirstSearch(array)
        return array
```
I made a thing (machi koro clone)
Tags: showdev, webdev, learning, challenge
Published: 2020-10-11 05:20:43

---
title: I made a thing (machi koro clone)
published: true
description: A clone of Machi Koro with vanilla JS, CSS and HTML
tags: showdev, webdev, learning, challenge
//cover_image: https://direct_url_to_image.jpg
---

I just wanted to put this out there. I suck at design but I wanted to prove some things from a programming perspective.

If you've played Machi Koro the board game, you'll know what this is.

The README in the github explains what I was trying to accomplish. Essentially I wanted to see how far I could go with vanilla JS, CSS and HTML using web components and CSS variables. Some of the stuff in here is kinda cool!

[Github](https://github.com/spirodonfl/machi-koro) and [live demo](https://spirofloropoulos.com/machikoro/)