git – plot the history

2016-05-23 1 min read Learning

git has a very simple solution to see all the commits in a graphical form. If you need to understand all the commits history all you need is

git graphviz|dot -Tpng  -o /tmp/a.png

This will generate a file called /tmp/a.png which will diplay the complete commit history.

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

terminal, terminal everywhere.

2015-11-23 1 min read Learning

Tilda is a borderless terminal that can be started multiple times each with its own configuration.

Name        : tilda
Arch        : x86_64
Epoch       : 0
Version     : 1.2.4
Release     : 1.fc23
Size        : 344 k
Repo        : @System
From repo   : fedora
Summary     : A Gtk based drop down terminal for Linux and Unix
URL         : http://github.com/lanoxx/tilda
License     : GPLv2+
Description : Tilda is a Linux terminal taking after the likeness of many classic terminals
from first person shooter games, Quake, Doom and Half-Life (to name a few),
where the terminal has no border and is hidden from the desktop until a key is
pressed.

 

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