teleren/devto huggingface dataset:
Administrators
Tags: opengauss
Published: 2023-04-18 07:13:05

Initial Users
The account automatically generated during openGauss installation is called an initial user. An initial user is the system, monitoring, O&M, and security policy administrator who has the highest-level permissions in the system and can perform all operations. This account has the same name as the OS user used for openGauss installation. You need to manually set the password during the installation. After the first login, change the initial user's password in time.

An initial user bypasses all permission checks. You are advised to use an initial user as a database administrator only for database management other than service running.

System Administrators
A system administrator is an account with the SYSADMIN attribute. By default, a database system administrator has the same permissions as object owners but does not have the object permissions in dbe_perf mode.

To create a system administrator, connect to the database as the initial user or a system administrator and run the CREATE USER or ALTER USER statement with SYSADMIN specified.


```
CREATE USER sysadmin WITH SYSADMIN password "xxxxxxxxx";
```
or


```
ALTER USER joe SYSADMIN;
```
To run the ALTER USER statement, the user must exist.

Monitor Administrator
A monitor administrator is an account with the MONADMIN attribute and has the permission to view views and functions in the dbe_perf schema. The monitor administrator can also grant or revoke object permissions in the dbe_perf schema.

To create a monitor administrator, connect to the database as a system administrator and run the CREATE USER or ALTER USER statement with MONADMIN specified.


```
postgres=# CREATE USER monadmin WITH MONADMIN password "xxxxxxxxx";
```
or


```
postgres=# ALTER USER joe MONADMIN;
```
To run the ALTER USER statement, the user must exist.

O&M Administrator
An O&M administrator is an account with the OPRADMIN attribute and has the permission to use Roach to perform backup and restoration.

To create an O&M administrator, connect to the database as an initial user and run the CREATE USER or ALTER USER statement with OPRADMIN specified.


```
postgres=# CREATE USER opradmin WITH OPRADMIN password "xxxxxxxxx";
```
or

```
postgres=# ALTER USER joe OPRADMIN;
```
To run the ALTER USER statement, the user must exist.

Security Policy Administrator
A security policy administrator is an account with the POLADMIN attribute and has the permission to create resource tags, anonymization policies, and unified audit policies.

To create a security policy administrator, connect to the database as an administrator and run the CREATE USER or ALTER USER statement with POLADMIN specified.


```
postgres=# CREATE USER poladmin WITH POLADMIN password "xxxxxxxxx";
```
or

```
postgres=# ALTER USER joe POLADMIN;
```
To run the ALTER USER statement, the user must exist.
Docker Notlarım 2 :
Tags: turkish, docker
Published: 2023-06-04 13:42:19

# Docker ile dotnet console uygulaması : 
Boş bir dizin açıp : 

- Adım 1 : 

> dotnet new console

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



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

- Adım 2 : 
Dockerfile dosyasını ekleyelim : 

```
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /App

# Copy everything
COPY . ./
# Restore as distinct layers
RUN dotnet restore
# Build and publish a release
RUN dotnet publish -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:7.0
WORKDIR /App
COPY --from=build-env /App/out .
ENTRYPOINT ["dotnet", "DevTo.dll"]
```

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

- Adım 3 : 

> docker build .

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

- Adım 4 : 

> docker run 1087498a58a5dbe945d83c57e3a1d53b4f29c1a4abeff16cac3e62b6167b353c

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

Sonuç : "Hello, World!" yazısını görmüş olduk.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zbx3ao3gtdjlmx1mo09f.png)
iOS 17 Coming With New Features
Tags: ios, news
Published: 2023-06-04 13:31:48

iOS 17 Coming With New Features iOS 17 Coming With New Features iOS 17 is the next major version of Apple's mobile operating system, and it's expected to be released in September 2023.
Here are some of the new features and improvements rumored for iOS 17:
Redesigned Control Center: The Control Center is getting a major overhaul in iOS 17. The new Control Center will be more customizable and easier to use. It will also include new features, such as a quick way to access your favorite shortcuts and apps.

**New Lock Screen:** The Lock Screen is also getting a refresh in iOS 17. The new Lock Screen will be more customizable and interactive. You'll be able to add widgets, change the wallpaper, and choose from a variety of different styles.

