Linux

Linux: migrate storage with pvmove

1. Begin by pvcreate’ing the new disk. This is the disk from the new storage array to which we want to migrate to. # pvcreate /dev/mapper/mpathY 2. Now, add this disk into the data_vg Volume Group : # vgextend data_vg…

Read More

Systemd: automatically restart after failure

With systemd you can configure the service so that it automaticaly restarts the service in case the service crashes.It’s enough to add the “restart” option to the [service] stanza within the service systemd configuraiton file.See example below. Of course, you…

Read More

Clamav: limit memory usage

Once in a while the clamd process can get killed because of memory usage. It turns out it would always get killed when reloading the database after an update. This is due to the fact that during a database reload clamd will…

Read More

Linux: quotaon: Quota format not supported in kernel

I was building a new system for hosting, and that system is a virtualised system with  Ubuntu. The OS was built by the provider. After installing everything, I wanted to activate the quota on the filesystem. The quota check failed with…

Read More

Linux: GRUB slow on 4k screens

In case you have a screen with high resolutions, a 4k screen for example, it is possible that GRUB is incredibly slow. If that is the case, the workaround is to edit the /etc/default/grub file, and add/replace the following line…

Read More

Linux – commvault: create systemd file

If you have upgraded your old Commvault agent,or you still use an old Commvault agent on your linux ‘systemd’ system, there won’t be any start/stop script for the agent. You can use the workaround below for creating a systemd file…

Read More

Mysql: optimize all tables in all databases

In order to optimize all databases & tables within your mysql instance, you can use the code below. You can also use a more specific script, where only the tables are optimized which have 10MB free space and 10% free…

Read More

FFmpeg: decrease size of mp4 file

With ffmpeg you can also decrease the size (aka: quality) of a mp4 file on linux command line.You can use the following example, which will generate a +/- 5Mb file :

Read More

Denyhosts: Add IP to whitelist

Create a file ‘allowed-hosts’ in the ‘work_dir’ (can be found in the denyhosts.conf file), which is /var/lib/denyhosts on Ubuntu, containing the ip.See the example below:

Read More

Fail2ban: unblock an ip

Find IP Address to Unblock Log in to your server via SSH and type in the following command: iptables -L -n Look for the IP address you want to unblock / unban. Now we must find the jail name this…

Read More

Fail2ban: whitelist an ip

First, edit the config file : vi Then, check the line : ignoreip = Add now add all ip you want. Each IP or range IP must be placed here with a space. Ex: 192.168.0.1 192.168.5.0/32 Save. And restart…

Read More