teleren/devto huggingface dataset:
Kali on a container
Tags: security, kubernetes, docker
Published: 2021-04-02 15:20:48

If you ask me about Kali some years ago, I must be thinking about Temple of Doom and if you asked me about hacking I would think about that blind man in Sneakers film :P

But joking apart, what can I say to you about Kali?

Kali is a cooked linux release that allows anyone to test pentesting tools. Could be installed as a virtual machine (VirtualBox, Vagrant...), as a boot partition on your computer or be deployed as EC2/VM instance on AWS/GCP/Azure/whatever cloud. These options are OK but it takes a "lot" of time to run, tweak and maintain a Kali system.

Imagine that you want to try a [Kali tool](https://tools.kali.org/tools-listing) and you dont want to install Kali Desktop, there is another option: [Kali Docker images](https://www.kali.org/docs/containers/official-kalilinux-docker-images).

Kali images contains a base image without tools but all them APT repositories are enabled. So it's really easy to install and test anything on them.

Let's try to run some web scanner with [Nikto](https://tools.kali.org/information-gathering/nikto), [DMitry](https://tools.kali.org/information-gathering/dmitry) and [SSLScan](https://github.com/rbsec/sslscan).

First you need to run bash in the Kali docker image:
```bash
docker run -ti --rm kalilinux/kali-rolling bash
```
Now, in this prompted shell we could run as many commands as we need:
```
┌──(root💀616f2bee7ea0)-[/]
└─# 
```
Let's start running some APT commands to install our tools:
```bash
┌──(root💀616f2bee7ea0)-[/]
└─# apt update && apt install nikto sslscan dmitry -y
```
That's it. Tools are been installed. Let's check that are ready to run:
- Nikto
```bash
┌──(root💀616f2bee7ea0)-[/]
└─# nikto -Version                                  
[...]
File                               Version      Last Mod
-----------------------------      --------     ----------
Nikto main                         2.1.6        
[...]
```
- Dmitry
```bash
┌──(root💀616f2bee7ea0)-[/]
└─# dmitry -version
Deepmagic Information Gathering Tool
"There be some deep magic going on"

Version: DMitry/1.3a (Unix)
```
- SSL Scan
```bash
┌──(root💀616f2bee7ea0)-[/]
└─# sslscan --version
                2.0.9-static
                OpenSSL 1.1.1l-dev  xx XXX xxxx
```

Imagine all the possibilities:

- Create your custom Kali images:
```
FROM kalilinux/kali-rolling

RUN apt-get update -qq \
 && apt-get install -qq -y --no-install-recommends \
    nikto sslscan dmitry metasploit-framework
[...]
```

- Run a Kali image into a Kubernetes cluster:
```bash
kubectl run prompt-shell --generator=run-pod/v1 --rm -i --tty --image kalilinux/kali -- bash
```

There are a lot of possibilities here.

Time to have fun. Enjoy!

## Reference
- [DockerHub](https://hub.docker.com/u/kalilinux)
Lockdown Fun: Your Age In Binary
Tags: html, css, javascript, webdev
Published: 2021-04-02 14:32:10

Today I gave my son a piece of paper with this cryptic message: `00001100`. 

“This is you”, I told him – “and *this* is your sister”: `00001111`.

“If you can work this out, I'll pay for your *v-bucks!*”

I gave him a single hint. The word “binary”.

Unfortunately, it only took him 5 minutes to Google the answers: `12` and `15`.

Nevertheless, I made the pen below, and we had a talk about what *binary numbers* are – and how computers work:

{% codepen https://codepen.io/stoumann/pen/MWJpxLy %}

If you have kids, let them click on the circles until the sum equals their age (or their parents age!), and if they're curious – well, then you have an excuse to talk about programming and stuff 😁

Thanks for reading, and Happy Easter!
Speak as if Someone is Listening
Tags: agile, standup
Published: 2021-04-02 14:26:00

I was riding in an uber with my wife long ago and noticed our conversation took on a strange tone. Without any planning, we both began to speak with half our minds taking the point of view of the driver. It's hard to describe, but you'd know it if this has happened to you.

It reminds me of a line from Seneca: "Live among men as if God beheld you; speak with God as if men were listening"

Our minds are great. With each new person that enters a room we can immediately adjust what we say to accommodate a level of empathy for how that person will understand or react to what we are saying.

Recently my manager and tech lead are only coming to two standups per week. The other three standups are markedly different. With less people in the room and no manager it's easier to open up and express oneself in a clear manner. If you don't have an open space like this for your team, I do highly recommend finding it.
Join vs includes vs eager load vs preload
Tags: rails, ruby
Published: 2021-04-02 14:22:12

# Intro

Per [rails guides](https://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations)
```
Eager loading is the mechanism for loading the associated records of the objects returned by Model.find using as few queries as possible.
```

This is the API that rails give you to avoid N + 1 queries.
* includes
* joins
* preload
* eager_load

## Reference

|            | SQL contains join | Load associated record in memory | Performs two queries |
|------------|-------------------|----------------------------------|----------------------|
| joins      | yes (inner join)  | no                               | no                   |
| preload    | no                | yes                              | yes                  |
| includes   | yes (left join)   | yes                              | sometimes            |
| eager load | yes (left join)   | yes                              | no                   |



## Joins
- Only affects the SQL query
- doesn’t load related data into memory
```ruby
pry(main)> u = User.joins(:alerts).first
  User Load (1.4ms)  SELECT "users".* FROM "users" INNER JOIN "alerts" ON "alerts"."user_id" = "users"."id" ORDER BY "users"."id" ASC LIMIT $1  [["LIMIT", 1]]
...
pry(main)> u.alerts
  Alert Load (0.6ms)  SELECT "alerts".* FROM "alerts" WHERE "alerts"."user_id" = $1  [["user_id", 2]]
...
```

## Preload
- Load associated data into memory
- User.preload(:posts) executes two queries
```ruby
pry(main)> u = User.preload(:alerts).first
  User Load (0.4ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1  [["LIMIT", 1]]
  Alert Load (0.3ms)  SELECT "alerts".* FROM "alerts" WHERE "alerts"."user_id" = $1  [["user_id", 1]]
=> #<User id: 1, email: ...
pry(main)> u.alerts
=> []

```

## Includes
- Performs outer left join and store the associated result in memory.
- Sometimes generate one query and sometimes generates 2 queries.
- If you want to force to use a single query you can add `.references`

```ruby
pry(main)> u = User.includes(:alerts).first
  User Load (0.4ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1  [["LIMIT", 1]]
  Alert Load (0.2ms)  SELECT "alerts".* FROM "alerts" WHERE "alerts"."user_id" = $1  [["user_id", 1]]
=> #<User id: 1, email:...
pry(main)> u.alerts
=> []


pry(main)> users = User.includes(:alerts).references(:alerts)
  SQL (12.7ms)  SELECT "users"."id" AS t0_r0, t1_r1, "alerts"."user_id" AS t1_r2, "alerts"."date" AS t1_r3,... FROM "users" LEFT OUTER JOIN "alerts" ON "alerts"."user_id" = "users"."id"
=> [#<User id: 2, ...
pry(main)> users.first.alerts
=> [#<Alert:0x00007fc279e76128
  id: 1,
...
```

## Eager Load

- Load data in memory
- Performs SQL join
- Forces to use a single query
- Some times takes more time than two queries

```ruby
pry(main)> users = User.eager_load(:alerts)
  SQL (14.0ms)  SELECT "users"."id" AS t0_r0, ... FROM "users" LEFT OUTER JOIN "alerts" ON "alerts"."user_id" = "users"."id"
=> [#<User id: 2, ...
pry(main)> users.first.alerts
=> [#<Alert:0x00007fc269b87d78
  id: 1,
  ...
```
These VS Code extensions  help you fix accessibility and compatibility bugs while you code
Tags: a11y, vscode, webdev
Published: 2021-04-02 14:17:53

webhint is a VS Code extension that checks your web code for accessibility, compatibility, security, and performance pitfalls. The Error Lens VS Code extension brings code warnings out of the Problems pane and next to the affected line. Used alone or together, they ensure you'll fix a whole host of code issues before you even close the `</tag>`!

---

For the past year and a half or so, I've been contributing to [webhint](https://webhint.io), an open-source project that collects best practices and suggestions from sources such as [axe-core](https://github.com/dequelabs/axe-core) and [MDN](https://github.com/mdn/browsercompat) into a single tool. You can think of it kind of like a linter for the web, giving you real-time feedback in areas such as cross-browser compatibility, accessibility, performance, and security. 

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l27oouja36jw1y863lmu.png)
<figcaption>Nellie, the official webhint mascot</figcaption>

---
 
I love using the [webhint VS Code extension](https://webhint.io/docs/user-guide/extensions/vscode-webhint/) because it helps me fix mistakes *while* I'm coding. It analyzes HTML, CSS, JS, TS, JSX, and more. As with other VS Code linters, webhint messages appear in the Problems pane in VS Code.


![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ewyvl0yoe445w0yfp67s.png)
<figcaption>webhint VS Code extension</figcaption>

---

I recently discovered another VS Code extension called [Error Lens](https://github.com/usernamehw/vscode-error-lens). Error Lens takes messages published to the Problems pane and inlines them with your code. It's also configurable via a variety of provided `errorLens.` settings.

Using the webhint and Error Lens extensions together creates an all-new experience. Now, I can see webhint feedback on a11y, compat, and more, right on the line where the error occurs! 😍


![webhint-errorlens](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/el3n1hf7k9y6mxfmdf4k.gif)
<figcaption>This accessibility warning from webhint appears as I type and disappears when I fix the issue</figcaption> 

---

Search "webhint" and "Error Lens" in the VS Code extensions tab to install them both.

webhint is available as a [CLI](https://webhint.io/docs/user-guide/), a [browser extension](https://webhint.io/docs/user-guide/extensions/extension-browser/), and a [VS Code extension](https://webhint.io/docs/user-guide/extensions/vscode-webhint/). It's even built in directly to the [Microsoft Edge browser](https://www.microsoftedgeinsider.com/)'s DevTools. If you're interested in contributing to webhint, come [find us on GitHub](https://www.github.com/webhintio/hint)!
Git : Revert your mistake
Tags: git, gitrevert
Published: 2021-04-02 14:17:20

Today we will understand how to revert any mistake we do when we checkin our code to git hub. 
[Video reference](https://youtu.be/94wlAdICXXc)

###We have below log in our github.

 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n24v23swme2vcsqk5vqh.PNG)
The above image has
1) The hash for latest code commit
2) commit message of latest commit
3) commit message of the code we need to revert to.

###Issue:
We have commited (88e1246c30427b624c48dfb0012b27c55e8e6f1e) hash in github repository. This commit has some error and we need to revert the code back to commit (05f4be112f24cc1a9f0922f2c9a9297be429f55b)


### Resolution:
1) git revert 88e1246c30427b624c48dfb0012b27c55e8e6f1e
This will revert the code base in your local system and NOT in git repository.

2) git push origin master
The above command is to upload the changes to git repository. 

Advantage of this command is it helps to keep the log of the revert done as shown below.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/37dqyok9tg4im1huxfj0.PNG)

