Linux: go to root: sudo -s go to username: sudo -i -u username tar -czvf name.tar.gz foldername tar -xvf name.tar.gz sudo timedatectl set-timezone Europe/Moscow sudo journalctl -eu fluent-bit.service -f netcat -ul 9094 date -d@1396713472 Sat Apr 5 19:57:52 MSK 2014 telnet example.com 80 = curl -v telnet://example.com:80 scp -rp src user@server:dest/ All nginx certs on VM: ip -c a | grep 192 && sudo grep -r ssl_cert* /etc/nginx/conf.d Send command to remote terminal: #!/bin/bash echo "Enter passwd" read pass echo $pass | ssh 192.168.0.1 -t 'sudo -S systemctl status nginx' ---------------------------------------------------------------------------------------------------- Letsencrypt Cert certbot certonly --manual --manual-auth-hook /etc/letsrncrypt/acme-dns-auth.py --preferred-challenges dns --debug-challenges -d domain_name.ru dig +short txt _acme-challenge.domain_name.ru @8.8.8.8 ---------------------------------------------------------------------------------------------------- disk grow sudo su - lsblk fdisk /dev/vda parted -l Fix/Ignore? fix fdisk /dev/vda d default n default default default Do you want to remove the signature? [Y]es/[N]o: n w The partition table has been altered. Syncing disks. xfs_growfs -d / OR reboot ==================================================================================================== Docker: Remove all unused data: docker system prune -a ==================================================================================================== k8s: k9s dashboard: search amd64.rpm https://github.com/derailed/k9s/releases wget https://github.com/derailed/k9s/releases/download/v0.32.5/k9s_linux_amd64.rpm sudo dnf localinstall k9s_linux_amd64.rpm sudo pkill k9s kubectl: kubectl cluster-info ==================================================================================================== Other: For rancher desktop: Need install WSL: ms-windows-store://pdp/?ProductId=9P9TQF7MRM4R ==================================================================================================== openssl: ip -c a | grep 192 && sudo ls -lah /etc/nginx/conf.d && sudo grep -r ssl_cert* /etc/nginx/conf.d && sudo ls -lah /var/log/nginx | grep .log ip -c a | grep 192 && sudo ls -lah /etc/nginx/conf.d && sudo grep -r certificate /etc/nginx/conf.d ip -c a | grep 192 && sudo grep -r certificate /etc/nginx/conf.d openssl x509 -noout -text -in *.crt | grep 'Not After' openssl x509 -in certname.pem -text | grep Not openssl x509 -enddate -noout -in certname.pem CMD version (need installed Git): Portable: "C:\Users\USERNAME\Documents\PortableGit\usr\bin\openssl.exe" x509 -noout -text -in *.crt Installed: "C:\Program Files\Git\usr\bin\openssl.exe" x509 -noout -text -in *.crt curl --insecure -vvI https://www.google.com 2>&1 | grep "start date:\|expire date:" Openssl view cert valid time: cat file location: cd /etc/nginx/conf.d ll cat filename.conf | grep ssl_certificate ===================================================================================================== Remote grep: pw=$(cat "PasswdFile") ip= link= echo "server name" echo $pw | ssh -tt user@ip "openssl x509 -enddate -noout -in certname.pem" Export keys: Try: openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes After that you have: -certificate in newfile.crt.pem -private key in newfile.key.pem To put the certificate and key in the same file without a password, use the following, as an empty password will cause the key to not be exported: openssl pkcs12 -in path.p12 -out newfile.pem -nodes Or, if you want to provide a password for the private key, omit -nodes and input a password: openssl pkcs12 -in path.p12 -out newfile.pem If you need to input the PKCS#12 password directly from the command line (e.g. a script), just add -passin pass:${PASSWORD}: openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys -passin 'pass:P@s5w0rD' ==================================================================================================== Ansible: ansible-vault decrypt /file_location/vars/main.yml ansible-vault encrypt /file_location/vars/main.yml eval "$(ssh-agent -s)" && ssh-add /home/administrator/.ssh/id_rsa ansible-playbook playbooks/playbook-name.yml -bK --check ansible-playbook playbooks/playbook-name.yml --ask-vault-pass -i inventory_location/inventory.yaml -bK --private-key=/home/administrator/.ssh/id_rsa --user=administrator --check