Category: Linux

  • Clear cache memory on Linux Systems

    Sometimes, you can see that memory is not correctly released once used and some caching can remain. You can see that by using the free command: # free -m total used free shared buffers cached Mem: 64458 53397 11060 0 1550 49163 -/+ buffers/cache: 2683 61774 Swap: 9998 35 9963 At this time, you can so…

  • Change OVH linux kernel to a standard one

    OVH servers come with a custom kernel provided by OVH. This kernel is compiled with a lots of functions deactivated like: Virtualization components Modules support … If you need those features, you will probably need to install a standard kernel not provided by OVH. For that, just follow the instructions below. Install a standard linux…

  • Move files with a specific extension older than x days

    Need to move or remove a list of files with a particular extension, a particular filename pattern and/or not changed since a specific date? This can be done by combining an action to perform with the result of a find command. Moving files called “FILES*.csv” with a modification date older than 10 days: find /old/directory/ -name…

  • Restrict access by IP on specific page with HAProxy

    Most of time, we are setting only one (or some) IP to be allowed to access to some pages or services. But it can also be necessary sometimes to restrict access of an URL only for one IP (if you are getting some attacks from a hacker for example on some webservice). You can do that restriction much…

  • Rsyslog stops working after logrotate

    You are using an RSyslog mechanism to send your logs to a centralized server, but as soon as the logrotate is executed on the server, no log is sent anymore? I will explain here why this can happen and how to fix it properly. In logrotate, when rotation is happening the old file is renamed…

  • NPM – Warning “root” does not have permission to access the dev dir

    If you want to install some packages using npm and you are getting this kind of error “Warning “root” does not have permission to access the dev dir“, that means that system is trying to compile some native libraries with a wrong user and so lead to an unability to gain access on certain directories. To…

  • Using strace with multiples PIDs

    For debugging purposes, it’s sometimes necessary to debug multiples PIDs at a same time with strace tool. I will take a simple example: PHP-FPM. PHP-FPM is creating several processes depending on its needs, and if you want to perform debugging on it, you can’t easily know what each process is doing. In order to get the results…

  • Generating core dumps for PHP-FPM

    When you are getting some errors from PHP-FPM like “signal 11 (core dumped)” in your logs, you can need to generate some core dumps to understand what’s happening. Install packages You first need to install some packages to allow you generating dumps: apt-get install gdb php5-dbg System core updates You will then need to update…

  • Send its logs to one server using rsyslog mechanisms (with ssl support)

    Rysslog is allowing to send its logs from a file on a server to a remote server (or online service) that will collect and maintain all logs. Assumed server configuration We will here assume that you have a rsyslog server already running and listening on port 514 (TCP or UDP depending on your needs). This server…

  • How to setup an IPSec tunnel with Strongswan with high-availability on Linux

    It is possible to secure your communication between several sites (datacenters for example) by using an open-source VPN IPSec on your Linux System. We will see here how to: Set-up a VPN IPSec on Linux with Strongswan (https://www.strongswan.org) Set-up a high availability mechanism on top of this VPN connection to ensure the link will always…