teleren/devto huggingface dataset:
Run Redis as Kubernetes Pods
Published: 2020-12-21 08:58:37

## Prerequisite:

Ensure that Kubernetes(atleast 2-node cluster) is installed in your system



## Verify Kubernetes components:


```
$ kubectl get componentstatus
NAME                 STATUS    MESSAGE             ERROR
controller-manager   Healthy   ok
scheduler            Healthy   ok
etcd-0               Healthy   {"health":"true"}
[node1 kubelabs]$
```



## Configuring Redis using a ConfigMap:

You can follow the steps below to configure a Redis cache using data stored in a ConfigMap.


```
[node1 kubelabs]$ curl -OL https://k8s.io/examples/pods/config/redis-config
```

First create a kustomization.yaml containing a ConfigMap from the redis-config file:


```
[node1 kubelabs]$ cat <<EOF >./kustomization.yaml
> configMapGenerator:
> - name: example-redis-config
>   files:
>   - redis-config
> EOF
```


## Add the pod resource config to the kustomization.yaml:

```
apiVersion: v1
kind: Pod
metadata:
  name: redis
spec:
  containers:
  - name: redis
    image: redis:5.0.4
    command:
      - redis-server
      - "/redis-master/redis.conf"
    env:
    - name: MASTER
      value: "true"
    ports:
    - containerPort: 6379
    resources:
      limits:
        cpu: "0.1"
    volumeMounts:
    - mountPath: /redis-master-data
      name: data
    - mountPath: /redis-master
      name: config
  volumes:
    - name: data
      emptyDir: {}
    - name: config
      configMap:
        name: example-redis-config
        items:
        - key: redis-config
          path: redis.conf
```



Apply the kustomization directory to create both the ConfigMap and Pod objects:


```
[node1 kubelabs]$ kubectl apply -k .
configmap/example-redis-config-dgh9dg555m created
pod/redis created
```

## Examine the created objects by


```
kubectl get -k .
NAME                                        DATA   AGE
configmap/example-redis-config-dgh9dg555m   1      33s

NAME        READY   STATUS    RESTARTS   AGE
pod/redis   1/1     Running   0          33s
[node1 kubelabs]$
```



In the example, the config volume is mounted at /redis-master. It uses path to add the redis-config key to a file named redis.conf. The file path for the redis config, therefore, is /redis-master/redis.conf. This is where the image will look for the config file for the redis master.
Use kubectl exec to enter the pod and run the redis-cli tool to verify that the configuration was correctly applied:

```
[node1 kubelabs]$ kubectl exec -it redis -- redis-cli
127.0.0.1:6379> CONFIG GET maxmemory
1) "maxmemory"
2) "2097152"
127.0.0.1:6379> CONFIG GET maxmemory-policy
1) "maxmemory-policy"
2) "allkeys-lru"
127.0.0.1:6379>
```

## Delete the created pod:


```
$ kubectl delete pod redis
pod "redis" deleted
```
Autocomplete With Images And Custom HTML Code Using Jquery UI?
Tags: javascript, html, php
Published: 2020-12-21 08:55:56

Today I will learn how to set an autocomplete jquery example with an image. generally, you will use autocomplete in jquery with name, email, message, etc. text but if you want to add images or your own HTML code like user HTML tag in autocomplete then you have to use "_renderItem" in jquery UI. how you will create I give you an example of an HTML file :

