teleren/devto huggingface dataset:
Ecommerce, where should I start?
Tags: webdev, ecommerc, nextjs, aws
Published: 2023-03-08 09:50:59

Hello, I am a Junior Developer with 1 yr of experience, mostly FrontEnd and a bit of BackEnd. And I was always wondering, how to make my own ecommerce website, to sell some products there.

My knowledge:
ReactJS/NextJS 4/5
TailwindCSS 4/5
ExpressJS/tRPC 2.5/5
PostgeSQL 3/5
Docker Deployment with CI/CD from GitHub 3.5/5
Stripe 0/5

I checked out some repo in Github with NextJS + business logic (add to cart, etc.). 
And some of them could be a really good starting point. But for sure I will need to add alot to it, to create a product from that.

There are alot of CMS or Headless CMS like Strapi/Medusa etc.
Or should I find just CMS and do whatever I need with that CMS?
I think the best way and easy to work with payments is Stripe
For deployment I think AWS S3 bucket + Storage for DB, for product images and EC2 for server itself 

If you have any suggestion, will be glad to hear from you!
Auto-updating hosts file using cronjob
Tags: cron, cronjob, linux, hosts
Published: 2023-03-08 15:46:31

In this post I will show you how you can easily set your hosts file in "/etc/hosts" to automatically update with the help of cron.
<!--more-->

## What is cron?
*cron is the time-based job scheduler in Unix-like computer operating systems. cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times, dates or intervals. It is commonly used to automate system maintenance or administration.*

## Installing Cron on Your System
You can use package manager on the distro of your choice to install cron.
For Ubuntu/Debian based distros:
```sudo apt install cron```
For Arch Linux:
```sudo pacman -S cronie```
For Fedora:
```sudo dnf install cronie```

## Enabling cron daemon to run on boot
```sudo systemctl enable cronie```
For Ubuntu/Debian based:
```sudo systemctl enable cron```

## Crontab format
The basic format for a crontab is:
```minute hour day_of_month month day_of_week command```

* minute: values can be from 0 to 59.
* hour: values can be from 0 to 23.
* day_of_month: values can be from 1 to 31.
* month: values can be from 1 to 12.
* day_of_week: values can be from 0 to 6, with 0 denoting Sunday.

