GREP_COLORS – change the colors in the GREP output.

2019-04-22 4 min read bash Linux
Today we will look at the variable GREP_COLORS. This variable determines the colour that is used with the grep command. You can look at the man page of the grep command to see what the various options mean. Here is the excerpt from the man command: GREP_COLORS Specifies the colors and other attributes used to highlight various parts of the output. Its value is a colon-separated list of capabilities that defaults to ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36 with the rv and ne boolean capabilities omitted (i. Continue reading

bash debug – log all executed commands

2014-02-03 1 min read bash
Screenshot of a Bash 3.1 session demonstrating its particularities. Shows exporting a variable, alias, type, Bash’s kill, environment variables PS1, BASH_VERSION and SHELLOPTS, redirecting standard output and standard error and history expansion. A POSIX session is launched from a normal session. Finally, the POSIX session kills itself (since just “exit” would be too boring). (Photo credit: Wikipedia) Whenever I am writing a script in perl or bash, I always wish that there Continue reading

Monitor your system with sysusage.

2013-12-02 2 min read Fedora
First some information on sysusage: Description : SysUsage continuously monitor your systems informations and generate periodical graph reports using rrdtool or javascript jqplot library. All reports are shown throught a web interface. SysUsage grabs all system activities using Sar and system commands allowing you to keep tracks of your computer or server activity during his life. It is a great help for performance analysis and resources management. The threshold notification can alarm you when the system capabilities are Continue reading

bash – using the vi mode more effectively.

2013-11-22 1 min read bash
Vi blogging bundle (Photo credit: pedro mg) You can first set the bash mode to vi. This will enable some vim like features to bash. So, add this to .bashrc : set -o vi Once, you have done that then its time to get more out of the vi mode. First, check some things and set some interesting stuff. #Display all the bindings : bind -P #Copy the current bindings and use it in inputrc: bind -p |grep -v self-insert>~/. Continue reading

procmail filters – apply to received mails.

2013-05-24 1 min read Linux
If you already have some mail in your maildir and you have set procmail filters, then it is difficult to apply the procmail filter, right? Not so, you just need to go to the Inbox directory and then execute the command. for i in *; do cat $i|procmail; rm -f "$i"; done This will pass all of your e-mail through procmail again and then your filters will get applied. Mails will go to their appropriate directory and you will be one happy man, I hope. Continue reading

slow ssh connection

2013-02-26 1 min read Linux
If you are experiencing slow ssh connections, then possibly your system is trying to do reverse lookup of the IP address. If that is the case, then you can add the below to “hosts” line in /etc/nsswitch.conf file. ‘[NOTFOUND=return]’ The other cause for slow connections can be GSSAPI authentication. If that is the case, then the simplest solution is to add the following in your “~/.ssh/config” file: GSSAPIAuthentication no Related articles ssh reverse tunning. Continue reading
Older posts