teleren/devto huggingface dataset:
Server Security For Beginners Pt. 1
Tags: devops, security
Published: 2020-06-12 05:42:54

So, you have a shiny new project and can't wait to jump on Digitalocean, Linode, or Upcloud to deploy a server instance and give the world a piece of your awesomeness? Wait! cause you're just as close to __tears__ as my colleague who almost dropped a production database.

Like me, many developers aren't trained in the glorious field of __cybersecurity__ and __devops__ and can't afford an expert and so, we have to learn from youtube videos and online articles. There are so many opinions on what the best practices are when deploying a new server instance. Usually, you find the right one when it's too late.

I've compiled my experiences into one large series so you don't have to suffer as i did. 

1. Server Security for Ubuntu Server.
2. Server Security for Centos/Redhat server.
3. Server Security for Debien based server.
4. Server Security For Windows Server(Maybe).

Click on the post you're interested in and let's get into it!
If you can't click on it, then I'm not done with the post. Go get yourself a cup of coffee and the refresh this post.

A caveat, I'm no expert, but what I shared above are the best methods that worked for me after getting hacked a couple of times.

Connect with me here:
Twitter: [@gbemi_l_david](https://twitter.com/Gbemi_L_David)
LinkedIn: [GbemiLanre](https://www.linkedin.com/in/gbemilanre/)
GitHub: [Nigeriancoder](https://github.com/Nigeriancoder)
How to keep track most watched movies in Django?
Tags: django, python
Published: 2020-06-12 05:40:33

So what I am trying to do is as you can see in this screenshot, there is a section called "Most Watched".  Now it is just a template but I was planning to write the logic of "Most Watched".

I found some similar topic about it... 
https://dev.to/coderasha/how-to-track-number-of-hits-views-for-chosen-objects-in-django-django-packages-series-2-3bcb

But here mostly counting the views.

Anyone can guide me on how to make a back-end logic of "Most Watched"? I am trying to do it with Django.
Different music for different tasks?
Tags: watercooler, music
Published: 2020-06-12 05:33:34

I recently noticed that different music genres help me to be more productive at certain tasks. 
For example, I nearly always listen to German hip-hop while coding, but the same kind of music completely stops me from writing up stuff. For this kind of work I nearly always switch to that one metal playlist I discovered while working on my thesis.

Do you switch between genres while doing different tasks? Which kind of music helps you to concentrate the most?
5.1 Interface Builder Basics
Tags: swift
Published: 2020-06-12 05:22:00

•	<h1>What’s the Storyboard?</h1> – Includes many pieces of the interface, defining the layout of one or many screens as well as the progression from one screen to another.

•	<h1>What’s the use of the Object Library?</h1> – It is to browse through buttons, text fields, labels and other view controllers that can be added onto a scene.
How to use YouTube Thumbnail Image downloader
Tags: youtubethumbnaildownloader, youtubedownloader, youtubethumbnail, thumbnailimagedownloader
Published: 2020-06-12 05:11:37

Video is a method to attain extra folks and get your face on the market. A well-liked video platform is YouTube. The drawback to video is you'll open your self to constructive and detrimental suggestions whether or not it's warranted or not.

In a world that's transferring increasingly more on-line, the content material is king. And out of all this content material, video content material is among the finest. Many instances folks would slightly watch the details about services or products on-line slightly than examine it.

Also, there's a likelihood that your video might go viral. If you make a video that's significantly good, emotional, humorous or one thing else, your video might have the potential to go viral very quickly. What going viral means is that there could possibly be hundreds of people that will share your video with others they know. If it does rather well, this might imply that your enterprise is uncovered to an infinite quantity of individuals.

Nowadays everybody wishes to earn and many of the younger technology get drawn to the YouTube partnership program to earn. Yes, you head it proper to earn from YouTube. YouTube pays when somebody watches movies on your YouTube channel and click on or watch advertisements displayed via partnership program.

You are pondering in all this income course of how this thumbnail even making any relation. If you having this thought then you might be incorrect. Youtube customized thumbnail positively make sense with YouTube. All professional Youtubers are aware of the significance of distinctive thumbnail for his or her movies and for this function they use totally different instruments like [thumbnail downloader](http://atozcelebrity.com/youtubethumbnaildownloader/index.html) thumbnail downloader or youtube thumbnail for a tempting picture for his or her channel.

Every individual on whose incomes from YouTube actually needs that his/her video get viral in order that they will earn some respectable cash. For this function, they do various things like YouTube video website positioning, Social Sharing, Attracting Thumbnail, or Video backlinks. So YouTube customized thumbnail performs an essential position to get your video viral. Attractive YouTube thumbnail drives interact extra folks to view your video. In this fashion, you may earn extra from YouTube.

We are offering free YouTube Thumbnail grabber after maintaining all this in thoughts that it'll assist folks to obtain engaging thumbnail of any video from YouTube.

Can I obtain Youtube thumbnail free? Yes, you may obtain it freely. How many kinds of photos Youtube thumbnail downloader presents?

You can obtain the Thumbnails in Three Different Qualities, they're:

High Quality (Maximum Resolution)
Medium Quality (Medium Resolution)
Low Quality (Lowest Resolution)
We hope you perceive who we're and what we do. This is all about us. Enjoy you a free customized thumbnail
How i made a blog using my Dev.to Posts
Tags: showdev, devops, webdev, codenewbie
Published: 2020-06-12 04:44:43

#How To Generate A Site With Stackbit
Dev.to teamed up with Stackbit to make it easier for you to deploy your DEV posts to a personal website. This service will pull in all your existing DEV posts and make sure they stay up-to-date. Your future posts will also be pulled in automatically.

Sounds cool.😍

The demo live blog - https://raghav-blog.netlify.app



1) Visit the Stackbit site creation flow.
https://app.stackbit.com/create?ref=devto
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zqyg1g6fwflr0uuqcl5v.jpg)

<br>
2) A new page should open up. The first step is to pick the theme of your new site
<br>
3) Next, you’ll choose the static site generator of your preference.
<br>
4) Last, you’ll want to connect both your GitHub and DEV accounts. A repository for your new site will automatically be created in your GitHub account.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gd06fwcfk8v5j6hojqh9.jpg)
<br>
5) Click “Create Your Project” and that’s it! Be patient, this might take a few minutes. Especially if you have lots of post. After Stackbit finishes its magic, you should have a link to your new site ✨

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

