teleren/devto huggingface dataset:
Reason: user 'xxx' does not meet 'require'ments for user to be allowed access
Tags: apache, httpd, authentication
Published: 2020-06-09 08:45:52

This post is meant as lessons learned from setting up Apache HTTPD server with authentication for some backend resources. The goal was to secure the resources with simple password based authentication and allow given list of users to access them. Accounts have been assembed in dbm file on local filesystem.

### Configuration that works, but...

```
<VirtualHost *:80>
    ErrorLog /var/log/httpd/http-error.log
    CustomLog /var/log/httpd/http-access.log

    <Location /myresources>
        AuthType basic
        AuthName "Authenticate using username and password"
        AuthBasicProvider dbm

        AuthDBMUserFile "/etc/httpd/authentication.dbm"
        AuthGroupFile "/etc/httpd/groups"
        <RequireAny>
            Require user adam
            Require user bob
            Require user cecil
        </RequireAny>
    </Location>
</VirtualHost>
```

So, what we have here
+ Credentials for user accounts are stored in `/etc/httpd/authentication.dbm`
+ Access to `myresources` is allowed only to used `adam, bob, cecil`. This is defined using `RequireAny` meaning that if `any` of these requirements is matched, user is granted with access.

This will work, but you will see disturbing messages in error log. They are disturbing, because they will be naming those users that *are allowed*! However, at the same time, you will not see any error response in access log. (Log messages are shortened)

`/var/log/httpd/http-error.log`

```
[authz_user:error] [client 10.10.10.10:10000] AH01663: access to /myresources failed, reason: user 'bob' does not meet 'require'ments for user to be allowed access
```
`/var/log/httpd/http-access.log`

```
10.10.10.10 - bob "POST /myresources HTTP/1.1" 200 102
```

#### Why is that?
The reason for this is that error log will contain error message for each unsatisfied `Require` directive. For *adam* there won't be any error message as he is first in list. For *bob* there will be 1 and for *cecil* there will be 2 for each request.

### Configuration that works, but...

```
<VirtualHost *:80>
    ErrorLog /var/log/httpd/http-error.log
    CustomLog /var/log/httpd/http-access.log

    <Location /myresources>
        AuthType basic
        AuthName "Authenticate using username and password"
        AuthBasicProvider dbm

        AuthDBMUserFile "/etc/httpd/authentication-myresources.dbm"
        AuthGroupFile "/etc/httpd/groups"
        Require valid-user
    </Location>
</VirtualHost>
```

The difference here is that there is no `Require user` list. Instead, any valid user is allowed. But, the authentication database can have more users that only those allowed to access `myresources`. This is why there is changed authentication file and you have to keep there correct list of users.

The latter configuration won't be generating *false alarms* in error log, but I don't consider it perfect too.
Schedule our Lambda function
Tags: aws
Published: 2020-06-09 08:23:57

