Bash check if a program is running or not

You can find process id for a running program with command

Example

We can use pidof command in bash script to find if a program is running or not

See bash […]

Read More…

PrestaShop Error Declaration of Cart::getPackageShippingCost

On a PrestaShop site, i get error message

To fix this error, edit file /var/www/vhosts/site.com/httpdocs/override/classes/Cart.php Find line

Replace with

This is because orderide class have improper function definiation, this may be due to some outdated PrestaShop modules. See PrestaShop […]

Read More…

Online Code Editor

Eclipse Che Eclipse Che is an Open Source Online Code editor. https://github.com/eclipse/che/ It support several programming language. Based on Visual Code Studio. RedHat.com supports this open source project and provide Free hosting for the Eclipse Che ommunity with the hope that it will result in ever-increasing community involvement and contributions. https://che.openshift.io […]

Read More…

CWP not working after hostname SSL install

On a CentOS Web Panel (CWP) server, control panel stopped working after installing SSL certficate for hostname. When starting cwpsrv service, i get following error.

To fix this, i run

This generated the self signed SSL for hostname. After this CWP control panel started working. Apache still was down, fixed it by removing […]

Read More…

Auto restart newrelic-daemon if crashed

On a web server with Newrelic APM installed, graph stopped showing new data. On checking the newrelic log file, i get following error

This is because newrelic-daemon stopped working. To auto restart newrelic-daemon if it crash, do the following

Add following to the file

Make the script executable

Create a cronjob […]

Read More…

bash check if a folder is empty or not

To check if a folder is empty of not, you can use

If you want to reverse the checking, you can use !

See bash […]

Read More…

libvirt qemu unexpectedly closed the monitor Failed to create chardev

On CentOS 7 server, after installing KVM, i connected to server using Virt Manager. During VM creation, i get following error libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2021-02-01T18:09:38.214356Z qemu-kvm: -chardev pty,id=charserial0: Failed to create chardev To fix this, edit file

Find

Replace with

Reboot the server. After reboot, VM creation […]

Read More…