Tuesday 22 August 2023

Poem aymen

 Aymen, a name that rings like a bell,

A person of character, with stories to tell.

With a heart full of kindness and a mind sharp and bright,

Aymen shines like a star in the darkest of night.


With a smile that warms and eyes that gleam,

Aymen is a friend, a true friend indeed.

With laughter and joy, Aymen brings light,

To the lives of those lucky enough to be in sight.


So here's to you, Aymen, may your days be bright,

May your heart be full and your dreams take flight.

For you are special, in so many ways,

Aymen, you are loved, now and always.


Wednesday 16 August 2023

strapi installation tutorials

npm cache clean --force


npm install --prefix /tmp/strapic41d56ede4e0 strapi-connector-bookshelf@3.1.0-alpha.5

npm install --prefix /tmp/strapic41d56ede4e0 knex@<0.20.0

npm install --prefix /tmp/strapic41d56ede4e0 mysql@latest


npm cache clean --force
npm install --prefix /tmp/strapic41d56ede4e0

npm install --prefix /tmp/strapic41d56ede4e0 strapi-connector-bookshelf@latest --force
npm install --prefix /tmp/strapic41d56ede4e0 strapi-connector-bookshelf@latest --legacy-peer-deps
npm install --prefix /tmp/strapic41d56ede4e0 knex@0.21.18
npm install --prefix /tmp/strapic41d56ede4e0 strapi-connector-bookshelf@latest

npm install -g npm
npm install -g npm@6.0.0


npm install --prefix /tmp/strapic41d56ede4e0 knex@0.19.5


npm install --prefix /tmp/strapic41d56ede4e0 strapi-connector-bookshelf@latest


 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash


source ~/.bashrc  

source ~/.nvm/nvm.sh


nvm install node 
nvm install 10

nvm use 10

npm install --prefix /tmp/strapi840898b76475 strapi-connector-bookshelf@latest knex@0.19.5 mysql@latest

sudo npm install strapi@alpha -g

strapi version

sudo strapi new myproject

npm install -g npm@latest

npm install --prefix /tmp/strapi840898b76475 strapi-connector-bookshelf@latest knex@0.19.5 mysql@latest




? Choose your default database client mysql ? Database name: strapi_db ? Host: 127.0.0.1 ? Port: 3306 ? Username: admin ? Password: ********* ? Enable SSL connection: No ⛔️ Connection test failed: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client Retrying...

ALTER USER 'admin'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'your_password';





















Monday 7 August 2023

listing files size in MB/GB in linux using command

 ls -l --block-size=G

 ls -l --block-size=M

ls -ltr --block=m


delete files older than 90 days linux bash script

 cd /home/ubuntu/apps/logs/search

find /home/ubuntu/apps/logs/search -type f -mtime +90 -exec rm {} \;


Wednesday 26 July 2023

create database,replication and user in ubuntu mysql

RE


sudo mysql 


CREATE DATABASE master_db CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE DATABASE slave_db CHARACTER SET utf8 COLLATE utf8_general_ci;


CREATE USER 'test'@'localhost' IDENTIFIED BY 'your_password';



GRANT ALL PRIVILEGES ON master_db.* TO 'test'@'%';


GRANT ALL PRIVILEGES ON slave_db.* TO 'test'@'%';

FLUSH PRIVILEGES;


CREATE USER 'replication_user'@'localhost' IDENTIFIED BY 'your_password';

GRANT REPLICATION SLAVE ON *.* TO 'replication_user'@'localhost';



/etc/mysql/mysql.conf.d/mysqld.cnf


[mysqld]

pid-file        = /var/run/mysqld/mysqld.pid

socket          = /var/run/mysqld/mysqld.sock

datadir         = /var/lib/mysql

log-error       = /var/log/mysql/error.log

# By default we only accept connections from localhost

#bind-address   = 127.0.0.1

bind-address   = 0.0.0.0

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

#replica test

server-id = 1

log-bin = /var/lib/mysql/mysql-bin

report-host=master-is-slave-host

relay-log=myserver-relaylog

replicate-same-server-id=1

binlog-do-db=master_db

replicate-rewrite-db=master_db->slave_db

replicate-do-db=slave_db

sudo systemctl restart mysql


CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='replication_user', MASTER_PASSWORD='your_password', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=0;

START SLAVE;


Tuesday 25 July 2023

show all mysql users

sudo mysql 


SELECT User, Host FROM mysql.user;

python env error

 


python3 -m venv testenv Error: [Errno 13] Permission denied: '/home/testreader/apps/test/testenv/pyvenv.cfg' solution python3 -m venv ~/passenv

Monday 24 July 2023

Poem aymen

 Aymen, a name that rings like a bell, A person of character, with stories to tell. With a heart full of kindness and a mind sharp and brigh...