split -b 1GB test.log < test.log head -n $(cat test.log | grep -m1 -n "2021-07-11" -a | cut -d: -f1) | tail -n +$(cat test.log | grep -m1 -n "2021-07-10" -a | cut -d: -f1) > test.log.20210710 awk 'NR >= 10 && NR <= 100' test.log >new.log.100
MariaDB 10.5 : shrink ibdata after innodb_file_per_table = ON Hint
systemctl stop mariadb mv /var/lib/mysql/ibdata* /backup/ mv /var/lib/mysql/ib_logfile* /backup/ systemctl start mariadb
rsync relative Hint
rsync -avR --relative --address=192.168.1.42 192.168.1.46::all/test/db/./install/test.txt /backup install/ install/test.txt Result [192.168.1.46] /test/db/./install/test.txt [192.168.1.42] /backup/install/test.txt
Fedora : autossh Hint
yum install autossh -y autossh -M 0 -o ServerAliveInterval=30 -p22 -L 33061:127.0.0.1:3306 -N test@remote.com
Fedora 34 : change runlevel Hint - default.target, multi-user.target, graphical.target
systemctl status default.target # to switch runlevels instantly systemctl isolate graphical.target systemctl isolate multi-user.target ll /etc/systemd/system/default.target #runlevel 3 ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target #runlevel 5 ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
Fedora 34 : ssh authorized_keys failed Hint
egrep -i 'pubkey*' /etc/ssh/sshd_config sshd -T|egrep "pubkeyauthentication|pubkeyacceptedkeytypes" Federal Information Processing Standards (FIPS) fips-mode-setup --disable fips-mode-setup --check fips-mode-setup --is-enabled Installation of FIPS modules is not completed. FIPS mode is disabled. update-crypto-policies --set LEGACY update-crypto-policies --show => LEGACY reboot
CentOS 7 : yum update error Hint
yum clean all yum update -y
Fedora 31 : php-fpm as root Hint
vi /etc/php-fpm.d/derp.conf ;user = apache user = root vi /lib/systemd/system/php-fpm.service #ExecStart=/usr/sbin/php-fpm --nodaemonize ExecStart=/usr/sbin/php-fpm --nodaemonize -R systemctl daemon-reload systemctl restart php-fpm
ssh : Remote command execution using a script file Hint
#Run one-line remote command ssh test@host -p22 'hostname -f' #Run Multi-Line Remote Command ssh test@host -p22 << EOF hostname -f EOF #Read Remote File and Run Remotely ssh test@host -p22 './test.sh' #Read my file and run it remotely ssh test@host -p22 'bash -s' < test.sh
fedora 31 : parallel ssh program pssh Hint
# yum install pssh -y # man pssh Connect to host1 and host2, and print "hello, world" from each: pssh -i -H "host1 host2" echo "hello, world" Print "hello, world" from each host specified in the file hosts.txt: pssh -i -h hosts.txt echo "hello, world" Run a command […]