Now if we want to run a command every Monday at 5:00pm we use:
```0 17 * * 1 command``` ( 17 is 5pm in 24 hour clock format ).
You can use [cron.help](https://cron.help/) for more help to understand the syntax.

## Setting up your cronjob using crontab
We will use sudo for this since it requires root privilege to edit "/etc/hosts" file.
```sudo crontab -e```
I personally use [StevenBlack](https://github.com/StevenBlack/hosts)'s hosts file to block advertisements and malicious domains so I would use:
```0 17 * * 1 curl https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts > /etc/hosts```
The above command will fetch the updated hosts file every Monday at 5:00pm using curl from the above URL and overwrite the current "/etc/hosts" file.
After adding the above command, save and exit crontab editor.

---

This blog was originally written on June 18, 2022.
URL: https://paper.wf/spignelon/auto-updating-hosts-file-using-cronjob
CSS advanced
Published: 2023-03-08 17:21:52

I will start my portfolio. I'm thinking on creating a personal page for my cats as a project. 
  ,-.       _,---._ __  / \
 /  )    .-'       `./ /   \
(  (   ,'            `/    /|
 \  `-"             \'\   / |
  `.              ,  \ \ /  |
   /`.          ,'-`----Y   |
  (            ;        |   '
  |  ,-.    ,-'         |  /
  |  | (   |        hjw | /
  )  |  \  `.___________|/
  `--'   `--'
Indifikators
Tags: cpp, programming, beginners
Published: 2023-03-08 18:31:05

C++ indificator:

indifikatorlar bu noyob isimlar yani "ism son yosh kun hafta"
ya'ni "name num ege day month"
 
 ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nnb0pmygn30z6vqn6p6b.png)
Recursion to simplify test assertions
Tags: recursion, testing
Published: 2023-03-10 11:04:54

At Woovi we use MongoDB as our primary database.
For our integration tests, we use an in memory database to ensure our queries and aggregates are working correctly.
It is madness to mock a database, it generates a lot of false positives, and it won't give confidence to upgrade.

## How to assert `ObjectId`?

ObjectIds are small, likely unique, fast to generate, and ordered.
`ObjectId` is the primary key of each MongoDB document.

A common test scenario is to validate if a given `ObjectId` is equal to another `ObjectId`

In a naive approach, you use assert like this

```jsx
expect(objectIdA).toBe(objectIdA);
```

This does not work because `ObjectId` are an Object in JavaScript, and even if they have the same value, they will be in different places in the memory.

The way to solve this, it is to convert the `ObjectId` to string using toString() method, and then make the assertion

```jsx
expect(objectIdA.toString()).toBe(objectIdA.toString());
```

What if you want to assert 2 complex objects, like this one:

```jsx
const obj = {
    _id: new ObjectId('5c9b1b9b9b9b9b9b9b9b9b9b'),
    name: 'test',
    myarr: [
      new ObjectId('5c9b1b9b9b9b9b9b9b9b9b9b'),
      new ObjectId('5c9b1b9b9b9b9b9b9b9b9b9b'),
      new ObjectId('5c9b1b9b9b9b9b9b9b9b9b9b'),
    ],
    my: {
      nested: {
        field: new ObjectId('5c9b1b9b9b9b9b9b9b9b9b9b'),
      },
    },
  };
```

## Recursion for the rescue

We want to convert all ObjectId values to string, the most elegant way of doing this is using recursion:

```jsx
export const mongooseObjectIdToString = (data: any) => {
  // no value, return value
  if (!data) {
    return data;
  }

  // traverse the array
  if (Array.isArray(data)) {
    return data.map(d => mongooseObjectIdToString(d));
  }

  // transform ObjectId to string
  if (
    ObjectId.isValid(data) &&
    data.toString().indexOf(data) !== -1
  ) {
    return data.toString();
  }
 
  // traverse nested object 
  if (typeof data === 'object' && !Array.isArray(data)) {
    return Object.keys(data).reduce((prev, curr) => ({
        ...prev,
        [curr]: mongooseObjectIdToString(data[curr]),
      }), {});
  }

  return data;
};
```

`mongooseObjectIdToString` will call itself when it finds an array or a nested object, otherwise will just convert the `ObjectId` to String, or just return any other data type.

The assert would then be:

```jsx
expect(mongooseObjectIdToString(obj)).toEqual(mongooseObjectIdToString(anotherObj));
```

## In Short
Recursion is not only useful to solve Fibonacci, but can also be applied to solve real problems, like traversing a complex object applying some transforming.

This approach can be generalized to apply any transforming in any complex object, comment with your generalized algorithm, and where you are going to use it.

---
Woovi
[Woovi](https://www.woovi.com) is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.

If you want to work with us, we are [hiring](https://woovi.com/jobs/)!
Column Store
Tags: opengauss
Published: 2023-03-09 07:13:22

openGauss supports hybrid row-column store. Row store stores tables to disk partitions by row, and column store stores tables to disk partitions by column.

Each storage model applies to specific scenarios. Select an appropriate model when creating a table. Generally, openGauss is used for databases in online transaction processing (OLTP) scenarios. By default, row store is used. Column store is used only in online analytical processing (OLAP) scenarios where complex queries are performed and the data volume is large. By default, a row-store table is created. For details about differences between row store and column store.

In the preceding figure, the upper left part is a row-store table, and the upper right part shows how the row-store table is stored on a disk; the lower left part is a column-store table, and the lower right part shows how the column-store table is stored on a disk.

Both row-store and column-store models have benefits and drawbacks.

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

Generally, if a table contains many columns (called a wide table) and its query involves only a few columns, column store is recommended. Row store is recommended if a table contains only a few columns and a query involves most of the columns.

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

**Syntax**

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

**Parameter Description**
**· table_name**

Specifies the name of the table to be created.

**· column_name**

Specifies the name of a column to be created in the new table.

**· data_type**

Specifies the data type of the column.

**· ORIENTATION**

Specifies the storage mode (row-store, column-store, or ORC) of table data. This parameter cannot be modified once it is set.
Value range:

**- ROW** indicates that table data is stored in rows.

**ROW** applies to OLTP services and scenarios with a large number of point queries or addition/deletion operations.

**- COLUMN** indicates that the data is stored in columns.

**COLUMN** applies to the data warehouse service, which has a large amount of aggregation computing, and involves a few column operations.

**Example**
If **ORIENTATION** is not specified, the table is a row-store table by default. For example:

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

When creating a column-store table, you need to specify the **ORIENTATION** parameter. For example:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/873ocfvgyk2cpulwyenc.png)
500 open-source components for TailwindCSS
Tags: tailwindcss
Published: 2023-03-09 10:47:31

[![Tailwind components](https://tailwind-elements.com/img/components-big.jpg)](https://tailwind-elements.com/)        
                       I'd like to share my latest discovery with you. 
       [Tailwind Elements](https://tailwind-elements.com/) is currently, the most popular 3rd party UI kit for TailwindCSS with over 10k Github stars.        [![GitHub Repo stars](https://img.shields.io/github/stars/mdbootstrap/tailwind-elements?style=social)](https://github.com/mdbootstrap/Tailwind-Elements/)        It's a **huge collection of stunning components** made with attention to the smallest detail.         Forms, cards, buttons, and hundreds of others.         All components have **dark mode** and very intuitive **theming options**.        The project is supported by an [engaged community on GitHub](https://github.com/mdbootstrap/Tailwind-Elements/discussions), I recommend you check it out and join one of the many discussions.        
       You will find installation instructions [here](https://tailwind-elements.com/docs/getting-started/installation), and you can track the progress of the project live         [here](https://tailwind-elements.com/docs/standard/getting-started/changelog/).        
       The project was kickstarted by @MDBootstrap, a group of open-source developers behind [MDB UI Kit](https://github.com/mdbootstrap/mdb-ui-kit) - a high-quality UI kit for Bootstrap, and also behind [MDB GO](https://mdbgo.com/) - hosting and deployment platform.        
       I highly recommend you to check it out!        
       {% link mdbootstrap/tailwind-elements-breakthrough-version-is-here-59hh %}
5 Cyber security Best Practices for Small and Medium-sized Businesses
Published: 2023-03-09 11:22:30



In today's digital landscape, cybersecurity is more important than ever, especially for small and medium-sized businesses (SMBs). While large corporations have dedicated teams and resources to handle cybersecurity threats, SMBs often lack the resources and expertise to adequately protect themselves. However, with the right strategies and tools, SMBs can greatly reduce their risk of cyberattacks. Here are five best practices for SMBs to improve their cybersecurity:

Use Strong Passwords: This may seem like a no-brainer, but many SMBs still use weak or easily guessable passwords. Encourage employees to use complex passwords that include a mix of upper and lowercase letters, numbers, and special characters. Consider using a password manager to generate and store strong passwords.

Implement Multi-Factor Authentication: Multi-factor authentication adds an extra layer of security by requiring users to provide more than just a password to access their accounts. This can include a code sent via text message, a biometric scan, or a physical security key. Many cloud-based services offer multi-factor authentication options.

Train Employees on Cybersecurity: Employees are often the weakest link in cybersecurity. Make sure all employees are aware of the risks and consequences of cyberattacks and provide regular training on best practices, such as avoiding phishing scams, identifying suspicious emails, and reporting security incidents.

Keep Software Up-to-Date: Outdated software can contain vulnerabilities that hackers can exploit. Ensure all software, including operating systems and applications, is regularly updated with the latest security patches.

Conduct Regular Backups: In the event of a cyberattack or data loss, having recent backups can be a lifesaver. Regularly backup important data to a secure location, such as an offsite server or cloud-based storage.

Implementing these best practices can greatly reduce the risk of cyberattacks for SMBs. However, it's important to remember that cybersecurity is an ongoing process, and SMBs should regularly assess and update their security strategies to stay ahead of evolving threats
API security is now more important than web application security
Published: 2023-03-23 16:31:31

We have been reviewing the OWASP Top Ten in some detail, which is the premier index of the most critical vulnerabilities in web applications.

But, in 2019, the OWASP Foundation found that their traditional web application security vulnerability was simply not advanced enough to bring visibility to the fastest growing threat categories: API vulnerabilities.

So, in response, the foundation published its first-ever [API Top Ten](https://owasp.org/www-project-api-security/). It’s quite staggering. Between 2017 and 2021, the vulnerability posture of APIs grew to overtake the traditional web application, to the extent that even the web application vulnerabilities often overlap with API vulnerabilities.

In fact, if APIs were fully secured, it’s likely that web application breaches would fall by at least 66%.

So, as an extension of our security vulnerabilities overview, we will extend and expand to review many of the OWASP API Top Ten.

Since the majority of all internet traffic is over APIs, it makes sense that we would want to prioritize improving and hardening APIs above even many traditional web application vulnerabilities. APIs are more often exploited, and their preference as an attack vector continues to grow for bad actors.

Stay tuned for a more detailed review of these risks and how to manage them without paralyzing your customer-facing initiatives.
MSSN CTRL: Call for papers is now open
Tags: security
Published: 2023-03-30 20:16:56

---
title: MSSN CTRL: Call for papers is now open
published: true
date: 2023-03-09 00:00:00 UTC
tags: security
canonical_url: https://www.limacharlie.io/blog/mssn-ctrl-call-for-papers-is-now-open-2023
---

The inaugural [MSSN CTRL](https://www.mssnctrl.org/) security engineering and automation conference will take place on October 5-6, 2023 in Arlington, VA. Get involved by submitting our [<u>call for proposals</u>](https://www.papercall.io/mssnctrl23) or [<u>get notified when registration is open.</u>](https://form.typeform.com/to/h64tdKlt)

Over the last couple of years we’ve seen our user base grow from a core group of early adopters to now thousands of users worldwide. And with that growth comes our dedication to our community and to learn from each other. Cybersecurity is continuously evolving and security practitioners need to look to their peers for inspiration, knowledge, and ideas.

### Community at work

We’re creating the conference with you, the practitioner, in mind. We plan to shape the event around the cybersecurity community with workshops and discussions to give you a voice and the opportunity to share. In order to accomplish this, we need your help.

Do you have a topic you want to discuss with your peers? Did you build something on top of LimaCharlie that you want to share? Topics are not limited to the use of LimaCharlie. We’re all ears. [<u>Submit your talk idea in our call for proposals. </u>](https://www.papercall.io/mssnctrl23)

<u><b>All proposals are due by April 16, 2023, at 11:59 pm PST.</b></u>

All speakers will receive a professionally edited recoding of their session, professional photographs, comped ticket to the event, and the opportunity to speak at the first of many MSSN CTRL conferences.

We cannot wait to create this conference with you.
Is HTML a programming language ?
Tags: webdev, codenewbie, html, computerscience
Published: 2023-03-11 13:34:58

HTML (Hypertext Markup Language) is not a programming language, but rather a markup language used for creating and structuring content on the web.

Unlike programming languages, HTML does not have the ability to perform complex operations, make decisions or carry out calculations. Instead, HTML is used to create the structure and content of web pages, defining the text, images, and other elements that make up a web page.

However, HTML is often used in conjunction with programming languages such as JavaScript and PHP to create dynamic and interactive web pages. These programming languages are used to add interactivity, perform calculations and operations, and connect to databases and other web services.
Contacto
Published: 2023-03-18 04:11:17

Según linkedin soy un: 
Conferencista internacional apasionado por hacer del mundo un lugar mejor, fundador y lider de comunidades tecnológicas éxitosas 🦏✨. Desarrollador web experimentado con un historial demostrado de trabajo en la industria de Internet. Experto en diseño web, desarrollo front-end, ingeniería, gestión de proyectos y desarrollo web. Fuerte profesional en ingeniería multimedia enfocado en desarrollo de páginas Web y desarrollo en Blockchain de la Universidad Autónoma de Occidente. 

Info/dudas/propuestas de trabajo que me harán millonario son bienvenidas wildchamo@gmail.com.

Existo en instagram [@wildchamo](https://www.instagram.com/wildchamo/).
Localization in Laravel
Tags: laravel, beginners, learning, localization
Published: 2023-03-18 11:45:15

**Why Localization is an important feature in Laravel?**

A popular PHP web framework, which allows developers to create multilingual applications easily. Laravel provides built-in support for localization using the Illuminate/Translation package, which provides tools for managing language files, translating strings, and displaying localized content.

To start using localization in Laravel, developers need to create language files for each language that their application will support. These files are typically located in the `resources/lang` directory of the project and have a filename that corresponds to the language code, e.g. `en` for English or `fr` for French.

Once the language files are in place, developers can use the `trans()` function to translate strings into the appropriate language. For example:

```
echo trans('messages.welcome');
```
In this example, the `trans()` function is used to translate the string `'messages.welcome'` into the language specified by the user's browser settings or application preferences.

Developers can also use the `Lang::get()` method to retrieve language strings directly from the language files, like this:

```
echo Lang::get('messages.welcome');
```


Laravel also supports localization of dates, numbers, and other data formats using the Carbon library, which provides tools for formatting and manipulating date and time values.

In summary, Laravel provides robust support for localization, making it easy for developers to create multilingual applications that can be used by audiences in different regions and languages.
Iteration or Recursion?
Published: 2023-04-16 09:57:10

One of the most common misconception or jeopardy arises when encountering Data Structure & Algorithms.

**Iteration:**
Iteration is the repetition of a process.

**Recursion:**
Recursion is the process of calling a certain function by itself.

The definitions might make them appear similar. However, there are several differences among them to differentiate them properly.

| Iteration   | Recursion  |
|------------|-----------|
| Set of instructions is repeated.        | The function calls itself.       |
| Iteration consists of initialization and conditions.      | Recursion consists of base case (termination condition) only.     |
| Infinite iteration can occur when the condition never becomes false.      | Infinite recursion can occur when the base case(s) can never be reached.      |
| Iteration uses a data structure called stack.     | Recursion does use stack.    |
| Fast in execution.        | Slow in execution.       |
| The codes of iteration are usually longer.        | The codes of recursion are usually shorter.       |
Big O Notation
Tags: algorithms, programming, computerscience
Published: 2023-03-18 19:16:09

## A brief overview of Big O notation

---

📌Big O notation is a mathematical notation used to describe the complexity or running time of an algorithm. It is used to compare the efficiency of algorithms by analyzing how the time and space requirements grow as the input size increases. In other words, it tells us how quickly the resource requirements of an algorithm increase as the input size grows larger.

---

📌In Big O notation, the notation "O" stands for "order of", and is followed by a mathematical expression that describes the algorithm's performance. 

---

📌For example, an algorithm with a runtime of O(n) has a linear runtime, meaning that the time it takes to execute the algorithm grows linearly with the input size n. An algorithm with a runtime of O(n^2) has a quadratic runtime, meaning that the time it takes to execute the algorithm grows quadratically with the input size n.

---

📌Some commonly used Big O notations include:

- O(1) - Constant time

- O(log n) - Logarithmic time

- O(n) - Linear time

- O(n log n) - Linearithmic time

- O(n^2) - Quadratic time

- O(2^n) - Exponential time

---

⚡Big O notation is important because it helps us analyze the efficiency of algorithms and determine which algorithm is the best for a given problem. It allows us to make informed decisions about the trade-offs between time and space complexity, and to choose the algorithm that is most appropriate for a given situation.

---

💡 You can follow me on:
- [LinkedIn](https://www.linkedin.com/in/dev-alisamir)
- [Telegram](https://t.me/dev_ali_samir)
- [Facebook](https://www.facebook.com/alisamir.dev)
- [Instagram](https://www.instagram.com/alisamir.dev)
web seo gestión andorra
Published: 2023-03-19 05:42:32

**[web seo gestión andorra](https://ad700management.com/como-conseguir-el-consultor-seo-adecuado-en-andorra/)** : En los últimos tiempos, la presencia en línea de una empresa es muy esencial para aumentar su alcance para captar clientes potenciales y maximizar sus ventas. Entonces, los empresarios estratégicos están poniendo el mismo dinero y esfuerzo para aumentar su estrategia de marketing digital. Esto puede ahorrarles tiempo y producir resultados garantizados.