teleren/devto huggingface dataset:
Understanding the Physical Structure of Database Cluster
Tags: postgres
Published: 2023-05-09 17:06:27

## Introduction to Database Clusters

A database cluster is a collection of directories and files that contain various subdirectories. By running the initdb utility, a new database cluster can be initialized, resulting in the creation of a base directory. Typically, the base directory is designated by the environment variable PGDATA.

## Layout of Databases

Each database is stored in a subdirectory within the base directory, with the subdirectory names matching the respective OIDs. For instance, if the OID of the database "sampledb" is 16384, its subdirectory name would be 16384.

## Layout of Files Associated with Tables and Indexes

Tables and indexes with a size of less than 1GB are stored as single files under the database directory. Tables and indexes are internally managed by individual OIDs, while the data files are managed by the variable relfilenode. The relfilenode values of tables and indexes usually match the respective OIDs, but not always. For tables and indexes that exceed 1GB in file size, PostgreSQL creates new files named relfilenode.1, relfilenode.2, and so on, as necessary.

## Tablespaces

A tablespace in PostgreSQL is an additional data area that exists outside of the base directory. This feature was introduced in version 8.0. When a tablespace is created using the CREATE TABLESPACE statement, it is created under the directory specified, with a version-specific subdirectory (e.g., PG_14_202011044). The tablespace directory is addressed using a symbolic link from the pg_tblspc subdirectory, with the link name being the same as the OID value of the tablespace. If a new database (with an OID of 16387) is created under the tablespace, its directory is created under the version-specific subdirectory.

## Helpful Sources

https://github.com/apache/age
https://www.interdb.jp/pg/pgsql01.html
Introducing the new Webvium Browser
Tags: programming, news, android, java
Published: 2023-05-10 04:10:30

Webvium Dev is an in-development version of the Webvium Browser. It offers an early look at i am working on, as well as new updates and features. 

However, it may also come with a lot of issues compared to the Webvium Browser or Webvium Beta. Webvium Dev offers a lot of features that are waiting to be explored. It is a great way to get a sneak peek at what the future of Webvium Browser holds. 

With Webvium Dev, users can experience the latest features and updates before they are released to the public. Webvium Dev also allows users to test out new features and provide feedback. This helps him to make sure that the Webvium Browser is the best it can be. 

Webvium Dev is a great way to stay up to date with the latest developments in the Webvium Browser.

Download Now for free (400KB): https://mrepol742.github.io/webviumdev
MagicTech
Tags: 3dprinting, harrypotter, magictech, innovation
Published: 2023-05-10 04:05:20

3D printing is like having a magic wand that can bring your imagination to life. Except instead of saying 'Expecto Patronum,' you just click 'Print.'


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3mnn0ee33p80bhthmntd.png)
HTTPS problem with SSL certificates in Node.js
Tags: ssl, http, https
Published: 2023-05-09 17:01:25

Bypassing the HTTPS problem with SSL certificates in Node.js involves temporarily disabling certificate validation or using self-signed certificates for development or testing purposes. Here's a short description of the steps you can take:


