teleren/devto huggingface dataset:
[UPDATE] มุด Proxy ย้อนกลับ
Tags: ssh, tunnel, socks
Published: 2021-08-11 08:53:28

จากการโพส [https://dev.to/kapong/proxy-3pcm](https://dev.to/kapong/proxy-3pcm) ลง Facebook แล้วได้คำแนะนำจาก [@นเรศ เก็จรัมย์](https://www.facebook.com/koonnarate) พบว่ามีวิธีที่สั้นกว่ามาก โดย SSH Client สามารถทำ SOCKS Proxy ได้ในตัวอยู่แล้ว (จริงๆ เอาไว้เพื่อทำ Tunnel) เราก็สามารถใช้ SOCKS ตัวนั้นเป็น Proxy Server ย้อนกลับมาได้เลย

# ด้วย

```
$ ssh -R <port> <user>@<host>
```

หลังจากนั้น เมื่อเข้าไป Server แล้วก็กำหนด HTTP Proxy เพื่อใช้งานได้โดย

```
export {http,https,ftp,rsync,dns}_proxy=socks5h://127.0.0.1:<port>
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
```

ก็เสร็จเลย ข้ามไปหลายขั้นตอนเลยทีเดียว

## เพิ่มเติม 1

มี software ที่จะช่วยให้ใช้ proxy http เป็นบางคำสั่งได้ นั่นคือ `proxychains` ลองค้นๆต่อเอานะ ก็สะดวกไปอีกแบบ

## เพิ่มเติม 2

เปลี่ยน `-R` เป็น `-D` คือกลับทิศกัน
Best programming languages to learn as a begginer
Tags: programming, beginners
Published: 2021-08-11 08:44:56

## Introduction
In this article, I am going to briefly present to you the top five programming languages to learn as a beginner programmer.

**NOTE**: Whatever programming language you choose, the most important thing is to learn the concepts.




## 5. C++
https://www.cplusplus.com/
Though old, c++ is one of the best programming languages out there. It's object-oriented and perfect for many use cases, including embedded programming, game programming, and GUI development. C++ adds OOP concepts to the c programming language. You may find it a bit hard to learn it as a first language, but it will help you establish a solid base in OOP and statically typed languages.

## 4. Go (Go Lang)
https://golang.org/
Go is a fairly new programming language made by google. It's somewhat similar to python but it's statically typed. Go is one of the 4 tolerated programming languages at google and it's widely used. Go is used in many different cases, including back-end web development. Go strikes as an easy and elegant language to learn.

## 3. Python 
https://www.python.org/
Python is a widely use dynamically typed programming/scripting language. It's very popular and easy to learn with its English-like syntax. Python is very powerful and it can be used in many different scenarios, including web development, game dev(Godot), scripting, hacking, etc.

## 2. Java
https://www.java.com/en/
Java is a very popular programming language, perhaps the most popular. It is widely used by enterprises because of its reliability. It runs on the JVM(Java Virtual Machine), meaning that it can run almost everywhere. It's used for backend web dev, game dev (ex. Minecraft Java Edition), GUI dev, and general software dev.

-----------

## Honorable mentions

### Rust 
https://www.rust-lang.org/
Rust is a multi-paradigm, high-level, general-purpose programming language designed for performance and safety, especially safe concurrency. Rust is syntactically similar to C++ but can guarantee memory safety by using a borrow checker to validate references.

--------------------------------------------
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snbstu1qbdd9bqyk6tra.gif)

## 1. Javascript
https://www.javascript.com/
Javascript, also known as ECMAScript, is one of the most popular programming languages out there. Javascript is dynamically typed and it runs natively on web browsers. It's very popular because you can use it anywhere (front end, backend, mobile, etc.). It has a very simple syntax and implements concepts from OOP and FP.

==================
## Conclusion
Learning your first programming language is not easy, but you will eventually succeed and you will find the cs concepts transferable from a programming language to another.
New To Flask? Take a look here.
Tags: python, flask
Published: 2021-08-11 08:42:57

## Why Flask?
> Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. It began as a simple wrapper around Werkzeug and Jinja and has become one of the most popular Python web application frameworks.

---


### Why `__name__` is used?
```python
from flask import Flask

# this __name__ is required!
app = Flask(__name__)
```
> The first argument is the name of the application’s module or package. __name__ is a convenient shortcut for this that is appropriate for most cases. This is needed so that Flask knows where to look for resources such as templates and static files.



