teleren/devto huggingface dataset:
HiDPI In Kali Linux Through RDP | Hyper-V
Tags: kali, hyperv, virtualmachine, rdp
Published: 2023-09-02 21:37:51

# 📃 HiDPI in Kali Linux Through RDP

To get started kali maintains a collection of “Pre-Built Virtual Machines” that we can download and use.

![Screenshot of available pre-built virtual machines on the kali linux webpage: https://www.kali.org/get-kali/#kali-virtual-machines](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3uevzhdl6lqbdgcikw7k.png)

In my case I downloaded the Hyper-V version by following the [official documentation](https://www.kali.org/docs/virtualization/import-premade-hyperv/).

## 💻 Monitors

Once I got the pre-built virtual machine installed, and I started it up, I was pleased to see that the “Enhanced Session” was already enabled. This is a setting within Hyper-V that uses RDP to connect to the virtual machine. This gives us a bunch of nice features, like shared clipboard, and the ability to use all our connected monitors.

In my case using all connected monitors was an issue, since I have one 1080p monitor and one 4k monitor. So enabling [Kali hiDPI Mode](https://www.kali.org/docs/general-use/hidpi/) would make my 1080p monitor useless, but not enabling it would make the text on my 4k monitor way too small.

### ⚖️ Monitor Scaling Through Display Manger Settings

I was disappointed to find out that DPI scaling though XFCE display settings had no effect.

![Image of XFCE display settings window.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t8q6kv5na5xuvv3dm1nj.png)

Normally I would be able to set the scaling of my 4k monitor to 2x or 1.5x and leave my 1080p monitor to 1x, and things would appear correctly on both monitors, but since I could not get this to work I was left with configuring my Hyper-V settings to use only one monitor at a time. Then I can either use or disable Kali HiDPI Mode as required.

## ⚙️ Hyper-V Settings

In order to change the RDP settings used when you select “Connect” on a virtual machine within Hyper-V we can use the “Edit Session Settings…” button:

![Screenshot of Hyper-V with a red box around the “Edit Session Settings…” button.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17x2gcblir0lb6yo6iax.png)

That will open the RDP Display Configuration window prior to connecting:

![Screenshot of RDP Display Configuration window, showing the “use all my monitors” button and a “connect” button. ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o4lh27w0tq3jd0ri5swz.png) 

This allows us to configure RDP prior to connecting to our virtual machine. In this case we can un-check the “Use all my monitors” option and then connect. From there we can set Kali HiDPI Mode accordingly and we are done.
Interest Python Project
Tags: python, beginners, programming, vscode
Published: 2023-09-02 21:29:40

https://github.com/Melson12/Final_Interest_Project

## What am I doing?
Hello, my name is Nelson Bermeo a college freshman at Stevens Institute of Technology. Computer Science and it's many sectors interest me greatly. I'd often get a jolt of excitement everytime I remember how much information is avaliable for me to learn online. I can create many things on my local machine... cool things. 

I am going through the Computer Science course from CodeAcademy and this is my first portfolio project. It is very simple, but I believe it demonstrates very important traits of a programmer. 

## The Project
My project is a terminal game that explains the user different types of interest equations. The user is greeted by a text explaing the premise and then asked which type of interest they would like to learn about. The user would type in their choice and get some information about that interest. They'd then have the opportunity to choose a starting amount for a set of variables and gain a look at the years of money incrementation in a list. Then the user would be allowed to type in another interest choice to look at.

## What I learned
This was actually my first project ever. It took a lot of time for me to gain my knowledge. First of all I had to complete all the python courses in the "Programming" section of the CS course. I utilized list comprehension and for loops in this project. In addition I watched a git version control tutorial on youtube to learn how to use git. I was able to commit changes as I went, change branches and learn but not utilize requests. 

## Conclusion
I loved working on this project and hope that my next project will gain me even more knowledge for my future. Only going up from here!
CSS VS SCSS
Tags: css, scss, webdev, frontend
Published: 2023-09-02 20:47:07

**here's a comparison of CSS and SCSS (Sass):**

| Aspect           | CSS                                     | SCSS (Sass)                            |
|------------------|-----------------------------------------|----------------------------------------|
| Syntax           | Plain text with selectors and properties | Extension of CSS with enhanced syntax  |
| Variables        | Not supported                           | Supported using `$` prefix            |
| Nesting          | Limited support with descendant selectors | Fully supported with nesting          |
| Mixins           | Not supported                           | Supported with `@mixin` directive     |
| Functions        | Not supported                           | Supported with built-in and custom functions |
| Inheritance      | Not supported                           | Supported with `@extend` directive    |
| Importing        | Supported with `@import`                | Supported with `@import`              |
| Comments         | Supported with `/* */`                  | Supported with `//` and `/* */`       |
| Math operations  | Limited support for basic operations    | Fully supported with arithmetic operators |
| Code readability| May require repetitive code             | Improved readability with variables, nesting, and mixins |
| File extension   | .css                                    | .scss or .sass                         |

`Please note that SCSS (Sass) is a superset of CSS, meaning you can write regular CSS within an SCSS file, so it's more versatile and developer-friendly. It allows you to use the features listed above to make your stylesheets more organized and maintainable.`
Create AI-Powered Image Captions in Seconds
Tags: productivity, tooling, ai
Published: 2023-09-02 20:43:03

Hi folks,

Today, I'll give information about the new tool I've created on [10015.io](https://10015.io): "**Image Caption Generator**". 

When you upload your image, it analysis the image and generate alternative captions powered by AI. Now, you don't need to find captions manually when you share an image on social media such as Instagram, Pinterest etc.

Give it a try!

[https://10015.io/tools/image-caption-generator](https://10015.io/tools/image-caption-generator)
How to read an Excel file from Azure Databricks using PySpark
Tags: azure, python, cloudcomputing, softwaredevelopment
Published: 2023-09-02 20:42:35

The Excel file cannot be read directly using Py-Spark in Databricks so necessary Libraries (com.crealytics.spark.excel) have to be installed in the Cluster to successfully run the Python code.

**Step 1**
Navigate to the Cluster that will be used to run the Python script under Compute in Databricks.

**Step 2**
 Click on the tab Libraries -> Install new.

**Step 3**
Select Maven as a Library source and click on Search Packages.

**Step 4**
Type com.crealytics in the search bar and select Maven Central.

**Step 5**
Select the com.crealytics.spark.excel package version that matches with the version of Scala (Cluster -> Configuration -> Databricks Runtime Version) in your Cluster.

**Step 6**
Click Install

Use the following code to load the Excel file:-

```python
// Specify the path to the Excel file
val excelFilePath = "/mnt/<your-mount-name>/path_to_your_excel_file.xlsx";  // Replace with your actual spark file path

// Read the Excel file into a Spark DataFrame
val df = spark.read
  .format("com.crealytics.spark.excel")
  .option("location", excelFilePath)
  .option("useHeader", "true")  // Use this option if your Excel file has headers
  .load();

```
Whereas using Pandas Library the following Python code could be used:-

```python
import pandas 
excelFilePath = "/mnt/<your-mount-name>/path_to_your_excel_file.xlsx"; # Replace with your actual file path

ef=pandas.ExcelFile(excelFilePath); # Load the Excel file as an object

# Mention the Sheet_Name or use ef.sheet_names to iterate through each sheet data

df=ef.parse(Sheet_Name); # Load the required Excel sheet data

```

##Done
From 13-Year-Old Coder to Tech Professional at 18: My Unconventional Journey
Tags: programming, beginners, learning, developer
Published: 2023-09-02 20:23:29

My journey into the world of programming started when I was just 13 years old. My first challenge was HTML. The idea of creating web pages from scratch both intrigued and daunted me. Armed with online tutorials and a heap of determination, I began piecing together my website. The sense of accomplishment I felt when I saw my first "Hello World" webpage displayed was indescribable. As I stared at the screen in awe, little did I know that this moment would mark the beginning of an incredible adventure.

As the years passed, my passion for coding only grew stronger. By the time I turned 16, I had progressed to more complex languages, and Java became my new fascination. The world of object-oriented programming opened up before me like a vast playground, full of endless possibilities. I spent countless hours experimenting, making mistakes, and, most importantly, learning from them. I could code for hours on end without even realizing how swiftly time passed.

Now, here's where the story takes an unexpected twist. As I approached the age of 18, I realized that I wanted to turn my passion for programming into a career, but I hadn't pursued a formal degree. The conventional path seemed closed to me, but I was determined to find my way.

I began building a portfolio of projects that showcased my skills and creativity. I contributed to open-source projects, collaborated with fellow developers, and built a network in the tech community. I also started attending coding meetups and conferences, where I met professionals in the field.

One day, at a local tech event, I struck up a conversation with a software development manager from a well-known tech company. We talked about my journey, my projects, and my passion for coding. Impressed by my dedication and skills, they asked for my resume. Although nothing immediately came of it, this encounter ignited a newfound belief in the possibility of pursuing my dream career. It motivated me to start applying to more places, ultimately leading to a full-time job. At the age of 18, I found myself working in the industry I had dreamed of, all without a traditional degree.

It's now clear to me that no dream is too wild, and taking unique paths can lead to awesome adventures! Thank you for reading this far!
Dissociate An Azure IP Address
Tags: beginners, cloudcomputing, azure, devops
Published: 2023-09-02 20:16:10

**Step 1:** After creating your virtual machine in Azure, click on stop and click on yes.


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

**Step 2:** Go to your search resources, services and docs field and type **PUBLIC IP ADDRESSES** and click on the grayed box


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

**Step 3:** Go to the name of the Virtual machine you created and you will see **IP** along with the name, click on it.


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

**Step 4:** Click on dissociate and click on yes.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ifvundp2qxpiz0lvk7vd.png)
Classroom to Coding: How Teachers Can Inspire Girls
Tags: womenintech, community, beginners
Published: 2023-09-02 19:49:14

Programming has become a vital skill - we all know it. It is crucial to encourage young minds, especially girls, to dive into the world of coding. 

Today we focus on:

- Why and how teachers should motivate girls to take up programming? 
- What are initiatives and resources available in Europe?

###The Importance of Encouraging Girls in Programming

Last five decades, the field of programming has been male-dominated. However, it's essential to break this stereotype and encourage more girls to explore the world of coding. Encouraging girls to take up programming from a young age can help foster creativity, improve problem-solving skills, and open up a wide range of career opportunities. Moreover, it can contribute to creating a more diverse and inclusive tech industry.

###How to Encourage Girls in Programming?

Teachers play a pivotal role in shaping a student's interest in different subjects. They can encourage girls to take up programming by integrating coding activities into the curriculum, creating a supportive and inclusive classroom environment, and showcasing successful women in tech as role models. Moreover, teachers can organize coding workshops or clubs and encourage girls to participate in coding competitions.

###Funding Opportunities for Schools

Several funding options are available for schools to support programming initiatives. 

These include grants from government bodies, non-profit organizations, and tech companies. 

Schools can also partner with local businesses or tech companies for sponsorships or in-kind support.

###Organizations Offering Free Programming Education

- **Girls Who Code**: An international non-profit organization that aims to close the gender gap in technology.

- **Code First: Girls**: A UK-based organization that provides free coding courses for young women.

- **Greenlight for Girls**: A global non-profit organization that encourages girls to pursue STEM subjects.

- **Rails Girls**: A global, non-profit volunteer community that organizes free workshops for girls and women to learn web app development.
Papéis comuns em times ágeis
Published: 2023-09-02 19:36:05

Bem-vindo a este guia sobre os papéis em times ágeis! Compreender os diversos papéis e suas interações é fundamental para o sucesso de qualquer projeto ágil. Cada membro da equipe tem responsabilidades específicas, mas a colaboração e comunicação eficazes são a chave para entregar um produto de sucesso.

Neste guia, vamos explorar em detalhes os papéis comuns encontrados em uma equipe ágil e como eles se inter-relacionam durante o ciclo de vida do projeto. Vamos abordar desde o Agile Coach, que orienta a equipe nas melhores práticas ágeis, até os desenvolvedores que executam as tarefas do dia a dia para criar o produto.

👩‍💼 **Agile Coach**

<u>Responsabilidades</u>: O Agile Coach treina e orienta a equipe em práticas ágeis. Ele também resolve problemas de processo e ajuda a equipe a se adaptar às mudanças.

<u>Interações</u>: Treina Scrum Master, Product Owner, Team Management e Desenvolvedor Líder em melhores práticas ágeis.

👨‍🚀**Scrum Master (SM)**
<u>Responsabilidades</u>: O Scrum Master facilita reuniões ágeis, como Daily Stand-ups e Sprint Reviews, e remove obstáculos para a equipe.

<u>Interações</u>: Facilita o trabalho para Back-end Devs, Full-stack Devs e Front-end Devs.

👩‍💻 **Product Owner (PO)**
<u>Responsabilidades</u>: O Product Owner cria e prioriza o backlog com base nos requisitos e feedback dos usuários.

<u>Interações</u>: Colabora com UX Designers para criar designs e com Arquiteto para definir a estrutura do sistema.

🎨 **UX Designers**
<u>Responsabilidades</u>: Os UX Designers criam protótipos e designs baseados nas necessidades dos usuários e nos requisitos do PO.

<u>Interações</u>: Fornecem designs para Front-end Devs.

🏗️ **Arquiteto**
<u>Responsabilidades</u>: O Arquiteto define a estrutura geral do sistema e toma decisões de alto nível sobre design e tecnologias.

<u>Interações</u>: Orienta Back-end Devs e Full-stack Devs na implementação da estrutura.

📊 **Team Management**
<u>Responsabilidades</u>: Team Management planeja os recursos, aloca tarefas e monitora o progresso do projeto.

<u>Interações</u>: Trabalha com Desenvolvedor Líder para alocar tarefas.

👨‍💻 **Desenvolvedor Líder**
<u>Responsabilidades</u>: O Desenvolvedor Líder divide as tarefas do backlog em tarefas menores e as distribui entre os desenvolvedores.

<u>Interações</u>: Aloca tarefas para Back-end Devs, Full-stack Devs e Front-end Devs.

👨‍💻 **Back-end Devs / Full-stack Devs / Front-end Devs**
<u>Responsabilidades</u>: Estes desenvolvedores executam as tarefas para desenvolver o produto, focando em suas respectivas áreas (Back-end, Full-stack, Front-end).

<u>Interações</u>: Recebem tarefas do Desenvolvedor Líder e orientações do Arquiteto e Scrum Master.
Celebrating over 2 million pulls of pyaction from the GitHub Container Registry
Tags: github, docker, python, showdev
Published: 2023-09-02 19:13:29

A while back, I developed, and have since been maintaining, [pyaction](https://github.com/cicirello/pyaction), which is a [Docker container with Python, git, and the GitHub CLI](https://dev.to/cicirello/pyaction-a-docker-container-with-python-git-and-the-github-cli-930). Sometime in the past week, pyaction surpassed 2 million pulls from the [GitHub Container Registry](https://github.com/cicirello/pyaction/pkgs/container/pyaction). 

![Screenshot of number of pulls of pyaction from the GitHub container registry](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vtw2plletsng1aqunyv1.PNG)

It is also available from [Docker Hub](https://hub.docker.com/r/cicirello/pyaction), but hasn't been pulled nearly as much from there. The pyaction container was originally developed to support developing GitHub Actions in Python. There are several GitHub container actions that use pyaction as the base image, and specifically pull it from the GitHub Container Registry. So this likely represents over 2 million runs of those dependent Actions.


## More Information

Please consider starring pyaction's GitHub repository, and even better using it to develop Actions, or just to use the GitHub CLI:

{% github cicirello/pyaction %}

For more information about pyaction, see my earlier post here on DEV, as well as an information page about pyaction on the web.

{% link https://dev.to/cicirello/pyaction-a-docker-container-with-python-git-and-the-github-cli-930 %}

{% embed https://actions.cicirello.org/pyaction/ %}


## Where You Can Find Me

Follow me [here on DEV](https://dev.to/cicirello) and on [GitHub](https://github.com/cicirello):

{% user cicirello %}

Or visit my website:

{% embed https://www.cicirello.org/ %}
Docker Best Practices for Production
Tags: docker, devops, webdev, linux
Published: 2023-09-02 18:59:48

## 1. Always use specific version
❌ Don't do this
```
FROM node
```
✅ Do this because it will ensure your container image version
```
FROM node:20.0.0
```

## 2. Try to use alpine version

❌ Don't do this because It can be use large
```
FROM node:20.0.0
```
✅ Do this for small official image
```
FROM node:20.0.0-alpine
```
## 3. Dont install all dependencies

❌ Don't do this 
```
RUN npm install
```
✅ Do this because you don't need dev dependencies in your production server
```
RUN npm install --production
```
## 4. Mantain versioning
❌ Don't do this
```
docker build -t myapp .
```

✅ Do this it will help you to track version of your container images.

```
docker build -t myapp:1.0 .
```
HackerRank MaxMin
Tags: python, challenge
Published: 2023-09-02 18:48:57

This is solution for HackerRank MaxMin challenge, in python. This is a problem in the [Interview Preparation Kit > Greedy Algorithms](https://www.hackerrank.com/interview/interview-preparation-kit/greedy-algorithms/challenges) and is considered of medium difficulty.

Be a greedy algorithm means that the final solution will be taken by applying the same algorithm in a subset of the global problem, then comparing the local solution with previous solution on every iteration. If the current solution is better, then it will become the global solution.

Speaking of code, we usually need to:
- prepare data (once)
- run the problem in a subset
- if current solution is better, we replace global solution with current solution
- choose another subset and repeat

The problem states that:
- we receive `k` (number of pairs) and `arr` array (initial)
- there is a distracting concept of unfairness
- we need to take `k` elements of `arr` and make a new array `arr'`
- unfairness is `max(arr') - min(arr')`
- we must find the minimum unfairness

First of all, if we sort `arr`, we don't need to check every k subset. We can only iterate through `arr` find `arr'` because we are interested in minimum difference between `min(arr')` and `max(arr')` only. So it doesn't make sense to make `arr'` with values too distant to each other.

```py
arr = [1,4,7,2]
k = 2
arr.sort() # [1,2,4,7]
for i in range(len(arr)-k+1):
   arr2 = arr[i:i+k-1]
# len(arr)-k+1 = 3 meaning i will assume 0, 1 and 2
# i=0 arr2 = [1,2]
# i=1 arr2 = [2,4]
# i=2 arr2 = [4,7]
```

In the example above, we should considerate only the **sorted neighbors**. It is unnecessary to test the `arr'=[1,7]` because the unfairness would by definition the bigger than `[1,2]` or `[4,7]`.

We may notice that there is an iteration in `arr` (global problem) to find `arr'` (local/partial solution). Now we must find the unfairness for each sorted `arr'` and compare with the last one. It the current solution is better, it will replace the global solution. After iteration we will have the best solution. This is the greedy approach.

A complete python solution is shown below. The first solution (min_unfairness) is defined as the maximum unfairness of arr. Notice that arr' is defined as `arr[i + k - 1] - arr[i]`.

```py
def maxMin(k, arr):
    arr.sort()
    min_unfairness = arr[k] - arr[0]
    for i in range(len(arr) - k + 1):
        curr_unfairness = arr[i + k - 1] - arr[i]
        min_unfairness = min(curr_unfairness, min_unfairness)
    return min_unfairness
```

This function still have room for improvement. For example, it could finish if at some point curr_unfairness = 0. It could also test unfairness before replace min_unfairness. It also could add all unfairness to an array and apply min() in the return.
How to stream video from the DeepRacer camera
Published: 2023-09-02 18:36:16

**Intro**

I have been working on several projects that require individuals to get access to the DeepRacer camera. 

- At UADE University, students needed access to the camera for some assignments.
- At a conference called Nerdearla, the video streaming team would like access to the car's camera to stream from it. 

After hacking around with the car a little and with some hints from David Smith from AWS, I came up with the following process. I'm documenting it here for anyone needing it and a future version of me.

**Backup Configuration Files**

```
mkdir -p /home/deepracer/backup
cp /opt/aws/deepracer/lib/device_console/static/bundle.js /home/deepracer/backup/
cp /etc/nginx/sites-enabled/default /home/deepracer/backup/site-config

```
**Perform Configuration Changes**


```
sudo sed -i "s/isVideoPlaying\: true/isVideoPlaying\: false/" /opt/aws/deepracer/lib/device_console/static/bundle.js
sudo sed -i "s/auth_request \/auth;/#auth_request \/auth;/" /etc/nginx/sites-enabled/default
systemctl restart nginx
```


**Accessing The Car Camera**

The URL to access the car camera is:

https://CAR_IP/route?topic=/camera_pkg/display_mjpeg&width=480&height=360

Please consider that this change disabled authentication on the ROS backend on the car, so make sure to do this only when you are working in an isolated network you trust.




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