```javascript
const path = require('path');
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const nodemailer = require('nodemailer');
const fs = require('fs');
const https = require('https');

const app = express();
const port = 3000;

app.use(express.static(__dirname + '/var/www/html'));
app.use(express.urlencoded({ extended: true }));
app.use(express.json());

const options = {
    key: fs.readFileSync('/etc/letsencrypt/live/domaine.com/privkey.pem'),
    cert: fs.readFileSync('/etc/letsencrypt/live/domaine.com/cert.pem')
};
const corsOptions = {
    origin: ['https://domaine.com', 'https://www.domaine.com'],

};


app.use(cors(corsOptions));

app.use(function (req, res, next) {
    res.header("Access-Control-Allow-Origin", "https://domaine.com, https://www.domaine.com");
    next();
});

app.get('/*', function (req, res) {
    res.sendFile(path.join(__dirname + '/var/www/html/index.html'));
});

app.use(bodyParser.json());

// Your send-email route here
app.post('/send-email', (req, res) => {
    const name = req.body.name;
    const email = req.body.email;
    const message = req.body.message;

    const transporter = nodemailer.createTransport({
        host: 'smtp.gmail.com',
        port: 465,
        secure: true,
        auth: {
            user: 'useremail@gmail.com', // Replace with your email address
            pass: 'motpasse' // Replace with your app password
        }
    });

    const mailOptions = {
        from: 'useremail@gmail.com',
        to: 'toemail@gmail.com', // Replace with recipient email address
        subject: 'Portfolio Message',
        text: `
      name: ${name}
      email: ${email}
      message: ${message}
    `
    };

    transporter.sendMail(mailOptions, (error, info) => {
        if (error) {
            console.log(error);
            res.status(500).send('Error sending email');
        } else {
            console.log('Email sent:', info.response);
            res.status(200).send('Email sent successfully');
        }
    });
});

const server = https.createServer(options, app).listen(port, () => {
    console.log(`Server listening at https://domaine.com:${port}`);
});
```
59 berufliches Vorwärtskommen: Wie sieht eine reife Karriere-Kultur bei Software-Entwicklern aus?
Tags: deutsch, career, motivation, discuss
Published: 2023-05-10 03:57:00

Moin Moin,

mit einer reifen Karriere-Kultur würden wir Software-Entwickler sowohl auf unsere fachlichen Fähigkeiten Wert legen, als auch auf unsere emotionale Intelligenz. 
Ein weiterer Punkt wären [klare Rollen im Projekt→](https://dev.to/amustafa16421/52-berufliches-vorwartskommen-eine-klare-rolle-im-software-entwicklungsprojekt-3e3k), auf Grundlage derer wir eigenverantwortlich arbeiten. Zudem wäre es für uns Gewohnheit einen Karriere-Plan festzulegen und uns mit anderen Software-Entwicklern darüber auszutauschen, sowie uns gegenseitig dabei zu unterstützen, unsere jeweiligen Ziele zu erreichen.

Wir würden uns damit beschäftigen, wie wir Überstunden, und die damit verbundenen negativen Folgen, vermeiden können. Des weiteren würden wir vermehrt nach Vergütungsmodellen für leistungsorientierte Arbeit bezahlt werden, da die dreistelligen Millionen Umsätze vieler Unternehmen auf IT gegründet sind und wir entsprechende Entlohnung verhandeln. Dies verknüpfen wir mit einem Grundgehalt und gegebenenfalls einer dauerhaften Umsatzbeteiligung (1).

Schließlich sei noch gesagt, dass wir nicht jede Arbeit tätigen würden, da wir uns unserer Verantwortung der Gesellschaft gegenüber bewusst sind.

1) Wie gefällt dir das „Bild“ ( 5-Sterne-Maß ), 
Ausführungen willkommen.
2) Was würdest du ergänzen?

Lass uns mittels Kommentaren austauschen.

Beste Grüße,
Mustafa

Austausch mittels E-Mail: mustafa.kevin.dwenger@posteo.de
Betreff: Austausch

(1) Ihr kennt bestimmt mindestens ein Unternehmen, welches dies umsetzt…
Dự án Chợ Lộc Đức
Published: 2023-05-10 03:24:27

https://www.cholocduc.com.vn/ Chợ Lộc Đức là dự án khu dân cư đa tiện ích do UBND xã Lộc Đức làm chủ đầu tư tại Bảo Lâm, TP. Bảo Lộc, hứa hẹn hoạt động kinh doanh sầm uất trong thời gian tới. Đây là sản phẩm phù hợp mua để dành, kinh doanh hoặc đầu tư cho thuê


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

https://www.facebook.com/cholocduc

https://twitter.com/cholocduc01

https://www.youtube.com/@cholocduc01/about

https://www.pinterest.com/cholocduc01/

https://www.tumblr.com/cholocduc01 https://getpocket.com/@1c7g8dT3p6433Adt05T91b5TcUA2p11aoWfi74au9fcb90E81cQy0v0gTfRHWfk2?src=navbar

https://cholocduc01.wordpress.com/

https://cholocduc01.blogspot.com/2023/05/du-an-cho-loc-duc.html https://cholocduc01.weebly.com/

https://www.linkedin.com/in/cholocduc01/

https://trello.com/u/cholocduc01

https://www.vingle.net/cholocduc01

https://dribbble.com/cholocduc01

https://500px.com/p/cholocduc01

https://www.flickr.com/people/cholocduc01/

https://flipboard.com/@cholocduc01

https://linktr.ee/cholocduc01

https://gab.com/cholocduc01

https://www.pearltrees.com/cholocduc01

https://linkhay.com/u/cholocduc01

https://ok.ru/profile/573782097913

https://mastodon.social/@cholocduc01

https://cholocduc01.mystrikingly.com/

https://cholocducvn.wixsite.com/d---n-ch--l-c---c

https://postheaven.net/cholocduc01/du-an-cho-loc-duc https://writeablog.net/cholocduc01/du-an-cho-loc-duc https://groups.google.com/g/cholocduc01

https://www.reddit.com/user/cholocduc01
Today I completed 365 days streak on Leetcode🥳🥳🥳
Tags: streak, beginners, programming, chiki1
Published: 2023-05-10 03:20:31


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

unbelievable 😍😍😍😍😍😍😍💕!
Day 1: Installing NixOS on my 2019 Macbook Pro
Tags: nixos, nix, linux
Published: 2023-05-10 03:17:06



Here's everything I did to install NixOS on my Macbook Pro without ruining my existing macOS Ventura setup.

1. Created bootable media

- Downloaded Balena Etcher 
- Downloaded NixOS ISO (GNOME, 64-bit Intel/AMD)
- Plugged in 16gb USB drive
- Ran Etcher to flash the NixOS ISO onto the USB drive (easy as 1-2-3)


2. Prepared a partition on my hard drive

- Couldn't use disk utility because it would only let me create APFS volumes
- Opened terminal
- Ran `diskutil list`
- Ran `diskutil info /dev/disk0`
- Ran `diskutil apfs resizeContainer /dev/disk0s2 300g ExFAT "NixOS" 200gb`

This took a little while.


3. Disabled the boot restriction security

- Shut down the mac
- Booted up, holding `CMD+R` to enter recovery mode
- At the top bar, chose Utilities>Startup Security Utility
- Chose `No security` for the first option
- Chose `Allow booting from external media` for the second option
- Closed the window
- Shut down


4. Got my peripherals ready

- Plugged in power cable
- Plugged in external mouse and keyboard
- Plugged in network cable via ethernet-usbc adapter


5. Ran the installer

- Booted up, holding `Option` key
- Chose EFI boot (my usb device)
- Ignored the menu that came up and disappeared in 10 seconds. If you press a key, the 10 second timer will be aborted and you'll have to manually select an option. Choose the first and hit enter
- Clicked next a few times and added my username, password, timezone, etc.
- I chose the Plasma desktop environment after comparing the visual preview to GNOME's in the setup wizard. I think people fight about this kind of stuff online, but I'm led to believe by one of the Reddit posts I saw that we can easily switch risk-free later on thanks to the power of Nix.
- Let it run and went upstairs for a few hours


6. Came back to my laptop and booted up NixOS

- Wondered how to get Wi-Fi working
- Wondered how to get Macbook keyboard, touch bar, and trackpad working
- Wondered how the heck I do anything on this weird OS
💸 EthicalAds
Tags: advertising, startup, tutorial
Published: 2023-05-10 03:14:41

[EthicalAds](https://www.ethicalads.io/) ([code](https://github.com/readthedocs/ethical-ad-server)) provides a way for developers and other creators of technical content to get paid for content creation, without using privacy invading advertisement tooling. 


![EthicalAds website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l3p2s9v4l9tndssli2p0.png)


**Except**, it actually protects user privacy, especially when compared to other programs like AdSense. Where traditional advertising methods track user data and browsing habits, EthicalAds serves advertisements based on the context of the website or page, ensuring a non-intrusive and privacy-respecting user experience. 

It really is that simple, and while you do have to get approved to be a publisher, the process is pretty painless!

The platform's core ethos is to provide relevant and engaging ads without exploiting personal data, addressing the rising demand for data privacy in the digital world.

EthicalAds supports the online ecosystem by sharing a portion of ad revenue with content creators and website owners. This model is particularly beneficial for open-source projects and creators who rely on such revenue streams. The platform also prides itself on its commitment to high-quality ads, avoiding any content that may be misleading, inappropriate, or excessively distracting. With its user-friendly design, easy integration, and detailed yet anonymous analytics, EthicalAds offers a fresh, ethical perspective on digital advertising.

This was [originally posted on AWSM FOSS](https://awsmfoss.com/ethicalads/)
About the export of lithium ion battery
Published: 2023-05-10 03:09:36

[Lithium ion battery](https://dlnenergy.com/) covers different product types such as power batteries, energy storage batteries and consumer batteries (small batteries). The General Administration of Customs has not announced the proportion of battery types exported to various countries, but has announced the specific export amount.

In the first quarter of this year, the top five countries in terms of export value were the United States, Germany, South Korea, the Netherlands and Vietnam, accounting for 62.6% of the total export value. In 2022, these five countries will also rank among the top five destinations for China’s lithium battery exports.

In the first quarter, China exported 22.47 billion yuan of lithium batteries to the United States, a year-on-year increase of 93.5%, accounting for 20.5% of the total lithium battery exports. In the same period last year, this value was 11.61 billion yuan.

The United States has become China’s largest exporter of lithium batteries for three consecutive years, accounting for nearly 20% in 2022.
Interactivity with Stimulus
Tags: ruby, rails, javascript, webdev
Published: 2023-05-10 02:57:52

StimulusJS is a lightweight JavaScript library that allows developers to create dynamic and interactive web applications. It offers several benefits for developers who want to create web applications that are both easy to develop and maintain. In this article, I will explore the benefits of StimulusJS.

Simplified Development Process

StimulusJS simplifies the development process by allowing developers to focus on the specific needs of their application. It does not require extensive knowledge of complex JavaScript frameworks, which can make it easier for developers to get started with building their applications. The framework provides an easy-to-learn syntax and is flexible enough to allow developers to write code that meets their unique requirements.

Improved Maintainability

StimulusJS helps developers create more maintainable code. By separating the concerns of the application, StimulusJS encourages developers to write code that is easier to understand and modify. It also makes it easier to maintain codebases as changes can be made to the code without affecting other parts of the application.

Better Performance

StimulusJS is designed to be lightweight, which makes it faster and more efficient than some of the more complex JavaScript frameworks. It uses a simple event-driven model to keep the application fast and responsive, even when dealing with large amounts of data.

Improved Accessibility

StimulusJS can improve accessibility for web applications. It provides a way to add keyboard navigation, screen reader support, and other accessibility features that make web applications more usable for people with disabilities.

Compatibility with Other Libraries

StimulusJS is compatible with other JavaScript libraries, making it easy to integrate with existing codebases. It can work with popular libraries such as jQuery, React, and Angular. This makes it a great choice for developers who want to use a lightweight framework but still have access to the functionality of more complex libraries.

Flexibility

StimulusJS is highly flexible, which means that developers can use it to create a wide range of web applications. It can be used to create simple single-page applications or more complex web applications that require multiple pages.


StimulusJS offers several benefits for developers who want to create dynamic and interactive web applications. It simplifies the development process, improves maintainability, and provides better performance. It also improves accessibility, is compatible with other libraries, and is highly flexible. If you are looking for a lightweight and easy-to-use JavaScript framework, StimulusJS is definitely worth considering.
Using GPT to Analyze Cloud Security Issues for K8s
Tags: devops, chatgpt, gpt4, gpt3
Published: 2023-05-10 02:55:10

### ****Intro****

Kubernetes security is an essential task in today's digital landscape. With countless K8s security issues emerging every day, it can be difficult to manually analyze and resolve them quickly. This is where Selefra comes in - a Policy-as-code product that incorporates GPT functionality to help users perform efficient K8s security analysis, cost analysis, and architecture analysis on their Kubernetes clusters.

The GPT feature in Selefra allows users to analyze Kubernetes products for security issues, similar to how ChatGPT works. In this article, we will use K8s Pod security issues as an example to demonstrate how to use Selefra for security analysis on Kubernetes clusters. With the help of Selefra's GPT functionality, users can identify and resolve K8s security issues on their clusters more efficiently, improving their overall security posture.


![Banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ixqckj239y3892g6rq3h.png)

## ****Running Selefra****

### Install

First, installing Selefra is very simple. You just need to execute the following command:

```bash

