teleren/devto huggingface dataset:
Prerequisites and operation steps for the installation of one active and one standby node of openGauss
Published: 2022-09-15 09:51:46

Preconditions:

The creation of user groups and ordinary users has been completed.
All server operating systems and networks are up and running.
Ordinary users must have read, write, and execute permissions for the database package decompression path and installation path, and the installation path must be empty.
Ordinary users have execution rights to the downloaded openGauss compressed package.

Before installation, please check whether all ports in the specified openGauss port matrix are occupied. If they are occupied, please change the port or stop the current process of using the port. For the port number, please refer to the parameter description in step 3 below.

Operation steps:

Step 1: Log in to the host where the package is installed as a common user, and decompress the openGauss compressed package to the installation directory.
`tar -jxf openGauss-xxx-openEuler-64bit.tar.bz2 -C /opt/software/openGauss`

Step 2: Assuming the path of the decompressed package is /opt/software/openGauss, enter simpleInstall in the decompressed directory.
`cd /opt/software/openGauss/simpleInstall`

Step 3: Execute the install.sh script to install openGauss.
`sh install.sh -w xxxx --multinode`
Step 4: After the installation is completed, use ps and gs_ctl to check whether the process is normal. 

Run the ps command to display the following information:

`>> ps ux | grep gaussdb 

omm 4879 11.8 1.1 2082452 373832 pts/0 Sl 14:26 8:29  /opt/software/openGauss/bin/gaussdb -D   /opt/software/openGauss/data/master -M primary

omm 5083 1.1 0.9 1819988 327200 pts/0 Sl 14:26 0:49 /opt/software/openGauss/bin/gaussdb -D /opt/software/openGauss/data/slave -M standby 

omm 20377 0.0 0.0 119880 1216 pts/0 S+ 15:37 0:00 grep --color=auto gaussdb`

Execute the gs_ctl command to display the type as shown on the right:

`>> gs_ctl query -D /opt/software/openGauss/data/master 

gs_ctl query ,datadir is /opt/software/openGauss/data/master 

HA state: 

local_role : Primary 

static_connections : 1 

db_state : Normal 

detail_information : Normal 



Senders info: 

sender_pid : 5165 

local_role : Primary 

peer_role : Standby 

peer_state : Normal 

state : Streaming 

sender_sent_location : 0/4005148 

sender_write_location : 0/4005148 

sender_flush_location : 0/4005148 

sender_replay_location : 0/4005148 

receiver_received_location : 0/4005148 

receiver_write_location : 0/4005148 

receiver_flush_location : 0/4005148 

receiver_replay_location : 0/4005148 

sync_percent : 100% 

sync_state : Sync 

sync_priority : 1 

sync_most_available : Off 

channel : 10.244.44.52:27001-->10.244.44.52:35912 

Receiver info: 

No information`
Java OOP Concepts Cheat Sheet
Tags: java, beginners, programming, tutorial
Published: 2022-09-15 09:32:28

Inheritance, Abstraction, Polymorphism and Encapsulation quick reference guide. 

![Java OOP Concepts Cheat Sheet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kl5mehtz9d37asx4hdiy.png)

See more at https://javaconceptoftheday.com/java-oop-concepts-cheat-sheet/
How to create a simple SFTP server using java stack
Tags: java, quarkus, sftp
Published: 2022-09-15 09:23:21

---
title: How to create a simple SFTP server using java stack
published: true
description: This blog is for designing a simple SFTP server using JAVA and QUARKUS
tags: java, quarkus, sftp
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rh1j55kvjkilt7pacqku.png
# Use a ratio of 100:42 for best results.
---

**Build a simple SFTP server**

**Usage**

As a software developer, I do different activities with SFTP server. It became a daily use case for me. I use to ask a IT/DEVOps person for a help to setup SFTP server in an instance, So that i can use through different clients. It is becoming costly activity in terms of time and money and hard to setup in linux/ubuntu machines.

To avoid that, I have created my own SFTP server and it can run in my local machine too. I used a trending technologies and frameworks and built a light weight SFTP server.



**Tech Stack Used**

