Sunday, February 15, 2015

Deleting old kernels on Fedora/Red Hat/CentOS

Reference: http://www.if-not-true-then-false.com/2012/delete-remove-old-kernels-on-fedora-centos-red-hat-rhel/

Edit /etc/yum.conf and change/add the following line:

    installonly_limit=2
Install yum-utils:
    sudo yum -y install yum-utils
Run command to reduce total kernels to 2:
   package-cleanup --oldkernels --count=2
Just in case, re-build grub2 config file:
   sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Wednesday, February 11, 2015

Using fiirewall-cmd on Fedora 21 and Red Hat 7

I ran into a situation today where I had to open ports on the fireall on my Acer Aspire One that is running Fedora 21.  I used the firewall GUI but wanted to learn how to do this via the command line via firewall-cmd.  I found the following post on StackOverflow. I had to run the --reload for any changes to take affect.


Here are a few commands I used:

 ZZ=$(sudo firewall-cmd --get-zones); for Z in $ZZ; do echo -n "<Z=${Z}> ";firewall-cmd --zone=$Z --query-port=21/tcp; done

sudo firewall-cmd --get-zones

sudo firewall-cmd --zone=internal --add-port=21/tcp --permanent

sudo firewall-cmd --reload