AttributeError: ‘module’ object has no attribute ‘DeprecatedIn12’

If you are playing with certbot on CenOS7 and you encounter the thing below, it’s due to a Python library that should be upgraded:

AttributeError: ‘module’ object has no attribute ‘DeprecatedIn12’

pip install cryptography –upgrade

pip install –upgrade pip

then again:

pip install cryptography –upgrade

After this, you should be able to use certbot without any issues.

disable and stop firewall on CentOS7

For the time being the firewall has to be off. I will replace it with csf anyway.

[root@500748 ~]# systemctl list-unit-files |grep -i firewall
dbus-org.fedoraproject.FirewallD1.service enabled
firewalld.service enabled
[root@500748 ~]# systemctl disable firewalld
rm ‘/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service’
rm ‘/etc/systemd/system/basic.target.wants/firewalld.service’

[root@500748 ~]# systemctl stop firewalld
[root@500748 ~]#

Done!

CentOS7 change hostname

I started switching recently (i know i should have probably started earlier but meh, was busy) switching boxes to CentOS7. Changing the hostname is slightly different now:

[root@500748 ~]# hostnamectl status
Static hostname: beast1.domain.com
Icon name: computer-desktop
Chassis: desktop
Machine ID: e289f5250bd548609d5989766573ab49
Boot ID: 844dbb05561c4c599aad84d9f685d0e8
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-229.el7.x86_64
Architecture: x86_64

So in order to change the hostname you would do:

hostnamectl set-hostname my.new.hostname

Done!