colors in bash scripts

2012-04-30 3 min read Bash Fedora Learning
Colours
Colours (Photo credit: CherrySoda!)

I have been trying to understand the color codes for bash for a pretty long time, but somehow never got time to understand this clearly. So this time around when I was writing a script to analyze some logs. I thought I will give it a go and finally understood some part of this.

So, first we will start with this script. This is taken from here.

Continue reading

systemadm – simpler way to manage the service files for systemd

2012-04-17 1 min read Fedora

Once the systemd unit and service files have come into being, understanding of the system services have changed a little bit and it might require some time to understand the cli tools for managing these services and units. That being the case, systemadm comes to rescue. This is a simple tool which :

Graphical front-end for systemd.

For installation :

sudo yum install systemd-gtk

And here’s a screenshot::

Continue reading

Convert string to hex.

2012-04-13 1 min read C Programs

If you want to use snoop or tcpdump with advanced search in the packet, then you would need to convert the string to hex string. For this, either you can use a web search and find some web application to do that or you can use a simple C program like this 🙂

/*
* =====================================================================================
*
*       Filename:  ascii.c
*
*    Description:  ascii to dec
*
*        Version:  1.0
*        Ceated:  03/02/2012 12:08:49 PM
*       Revision:  none
*       Compiler:  gcc
*
*         Author:  Amit Agarwal (aka), amit.agarwal@roamware.com
*  Last modified: Thu Mar 08, 2012  08:47PM
*
* =====================================================================================
*/
void main (int argc, char **argv){
    int i=0;
    char a[200]="",b[200]="";
    printf("String - %s, Length - %d\n",argv[1],strlen(argv[1]));
    /*printf("%x\n 0x",argv[1]);*/
    while (i < strlen(argv[1])){
        /*printf("%c",argv[1][i]);*/
        sprintf(a,"%s%x",a,argv[1][i]);
        /*printf("a=%s\n",a);
        printf("b=%s\n",b);*/
        sprintf(b,"%s%d",b,argv[1][i]);
        i++;
    }
    printf ("\n");
    printf ("String : %s\n",argv[1]);
    printf ("Hex    : 0x%s\n", a);
    printf ("Dec    : %s\n", b);

}
Enhanced by Zemanta

Your own local search engine.

2012-04-09 1 min read Fedora Learning Uncategorized

There are times when you would want to have a local search engine capable of indexing even pdf and doc files. So here is a solution.

You can use “Omega” and here are the instructions.

download omega from http:// xapian.org/download

yum install xapian libuuid-devel

And then make and install omega and for this you can follow the instructions.

Federated Search Engine Diagram
Federated Search Engine Diagram (Photo credit: Wikipedia)

Create index using command omindex
and then you can use quest or search.py to search or you can setup the cgi way so that you can use local browser to search.

Continue reading

uptimed – keep track of your system uptime.

2012-04-02 1 min read Fedora

Uptimed is an up time record daemon keeping track of the highest
up times the system ever had.

Uptimed has the ability to inform you of records and milestones
though syslog and e-mail, and comes with a console front end to
parse the records, which can also easily be used to show your
records on your Web page

Installation :

sudo yum install uptimed

Once installed, you will have to first create the boot id with this command:

Continue reading

pigz -parallel gzip

2012-03-26 1 min read Fedora Linux

Here is a short description of pigz:

pigz, which stands for parallel implementation of gzip,
is a fully functional replacement for gzip that exploits
multiple processors and multiple cores to the hilt when compressing data.

And for the installation:

sudo yum install pigz

With pigz, if you don’t have many things running on your multi processor machine then you will see a significant improvement when you are gzipping the files.

Continue reading

visio support comes to Linux with loads of new features of LibreOffice.

2012-03-17 1 min read Linux Uncategorized
Microsoft Visio 2010
Image via Wikipedia

LibreOffice 3.5 was released few days back with loads of features and improvements. Most bragged about feature should be capability to read visio diagrams. You can read the full list of features here. And here are some interesting features:

  • Better UI for header/footer handling. Easily add header or footers. Quickly see what is edited with new changing text boundaries. Quickly edit or remove headers and footers without going through page styles formatting. (Cédric Bosdonnat)
  • New faster built-in grammar checker for English and several other languages. (László Németh)
  • New multi-line input bar in Calc. The arrow-control at the end of the toolbar allows to switch this on/off.  (Anurag Jain, Noel Power)
  • Import filter for Microsoft Visio documents. (Fridrich Štrba, Eilidh McAdam, Valek Filippov)
  • Custom Shapes import was greatly enhanced, many bugs were fixed and new presets implementation added. (Radek Doulik)
  • and many more…
Enhanced by Zemanta
Older posts Newer posts