- JAVA (11)
- Quarkus Framework

Most of people may not know about the quarkus. But It's a *Kubernetes Native Java stack tailored for OpenJDK HotSpot and GraalVM, crafted from the best of breed Java libraries and standards*. Framework community is growing very fast and building a optimised solutions to the world.

This is purely build on top of JAVA and QUARKUS. I used a sshd-sftp maven package for implementing SFTP server. So that, Now i can run it locally as jar file using java commands.

Recently, I used the same jar to create a SFTP server in AWS EC2 instance. It's working cool :).



**Source code**

https://github.com/vishalpaalakurthi/SFTP-Server-Quarkus

(Instructions are available in README file)



I hope you like it. Please add your comments.

Thanks
How to have a unique NeoVim instance
Tags: vim, neovim, opensource
Published: 2022-10-13 18:01:15

---
title: How to have a unique NeoVim instance
published: true
date: 2022-09-15 09:23:16 UTC
tags: vim,neovim,OpenSource
canonical_url: https://daniele.tech/2022/09/how-to-have-a-unique-neovim-instance/
---

Yes it is not impossible and with a bit of python and alias is easy!

The post [How to have a unique NeoVim instance](https://daniele.tech/2022/09/how-to-have-a-unique-neovim-instance/) appeared first on [Daniele Mte90 Scasciafratte](https://daniele.tech/eng).
Sending mails using Cron in Drupal 8
Tags: php, drupal, drupal8, cron
Published: 2022-09-15 09:21:38

In this post, we will be sending a simple birthday greeting email to the users using cron.

First, we have to create a module file in our custom module folder. We will name it as 'MODULE_NAME.module'. Using the _hook_cron()_, we will call a function to send the emails to the users where the mail-body is defined.

```
function MODULE_NAME_cron() {
    user_birthday_mails();
}
```

Now we will fetch the details of the users, namely User-Name, Email-ID & Date of Birth.

In this scenario, I'm fetching the user details from a custom table.

```
<?php
function user_birthday_mails() {
	// this is used to send HTML emails
    $send_mail = new \Drupal\Core\Mail\Plugin\Mail\PhpMail();

    $current_m_d = date('m-d', \Drupal::time()->getRequestTime());
    $fetch_query = \Drupal::database()->query("SELECT `firstname`, `email`, `dob` FROM `TABLE_NAME`");
    $query_result = $fetch_query->fetchAll();

    foreach($query_result as $result){
        $birthday = explode('-', $result->dob);
        $birth_m_d = $birthday[1].'-'.$birthday[2];

        $user_name = $result->firstname;
        $user_mail = $result->email;

        if($birth_m_d == $current_m_d){
            $from = 'sitename@example.com';
            $to = $user_mail;
            $message['headers'] = array(
                'content-type' => 'text/html',
                'MIME-Version' => '1.0',
                'reply-to' => $from,
                'from' => 'Site Admin <'.$from.'>'
            );
            $message['to'] = $to;
            $message['subject'] = "Happy Birthday ".$user_name."!!!";
        
            $message['body'] = 'Dear '.$user_name.',
            <br><br>
            We value your special day just as much as we value you. On your birthday, we send you our warmest and most heartfelt wishes..
            <br><br>
            Regards,<br>
            Site Admin';
        
            $send_mail->mail($message);
            \Drupal::logger('userinfo')->notice('Birthday mail sent to '.$user_name);
        };
    }
}
```

I hope you find this simple use of cron helpful.
Deploying Vue apps in subdirectory
Tags: vue, htaccess, apache, deployment
Published: 2022-09-15 09:20:05

This take 6 hours for me to understand, 

first you need to configure some file
`1. vite.config.js`

```
import { fileURLToPath, URL } from "url";

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [vue()],
	base: "/yourSubdirectory/",
	resolve: {
		alias: {
			"@": fileURLToPath(new URL("./src", import.meta.url)),
		},
	},
});
```

you need to add `base` configuration in your vite config, to make your asset file path relative to the root and the subdirectory.

`2. index.js in router`

```
	history: createWebHistory(`/subDirectory`),
	base: `/subDirectory`,
```

you need to add base configuration in the router so vue know where exactly your file, and the history to make vue save your subDirectory as a history route


`3. .htaccess`
this is the game begin

```
<IfModule mod_negotiation.c>
  Options -MultiViews
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subDirectory
RewriteRule ^subDirectory/index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subDirectory/index.html [L]
</IfModule>
```

i cannot explain this section, so if you guys know please explain to me, i really appreciate it.


if you guys have same problem with me and have another method to resolve it, feel free to share.

thanks for reading.
Django 4.1
Published: 2022-09-15 09:13:26

1. 模型设计 models
2. 迁移 Migrations 
makemigrations 负责将模型修改打包进独立的迁移文件中——类似提交修改，而 migrate 负责将其应用至数据库。
makemigrations is responsible for packaging up your model changes into individual migration files - analogous to commits - and migrate is responsible for applying those to your database.
python manage.py makemigrations

python manage.py migrate
3. routes, views, template, admin
Notice: Undefined index: category
Tags: webdev, php, smarty
Published: 2022-09-15 08:48:32

I've checked the file that says that I'm having the error, but cant fix it I have absolutely no clue about what the hell is going on.

![Error of the file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0smmqdu9q9mxmds78z3p.png)


![Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3ygn06wos80mcf0z2q4h.png)
Apsara Book website template
Published: 2022-09-15 08:16:52

<p>The Apsara Book is the best website template that was built with an objective to write and publish unlimited E-books online. With this template, we can create rich e-book content including video, audio, text, and computer program code in many modern programming languages. In summary, this template includes all the latest technology in web development. </p>

<p>In addition, to help you make money, Apsara Book has reserved a large spot on the front page and two other spots in each page of the book for you to display a variety of advertisement pictures as much as you can.</p>

<p>What is unique to this template is the possibility for us to navigate through all books and articles in the database without any difficulty. As the result, readers will always find the book they like by navigating and/or searching the books. Moreover, at the bottom of the front page, readers could also search their favorite books by just clicking a button to do random search.</p>

[https://khmerweb.deta.dev/post/vruj8drwv08y](https://khmerweb.deta.dev/post/vruj8drwv08y)

<a href="https://khmerweb.deta.dev/post/vruj8drwv08y">
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mkpf07a5jyz5c79j8mfk.jpeg" />
</a>
Mantine Modal Header
Tags: mantine, modal
Published: 2022-09-15 08:33:39

How can I modify this modal header of mantine? there's a documentation on how to modify but I want to make it like a full color without the padding of modal.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gduuzkafpt7mh3h806tp.png)
Easy advanced TypeScript types from day 1
Tags: typescript, javascript, webdev, beginners
Published: 2022-09-15 08:28:59

---
title: "Easy advanced TypeScript types from day 1"
published: true
description: Please check out this important TypeScript idea
tags: typescript, javascript, webdev, beginners
---

Someone proposed a TypeScript feature that could bridge the gap between the JS and TS worlds:

{% embed https://twitter.com/mindplaydk/status/1570325123948859392?s=20&t=5_4GmH7rSSxcdKyrLhZkjQ %}

*"Typing is hard".*

Yes, it is.

Imagine if this was easy and accessible to everyone from day 1? I really think we need to push for the development of this idea. 

**Advanced types should be for Everyone, not just TypeScript Gurus and people with functional programming experience.** 🙂✌

Please 💗 this post, ⭐ and `+1` the [issue](https://github.com/microsoft/TypeScript/issues/41577) - let's get this idea out there!

Thank You! 🙏
¿Como encontre un mentor?
Tags: programming, javascript
Published: 2022-09-15 08:04:05

Desde que aprendí HTML por mi propia cuenta, logre conocer a una persona que estaba inmerso en la programación y me ayudaría en mi camino y aprendizaje...

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


Antes que empezara me entrevisto e hizo unas preguntas ahora que lo recuerdo.

Estuve recibiendo clases y es gracioso al decirlo, Aun recuerdo que yo le dije:   "Soy  programador" el primer día me puso hacer peticiones al servidor ja ja ja lo cual yo no entendía nada, absolutamente NADA! Que era una variable, función, arreglo, objeto, un callback... Yo solo sabia HTML


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

Todo eso era nuevo para mí, y no sabía que existía javascript
yo estaba comprometido en aprender a programar, solamente que con python 

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

Al fin... tomé la decision de aprender JavaScript y no me arrepiento, lo cual me resulto un poco difícil porque yo no le entendía nada, me costaba mucho asimilar que era un objeto y un arreglo, el ya sabia todo y por lo cual fui aprendiendo a mi propio ritmo y a mi propia forma por que el estaba en otro nivel que yo no entendía...


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

Recuerdo que me dejaban proyectos de la Universidad recuerdo que había que hacer un CRUD, yo iba todas las tardes de 2:00 PM a 5: PM y mi proyecto que teníamos para entregar en 1 mes, él lo hizo en 2 tardes y todas las tareas siempre le pedía ayuda y todos pensaban que yo sabia programar en la Universidad y "si" dije que yo lo hacía todo.


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

Fui aprendiendo la verdad, me costo bastante, llevarle el ritmo y me di cuenta de que podia ayudarlo tambien.

## Que le estoy aportando

##### Trabaja gratis si es necesario: Cuando al fin aprendi a programar empece ayudarlo con lo que sabia, creo que es aportar valor y demostrarle que uno tiene la capacidad de realizar ese tipo de tareas. Yo estoy por mi propia voluntad dando mi tiempo y energia solo para que me sea posible aprender mas y a veces trabajo tarde solo para que me sea posible aprender 

Creo que tuve un golpe de suerte al tener un menthor, veo a muchos junior que preguntan muchas cosas oh se quedan atrapados en un simple error por horas e includo por semanas  por algo que es muy sencillo, yo he estado ahi y cualquier duda, le pregunto y en cuestion de minutos me explican el error y me ayudan a entender el problema y correjirlo, asi poder seguir aprendiendo y no quedarme mucho tiempo con ese error cuando realmente le empece a dedicar tiempo a programar me di cuenta que mi conocimiento empezo a crecer demasiado! en apenas 6 meses...
A Nice Developer Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2022-09-15 08:00:21

---
title: "A Nice Developer Joke For Today"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12598c9c711.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ Why are machine learning models so fit?

___A:___ Because they do weight training.
 -->
Book review – "10 Simple And Effective Productivity Hacks For Programmers", by Simple Programmer
Tags: programming, selfimprovement, bookreview, tips
Published: 2022-09-20 06:37:54

---
title: Book review – "10 Simple And Effective Productivity Hacks For Programmers", by Simple Programmer
published: true
date: 2022-09-15 08:00:00 UTC
tags: Programming,SelfImprovement,BookReview,tips
canonical_url: https://10xlearner.com/2022/09/15/book-review-10-simple-and-effective-productivity-hacks-for-programmers-by-simple-programmer/
---

Hello ! I'm Xavier Jouvenot and today, I want to talk to you about a document I've just read.
This document is named *"10 Simple And Effective Productivity Hacks For Programmers"*, by Simple Programmer.

This is a very small book composed of 14 pages (so really quick to read) detailing, as the title suggests, 10 ways you can improve your productivity, as a programmer. I won't go over the “hacks” detailed in it, as this is a free digital book that you can get directly on [Simple Programmer website](https://simpleprogrammer.com/10hacks/).

I found this small book really practical, as the different hacks in it are really actionable. Some may require a little bit of time for us to get used to, but everyone can apply them, and will, without a doubt, get great results.
If you are used to reading articles or books on self development, or productivity in general, you will probably know about all these techniques. But, even if this is the case, I encourage you to read it, as it is always nice to refresh those knowledge, and the small format make it easy for a quick read 😄

Personally, I know that, when I am in a rush or just too deep in my work, I tend to try to brute force everything rather than using the right method to accomplish everything in a sane and productive manner. So I will go back to this book several times during the following months in order to check up on how I am doing and how I can improve myself. And, since a part of the 1st hack is to clean his deck, I will work in a less messy environment 😆

On this note, I am going to clean my desk, and I will let you with this [link](https://simpleprogrammer.com/10hacks/) to the book. 😉

-----------

Thank you all for reading this small article,
And until my next article, have a productive day 🙂
Allow validator messages to use nested arrays - Laravel
Tags: laravel, php, webdev, programming
Published: 2022-09-15 07:46:59

In the new version 9.28 we have the feature Allow validator messages to use nested arrays So that the handling of writing error messages is more organized and smells to the eye .

https://github.com/laravel/framework/pull/43981

```php
[
   'attribute.rule1' => 'message1',
   'attribute.rule2' => 'message2',
   'attribute.rule3' => 'message3',
   'attribute.rule4' => 'message4',
   'attribute.rule5' => 'message5',
]

// Now 

[
   'attribute' => [
       'rule1' => 'message1',
       'rule2' => 'message2',
       'rule3' => 'message3',
       'rule4' => 'message4',
       'rule5' => 'message5',
    ]
]
```


I hope you enjoyed with me and to learn more about this release visit the sources and search more. I adore you who search for everything new.

Source :- https://www.youtube.com/watch?v=DKd560Ps6xo
Source :- https://laravel-news.com/laravel-9-28-0
The Vim Tutor - Try This Out Now!!!!
Tags: linux, scripting, kubernetes, aws
Published: 2022-09-15 07:36:20

In Preparation for my Kubernetes Examination, I have been sharpening up my Linux skills, having primarily used NANO before vi / vim was a little new to me, however during one of the Video Lectures I managed to pick up this little Easter Egg, which I am sharing with you now, it only takes 30mins of your time, but you will LOVE IT! I recommend VIM tutor whether you already know the VI text editor, there are some really cool and powerful techniques that can save you alot of Scripting time! I believe having a really strong Foundation can take you places, because that's the soil we grow from. 

https://www.systutorials.com/vim-tutorial-beginners-vimtutor/
Deploying a Google action
Tags: googlecloud, javascript, beginners
Published: 2022-09-15 07:21:08

Now that we have our Google Action fully functional, we can look at deploying it so that it will become active for everyone.

I've never done this before, so bear with me, as Google might come back and reject the action for some reason.

## Deploying the Google action

First of all, head over to your [Google actions console](https://console.actions.google.com/) and ensure you tested the app on all possible devices in the Test tab.

Once you are ready to deploy, head over to the deploy tab.
In this tab, you'll find a small overview of the most important parts with a detailed option on the left.

![Google action deploy screen](https://cdn.hashnode.com/res/hashnode/image/upload/v1662356133074/Pp5fSRalf.png)

I started filling out the information on this page, and here are the required fields:

- Short description
- Full description
- Small logo
- Developer contact details
- Privacy policy

Let me dive a little bit deeper into the Privacy policy as it's the one that might require some more work.

If you already have a generic one on your website, you can use that.
If you don't have one, you can use a free tool like [TermsFeed](https://app.termsfeed.com/wizard/privacy-policy/) to generate one.

You can then follow Google's actions example of hosting it on Google Drive and making the link publicly available. They do an excellent job of explaining how it works inside the privacy policy step.

Mine looks like this: [Google action privacy policy](https://docs.google.com/document/d/1g1EyJcwQ1CVAlkbMIxu4icZzYm8EzFRxNBOVOn5EN6A/edit?usp=sharing&resourcekey=0-9iXTaOwAQHpYL9Q84-7Xxw).

And once that's all filled out, head over to the release section in the left-side menu.
From here, you can start a new release by clicking the button.
Your version will be 1, and you can select "production" as your channel.

Check that you have gone through all the steps described and want to do a full rollout.

![Google action release checklist](https://cdn.hashnode.com/res/hashnode/image/upload/v1662356637631/GUy4fJVkJ.png)

Once done, you'll either be prompted that it succeeded or missed a step somewhere. You can simply go back and fix it and try again.

In the end, your submission will be visible in the release section, and you should receive an email about this.

![Action under release](https://cdn.hashnode.com/res/hashnode/image/upload/v1662356727373/HYO2mYpMb.png)

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)