apt list --upgradable | grep "\-security"
Category Archives: linux
mysql slave read only
Make sure you are working on slave server:
SHOW SLAVE STATUS \G ;
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
SELECT @@global.read_only, @@global.super_read_only;
+--------------------+--------------------------+
| @@global.read_only | @@global.super_read_only |
+--------------------+--------------------------+
| 0 | 0 |
+--------------------+--------------------------+
1 row in set (0.00 sec)
SET GLOBAL super_read_only = 1;
SELECT @@global.read_only, @@global.super_read_only;
+--------------------+--------------------------+
| @@global.read_only | @@global.super_read_only |
+--------------------+--------------------------+
| 1 | 1 |
+--------------------+--------------------------+
1 row in set (0.00 sec)
Save config settings:
super_read_only = On
mysql> INSERT INTO authors (id,name,email) VALUES(1,"Test","test@test.com");
ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statement
If ERROR 1193 (HY000): Unknown system variable 'super_read_only'
SET GLOBAL read_only = 1;
UPDATE mysql.user SET super_priv='N' WHERE user<>'root';
FLUSH PRIVILEGES;
select user,host,plugin,Super_priv from mysql.user;
+------------------+-----------+-------------+------------+
| user | host | plugin | Super_priv |
+------------------+-----------+-------------+------------+
| root | localhost | unix_socket | Y |
| replica_user | % | | N |
Unable to locate package lsb_release
apt install -y lsb-release
zabbix_get []: Check access restrictions in Zabbix agent configuration
failed to accept an incoming connection: connection from “192.168.1.100” rejected, allowed hosts: “127.0.0.1”
vim /etc/zabbix/zabbix_agentd.conf
Server=127.0.0.1,192.168.1.100
imap-login: Info: Aborted login auth failed, 1 attempts in 0 secs
dovecot enable plaintext auth
disable_plaintext_auth = no
service dovecot restart
* OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=CRAM-MD5] Dovecot (Ubuntu) ready
sender verify fail for The mail server could not deliver mail to The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.
cPanel whitelist sender
WHM >> Service Configuration >> Exim Configuration Manager
Sender verification bypass IP addresses
Trusted SMTP IP addresses
Unable to negotiate with xx.xx.xx.xx port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.100
ubuntu gcloud
apt install apt-transport-https ca-certificates gnupg -y
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
apt update
apt install google-cloud-sdk
gcloud init
Welcome! This command will take you through the configuration of gcloud.
Your current configuration has been set to: [default]
You can skip diagnostics next time by using the following flag:
gcloud init --skip-diagnostics
Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.
Reachability Check passed.
Network diagnostic passed (1/1 checks passed).
You must log in to continue. Would you like to log in (Y/n)?
postgresql ubuntu
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add -
apt update
apt install postgresql-9.4
screen cannot open your terminal ‘/dev/pts/0’ – please check
script /dev/null
screen
postgres check for corruption
postgresql check databases for errors
pg_dumpall -f /dev/null 2> /tmp/pg.err
mysqldump to remote server ssh
mysqldump –single-transaction sourcedb | mysql destdb
syn flood attack
apt install hping3
hping3 -c 15000 -d 120 -S -w 64 -p 80 –flood –rand-source 192.168.1.100
upgrade/downgrade mongo
systemctl stop mongod.service
apt update
apt install mongodb-org=3.6.8 mongodb-org-mongos=3.6.8 mongodb-org-server=3.6.8 mongodb-org-shell=3.6.8 mongodb-org-tools=3.6.8
systemctl start mongod.service
mongo
db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } )
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
vi /etc/apt/sources.list.d/mongodb-org-4.0.list
deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse
apt update mongodb*
apt upgrade
lock crontab job
* * * * * /usr/bin/flock -w 0 /tmp/cron.lock /usr/bin/php7.4 /path/to/cron.php