This article is part of the **Twitter bot with Kotlin in AWS series** showing how [I created a Twitter bot for Vue 3 updates](https://dev.to/gautemeekolsen/twitter-bot-vue-3-updates-j5b). But this article works as an independent article on how to run a Lambda function on a scheduled time period.

Now we want our Lambda function to run every 5 minutes. We will use the AWS CLI to set it up.

First, let's create a scheduled event where you specify when it should trigger based on a cron expression or a rate expression. More information about the syntax [here](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html).

```
aws events put-rule --schedule-expression "rate(5 minutes)" --name FiveMinRule
```

Copy the RuleArn from the output.

Now we will add permission for the CloudWatch event to trigger the function.

```
aws lambda add-permission --function-name twitter-bot-vue-3 --action lambda:InvokeFunction --principal events.amazonaws.com --source-arn <rule-arn-from-above> --statement-id my-scheduled-event
```

At last, we will use put-targets to add the Lambda function to the rule. First we need to run `aws lambda list-functions` and copy the FunctionArn for the function.

```
aws events put-targets --rule FiveMinRule --targets "Id"="1","Arn"="<function-arn>"
```

That's it, you can now see that the Lambda function has a trigger attached to it in the AWS console.
Build a complete warehouse management system with React and Django.
Tags: python, django, react, javascript
Published: 2020-06-09 08:13:15

Update

My React Frontend now authenticates successfully with my django backend through Token Authentication. Might change it to JWT's later on.
My only doubt is whether to continue storing the Token in localstorage in the screenshot below(Might be a vulnerability) or request the token on every request to the backend (Delayed responses due to two round trips?). Please comment below with your views .

*Caching*
Added A Caching layer as well with Redis. It only caches a section of the template rendered by homepage and some other read heavy pages.
This is built into django with the help of the caching templatetags.

```python
#view
from django.views.decorators.cache import cache_page

@cache_page(60 * 15)
def my_view(request):
    ...

 #template file
{% load cache %}
  {% cache menu request.user.email %}

 #menu for logged in user

{% endcache %}

```

![Auth Token](https://dev-to-uploads.s3.amazonaws.com/i/ptcg9l3cm3io3ng1npyy.jpg)
How my spammer for WhatsApp works
Published: 2020-06-08 13:18:50

2 years ago I discovered the fact that modern chat apps could be exploited to spamming the same message over thousands of times. You can send a message to someone a thousand times by using a keyboard app. So i created SPAMit - a spammer for WhatsApp.

## This is how it works
Many chat apps have the option of using the enter key of your phone keyboard as the send button. So, you can emulate the keypresses on your device by programming the "keyboard" to type the message and then pressing the enter key. Loop this over how many ever times you want and you effectively have a message bomber. You can take a look here - [Github - SPAMit](https://github.com/burhanuday/SPAMit-WhatsApp-Spammer)

![Screenshot1](https://camo.githubusercontent.com/4d9776423dba6e1aa61447c1d2b729bd25546cdb/68747470733a2f2f692e696d6775722e636f6d2f43787a74666e692e706e67)

![Screenshot2](https://camo.githubusercontent.com/06af5660c8a2447a266b7125f29fcd0597aab499/68747470733a2f2f692e696d6775722e636f6d2f6a3433714a50792e706e67)

## Steps to use the spammer
- Enable the keyboard from the Settings
- Go to WhatsApp>Chats and enable "enter key is send"
- Set your message and number of messages to send(Dont send huge amount of text messages)
- Switch to SPAMit keyboard
- Press the SEND button

## Download
You can download an apk to test this out for yourself from the releases tab - 
[Github - Releases](https://github.com/burhanuday/SPAMit-WhatsApp-Spammer/releases)

## How apps can prevent this
I don't see a simple fix for message bombing like this. However, the messaging client could detect when messages are being typed at inhuman speeds

## Connect with me
You can follow me on DEV or connect with me on [Twitter](https://twitter.com/burhanuday). Subscribe to my [newsletter](https://www.burhanuday.com/)
SCSS to CSS converter - Uber Compute

Published: 2020-06-09 07:29:36

Explore High quality and bug-free Scss to CSS converter online at ubercompute, this scss converter uses high-performance CSS preprocessor in its core that responsible for delivering accurate, clean, and bug-free conversion result. Scss to css converter of ubercompute.com is the best scss compiler online.

Website -: https://www.ubercompute.com/pug-to-html
Electron can be better [RANT]
Tags: javascript, electronjs, webdev, framework
Published: 2020-06-09 07:27:02

Let's make up a situation to explain why Electron is enticing. I am a new developer, very limited in ways of skills. I am proficient in HTML/CSS, with enough JavaScript knowledge to make something work with enough documentation. I have made my app idea, but I want it to use HTML/CSS, as I know how that works. I want easy implementation with JavaScript, I heard about NodeJS, and I want to test it out. I ask my friends would it be better to use UI tools like GTK and Qt available for all languages, or should I use an implementation made by the programming language devs like VUI for V language. We talk and talk until one asks, "Since you know HTML/CSS so well, and you love JavaScript, why not use Electron?" Electron is something I never heard about, my friend explains, it uses NodeJS to emulate a browser, and I can use HTML/CSS to build GUI applications. Electron is a game-changer for me.

Why should I not use Electron? There are many reasons the Electron library is terrible. Notice the wording I use, I say: it emulates a browser. What I mean is, it creates a run time environment with Chromium as the backend. A reasonably modified version of Chromium is what Electron uses. To say this is a bad idea is an understatement. Not only is this a slower method of running a browser, emulating. There are many ways to do emulation, but that isn't required to explain. Emulation is a slow process with running everything on the front-end. While emulation isn't the most delayed, it can be as sluggish to run as containerized systems like Snap.

The main three issues behind Electron being terrible are that it uses emulation or emulation-like systems. It doesn't have a custom HTML/CSS engine. It borrows from Chromium, a browser not too keen on speed. Removing any one of these issues will make others either mute or disappear. Replacing Chromium will help speed enough where we can ignore the emulation, and the custom HTML/CSS engine can be put off. Using a custom HTML/CSS engine removes the issues with speed in emulation and the Chromium problem. Removing their emulation, and using the code from Chromium itself, will make the speeds of Chromium not important enough for the short term to get a new engine or make a custom-built engine.

Electron has issues, but as a whole, the project is usable and well documented enough to say it is still a decent project for web applications. These are my complaints and from my technological standing of how Electron works.
Safeguarding target=_blank links
Tags: security, webdev, html, javascript
Published: 2020-06-09 07:24:27

---
title: Safeguarding target=_blank links
description: Do you know adding a link with target=_blank has the potential of crashing your page and is very insecure? Find out how and its prevention.
cover_image: https://puruvjdev.now.sh/assets/media/link-fence/large.webp
canonical_url: https://puruvj.dev/blog/link-noopener
---

> This article was originally posted at [puruvj.dev](https://puruvjdev.now.sh/blog). Check it out for more content Javascipt and Web development

I'm sure you have added `<a href="..." target="_blank">` to your website before or at least know about it. Well, do you know that it has a potential of crashing your site and even have your user robbed?

Just kidding. I exaggerated a bit there. But seriously, this is a security issue that can be exploited. And it really affects performance, too.

When you click a link with `target="_blank"`, the link opens up in new tab. As usual, nothing much happens. But under the hood, <mark>some of the most important properties</mark> of your page's `window` object get passed to the **page that is going to open** in the `window.opener` property.

One of these properties is the `location` prop.

With the `window.opener` property, the new page can redirect the page from which it was opened to some other page. An e-banking site `icici.com` can be redirected to `1c1c1.com`, and the user will almost always miss this transition. Watch this video I have here to get a feel.

{% youtube z64I7AAeoiA %}

A bit scary, huh?

And there is also the issue of <mark>performance</mark>. The page that opens up runs on the same process as your page, meaning that both pages can become slow and laggy, just because of the other page. Don't link Youtube like this.

# Solution

Just add this little attribute to your link:

```html
rel="noopener"
```

Yup, this little attribute solves all of the above problems. An example of this would be:

```html
<a href="https://twitter.com/puruvjdev" target="_blank" rel="noopener"></a>
```

This is a small measure, but it can pay off really well. Every external link on this blog, for example, has this attribute to it. Check it out if you want to.

[Read more about it here](https://web.dev/external-anchors-use-rel-noopener/)

_That's it for today. Hope you liked the article. Ping me on Twitter if you have any problems or simply leave a review. Link is in the footer._
How to Install and Run Metatrader 5 Windows Application on Ubuntu Linux using WINE Box
Tags: linux, ubuntu, devops, metatrader
Published: 2020-06-09 07:05:48

## TL;DR

Metatrader application run under Windows system. However, did you know that you can also run it on Ubuntu system, if you install WINE Box first?

![Man shrugs](https://dev-to-uploads.s3.amazonaws.com/i/p67th8xr6lun22r6h4v3.gif)

WINE is a simple application that helps you run Windows applications on your Ubuntu system. If you try to download a Metatrader application on your Ubuntu system, you won't be able to do so. However, you can do it by using WINE Box. 

In this video you will learn about WINE Box, which is available as a Docker image. Using Terraform, which is infrastructure as a code, you can instantly deploy your Docker image to a cloud engine. This is as close to a continuous deployment as you can get for Ubuntu VPS.

{% youtube tWZt-MVWVEM %}

00:00 Introduction 
02:30 Deploying Docker image using Terraform
06:30 (Optional) Set Domain to IP address
07:22 Connecting to your Ubuntu Linux VPS via VNC
08:06 Installing Metatrader 5 on Ubuntu Linux
08:48 Login to Metatrader 5 Account
09:42 Conclusion

## Python, R and Metatrader for Trading

https://fxgit.work

## FREE $100 CREDIT

https://bit.ly/dbref001

### FOREX ROBOT
Special Combo Package of WallStreet Forex Robot 2.0 Evolution, Forex Diamond EA and Volatility Factor EA

https://bit.ly/dbclick001

### BUY A COFFEE

https://ko-fi.com/dennislwm

### BE A PATREON

https://patreon.com/dennislwm

### REACH OUT
Twitter: https://twitter.com/leetradetitan
Dev.to: https://dev.to/dennislwm

### CHECK OUT MY YOUTUBE CHANNEL
https://bit.ly/leetradetitan

### MORE VIDEOS
https://youtu.be/wF-4vnW6Rbk - Build Your MT4 Expert Advisor Telegram Bot 
https://youtu.be/u9WBiFmCez0 - Paper Trading in MT4 using SQL (Updated)
Angular App review needed
Tags: codereview, angular
Published: 2020-06-09 06:50:02

Hi,

This is my first post on Dev!

I have created a basic weather app using Angular 9.

Source: https://github.com/abhi747/weather-app-material
Live: https://abhi747.github.io/weather-app-material/

Appreciate any feedback/ review regarding the code and app :)
What Is Umbraco? Is Umbraco Better Than WordPress, Drupal, Or Sitecore?
Published: 2020-06-09 06:34:45

When we think about development, selecting the appropriate content management system comes with some choices, ranging from free to paid options. No website is successful unless it is scalable, secure, feature-packed user-friendly content management systems. WordPress is a popular choice for website builders. It is suitable to choose WordPress for small websites. It doesn’t require much knowledge about web development to create a basic website. Few advanced management systems like Joomla and Sitecore are used to build websites having complex content such as e-commerce, financial or governmental sites.  Sitecore, come with a hefty license fee. Microsoft CMS development platform is the latest in the market. Kentico, Umbraco, DotNetNuke, and Sitefinity are some of the popular Microsoft CMS platforms. But here we will see Umbraco.

**What Is Umbraco CMS?**
Umbraco is a well known cloud-based open source content management system built by using Microsoft ASP.NET framework. It is known for its flexibility to run anything from small to complex applications for fortune 500 companies and some of the largest media sites. Right now more than 100,000 websites are running on this platform. Day by day the popularity of Umbraco is increasing among web developers because of its cloud-based CMS web design system. Since 2011, many customers have migrated to Umbraco because of its amazing benefits. Let us now these benefits.

**Why Should You Use Umbraco?**
*1. Cost-*
Umbraco is free. It doesn’t cost you a license fee or annual subscription. Ranging from Starter to Enterprise it offers plans through their self-hosted service, Umbraco Cloud. As this service is based on their own hosting platform, it allows automated upgrades to the new version of Umbraco, unlimited hosting, and smoother deployments of your website. Employing the expert agency to host, maintain, and build your Umbraco website will allow you more flexibility and customization to your website.

*2. Simple setup-*
It is easy to install and you can easily start to use it without any hassle. Also, you can easily update to its newest versions. It is based on .NET technology. While it does require some web development experience,  it’s very easy to maintain and develop with. The open-source platform of Umbraco allows you to control what you can create. Umbraco is a blank canvas that provides developers tools to create whatever you want.

Know more at- [https://solaceinfotech.com/blog/what-is-umbraco-is-umbraco-better-than-wordpress-drupal-or-sitecore/]
Understanding Kubernetes: part 32 – DaemonSet
Tags: kubernetes, devops, docker, beginners
Published: 2020-06-09 06:23:53

---
title: Understanding Kubernetes: part 32 – DaemonSet
published: true
description: Serie of sketchnotes about Kubernetes. Explaining in a visual way Kubernetes principles.
tags: Kubernetes, DevOps, Docker, beginners
series: Understanding Kubernetes in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/tjtpkdq33s9klen4xawz.jpg
---

Understanding Kubernetes can be difficult or time-consuming. In order to spread knowledges about Cloud technologies I started to create sketchnotes about Kubernetes. I think it could be a good way, more visual, to explain Kubernetes (and others technologies).

We continue the serie of Kubernetes Sketchnotes with a focus on DaemonSet. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tjtpkdq33s9klen4xawz.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tzy6tfjjnbqkzulmk4t0.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/58ndhmz2mpxc0vovzw6y.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/nqv4a5zpz43srwl0lqw4.jpg)

If you are interested, I published all the sketchnotes on Kubernetes (and new ones!) to make a "book" of 120 pages: ["Understanding Kubernetes in a visual way"](https://gumroad.com/aurelievache#uCxcr).

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).
Building a Programming Language Recommendation Tool
Tags: codenewbie, javascript, webapp, programming
Published: 2020-06-09 06:11:26


<h1><b><u>Programming Language Recommender</u></b></h1>


This Javascript based web tool will help you to choose the best programming language that suits you, If you are struck in your life or starting as a beginner, this web tool is perfect for you. Programming has become a vital element in every CSE Student's Life. When you want to start your career as a Web Developer or Software Developer or an Ethical Hacker, but you don't know how to choose, We are here for you. Just simply follow the instructions.


<img src= "https://bbvaopen4u.com/sites/default/files/img/new/recursosprogramadores.png" width="600px" height="320px" alt="important">

<br><br>

<h3>How to use this Tool ?</h3>
<ol style="font-size:20px";>
	<li>Explore different fields in Computer Science.</li>
	<li>Come back again to this website and think to choose an option listed below.</li>
	<li>Choose the best option that suits your goal. </li>
	<li>Now, Click on Continue..</li>
	<li>Your result is displayed below Recommender : </li>
	<li>If you like this, share this link to your friends...</li>
</ol>

<a href="https://www.linkedin.com/in/varaprasad-gudi-0007b4129/"><u>For more details</u> :</a>

<ul>
<li>Liked it, watch out a video on this - <a href="https://youtu.be/ZpdMjmuI0EE">here</a></li>

<li>The link to the tool is <a href="https://gudivaraprasad.github.io/Projects/Programming_Language_Recommender/index.html">here</a></li>

<li>Get Source code at <a href="https://github.com/GudiVaraprasad/Projects/blob/master/Programming_Language_Recommender/index.html">GITHUB</a></li>

<li><h4 style="color:#FE045F;" >This tool is designed by &copy; <a href="https://github.com/GudiVaraprasad" target="_blank">GVP</a></h4></li>
</ul>
-An unrecognized creative Web designer <a href="https://github.com/GudiVaraprasad">@GVP</a>
What is DevOps?
Tags: devops, help, codenewbie, whoishiring
Published: 2020-06-09 05:49:45

What exactly is DevOps? I plan on becoming one because it seems great and fun.

What knowledge, tools and languages I would have to learn and the experience needed for becoming one? I am entirely new to this field so I need help.

Do people really need DevOps for their companies too? I seem to find that DevOps demands are increasing year by year. I would like to know if it's true or not.

Thanks!
Deep Clone of JS Objects with circular dependency
Tags: javascript, webdev, discuss, beginners
Published: 2020-06-09 05:45:50

Deep cloning JS objects has a plethora of blog posts and articles over the internet. But as I see, most or rather all of them end up with a solution of stringifying the JSON object and parsing them back. Somehow I am really unsettled with this solution. Is there any other way of deep clone a JS object?
 
Let's take some scenarios to discuss:
1- Not just one level of nested object, how about atleast 10?
2- What if after a certain point, there is circular dependency in the objects. (Ever heard of the tortoise-hare algorithm in linked list?) How will be approach cloning such an object?

P.S. I do not want to `JSON.parse(JSON.stringify(obj))`.

####Edit: 
Why I don't what to use JSON.stringify?
I came across [this article](https://medium.com/@pmzubar/why-json-parse-json-stringify-is-a-bad-practice-to-clone-an-object-in-javascript-b28ac5e36521) on Medium.
And it was pretty convincing of certain loopholes in using `JSON.stringify`.

I agree that this is the most effective way to convert an object, but I am in a quest for a non-work-around solution. We will deal with performance of cloning later. For now, a base solution!