####Thanks for reading till here. if you like the article don't forget to subcribe my channel. [My Channel Link](https://www.youtube.com/channel/UCajNSAb41SHFYAsCJxUKIMw?sub_confirmation=1)

####Video Link on Git :
<a href="http://www.youtube.com/watch?feature=player_embedded&v=94wlAdICXXc" target="_blank"><img src="http://img.youtube.com/vi/94wlAdICXXc/0.jpg" alt="GIT REVERT" width="240" height="180" border="10" /></a>
Recent Bootcamp Grad..AMA
Tags: bootcamps, softwareengineering, juniorengineer, fullstack
Published: 2021-04-02 13:55:48

Aspiring Devs or those considering attending a bootcamp...

I recently graduated from a cohort at General Assembly. I've went the self-teaching route on/off for a few years. I've attended college as a Computer Science major, and last but not least I decided to go the bootcamp route.

If you're on the fence about a bootcamp, feel free to ask me anything and I'll give it to straight, no fluff.
My First (Mock) Technical Interview: SKILLED, INC
Tags: javascript
Published: 2021-04-02 13:53:16

As a graduate of the Flatiron School, you will be asked to complete a mock technical interview. You are gifted a token (free interview) for Skilled Inc, a technical interviewing startup. 

Their motto is:"The world's Outcomes company. Our experts interview, educate and certify job seekers to help them get hired."