---


### Easy reload
```python
if __name__ == "__main__":
    # note that `debug=True`
    app.run(debug=True)
```
> The `debug=True` server provides an interactive debugger and will reload when code is changed. So, no need to stop the app, and restart it again. Just save a python file, and the server will automatically reload.



---


### Sessions
```python
## CODE FROM: 
## https://flask.palletsprojects.com/en/2.0.x/quickstart/#sessions
from flask import session

# Set the secret key to some random bytes. Keep this really secret!
app.secret_key = b'_5#y2L"F4Q8z\n\xec]/'

@app.route('/')
def index():
    if 'username' in session:
        return f'Logged in as {session["username"]}'
    return 'You are not logged in'

@app.route('/login', methods=['GET', 'POST'])
def login():
    if request.method == 'POST':
        session['username'] = request.form['username']
        return redirect(url_for('index'))
    return '''
        <form method="post">
            <p><input type=text name=username>
            <p><input type=submit value=Login>
        </form>
    '''

@app.route('/logout')
def logout():
    # remove the username from the session if it's there
    session.pop('username', None)
    return redirect(url_for('index'))
```
> session allows you to store information specific to a user from one request to the next. This is implemented on top of cookies for you and signs the cookies cryptographically. What this means is that the user could look at the contents of your cookie but not modify it, unless they know the secret key used for signing.


---



#### Custom 404 Pages
```python
from flask import render_template

@app.errorhandler(404)
def not_found(error):
    # assuming you have `error.html` at `templates` directory
    return render_template('error.html')
```


------



