Freitag, 26. Mai 2023

SAH512 password in python

 in case you need to update a mysql db with a SHA512 password:


Install the correct lib: sudo apt-get install -y python-passlib


then:

python -c "from passlib.hash import sha512_crypt; import getpass; print sha512_crypt.encrypt(getpass.getpass())"

Montag, 22. Mai 2023

Tomcat and certbot

 In case you need an automated update of your let's encrypt certs:

make a script (best: put in in cron)


#!/bin/bash


logfile="/var/log/renew_$(date -Is).log"

echo "$(date +%T):" >$logfile

/usr/bin/certbot renew --quiet

cp /etc/letsencrypt/live/YOURDOMAIN.COM/{cert,chain,privkey}.pem /opt/tomcat/latest/conf/

chown tomcat:tomcat /opt/tomcat/latest/conf/*.pem




Mittwoch, 17. Mai 2023

VMWARE esxi 8 certificates

 In case you want to change the certificate:

change to

/etc/vmware/ssl 


make a backup of rui.crt and rui.key


delete rui.crt and rui.key


copy your own certs to rui.crt and rui.key


Restart the proxy: /etc/init.d/rhttpproxy restart



In case you have trouble re-create the default certs: /sbin/create_certificates

Montag, 15. Mai 2023

Linux remove old kernels für update to UBUNTU 22.0

 in case you need more space at /boot while updating to UBUNTU 22

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge


Donnerstag, 4. Mai 2023

Ubuntu 22 DNS with resolvconf

 in case you need to modify the DNS of UBUNTU 22


vi /etc/resolvconf/resolv.conf.d/head

add new nameserver i.e.

nameserver 1.1.1.1

nameserver 1.0.0.1


sudo resolvconf --enable-updates

sudo resolvconf -u

sudo systemctl restart resolvconf.service

sudo systemctl restart systemd-resolved.service

to check: resolvectl status