You have the option upon passing a technical interview to be considered "certified" by their team and alert potential employers.

I chose not to alert employers, as I had not started my job search and was still putting together my materials. 

One of the best aspects of Skilled is that they team you up with a senior engineer from a reputable company. These engineers have extensive experience interviewing potential candidates, and bring that expertise and experience to Skilled.

I chose to interview in Javascript, which funny enough, I felt at that point, was slightly weaker than my Ruby skills. However, I wanted to challenge myself, since this was not an official job interview, and I wanted to assess my frontend abilities. 

I was a paired up with a senior engineer from a very well known company. You would think this would be incredibly intimidating, but he was the kindest, warmest engineer I'd ever met! Whew! As soon as we began, my nerves melted away.

The 60-min session is set up to mimic a typical technical but also include moments where the engineer gives you candid advice and insight about what he typically is looking for. 

At first, we worked on CSS and HTML, which was a bit of a surprise since I was expecting only Javascript. The interviewer gave me an aside that this is very typical in terms of Javascript interviews. I had to rack my brain a little bit, but was able to answer all of the questions and coding challenges. This was great information to know for the future! 

We then went over a Javascript coding challenge which involved array manipulation. It was pretty straight forward. But one thing interviewer challenged me on was my using my voice! He wanted me to speak aloud about my thought process, as I initially had just start coding silently. This was brilliant advice, in that it encouraged engagement and let the interviewer in on my problem-solving skills.

