Sunday, May 31, 2009

banner command

banner command

can anyone give me a practical situation in which banner command is used ?


square gold fish

This question includes the assumption that everything must have a practical use (Try cowsay!)

Anyway, you could have a console script that could post its status ("GOOD", "BAD") in nice big letters so you could see it from across the room....


cmay

it have had a practical use once i think. but the only thing you can use it for now is to print a nice banner on a piece of paper if you redirect the out put to a printer. i read about it some time ago but i can not remember what the original use was and its also a very old program i think. but it is not written just for the fun of it that i am sure of.

xyz
one possible usage i could find is

/usr/games/banner -w50 Happy Birthday! |lpr

MIRO

how to lock and un lock terminals in linux ?

to lock just comment the tty entries in /etc/securetty file
and to un lock just un comment the commented entries

Regular expression examples

ls -a | grep '.[a-z]'
rm 'ls | grep '^[ab]$''
ls | grep '^[a-c]$'
ls -a | grep '^[a.]*$'


grep 'lin.x'*
grep -ls '^hosts' *
grep -ls 'hosts$' *


\< and \>
Search for patterns at the beginning of a word or at the end of a word. For instance, the following would show lines that have text beginning with san:

grep \< san *



\{n\} : The preceding character or regular expression occurs at least times. This is useful in a regular expression where you are looking for a number, say, between 100 and 999, as in the following command:

grep -ls '0-9\{3\}' *

Saturday, May 30, 2009

iptable rules file

In ubuntu linux, by default where does the iptable rules gets saved ?


bsd unix

I believe this is what your looking for:


Quote: Save your firewall rules to a file

Code: $ sudo sh -c "iptables-save > /etc/iptables.rules"




spd106


The short answer is... they don't.

You can view the current rules with
iptables -L

Usually you would add the commands to create these rules into the /etc/network/interfaces file or to a shell script file and place that somewhere in the init system.

Since Network Manager took over it's a little bit different and I'm not entirely sure how it works. I think you need to place a script in the /etc/NetworkManager/dispatcher.d/ folder.

See https://help.ubuntu.com/community/IptablesHowTo


NB:- tested on ubuntu 8.04