brew tap selera/tap
brew install selefra/tap/selefra
mkdir selefra-demo & cd selefra-demo & selefra init
```

### Choose provider

Then, you need to choose the provider you need in the shell, such as K8s:

```bash

[Use arrows to move, Space to select, and enter to complete the selection]

[ ] AWS 
[ ] azure
[ ] GCP 
[✔] K8s # We choose K8s installation

```

### ****Configuration****

**configure K8s:**

You can configure your K8s information in advance by referring to our detailed configuration document available at [Document](https://www.selefra.io/docs/providers-connector/k8s).

**configure Selefra:**
After initialization, you will get a selefra.yaml file. Next, you need to configure this file to use the GPT functionality:

```yaml

selefra:
  name: selefra-demo
  cli_version: latest
  openai_api_key: <Your Openai Api Key>
  openai_mode: gpt-3.5
  openai_limit: 10
  providers:
    - name: k8s
      source: k8s
      version: latest

```

### Running

You can use environment variables to store the openai_api_key, openai_mode, and openai_limit parameters. Then, you can start the GPT analysis by executing the following command:

```bash

selefra gpt "Help me to query pods in kubernetes that are privileged to true"
```

Finally, you will get results similar to the animated image below:

![K8s](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19v5br1nqtljfcyuph6q.png)

## T**hanks for reading**

We highly recommend trying Selefra to experience a faster and more efficient cloud security analysis and resolution.

For more information on Selefra：

Website: **[https://www.selefra.io/](https://www.selefra.io/)**

GitHub: **[https://github.com/selefra/selefra](https://github.com/selefra/selefra)**

Twitter: **[https://twitter.com/SelefraCorp](https://twitter.com/SelefraCorp)**

Slack: [https://selefra.io/community/join](https://selefra.io/community/join)
CURP library CI4
Tags: php, library, webdev, programming
Published: 2023-05-10 02:42:22

> The Clave Única de Registro de Población (translated into English as Unique Population Registry Code or else as Personal ID Code Number) (abbreviated CURP) is a unique identity code for both citizens and residents of Mexico. Each CURP code is a unique alphanumeric 18-character string intended to prevent duplicate entries.

> [source](https://en.wikipedia.org/wiki/Unique_Population_Registry_Code)

Hello everyone, I have been working in a CI4 library to generate the CURP according to the official rules. In the present article, I will explain to you how to use it.
[Official rules to assign CURP](https://www.gob.mx/cms/uploads/attachment/file/681698/reglas_para_la_ejecucion_de_los_procedimientos_asignacion_de_la_curp.pdf)

## Rules to assign the curp

- The first surname's initial and first inside vowel;

- The second surname's initial (or the letter "X" if, like some foreign nationals, the person has no second surname);
- The first given name's initial;
- Date of birth (2 digits for year, 2 digits for month, and 2 digits for day);
- A one-letter gender indicator (H for male (hombre in Spanish), M for female (mujer in Spanish), or X for non-binary);
- A two-letter code for the state where the person was born; for persons born abroad, the code NE (nacido en el extranjero) is used;
- The first surname's first inside consonant;
- The second surname's first inside consonant;
- The first given name's first inside consonant; and
- One character ranging from 0-9 for people born before 2000 or from A-Z for people born since 2000; this is generated by the National Population Registry to prevent identical entries.
- Control digit, which checks the validity of the previous 17 digits
Simple Beginner-Level Node.js Projects
Tags: webdev, node, beginners, tooling
Published: 2023-05-10 02:16:10

If you'd like, I can remove the repeated text. Otherwise, here are some project ideas that you can customize and expand upon as your skills and knowledge of Node.js grow. Good luck!

1. A note-taking application that allows users to create, edit, and delete notes
2. A URL shortener that takes a long URL and generates a shorter, more manageable URL
3. A task manager application that allows users to create, update, and delete tasks
4. A simple chat application that allows users to send and receive messages in real-time
5. A weather app that uses an API to retrieve current weather information for a given location

When starting out with Node.js, it can be helpful to work on projects that are simple and easy to understand. These are just a few ideas for beginner-level Node.js projects to help you get started.


**Tools**

![Tools](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1xm7fw0j8msj61r9u645.png)

In order to build these projects, you may need to use tools such as:
1. Express.js to create the server-side application
2.  Socket.io to facilitate real-time communication in the chat application
3. Axios or Request to make HTTP requests to APIs for the weather app
4. MongoDB or another database to store data for the note-taking and task manager applications
Good luck with your projects! Let me know if you have any questions.