teleren/devto huggingface dataset:
Setting Up an SSH Server on Windows with PowerShell
Published: 2023-09-12 06:12:46

## Introduction
Secure Shell (SSH) is a widely used protocol for secure remote access to servers and systems. While SSH is commonly associated with Unix-based systems, you can also enable and configure an SSH server on Windows. In this guide, we'll walk through the process of setting up an SSH server on Windows using PowerShell commands.

### Step 1: Check for OpenSSH Capability
First, let's check if your Windows machine already has the OpenSSH capability installed. Open PowerShell and run the following command:

```powershell
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
```

This command lists the OpenSSH capabilities available on your system.

### Step 2: Install OpenSSH Server Capability
If you don't see the OpenSSH.Server capability listed, you can install it with the following command:

```powershell
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
```

This command adds the OpenSSH Server capability to your Windows installation.

### Step 3: Start the SSH Server
Next, start the SSH server service with the following command:

```powershell
Start-Service sshd
```

This command initiates the SSH server service.

### Step 4: Set SSH Server to Start Automatically
To ensure the SSH server starts automatically with Windows, use the following command:

```powershell
Set-Service -Name sshd -StartupType 'Automatic'
```

This command configures the SSH server service to start automatically during system boot.

### Step 5: Configure the Firewall Rule
To allow SSH traffic through the Windows firewall, create a firewall rule using this command:

```powershell
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
```

This command creates a rule named 'sshd' that allows incoming SSH traffic on port 22 (the default SSH port).

### Step 6: Verify the Firewall Rule
You can verify that the SSH firewall rule is correctly configured using this command:

```powershell
Get-NetFirewallRule sshd
```

This command will display the details of the SSH firewall rule.

### Conclusion
Congratulations! You've successfully set up an SSH server on your Windows machine using PowerShell commands. Now you can securely access your Windows system remotely using SSH. This capability can be particularly useful for system administration and remote troubleshooting.

Feel free to explore more SSH-related configurations and use cases to enhance your Windows SSH server setup further.

**_Happy SSHing!_**
Better `useEffect` is here
Tags: react
Published: 2023-09-03 12:16:03

