26. May 2022 |

Docker, Linux, user

Täielik segadus 🙂 Selleks, et Linuxis saaks Dockeriga lokaalselt php arendust teha, siis peab Docker, host ja PHP õigused paika sättima.

Digital Oceani õpetus täpselt olemas.

To run docker command without sudo, you need to add your user (who has root privileges) to docker group. (ref).

See current user: echo ${UID}

Official doc: Post-installation steps for Linux

You need to run your application as the same uid inside the container as you do on the host to get file ownership to match. (ref)

Something about application and root here.

Digital Ocean tutorial – WordPress with docker compose.
Probably the thing you are looking for – Docker in Development – Docker and File Permissions

28. Apr 2022 |

SQL stuff

UPDATE `core_config_data` SET `value` = replace(value, 'oldtext.ee', 'newtext.ee');

1. Apr 2022 |

ps aux with grep

Very good ps aux overview can be found on Linode website.

grep stands for global regular expression print

grep by default is case sensitive. Add -i to make it case insensitive.

ps aux | grep -i "robert" | grep -i "vscode" – by such piping you can narrow down the search step by step.

If kill does not then add kill -9 <pid> (source).

history | grep “git commit” | grep “something”

Regular expressions in grep and on youtube basic Grep and Regex and the most useful DO guide

ps aux | grep -i "...be.t"  – simple pattern match.

ps aux | grep -P -i "^weekend"  – add -P to get perl compatible regular expressions to work

ps aux | grep -i '^weekend.*product' – lines that start with weekend and contains word product.

To see your proccesses then ps ux is enough.

22. Feb 2022 |

Magento REST API – Specified request cannot be processed and Class does not exist

Class \Vendor\ModuleName\Api\TestInterface does not exist

During development move things from local-src + symlink to app/code/{vendor}/{modulename} so that namespace and folder structure could match.

If you are using interfaces in your module then this is also true that you need to use full path reference in PHPdoc instead of use import and reference.

Both worked for me

Specified request cannot be processed

rest/V1/test/ – V in version needs to be capital letter (also in webapi.xml).

And just useful tip that you can extract interface out of existing class.