**[Autocomplete With Images And Custom HTML Code Using Jquery UI?](https://www.phpcodingstuff.com/blog/autocomplete-with-images-and-custom-html-code-using-jquery-ui.html)**
Responsive Footer using HTML CSS
Tags: rsponsivefooter, footersection, footerdesign, footerforwebsite
Published: 2020-12-21 08:47:06

Hello Readers, welcome to my other blog, today in this blog I'm going to create a Responsive Footer by using HTML & CSS only. Earlier I have shared How to create a Responsive Navigation Menu and now it's time to create a footer section.

In simple language, the footer is a section or full box which exists at the bottom of any type of webpages with important hyperlinks, information, and message or subscribe box. Footer is the most important section for all the websites. Footer can be depended upon the types of the webpage.

As you can see on the image which is given on the webpage. There are various important topics there like About us, Our services and subscribes, some social media icons, and a contact section for easy connection. I want to tell you that it is fully responsive. Responsive means this program is fit in all screen devices like tablet, small screen laptop, or mobile devices.

You Can Download all Source Code Files From the Given Link. <a href=”https://www.codinglabweb.com/2020/12/responsive-footer-html-css.html”>Click Here to Download Source Code Files.</a>
Coding websites
Tags: hackerrank, coding, codingwebsite, leetcode
Published: 2020-12-21 08:43:17

Most companies use coding challenges to asses candidate's technical abilities. In most cases, they put this assessment prior than any other interview or discussion. Many developers have gone through processes of a few challenges like this.

Process usually starts with decision of developer about what programming language they are comfortable with. People may prefer JavaScript, C++, Python or anything else. Then a problem is presented in a task format. Candidate is asked to solve the problem with the preferred language. Usually this is a pure problem solving effort which finally leads to develop an algorithm.

The whole process is taking place in a special website. Such websites may provide an online IDE with some features like intellisense or just provide a way to upload the final source code. Some of them have automated tests which indicate if your code works expectedly or not.

Coding websites are not dedicated to interview questions only. Many of them have an assessment path which is like a learning course or like a tournament. People can register for, and follow each step. By this, they increase both their coding skills and their rank. It's common for companies to hire from high rank members of the website.

Not all coding challenges are problem-solving only. Some challenges are based on technologies rather than algorithms. For instance, they may be based on React.js, Laravel or Django.

[HankerRank](https://www.hackerrank.com/) is one of coding website which support most of the features described here. Another ones are [Skillenza](https://skillenza.com/), [CodeChef](https://www.codechef.com/), [LeetCode](https://leetcode.com/) and, [Quera](https://quera.ir/).

Do you know any other coding website?
Have you ever used Airtable for data?
Tags: watercooler, database
Published: 2020-12-21 08:38:07

---
title: Have you ever used Airtable for data?
published: true
description: 
tags: watercooler, database
cover_image: https://softwareengineeringdaily.com/wp-content/uploads/2019/05/Airtable.png
---
[Airtable](https://airtable.com/) combines the simplicity of a spreadsheet and the power of a database. The main benefits are its familiar collaboration space, simple-to-use interface, and customizable system. 

Have you ever used it for your projects as a data source?
How to create Magento 2 git patch and apply.
Tags: magento, git
Published: 2020-12-21 08:30:16

There are times where it is not possible to override an core function or a possible github fix for an issue in Magento, and you are not updating the current version to get the fix.
Times like these where git patches comes to the rescue.

The basic syntax for apply git patches
`git apply <location-of-your-patch-file>`

Suppose we are ought to modify the file 
`vendor/magento/module-customer/Block/CustomerData.php` and create a custom patch.

1. Create a copy of that file in the same location
`vendor/magento/module-customer/Block/CustomerDataModified.php`
2. Modify the changes in the new file and save it.
3. At this point, the vendor folders are ignored and you want to force git to find difference between two files, so we run the command
`diff -u CustomerData.php CustomerDataModified.php > diff.patch`
This will generate a file 'diff.patch' in your root directory.
Bitcoin Mempool — Simply explained
Tags: technology, education, bitcoinmining, bitcoin
Published: 2020-12-25 10:57:35

---
title: Bitcoin Mempool — Simply explained
published: true
date: 2020-12-21 08:24:40 UTC
tags: technology,education,bitcoinmining,bitcoin
canonical_url: https://medium.com/coinmonks/bitcoin-mempool-simply-explained-7f76be235e85
---

[![](https://cdn-images-1.medium.com/max/700/0*UBB7E4EX08OkZy6Z.jpg)](https://medium.com/coinmonks/bitcoin-mempool-simply-explained-7f76be235e85?source=rss----721b17443fd5---4)

In 2020, 11 years after Bitcoin's official birth, we hardly deal with Bitcoin's fundamental technology.

[Continue reading on Coinmonks »](https://medium.com/coinmonks/bitcoin-mempool-simply-explained-7f76be235e85?source=rss----721b17443fd5---4)
How to Quickly Setup a Hashnode Blog on an Existing Netlify app
Tags: hashnode, blog, netlify
Published: 2020-12-21 07:11:46

<sub>Originally posted on https://blog.zencoder.xyz</sub>
<br>

How do you connect your exisiting app on Netlify with Hashnode?
<br>

* Log in to your  [Netlify ](https://www.netlify.com/) Dashboard and select the app you want to connect.


![Screenshot 2020-12-17 135959.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1608210089126/3Dv59AAiQ.png)
<br>


* Click on **Domain Settings**

Under **Custom Domains** section, select the DNS Panel from your primary domain options.


![Screenshot 2020-12-17 140311.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1608210269249/DyJ9D0eb-.png)
<br>


* Click on "Add a New Record" and enter the following DNS Settings

> Record Type:  **CNAME**

> Name: **blog** *or any subdomain of your choice*

> Value: **hashnode.network** 


![Screenshot 2020-12-17 140641.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1608210427417/jAmmOPdKp.png)
*Silly me. There's a typo in the value field in the image, use* **hashnode.network**

<br>
<hr>
<br>

That wasn't hard. Now, let's head back to Hashnode and update your settings.

* Go to your Hashnode dashboard **Domain** section


![Screenshot 2020-12-17 141116.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1608210712506/rG82KQZVX.png)
<br>


* Update your domain name to fit with the settings from [Netlify ](https://www.netlify.com/):

![Screenshot 2020-12-17 141226.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1608210799728/7OAxohxtM.png)
<br>

That's all. Easy breezy!

Note that DNS propagation may take within 24 hours, or less. *Hit refresh on your new subdomain to check* 

If you found this post helpful. Please share and discuss with me in the comment session.
unable to rendering the component 
Tags: react, javascript, reactcomponent, help
Published: 2020-12-21 07:54:39

I am working on the t-shirt store application . In which there are Admin controls the all the categories of products and the all of the products . I created ManageProducts component which handle the updating and delating the products by the admin . When I render it without any function it works properly and displaying all of the buttons . But when I add the mapping function in it, it does not displaying buttons and the products details . Also there is no any error in console ... 
Here is the code https://codeshare.io/5eEzeK
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2f1vllsxmavam5qfoikf.PNG)
Please anyone help me to sort out this problem...
DO Hackathon: Data Processing
Tags: dohackathon, python, todayilearned
Published: 2020-12-21 07:53:40

# Data Processing

![Minion gif](https://media.tenor.com/images/415e57a7f0da39a982c3015616a347ca/tenor.gif)

Welcome back to my adventures with DO hackathon.

Probably here comes the craziest part of the development process.

![Excel data](https://dev-to-uploads.s3.amazonaws.com/i/m8mppq9peoqqkqk6xnu6.png)


Seems interesting right. I got this data from the business team.

## Here is a little expectation v/s reality check

### Expectation:
Each company/division is a separate sheet in the excel file. I need to do a little processing and then save em all in the database (firestore).

### Reality:
As you saw in the screenshot everything is in a single file. I had to use my python skills, extracted them and saved them in the firestore.

I want my code to look really clean and beautiful. So I decided to sprinkle a tad bit of clean code architecture on the python script application.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1pv50vxyigmheeo4aosd.jpg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/n7n4jvwepirn1vhkw0yr.jpg)

Not trying to beautify things much, just showing how the thinking process went. Let's put in this way, handwriting and ideas scribbling don't probably go hand in hand with each other.

[Python part of the github repository](https://github.com/Rohithgilla12/BPDProductList/tree/master/python/product-list)

This project structure uses **poetry** as the package manager.

If want to learn more about python package managers please do check this 

{% link https://dev.to/gillarohith/package-managers-in-python-206j %}


Modules used for excel processing

- pandas
- xlrd

**jsonpickle** module to obtain serializability.

Other misc modules can be found in the `pyproject.toml` which helped to achieve code quality.

`google-cloud-firestore` for firebase connectivity.

Finally, the data in the firestore looks like this

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/kzyqupovaz0qgki54tn3.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yqgpk2095nlv0clpx7y3.png)

In the next post, I will be describing how the web application was built.

![See ya soon](https://media.tenor.com/images/25f9b698dde6ef03280ff1458b12f7fe/tenor.gif)

Peace ✌🏻
Rohith Gilla
Connect to external mysql server via phpMyAdmin
Tags: phpmyadmin, pma, host
Published: 2020-12-21 07:43:20

## Background

After I deployed my phpMyAdmin to my kubernetes cluster and ran it, I was astonished by the UI, which only allows you type username and password, there is no way to input my mysql server's host!

## Analysis

Seems phpMyAdmin by default only allows you connect to mysql server deployed in the same machine with the phpMyAdmin itself, in terms of this I would say I love adminer more!

## Solution

You need to set `PMA_HOST` to your mysql server host before running the phpMyAdmin instance.

So if you are deploying your phpMyAdmin to your kubernetes cluster, you should edit the `deployment.yaml` as follows:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: phpmyadmin
    tier: backend
  name: phpmyadmin
spec:
  minReadySeconds: 5
  selector:
    matchLabels:
      app: phpmyadmin
      tier: backend
  template:
    metadata:
      labels:
        app: phpmyadmin
        tier: backend
    spec:
      imagePullSecrets:
        - name: harbor-odp
      containers:
        - image: "phpmyadmin"
          env:
            - name: PMA_HOST
              value: your-my-sql-db.yourhost.com.cn
          imagePullPolicy: Always
          name: phpmyadmin
          ports:
            - containerPort: 80
              name: http
              protocol: TCP
          resources:
            limits:
              cpu: 500m
              memory: 128Mi
            requests:
              cpu: 250m
              memory: 64Mi

```
Understanding Docker: part 23 – Tools: hub-tools
Tags: docker, devops, beginners, cloud
Published: 2020-12-21 07:33:29

---
title: Understanding Docker: part 23 – Tools: hub-tools 
published: true
description: Serie of sketchnotes about Docker. Explaining in a visual way Docker principles.
tags: Docker, DevOps, beginners, Cloud
series: Understanding Docker in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/pr9bixpurlwyygglci7r.jpeg
---

Understanding Docker can be difficult or time-consuming. In order to spread knowledge about Cloud technologies I started to create sketchnotes about Docker. I think it could be a good way, more visual, to explain Docker (and other technologies like Kubernetes and Istio).

We continue the series of Docker sketchnotes with a focus about an useful and experimental CLI tool: hub-tool.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pr9bixpurlwyygglci7r.jpeg)

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).

If you are interested, I published all the sketchnotes on Docker (and new ones!) to make a "book" of 93 pages: ["Understanding Docker in a visual way"](https://gumroad.com/aurelievache#YTLzM).
Modern CRM in Ruby on Rails — Part 2
Tags: ruby, rails
Published: 2020-12-21 07:31:30

We’re continuing the series on building a Customer Relationship Management system with Ruby on Rails.

## In this tutorial we will
* Set up Invoker
* Integrate Webpacker with ActiveAdmin
* Use a modern theme for ActiveAdmin

[Read more](https://medium.com/modern-rails/modern-crm-in-ruby-on-rails-part-2-adding-a-theme-1cfea0995759)
Create Setup in such a way so that System A can ping to  B and  C but both should not be pinging each other(Don't use firewall) 
Tags: linux
Published: 2020-12-21 07:28:44

I have Solved this problem Statement and also written an blog on it ... Hope You All Enjoy it .

Blog Link :- https://shashwatsingh71.medium.com/create-a-network-topology-setup-in-such-a-way-so-that-system-a-can-ping-to-two-systems-system-b-b9b73765ad07
Contribute Your Code for our Django Project
Tags: django, python, opensource, github
Published: 2020-12-21 07:21:10

Our project Django CRM is an open-source CRM developed in the Django framework. We welcome code contributions and feature requests via GitHub. We would be immensely happy if you give your precious time to our Django project.
Visit us @ https://github.com/MicroPyramid/Django-CRM
PDO Exception
Tags: php, laravel, mysql, sql
Published: 2020-12-21 07:11:30

PDO Exception for Memory exhausted Due to SQL connection issue while trying to connect database.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zqkyzbmvg8u6ihd2cifp.png)
In .env file we need to be specific about the credentials using for accessing the Database otherwise while running that the application can cause the server load and the memory limit  related Error.
We can use that using the PHPUnit testing the connection in phpunit.xml to check if the credentials are used in the application or not.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3ue1ox5dtonobim04y2m.png)
Software Engineering the Sustainable Way!
Published: 2020-12-21 06:58:50

##Why Sustainable?

As studies show industries are responsible for more than 30% of global CO2 emissions, so there is a need for sustainability wherever possible.

> This is the past year's analysis of one minute of social applications we use on daily basis.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yfa3whsln8sh41s8wmiz.jpeg)

Everyone thinks that there is actually code that runs these applications, that is true but to run that code we need dedicated servers, like your PC on which you explore all the stuff.
But, we never gave a thought regarding that the amount of time we spent on the internet actually started contributing to pollution.



##HOW
That's a question to ponder upon

> This is the basic overview of an application deployed on the cloud.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/026l2i7x0nk2ln7vbyyl.png)

An application needs:
* Storage
* Database
* Compute
* Network
* Infrastructure

A server is needed that can fulfill all the requirements, a server emits heat and the ambient temperature for a server room is b/w 20-21 Celsius otherwise there is a chance that they can fail.
So to keep the temperature different kinds of cooling technologies are used which leads to carbon emissions.

* Datacenter contributing to global emissions

> Study shows a datacenter produces nearly 150 million metric tons of carbon emissions per year. Equal to the annual output and pollution of 50 coal-fired power plants.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0cd8d6lvtg1zrekncgxx.png)

It has been reported that the global carbon footprint of the ICT industry accounts for more than 2% of global carbon emissions

>So more the application usage, more is the server usage hence more emissions.

So that is why there is a need for sustainable software engineering to develop sustainable software applications.

###Consideration while building applications
* Applications that are carbon efficient.
* Applications that are energy efficient.
* Applications that can run on older hardware.
* Reduce the amount of data and distance it must travel across the network.
* Run servers at a high rate of utilization.

###How To Apply
**Architecture Approach:**
* Going Serverless
* N-Tier Architecture
* Event-driven architecture
* Using Microservices 

  > For example Azure serverless architectures such as Azure Functions

**Infrastructure Approach:**
* Virtualized Servers
* IAAS
* PAAS
* Green Data Center

> **Examples:**
* Azure.com uses Serverless Functions, which reduced the always-on electric footprint.
* AWS gearing up for renewable energy sources for its centers.
* GCP Using AI to define actions based on the usage, emissions calculations which can minimize further emissions.

Image Credits: Google Photos
How do you split a Word document into separate pages?
Tags: dotnet, csharp, tutorial, java
Published: 2020-12-21 06:56:47

We could split a Word document to separate pages by specifying start and end page number. Secondly, by specifying exact page numbers.
Let’s see both cases in .NET and Java:

**Split the document to several one-page documents (by exact page numbers)**
*.NET*
```csharp
string filePath = @"c:\sample.docx"; 
string filePathOut = @"c:\output\document_{0}.{1}"; 
 
SplitOptions splitOptions = new SplitOptions(filePathOut, new int[] { 3, 6, 8 }); 
            
using (Merger merger = new Merger(filePath)) 
{ 
     merger.Split(splitOptions); 
}  
```
*Java*
```java
String filePath = "c:\sample.docx"; 
String filePathOut = "c:\output\document_{0}.{1}"; 
 
PageSplitOptions splitOptions = new PageSplitOptions(filePathOut, new int[] { 3, 6, 8 }); 
Merger merger = new Merger(filePath); 
merger.split(splitOptions); 
```
Have a look at [.NET](https://docs.groupdocs.com/merger/net/split-document/) and [Java](https://docs.groupdocs.com/merger/java/split-document/) developers guide. In case of any issue, you could post it on free support [forum](http://forum.groupdocs.com/).
This is Why Python is Easier
Tags: python, django, opensource, programming
Published: 2020-12-21 06:48:18

One of the reasons that I happen to love python is that its easier to write the code.
Take for instance writing a python code that prints Python is simple.
* To write this kind of output in <mark>C++</mark> it is going to be like this:
```C++
#include <iostream.h>
int main()
{
cout<<"Python is simple";
return 0;
}
```
* To write the same output in <mark>Java</mark>:
```Java
class hope{
public static void main(string[]args)
{
system.out.println("Python is simple");
}
}
```
* But to write the sane code in <mark>Python</mark> you only need 1 line of code
```python
print("Python is Simple")
```