SRE – Systems and Network

Tips and tricks

  • In Apache, if you want to forward some requests matching a regex to another server, you can use the rule ProxyPassMatch. Here is an example that is matching URL like: /admin/anything /list/any number/info /manage/any number and redirect it to https://my-hidden-domain.com:26000…

  • A simple script that can browse a directory, and upload to S3 some files matching a regex. The file will be uploaded by respecting the path you have in local. #!/usr/bin/env python # -*- coding: utf-8 -*- import os, re…

  • 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…

  • 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…

  • 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.…

  • 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…

  • 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…

  • 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…

  • 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…

  • 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…