Note: you’ll need to create or connect your Netlify account to keep the site live
Top sites to land you good paying freelance job
Tags: beginners, career
Published: 2020-06-12 04:32:04

Here are list of sites which would help you land good paying jobs as a freelancer,i have used most of this sites and their really good for getting jobs, all you need is to set up a good profile and portfolio, let's get started.

Angel list - They feature jobs from companies and it's a good place to start your journey as a freelance developer
https://angel.co/

working nomads -
Job posting are mostly tech related
https://www.workingnomads.co/jobs

we work remotely -
With this website you could get quick job opportunities but job listing are not up to other site
https://weworkremotely.com/

jobpresso -
Only Remote jobs are listed on here
https://jobspresso.co/remote-work/

remote -
It gives you futures which allows you search on any job type and it's also easy to get freelance jobs
https://remote.co/remote-jobs/

GitHub jobs - Github has a job board and the listings are basically development because Guthub it self is used mostly by developers to share their code.
https://jobs.github.com/

just remote -
Gives the opportunity for developers to get their perfect role
https://justremote.co

pangian -
It's a good place for developers to get jobs and you could also join their community
https://pangian.com/

remote ok - has the feature of filtering by experience and mostly development gigs are posted here,it's a good place to get remote jobs
https://remoteok.io

Remotive -
It's a good place to get development gig.
https://remotive.io/

outsourqely -
It connects remote workers with employers seeking for full-time and part-time employees
https://www.outsourcely.com

Other websites like https://upwork.com , https://fiverr.com, https://indeed.com,
https://freelancer.com
https://freelancermap.com are also good websites to get started with.
Basic Setup for Deno!
Tags: deno, vscode, tutorial, programming
Published: 2020-06-12 03:45:31

* Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.

* You can easily understand the deno application (REST API, etc.) if you know how nodejs is working in those.

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

