David Cao

David Cao

David is a Cloud & DevOps Enthusiast. He has years of experience as a Linux engineer. He had working experience in AMD, EMC. He likes Linux, Python, bash, and more. He is a technical blogger and a Software Engineer. He enjoys sharing his learning and contributing to open-source.

Enable SSL in Postgresql

Enabling SSL in PostgreSQL is a straightforward process that only requires three simple steps:   Obtain server certificate and key files for Postgres On PostgreSQL server, we need 3 certificates in data directory for SSL configuration. They are:   In…

2 ways to fix cp Permission denied error

The error message “cp: Permission denied” typically occurs when the user doesn’t have permission to access the source file or the destination directory. Here are the errors we usually meet with “cp Permission denied” error in Linux: Error Description cp:…

3 ways to get table size in Postgres

Get table size with pg_relation_size in Postgres PostgreSQL provides a dedicated function, pg_relation_size, to compute the actual disk space used by a specific table or index. We just need to provide the table name. To check the size of a…

2 ways to create file with Ansible

Create a file with Ansible file module There are a few ways to create a file with Ansible. One way is to use the file module. The file module has a state option that can be set to touch to…

selectattr in Ansible

selectattr in Ansible selectattr is a filter plugin in Ansible that allows you to select a subset of elements from a list of dictionaries based on the value of a particular attribute.  Its syntax is as follows: <list of dictionaries>…

Get MAC address with Ansible

This article is part of the following series.   Get MAC address with Ansible You can use the ansible_default_ipv4.macaddress variable to get the MAC address using Ansible.This is a variable that contains the MAC address of default network interface. Here…