I passed the interview. But I will continue working on my skills. This Skilled interview was a great introduction into the hiring process. And future Javascript interviewees*: get ready to have to complete CSS and HTML challenges as well! And remember, think your problem-solving thoughts out loud!
🚀10 Trending projects on GitHub for web developers - 2nd April 2021
Tags: react, javascript, webdev, graphql
Published: 2021-04-02 13:50:50

Trending Projects is available as a weekly newsletter please sign up at [www.iainfreestone.com](https://www.iainfreestone.com) to ensure you never miss an issue.

### 1. Crank.js

Write JSX-driven components with functions, promises and generators.

{% github https://github.com/bikeshaving/crank %}

---

### 2. Appwrite 

Appwrite is a secure end-to-end backend server for Web, Mobile, and Flutter developers that is packaged as a set of Docker containers for easy deployment 

{% github https://github.com/appwrite/appwrite %}

---

### 3. Deno Standard Modules

Deno standard library

{% github https://github.com/denoland/deno_std %}

---

### 4. ractive-player

Library for interactive videos in React

{% github https://github.com/ysulyma/ractive-player %}

---

### 5. Altair

A beautiful feature-rich GraphQL Client for all platforms.

{% github https://github.com/imolorhe/altair %}

---

### 6. Spearmint

Testing, simplified. || An inclusive, accessibility-first GUI for generating clean, semantic Javascript tests in only a few clicks of (or keystrokes) of a button.

{% github https://github.com/open-source-labs/spearmint %}

---

### 7. Prism 

Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.

{% github https://github.com/stoplightio/prism %}

---

### 8. git-notify

Communicate important updates to your team via git commit messages

{% github https://github.com/jevakallio/git-notify %}

---

### 9. degit 

Straightforward project scaffolding.

{% github https://github.com/Rich-Harris/degit %}

---

### 10. Memoizee

Complete memoize/cache solution for JavaScript

{% github https://github.com/medikoo/memoizee %}

---

### Stargazing 📈
#### Top risers over last 7 days

1. [ JavaScript Algorithms](https://github.com/trekhleb/javascript-algorithms)  +2,332 stars
2. [Public APIs](https://github.com/public-apis/public-apis)    +1,797 stars
3. [Front-End Checklist](https://github.com/thedaviddias/Front-End-Checklist)  +1,351 stars
4. [Material UI](https://github.com/mui-org/material-ui)  +810 stars
5. [JavaScript Questions](https://github.com/lydiahallie/javascript-questions)  +805 stars

#### Top risers over last 30 days

1. [Web Development for Beginners](https://github.com/microsoft/Web-Dev-For-Beginners)  +5,751 stars
2. [ JavaScript Algorithms](https://github.com/trekhleb/javascript-algorithms)   +4,263 stars
3. [Public APIs](https://github.com/public-apis/public-apis)  +4,058 stars
4. [Free Programming Books](https://github.com/EbookFoundation/free-programming-books)  +3,381 stars
5. [Developer Roadmap](https://github.com/kamranahmedse/developer-roadmap)  +2,801 stars

---

Trending Projects is available as a weekly newsletter please sign up at [www.iainfreestone.com](https://www.iainfreestone.com) to ensure you never miss an issue.

If you enjoyed this article you can [follow me](https://twitter.com/iain_freestone) on Twitter where I regularly post bite size tips relating to HTML, CSS and JavaScript.
Anime Search engine with Reactjs
Tags: react, showdev, javascript, api
Published: 2021-04-02 13:41:21

Hello Devs,

Today I would like to share a project which I had build using ReactJs from scratch using external API.

What App will do?
You can search for any anime series by entering its name.

What you can learn from it?
If you are a beginner in React and API's world then this project is for you.

Link:- https://shaileshparmar-webdeveloper.github.io/anime-search/
Github:- https://github.com/ShaileshParmar-WebDeveloper/anime-search

Suggestions and Improvement ideas are most welcome.
Kind: Tiniest Kubernetes ever!
Tags: kubernetes, devops, docker, linux
Published: 2021-04-02 13:27:04

[Kind](https://kind.sigs.k8s.io) is the smallest, tiniest and funniest Kubernetes runtime I've tried.

Kind could be used for different purposes: to run a local environment, include as a stage on a CD/CD pipeline, test new Kubernetes releases for your OCI compliance images.

Kind requires [Docker](https://docs.docker.com) properly installed on your computer, otherwise it wont deploy anything.

Let's start creating a cluster!

First things to do is install Kind. There are a few ways to install it: Install Go language then run "go get" command or more easy to go, download latest release from the [Github repository](https://github.com/kubernetes-sigs/kind/releases) :D

I already automated this "download" task from my dotfiles, here is the "code":

```bash
mkdir ${HOME}/bin ;\
wget -q https://github.com/kubernetes-sigs/kind/releases/latest/download/kind-linux-amd64 -O ${HOME}/bin/kind ;\
chmod u+x ${HOME}/bin/kind ;\
${HOME}/bin/kind version
```
This will prompt you a message like this:
```bash
kind v0.10.0 go1.15.7 linux/amd64
```

Next step is to create a cluster, to acknoledge this we must run this command:

```bash
CMD> kind create cluster --name tiny-k8s-01
```
![output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/edrbe6gop11d8znlnw45.png)

So, we now have a running Kind K8s cluster!

There a lot of funny features that makes Kind a versatile K8s  tool, like: 

- Run as many K8s clusters as you want:
```bash
for i in {0..4}; do
kind create cluster --name tiny-cluster-0$i
done        
```
Cluster list:
```bash
CMD> kind get clusters

tiny-cluster-00
tiny-cluster-01
tiny-cluster-02
tiny-cluster-03
tiny-cluster-04
```

- Create Kind cluster with different Kubernetes releases:
```bash
CMD> kind create cluster --image kindest/node:v1.19.7 --name tiny-cluster-v19
```
Kind images are aviable in this [DockerHub registry](https://hub.docker.com/r/kindest/node)

There are a lot more features to be used with Kind like Ingress, build images and import into Kind, check your OCI rootless ... 

Enjoy!

References:
- [Kind](https://kind.sigs.k8s.io)
- [Github](https://github.com/kubernetes-sigs/kind)
- [DockerHub](https://hub.docker.com/r/kindest/node)
Interview with Jeremy Evans, Lead developer of Sequel & Roda
Tags: ruby, rails, programming, webdev
Published: 2021-04-02 13:15:21

Jeremy Evans is the lead developer of the Sequel database library, the Roda web toolkit, the Rodauth authentication framework, and many other Ruby libraries. He is the maintainer of Ruby ports for the OpenBSD operating system, and has contributed to CRuby and JRuby, as well as many popular Ruby libraries. We are happy to present a brand-new interview with Jeremy to our readers.

Hope you enjoy it!
Oh My Zsh + PowerLevel10k.
Published: 2021-04-02 13:12:44

Just to let you know that I was chuffed to find this really straight forward set of instructions for Oh My Zsh + PowerLevel10k. Done this install many times but it's impossible to remember things like the install line for oh-my-zsh [sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"] and for the PowerLevel10k theme etc.

I'm using Arch Linux and my terminal that I use is Tilix. Before I install Oh-My-Zsh and PowerLevel10k I make sure that all the necessary (and more) fonts are installed, in no particular order and in what repo to find them: community/ttf-fira-code: aur/nerd-fonts-fira-code: aur/ttf-meslo-nerd-font-powerlevel10k: community/powerline-fonts: community/awesome-terminal-fonts: aur/bedstead-fonts-powerline: It's a bit of over-kill but I never have to look for fonts or have something rendering incorrectly or not rendering at all. Thanks again.Piers.