**More powerful privacy features:** Apple is always working to improve the privacy of its users, and iOS 17 is no exception. The new operating system will include a number of new privacy features, such as a new way to control how apps track your location.

**Other improvements:** In addition to the new features mentioned above, iOS 17 is also expected to include a number of other improvements, such as performance improvements, bug fixes, and new accessibility features.

**New Health Features:** iOS 17 is rumored to include a number of new health features, such as a new way to track your menstrual cycle, a new way to track your sleep, and a new way to track your stress levels. [Read More....](https://www.regularupdates.tech/2023/06/ios-17-coming-with-new-features.html[](url))
Day 43-44: Beginner FastAPI Series - Part 1
Tags: beginners, programming, python
Published: 2023-06-04 13:21:29

I've recently come across an amazing web framework for building APIs with Python, and I'm excited to learn it. To document this, I'm starting a new series that chronicles my adventures (and misadventures!) as I slowly get familiar with it.

FastAPI bills itself as a modern, high-performance web framework for building APIs. It compares its speed to NodeJS and Go, and touts itself as one of the fastest Python frameworks around. I poked around its documentation and looked up a examples, and liked what I saw So without a second thought, I decided to dive right in!

I took a quick pause to think about what I was going to build and I aimed for simplicity so I settled on developing a basic CRUD (Create, Read, Update, Delete) project for a Person with just four fields: id, first_name, last_name, and active.

To those who might want to follow along, here are the prerequisites:

- Python 3.11 installed.
- VSCode installed with a basic understanding of setting up a venv environment.
- A fundamental grasp of Python. Some familiarity with FastAPI would be advantageous.
- Basic understanding of HTTP and REST.

Next, I mapped out the routes for the API and here's what I came up with:

```
HTTP METHOD  ROUTE
GET          /api/persons  (Retrieves all persons)
GET          /api/persons/:person_id  (Retrieves a single person)
POST         /api/persons/:person_id  (Creates a new person)
PUT          /api/persons/:person_id  (Updates an existing person)
DELETE       /api/persons/:person_id  (Deletes a single person)
```

I then created a new folder titled 'enad-project-1' to house the project. Launching VSCode, I initiated Git in a VSCode terminal with the command: 'git init'.

In the root folder, I set up a '.gitignore' file to prevent unnecessary files from being saved in our Git repository. It excludes the following:

```
.DS_Store
.idea/
__pycache__/
venv/
.env
```

To set up the Python Virtual Environment (venv), I used VS Code's Command Palette to run 'Python: Create Environment', selecting 'venv'. Upon opening a new terminal, I noticed that the command-line prompt now begins with '(.venv)', signifying the active virtual environment.

Now it's FastAPI time!

Installing FastAPI was quick and easy with the command:

```
pip install "fastapi[all]"
```

Next, I created a folder named 'app' and inside, I generated an empty file named '`__init__.py`' which (as you may or may not know) indicates that 'app' is a Python package.

After that, I created 'main.py', which had the following code to create a FastAPI application:

```
from fastapi import FastAPI
app = FastAPI()

@app.get("/api/hello")
def root():
    return {"message": "Hello World"}
```

I ran the application using the command:
`uvicorn app.main:app --host localhost --port 8000 --reload'`

Then, by navigating to http://localhost:8000/api/hello in a web browser, I was greeted with the ubiquitous "Hello World"!

And off we go to the races! It's the start and I'm going to continue to build on this while learning about FastAPI and Python.
SAP Commerce Cloud and Broken Smart Edit
Tags: sap, commerce, devops
Published: 2023-06-04 13:20:21

# Issue

Recently I have been involved in website go-live. Testers have been complaining that they were not able to see website in Smartedit built-in iFrame.

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

Looking at the console we realised that recently jsapps endpoints started to send one HTTP Header:

```
X-Frame-Options: deny
```

That is probably a consequence of SAP internal security audit [OWASP Secure Headers](https://owasp.org/www-project-secure-headers/) [X-Frame-Options](https://owasp.org/www-project-secure-headers/#x-frame-options).

At SAP Help you can find an article [Adding HTTP CSP Frame-Ancestors](https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/e1391e5265574bfbb56ca4c0573ba1dc/b1b7c612c404471b9d30867e3fb8749f.html?locale=en-US). You will **NOT** find explanation how to do that.

# Solution

Fortunately there is possibility to add in-the-runtime HTTP Response Headers in Cloud Portal in sub-page `Security` -> `HTTP Response Header Sets`.

SAP Help has one section about it here: [HTTP Response Header Sets](https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/7bc106228a794704accfb047bc352168.html?locale=en-US&q=http%20response%20header).

Unfortunately `X-Frame-Options: deny` is a default value and it is not possible to remove from system... but fortunately you can unset it in Cloud Portal.

My configuration for Smartedit contains two entries:

- setting `Content-Security-Policy` with wildcard to allow any request from Commerce Cloud.
- **unsetting** `X-Frame-Options` to make it finally working, as it is replaced by CSP (more info on [MDN XFO](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mwcxpoyef6lg6ncuq0ye.png)
Hands on search engine in Java using Elastic search
Tags: elasticsearch, springboot, webdev, blog
Published: 2023-06-04 13:11:00

##What is Elasticsearch and where is it used?
If you're looking for a powerful search engine and data visualization tool, then you need to install Elasticsearch and Kibana. Elasticsearch is a distributed, Restful search and analytics engine that helps you find the right information quickly.

##What is Kibana and where is it used?
Kibana is a data visualization tool that lets you see your data in creative and exciting ways. Having both of these tools installed can be extremely beneficial for anyone who wants to be able to quickly find and visualize their data.

Steps to download and install Elastic search and kibana [Integrate ElasticSearch with kibana](https://codebooker.blogspot.com/2023/01/elasticsearch-kibana-installation-and.html)

Some of the term used in elastic search.

- Index - similar to table which store record(document) in it.
- Document - JSON object stored in index 

Let create a index and insert documents into it.

[Index creation and their settings in elastic searh](https://codebooker.blogspot.com/2023/01/elastic-java-client-create-index-with.html)

[Insert documents into elastic index from Spring boot API](https://codebooker.blogspot.com/2023/02/inserting-data-into-elasticsearch-with.html)

[Fetching documents from index by building query](https://codebooker.blogspot.com/2023/01/elasticsearch-get-list-of-all-indices.html)


A Detailed post with examples are available in [codebooker](https://codebooker.blogspot.com/)
Perl Weekly Challenge #219 - Squaring Up
Tags: perl, perlweeklychallenge, python
Published: 2023-06-04 12:41:35

Hi everybody! This week again because of time I only finished the first challenge of The Weekly Challenge. However, because work for my client requires Python, I'm busy learning Python and I thought "Why not do Python for a simple weekly challenge task?" This is the first Python code I've ever truly written and not just modified!

First, the Perl:

    say $_ for (sort {$a <=> $b} (map {$_ * $_} @ARGV));

Yep, a one-liner. Normally I prefer to write longer, more readable code, but this time the task was so simple it made sense just to write it on one line.

We map each argument on the command line into its square, then sort (with a numerical sort because map defaults to strings) and then just say() them.

Originally I was sorting with a custom sort routine based on absolute values, but then I realized (thanks to other blog posts) that it would be more efficient not to abs() anything and just to replace everything with its square first, then sort.

Now for Python:

    list = [int(input("Num1:")), int(input("Num2:")), int(input("Num3:")), int(input("Num4:")), int(input("Num5:"))]
    for index in range(len(list)):
        list[index] = list[index] ** 2
    list.sort()
    for square in list:
        print(square)

It essentially does the same thing by replacing everything with its square, then sorting, then printing. It only takes 5 arguments because I'm not familiar with Python argument methods. I do like the simple input() command. It's quite a nice feature compared to Perl.

Hope to see you all next week!
Type Coercion in Javascript
Published: 2023-06-04 12:37:10

**_Interesting fact_**...

I was asked about this type coercion in an interview and I said that question was irrelevent since it had no use in my day today operations and the interviewer literally asked me to just define it and I was left fidgetting....

Yes, you need to have a very strong grasp with the basics of javascript apparently.
Infact, after diving deep into the topic of type coercion, I learnt so much that I didn't know and how important it was...

- - - - - - > #hashtag **LEARN YOUR BASICS**

_**TYPE COERCION**_....
    Definition: This is the automatic or implicit conversion of values from one type to another


    Example....
```javascript
        let a = 1;
        let b = "5";

        let c = a + b;
        console.log(c);
        // the value of c will be 15
        // this is because addition converts numbers to string

        let d = 5 - 1;
        console.log(d);
        // the value of d will be 4
        // this is because subtraction converts strings to numbers
```
Exploring CodeFlix: A ReactJS Project
Tags: react, javascript, firebase, webdev
Published: 2023-06-04 12:11:27

🎬 In this blog post, I'll guide you through the steps to get started with the web app built using ReactJS, Tailwind CSS, Firebase and Axios. I'm excited to hear your feedback and suggestions, so let's dive in!

## CodeFlix Repository

You can find the code for the [ReactJS](https://codeflix23.netlify.app/) project in this GitHub repository: [CodeFlix](https://github.com/JavascriptDon/Javascript-Fundamentals/tree/codeflix)

To give the app a try, follow these steps:

1. Clone the repository locally.
2. Install the necessary dependencies using **npm install**.
3. Start the development server with **npm run start**.
4. Open your browser and go to http://localhost:3000 to see it in action.

## Adding Firebase to Your Web App

CodeFlix leverages the power of Firebase for backend services and authentication. To add Firebase to your web app, follow these steps:

**Create a Firebase Project:**

Visit the Firebase console and click on the **"Add project"** button. Provide a name for your project, select your preferred region, and click on "Create project".

**Set up Firebase for Your Web App:** 

In the Firebase console, click on **"Web"** under the **"Get started by adding Firebase to your app"** section. Provide a nickname for your web app and optionally enable Firebase Hosting. Click on "Register app".

**Obtain Firebase Configuration:** 

After registering your app, you'll see a code snippet containing the Firebase configuration. Copy the configuration object (usually found within the firebaseConfig variable) for later use.

Remember to keep your Firebase configuration secure and avoid exposing it publicly.

## Lastly access the TMDB API

CodeFlix integrates with the TMDB (The Movie Database) API to fetch movie data. Follow these steps to access the TMDB API:

**Create a TMDB Account:** 

If you don't have one already, visit the [TMDB website](https://www.themoviedb.org/) and create a new account.

**Obtain an API Key:**

After creating an account, navigate to your account settings or API section on the TMDB website. Look for the API documentation or API keys section and generate a new API key. Make sure to read and agree to the terms of use and any applicable usage limits.

**Store the API Key Securely:** 

After obtaining the API key, store it securely. You can save it in a secure location or use an environment variable to store the key. Avoid hardcoding the key directly in your code or exposing it publicly.

Here's an example .env file that shows how to store your API keys:

```javascript
// env sample

// Firebase
FIREBASE_API_KEY=YOUR_HIDDEN_KEY
FIREBASE_AUTH_DOMAIN=YOUR_HIDDEN_KEY
FIREBASE_PROJECT_ID=YOUR_HIDDEN_KEY
FIREBASE_STORAGE_BUCKET=YOUR_HIDDEN_KEY
MESSAGING_SENDER=YOUR_HIDDEN_KEY
APP_ID=YOUR_HIDDEN_KEY

//TMDB API
TMDB_API_KEY=YOUR_HIDDEN_KEY

```

Feel free to modify the `.env` file according to your specific keys.

Please feel free to provide any other feedback or suggestions you have in the comments below. Your expertise and insights would be invaluable to help me enhance this ReactJS project.

Happy coding! 😄
Private Key To Mnemonic
Tags: privatekey, mnemonic, blockthon, python
Published: 2023-06-04 12:05:12

installing package in windows :
`pip install blockthon`
installing on Linux / debian:
```bash
sudo apt-get install -y autoconf automake build-essential libffi-dev libtool pkg-config python3-dev
pip3 install blockthon
```
## Generated and convert Private Key Hex To Mnemonic with `Blockthon` in python:

```python
from Blockthon.Wallet import PrivateKey, PrivateKey_To_Mnemonics

# generated random private key hex without any repeat
privatekey = PrivateKey()
# convert Private Key (hex) to Mnemonic word's
mnemonicWords = PrivateKey_To_Mnemonics(privatekey)
```
10 DSA concepts every developer MUST know for coding interviews (Data Structures & Algorithms)
Tags: algorithms, programming, coding, tutorial
Published: 2023-06-04 12:01:20

The 10 concepts I am about to mention in this video will be essential to give you the foundation required in order to solve or jump into more complex data structures and algorithms. As a software engineer, you must know these concepts to understand this field of engineering better, and no doubt these shall also help you a lot in cracking coding interviews. So pay attention and make sure to master these.

{% embed https://www.youtube.com/watch?v=xEhiMJRpeBg %}
Get Mentored from Ninja Developer for Career Success/Emotional Support
Tags: discuss, webdev, javascript, beginners
Published: 2023-06-04 11:49:51

I want to mentor 3 Developers for Career Success/Emotional Support 
 free this Month. 
This is my portfolio: https://dev.to/chetanan/chetan-jains-portfolio-cl6. If you find me worthy please reach out to me via WhatsApp at https://www.omkar.cloud/l/whatsapp or email me at chetan@omkar.cloud and I would be happy to help.
SnapArtify - Beautify Your Code Snippets & Screenshots
Published: 2023-06-04 11:49:40

**Hello developer community,**

Introducing [SnapArtify](http://snapartify.com), the ultimate application to transform your code presentations into visually stunning works of art. With a wide array of features and customization options.

SnapArtify allows developers, bloggers, and educators to beautify their code snippets and screenshots effortlessly.

![Beautify code snippets](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6bcxzovbypko8plkfkl.PNG)


![Beautify your screenshots](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jwebnunx5pxg57xpz167.PNG)
I created this application to transform any code snippets & screenshots into stunning visuals that captivate your audience. Whether you're a developer showcasing your work or a tech enthusiast looking to add creativity to your code,

With a user-friendly interface and customizable options, Snapartify makes it effortless to create and share eye-catching snapshots.

Visit [SnapArtify](http://snapartify.com) and feel free to provide your feedback.

**Happy Coding!**

**Keep in Touch**

On Twitter : [@ar_murade](https://twitter.com/ar_murade)

On GitHub : [Aishwarya M](https://github.com/AishwaryaMurade)
Parallel Development Made Seamless: Revolutionize Your Workflow with Git Worktree
Published: 2023-06-04 11:24:56

In today’s fast-paced software development landscape, efficient collaboration and streamlined workflows are essential for teams to deliver high-quality code. Git, the widely adopted version control system, offers a range of powerful features to support these needs. One such feature is Git Worktree, a valuable tool that enables developers to manage multiple working trees within a single Git repository. In this article, we’ll explore what Git Worktree is and why it should be an integral part of your development toolkit.
<br/>

## What is git worktree?
Git Worktree is a feature introduced in Git 2.5 that allows you to have multiple working trees linked to the same Git repository. In simpler terms, it enables you to have multiple copies of your codebase in separate directories, each with its own branch, while still sharing the same underlying repository.

This means that you can work on different branches simultaneously without the need for complex branching strategies or repository clones.
<br/>

## Why we should use it?
There are several compelling reasons why Git Worktree is a valuable addition to your development workflow:

- **Seamless Branch Switching**

Traditionally, switching branches involves either committing or stashing changes, switching to the desired branch, and then reapplying the changes.

With Git Worktree, you can have multiple working trees concurrently, allowing you to switch between branches without the need for committing or stashing changes, saving valuable time and minimizing disruptions to your workflow.
<br/>

- **Parallel Development**

Git Worktree empowers developers to work on multiple features or bug fixes simultaneously by creating separate working trees for each task.

This parallel development capability is especially beneficial for teams working on larger projects, enabling developers to isolate their changes and test them independently, without the risk of inadvertently affecting other ongoing work.
<br/>

- **Lightweight and Efficient**

Git Worktree offers an efficient way to work on different branches by utilizing the same repository objects, saving disk space and reducing the time required for cloning additional copies of the repository.

Rather than maintaining multiple complete copies of the project, Git Worktree shares the repository data, resulting in a lightweight setup that is both resource-friendly and convenient for developers.
<br/>

## Any git worktree manager recommands?
A powerful command-line tool [@kanamara/wotkree](https://www.npmjs.com/package/@kanamara/worktree?activeTab=readme) is designed to automate Git worktree management.

**Key features:**

- Seamlessly create and remove worktrees
- Efficiently Manage Worktree Cleanup
- Simple commands & Friendly prompts
- Support multiple repositories