Reference: [Flask](https://flask.palletsprojects.com/en/2.0.x/)
Add Borders to Cells in Excel Using Java
Tags: java, excel, border
Published: 2021-08-11 08:10:39

This article will introduce how to add borders to cells in an Excel file using a 3rd party free library.

**Installation (2 Method)**
**1#** Download the free library ([Free Spire.XLS for Java](https://www.e-iceblue.com/Download/xls-for-java-free.html)) and unzip it, then add the Spire.Xls.jar file to your project as dependency.
**2#** You can also add the jar dependency to maven project by adding the following configurations to the pom.xml.
```xml
<repositories>
        <repository>
            <id>com.e-iceblue</id>
            <name>e-iceblue</name>
            <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
        </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>e-iceblue</groupId>
        <artifactId>spire.xls.free</artifactId>
        <version>3.9.1</version>
    </dependency>
</dependencies>
```

**Sample Code**
```java
import com.spire.xls.*;
import java.awt.*;

public class AddBorders {
    public static void main(String[] args){
        //Create a workbook instance
        Workbook workbook = new Workbook();
        //Load the Excel file
        workbook.loadFromFile("C:\\Users\\Administrator\\Desktop\\input.xlsx");

        //Get the first worksheet
        Worksheet sheet = workbook.getWorksheets().get(0);

        //Get the cell range that you want to apply border style
        CellRange cr = sheet.getCellRange(sheet.getFirstRow(), sheet.getFirstColumn(), sheet.getLastRow(), sheet.getLastColumn());

        //Apply border style
        cr.getBorders().setLineStyle(LineStyleType.Double);
        cr.getBorders().getByBordersLineType(BordersLineType.DiagonalDown).setLineStyle(LineStyleType.None);
        cr.getBorders().getByBordersLineType(BordersLineType.DiagonalUp).setLineStyle(LineStyleType.None);
        cr.getBorders().setColor(Color.BLUE);

        //Save the resultant file
        workbook.saveToFile("SetBorder.xlsx", ExcelVersion.Version2010);
    }
}
```

**Before**
![input](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kn9g4v129ccvriqijuci.jpg)

**After**
![border](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lmgo27erahjplqbpssdg.jpg)
100days of Code
Tags: 100daysofcode, programming, javascript, webdev
Published: 2021-08-11 07:42:11


Hello Everyone,
I'm Al Siam a Frontend Developer. I've started my journey to be a Web Developer this year 2021. For the past few months, I have completed learning Web design & some Initial skills. And I had started my complete Web Development journey in July. 

From July I have started to learn Javascript as my first programming language. And for the next few months, I am going to learn Javascript and its frameworks. So, that's why I have a plan that I will do a 100daysofcoding challenge. I will post every single day what I have learnt today. So, please wish me the best of luck.

To anyone who knows how to code: please help me by suggesting how I can improve my skills better.

To anyone learning to code: please follow and ask your own questions about my code and about the problems. we will all learn even more together.
Some Powerful Js One-liners
Tags: javascript, array, react, node
Published: 2021-08-11 07:34:49

Javascript is one of the most powerful language in this modern world.In this article we will go through some of the useful js one-liners.
###Remove Duplicates in an Array.
```javascript
const array = [12, 23, 54, 69, 4, 12, 23];
console.log(array); // [12, 23, 54, 69, 4, 12, 23]
const RemoveDuplicates = (arr) => [...new Set(arr)];
console.log(RemoveDuplicates(array)); // [12, 23, 54, 69, 4]
```
###Generate a random Id
```javascript
const randomId = Math.random().toString(36).substring(2);
console.log(randomId); // ituzp41cq08
```
###shuffle an Array
```javascript
const alpha = ["A", "B", "C", "D", "E", "F"];
console.log(alpha); // ["A", "B", "C", "D", "E", "F"]
console.log(alpha.slice().sort(() => Math.random() - 0.5)); // ["B", "A", "C", "E", "F", "D"]
```
###Swapping two variables
```javascript
let a = 10;
let b = 5;
console.log(a, b); // 10 5

[a, b] = [b, a];
console.log(a, b); // 5 10
```
###Assign Multiple variables
```javascript
let [x, y, z, w] = [4, 0.5, "Ajith", ["a", "b"]];
console.log(x, y, z, w); //4 0.5 "Ajith"  ["a", "b"]
```
###Reverse a String
```javascript
const reverseString = (arr) => arr.split("").reverse().join("");
console.log(reverseString("I love to code in javascript")); //tpircsavaj ni edoc ot evol I
```
###Merge multiple arrays
```javascript
const languages = ["js", "c", "go", "java"];
const frameworks = ["react", "angular", "ruby on rails", "larvel"];
const combined = languages.concat(frameworks);
console.log(combined); //["js", "c", "go", "java", "react", "angular", "ruby on rails", "larvel"]
```
##Do like and save this post for future reference 🚀💯
Create a Netflix clone from Scratch: JavaScript PHP + MySQL Day 16
Tags: php, javascript, webdev, tutorial
Published: 2021-08-11 07:22:04

Netflix provides streaming movies and TV shows to over 75 million subscribers across
the globe. Customers can watch as many shows/ movies as they want as long as they are
connected to the internet for a monthly subscription fee of about ten dollars. Netflix produces
original content and also pays for the rights to stream feature films and shows.

In this video,we will create the register functionalities

{% youtube 3xi51NhGCG8 %}

If you like my work, please consider
[![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jm11knj7d8zwcvo150q2.png)](https://www.buymeacoffee.com/cglikpo)
so that I can bring more projects, more articles for you

If you want to learn more about Web Development, feel free to [follow me on Youtube!](https://www.youtube.com/c/ChristopherGlikpo)
Java Question Bank with Solutions
Tags: java, learning, programming
Published: 2021-08-11 07:09:42

Want to practice those newly learned Java concepts, but do not have a question bank with solutions? Look no further! [This](https://github.com/saxenamansi/Java-Beginner-To-Intermediate)  GitHub repository has it all!

The concepts covered are - 
1. Basic Java Questions
2. Array Questions
3. String Questions
4. Object Oriented Questions - Classes and Objects
5. Object Oriented Questions - Interfaces, Inheritance, Abstract Classes, Packages
6. Exception Handling Questions 
7. Multi-Threading Questions
8. File Handling Questions
9. Collections Questions- ArrayList
10. JDBC Questions (with concepts)
11. JavaFX Questions

If these solutions help you, let me know and reach out to me for any further help/doubts. Happy Learning!
Policy Reporter – Kubernetes Policy Dashboard
Tags: kubernetes, security, policy
Published: 2021-08-11 07:02:00

[Kyverno](https://kali-linuxtr.net/kyverno-kubernetes-native-policy-management) ships with two types of validation. You can either enforce a rule or audit it. If you don’t want to block developers or if you want to try out a new rule, you can use the audit functionality. The audit configuration creates PolicyReports which you can access with kubectl. Because I can’t find a simple solution to get a general overview of this PolicyReports and PolicyReportResults, I created this tool to send information about PolicyReports to different targets like Grafana Loki, Elasticsearch or Slack.

[Policy Reporter](https://kali-linuxtr.net/policy-reporter-kubernetes-policy-dashboard)
Learning Python- Intermediate course: Day 6, Math Exercises
Tags: learningpython, programming, beginners, codenewbie
Published: 2021-08-11 06:49:38

In the last part we covered the math module. In this part, we will solve some questions related to it.
---
____
### Sample questions.
- Write a program to check if a number is an ["Armstrong number"](https://en.wikipedia.org/wiki/Narcissistic_number) or not 
```python
def armstrong(x):
    a=str(x) #convert int to string to make it iteratable
    counter=0
    Sum=0
    for i in a:
        counter=counter+1
    
    for i in a:
        Sum=Sum+pow(int(i),counter)
    if(Sum==x):
        return True
    return False
print(armstrong(153))
print(armstrong(1723))
```
```
True
False
```
#### Alternative 
```python
def armstrong(x):
    n = 0
    i=x
    while (i != 0):
        n = n + 1
        i = i // 10
    temp = x
    Sum = 0
    while (temp != 0):
        r = temp % 10
        Sum = Sum + pow(r, n)
        temp = temp // 10
    return (Sum == x) #shorthand for if Sum==x return True else return False
print(armstrong(153))
print(armstrong(1723))
```
```
True
False
```

- Write the function power which returns the number raise to a power without using the math function `pow()`
```python
def power(x, y):      
    if (y == 0):
        return 1
    if (y % 2 == 0):
        return power(x, y // 2) * power(x, y // 2)      
    return x * power(x, y // 2) * power(x, y // 2)
print(power(2,3))
print(pow(2,3))
```
```
8
8
```
> **Logic** The function power is a function which makes use of recursion in Python. The power is raised using recursive multiplication. 

#### Alternative-
```python
def power(a, b):
    temp=a
    for i in range(1,b):
        temp=temp*a
    return temp
print(power(3,4))
print(pow(3,4))
```
```
81
81
```

### Exercise.
Write the following functions without using their predefined math versions.
- `hypot()`
- `sqrt()`
- `asinh()`

Answers in the [Learning Python Repository](https://github.com/Aatmaj-Zephyr/Learning-Python)
_____
So friends that's all for this part. 😊 Hope you all are enjoying.😎 Please let me know in the comment section if you liked it or not. 🧐 And don't forget to like the post if you did. 😍 I am open to any suggestions or doubts. 🤠 Just post in the comments below or Gmail me. 😉
Thank you for being so patient.👍
Also please visit the [Learning-Python repo](https://github.com/Aatmaj-Zephyr/Learning-Python) made especially for this course and don't forget to star it too!!!
Weekly web development resources #84
Tags: weekly, webdev
Published: 2021-08-11 06:32:31



______

##[Jotai](https://docs.pmnd.rs/jotai/introduction)
[![Jotai](https://wweb.dev/weekly/content/84/jotai.jpg)](https://docs.pmnd.rs/jotai/introduction)
A primitive and flexible state management for React.

______

##[LÖVR](https://lovr.org/)
[![LÖVR](https://wweb.dev/weekly/content/84/lovr.jpg)](https://lovr.org/)
An open source framework for rapidly building immersive 3D experiences.

______

##[Boltz Engine](https://github.com/bsnk-dev/boltz-engine)
[![Boltz Engine](https://wweb.dev/weekly/content/84/boltz.jpg)](https://github.com/bsnk-dev/boltz-engine)
A fast Node.js microservices engine for running cloud functions.

______

##[LiveKit](https://livekit.io/)
[![LiveKit](https://wweb.dev/weekly/content/84/livekit.jpg)](https://livekit.io/)
An open source project that provides scalable, multi-user conferencing over WebRTC.

______

##[AVPress](https://avpress.zaps.dev/)
[![AVPress](https://wweb.dev/weekly/content/84/avpress.jpg)](https://avpress.zaps.dev/)
 An in-browser video compressor that leverages FFMPEG.wasm

______

##[StackFinder](https://marketplace.visualstudio.com/items?itemName=mark-fobert.stackfinder)
[![StackFinder](https://wweb.dev/weekly/content/84/stackfinder.jpg)](https://marketplace.visualstudio.com/items?itemName=mark-fobert.stackfinder)
A VS Code extension for finding stackoverflow answers and pasting them into your code.

______

##[Superhero Animation Effect with SVG Filters](https://tympanus.net/codrops/2021/08/09/superhero-animation-effect-with-svg-filters/)
[![Superhero Animation Effect with SVG Filters](https://wweb.dev/weekly/content/84/superhero-animation.jpg)](https://tympanus.net/codrops/2021/08/09/superhero-animation-effect-with-svg-filters/)
A tutorial how to create an interactive illustration effect using SVG filters and masks.

______

##[Using Absolute Value, Sign, Rounding and Modulo](https://css-tricks.com/using-absolute-value-sign-rounding-and-modulo-in-css-today/)
[![Using Absolute Value, Sign, Rounding and Modulo](https://wweb.dev/weekly/content/84/css-today.jpg)](https://css-tricks.com/using-absolute-value-sign-rounding-and-modulo-in-css-today/)
A nice article by Ana Tudor on CSS-tricks.

______

##[CSS Gradients](https://baseline.is/tools/css-gradients/)
[![CSS Gradients](https://wweb.dev/weekly/content/84/css-gradients.jpg)](https://baseline.is/tools/css-gradients/)
A website with 42 CSS gradients, with easy editing features.

______

To see all the weeklies check: [wweb.dev/weekly](https://wweb.dev/weekly)
Derealize
Tags: tailwindcss
Published: 2021-08-11 06:25:02

---
title: Derealize
published: true
description: tailwindcss editor for front-end peoject
tags: tailwindcss
cover_image: https://assets-derealize-com.onrender.com/hero.png
---

[Derealize](https://derealize.com) is a tailwindcss editor that play with the development mode front-end projects.

Traditional tailwindcss editors (e.g. windicss.org/play) edits an html component that is separate from the front-end project. After each edit, you need to manually synchronize the html component to your front-end project. The modular nesting of a front-end project may be very complicated and uncertain. Until I saw ui-devtools (thanks for the inspiration it gave). It play with the front-end project rather than html components. Unfortunately, its working model limits UI design to the hands of front-end engineers (can't avoid some professional command line knowledge). So I thought that if I could integrate the node/git environment in an electron application, people not familiar with any code knowledge could also edit the UI of real front-end projects with the help of tailwindcss and get into the CI/CD pipeline! It seems that this goal is a bit whimsical, I hope we can approach it.

YouTube: {% youtube eR5BS3egrDQ %}
HTML tags | data
Tags: html, tags, data
Published: 2021-08-11 06:24:39

It is used to **provide a machine-readable translation of a certain content**, for example a price or code in a list of products.

If the content is related to a time or a date, use `<time>` instead.

The `value` attribute **specifies the translation of the content** that will be machine readable.

- Type: *inline*
- Self-closing: *No*
- Semantic value: *No*

[Definition and example](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/data) | [Support](https://caniuse.com/mdn-html_elements_data)
Are you a tech expert? And you want to leverage your skills by teaching others?
Published: 2021-08-11 06:21:33

Professionals are turning into creators nowadays to leverage their skills. Are you one of them?

Creating a course is not easy, especially if there are:
-several tools to use
-your fighting with thousands of competitors
-too many ways on how to create courses
-you don't have a background in teaching
-your audience wants everything for free

We know it and we wanna help. How? By creating a community where you can find a support system to improve your craft.

***

We're building the first-ever community of Cohort-based courses. There's an increasing volume of blogs and articles that discussed the benefits of cohort-based courses (or CBCs). We think it's the future of online education. Do you agree?

In Cohort-based course,
-you can use one platform, all tools are there
-get free marketing through word of mouth and referrals. If your course is good, your students will tell their friends even their enemies
-you don't need to be a teacher to teach. You need to be an entertainer (making the course interactive and engaging), and an instructor (to share what you know and show them "how" you do it.)
-students don't pay if they aren't sure what will they get in the end; yet students pay if they are sure they'll gain something in the end.
 
Yes, it's hard to create a course. My mother always says, "educating is a vocation, not a profession"

But it's worth it :) You'll impact someone's life while making a living.

Join the community of creators ->
https://airtable.com/shrKPO4QYiag1a4i0

#career #onlinelearning #courses #tech