teleren/devto huggingface dataset:
Strings In Python
Tags: webdev, beginners, tutorial, python
Published: 2023-03-28 03:54:27

[![image alt text here](http://img.youtube.com/vi/uP_O7rI5iV4/0.jpg)](http://www.youtube.com/watch?v=uP_O7rI5iV4)

A string is a data structure in Python that represents a sequence of characters. It is an immutable data type, meaning that once you have created a string, you cannot change it. Strings are used widely in many different applications, such as storing and manipulating text data, representing names, addresses, and other types of data that can be represented as text.A string is a data structure in Python that represents a sequence of characters. It is an immutable data type, meaning that once you have created a string, you cannot change it. Strings are used widely in many different applications, such as storing and manipulating text data, representing names, addresses, and other types of data that can be represented as text.
Apa itu Boilerplate
Published: 2023-03-28 03:51:39

Boilerplate adalah istilah dalam pengembangan perangkat lunak yang merujuk pada kode atau teks yang telah ditulis secara umum dan dapat digunakan ulang dalam berbagai proyek. Istilah ini berasal dari dunia percetakan, di mana boilerplate merujuk pada cetakan yang dibuat sebelumnya dan dapat digunakan berulang kali untuk membuat dokumen atau publikasi lainnya.

Dalam pengembangan perangkat lunak, boilerplate umumnya digunakan untuk menghindari menulis ulang kode yang sama atau teks yang sama berulang kali dalam proyek yang berbeda. Hal ini dapat mempercepat proses pengembangan dan meminimalkan kesalahan penulisan ulang kode.

Contoh dari boilerplate dalam pengembangan perangkat lunak termasuk konfigurasi file, kode yang diperlukan untuk menyambungkan aplikasi dengan database, atau tata letak antarmuka pengguna yang sudah diatur. Ada banyak boilerplate yang telah dibuat oleh komunitas pengembang perangkat lunak, seperti boilerplate untuk aplikasi web atau aplikasi seluler, yang dapat diunduh dan digunakan sebagai dasar untuk proyek yang baru.

Boilerplate dapat membantu meningkatkan produktivitas dan efisiensi pengembang perangkat lunak, terutama jika digunakan secara bijak. Namun, penggunaan boilerplate yang berlebihan atau tidak sesuai dengan kebutuhan proyek dapat menyebabkan masalah seperti peningkatan kompleksitas kode atau ketergantungan terhadap boilerplate tertentu yang dapat menghambat fleksibilitas proyek.

Oleh karena itu, dalam pengembangan perangkat lunak, perlu untuk mempertimbangkan secara cermat penggunaan boilerplate, mengevaluasi apakah boilerplate yang tersedia sudah sesuai dengan kebutuhan proyek atau tidak, dan memastikan bahwa boilerplate digunakan secara tepat untuk menghindari masalah dalam pengembangan perangkat lunak.

Dalam kesimpulannya, boilerplate adalah kode atau teks yang telah ditulis sebelumnya dan dapat digunakan ulang dalam berbagai proyek. Penggunaan boilerplate dapat membantu meningkatkan produktivitas dan efisiensi pengembang perangkat lunak, namun perlu dipertimbangkan dengan cermat untuk menghindari masalah dalam pengembangan perangkat lunak.
Terraform Interpolation & Condition
Tags: terraform, interpolation, programming, tutorial
Published: 2023-03-28 03:44:30

[![image alt text here](http://img.youtube.com/vi/o_M9PD42Q74/0.jpg)](http://www.youtube.com/watch?v=o_M9PD42Q74)

Embedded within strings in Terraform, whether you're using the Terraform syntax or JSON syntax, you can interpolate other values. These interpolations are wrapped in ${}, such as ${var.foo}.

The interpolation syntax is powerful and allows you to reference variables, attributes of resources, call functions, etc.

You can perform simple math in interpolations, allowing you to write expressions such as ${count.index + 1}. And you can also use conditionals to determine a value based on some logic.

You can escape interpolation with double dollar signs: $${foo} will be rendered as a literal ${foo}.
Components of Kubernetes
Tags: webdev, beginners, tutorial, kubernetes
Published: 2023-03-28 03:40:54

[![image alt text here](http://img.youtube.com/vi/LGC_f1Qc5Lg/0.jpg)](http://www.youtube.com/watch?v=LGC_f1Qc5Lg)

When you deploy Kubernetes, you get a cluster.

A Kubernetes cluster consists of a set of worker machines, called nodes, that run containerized applications. Every cluster has at least one worker node.

The worker node(s) host the Pods that are the components of the application workload. The control plane manages the worker nodes and the Pods in the cluster. In production environments, the control plane usually runs across multiple computers and a cluster usually runs multiple nodes, providing fault-tolerance and high availability.

This document outlines the various components you need to have for a complete and working Kubernetes cluster.
How to install and configure the AWS CLI on Windows 10
Tags: webdev, beginners, tutorial, aws
Published: 2023-03-28 03:37:10

[![image alt text here](http://img.youtube.com/vi/CYpy9aFIqxE/0.jpg)](http://www.youtube.com/watch?v=CYpy9aFIqxE)

How to Install and Configure the AWS CLI on Windows 10

Step 1 – Download the AWS CLI Once you are on your PC, open your browser and search for the term “AWS CLI windows” in your Google search. ...
Step 2 – Configuration ( If you are first time user) If you are first setting up the CLI, there are some additional steps to interact with AWS. ...
Step 3 – CLI Configuration ...
Step 4 – Verification ...
Daily Tasks of DevOps Engineer
Tags: webdev, beginners, tutorial, devops
Published: 2023-03-28 03:34:14

[![image alt text here](http://img.youtube.com/vi/CsDN2uTw7xY/0.jpg)](http://www.youtube.com/watch?v=CsDN2uTw7xY)

A DevOps engineer’s responsibilities include:

Designing, building, testing, and maintaining the continuous integration and continuous delivery (CI/CD) process.
Choosing the best tools and technologies the team requires to meet the business needs.
Automating different phases of the DevOps pipeline.
Monitoring systems for malicious activity.
Managing the IT infrastructure.
🎯 Let's Understand ️ ✌️ Ａｍａｚｏｎ ＥＣ２✌ ️
Published: 2023-03-28 03:33:54

Hey connections!!👋

🎯Let's learn and grow together📈

📢 📢 📢

📍 “𝐅𝐫𝐨𝐦 𝐙𝐞𝐫𝐨 𝐭𝐨 𝐂𝐥𝐨𝐮𝐝 𝐇𝐞𝐫𝐨: 𝐃𝐚𝐲 5 𝐨𝐟 𝐭𝐡𝐞 𝟏𝟎𝟎-𝐃𝐚𝐲 𝐉𝐨𝐮𝐫𝐧𝐞𝐲 𝐭𝐨 𝐌𝐚𝐬𝐭𝐞𝐫𝐢𝐧𝐠 𝐂𝐥𝐨𝐮𝐝 𝐂𝐨𝐦𝐩𝐮𝐭𝐢𝐧𝐠”

🎯  Let's Understand ️ ✌️ Ａｍａｚｏｎ ＥＣ２✌ ️

"𝐄𝐱𝐜𝐥𝐮𝐬𝐢𝐯𝐞 𝐈𝐧𝐬𝐢𝐠𝐡𝐭𝐬: 𝐋𝐞𝐚𝐫𝐧 𝐌𝐨𝐫𝐞 𝐀𝐛𝐨𝐮𝐭 𝐨𝐧 𝐌𝐲 𝐌𝐞𝐝𝐢𝐮𝐦 𝐁𝐥𝐨𝐠"

https://medium.com/cloudnloud/-2cbecc0add12

GIT Repo Link : https://github.com/gefkkd/From-Zero-to-Cloud-Hero-A-100-Day-Journey-to-Mastering-Cloud-Computing.git

Happy learning
🍂🍂🍂🍂

Sources: AWS

Follow me, Manikanta Suru and Cloudnloud Tech Community on LinkedIn for more insightful knowledge & resources.

https://linkedin.com/in/manitechy
https://github.com/gefkkd
https://hashnode.com/@mpn
https://dev.to/manikanta2023
https://techmaniit.blogspot.com/
Should you become a DevOps Engineer?
Tags: webdev, beginners, tutorial, devops
Published: 2023-03-28 03:32:12

[![image alt text here](http://img.youtube.com/vi/d3yOa3zTsgA/0.jpg)](http://www.youtube.com/watch?v=d3yOa3zTsgA)

In the present-day scenario of IT organizations, DevOps Engineer is one of the most demanding job profiles with no signs of slowing down. Statistically, the demand for DevOps Professionals has increased by approximately 40-45% in the job market within the last 3-4 years and the number is growing rapidly. Meanwhile, DevOps is a challenging job that requires a vast skillset along with adequate experience and in-depth knowledge in the field. No wonder DevOps will rule the IT world in the upcoming times and if you’re looking forward to making a car...
Connect to openGauss database (Python)
Tags: opengauss
Published: 2023-03-28 03:31:59

Python
Psycopg is a Python API for executing SQL statements. It can provide a unified access interface for PostgreSQL and openGauss databases, and applications can perform data operations based on it. Psycopg2 encapsulates libpq, and some codes are implemented in C language, which is efficient and safe. It has client-side and server-side cursors, asynchronous communication and notifications, and supports "COPY TO/COPY FROM" functions. Supports multiple types of Python out of the box, and adapts to PostgreSQL data types; through a flexible object adaptation system, it can be extended and customized. Psycopg2 is Unicode and Python 3 compatible.

The openGauss database provides support for Psycopg2 features, and supports psycopg2 connections through SSL mode.

Table 1  Psycopg supported platforms


operating system

platform

EulerOS 2.5

x86_64 bit

EulerOS 2.8

ARM64 bit

load driver
Before using the driver, you need to do the following:

Download the compiled psycopg2 compressed package from the openGauss official website.

 Note:  The version of psycopg2 downloaded from the openGauss official website is adapted to Python3.6. If you use other versions of Python, you need to compile psycopg2 yourself. The compilation method is basically the same as that under the PostgreSQL database. Just need to modify the code of the setup.py version number verification part during compilation, which can be realized by the following command:

sed -i "s/(pgmajor, pgminor, pgpatch)/(9, 2, 4)/g" setup.py
Unzip the driver package corresponding to the version, and copy psycopg2 to the third-party package folder (namely the site-packages directory) of the python installation directory.

Make sure that the permission of the psycopg2 directory is at least 755, so as not to prompt that the file cannot be accessed due to permission issues when calling.

For non-database users, you need to configure the decompressed lib directory in the LD_LIBRARY_PATH environment variable.

Before creating a database connection, the following database drivers need to be loaded:

import  psycopg2
Connect to the database
The following Python code shows how to connect to an existing database. If the database does not exist, it will be created automatically, and finally a database object will be returned.

#!/usr/bin/python
import psycopg2
conn = psycopg2.connect(database="testdb", user="openGauss", password="xxxxxxxx", host="127.0.0.1", port="26000")
In the above code, please replace the bold font according to the specific situation. Specify here to use testdb as the database name.
mbhkkkj
Tags: webdev
Published: 2023-03-28 03:30:34

jhfkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkjhlli uiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiihhhhhhhhhh i
 hioooooo
umopi
opim
ụuimlhh
What is AWS DMS
Tags: webdev, beginners, tutorial, aws
Published: 2023-03-28 03:29:08

[![image alt text here](http://img.youtube.com/vi/lqo18qSIJfU/0.jpg)](http://www.youtube.com/watch?v=lqo18qSIJfU)

What is AWS DMS or AWS Database Migration Service? AWS DMS is an AWS cloud service created to migrate data in a variety of ways: to the AWS cloud, from on-premises or cloud hosted data stores. AWS DMS can migrate all kinds of data ranging from relational databases, data warehouses, NoSQL databases, and other types of data stores.
DISTINCT
Tags: opengauss
Published: 2023-03-28 03:27:48

The DISTINCT keyword is used together with the SELECT statement to remove duplicate records and obtain only unique records.

When there are multiple duplicate records in a table, the DISTINCT keyword is used to obtain only unique records instead of duplicate records.

Syntax

```
SELECT  DISTINCT [ ON ( expression [, ...] ) ] ]
{ * | [column, ...] }
[ FROM from_item [, ...] ];
```
Parameter Description
DISTINCT [ ON ( expression [, …] ) ]
Removes all duplicate rows from the result set of the SELECT statement so that each row in the result set is unique.

Retains only the first row in the set of rows that have the same result computed on the given expression.

Examples
Insert the following data into the customer_t1 table:

```
openGauss=# INSERT INTO customer_t1 (c_customer_sk, c_customer_id, c_first_name,Amount) VALUES 
    (6881, 'maps', 'Lily',1000),
    (4320, 'tpcds', 'Lily',2000);
```

The current data is as follows:

```
openGauss=# SELECT * FROM customer_t1 ;
 c_customer_sk | c_customer_id | c_first_name | c_last_name | amount
---------------+---------------+--------------+-------------+--------
          3869 | hello         | Grace        |             |   1000
          3869 | hello         | Grace        |             |   1000
          3869 |               | Grace        |             |
          3869 | hello         |              |             |
          3869 | hello         |              |             |
               |               |              |             |
          6985 | maps          | Joes         |             |   2200
          9976 | world         | James        |             |   5000
          4421 | Admin         | Local        |             |   3000
          6881 | maps          | Lily         |             |   1000
          4320 | tpcds         | Lily         |             |   2000
(11 rows)
```

Query all values of c_first_name in the customer_t1 table. There are two Lily and three Grace.

```
openGauss=# SELECT c_first_name  FROM customer_t1 ;
 c_first_name
--------------
 Grace
 Grace
 Grace



 Joes
 James
 Local
 Lily
 Lily
(11 rows)
```
Use the DISTINCT keyword in the SELECT statement. The result shows that duplicate data has been deleted.

```
openGauss=# SELECT DISTINCT c_first_name  FROM customer_t1 ;
 c_first_name
--------------
 James
 Grace
 Local

 Joes
 Lily
(6 rows)

```
openGauss RPM installation
Tags: opengauss
Published: 2023-03-28 03:27:47

RPM installation
This chapter mainly introduces the one-click installation of the openGauss database through the yum command on the openEuler 22.03 LTS operating system.

Supported Architectures and OS Versions
x86-64 openEuler 22.03 LTS
ARM64 openEuler 22.03 LTS
Only supported on openEuler 22.03 LTS

usage restrictions
Currently, yum installation is only supported on the openEuler 22.03 LTS operating system, and both arm64 and x86_64 architectures are supported.
The database integrated into the openEuler system is built based on the capabilities of the openGauss lightweight version.
Only the stand-alone database instance is installed in the RPM mode. During the upgrade, only the binary version can be replaced, and grayscale upgrade is not supported.
The default installation instance listens to the 127.0.0.1:7654 address and port. If you need to connect remotely, you need to manually modify the listen_address in the postgresql.conf file.
The installation database creates the user openGauss by default, and the user is not deleted after the database is uninstalled.
installation method
After the operating system is installed, use yum install to install it.

yum install opengauss -y

During the installation of the operating system, the software selects openGauss, and the openGauss database is installed by default when the operating system is installed.





Instructions for use
Switch to the opengauss user su - opengauss

Check the process  ps ux, you can see that the binary installation directory /usr/local/opengaussis under the directory, and the default startup data directory is /var/lib/opengauss/dataunder the directory.

Database connection  gsql -d postgres -p 7654 -r, the default port of the database is 7654. After connecting to the database, the database can be used normally.
ORDER BY Clause
Tags: opengauss
Published: 2023-03-28 03:22:55

The ORDER BY clause sorts the data in one or more columns retrieved by the SELECT statement in ascending (ASC) or descending (DESC) order.


Syntax

```
SELECT 
{ * | [column, ...] }
[ FROM from_item [, ...] ]
[ ORDER BY {expression [ ASC | DESC ] }];
```

## Parameter Description
ORDER BY clause

Sorts data retrieved by the SELECT statement in descending or ascending order. If the ORDER BY expression contains multiple columns:

If two columns are equal according to the leftmost expression, they are compared according to the next expression and so on.
If they are equal according to all specified expressions, they are returned in an implementation-dependent order.

## Examples
Sort the result in ascending order based on the value of c_customer_sk.

```
openGauss=# SELECT * FROM customer_t1 ORDER BY c_customer_sk ASC;
 c_customer_sk | c_customer_id | c_first_name | c_last_name | amount
---------------+---------------+--------------+-------------+--------
          3869 | hello         | Grace        |             |   1000
          3869 | hello         | Grace        |             |   1000
          3869 |               | Grace        |             |
          3869 | hello         |              |             |
          3869 | hello         |              |             |
          4421 | Admin         | Local        |             |   3000
          6985 | maps          | Joes         |             |   2200
          9976 | world         | James        |             |   5000
               |               |              |             |
(9 rows)

```
Sort the reSort the result in descending order based on the value of c_customer_sk.

sult in descending order based on the value of c_customer_sk.

```
openGauss=# SELECT * FROM customer_t1 ORDER BY c_customer_sk DESC;
 c_customer_sk | c_customer_id | c_first_name | c_last_name | amount
---------------+---------------+--------------+-------------+--------
               |               |              |             |
          9976 | world         | James        |             |   5000
          6985 | maps          | Joes         |             |   2200
          4421 | Admin         | Local        |             |   3000
          3869 | hello         | Grace        |             |   1000
          3869 | hello         |              |             |
          3869 | hello         | Grace        |             |   1000
          3869 |               | Grace        |             |
          3869 | hello         |              |             |
(9 rows)
```
Start and stop operation of openGauss
Tags: opengauss
Published: 2023-03-28 03:19:46

Start openGauss
Log in to the active database node as the operating system user omm.

Start openGauss with the following command.

gs_om -t start
 Note:  The two-machine startup must be started in the two-machine mode. If the intermediate process is started in the single-machine mode, the two-machine relationship must be repaired to restore the two-machine relationship. Use gs_ctl build to repair it. For the usage of gs_ctl, please refer to "openGauss Tool Reference".

Stop openGauss
Log in to the active database node as the operating system user omm.

Stop openGauss with the following command.

gs_om -t stop
 Note:  For the operation of starting and stopping nodes and AZ, please refer to the "Server Tool > gs_om" chapter in "openGauss Tool Reference".

example
Start openGauss:

gs_om -t start
Starting cluster.
=========================================
=========================================
Successfully started.
Stop openGauss:

gs_om -t stop
Stopping cluster.
=========================================
Successfully stopped cluster.
=========================================
End stop cluster.
Troubleshooting
If you fail to start openGauss or stop the openGauss service, troubleshoot the error based on the log information in the log file, see Log reference.

If the startup fails due to timeout, you can execute the following command to set the startup timeout period. The default timeout period is 300s.

gs_om -t start --time-out=300
How to Create and Connect PostgreSQL with Amazon RDS
Tags: webdev, beginners, tutorial, aws
Published: 2023-03-28 03:17:47

[![image alt text here](http://img.youtube.com/vi/0A-5ITILrMA/0.jpg)](http://www.youtube.com/watch?v=0A-5ITILrMA)

Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.
In the upper-right corner of the Amazon RDS console, choose the AWS Region in which you want to create the DB instance.
In the navigation pane, choose Databases.
Choose Create database and make sure that Easy create is chosen.
For Engine type, choose PostgreSQL.
TIL - Heroku and postgresql
Tags: webdev, ruby, rails, beginners
Published: 2023-03-28 03:14:18

Today I was working on my portfolio website. It's still not completely done, but I am happy with how it's turning out. I learned a few new things in the process:

- I deployed my first two projects on Heroku,
- I learned about Rack gem and how to use it to create a static page in Rails. I made an empty app and pushed it to GitHub just to have it handy whenever I want to deploy a static page to Heroku,
- that being said, I learned that Heroku doesn't support sqlite3, so I had to look up how to switch to postgresql instead,
- oh, and I connected my domain to my portfolio hosted on GitHub pages.

Overall, it was a pretty productive day!
WHERE Clause
Tags: opengauss
Published: 2023-03-28 03:13:39

When you need to query data from a table based on specified conditions, you can add a WHERE clause to the SELECT statement to filter out unnecessary data. The WHERE clause forms an expression for row selection and is used to obtain data based on specified conditions. Values in the table are returned only when the specified conditions are met.

**Syntax**

```
SELECT 
{ * | [column, ...] }
[ FROM from_item [, ...] ]
[ WHERE condition ];

```
Parameter Description
WHERE clause

The WHERE clause forms an expression for row selection to narrow down the query range of the SELECT statement. Comparison operators or logical operators, such as >, <, =, LIKE, or NOT, can be used in the WHERE clause.

condition

condition indicates any expression that returns a value of Boolean type. Rows that do not meet this condition will not be retrieved.

Examples
Use logical operators to read data from the customer_t1 table.

AND

Locate the row where the value of c_customer_id is hello and that of c_customer_sk is 3869.

openGauss=# SELECT * FROM customer_t1 WHERE  c_customer_sk = 3869 AND c_customer_id = 'hello';
 c_customer_sk | c_customer_id | c_first_name | c_last_name | amount
---------------+---------------+--------------+-------------+--------
          3869 | hello         | Grace        |             |   1000
          3869 | hello         | Grace        |             |   1000
          3869 | hello         |              |             |
          3869 | hello         |              |             |
(4 rows)

OR

Locate the row where the value of c_customer_sk is greater than 6985 or that of c_customer_id is hello.

```
openGauss=# SELECT * FROM customer_t1 WHERE  c_customer_sk > 6985 OR c_customer_id = 'hello';
c_customer_sk | c_customer_id | c_first_name | c_last_name | amount
---------------+---------------+--------------+-------------+--------
          3869 | hello         | Grace        |             |   1000
          3869 | hello         | Grace        |             |   1000
          3869 | hello         |              |             |
          3869 | hello         |              |             |
          9976 | world         | James        |             |   5000
(5 rows)
```
NOT NULL
Locate the row where the value of c_last_name is not empty in the customer_t1 table.

```
openGauss=# SELECT * FROM customer_t1 WHERE  c_last_name IS NOT NULL;
 c_customer_sk | c_customer_id | c_first_name | c_last_name | amount
---------------+---------------+--------------+-------------+--------
(0 rows)
```
BETWEEN

Locate the row where the value of c_customer_sk is between 4000 and** 9000**.

```
openGauss=# SELECT * FROM customer_t1 WHERE  c_customer_sk  BETWEEN 4000 AND 9000;
 c_customer_sk | c_customer_id | c_first_name | c_last_name | amount
---------------+---------------+--------------+-------------+--------
          6985 | maps          | Joes         |             |   2200
          4421 | Admin         | Local        |             |   3000
(2 rows)
```