503 Max restarts limit reached

So we had "503 Max restarts limit reached" problem on our production while doing some batch operations and some edits of entities. Problem for both was that server response was slow as both have large queries running which take more than 20 seconds(yeah should be optimized and probably add some indexes to fields).

Xdebug profiler on Mac OSx

Calling this 3 commands should help you install qcachegrind so you can read xdebug profiler files you made

# Install qt
brew install qt

# Install qcachegrind
$ brew install qcachegrind
 
# Install graphviz
$ brew install graphviz

run qcachegrind in CLI and it will open up app in window where you can import profile file.

Run composer without "Discard changes" question

You want to keep composer quite and just do its job? Then either set that to your composer.json config with

composer config --global discard-changes true

Which will add that config to your config.json and everbody will have this setting or you can just make this one liner to keep it shut.

Checking all crontabs on server

To get all crontabs from users on your system write this one liner

for user in $(getent passwd | cut -f1 -d: ); do echo $user; crontab -u $user -l; done

to check other crons you need to see what is in for example 

ls -la /etc/cron.daily

or

How to login to drupal over postman or CLI (Authorization: Basic)

To login to drupal and POST/PATCH some endpoint over JSON:API you need to login first, this is simple over postman, just go to Authorization TAB, select Basic Auth and fill in your user/pass and this will be automatically added to your header. You could also make it manually adding header with calculated base64 username:password, which you can get with CLI and

Rsyslog using severities, templating and datadog integration

Basic setup

So I will assume you installed syslog and have some default config running for it with syslog_facility set to log_local0. With that lets assume you are using rsyslog and you have config for it in

/etc/rsyslog.conf

which could have all config in this file or separated config files that are included with

Having multiple drush versions on a enviroment

Do this on your local or virtual enviroment, depending where do you want to have it

mkdir ~/drush10
cd ~/drush10
composer require "drush/drush:10.*"

this will install drush10 to that directory and now you just need to add alias

SSH keys setup on Mac OsX

To add multiple ssh keys to your system, you need to edit config file ~/.ssh/config and put lines like below, this will also help store password for your ssh in keychain and use agent forwarding so you can use your keys on virtual machines like vagrant