Recovering GRUB Linux

Usually on each disk there is an MBR (master boot record) and when the computer is turned on, the BIOS accesses it for information for further download. On Linux systems, GRUB is used as the boot loader, I will write about the recovery options of which below.

You can see the version of GRUB using the command:

grub-install --version

1) First option.
We start the system with LiveCD/USB, for example in the Ubuntu Desktop image, in addition to the installation, it is possible to start the system.
Open the terminal, for this press Alt+F2 and enter the command:

gnome-terminal

Continue reading “Recovering GRUB Linux”

Configuring Cron Jobs in cPanel and WHM

Cron jobs are added separately for each user through the cPanel and WHM web interface, namely cPanel “Advanced” -> “Cron Jobs“.
Through the WHM panel “Home” -> “Server Configuration” -> “Configure cPanel Cron Jobs“.

But there are also system tasks that can not be seen through the panel.
They can be seen by connecting through SSH to the server and running the command from the root user:

crontab -e

or from another user via sudo:

sudo crontab -e

In the nano editor, the shortcut Ctrl+X is used to exit, and y/n to save or discard the changes.
The file itself with the tasks is located on the path /var/spool/cron/root

If an annoying report is sent to an e-mail when executing an assignment, you can hide the output of the task by adding the following code to the end of the command:

>/dev/null 2>&1

To restart the Cron service, use the command:

service crond restart

See also a similar article: Using and configuring CRON

Configure ProFTPd using the MySQL user database

Let’s say there is a ProFTPd server installed, for example, as I described in this article – Installing and Configuring ProFTPd in Ubuntu
And also installed MySQL server, for example, as I described in this article – Installing and configuring a MySQL server on Ubuntu

Here is an example of setting up ProFTPd using the MySQL user database.

Continue reading “Configure ProFTPd using the MySQL user database”

The solution of the error “Job for puppetserver.service failed because the control process exited with error code”

I noticed once when I started Puppet server, after installation, the following error:

Job for puppetserver.service failed because the control process exited with error code. See “systemctl status puppetserver.service” and “journalctl -xe” for details.

The error occurs because there is not enough RAM and to fix the error, open the Puppet server configuration file:

sudo nano /etc/default/puppetserver

And reduce the amount of allocated RAM for the Puppet server (for example, I specified 512m instead of 2g):

JAVA_ARGS="-Xms512m -Xmx512m"

Now let’s start the Puppet server:

sudo systemctl start puppetserver

Run application at startup in Ubuntu

Below is an example of creating a script to autorun the desired program.

Create a script:

sudo touch /etc/init.d/name

Open it in a text editor (in the editor nano Ctrl+X to exit, and y/n to save or cancel changes):

sudo nano /etc/init.d/name

Fill it with content like:

#!/bin/bash
/etc/init.d/programma start

Let’s make the script executable:

sudo chmod +x /etc/init.d/name

Add the script to startup:

sudo update-rc.d name defaults 95

You can get the documentation for update-rc.d by running the command:

man update-rc.d

To remove a script from autorun, use the command:

sudo update-rc.d name remove

See also:
Solving the error “insserv: warning: script ‘script’ missing LSB tags and overrides”

Installing the Netlist for ABillS

On the test, I install the Netlist module for ABillS in Ubuntu Server.

We import the tables into the database:

mysql -D abills --default-character-set=utf8 < /usr/abills/db/Netlist.sql

Open the billing configuration file:

nano /usr/abills/libexec/config.pl

Make sure that the module is activated:

@MODULES = (
          'Netlist'
          );

Install nmap and Perl module for it:

sudo apt-get install nmap
sudo cpanm Nmap::Parser

Let’s see where nmap is located:

which nmap

Open the billing configuration file again:

sudo nano /usr/abills/libexec/config.pl

Let’s specify the path to nmap:

$conf{'NMAP_LOCATION'}="/usr/bin/nmap";

Add to sudoers:

echo 'www-data ALL=(ALL) NOPASSWD: /usr/bin/nmap' >> /etc/sudoers.d/abills_sudoers

After installation, the module will be available in the menu /Settings/Netlist

Configuring Automatic Calls in Asterisk

Asterisk can automatically make a call if you put a .call file in the (default) /var/spool/asterisk/outgoing/ directory. If the date of the file change is greater than the current one, the call will be made on or after this time.

For automatic calls, the pbx_spool.so module must be loaded, it must be registered in modules.conf or autoload=yes must be specified.

Continue reading “Configuring Automatic Calls in Asterisk”