firewalld – enable logging

2016-05-16 1 min read Fedora

firewalld by default does not allow packets that are dropped. In some cases, you need to find out if some packet is being dropped or not. For doing so you may want to enable logging of dropped packets with the following command:

sudo firewall-cmd  --set-log-denied=all

This will enable logging all the packets and help you figure out if firewalld is dropping the packet.

speed up journalctl

2016-04-25 1 min read Fedora

Sometime back I noticed that whenever I run my favourite command, viz.

journalctl -xn -f -l

it was taking more time than usual. So, I thought to dig more into it and finally found that the following command:

sudo journalctl --disk-usage

showed that journalctl was using some huge space in tune of about 4GB. So, the solution was simple, vaccum the journal entries and the command to do so is :

sudo journalctl --vacuum-size 90M

Checking journalctl size after that confirms the size is reduced and after that indeed the above journal command takes no time 🙂

Continue reading

virsh – show ip address of all running VMs

2016-02-01 1 min read Fedora Learning Vurtualization

If you are using the libvirt and associated tools, then you must be aware about virt-manager. However this being a GUI tools, it is not possible to always use this. “virsh” is a good option for this.

To start with, if you need to know all the VMs all the running VMs, then you can use (to only view the names):

virsh list --name

Extending this to make it more useful is the case if you need to know the IP address for the running VMs. Here is a simple code that you can put in alias or function that can be used to get the IP address of the running VM’s.

Continue reading

Disk usage by file type

2015-11-30 1 min read Fedora Learning

Trying to find the total usage for each of the file types by extension, then here is a quick bash function for you :

disk_usage_type () 
{ 
    find . -name '*'$1 -ls | awk '
    BEGIN{
        a[0]="Bytes";
        a[1]="KB";
        a[2]="MB";
        a[3]="GB";
    }
    {sum+=$7; files++;}
    END{
    print "Total sum is ::\t" sum;
    print "Total files  ::\t" files;
        while (sum > 1024) {
            sum=sum/1024;
            count++;
            };
        print sum" "a[count];
    }'
}

Just define the function in one of your bash startup files. After that to use the function pass in the extension for which you would like to find the total size. Output should be something like below:

Continue reading

Text file based presentation tool – pinpoint

2015-10-05 1 min read Fedora

Pinpoint description:

Name        : pinpoint
Summary     : A tool for making hackers do excellent presentations
URL         : https://live.gnome.org/Pinpoint
License     : LGPLv2+
Description : Pinpoint a simple presentation tool that hopes to avoid audience death
by bullet point and instead encourage presentations containing
beautiful images and small amounts of concise text in slides.

Pinpoint is a presentation tool. The source file for the presentation is text file and thus very easy to manage. You can see an example with :

Continue reading

Executing commands on multiple hosts

2015-09-21 1 min read Fedora Learning Linux

If you have to execute the same command in multiple hosts, then you can use mussh:

Description : Mussh is a shell script that allows you to execute a command or script
over ssh on multiple hosts with one command. When possible mussh will use
ssh-agent and RSA/DSA keys to minimize the need to enter your password
more than once.

First install mussh with the following command

dnf install mussh

Now to run this for multiple hosts, you can run like this

Continue reading
Older posts Newer posts