teleren/devto huggingface dataset:
OverTheWire Bandit Level 6 Level 7 walk-through
Tags: security, beginners, infosec, ctf
Published: 2020-03-05 14:06:35

Challenge page => https://overthewire.org/wargames/bandit/bandit7.html

> The password for the next level is stored somewhere on the server and has all of the following properties:

>    owned by user bandit7
>    owned by group bandit6
>    33 bytes in size


This challenge is very similar to the last one, the only difference being that we will have to search the entire filesystem.

We already know from the [last challenge](https://dev.to/kkaosninja/overthewire-bandit-level-5-level-6-walk-through-50cf) that using the `find` command is the best way to go about this.

___

Once again, what flags of the `find` command are required to search for this file?

*Hint 1*: Searching the man page will be enough to get the flags required
___


Alright then. After searching the man page, we have found the flags.

- `-user bandit7`
- `-group bandit6`
- `-size 33c`

Since the file is "somewhere on the server", we will have to run the search from the root `/` directory.

So the final command would be

`find / -user bandit7 -group bandit6 -size 33c`

Let's execute it then

![find command initial output](https://dev-to-uploads.s3.amazonaws.com/i/lrikbyiwcknl5s6i7b1h.png)

___
Be warned, since the user we used to log in is not `root`, the `find` command will visit a lot of directories which the `bandit6` user does not the permissions to read. So we will encounter a lot of errors.

How do we get the errors out of the way so that we get a "clean" result?

*Hint 2*: A few web searches should yield a result. Read up on streams and I/O redirection
___

If you couldn't figure that out, its ok!

An easy way to get the errors out of the way is to send them to `/dev/null` as follows.

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

Looks like we got it!

What I did there was redirect the "stderr" stream to `/dev/null`, basically discarding it, and therefore ensuring that it does not get printed on the terminal.

Couple of articles to understand this better

- [What Are stdin, stdout, and stderr on Linux?](https://www.howtogeek.com/435903/what-are-stdin-stdout-and-stderr-on-linux/)

- [An Introduction to Linux I/O Redirection](https://www.digitalocean.com/community/tutorials/an-introduction-to-linux-i-o-redirection)

- [What Is /dev/null in Linux?](https://www.maketecheasier.com/dev-null-in-linux/)

Being comfortable with I/O redirection is an important part of being comfortable with the command line. Don't be afraid to get your hands dirty.

Note: A lot of programs will send useful error info to `stderr` in case of failure. So when debugging, and especially if there are a ton of error messages, it is common practice to redirect `stderr` to a file so that you can go through it later to figure out what happened.

Onto the next challenge!
Demystifying Database Migration
Tags: database, webdev, codenewbie, discuss
Published: 2020-03-05 14:04:34

Many of you might be wondering looking at the title that I have chosen to write this post. Well, working in the IT industry and talking about migrations is like talking about a popular commodity in the market. But, for some, it is the worst nightmare that can keep them haunting for ages.  

Indubitably, new technologies have garnered much of the needed tension (pun intended). Their ability to do the in-app migrations with ease has made them really popular nowadays. In fact, they are lazy people's way out. But, what about the applications that require complete database migration???? What are the challenges that are faced while migrating a database? How does the process work?? Curious to know the answers to these questions?? Let’s explore.

##Database Migration Need##

An application would require to move from one database to another only when it is facing issues with the current database. These issues include performance issues, speed of doing tasks, redundant data, technological transformations, and security fixes. Not much to my surprise, security fixes were the major issues that require a firm or organization to switch databases. 

##Database Migration Challenges##

For the applications using heavy databases, the need to migrate the database is more on the verge. Since using a legacy system would make a company susceptible to face difficulty, it becomes challenging to migrate to a completely new database.  
Well, the most common challenges that are being faced by many of the companies which opted for migration include:

- Finding disparate databases (Identification of Databases stored at different places)

- Data Analysis at the earliest (to unveil hidden errors in best possible manner)
Devising a migration strategy

- Lack of Integrated Process (linking inputs & outputs from each stage of the process)

- Data cleaning and coding (data from various places - cleansed, normalized and transformed)

- Not evaluating final results in a timely manner

- Lack of collaboration(sync between in-house and outsourced engineers)

- Take help from data experts

- Securing data and systems

Dealing with these challenges might be tough for some but overcoming those can make the migration process seamless. 

If you wanna dig deeper to know about database migrations, read this blog post here - [What is Database Migration? Understanding Needs and Challenges] (https://www.simform.com/database-migration/). If you have any suggestions up your sleeve, please comment.
Import SVG Directly as a ReactComponent
Tags: react, svg, webdev
Published: 2020-03-05 13:34:16

---
title: Import SVG Directly as a ReactComponent
published: true
description: Use create-react-app to import an SVG icon directly as a ReactComponent.
tags: react, svg, webdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/nnrqidt59rarngppmupa.png
---

I've been working on a React project that uses custom SVG icons and needed a nice way to import these icons. Since I'm using `create-react-app`, I've been able to import SVGs as React components.

```javascript
import React from 'react';
import { ReactComponent as Icon } from './icon.svg';

<Icon />
```
<blockquote>
<p>
<strong>Note:</strong> This feature is only available with <code>react-script@2.0.0</code> and higher, and <code>react@16.3.0</code> and higher.
</p>
</blockquote>

Hey presto!🎉

I can now access them as a normal React component, which saves me hassle.

You can also add props to the React component, just like you would normally. E.g.

```javascript
import React from 'react';
import { ReactComponent as DevIcon} from './dev-brands.svg';
import './App.css';

export const App = () => <DevIcon title="DEV Icon" className="icon" />;
```
<figcaption>App.jsx - Code to import SVG as React Component</figcaption>

```css
.icon {
  height: 24px;
  width: 24px;
}
```
<figcaption>App.css - CSS for the svg icon</figcaption>

```html
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="dev" class="svg-inline--fa fa-dev fa-w-14" role="img" viewBox="0 0 448 512">
  <path fill="currentColor" d="M120.12 208.29c-3.88-2.9-7.77-4.35-11.65-4.35H91.03v104.47h17.45c3.88 0 7.77-1.45 11.65-4.35 3.88-2.9 5.82-7.25 5.82-13.06v-69.65c-.01-5.8-1.96-10.16-5.83-13.06zM404.1 32H43.9C19.7 32 .06 51.59 0 75.8v360.4C.06 460.41 19.7 480 43.9 480h360.2c24.21 0 43.84-19.59 43.9-43.8V75.8c-.06-24.21-19.7-43.8-43.9-43.8zM154.2 291.19c0 18.81-11.61 47.31-48.36 47.25h-46.4V172.98h47.38c35.44 0 47.36 28.46 47.37 47.28l.01 70.93zm100.68-88.66H201.6v38.42h32.57v29.57H201.6v38.41h53.29v29.57h-62.18c-11.16.29-20.44-8.53-20.72-19.69V193.7c-.27-11.15 8.56-20.41 19.71-20.69h63.19l-.01 29.52zm103.64 115.29c-13.2 30.75-36.85 24.63-47.44 0l-38.53-144.8h32.57l29.71 113.72 29.57-113.72h32.58l-38.46 144.8z"/>
</svg>
```
<figcaption>dev-brands.svg - Dev Icon from FontAwesome</figcaption>

### Resources

[Create React App Adding SVGs](https://create-react-app.dev/docs/adding-images-fonts-and-files/#adding-svgs)
[Font Awesome Dev Icon](https://fontawesome.com/icons/dev?style=brands)
How to build a basic website on GitHub with Liquid
Tags: jekyll, liquid, github, beginners
Published: 2020-03-05 13:29:26

Why this post?

Because I could not find any resource that tells me how to build a _basic_ website with Liquid tags on GitHub. Through the GitHub web interface, not through any CLI, whether Jekyll or Git. Without needing to install Jekyll (which isn't officially supported for my Windows machine anyway).

Also because the official Jekyll documentation (and the official Jekyll tutorial) assumes a level of knowledge that I do not have. Also because all the so-called starter packs I found on GitHub (and through Google) have way too many files to be useful to me as a beginner.

So, this post.

This post is for people like me who get frustrated when they encounter something like this:

![Dont tell me how to make a chesterfield when all I want is to make a simple stool](https://dev-to-uploads.s3.amazonaws.com/i/ky7gx052x3uuavzwv6s7.png)

This post assumes you know the basics of HTML and CSS.

GitHub is a source-code repository; it also gives you a webpage for each of your repositories. The intention of this post is to show you how to make use of GitHub's hosting facility to build your website.

GitHub uses Jekyll to render the pages on your website. 

This means, GitHub's publishing engine expects the same directory structure that Jekyll's publishing engine expects. Which is something like this, if you start off with the barest minimum files:

<pre>

- _layouts        # folder to contain HTML templates
  -- default.html
- css             # folder to contain stylesheets
  -- main.css
- topics          # folder to contain pages of the website
  -- page1.html
  -- page2.html
  -- page3.html
- _config.yml    # basic configuration info
- index.html     # landing page of the website

</pre>

Jekyll uses the Liquid template engine to create webpages. This means, you can use Liquid variables in your HTML pages, and during build time, the value of these variables will be inserted onto the page. So, for example, if you have something like this:

`<p>I graduated in {{ grad_year }} and have since worked with {{ company_1 }} ({{ comp1_start_year }} - {{ comp1_end_year }}), {{ company_2 }} ({{ comp2_start_year }} - {{ comp2_end_year }}), and {{ company_3 }} ({{ comp3_start_year }} - {{ comp3_end_year }}).</p>`

it'll be rendered on the page like this:

`I graduated in 2020 and have since worked with WB (2020 - 2025), YOLO (2025 - 2074), and FIK (2134 - 2135).</p>`

You can immediately see the possibilities that Liquid gives you, right? You can almost build dynamic webpages with a static site generator. Almost. Without needing to install or configure anything.

So go ahead, create that GitHub repo and build a website. Once you're comfortable with this basic setup, you can explore the full power of the objects, tags, and filters of Liquid.

If you need a template to take off running, I've created one for the files you'd need: [jekyll-github-starter-pack](https://github.com/AninditaBasu/jekyll-github-starter-pack). It also has a README to help you get started.

Was this useful?
Rust Programming Language: Knows about Pros & Cons
Tags: python, c, android, ios
Published: 2020-03-05 13:02:26

What is Rust?

Rust is a multi-paradigm system programming language which performs C and C++ but with protection to cease the app developers shooting themselves in the foot. It is designed to keep the safety of the application in mind.

The Rust programming language allows the developer to write faster, more reliable software. High-level comfort design and low-level control are often at odds in programming language design; Rust objects that competition.

Rust programming language is used for game engines, operating systems, file systems, browser components and simulation engines for virtual reality.

How do I use it ?

With rust compiler not letting you break your program. Rust download through the rustup. Rustup is a command line tool for managing Rust versions and associated tools.

Why use Rust ?

Rust doesn’t have a runtime or a garbage collector. Rust programming is very fast and memory-efficient and it runs on embedded devices, and easily integrates with other languages.

It is also prone to a high level of control and performance.

Rust has significant documentation, a Powerful compiler with useful error messages, and top-notch tooling — an integrated package manager and build tool, smart multi-editor support with auto-completion and type inspections.
Rust’s rich type documentation system and ownership model guarantee memory-safety and thread-safety. Memory safety allows you to eliminate many classes of bugs while compiling time.

Pros and Cons
Each language has benefits and drawbacks of their own. But as the discussion is going on about the Rust, the benefits of using rust is more than the drawbacks.
Rust has the Strong support of generics with Guaranteed Safety and it’s Complexity of code makes it more beneficial. Rust has Rich patterns and Syntax and supports Easy Integration of C and several languages with no cost abstraction.

Using the rust you can Predict the run time behavior of the application and Saves time in debugging and testing. Rust has the Strong community support.
With all the above benefits Rust has some limitations like the programming language is complex to programming and difficult to learn and slow in compiling also.

Conclusion

Rust is comparatively easier to approach and has a sizable community, does not come with decades of technical debt, and yet provides qualified performance. Memory safety and easier compatibility are added benefits.

Are you looking for a Python Development Company in India? Rlogical Techsoft Pvt. Ltd is one of the best programming development company. We are known for delivering the best-in-class Python applications using cutting-edge tools and advanced Django python web development framework and programming language.
Daily Developer Jokes - Thursday, Mar 5, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-03-05 13:00:23

---
title: "Daily Developer Jokes - Thursday, Mar 5, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Thursday%2C%20Mar%205%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258c4f0d26.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*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:___ What is a computer virus?

___A:___ A terminal illness!
 -->
Ben++
Tags: career
Published: 2020-03-05 12:50:27

Much to not-too-far-past-Ben's surprise, I accepted an offer this morning for my first full-time software engineering role.  Beginning June 1, 2020, pending a successful visa process and a potential global pandemic, I will be working for [Dalia Research](https://daliaresearch.com/) in the role of "Backend Engineer".

A few points of interest:

* It's primarily a Ruby/Rails job.  If you take a quick look at my post history, that's...not one of mine.  I will have some Ruby to learn.  (I told them this.)

* This company is located in Berlin, Germany.  It's not a remote gig, and I live in Boston, Massachusetts, USA.  To avoid the prohibitive commute, I'm relocating to Berlin.  I will have some German to learn.  (I told them this.)

* DEV's `work_status` boolean is entirely to blame.  Thanks, DEV, very cool!

The point as it pertains to DEV, I guess, is that I'll probably start [writing about Ruby](https://dev.to/deciduously/how-did-you-learn-ruby-5ecp)!  I'm already a fan.

Plot twist, right?

I would love any recommendations you may have for high-quality human-language self-learning.  While the office speaks English and Berlin has a high concentration of foreigners, I will want to attain at least [ILR 2](https://en.wikipedia.org/wiki/ILR_scale#ILR_Level_2_%E2%80%93_Limited_working_proficiency) - of course not necessarily entirely before I go.  Is Rosetta Stone worth the cash?  Pimsleur?  I've started the Duolingo track but that's really just practice, I need something more substantial as well.

*Photo by 🇨🇭 Claudio Schwarz | @purzlbaum on Unsplash*
How to write a "programming" resume (or CV)?
Tags: help
Published: 2020-03-05 12:49:05

Hi guys!

I'm a beginner programmer at Codecool, where I have done a lot of programming (proof is on my GitHub page).

I would like to know what to write inside a programming resume (or CV).

If you have done it before, I would appreciate you helping me what to write in it, what to share inside it, stuff like that.
Rendering JSON-LD data in NextJS and ReactJS
Tags: react, nextjs
Published: 2020-03-05 12:28:03

---
title: Rendering JSON-LD data in NextJS and ReactJS
published: true
description: 
tags: reactjs,nextjs
---

Rendering JSON-LD data in NextJS and ReactJS is quite straight-forward. Here are the steps involved.

1. Organize data in a plain JavaScript Object.
2. Serialize it using `JSON.stringify`.
3. Include the data in the `script` tag using `dangerouslySetInnerHTML`.
4. Optional but recommended - Attach a key. 

The first step is creating the JSON Object. I used this in [GoRemote](http://goremote.in/) which is a job-listing site. Here is the function which creates a job schema given the `job` object. It returns a simple JavaScript object.

```js
function makeJobSchema(job) {
	const desc = stripHTML(job.description)
	return {
		// schema truncated for brevity
		'@context': 'http://schema.org',
		'@type': 'JobPosting',
		datePosted: job.postedAt,
		description: desc,
		title: job.title,
		image: job.company.logo,
		workHours: 'Flexible',
		validThrough: addDaysToDate(job.postedAt, 60),
		hiringOrganization: {
			'@type': 'Organization',
			name: job.company.name,
			sameAs: job.company.website || null,
			logo: job.company.logo,
		},
	}
}

```

The next step is to serialize this object using `JSON.stringify`. Once serialized, we insert it in a  `script` tag using `dangerouslySetInnerHTML`.  Here is how the code looks like.

```jsx
export default function JobSchema({ job }) {
	return (
		<script
			key={`jobJSON-${job.id}`}
			type='application/ld+json'
			dangerouslySetInnerHTML={{ __html: JSON.stringify(makeJobSchema(job)) }}
		/>
	)
}
```

Now, you might question, why do we use `dangerouslySetInnerHTML`? Why not insert the serialized object as a string? Because if we do that, React treats it as HTML and so HTML-escapes the text. The output then looks like this.

```html
<script type="application/ld+json">
	{&quot;@context&quot;:&quot;http:...
</script>
```

This won’t work with bots that will crawl the page for this metadata. In other words, we don’t want to HTML-escape the text within these `script` tags. So, that’s why we use `dangerouslySetInnerHTML`.

Another question would be why do you need to add a `key`? It’s not needed but it’s a good-to-have to avoid the situation where you have multiple JSON-LD’s for a single entity. A `key` makes sure that only one such instance is included in the rendered page.

Well, there you have it.

Once you have the page running, you can use [ngrok](https://ngrok.com/) to expose your localhost online and Google’s [structured data testing tool](https://search.google.com/structured-data/testing-tool/u/0/) to make sure everything works as expected. 

------

This article was posted on [Avi Aryan's Blog](https://aviaryan.com/blog/jsonld-nextjs-react).
Using VS Code for notes taking
Tags: vscode, notes, github
Published: 2020-03-05 12:27:58

---
title: Using VS Code for notes taking
published: true
description: A short post about how I use VS Code and GitHub to write and store my notes
tags: vscode, notes, github
---

Everybody writes notes. I found that my way of doing it was not efficient enough for some reason. I wanted to have them distributed in different folders (logical divisions) and have them synchronized to the cloud in an easy way plus being able to use a decent editor so I decided to give it a try with the one I had already installed: Visual Studio Code.

First of all, I installed the following extensions for VS Code:
* [Notes](https://marketplace.visualstudio.com/items?itemName=canadaduane.notes)
* [RunOnSave](https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave)

Notes extension provides some cool options to ease the notes writing (TODO items and code fragments are key for me)

To accomplish my goal of synchronization to the cloud, I decided to use GitHub as the storage for my notes.

I created a folder for my notes and started a git repository there:

        git init

Then I created a GitHub repo and added it as a remote to the repository:

        git remote add origin git@git.....

I created a script to automate the synchronization with GitHub, I stored it under the notes folder in the path ".auto/commit.sh":

        git add -A
        git commit -m 'auto commit'
        git push origin

As the last step, I configured RunOnSave extension by creating a configuration file in the notes folder under the path ".vscode/settings.json" with this content:

        "emeraldwalk.runonsave": {
            "commands": [
                 {
                    "match": ".notes",
                    "isAsync": true,
                    "cmd": "./.auto/commit.sh"
                 }
            ]
        }

With the project configured in this way, once a "*.notes" file is saved, it gets automatically committed to the GitHub repository.

With this approach, I found a way to freely organize my notes in the folders I want and synchronize them in a frictionless way.