teleren/devto huggingface dataset:
Got wrapped around by python's tail.. XD
Tags: python, programming, beginners
Published: 2022-05-06 13:15:05

After a long practice with C and C++, I just got started with python. 
In the beginning it's confusing but after I started visualising the code with data structures and algorithm it just got as smooth as flowing water. Hope to master it soon... Please share some link of projects and resources... 
Will be waiting...
This website doesn't have an API, so I made my own, with extra features.
Tags: python, showdev
Published: 2022-05-06 13:14:54

The [poet_this twitter bot](https://dev.to/dhravya/i-made-a-twitter-bot-to-take-beautiful-screenshots-of-a-tweet-3kk5) I made, used to use selenium to extract tweets from https://poet.so (literally going to the website, pasting link, taking a screenshot 💀)

This had several, several issues:
- Very costly to host
- Inefficient by design
- Slow
- Highly prone to errors and crashes

It was time to change this. 

So I went ahead and created :
- a python script that uses the Python Image Library to generate the image. This was quite challenging, because I had to (very painfully) plot stuff pixel-by-pixel, and also had to ensure that the tweet fits in the box (for which, I made my own trick where I vertically expanded the image, I'll write a bigger blog explaining the code)
- An API that anyone and everyone can use
- A frontend for the API
- An overall framework, that works for twitter stuff for now, but I'll also be able to implement the same for reddit posts (and comments), etc. you get the point

It was a lot of hassle to make things like mentions, hashtags, and link appear in blue color, media support, and the replies, but I did it!

You can visit the website here - https://beautify.dhravya.dev

To use it instantly on any tweet, mention [@poet_this](https://twitter.com/poet_this)
So yeah, it's time to change the name from poet_this to beautify_this lol

"But isn't this the same as poet.so?" 
Well, it is for the most part, but I've also added (a very few, but important) extra features like replies showing up with a preview of the original tweet, with the website doesn't have.
![Replies show up like this.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z522w4pajdep9d9bt2q0.png)

I also think that my updated design is better
 

also, THANK YOU SO MUCH for showing so much love on the [last post](https://dev.to/dhravya/i-made-a-twitter-bot-to-take-beautiful-screenshots-of-a-tweet-3kk5). Because of your support, I got a 50$ forem shop voucher. Even though I'll be unable to afford the shipping costs, it means a lot to me to just receive the voucher.
What is recursion and when is it useful?
Published: 2022-05-06 12:49:44

Recursion is the repeated application of a process. In JavaScript, recursion involves functions that call themselves repeatedly until they reach a base condition. The base condition breaks out of the recursion loop because otherwise the function would call itself indefinitely. Recursion is very useful when working with data structures that contain nesting where the number of levels deep is unknown.

For example, you may have a thread of comments returned from a database that exist in a flat array but need to be nested for display in the UI. Each comment is either a top-level comment (no parent) or is a reply to a parent comment. Comments can be a reply of a reply of a reply... we have no knowledge beforehand the number of levels deep a comment may be. This is where recursion can help.

**Code Sample:**

```
const nest = (items, id = null, link = "parent_id") =>
  items
    .filter(item => item[link] === id)
    .map(item => ({ ...item, children: nest(items, item.id) }))

const comments = [
  { id: 1, parent_id: null, text: "First reply to post." },
  { id: 2, parent_id: 1, text: "First reply to comment #1." },
  { id: 3, parent_id: 1, text: "Second reply to comment #1." },
  { id: 4, parent_id: 3, text: "First reply to comment #3." },
  { id: 5, parent_id: 4, text: "First reply to comment #4." },
  { id: 6, parent_id: null, text: "Second reply to post." }
]

nest(comments)
/*
[
  { id: 1, parent_id: null, text: "First reply to post.", children: [...] },
  { id: 6, parent_id: null, text: "Second reply to post.", children: [] }
]
*/
```

In the above example, the base condition is met if `filter()` returns an empty array. The chained `map()` won't invoke the callback function which contains the recursive call, thereby breaking the loop.

**Note:** 

- Recursion is useful when working with data structures containing an unknown number of nested structures.

- Recursion must have a base condition to be met that breaks out of the loop, or it will call itself indefinitely.



Thanks for reading...
**Happy Coding!**
Encrypting a file, using aes-256 and OpenSSL
Tags: security, tutorial, opensource
Published: 2022-05-06 12:47:30


**Problem or Issue:**

The other day I had a request to share and provide some sensitive information for some personal work I was going. The person requesting the information didn't have a secure drop-off or transfer method, and simply asked that I share via email. 

**Solution:**

I am using a Mac, and will simply use a terminal with OpenSSL, but if you run Windows thats ok too and the same command should work, just change the in and out path to match your folders and file names. 

For this short example, I created a short and simple test file named testfile.txt, which I will be using below. 

_To Encrypt the file, I simply issue the command below in my terminal_

`openssl enc -e -aes-256-cbc -a -in testfile.txt > testfile-enc123 -k ThisIsMySuperSecretPassword12345$.`

_To decypt the file and read the contents, I simply issue this command in my terminal_

`openssl enc -d -aes-256-cbc -a -in testfile-enc123 -k ThisIsMySuperSecretPassword12345$.`

For this example all went well and I was able to read the contents of my file which simply says "Hello There 2022."
Get Started with RPA and ServiceNow
Tags: servicenow, rpa, automation
Published: 2022-05-06 12:42:47

ServiceNow has now RPA capabilities with the new San Diego Release!! Whoop Whoop!! 

Lets set up our environment so we can built our first robot:
First you need to install following plugins:

- RPA Hub (sn_rpa_fdn) --> will also install the RPA Plugin Bundle (sn_rpa_plugins)
(App Engine Studio (sn_app_eng_studio) --> is not necessary, but I would install AES as well :))


If you have installed all plugins, please check if there is a record in the Licence table:
Robotic Process Automation > Administration > Robots License Distribution
If not, create a record an add some attended and unattended bots.

Next you need to give (also your admin user) the sn_rpa_fdn.rpa_developer role so you can work in the RPA Design Studio.

Last thing, go to the RPA properties: Robotic Process Automation > Administration > Properties
and change the authentication mechanism to Basic. 

Thats it! Now you can download the RPA Design Studio on your Windows, or have a MS-VM if you are a mac user like me, via Robotic Process Automation > Downloads.

If you want to also use the bots on your machine or VM, you can also download the unattended and attended bot runtime.
I wrote an ultimate guide to cryptocurrency, so even your grandma can understand
Tags: crypto, blockchain, cryptocurrency, bitcoin
Published: 2022-05-06 12:32:11

I remembered that not so long ago I wrote a guide to cryptocurrency and blockchain. I was trying to keep it simple and plain, so even your grandma can understand it, hopefully.

I kept it on my laptop and forgot about it. I just wanted to share with you, no strings attached, after all, I did spend days researching and writing it, at least it might help someone.

So here it is, feel free to share, reuse, whatever (but at least leave some credits)
[https://wouldyoudoitforadollar.com/guides/cryptocurrency_guide.pdf](https://wouldyoudoitforadollar.com/guides/cryptocurrency_guide.pdf)
Flask Web-App Setup Using WSGI and Apache or httpd on Debian and fedora based servers
Published: 2022-05-06 12:31:56

## [1] Installing Dependence

### Debian

```sh
sudo apt-get install libapache2-mod-wsgi python-dev
```

```sh
pip3 install virtualenv
```

### Fedora

```sh
sudo dnf install python-dev python3-pip mod_wsgi
```

```sh
pip3 install virtualenv
```

## [2] Setting up the File System

```sh
mkdir /var/www/webapp
mkdir /var/www/webapp/logs
mkdir /var/www/webapp/static
touch app.py && touch webapp.wsgi
cd /var/www/webapp
```

```sh
virtualenv venv
source venv/bin/activate
```

```sh
pip install flask
```

`app.py`  content

```python
from flask import Flask

app = Flask(__name__)

@app.route('/')
def hello():
    return 'Hello, World!'

if __name__ == "__main__":
	app.run()
```

`webapp.wsgi`  content

```python
#!/usr/bin/python
import sys
import logging

activate_this = "/var/www/webapp/venv/bin/activate_this.py"
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0, '/var/www/web-app/webapp')

with open(activate_this) as file_:
    exec(file_.read(), dict(__file__=activate_this))

from app import app as application
```

## [3] Setting up httpd

### Fedora

In  `/etc/httpd/conf.d/` create a new config file of any name `flaskwebapp.conf`

```xml
<VirtualHost *:80>

    ServerName <you_server_ip>

    ServerAdmin <email>

    WSGIDaemonProcess <webapp> user=apache group=apache threads=5
    WSGIScriptAlias / /var/www/webapp/webapp.wsgi

    <Directory /var/www/webapp/>
        Order allow,deny
        Allow from all
    </Directory>

	#FOR FLASK STATIC FOLDER

    Alias /static /var/www/web-app/webapp/static

    <Directory /var/www/webapp/static/>
        Order allow,deny
        Allow from all
    </Directory>

</VirtualHost>
```

### Debian

for Debian base system running apache2, create `.conf` in `/etc/apache2/sites-available/FlaskApp`

`.conf` content

```xml
<VirtualHost *:80>

    ServerName <you_server_ip>

    ServerAdmin <email>

    WSGIDaemonProcess <webapp> user=apache group=apache threads=5
    WSGIScriptAlias / /var/www/webapp/webapp.wsgi

    <Directory /var/www/webapp/>
        Order allow,deny
        Allow from all
    </Directory>

	#FOR FLASK STATIC FOLDER

    Alias /static /var/www/web-app/webapp/static

    <Directory /var/www/webapp/static/>
        Order allow,deny
        Allow from all
    </Directory>

</VirtualHost>
```

after creating the `.conf` run this `sudo a2ensite <naem_of_the_conf_without_.conf>`

## [4] changing context's for Fedora

For project folder

```sh
cd /var/www
semanage fcontext -a -t httpd_sys_content_t './webapp(/.*)?'
restorecon -vvRF ./webapp
```

For the WSGI script

```sh
cd /var/www
semanage fcontext -a -t httpd_sys_script_exec_t './webapp/webapp.wsgi'
restorecon -vvRF ./webapp/webapp.wsgi
```

To check context

```sh
ls -ldZ <file_or_dir>
```

## [5] Refresh the server

```sh
sudo systemctl stop httpd
sudo systemctl start httpd
sudo systemctl enable httpd
```

To check the Status

```sh
sudo systemctl status httpd
```
Client bought a domain, and registered it with a Typo
Tags: webdev, discuss, programming, productivity
Published: 2022-05-06 12:08:20

After building the client's website it was time to point the Dns to the host, and bammm, error after error, after convincing my client to pass me the user and password of the domain provider I realized the problem was a mispelling of an aditional S letter to the client's domain.

Does anybody faced this kind of "fatal error"? lol
How to make your career in Cyber Security
Tags: cybersecurity, career, internship, beginners
Published: 2022-05-06 11:32:32

Hi I am Cyber Security professional with 12 Plus years of experience and the below certifications

▪ISO 27001:2005 and ISO 27001:2013 (ISMS-LA)

▪CISA (Certified Information Systems Auditor) ( ISACA)

▪CRISC (Certified in Risk and Information Systems Control) (ISACA)

▪CISM (Certified Information Security Manager) (ISACA)

▪SANS 504 Hackers Tools Techniques Exploits and Incident Handling, GIAC GCIH Certified.

▪CISSP (Certified Information Security Professional) (ISC2)

▪CCSK (Certificate of Cloud Security Knowledge (Cloud Security Alliance)

▪CDPSE (Certified Data Privacy Solutions Engineer) (ISACA)

▪OSCP(Offensive Security Certified Professional)

▪ISO27001:2013 ISO/IEC 27001. Information Security Management System 2022

▪ISO/IEC 27701. Privacy Information Management System 2022

▪ISO 22301 Business Continuity Management System. 2022
I am planning to write article for the upcoming hackers. So that people looking for resources can kickstart their career.

After completing education and gaining experience below is my summary which I will recommend to the new comers in the domain.

#Cyber Security is big vast subject. One need to build basic foundation of IT and then start with cyber security.
# Some of the subdomains of Cyber Security are 
1)Information Security Governance and Compliance (ensuring Policy Procedures, are implemented and followed)
2)Vulnerability Management & Penetration Testing (Web, Mobile, Infrastructure)
3)Information Security Monitoring and Response (Monitorring for threats and security incidents in real time and responding)
4)Information Security Risk Management(Managing the Information Security risks for the organization considering external, internal local and regulatory requirements )
There can be further segregation you can see in companies.

Most of the newcomers get attracted towards ethical hacking, bug bounty. This is great but it requires lot of exposures and understanding to do excel and for beginners I will recommend to understand the basics and then jump into it.

Cyber Security is domain where you need to be pushing yourself every days and you need to be aware of what all things are happening in the domain specially for bug hunters, and vulnerability management candidates. 

New comers should try and understand basic concept of all the subdomain and then pick one and then start working on it.
If you need any support or help you can reach me out directly at twitter: mukesh_verma_
or mukeshverma@msn.com

This blog is sponsored by
https://mditservices.in
http://eshieldconsulting.com/
http://eshieldconsulting.in/
Create an image slider using HTML and CSS
Tags: css, html, beginners, webdev
Published: 2022-05-06 11:27:34

In this section, we learn how to create image slider using HTML and CSS. You can view the full source code at the below link.

https://codepen.io/taimoorsattar/pen/yLJBdKO

👆👆👆

To get started, we can structure Html code as shown below:

```html
<div class="wrapper">
  <h2>Image Slider</h2>
  <div class="slider">
    <img
      src="https://i.picsum.photos/id/694/500/500.jpg?hmac=cEe2DO9tVxp0o0HjSI5RboKc75ofkq50NvKBIlB_0fQ"
      alt="pic"
    />

    <img
      src="https://i.picsum.photos/id/531/500/500.jpg?hmac=eaduedF4dw0jS6AeDrrxNJIxAlsmWfdZWEPdEG84WRw"
      alt="pic"
    />

    . .
    <!-- More Images Here. -->
    . .
  </div>
</div>
<!-- wrapper -->
```

You can add as many image as you like. To download dummy images, you can visit [picsum.photos](https://picsum.photos) site.

In the above HTML, we have define the class names to the HTML elements that is structure as below.

```text
.wrapper
  └── .slider
      └── <img>
      └── <img>
      └── ....<img>...
```

We can insert as many image as we like. We can only see those images that are visible to us. As describe in the below image, yellow area is the visible area where image are shown. The image slider left to reveal more images.

![Image Slider sketch](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b057fwdckvjk8gs6v8hv.png)

Next, we need to define the width and height of the visible area as shown above. To define the width of visible area, we can define the `.wrapper` class as below.

```css
.wrapper {
  margin: auto;
  max-width: 960px;
}
```

In order to allow more images to be revealed, the visible area should scroll. For that, we can define the `.slider` class as below.

```css
.slider {
  overflow-x: scroll;
  white-space: nowrap;
}
```

Next, to make the scroll bar of slider more fancy, we can write the below code in CSS.

```css
::-webkit-scrollbar {
  height: 5px;
  width: 10px;
  border-radius: 5px;
}

/* Track */
::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 5px;
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #555;
}
```

Also, I've wrote a blog about CSS scrollbar if you're interested to learn, visit the below link.

- [CSS scrollbar](https://taimoorsattar.dev/blogs/custom-scrollbar-in-css)

Finally, our image slider preview as below.


![Final Image slider](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/socqzzxxo7b7pxa4ptl5.jpg)
Javascript scope and scope chain
Tags: javascript, programming, tutorial, beginners
Published: 2022-05-06 11:19:24

A scope is like a place where we can access a certain declared variable in Javascript, when the variable is not availabe in a certain scope it cannot be used there.

## Types of scopes
there are 3 main types of scopes found in Javascript

### The global scope
This is the scope where you can access any declared variable or function and it is on the top level
```javascript
const name = "John";
console.log(name); // John
```
the variable name is created in the global scope so it is accessible everywhere even inside a function scope
```javascript
const name = "John";
function logName() {
    console.log(name); //John
}
logName();
```

### The function scope
This is the scope inside functions and methods and anything declared there cannot be accessed in the global scope
```javascript
function createName() {
    const name = "John";
    console.log(name); // John
}
createName();
console.log(name); // name is not defined
```

### The block scope (ES6 only)
This is the scope inside if statements and loops, any variable declared there with **let** and **const** cannot be accessed outside the scope
```javascript
if (true) {
    const name = "John";
}
console.log(name); // name is not defined
```
however, if we declare the variable with var, it can be accessed outside the scope
```javascript
if (true) {
    var name = "John";
}
console.log(name); // John
```

## The scope chain
If we make a scope inside a scope inside another scope we make a scope chain
### Example
```javascript
function fnc1() {
  //scope 2
  return function () {
    //scope 3
    return function () {
      //scope 4
      return function () {
        //scope 5
      };
    };
  };
}
```
and every scope only has access to variables declared inside a higher level scope.
scope 5 has access to all scope 4, 3, 2 and global scope variables
scope 4 has access to all scope 3, 2, and global scope variables
etc
The complete guide to internationalization in Next.js
Tags: nextjs, webdev, javascript, beginners
Published: 2022-05-06 10:35:58

Translating web applications into multiple languages is a common requirement. In the past, creating multilingual applications was not an easy task, but recently (thanks to the people behind the Next.js framework and Lingui.js library) this task has gotten a lot easier.

![Translation demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/forj9pmk9x0e0jjdntfv.gif)

I have written a blog post for LogRocket where I create a Next.js application with multiple translations, there is a link to the github repository, and an online demo.

So go over there and [check it out](https://blog.logrocket.com/complete-guide-internationalization-nextjs/)
Git: Create a repo
Tags: git, beginners
Published: 2022-05-06 10:27:57

**Git Repository**
A Git Repository, commonly referred to as a "Repo", is a container that tracks and manages files withing a folder.

Anytime we want to use git to track our project, we need to create a new git repository.

We can create as many repos as we want on our machine. Each repo has its own histories and contents.


**Create a new Git Repo**
To create a new git repository, execute the command below from the top-level folder containing the project
`git init`


**Additional Notes**
1. Git tracks a directory and all nested subdirectories.
2. Because of point #1, do not execute `git init` inside of an existing repo
    - Execute `git status` to verify that you are not inside of an existing repo.
       - If you get `fatal: not a git repository or any of the parent directories: .git`, then you're not inside of an existing repo.
Tip : How to assign users or groups on AWS SSO on all AWS accounts
Tags: aws, sso, tip
Published: 2022-05-06 10:13:19

When you have configured AWS SSO and also created all the users and groups needed, you often have groups that you want to assign to all accounts, but when we arrive in the console we must then select the accounts in each OU

![Console with all the OU](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v9dwq9atqlk5wmx35sbf.png)
*all the OU of the Organization listed*

----

![Select account by account](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1rdpkqdnkeccw1dz9mz3.png)
*select each account one by one*


### From Hierarchy to List

So how to select all the accounts without scrolling each OU?

Simple and efficient we have to switch to "List" view and load all the accounts inside the Organization and check the first box at the top


![You can now select all the accounts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0abdv713l55ljtv3xysb.png)

You now have the possibility to select all the accounts!
How do you explain your job to someone who is not technical?
Tags: discuss, programming, career
Published: 2022-05-06 10:02:40

So you work as a software engineer. You work with Node or Javascript or Python or Java or even Swift. I understand what you do but how do you explain it to someone that isn't technical? I really struggle, and I'm sure others do as well. I watch as people's eyes just glaze over. Please help. 

![bored listener](https://media.giphy.com/media/OBUPDLUZhQ5mg8wIn9/giphy-downsized-large.gif)

## Grandparents

First of all, let's start the *maturer* generation. They remember computers filling rooms. They have heard that they can talk to their friend on Zoom who moved out to Australia using their computer. It seems magical to them. Maybe mention you build websites like facebook. And just leave it as that. Change the conversation quickly I'd say. 


## Parents

Next let's tell our parents that think we just 'sit at a desk and play on your computer all day'. 
We may sometimes be at our desk all day looking at text on a screen, but that is called *reading* code. And we now and again correct the code like we are editors for a newspaper or we add new content as if we are one of the journalists.

Perhaps you work for a well known company. Name drop that company. It makes Parents feel proud when they say they kid works for Google.

## Kids
Next let's talk to the little dudes and dudettes. Don't go too complicated and maybe use a tiktok reference or 2. Tell them, that you could make their favourite apps and you have become the best uncle/ aunty or parent in the world.

## Designer friends
Next the UI designer. Please remain calm and let's try be civil. We don't 'ruin their design' we *implement* their design. They know their way around colors, design and pretty looking designs. But we, as developers, need to **build** their designs. CSS isn't as easy as it looks. It really isn't 😭

## The client
"We make magic happen".
And with that, I'll end there.

![Thank you](https://media.giphy.com/media/ZfK4cXKJTTay1Ava29/giphy.gif)

Thank you for reading. Please leave a comment on how **YOU** reply to the question "So what do you do?"