SRE – Systems and Network

Tips and tricks

  • If your machine is behind a proxy, you probably configured your browser for going through the proxy to reach Internet. But what about command line with curl and wget? If you want to add the proxy temporarily for some few…

  • Who never forgot a root password on a running machine that you can’t reinstall totally? Most of the linux distributions do have a recovery partition that you can use for that on startup (I won’t detail this here). But if…

  • Some Apache servers do activate the DirectoryIndex so you can easily go through the directories listing over HTTP and download some files. It’ s often used for giving possibility to people to download multiple releases for a package/software. But in…

  • It’s often very useful to automate opening of multi panes with iTerm to execute many commands or getting access to many servers at the same time. This can be done through AppleScript. You can copy this script and save it…

  • When trying to execute a nagios plugin, you’re getting this error: # /usr/lib/nagios/plugins/check_procs bash: /usr/lib/nagios/plugins/check_procs: No such file or directory But when checking further, the file does exist: # ls -l /usr/lib/nagios/plugins/check_procs -rwxr-xr-x 1 root root 124929 Jan 19 2016…

  • With recent versions of NRPE server, the possibility to enable command args has been disabled. For example, on a Debian Jessie, you can get this kind of error on console: CHECK_NRPE: Received 0 bytes from daemon and in logs: Error:…

  • Since Apache 2.4, mod_auth changed and some directive like Order allow,deny Allow from all that have been replaced with Require all granted If you want to automatically handle same configuration for multiple servers where different versions of Apache are installed,…

  • With PostgreSQL, if you have a field containing an Array and you want to get all the results containing this value in the array, you can use the following command. Here, we are looking for all the results in the…

  • If you have a bash script doing some critical actions, it can be useful to add a confirmation dialog to double check with the user that he really wants to perform the action. Here is a very simple script allowing…

  • Tomcat allows you to rotate easily your log files with AccessLogValve but it can be more difficult to get cleaning in logs directories automatically. For that, you can easily use some smart find commands combined with actions: Get logs older…