mysql: capitalize first word of all words

credits to: http://joezack.com/2008/10/20/mysql-capitalize-function/   create a function:   CREATE FUNCTION CAP_FIRST (input VARCHAR(255)) RETURNS VARCHAR(255) DETERMINISTIC BEGIN DECLARE len INT; DECLARE i INT; SET len = CHAR_LENGTH(input); SET input = LOWER(input); SET i = 0; WHILE (i < len) DO […]

mysql: min value per group

surprisingly, to find the min date per company, which is a super basic query, on mysql you need to do a complicated query.    SELECT a.id, a.company, a.email, a.custom_last_email FROM leads a INNER JOIN ( SELECT company, MIN(custom_last_email) mindate FROM […]

elasticsearch: secure

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-elasticsearch-on-ubuntu-20-04   To test: Run from the local server to see if the server can connect to the elasticsearch cluster: curl -X GET ‘http://localhost:9200’   Run a test from a remote server, to see if a remote user can access […]

asterisk: console commands

ubuntu-s-1vcpu-1gb-sgp1-01*CLI> core show help ! — Execute a shell command acl show — Show a named ACL or list all named ACLs ael reload — Reload AEL configuration ael set debug {read|tokens|macros|contexts|off} — Enable AEL debugging flags agent logoff — […]

python: pycharm notes

Install Modules inside Repository:   File -> Settings -> Inside your project’s name -> Project Interpreter -> click on “+” button -> search for selenium (current version 3.141.0) -> click on install -> restart PyCharm.