[react-eff-hook](https://github.com/gwyng-dev/react-eff-hook) introduces `useEff`, an enhanced `useEffect` powered by Generator.

## Usage
```js
useEff(function*() {
  while (true) {
    yield delay(1000)
    
    setCount((x) => x + 1)
  }
}, [])
```

So, why is it better? Let's compare it to the code using `useEffect`.

```js
useEffect(() => {
  let cancelled = false
  void (async () => {
    while (!cancelled) {
      await delay(1000)

      setCount((x) => x + 1)
    }
  })()
  return () => { cancelled = true }
}, [])
```

- Ugly IIFE to avoid being asynchronous callback
- Manually stop the loop on cleanup

They are all gone with `useEff`.

If you wish to have the promise value's type inferred, use `wait` in conjunction with `yield*` like so:
```js
const data = yield* wait(fetch(url))
```
Then you will get `data` with its right type.

Furthremore, `useEffect` doesn't work fine with new `using` syntax in TypeScript 5.2.

`useEff` does.

```js
class Interval {
  constructor(fn: () => void, interval: number) {
    this.interval = setInterval(fn, interval); 
  }
  
  [Symbol.dispose]() {
    clearInterval(this.interval)
  }
}

const never = new Promise(() => {})

useEff(function*() {
  using interval = new Interval(
    () => { setCount((x) => x + 1) }, 
    1000)

  yield never
}, [])
```

Also, you can use `useLayoutEff` and `useInsertionEff` which are better versions of `useLayoutEffect` and `useInsertionEffect` respectively.

## Caveat(or Feature?)
While `useEff` automatically handles cleanup, it handles erros in a different way from `useEffect`.

Both `useEff` and `useEffect` trigger cleanup functions upon deps changes or component unmounts, ensuring you don't need to worry about successful effects. 

`useEffect` disregards errors thrown by promises within it, whereas the disposables within `useEff` invoke their dispose functions when any error occurs. 

While this may be seen as a more desirable behavior, it may not be compatible with `useEffect`.

However, I'm not entirely certain. Please let me know if you encounter any issues with this behavior.
Supercharging Node.js Dependencies with Bun in Your Laravel Project
Published: 2023-09-12 06:02:02

Introduction:
Recently, I came across an exciting JavaScript tool that got me pumped up – Bun. It's a powerful "all-in-one toolkit for JavaScript and TypeScript apps" that can be considered a worthy alternative to NPM and Yarn, but with one notable difference – it's incredibly fast.

In this blog post, we'll explore how you can leverage Bun as a replacement for NPM and Yarn in your local development environment and discover how it can supercharge your typical Laravel application.

Installing Bun

Getting Bun up and running is a breeze. Depending on your system, you can choose from the following installation methods:

For Mac, Linux, or WSL Users:

```
curl -fsSL https://bun.sh/install | bash

```
Homebrew Users:
If you prefer to use Homebrew:

```
brew tap oven-sh/bun
brew install bun

```
Please note that Windows users can access an experimental native build of Bun, which comes with limited features for now, but it's a promising start. Features like adding, removing, and installing packages are not fully functional on Windows yet.

Once Bun is successfully installed, you can confirm it by running the following command in your Terminal:

```
bun --version

```

Utilizing Bun

Now that Bun is at your disposal, let's see how you can replace NPM and Yarn in your workflow. To demonstrate, we'll work with a fresh Laravel Jetstream application featuring Inertia and Vue.

To install all dependencies from an existing package.json file, simply execute the following command:

```
bun install

```
Installing Dependencies with Bun

Adding dependencies with Bun is just as straightforward as you're used to with Yarn or NPM. To install a new dependency, use:

```
bun add [PACKAGE_NAME]

```

If you want it as a dev-dependency instead:

```
bun add -d [PACKAGE_NAME]

```

And just like the install command, adding new dependencies is remarkably fast.

Removing Dependencies

Need to clean house and remove some dependencies? Bun has you covered there too. Use the rm or remove command:

```
bun rm [PACKAGE_NAME]

```
And there you have it! With Bun in your toolkit, you can replace NPM and Yarn, experiencing up to 33x faster performance. Happy coding!
Slash Saber: endless game made in ThreeJS and Vue
Tags: showdev, gamedev, threejs, webdev
Published: 2023-09-12 05:59:05

Try it out: **[slashsaber.com](https://slashsaber.com)**

I've been working on this for a few months now. I'm open to any feedback.

Source code: **[github.com/honzaap/SlashSaber](https://github.com/honzaap/SlashSaber)**

Some 3D assets are also available in the [GitHub repo](https://github.com/honzaap/SlashSaber).
Advanced Carousel In Doodle
Published: 2023-09-12 05:49:04

[Tutorial](https://nacular.github.io/doodle-tutorials/docs/timedcards) showing how to make this app using Doodle's powerful [Carousel APIs](https://nacular.github.io/doodle/docs/ui_components/overview#carousel). This app is multi-platform, which means it runs in the browser and as a desktop application.

[Doodle](https://github.com/nacular/doodle) is a pure Kotlin UI framework for the Web (and Desktop), that lets you create rich applications without relying on Javascript, HTML or CSS.
Small Business Success: Thriving Through Affordable Outdoor Advertising Strategies
Published: 2023-09-12 05:47:12

In the ever-competitive world of marketing, small businesses often find themselves grappling with limited budgets. While digital advertising has gained prominence in recent years, [Outdoor Advertising Agency](https://www.excellentpublicity.com/blog/small-business-success-thriving-through-affordable) In India remains a valuable tool for reaching local audiences and building brand awareness. In this comprehensive guide, we'll explore cost-effective strategies that small businesses can employ to leverage the power of outdoor advertising without breaking the bank.
Significant benefits of ESG reporting software to entities
Tags: esg, sustainability, carbonemission
Published: 2023-09-12 05:44:23

Identify risk and mitigate that. 
Increase brand reputation.
Customize ESG Reports. 
 Gain more investors. 
 Measure ESG Performance. 
Data integrated with various platforms. 


**Identify risk and mitigate that:** 

As a human being, we cannot predict the risk.  But we can prevent that before it occurs, analyze entities ESG data through can prevent risk before it happens.  ESG reporting software identify possibilities where have risk opportunities and provides comprehensive solution way to overcome and mitigate that. 
If Risk happens, it definitely affects entities financial performance and reputations.  Its software immensely help to avert from risk. 
      
**Increase brand reputation:** 

Those which an organization possesses a good ESG portfolio including emission reports it helps to increase brand values.   If an entities transparently disclose their sustainability reports which are increases values among investor, stakeholder, customer, employees  and more. 
Therefore, a proper ESG portfolio will be increased brand reputation.  


**Customize ESG Reports**: 

Objectives are varied to all types of entities, their goals also different.  So, based on the business and based on objectives entities can customize their ESG report. 
   
**Gain more investors**: 

More than 80 percent of investors consider organization ESG reports before investing.  Across the world, many countries' investors pay more attention to ESG data.  Therefore, many organizations transparently disclose financial reports along with sustainability reports. 

A entities whose disclose their ESG reports transparently it increases brand values among investors.  So, transparency leads to more potential investors. 

**Measure ESG Performance**: 

ESG reporting software provides comprehensive details about Gap analysis, ESG mapping and UN SDGs.
 furthermore, from the analysis of  ESG data it identify where require more attention and where energy consumption become waste all details measure through ESG data. 
Therefore, it measuring tool helps to measure entities ESG Performance. 
  
**Data integrated with various platforms**: 

If entities want to measure and tracks their ESG performance, they have to collects various Data from various resources.   Some data is to be financial, some data is to be operational and more.  So, data collection is more complex than we think.  
 
If  entities want to track ESG performance they have to collect  and  connect various data  together.   Each data store has different platforms, so not easy data collections. Reporting software  collects all ESG data and connects together generate enhance ESG Reports. 

Therefore, make it easy integration with helps of reporting tool.
  
**In the nutshell**: 

[ESG reporting software](https://www.updapt.com/solutions/esg-reporting) efficiently measures performance which helps to improve organization sustainability.  Start ESG journey with Updapt ESG reporting software. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/75455m0kguk5ct7po80n.png)
AntDB-Oracle Compatibility Developer's Manual P3–50
Published: 2023-09-12 05:32:35

#### Aggregation and Analysis Functions

Aggregation functions serve to compute a single result value based on a collection of input values. The following table lists the built-in aggregation functions.

| Name| Number of arguments| Function| For example:
|----------|----------|----------|----------
| AVG| 1| Used to calculate the average of expressions within a group and data window.| select avg(col) from test1; avg(distinct col) avg(all col)
| COUNT| 1| Cumulative count of what happens within a group| count(col) count(distinct col) count(all col) count(\*)
| MAX| 1| Find the maximum value of an expression in a data window in a group| max(col) max(distinct col) max(all col)
| MIN| 1| Find the minimum value of an expression in a data window in a group| min(col) min(distinct col) min(all col)
| SUM| 1| This function calculates the cumulative sum of the expressions in the group| sum(col) sum(distinct col) sum(all col)

It should be noted that except for the function COUNT, when there is no query out of the record, other functions return null. In particular, if there are no records, the function SUM returns null, rather than 0 as expected. When necessary, we can use the function COALESCE to replace the null value with 0.

The following details the aggregation functions usually used for statistical analysis. The analysis function is used to calculate some kind of aggregated values based on groups, and it differs from the aggregation function in that it returns multiple rows for each group, while the aggregation function returns only one row for each group. The reason for listing them separately from the generic aggregation functions above is to make their respective functions clearer.
AntDB-Oracle Compatibility Developer’s Manual P3–48
Published: 2023-09-12 05:28:54

##### Current Date/time

AntDB provides a number of functions to return values related to the current date and time. SYSDATE and SYSTIMESTAMP return the time of the current execution of SQL, other functions return values based on the start time of the current transaction, their values do not change during the transaction run, its purpose is to allow a single transaction to have a consistent current time, so multiple modification operations in the same transaction use the same timestamp.

- CURRENT\_DATE

- CURRENT\_TIMESTAMP

- LOCALTIMESTAMP

- LOCALTIMESTAMP(precision)

- SYSDATE

- SYSTIMESTAMP

- cSESSIONTIMEZONE

- DBTIMEZONE

We can provide a precision parameter to LOCALTIMESTAMP so that the result can be rounded to multiple decimal places in the seconds field. If there is no precision parameter, the return is a fully valid precision.

```
SELECT CURRENT_DATE FROM DUAL;

        DATE         
---------------------
 2020-09-29 17:28:28
(1 row)

SELECT LOCALTIMESTAMP FROM DUAL;

         TIMESTAMP          
----------------------------
 2020-09-29 17:28:41.485867
(1 row)

SELECT LOCALTIMESTAMP(2) FROM DUAL;

       TIMESTAMP        
------------------------
 2020-09-29 17:30:27.93
(1 row)

SELECT SYSDATE FROM DUAL;

     ORA_SYS_NOW     
---------------------
 2020-09-29 17:29:11
(1 row)

SELECT SYSTIMESTAMP FROM DUAL;
        ORA_SYS_NOW         
-----------------------------------------
 2020-09-29 17:30:02.186407
(1 row)

SELECT SESSIONTIMEZONE FROM DUAL;
 ORA_SESSION_TIMEZONE 
--------------------------------------------
 +08:00
(1 row)

SELECT CURRENT_TIMESTAMP FROM DUAL;
        CURRENT_TIMESTAMP         
-----------------------------------------------------
 2020-09-29 17:31:41.56663 +08:00
(1 row)

SELECT DBTIMEZONE FROM DUAL;
 ORA_DBTIMEZONE 
--------------------------------
 +08:00
(1 row)
```
AntDB-Oracle Compatibility Developer’s Manual P3–47
Published: 2023-09-12 05:25:30

The following example truncates the date to the start of the week (Sunday).

```
SELECT TRUNC(TO_DATE('09-AUG-07','DD-MON-YY'),'DAY') "Day of Week" FROM DUAL;

     Day of Week     
--------------------------------
 2007-08-05 00:00:00
(1 row)
```

The following example truncates the date to the hour.

```
SELECT TO_CHAR(TRUNC(TO_DATE('09-AUG-07 08:30','DD-MON-YY HH:MI'),'HH'),'DD-MON-YY HH24:MI:SS') "Hour" FROM DUAL;

Hour
--------------------------------
09-AUG-07 08:00:00
(1 row)
```

The following example truncates the date to the minute.

```
SELECT TO_CHAR(TRUNC(TO_DATE('09-AUG-07 08:30:30','DD-MON-YY HH:MI:SS'),'MI'),'DD-MON-YY HH24:MI:SS') "Minute" FROM DUAL;

Minute
------------------------------
09-AUG-07 08:30:00
(1 row)
```
AntDB-Oracle Compatibility Developer’s Manual P3–46
Published: 2023-09-12 05:22:21

The following example truncates the date to the start of the quarter in which the current date is located.

```
SELECT TRUNC(TO_DATE('16-FEB-07','DD-MON-YY'),'Q') "Quarter" FROM DUAL;

       Quarter       
---------------------
 2007-01-01 00:00:00
(1 row)
```

The following example truncates the date to the start of the month.

```
SELECT TRUNC(TO_DATE('16-DEC-07','DD-MON-YY'),'MONTH') "Month" FROM DUAL;

        Month        
---------------------
 2007-12-01 00:00:00
(1 row)
```

The following example truncates the date to the start date of the week in which the date falls, which is determined by the week date of the first day of the year. For example, the first day of 2007 is Monday, so the date of the Monday before January 19 is January 15.

```
SELECT TRUNC(TO_DATE('19-JAN-07','DD-MON-YY'),'WW') "Week" FROM DUAL;

        Week         
---------------------
 2007-01-15 00:00:00
(1 row)
```

The following example truncates the date to the beginning of an ISO week. An ISO week starts on a Monday, and the date that falls on the ISO week is January 2, 2004, so the ISO week starts on December 29, 2003.

```
SELECT TRUNC(TO_DATE('02-JAN-04','DD-MON-YY'),'IW') "ISO Week" FROM DUAL;

      ISO Week       
--------------------------------
 2003-12-29 00:00:00
(1 row)
```

The following example truncates the date to the start of the week, which is considered to be the same as the first day of the month.

```
SELECT TRUNC(TO_DATE('21-MAR-07','DD-MON-YY'),'W') "Week" FROM DUAL;

        Week         
--------------------------------
 2007-03-15 00:00:00
(1 row)
```

The following example truncates the date to the start of the day.

```
SELECT TRUNC(TO_DATE('04-AUG-07 12:00:00 PM','DD-MON-YY HH:MI:SS AM'),'J') "Day" FROM DUAL;

         Day         
--------------------------------
 2007-08-04 00:00:00
(1 row)
```
Including Files in Next.js API on Vercel: A Guide for Email Templates
Tags: nextjs, webdev, tutorial, javascript
Published: 2023-09-12 05:22:09

Quick Guide:

If you're looking to include static files in your Next.js API on Vercel for use with Nodemailer (or any other purpose) similar to using included files in Netlify's `.toml` file, you can achieve this by using a combination of `readFileSync` from the fs package and `path.resolve` from the path package. For instance, if you have an `emails` folder in the **root** directory, with a subfolder named `reset_password_email` containing both an HTML and a TXT file, you can call these files like so:

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

```
const fs = require("fs");
const path = require("path");

const emailHTML = fs.readFileSync(
  path.resolve("./emails", "reset_password_email", "email.html"),
  "utf-8"
);

const emailTXT = fs.readFileSync(
  path.resolve("./emails", "reset_password_email", "email.txt"),
  "utf-8"
);
```

Now, you can use these variables in your code as needed, for example in Handlebars:

```
const compiledHTML = Handlebars.compile(emailHTML);
const compiledTXT = Handlebars.compile(emailTXT);
```

Explanation:

When working with Next.js and serverless functions on Vercel, it's important to note that static files in the root directory aren't automatically bundled with your serverless function. To access these files, you'll need to use Node.js's built-in fs module to read them.

`path.resolve` is used to generate the correct file path, ensuring it works both locally during development and when deployed on Vercel. It's a more robust way to construct file paths compared to manually concatenating strings.

By following this approach, you can seamlessly integrate static files like email templates into your Next.js API, enabling you to send personalized emails with ease.

Remember, always handle sensitive information like email templates with care, ensuring they are securely stored and accessed. With this technique, you have the flexibility to incorporate various types of files into your Next.js projects.

Author:
[Tashyn Wallace](https://tashyn.com/)
Redux State Management Library
Published: 2023-09-12 05:21:26

First of All thanks to [Dan Abramov](https://overreacted.io/) for creating Redux which is wonderful for state management as well as UI/UX binding which enhances App performance.

Why redux? what is that makes redux better in case of normal react application.

Without Redux each components of state management handles the user input and manages its own state.some time it share with props with other that rely on data change.But here comes a difference if there are only components having parent child relationship with the state management components then funda is clear logic is clear about that no issue because its simple hierarchy model which is present child and parent relationship.

Know here comes the catch which is when these state management has to share data with other many components in the applications through it then there is one problem that come into account that is **Props drilling**.

**What is Prop drilling**

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

here in above image i have show how prop drilling works initially we have 3 function loginpage.js,Dashboard.js,profile.js
We know that loginpage is parent of both in prop-drilling parent transfers its data to child and child transfer its  data to its child due to this process if the application is large enough then this hierarchy model will fail.

How redux handles its data flow due to large and complex structure of application 


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

Here is gif in above example how it handles the complex data flow model threw it.
How from state it goes to UI and then after UI structure 
in this UI first it will go to the event handler for this it has to do some even task which is deposit.From Eventhandler it will dispatch the Action which contain the key and data in from of map gies to store this is cyclic process which handles the data flow control.
Clean Ducts, Happy Home: Safe House Air Duct Cleaning in Ellicott City MD
Tags: business
Published: 2023-09-12 05:17:09

When it comes to your home's well-being, don't compromise. Safe House [air duct cleaning in Ellicott City, MD](https://www.airductinmd.com/air-duct-dryer-vent-cleaning-ellicott-city-md/), is tailored to perfection. Our meticulous approach ensures that your ducts are contaminant-free, making indoor air quality pristine. Dust, allergens, and pollutants don't stand a chance against our expert team. A cleaner, healthier home is just a call away. Let Safe House transform your living space. Contact us now and give your home the TLC it deserves!