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