Outside Links collection

Sometimes you find just the right resources that fulfill certain need and nothing much should be added to them, in those cases I will just collect them on this page and add short comment why is this so.

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 find hook_update_N, current N value

To find it via drush, run this command 

drush php:eval "echo drupal_get_installed_schema_version('modul_name');"

also if you want to look it up with some DB admin tool, look under table `key_value`,  `system.schema` collection row, with a `name` of your module and you will get value of last run update.

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

Recursively renaming files and folders with PHP

I wanted to rename lots of filed and folders for my modules, but not to do it manually I made an php script that does this for me. Also I used my IDE to rename code(class names and methods). So just replace root where is the code you want to change file and folder names and do that for strings also.

Adding prefix or suffix to entity base fields

When creating custom entity you will use "BaseFieldDefinition" code snippets where you will define many things about this field, one of the things you may want to define is suffix or prefix that will be used in display of this field either on entity view or on views that use this field. To do that you will add it to setSettings array simple as 'suffix' => '%'

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