Archive for the ‘Uncategorized’ Category

Create deployment with name “blue” using nginx image

Tuesday, May 3rd, 2022

kubectl create deployment blue –image=nginx

Generate string (password)

Friday, April 15th, 2022
openssl rand -base64 12

Number of connection Netstart (netstat)

Sunday, April 10th, 2022

netstat -tn 2>/dev/null | grep :3306 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -nr | head

create db user and password mariadb – done as production

Sunday, February 27th, 2022

create user ‘db’user’@’10.10.5.5’ identified by ‘ ********** ’ ;

grant all privileges on `dyname`.* to ‘dbuser’@’10.10.5.5’;

How many slave lag behind the master in postgres

Monday, February 21st, 2022
select now()-pg_last_xact_replay_timestamp();

postgres rules

Tuesday, February 8th, 2022

ALTER ROLE grafana_kms_srv WITH LOGIN;
GRANT SELECT ON ALL TABLES IN SCHEMA company_domain TO grafana_kms_srv;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO grafana_kms_srv;
GRANT USAGE ON SCHEMA public TO grafana_fms_srv;
GRANT USAGE ON SCHEMA company_domain TO grafana_fms_srv;

Distribute SSH key in servers

Wednesday, February 2nd, 2022

put the ssh public key of your PC in the following command and run it in any server want to access without password

echo ‘put the public key here’ >> /root/.ssh/authorized_keys

list all the available extensions in postgres

Wednesday, February 2nd, 2022
SELECT * FROM pg_available_extensions;
or 
run this in postgres
\dx

cluster_admin permission in OKD/Openshift

Sunday, January 30th, 2022

oc adm policy add-role-to-user cluster_admin ayad

trace route with port

Sunday, January 30th, 2022

traceroute -T -p 22 alzwea.com