Monday, December 5, 2022

Curl error (37): Couldn't read a file:// file for file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 [Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8]

 When I tried to run "yum install certbot" on my Oracle linux 8 VM. I got the following error


Curl error (37): Couldn't read a file:// file for file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 [Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8]


How to fix this?

vi /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8

Open the file https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8 in a browser and copy paste the content on the path /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8

Now your yum will work. :)


Wednesday, October 26, 2022

MySQL Error : which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

 I got mysql error when executing a command

which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Solution to fix :

- Login to your server as root

- Open your mysql configuration file (for me its /etc/mysql/mysql.conf.d/mysqld.cnf)

- Add the following code after [mysqld] block

[mysqld]

sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

- Restart mysql service ( systemctl restart mysql )

Issue fixed

Monday, September 19, 2022

GIT operations in day to day life

 GIT operations

To configure your name and email in your local settings:


# git config --global user.name "Name"

# git config --global user.email "Email"

git config -l


To Clone the git repo:


git clone https://git-url/project.git


To play around the branches :


git branch

git branch -r

git switch <branch-name> 


To push from local repo to git repo:


# git add .

git commit -m "First commit"

git push -u origin <branch-name> 

Wednesday, September 14, 2022

How to upgrade Prometheus from 2.22 to 2.38 on Ubuntu

 How to upgrade Prometheus from 2.22 to 2.38 on Ubuntu

OS : Ubuntu 16.04 LTS

Prometheus version : 2.22

# /usr/local/bin/prometheus --version

prometheus, version 2.22.0 (branch: HEAD, revision: 0a7fdd3b76960808c3a91d92267c3d815c1bc354)


Confirm that prometheus datas are in # ll /var/lib/prometheus

Take a backup of this data to a safe location


Confirm the path of prometheus and promtool # /usr/local/bin/

Take a backup of this data to a safe location


Stop prometheus and grafana services


# systemctl stop prometheus

# systemctl stop grafana-server


Download the latest prometheus. In my case its 2.38 and I downloaded to /mnt folder.


# cd /mnt

wget https://github.com/prometheus/prometheus/releases/download/v2.38.0/prometheus-2.38.0.linux-amd64.tar.gz

# tar -xvf prometheus-2.38.0.linux-amd64.tar.gz

# cd prometheus-2.38.0.linux-amd64

# cp prometheus /usr/local/bin/

# cp promtool /usr/local/bin/

# chown prometheus:prometheus /usr/local/bin/prometheus

# chown prometheus:prometheus /usr/local/bin/promtool

# cp -r consoles /etc/prometheus/

# cp -r console_libraries /etc/prometheus/

# chown -R prometheus:prometheus /etc/prometheus


Start prometheus and grafana services


# systemctl start prometheus

# systemctl start grafana-server


Check the prometheus version

# /usr/local/bin/prometheus --version

prometheus, version 2.38.0 (branch: HEAD, revision: 818d6e60888b2a3ea363aee8a9828c7bafd73699)