On Sun, 25 Sep 2011 13:53:20 +0100
Simon Hobson <li...@thehobsons.co.uk> wrote:

> Christ Schlacta wrote:
> >I was reading through the config files, and noticed that many of them
> >would be well suited by being replaced or supplemented with an
> >(optionally optional) shiny new XML format that would allow the user
> >to specify only the needed attributes and not have to fill in -s
> >where not needed.  Would prevent such mishaps as 1-too-many or
> >1-too-few -s resulting in entries being placed in the column, and as
> >I understand it perl already has simple to use XML tools.  
> 
> Perhaps it's just me being somewhat "old fashioned" but I prefer flat 
> format files and find them a lot easier to work with. Mind you, part 
> of that may be that I'm used to using unix text tools for working 
> with files - and they just don't work with XML.

I concur. Furthermore I'd like to suggest a nice trick.

If you're editing the files with vim, you could use folds. That's how I
do it and it keeps your window very tidy. Two examples:

# all icmp and public ssh  {{{
COMMENT To mybox
ACCEPT       all  all  icmp
COMMENT
# }}}

COMMENT public ssh  # {{{
ACCEPT:$LOG  wan  fw  tcp  22
COMMENT  # }}}

Then, on the bottom of the file, I have:
# vi: nowrap foldmethod=marker noet

(Usually I use 'et' or 'expandtabs', but in these files I prefer actual
tabs)

And, to make sure that this is parsed, I have "set modeline" in
my .vimrc. There are some caveats when modeline parsing is enabled, so
be sure to search for that online.


If I open the file, I see:
+ -- 5 lines: all icmp and public ssh  --------------------------------
+ -- 3 lines: COMMENT public ssh  -------------------------------------
...

I simply move my cursor to the line I want to unfold, press space,
edit, and to close it I press 'zc' from within the unfolded space. You
can also open/close all folds at once, and it's even possible to have
multiple fold levels. A great feature of vim. For more info on folds,
vim -c ':help usr_28'

Good luck,
Mark

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Shorewall-users mailing list
Shorewall-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to