I made a youtube video for getting stared in deno.

{% youtube lduoLPvjbw4 %}

------
### Install Deno

* For windows, I prefer chocolatey

``` sh
$ choco install deno
```
* For more options, You can visit their official documentation website
https://deno.land


### Getting Started
---
* You can create applications like REST API as like in nodejs, Backend application for your full-stack application.

* How to run your application?
```
$ deno run <app.js | app.ts>
```
* How to install global packages like denon?

> Denon is exactly like a nodemon for deno.

```
$ deno install --allow-read --allow-run --allow-write --allow-net -f --unstable https://deno.land/x/denon/denon.ts
```
(Link can be changing if you are installing other packages) 

### Simple Example for creating http server in deno!

``` JavaScript
import { serve } from "https://deno.land/std@0.56.0/http/server.ts";
const s = serve({ port: 8080 });
console.log("http://localhost:8080/");
for await (const req of s) {
  req.respond({ body: "It's my Deno world!" });
}
```
* If you're using vscode as an editor, then if dev blog will be useful for you
{% link https://dev.to/vuelancer/deno-extension-5fn6 %}
Sort Colors - LeetCode
Tags: sorting
Published: 2020-06-12 03:41:02

---
title: Sort Colors - LeetCode
published: true
description: Medium Problem
tags: sorting
---

Given an array of three group of elements sort them in order

Input: [2,0,2,1,1,0]

Output: [0,0,1,1,2,2]

One Simple way is to use Counting Sort algorithm

Algorithm:

1. initialize a bucket(array)
2. Loop through each element and increment the bucket[i]
3. Loop through the bucket and update existing nums

Code:

``` JS
var sortColors = function(nums) {
	let bucket = new Array(3).fill(0);
	for (let i = 0; i < nums.length; i++) {
		bucket[nums[i]]++;
	}
	let bucketIdx = 0;
	for (let i = 0; i < nums.length; i++) {
		console.log(bucketIdx);
		if (bucket[bucketIdx] != 0) {
			nums[i] = bucketIdx;
			bucket[bucketIdx]--;
		} else {
			bucketIdx++;
			i--
		}
	}
	return nums
};
```

This can also be solved in one pass:

Algorithm:

1. initialize low and mid to 0 and high to nums last index
2. Now, consider mid as center pole
3. Whenever you encounter nums[mid] as 0, swap nums[mid] and nums[low] then increment low and mid. We increment low, so that next 0 will take that index and same with mid
4. Whenever nums[mid] is 1, just increment mid
5. Whenever nums[mid] is 2, swap nums[mid] and nums[high] and decrement high. This way we are putting all 2's at the end

``` JS
/**
 * @param {number[]} nums
 * @return {void} Do not return anything, modify nums in-place instead.
 */
var sortColors = function (nums) {
  let low = 0, mid = 0, high = nums.length - 1;
  while (mid <= high) {
    if (nums[mid] == 0) {
      let temp = nums[mid];
      nums[mid] = nums[low];
      nums[low] = temp;
      low++;
      mid++;
    } else if (nums[mid] == 1) {
      mid++;
    } else {
      let temp = nums[mid];
      nums[mid] = nums[high];
      nums[high] = temp;
      high--;
    }
  }
};
```
Teste de Software
Tags: testing, node, software, javascript
Published: 2020-06-12 03:10:38

**Post 2**
No post anterior, falamos apenas de conceitos básicos que utilizamos ao realizar testes de software, conceitos que parecem “bobos”, porém de bastante importância.
Nesse segundo post iremos abordar algo mais abrangente, Iremos falar sobre elementos de grande importância para que possamos chegar a um determinado objetivo de avalição, ou seja, elementos que funcionam como um passo a passo para chegar a um resultado final de um documento de teste.

**Caso de teste.** Que descreve uma condição a ser testada no software,e contém valores de entrada, restrições para ser executado e um resultado de saída, ou algum comportamento esperado, com isso, definimos que o caso de teste e de fato indispensável para que possamos seguir com o processo.

**Procedimento de teste.** É simples, é a execução do caso de teste, os passos necessários para executá-lo.

**Critérios de teste.** Nos critérios entramos na parte de avaliação dos testes após seu resultado,Lembrando sempre que o processo de teste é destrutivo, então devemos sempre provocar falhas para estabelecer um nível de confiança na correção do produto, ao avaliar o teste devemos também ter conhecimento que os  critérios podem ser utilizados da seguinte forma:

**Critério de cobertura de testes.** Que identifica as partes essenciais do software, para garantir sua qualidade.

**Critério de Adequação de casos de teste.** Avaliar se um conjunto de casos de teste satisfaz os requisitos de testes estabelecidos pelo critério.

**Critério de geração de casos de testes.** Este critério define as regras e diretrizes para geração dos casos de teste de um produto que esteja de acordo com o critério de adequação definido anteriormente.

referencias:
https://www.researchgate.net/profile/Arilo_Neto/publication/266356473_Introducao_a_Teste_de_Software/links/5554ee6408ae6fd2d821ba3a/Introducao-a-Teste-de-Software.pdf
https://www.researchgate.net/profile/Adalberto_Crespo/publication/237497188_Uma_Metodologia_para_Teste_de_Software_no_Contexto_da_Melhoria_de_Processo/links/54e5d1040cf2cd2e028b338b.pdf
Conditional {i18n}
Tags: i18n, template, literals, localization
Published: 2020-06-12 02:55:27

For a statistics/analytics dashboard we needed a bit more advanced and customizable localization tool. Due to restriction of external packages, I had to create one :D ([Github link](https://github.com/isaozler/dynamic-i18n-io) / [Try it out!](https://npm.runkit.com/dynamic-i18n-io))

Basically this is a string interpolation tool which fill the placeholders with data on the fly.

I think what makes this tool nice is that you can have conditional outputs.

## Basic example 

```js

import i18n from 'dynamic-i18n-io';

// some data
const data = {
  greeting: {
    isMale: true,
    name:   'Joe',
    age:    42
  },
};

// en.js
const format = {
  greeting: {
    // template contains the placeholders text
    template:   `Hello {isMale} {name} {age}`,

    // options is where you put all your values / refs
    // so if
    // greeting.options.name === true ? data.greeting.name
    // will be set to the {name} in the greeting.template literal
    options: {
      isMale: ['Sir', 'Madam'],
      name:   ['{name}', ''],
      age:    ['({age})', '']
    },

    // when condition returns true options[key][0] is set
    // otherwise options[key][1]
    // you can add logic to determine selection with a callback
    conditions: {
      isMale: (props) => props.isMale,
      name:   true,
      age:    (props) => props.isMale || props.age < 20,
    }
  }
};

const { greeting } = i18n(data, format);

// data = { isMale: true, name: 'Joe', age: 42 }
// > 'Hello Sir Joe (42)'

// data = { isMale: false, name: 'Joelle', age: 42 }
// > 'Hello Madam Joelle'

// data = { isMale: false, name: 'Joelle', age: 18 }
// > 'Hello Madam Joelle (18)'

```

Feel free to fork and improve based on your needs!

[Or try it out!](https://npm.runkit.com/dynamic-i18n-io)
[Fedora 32] How to solve docker internal network issue
Tags: fedora, docker, firewalld
Published: 2020-06-12 02:54:49

Recently I upgraded to Fedora 32 with a fresh install and started to face an issue using docker-compose and docker in general, containers weren't able to talk each other.

After some googling I found that default backend for firewalld was changed [from iptables to nftables](https://fedoraproject.org/wiki/Changes/firewalld_default_to_nftables).

I tried to do the proposed fixes for Docker described in the link above, but without success, so the way to solve the issue for me was put back iptables as firewalld backend.

With those commands below, I was able to solve the issue.

```
sudo sed -i 's/FirewallBackend=nftables/FirewallBackend=iptables/g' /etc/firewalld/firewalld.conf

sudo systemctl restart firewalld docker
```

That's all folks, thanks in advance and stay in tune.
Backup/Restore a dockerized PostgreSQL database
Published: 2020-06-12 02:46:52

Backup your databases
docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql

Restore your databases
cat your_dump.sql | docker exec -i your-db-container psql -U postgres
Getting Started with Angular
Tags: angular, beginners, webdev
Published: 2020-06-12 02:33:57

# What is Angular?

Angular is an open source web application framework lead by Google and by community developers.

It is based on TypeScript which is a strict syntactical superset of JavaScript which adds optional static typing to the language. While Typescript needs to be compiled it does offer a benefit in prototyping.

## Getting Started

To use the Angular framework you should be familiar with:
  - JavaScript
  - HTML
  - CSS

Another important thing to understand is that Angular apps require libraries that are available as npm packages. 

### Step 1: Install the Angular CLI 👨‍💻
To install the CLI using npm, open the terminal and enter 

``` npm install -g @angular/cli ```

### Step 2: Create a workspace and initial application 👷‍♂️

To create a new workspace and initial starter app:

Run the CLI command ng new and provide the name my-application, as shown here:

``` ng new my-application ```

Angular will now get to work building the application. The client will create all folders and files necessary.

To run type:

``` ng serve ```

This will run the application through localhost:4200/

Follow and like for the next article on "Angular Building Blocks"
Go - Unicode characters to Unicode escape sequence
Tags: go
Published: 2020-06-12 02:23:17

---
title: Go - Unicode characters to Unicode escape sequence
published: true
description: 
tags: go, golang
//cover_image: https://direct_url_to_image.jpg
---

Escape string in unmarshaled data.

```go
//
func convertJsonElement(data interface{}) interface{} {
	switch v := data.(type) {
	case map[string]interface{}:
		for ik, iv := range v {
			v[ik] = convertJsonElement(iv)
		}
		data = v
	case []interface{}:
		for ik, iv := range v {
			v[ik] = convertJsonElement(iv)
		}
		data = v
	case string:
		v = fmt.Sprintf("%+q", v)
                if len(v) > 0 {
		    // Remove unnecessary double-quote
		    data = v[1 : len(v)-1]
                }
	default:
	}
	return data
}

//
func main() {
        jsonStr := []byte(`{"test":"こんにちは"}`)
	var data interface{}
	json.Unmarshal(jsonStr, &data)
	convertedData := convertJsonElement(data)
}
```
Para que serve o .gitignore e o .gitkeep
Tags: git, github
Published: 2020-06-12 02:01:16

Quando iniciei meus estudos em programação e descobri que existia o **git** para versionar meus códigos e o **github** para armazena-los em repositório, logo me perguntei. Como eu faço para não versionar determinados arquivos e pastas além de poder subir pastas vazias para o github? Foi então que descobri a função de dois arquivos. O **.gitignore** e o **.gitkeep**.

O **.gitignore** é um arquivo que criamos na raiz do nosso projeto para poder ignorar arquivos e pastas do versionamento.
Dentro do **.gitignore** colocamos todos os arquivos e pastas para serem ignorados pelo git.

**Exemplo**:
```
# Ignora todos os arquivos com extensão .txt
*.txt

# Ignora uma pasta
build

# Remove do .gitignore o arquivo .gitkeep dentro da pasta
!uploads/.gitkeep

```
Já o **.gitkeep** é um arquivo oculto pelo sistema que serve apenas para versionar pastas vázias, basta cria-lo dentro da pasta a ser versionada.
Enamel Pins for Developers
Tags: watercooler, design, showdev
Published: 2020-06-12 01:47:03

We all know developers (myself included) **love** their stickers! 

We cover our laptops in them, stick them on our cars, our notebooks, everywhere sticky things will...ya know...stick. 

But what about sticking things...**on ourselves**!? 

I have always been a _huge_ fan of enamel pins, and have amassed a decent collection of them over the years. 

Despite the absolute wealth of development, programming, and coding related stickers there are in the world, I had a genuinely difficult (almost impossible) time finding any enamel pins that fit the theme. 

So, I decided to make my own! 🎉 

My first two pin designs are available for pre-order [on my website](https://shop.thecodepixi.dev), and I'm looking forward to designing many many more in the future. 

If you're also a pin collector, or have any cool coding-related pin ideas, let me know in the comments! 

xx - Emily / Pixi