Re: [6.3] Get e-mail when CTRL-ALT-DEL is used?

2010-07-08 Thread George Davidovich
On Thu, Jul 08, 2010 at 12:12:27PM +0200, Gilles wrote:
> This is on a remote 6.3 host: I'd like to get an e-mail if a user hits
> the CTRL-ALT-DEL to reboot the server.
> 
> Googling told me that the use of the three-key combo can be
> enabled/disabled when compiling a new kernel, but not how to manage
> this feature when it's enabled in a running kernel.
> 
> Is there a configuration file somewhere that would let me add e-mail
> support for this action?

Assuming you want to know whether the server was rebooted (as opposed to
whether a user invoked a given key combination), adding something
along the lines of the following to root's crontab(5) should suffice:

  @reboot echo "`hostname` rebooted" \
  | mail -s "`hostname` rebooted" gil...@example.org

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: text to html

2010-07-03 Thread George Davidovich
On Sat, Jul 03, 2010 at 11:07:29AM +0200, Jozsi Avadkan wrote:
> input:
> http://pastebin.com/raw.php?i=MqPXZwc3
> 
> output:
> http://pastebin.com/raw.php?i=8QCkp4yv
> 
> it will be a long day.. :D
> 
> could someone please help with it?
> 
> i have to make a "one liner" that get's the input, and gives the
> mentioned output.

A one-liner, huh?  LOL.  Add semi-colons?

The following should accomplish what you want.

#!/bin/sh

sample_data="\
debian/hosts/hosts.html
debian/use-other-users-when-using-wine-eg-dude.html
debian/java-chromium-etc.html
dns/dns-server-szakszon-mihaly-hungarian.html
netbsd/sshd.html
netbsd/installing-removing-programs.html
netbsd/install-from-pendrive/install-from-pendrive.html
openwrt/wrt160nl/wrt160nl-flash.html
routeros/home-soho-router.html
routeros/turn-off-watchdog.html"

seen='nothing_to_see_yet_move_along'

echo "$sample_data" | while read target; do

topic=${target%%/*} # debian/hosts/hosts.html -> debian
filename=${target##*/}  # debian/hosts/hosts.html -> hosts.html
title=${filename%.*}#  hosts.html -> hosts

if [ $topic = $seen ]; then
echo "| ${title}"
else
echo "  ${topic} "
echo "${title}"
fi

seen=$topic

done

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: jail and uname

2010-07-03 Thread George Davidovich
On Sat, Jul 03, 2010 at 02:13:13PM +0800, Aiza wrote:
> From the console of a jail I issue uname -r and get 8.0-RELEASE-p3,
> which is the release level of the host. I know the jail is running a
> pristine minimum install of 8.0-RELEASE.
> 
> I would think issuing uname from within a jail environment should 
> respond with the info of the jail environment. Is this not a security 
> violation?

I'm guessing your understanding of jails is a bit off.  A FreeBSD jail
isn't a "fully virtualised" system.  As implemented, jails share the
host system's kernel.  The Handbook makes clear that a jail is
essentially defined by a directory subtree, a hostname, an IP address,
and a command.  Well, that, and things like user accounts.

So when you run uname, what's reported is kernel information as stored
in various sysctl(8) MIBs (kern.ostype, kern.osrelease, kern.osrevision,
kern.version, etc.).  And because there's only one kernel, you'll get
the same output from running uname on the host as you would get from
running it inside a jail.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: .sh & ip address

2010-06-22 Thread George Davidovich
On Wed, Jun 23, 2010 at 10:31:51AM +0800, Aiza wrote:
> I looking to take the last group number in a ip address and bump the
> number by 1.  BY the way is there some name for each group of numbers in
> the ip address?

Octet.
 
> Something like.
> 
> org_ip="10.0.10.2"
> short_ip=need command to strip off the 2 so short_ip contains 10.0.10.
> and ip_suffix= ends up holding the 2, then add 1 to the ip_suffix.
> ip_suffix=$(( ${ip_suffix + 1 ))
> org_ip="${short_ip}${ip_suffix}"
> 
> Thinking there must be some common way of manipulating ip addresses that
> I just don't know about.

man sh | less -p"Parameter Expansion"

org_ip=10.0.10.2 
${org_ip##*.}   # yields 2
${org_ip%.*}# yields 10.0.10

Do read the manpage.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Booting multiple choice, and pause to read bootup info

2010-06-21 Thread George Davidovich
On Mon, Jun 21, 2010 at 08:19:22PM -0500, J. Porter Clark wrote:
> 1. I'd like to be able to expand the list of choices in the
> boot menu (the menu with single user mode, safe mode, etc.) to
> include booting in any of several different environments, e.g.,
> home wired, home wireless, work wired, work wireless.  Hacking
> the FORTH code isn't entirely out of the question, but before
> I even try it, I need to know how I could tell the system to
> switch among different rc.conf files (if that's even possible)
> from the loader.  Offhand, I don't see a mechanism for doing so.
> Cleverer ideas welcome.

I did something similar for PXE scenarios but eventually decided I was
spending more time coming up with clever ideas than I would have saved
making use of any of them.  The approach I took was to write a custom
loader.rc (with an include for each of the possible options), but IIRC
everything was presented via a rudimentary menu.

For customising the existing menu, if you read through loader(8), and
then have a look at what's provided in /usr/share/examples/bootforth,
you should be able to figure things out without too much trouble.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: command to strip suffix in .sh script

2010-06-03 Thread George Davidovich
On Thu, Jun 03, 2010 at 11:11:16PM +0700, Anh Ky Huynh wrote:
> On Wed, 02 Jun 2010 20:25:36 -0400 Vinny wrote:
> > On 06/02/2010 04:30, Matthew Seaman wrote:
> > > On 02/06/2010 09:24:01, Matthias Apitz wrote:
> > > > Aiza wrote:
> > > >
> > > > > I have this code
> > [snip]
> > > > $ echo 'archivename-201006021514.34.tar.gz' | sed 's/-.*$//'
> > >
> > > archive_name=${fromarchive%-*}
> >  
> > Thanks Matthew, that's really neat.  It took me a long time to find
> > the correct google incantation to find the documentation for that.
> > ( bourne shell pattern-matching notation )
> 
> In fact I know about that from Bash's documents:) IMHO, there are more
> Bash's documents than Bourne's ones.

Kids today. ;-)  

No need for Magick Google Incantations:

  man sh   | less -p 'Parameter Expansion$'
  man bash | less -p 'Parameter Expansion$'

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Small computer to run a GUI?

2010-05-07 Thread George Davidovich
On Fri, May 07, 2010 at 06:41:16PM -0700, Liontaur wrote:
> I'm looking for a small (and relatively inexpensive) computer to run a
> GUI, I don't much care if it's KDE or Gnome or one of the others. Just
> so that I can browse the Internet using Firefox (unfortunately I may
> need to look at some flash). So they need to be able to run FreeBSD
> (obviously), a GUI, have a Cat5 port (10/100 is fine), and PS/2s for
> mouse and keyboard. USB is a bonus but not necessary.
>
> I remember seeing some kind of small terminals at the local library
> but I can't remember now who made them I think it was Weis or Weir or
> something like that but a google brings up nothing.  I was hoping to
> either boot them over a network or using a CF card or something with a
> small footprint as well. 

"WYSE".  

Do a search on eBay for either "network terminal" or "thin client" and
and you'll probably find the same model you saw in the library.

> I went checking out Soekris but couldn't really see if they offer a
> GUI, the models I looked at didn't have a VGA port though. I was
> hoping for something about 9 inches square and three inches thick, or
> smaller.

The lack of video on Soekris boxes is deliberate, and is considered a
feature.

Sounds to me like you probably want either a Mac Mini or a mini-ITX
system.  I've never been that impressed by mini-ITX, but the newer
Atom-based models look promising, and are certainly more affordable than
a Mac Mini.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Kill via Cron...

2010-04-20 Thread George Davidovich
On Tue, Apr 20, 2010 at 12:57:25PM -0700, Randal L. Schwartz wrote:
> > > > >> "Karl" == Karl Vogel  writes:
> 
> > > > On Tue, 20 Apr 2010 08:52:58 +0100, 
> > > > "mcoyles"  said:
> 
> M> kill -9 `ps ax | grep backup | grep -v grep | awk '{print $1}'`
> 
> And you don't have to remember grep -v grep if you remember
> to use "ps axc" (note the c), since arguments won't show up so the
> arguments to grep won't generate a false positive.

Alternatively:

  ps ax | grep [b]ackup | awk '{print $1}'

Or to avoid being nominated for something like the Useless Use of Cat
award:

  ps ax | awk '/[b]ackup/ {print $1}'

Making use pgrep/pkill would seem to make the most sense.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Advanced printing/layout tools

2010-01-01 Thread George Davidovich
On Fri, Jan 01, 2010 at 04:25:08PM -0600, Doug Poland wrote:
> On 2010-01-01 14:18, Roland Smith wrote:
> > On Fri, Jan 01, 2010 at 07:36:25PM +0100, Polytropon wrote:
> > > On Fri, 1 Jan 2010 19:24:21 +0100, Roland Smith wrote:
>
> Thanks for the info so far.  I have much to learn about LaTeX, that is
> certain.  To complicate matters, the output will be on US Letter,
> landscape, multi-column, multi-sided, booklet format.  No doubt LaTeX
> will handle the landscape, letter, and multi-column, but I'm not sure
> about booklet, multi-sided.  I have some experience with print/psutils
> doing duplex, booklet printing.

I'd start by reading "The Not So Short Introduction to Latex":

  http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf

There's a useful wiki available at:

  http://en.wikibooks.org/wiki/LaTeX

that covers common questions, but for what you're doing, I'd suggest
logging onto comp.tex.tex.  It's been years since I did anything
similar, otherwise I'd post a template to get you started.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Adding an alias to .cshrc

2009-12-29 Thread George Davidovich
On Tue, Dec 29, 2009 at 07:50:21PM -0500, Steve Bertrand wrote:
> I want to add an alias to my .cshrc file:
> 
> alias srm   find . -name "*~" | xargs rm

No need for xargs:

  alias srm "find . -name '*~' -exec rm {} +"

or

  alias srm "find . -name '*~' -delete"

> ...so that I have an easy way to remove the temp files left by svn.
> 
> After adding the alias, logging out and then back in, I get an error
> stating:

Use the builtin(1) 'source' command.  No need to log out/log in.

> acct-dev: ISP-RADIUS % srm
> srm: Command not found.

I'm sure someone more knowledgable about csh (I rely on bash) can help
you debug what exactly happens and why, but quoting your alias command
in .cshrc is all that's required.
 
> I thought that perhaps the file wasn't being read upon login, so I
> appended a new alias underneath:

Easier to check your aliases by typing 'alias', no?

> alias srm   find . -name "*~" | xargs rm
> alias sll   ls -lA
> 
> ...which works fine when called after re-login.
> 
> I even went as far as to prefix the find/xargs command with full paths,
> to no avail.
> 
> Is this a problem with the pipe in the alias directive? The command
> works on the CLI, as I literally copy/pasted it into the .cshrc file.

Again, quoting what's being aliased will suffice.  Why that's not
necessary during interactive use, I don't know, but I'd get into the
habit of quoting such things regardless.

-- 
George

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Sendmail client configuration to connect to ISP's SMTP server

2009-12-26 Thread George Davidovich
On Sat, Dec 26, 2009 at 11:20:27AM -0800, Aflatoon Aflatooni wrote:
> What configuration do I need to set in my freebsd.submit.mc in order
> to connect to the ISP's SMTP server?  The ISP is blocking all the
> emails unless it goes through their mail server, so I need my FreeBSD
> box to connect to the ISP's SMTP server for outbound emails.
> 
> The client also needs to be authenticated as well.

Fix your word wrap.

Have you checked the Handbook?  If not, start with Section 28.10 SMTP
Authentication.  Read that and follow the link to 

http://www.sendmail.org/~ca/email/auth.html

where you'll find the rest of what you need to know.  You're using
sendmail as a client, so be sure to focus on the section entitled "Using
sendmail as a client with AUTH".  

Fairly straightforward stuff, but there may be a lot to take in at first
glance.  Post back if you have any questions or need to be walked
through any part of the process.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Mount dump0 as ISO9660 filesystem?

2009-12-04 Thread George Davidovich
On Fri, Dec 04, 2009 at 04:50:43PM -0800, Nerius Landys wrote:
> > Either way, the file remains just a file, and is read using
> > restore(8).

[snip]

> All I really want to do is take my dump file and see the "files"
> inside it, and do things with those files such as copy or md5sum (not
> edit).  And I don't even know which tool do use to accomplish that.

You still don't know which tool?

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: "Last login" message

2009-12-04 Thread George Davidovich
On Thu, Dec 03, 2009 at 03:16:54PM -0800, Nerius Landys wrote:
> When I ssh to my FreeBSD machine, I get something like this:
> 
> Last login: Thu Dec  3 15:12:40 2009 from 11.22.33.44
> Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
> The Regents of the University of California.  All rights
> reserved.
> 
> FreeBSD 7.1-RELEASE-p9 (DAFFY) #0: Thu Dec  3 11:33:28 PST 2009
> 
> ..where "11.22.33.44" is an IP address.  However, sometimes, in place
> of an IP address I get a truncated hostname, for example
> "daffy.nerius.co" (note the last 'm' missing).  I was wondering what
> controls this, meaning if I get an IP or a hostname, and why it's
> being truncated.

If 'touch ~/.hushlogin' isn't what you're after, consider modifying
sshd_flags in /etc/rc.conf.  From sshd(8):

 -u len  This option is used to specify the size of the field in the
 utmp structure that holds the remote host name.  If the
 resolved host name is longer than len, the dotted decimal value
 will be used instead.  This allows hosts with very long host
 names that over- flow this field to still be uniquely
 identified.  Specifying -u0 indicates that only dotted decimal
 addresses should be put into the utmp file.  -u0 may also be
 used to prevent sshd from making DNS requests unless the
 authentication mechanism or configuration requires it.
 Authentication mechanisms that may require DNS include
 RhostsRSAAuthentication, HostbasedAuthentication, and using a
 from="pattern-list" option in a key file.  Configuration
 options that require DNS include using a u...@host pattern in
 AllowUsers or DenyUsers.

I count 'daffy.nerius.co' as 15.

-- 
George

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Mount dump0 as ISO9660 filesystem?

2009-12-04 Thread George Davidovich
On Thu, Dec 03, 2009 at 03:27:48PM -0800, Nerius Landys wrote:
> I heard somewhere that you can mount a dump as an ISO9660 filesystem,
> but I cannot find any Google answers on this subject.  I took my dump
> in the following fashion:
> 
> dump -0Lan -C 16 -f - /usr | gzip -2 | 
> 
> So, I have a file named dump0-var.gz.

Your dump is just a regular file sitting on a hard drive with a file
system that's already mounted.  If you created an on-disk ISO image of
that file, you'd have to mount the file system of that ISO image to read
the file.  If you burned the ISO image to a CD, you'd mount the CD's
file system to read it.  Either way, the file remains just a file, and
is read using restore(8).

I'll offer a guess that you're confusing things with tar(1) (which is
often used for backups) and the recent changes.  From the manpage:

This implementation can extract from tar, pax, cpio, zip, jar, ar,
and ISO 9660 cdrom images and can create tar, pax, cpio, ar, and
shar archives.

The above means you can now do nifty things like 'tar xvf mybackup.iso',
and if you've configured a pre-processor for less(1), even niftier
things like:

less backup.tar.gz
less backup.zip
less backup.iso 

It's also possible you might be thinking of file system snapshots (which
can be mounted).  Check the Handbook for details.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: PF binat rule issue - feature or bug?

2009-12-04 Thread George Davidovich
On Fri, Dec 04, 2009 at 10:41:20AM -0600, Greg Barniskis wrote:
> Using 7.2-RELEASE-p4 i386 with GENERIC kernel, I've found (the hard way) 
> that if I have a pf.conf rule like
> 
> nat on $ext_if proto { tcp udp icmp } from $my_subnet \
>to any -> some.public.ip.num
> 
> then pfctl will perform the expected expansion of the listed protocols 
> into three separate NAT rules.
> 
> However, if I have a rule like
> 
> binat on $ext_if proto { tcp udp icmp } from $server_dmz_ip \
>to any -> $server_public_ip
> 
> then I will /only/ get one NAT rule, for TCP.
> 
> Then things like NTP, DNS and ping will fail, but the filtering rules 
> that permit such traffic will increment their byte, packet and state 
> counters like PF is working just fine (and I suppose in some sense that 
> the filtering part is). But only if I explicitly declare in pf.conf a 
> separate binat rule for each desired protocol, instead of listing them, 
> will things work as needed.
> 
> Feature or bug? If the former, it is not well documented that I could 
> see. I expected that a list of protocols for a binat rule would just 
> work, and pfctl certainly didn't mark it as bad syntax. If a bug, is 
> this a FreeBSD bug or OpenBSD?

The BNF grammar in pfconf(5) suggests that binat rules don't take a
list.  Summarised:

nat-rule   = ... "proto" ( proto-name | proto-number | "{" proto-list "}" )

binat-rule = ... proto ( proto-name | proto-number )  

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: 8.0-RELEASE and "dangerously dedicated" disks

2009-12-02 Thread George Davidovich
On Tue, Dec 01, 2009 at 08:34:05PM -0800, Randi Harper wrote:
> I'm going to just reply to all of these at once.
>
> On Tue, Dec 1, 2009 at 1:03 PM, Jerry McAllister wrote:
> > On Tue, Dec 01, 2009 at 07:59:42AM -0500, Maxim Khitrov wrote:
> > > On Sat, Nov 28, 2009 at 12:28 PM, Peggy Wilkins wrote:
> > > > Due to history I won't go into, all my production (currently
> > > > 7.2-RELEASE) systems are installed onto "dangerously dedicated"
> > > > disks.  What exactly do I need to do to upgrade them to 8.0?
> > > > (I'm not asking for an upgrade procedure, I'm familiar with
> > > > that, but rather, how this change impacts the upgrade.) I think
> > > > that the suggestion that the disks need to be reformatted is
> > > > extreme and I hope something less extreme will suffice.
>
> Just to point out the obvious, you shouldn't use "dangerous" and
> "production" in the same sentence. :)

Fun with ambiguities aside, I think it's fair and reasonable to
interpret "dedicated" as "dedicated to FreeBSD", and "dangerous" as "may
not work with common third-party disk tools or an older BIOS".  

It's similarly fair to interpret any caveat, implicit or otherwise,
against using "dangerously dedicated mode" as a general recommendation
aimed at new users (typically in dual or multi-boot environments), and
not a statement that dangerously dedicated mode is unsuitable for
production environments.  It certainly doesn't state or suggest that
it's a convenient but deprecated feature that might be removed without
notice or warning in the future.  Which is what's happened.

In that light, the statement in the release notes merits a fuller
description as well as an explanation for the change. 

> > > > Also, just to be clear, does this statement refer to boot disks,
> > > > data disks, or both?
> > > >
> > > > It doesn't make sense to me that "dangerously dedicated" could
> > > > have an impact on UFS filesystems specifically. A partition
> > > > table is just a partition table, regardless of what filesystems
> > > > might be written on disks, yes? Am I misunderstanding something
> > > > here?
> >
> > I don't know why it would have an affect, but they say it does.
>
> Did you see all the mailing list chatter about new installations  
> 
> failing due to sysinstall not being able to newfs device names that   
> 
> didn't exist? This is related. Also, a partition table isn't just a   
> 
> partition table. It's a little more complex than that. It has 
> 
> *nothing* to do with the filesystems inside. It has everything to do  
> 
> with the way that FreeBSD looks at the drive to figure out what's on  
> 
> it. See man pages for geom/gpart. There are others that have given a  
> 
> better explanation than I can provide (marcus, juli). Search the  
> 
> archives. 

FreeBSD is known for, among other things, the consistent quality of its
documentation.  As it stands, the statement "dangerously dedicated mode
for the UFS file system is no longer supported" in the release notes
stands in direct contradiction to the official Handbook (updated to
include 8.0-RELEASE) Section 18.3.2.2 which states "you may use the
dedicated mode".

A suggestion to search the (multiple) archives for chatter suggests that
authoritative information can now be found on display in the bottom of a
locked filing cabinet stuck in a disused lavatory with a sign on the
door saying "Beware of the Leopard".

Perhaps you could provide something more specific, or a direct link to
the chatter? 

> Trust me, I didn't remove DD support from sysinstall just to  
>   
> make life more complicated for everyone. I did this because as it 
> 
> stands right now, it doesn't work. 

Regrettably, the end result is the same.  That's not to say we wouldn't
grumble and then happily settle for something less.  Provided that
something amounted to more than "no longer supported because it doesn't
work".

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Prompt containing SSH login information

2009-11-23 Thread George Davidovich
On Tue, Nov 24, 2009 at 05:10:38AM +0100, Polytropon wrote:
> again, a strange question: I'd like to know if there is a builtin
> means to let the csh's (or bash's) prompt show an information if
> the current dialog session has been opened via SSH from another
> system. The obvious is:
> 
>   m...@sys1:~% ssh m...@sys2
>   m...@sys2:~% _
> 
> I'd like the second prompt that I've been logged into sys2 by
> sys1, such as
> 
>   m...@sys1>sys2:~% _
> 
> or reverse
> 
>   m...@sys2 
> or something similar, like the complex form with different user
> names, such as
> 
>   m...@sys1:~% ssh b...@sys2
>   m...@sys1>b...@sys2:~% _
> 
> Is this possible with the means given by the shell? I read "man
> csh", but found nothing that would fit.
> 
> Maybe it's not possible (because not intended)...

I'd suggest parsing out w(1), or better yet, making use of environmental
variables instead.  The following, for example, are set by ssh:

  SSH_CLIENT
  SSH_CONNECTION
  SSH_TTY

Out of curiosity, why are you wanting to do this?  Are you chaining
connections and need an analog of SHLVL for ssh connections? 

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Dump

2009-11-21 Thread George Davidovich
On Sat, Nov 21, 2009 at 04:12:42AM +0100, Bernt Hansson wrote:
> Matthew Seaman skrev:
> > Bernt Hansson wrote:
> > > 
> > > I've been testing backups with dump, works well BUT
> > > -L does not work. For example
> > > 
> > > dump -0 -a -u -L -f /mnt/dump.home.full /dev/ad0s2d
> > 
> > I believe that you need to tell dump the mount point of the file system in
> > order for it to create a snapshot, rather than the device file for the
> > partition. (ie. snapshotting only makes sense on a mounted read-write
> > filesystem).
> > 
> > Also, if you're dumping a snapshotted FS to a local file, then bump up the
> > cachesize to improve performance a lot.  Add '-C 32' to your command-line.
> 
> Ok. I've tested this
> dump -1 -a -u -L -C 64 -h 0 -f /usr/home/bernt/disk2/dump.backup.home.2 
> /usr/home
> dump -1 -a -u -L -C 64 -h 0 -f /usr/home/bernt/disk2/dump.backup.home.2 
> /usr/home
> 
> The error is
> mksnap_ffs: Cannot create /usr/home/.snap/dump_snapshot: Invalid argument
> dump: Cannot create /usr/home/.snap/dump_snapshot: No such file or directory

Aargh.  Must have missed the above when I last replied.  That error
message indicates you're running dump without proper privileges.

Run dump as root, or add yourself to the operator group:

  pw groupmod operator -m bernt 

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Dump

2009-11-21 Thread George Davidovich
On Sat, Nov 21, 2009 at 04:12:42AM +0100, Bernt Hansson wrote:
> Matthew Seaman skrev:
> > Bernt Hansson wrote:
> > > 
> > > I've been testing backups with dump, works well BUT
> > > -L does not work. For example
> > > 
> > > dump -0 -a -u -L -f /mnt/dump.home.full /dev/ad0s2d
> > 
> > I believe that you need to tell dump the mount point of the file
> > system in order for it to create a snapshot, rather than the device
> > file for the partition. (ie. snapshotting only makes sense on a
> > mounted read-write filesystem).

Actually, the above isn't correct.  A device special is fine.  From the
dump(8) manpage:
  
  The file system to be dumped is specified by the argument filesystem
  as either its device-special file or its mount point (if that is in a
  standard entry in /etc/fstab).

The criteria unique to live dumps is that /dev/ad0s2d must be already
mounted, and there must be a .snap directory in its root.  You've since
changed your command, so I won't address what the problem might have
been.

> > Also, if you're dumping a snapshotted FS to a local file, then bump
> > up the cachesize to improve performance a lot.  Add '-C 32' to your
> > command-line.
> 
> Ok. I've tested this
> dump -1 -a -u -L -C 64 -h 0 -f /usr/home/bernt/disk2/dump.backup.home.2 
> /usr/home

Was the change from 'dump -0' to 'dump -1' intentional?  Dump levels are
rarely chosen to be sequential, but a level of 1 or greater is generally
performed after a level 0 dump.
 
> The error is mksnap_ffs: Cannot create /usr/home/.snap/dump_snapshot:
> Invalid argument dump: Cannot create /usr/home/.snap/dump_snapshot: No
> such file or directory

You've now specified what's likely a directory (/usr/home), not a
device-special or mount point.  Your choices of valid filesystems can be
determined by running df(1) and examining the first and last columns.
On a typical install those two columns might be:

  Filesystem  Mounted on
  /dev/ad0s1a /
  devfs   /dev # ignore this line
  /dev/ad0s1e /tmp
  /dev/ad0s1f /usr
  /dev/ad0s1d /var

Pick one.  I prefer device names.

FWIW, if you're going to be using dump regularly (i.e. multiple dump
levels and/or multiple hosts) and dumping to files, I'd suggest a naming
convention of

  hostname-20090405-usr-0

to save you the grief of date fragility, and give you a meaningful
display in 'ls -l' when restoring.  So, for a level 0 dump on your
system, your commands might be:

  dumpdir=/home/bernt/disk2
  dump -0auL -C 64 -f $dumpdir/hostname-20091121-root-0 -h 0 /
  dump -0auL -C 64 -f $dumpdir/hostname-20091121-usr-0  -h 0 /usr
  dump -0auL -C 64 -f $dumpdir/hostname-20091121-var-0  -h 0 /var

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: SLIM and XFCE4

2009-11-05 Thread George Davidovich
On Thu, Nov 05, 2009 at 10:49:44PM +0100, Polytropon wrote:
> On Wed, 4 Nov 2009 23:01:19 -0800 (PST), Alexandre L. wrote:
> > mmm. I don't know.  But with this config file, XFCE4 launch is OK
> > (or seems OK).
> 
> That may be possible, as well as correct.
> 
> I have learned - many many years ago, so it may already have changed -
> that .xinitrc is a SHELL SCRIPT that is executed on X startup. So all
> the "rules" for shell scripts do apply, such as declaring the
> interpreter with the #!  special comment. Furthermore, .xinitrc serves
> as a kind of "init process", so that the "exec" statement is needed to
> replace the .xinitrc process by the window manager.

That's always been my understanding, but if you examine the startx
script, you'll see otherwise.  From xinit(1): 

If no specific client program is given on the command line, xinit
will look for a file in the user's home directory called .xinitrc to
run as a shell script to start up client programs ... 
^

The interpretation being that .xinitrc can be an ordinary file, but
should be written to follow certain syntax rules (not unlike
/etc/rc.conf).  An example to illustrate:

$ echo 'var="Hello World"; echo $var' > filename
$ sh filename
Hello World

Put simply, .xinitrc does not need a shebang line, and does not need to
be executable.  A simple 'exec ...' statement as the final line will
suffice.


-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: error output redirection

2009-10-11 Thread George Davidovich
On Sun, Oct 11, 2009 at 11:36:52PM +0200, Stefan Miklosovic wrote:
> if error output of some program appear on screen, it is possible to
> print it also to some file simultaneously?

Depends on the program, but generally, yes.

http://en.wikipedia.org/wiki/Standard_streams
http://en.wikipedia.org/wiki/Redirection_(computing)

> e.g if I "cat" file which do not exist, error is on screen, I want to
> add that error to some file (errors.txt)

Replacing 'cat file_that_does_not_exist' with 'badcommand'

  # redirect STDERR to a file
  badcommand 2> errors.txt

  # append STDERR to a file
  badcommand 2>> errors.txt

  # fun with file descriptors to have it both ways
  badcommand 3>&1 1>&2 2>&3 | tee errors.txt

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Daily report cannot be emailed to a jailed mail server

2009-10-07 Thread George Davidovich
On Thu, Oct 08, 2009 at 09:02:50AM +1100, David N wrote:
> FreeBSD 7.2-R box with 10 jails.
> 
> The mail server (actually its a mail filter) is hosted on the same
> server inside a jail.
> 
> I can't seem to get the main server reports to be sent to the mail
> filter inside the jail inside the same box.
> 
> so.. r...@localhost tries to send an email to
> some...@anotherdomain.com.au
> 
> The MX entry for anotherdomain.com.au points to the mailfilter on the
> server (jailed).
>
> I've changed my /etc/mail/aliases to have
> root: some...@anotherdomain.com.au
> and ran newaliases.

It's been already pointed out that you aren't providing much information
to go on, so here's my WAG of what is happening.

Changing the root alias root could work, but consider the case of mail
from the jailhost being rejected by the jailed mailserver.  The bounce
message will be addressed to POSTMASTER on the jailhost, which points to
root on the jailhost, which points back to the jailed mailserver trying
to send the bounce, which points to ...

You can examine the scenario for yourself either by listening to a
married couple on the verge of divorce argue with one another, or more
specifically, by running

  [r...@jailhost] sendmail -bv root
  [r...@jail] sendmail -bv postmas...@jailhost.server.net

> When i try to send an email i get
> in /var/log/messages
> sm-mta[94682]: n97LeeOw094682: Losing ./qfn97LeeOw094682: savemail panic
> Oct  8 08:40:40 server sm-mta[94682]: n97LeeOw094682: SYSERR(root):
> savemail: cannot save rejected email anywhere
> Oct  8 08:42:30 server sm-mta[94713]: n97LgTYg094713: Losing
> ./qfn97LgTYg094713: savemail panic
> Oct  8 08:42:30 server sm-mta[94713]: n97LgTYg094713: SYSERR(root):
> savemail: cannot save rejected email anywhere
> Oct  8 08:47:07 server sm-mta[95130]: n97Ll7VV095129: SYSERR(root): MX
> list for anotherdomain.com.au. points back to server.net

The jailed mailserver is rejecting the mail and is then trying to send a
bounce and can't because it's caught in a loop that ends when Sendmail
says "Look this isn't an argument ... it's just contradiction!" and
bails out.  

Why the jailed mailserver is rejecting the mail is a separate issue. 

> In /var/log/maillog
> n97Ll7VV095129: to=some...@anotherdomain.com.au,
> ctladdr= (0/0), delay=00:00:00, xdelay=00:00:00,
> mailer=esmtp, pri=30715, relay=anotherdomain.com.au., dsn=5.3.5,
> stat=Local configuration error
> Oct  8 08:47:07 server sm-mta[95130]: n97Ll7VV095129: n97Ll7VV095130:
> DSN: Local configuration error

That's from the maillog on the jailhost.  More relevant to why the
jailed mailserver has rejected the mail would be the jail's maillog
entries (or whatever logging was done by the "filter" installed there). 

Either way, for the interim I'd suggest undoing your changes, rebuilding
your aliases and consider implementing an alternate approach.  For
anyone to figure out conclusively what's happening, you'll have to
provide more information.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: A general sed question

2009-10-07 Thread George Davidovich
On Tue, Oct 06, 2009 at 11:45:36PM -0700, David Allen wrote:
> I keep bumping up against this, so I thought I'd throw this question out
> to those who understand sed better than I do.
> 
> What I'm trying to do is to clean up the contents of some files
> (/sys/i386/conf/GENERIC would be a good example) to get more readable
> diffs.  To that end, I'm trying to use sed to

For the following note that what's contained in the square brackets is a
space character followed by a literal TAB character (typically created
by entering ^V followed by TAB).

>  - delete commented lines
>  - remove inline comments

s/[ ]*#.*//   # takes care of both, but will leave \t\t\t\n

>  - remove trailing spaces and/or tabs

s/[ ]*$// # handy, but not needed if using diff -b

>  - delete blank lines, and/or lines containing just spaces and/or tabs

/^[ ]*$/d

>  - expand tabs

This is overly complex with sed and probably unecessary.  Instead I'd
suggest using your editor (in vim, it's ':set expandtab | retab'), or
for interactive use, relying on expand(1) and using a value for -t that
matches the tab spacing you typically use for your pager and/or editor.
Alternatively, to get better visual alignment when using diff(1), just
use the -t option.

Putting the above together, you get

sed -e 's/[ ]*#.*//' -e 's/[]*$//' -e '/^[  ]*$/d'  

Hardly ideal but it's readable enough and satisfies the 80/20 rule.  If
used as a simple alias, shell function or script as Oliver Fromme
suggested (yes, this works in bash), my suggestion is

diff -ubBt <(cleanup /sys/i386/conf/GENERIC) <(cleanup /path/to/NEWKERNEL)

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Regex Help - Greedy vs. Non-Greedy

2009-09-09 Thread George Davidovich
On Wed, Sep 09, 2009 at 09:15:25AM -0700, Drew Tomlinson wrote:
> I'm trying to do a search and replace in vim.  I have lines like this:
> http://site1/dir/;
> http://site2/dir/;LastName, FirstName;Phone;
> http://site3/dir/;LastName, FirstName;
> http://site4/dir/;
> 
> I'm want to match "http:*" and stop matching at the first ";".  My basic 
> regex is:
> 
> /http:.\+;/
> 
> But it's matching *all* the semi-colons.  Thus I've Googled and tried 
> various incatations to try and make my regex "non-greedy" but I can't 
> seem to come up with the correct combination.

LOL.  Do yourself a favour and stop "Googling".  Vim has a built-in help
system.  To access help for regular expressions:

  :help regexp
  :he regexp
  :he r[TAB] ...

and search for non-greedy (or just scroll down).

> How can I write a regex that stops matching at the first semi-colon?

You've already received a few answers, but I'll add one that may be even
better -- rely on external programs instead.  Vim can be a bit clunky at
times.

The simplest and most typical usage would be

  :[range] !command 

If using Perl  

  $ perldoc -h
  $ perldoc -q regex

-- 
George

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: 'alias' + sudo

2009-09-04 Thread George Davidovich
On Thu, Sep 03, 2009 at 08:10:36PM -0400, Jerry wrote:
> On Fri, 4 Sep 2009 01:34:05 +0200 Mel Flynn wrote:
> 
> > alias spico='/usr/local/bin/sudo pico -m' and be done with it.

Instead of an extra alias, why not export $VISUAL or $EDITOR, and rely
on sudoedit(8)?

> That is what I am currently doing; however,there are other commands
> that I want to use that are not available when used via sudo without
> modifying the alias. I did not realize that sudo had such a
> limitation.

It's not a "limitation".  It's a feature.  ;-)  Re-read the sudo
manpage.

I'd be surprised if most of your aliases would ever require root
privileges, and are anything but one-off shortcuts for your personal
use.

For those that do, I'd suggest replacing them with a function (or
script) that tests for root privileges (using something like id(1)), and
invokes sudo when appropriate.  

Otherwise, you may want to consider using 'su -m'.  That will your
current environment unmodified and all your existing aliases will remain
available for use.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: remove newlines from a file

2009-09-01 Thread George Davidovich
On Tue, Sep 01, 2009 at 06:03:19PM +, Paul Schmehl wrote:
> I found a sed tutorial once that did this, but I can't seem to find it
> again.  

You're probably thinking of "Useful One-Line Scripts for Sed":

http://sed.sourceforge.net/sed1line.txt

A good follow-up:

http://www.osnews.com/story/21004/Awk_and_Sed_One-Liners_Explained

> I have a file with multiple lines, each of which contains a single ip
> followed by a /32 and a comma.  I want to combine all those lines into
> a single line by removing all the newline characters at the end of
> each line.
> 
> What's the best/most efficient way of doing that in a shell?

A sed solution would be

  sed -e :a -e '$!N; s/\n/ /; ta' my_file

Other (easier to remember) solutions could include:

  tr -d '\n' < my_file
  tr '\n' ' ' < my_file 

  echo $(cat my_file)  # not so useless use of cat!
 
  paste -s my_file

  while read line; do 
joined="$joined $(echo $line)"
  done < my_file
  echo $joined

Lots of options, of course.  Even more with Perl. 

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: SUID permission on Bash script

2009-08-28 Thread George Davidovich
On Fri, Aug 28, 2009 at 10:01:54AM +0100, Jeronimo Calvo wrote:
> 2009/8/28 Giorgos Keramidas 
> 
> On Fri, 28 Aug 2009 09:24:35 +0100, Jeronimo Calvo
>  wrote:
> > > 
> > > Im trying to set up a reaaallly basic scrip to allow one user to
> > > shutdown my machine without root permisions, seting up SUID as
> > > follows:
> > > 
> > > -rwsrwxr-- 1 root wheel 38 Aug 27 23:12 apagar.sh
> > > 
> > > $ ./apagar.sh
> > > 
> > > Permission denied
> > > 
> > > content of script:
> > > 
> > > cat apagar.sh
> > > 
> > > ]#!/usr/local/bin/bash
> > > shutdown -p now
> > > 
> > > As far as i know, using SUID, script must runs with root
> > > permissions... so i shoudnt get "Permission denied", what im doing
> > > wrong??
> > 
> > No it must not.  There are security reasons why shell scripts are not
> > setuid-capable.  You can find some of them in the archives of the
> > mailing list, going back at least until 1997.
> > 
> > The good thing is that you don't need a shell script to do that.  You
> > can install `sudo' and give permission to the specific user to run:
> > 
> >sudo shutdown -p now
> 
> so SUID can be applied to sh but it doesn't work!, there is not anyway
> to apply it? apart from installing sudo?, The thing is that installing
> sudo and adding that user into sudoers, that user will be capable to do
> any other SU tasks, apart of shutting down... wich i dont like :D (I
> know that SUID could be even worst if they edit the .sh file... but lets
> believe they dont even know that XD)

Please refrain from top-posting.  It's both confusing and inconsiderate
for anyone trying to read what you write or otherwise trying follow a
discussion.

First, as has already been pointed out, your approach is A Really Bad
Idea and will lead nowhere so forget it.  Second, you're
misunderstanding sudo.  From sudo(8):

  sudo allows a permitted user to execute a command as the 
  superuser or another user, as specified in the sudoers file.  

Note the "as specified".  For example, if the sudoers file contains
nothing but

  john  ALL= NOPASSWD: /usr/sbin/shutdown

then John (and only John) can use sudo to execute /usr/sbin/shutdown,
but can't use sudo to execute any other commands. 

As an alternative to installing sudo, you can add your user to the
operator group:

  pw groupmod operator -m john

but be sure to understand the ramifications before doing so.

-- 
George


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: hard disk failure - now what?

2009-08-26 Thread George Davidovich
On Wed, Aug 26, 2009 at 04:45:40PM -0400, Jerry McAllister wrote:
> On Wed, Aug 26, 2009 at 10:23:47PM +0200, Roland Smith wrote:
> 
> > On Wed, Aug 26, 2009 at 12:13:48PM -0700, George Davidovich wrote: I
> > remember this special non-condictive 3M fluid that can be used to
> > cool electronics. A group of hackers dunked a complete PC minus the
> > case and power supply in this stuff. The fluid itself was cooled
> > with liquid nitrogen. They everclocked it something wicked. Not very
> > practical though. :-)
> 
> A number of supercomputers from Cray and Control Data and maybe some
> other places used this sort of thing on some experimental systems.  I
> don't know if any ever were put in to commercial production.  They
> submerged who boards in to it and then supercooled the fluid.   I
> don't remember the chemical names.  

I do, but have no idea why.

http://en.wikipedia.org/wiki/Perfluorohexane

> The fluid was a relative of Freon and held sufficient levels of oxygen 
> to support lung breathers.  They used to have a tank with a live mouse 
> submerged in it bouncing around and seeming to have no trouble not 
> choking or drowning.  

> A variation of it was also researched as a blood substitute for some
> special medical needs.  I don't know how far that went.I know it
> is not all fantasy because I saw the live mouse.   

I believe you.  I saw a similar scene in a movie, so I already knew it
had to be true.  Bonus points for anyone that can add to this thread's
collection of off-topic but semi-interesting trivia and name the movie. 

> I didn't try the blood substitute.

How do you save a drowning mouse?
Use mouse to mouse resuscitation.

Thanks, I'll be here all week.  Try the veal instead.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: hard disk failure - now what?

2009-08-26 Thread George Davidovich
On Wed, Aug 26, 2009 at 08:07:41PM +0200, Roland Smith wrote:
> On Tue, Aug 25, 2009 at 11:46:50PM -0600, Kelly Martin wrote:
> > plugging the drive in and accessing it, I heard those tell-tale
> > signs of hard drive failure: clicks and pops and other unusual
> > noises, so I know that it has some damage. I hate those sounds,
> > having heard them on failing drives too many times before.
> 
> If the drive is that bad, it is doubtfull if dd or ddrescue will be
> able to get a good copy.

Probably true.  I hesitate to suggest this, but sticking the drive in a
freezer (preferrably in a ziplock bag) for a few hours or overnight
might help.  Stories from people claiming "I swear it works!" go back
years.  

To the exent it does work, it might give Kelly enough time to attempt
recovery.  If more time is required, he can try and find a creative
workaround for the 5 meter max length for USB cables.  Also,
experimenting with dry ice or acetone baths might prove to be
interesting, or at least educational. ;-)

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: please help to uninstall FreeBSD!!!

2009-08-16 Thread George Davidovich
On Sun, Aug 16, 2009 at 11:54:41AM -0400, Charles Oppermann wrote:
> 
> I assume your use of "MICROS~1" is some sort of clever dig at
> Microsoft, but this is 2009 - not 1995 

Sorry, but while I agree the MICROS~1 pejorative can be a bit juvenile
and uncalled for, your assertion that 8.3 filenames are a thing of the
past is incorrect.  If browsing an installation CD or the contents of
your local drive isn't enough to raise a few questions ...

[geo...@xp] # regtool list '/HKLM/SYSTEM/CurrentControlSet/Control/FileSystem'
NtfsDisable8dot3NameCreation 
Win31FileSystem
Win95TruncatedExtensions

The default value for NtfsDisable8dot3NameCreation is 0.

Obviously, there's reasons for that, but this is one of those situations
where an admonition of "Go ahead and laugh -- it's funny!" might be
appropriate.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Trying to Install Man Page

2009-08-11 Thread George Davidovich
On Mon, Aug 10, 2009 at 03:59:43PM -0500, Martin McCormick wrote:
> There is a test man page I am trying to install and the system is not
> finding it. I put it in /usr/local/man/man1 and think I should at
> least get complaints about the page as it is the start of a man page,
> not the whole thing. I named it testpage

If your testpage manpage is located in a man1 directory, it has to be
named testpage.1 (or gzipped as testpage.1.gz).  For a man2 directory,
the suffix is .2, and so on.  Rename the file and I'm sure things will
work fine.

> , compressed it with gzip and when I type
> 
> man testpage, it just says that there is no manual entry for testpage.
> 
> Is there a data base I forgot to remake after adding the page? I did
> make sure the ownership and permissions are the same as other pages in
> the directory. I also did a man on one of the other pages in that same
> directory and it came right up. Thank you.

>From man(1):

By default, man uses manpath(1) (which is built into the man binary)
to determine the path to search.  This option overrides the MANPATH
environment variable.

You can read manpath(1) for a full description of how things work (the
configuration file used is /etc/manpath.config), but be sure to read
man(1) in its entirety if you're going to get in the habit of writing
your own manpages.  More specifically, it describes the -w or -d options
you can use for debugging fun, and the sometimes useful -M option[1].

As a side note, if the manpage is for your own use, I'd suggest using
a hierarchy rooted in ~/man instead of /usr/local/man.  That can offer
numerous[2] benefits. 

--
1. On Linux systems where you've installed FreeBSD manpages to improve
   your chances of finding more useful information than what's typically
   provided in the horrible info pages.

2. Aside from portability, it's especially useful on Windows systems
   where Cygwin is installed, but you're writing manpages for Windows
   (where the documentation is even more sparse than what's found in
   info pages, and no less clumsy to use).

-- 
George

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: MIME attachments in mbox files

2009-05-30 Thread George Davidovich
On Fri, May 29, 2009 at 11:40:52PM -0400, Vince Sabio wrote:
> I have a need (well, I have lots of needs, but I'll try to stay
> focused here) 

Given the nature of most messages in the last few days, I'd suggest
you're trying too hard.  ;-)

> to be able to take a Windows zip file that is stored as a MIME
> attachment to an e-mail message in an Mbox-format spool file, and
> unzip the attachment. I actually need to script the process. In case
> it helps, I can dedicate a mailbox to the task. 
> 
> Anyone know of any FreeBSD utility(ies) that do(es) this?

Generally, when you're talking about processing an mbox and doing
something with message bodies, you're looking at formail plus procmail
in combination with a tool that can interpret the mime structure and
process the components (mimedefang, demine, stripmime, mimedecode,
reformime, renattach, etc.).  That's a roundabout way of saying, no,
there are no FreeBSD utilities to do what you want, but there's lots to
be found in ports.

I'd start with a quick read through of some of those manpages, but at
first glance, ripmime alone might do the trick:



> If necessary, I can write my own parser to strip out the attachment,
> in which case I'd need only a widget that can take in a MIME (base64)
> encoded zip file, convert it to binary, and unzip it.

In that case, and assuming you're using Perl, MIME::base64 and
IO::Uncompress::Unzip (or /usr/ports/archivers/unzip) is what you want.
Bonus points for writing a one-liner.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: USENET?

2009-03-09 Thread George Davidovich
On Mon, Mar 09, 2009 at 12:44:38PM +0100, cpghost wrote:
> On Mon, Mar 09, 2009 at 11:39:43AM +0100, Wojciech Puchar wrote:
> > > news/pan seems to work OK, if you want a GUI. But be aware that
> > > nowadays, you'll probably have to pay a monthly fee for usenet.
> > > ISPs don't seem to routinely offer it as part of the deal anymore
> > > like they used to.
> > 
> > at least in Poland there are free. and for my clients i have
> > nntpcache'd news from Gda?sk University.
> 
> Actually, in most parts of the world, news are still freely available
> with many ISPs (you may have to ask them explicitly), except for
> alt.binaries.* which are quite bandwidth intensive.
> 
> Your typical small ISP would rather save the bandwidth it takes to
> transfer all articles, esp. if only a fraction of them are accessed by
> their customers. It simply doesn't make sense for them to host
> binaries, unlike dedicated news providers which have enough customers
> to justify the expenses.

That's essentially correct, but it's worth noting that an ISP can
provide a news feed to their customers through one of the major news
providers.  It wasn't unusual not so long ago for dialup ISPs to offer a
full alt.binaries hierachy this way.

As for client suggestions, that typically depends on whether the person
is interested in text, binaries, or both.  Most clients are capable of
doing both, of course.  That's not to say that all do both equally well.
Right tool for the job and all that.

For text, I'd recommend slrn.  Gary is already using mutt, so I'd
suggest he go that route, or alternatively, try mutt's nntp patch and
use mutt instead.  Works perfectly well and it's what I use.  If reading
news is going to be a regular thing, then setting up a local server of
some sort (to pull down feeds from one or more providers) may be a
useful addition, though slrn does does provide a companion program to do
something similar.

Binary groups, on the other hand, are generally best handled by a GUI
client.  If you know what you're doing, command-line programs like nget,
nzbperl, etc. may be preferrable or useful additions.

The thing to keep in mind is that irrespective of what client one is
using, it's the quality of the feed that matters most.  At least for
non-casual use.  For a top notch feed, expect to pay out a few extra
bucks per month.  That typically gives you a host of other benefits that
would include a complete hierarchy, high retention levels, unrestricted
download speeds, web access, multiple connections, multiple servers,
NNTPS, HTTPs, Clarinet, and a direct line to customer support.

If you think you are or can get most of those for free (from your ISP,
for example), you haven't looked carefully enough.  Still, I think a
subscription to a pay provider is worth every cent, even for text
groups.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Battery powered, SBC that can run BSD

2009-03-05 Thread George Davidovich
On Thu, Mar 05, 2009 at 08:53:45AM -0500, John Almberg wrote:
> I'm looking for a small, single board computer that can run for a
> week or two on batteries (so very low power drain), topped up by
> solar cells when the sun is out, and that can run some sort of
> unix... preferably one of the BSDs. No hard drive, obviously, or any
> other power draining peripherals.
> 
> The user interface would be a low powered LCD display plus some
> buttons.
> 
> The application is for a custom measuring instrument that would run
> in a marine environment.

soekris.com

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Odd DNS requests

2009-02-28 Thread George Davidovich
On Sat, Feb 28, 2009 at 04:32:47PM +1100, Ian Smith wrote:
> Recently we've had a Mac notebook of some sort on our LAN, that likes
> to make these DNS queries from time to time, to no avail, as noticed
> on a filtering bridge between the LAN and the router+DNS at
> 192.168.0.1:
> 
> 16:13:05.020397 192.168.0.59.53207 > 192.168.0.1.53:  63162+ PTR? 
> b._dns-sd._udp.0.0.168.192.in-addr.arpa. (57) [tos 0x18]
> 16:13:05.021093 192.168.0.1.53 > 192.168.0.59.53207:  63162 NXDomain* 0/1/0 
> (128) (DF)
> 16:13:05.215790 192.168.0.59.64633 > 192.168.0.1.53:  61059+ PTR? 
> db._dns-sd._udp.0.0.168.192.in-addr.arpa. (58) [tos 0x18]
> 16:13:05.216469 192.168.0.1.53 > 192.168.0.59.64633:  61059 NXDomain* 0/1/0 
> (129) (DF)
> 16:13:05.226242 192.168.0.59.61635 > 192.168.0.1.53:  6749+ PTR? 
> r._dns-sd._udp.0.0.168.192.in-addr.arpa. (57) [tos 0x18]
> 16:13:05.226789 192.168.0.1.53 > 192.168.0.59.61635:  6749 NXDomain* 0/1/0 
> (128) (DF)
> 16:13:05.237319 192.168.0.59.56300 > 192.168.0.1.53:  21450+ PTR? 
> dr._dns-sd._udp.0.0.168.192.in-addr.arpa. (58) [tos 0x18]
> 16:13:05.237842 192.168.0.1.53 > 192.168.0.59.56300:  21450 NXDomain* 0/1/0 
> (129) (DF)
> 16:13:05.248440 192.168.0.59.60806 > 192.168.0.1.53:  10032+ PTR? 
> lb._dns-sd._udp.0.0.168.192.in-addr.arpa. (58) [tos 0x18]
> 16:13:05.249252 192.168.0.1.53 > 192.168.0.59.60806:  10032 NXDomain* 0/1/0 
> (129) (DF)
> 
> What exactly are these hoping to discover, and what needs turning off
> in the Mac's setup (OSX, most likely a recent version) to quell them?

DNS-Based Service Discovery:


Skip to the section titled: 

12. Discovery of Browsing and Registration Domains (Domain
Enumeration)'

when it gets boring.  There may be something more recent or more
authoritative, but that's what I have bookmarked.  

As for configuring the notebook, etc., perhaps someone else can chime
in.

-- 
George

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Blocking very many (tens of thousands) ip addresses in ipfw

2009-01-14 Thread George Davidovich
On Wed, Jan 14, 2009 at 08:30:53PM -0800, mojo fms wrote:
> On Wed, Jan 14, 2009 at 9:13 AM, Steve Bertrand 
> wrote:
> > Pieter de Goeje wrote:
> > > On Wednesday 14 January 2009 17:23:25 Artem Kuchin wrote:
> > > > I need to block around 15 ip addreses from acccess the server
> > > > at all at any port.  The addesses are random, they are not nets.
> > > > These are the spammer i want to block for 24 hours.  The list is
> > > > dynamically generated and regenerated every hour or so.  What is
> > > > the most efficient way to do it?  At first i thought doing ipfw
> > > > rules using 5 ips per rule, that would result in 3 rules! This
> > > > will be too slow!  I need to something really quick and smart.
> > > > Like matching the first number from ip (195 from 192.1.2.3), if it
> > > > does not match - skip, if it does - compare the next one and so
> > > > on.
> > > 
> > > Quoting ipfw(8):
> > > LOOKUP TABLES
> > >  Lookup tables are useful to handle large sparse address sets,
> > >  typically from a hundred to several thousands of entries.
> > >  There may be up to 128 different lookup tables, numbered 0 to
> > >  127.
> > > 
> > > net.inet.ip.fw.dyn_buckets should probably also be increased to
> > > efficiently handle 150k IPs.
> > 
> > Please correct me if I'm wrong, but if the OP is going to drop all
> > traffic immediately from the 150k IPs, then dyn_buckets shouldn't come
> > into play, as there is no dynamic rule generated.
> 
> Is this kind of thing doable with PF or really a ipfw thing more?

# pfctl -sm
stateshard limit1
src-nodes hard limit1
frags hard limit 5000
tableshard limit 1000
table-entries hard limit   20

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: FreeBSD Transition Questions.

2009-01-13 Thread George Davidovich
On Tue, Jan 13, 2009 at 07:47:38PM +0100, Roland Smith wrote:
> On Tue, Jan 13, 2009 at 12:54:24PM -0500, Grant Peel wrote:
>  
> > 2. I want to import my Oulook express folders to Thinderbird. I know
> > it can be done on windows, but when I try the impirt feature
> > (running Thunderbord on FreeBSD), there is no option to do this. Is
> > there a way?
> 
> The /usr/ports/mail/libpst port contains a tool called readpst which
> can convert them to e.g. mailbox (mbox) format. Thunderbird should be
> able to import mbox files.

Never used Outlook Express, but its file format, IIRC, is different than
that used by Outlook (.pst).

Either way, the best option would be to install Thunderbird on the
Windows machine and use Thunderbird there to import the OE mail.  The
resulting mbox file(s) can then be simply copied over to his FreeBSD
box.

A randomly-selected HowTo link:

http://doc.vic.computerbank.org.au/support/Getting%20mail%20from%20Outlook%20to%20Thunderbird/

Also, given that he's already using Thunderbird, I'd suggest the
following be done first:

http://www.mozilla.com/en-US/thunderbird/dictionaries.html

:-)

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: bash versus sh test builtin

2009-01-11 Thread George Davidovich
On Sun, Jan 11, 2009 at 08:08:18PM -0600, Jeffrey Goldberg wrote:
> The -ne operator for [ in /bin/sh doesn't seem to work as in bash.   
> Also the bash behavior here is what matches /bin/[ most closely.
> 
> $ /bin/sh
> $ if [ $UID -ne 0 ] ; then
>  > echo not root
>  > fi
> [: -ne: unexpected operator
> $ exit
> $ echo $SHELL
> /usr/local/bin/bash
> [jeff...@dobby ~/src/mount-rsnap]$ if [ $UID -ne 0 ] ; then
>  > echo not root
>  > fi
> not root
> 
> Does anyone have a recommendation of how to run this simple test in / 
> bin/sh 

if [ $(id -u) -ne 0 ]; then ...

As to why your test isn't working as expected, rewrite your script to
read:

#!/bin/sh
echo $UID

and you'll discover that UID is a bash environmental variable.

> and how to write tests reasonably portably?

That's a different question, and merits a much longer discussion
probably better had elsewhere.  I'd suggest comp.unix.shell.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: shell scripting problems

2008-11-29 Thread George Davidovich
On Fri, Nov 28, 2008 at 11:31:17PM -0700, Tim Judd wrote:
> On Fri, Nov 28, 2008 at 11:08 PM, Sahil Tandon <[EMAIL PROTECTED]>
> wrote:
> > Tim Judd <[EMAIL PROTECTED]> wrote:
> > 
> > I am not sure what the problem is, but are you just looking for the
> > output of "pkg_info -qxL" on the *first* instance of xorg-fonts-*?
> > 
> > % pkg_info -qL `pkg_info | grep xorg-fonts | head -1 | cut -d\  -f1`
> > 
> > FWIW, your regexp also looks faulty.
> 
> I'm sure it's faulty
> 
> Which is why I'm asking for help

What you were asking wasn't clear, and could have included a script
problem, a port update problem, a pkg_info problem, and/or a regex
problem.  And then, I'm scratching my head wondering how you're making
use of the output of the -L switch.

> My regexes (in it's various forms) produce the output similar to:
>   xorg-fonts-75dpi
>   xorg-fonts
>   xorg-fonts-100dpi
>   ...
> 
> and I'm wanting my regex to return the 2nd value, in this example, in
> this list.

If that's the case, where does your regex of "^$PKG-[0-9,._]+$" fit into
all this?  And why would you expect pkg_info to match on something like
'^xorg-fonts$' when, AFAICT, there is no port by that name?  Again,
you're not being clear. 

> The problem is the shell is taking the end anchor $ as the start of a
> variable, and no matter how I escape it, it seems to never work.

The end-of-line anchors work fine.  For the following I've used bash,
but you can copy the same into a /bin/sh script for identical results:

# PKG=cyrus

# pkg_info -Ex $PKG
cyrus-sasl-2.1.22_1
cyrus-sasl-saslauthd-2.1.22

# pkg_info -Ex $PKG.*1
cyrus-sasl-2.1.22_1
cyrus-sasl-saslauthd-2.1.22 

# pkg_info -Ex ^$PKG.*1\$
cyrus-sasl-2.1.22_1

I'd suggest you submit your script or an abbreviated version.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: inet hosts question

2008-11-14 Thread George Davidovich
On Fri, Nov 14, 2008, Matthew Seaman wrote:
> Vincent Hoffman wrote:
> > Gary Hartl wrote:
> 
> > > I thought I could do it by using the /class ie /32 for class c but
> > > i can't remember what the class delegation is for that size of
> > > pool, I think it is a class B.
> 
> > 192.168.0.0/16 for your example.  and yes this is a class B (not all
> > /16s are though.)
> >  
> > the /x notation is called CIDR (classless interdomain routing.)
> > http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
> 
> Class C surely?  192.168.0.0/16 is the RFC1918 Class C reserved
> range of 256 /24 networks.
> 
> Yes, Class B networks were /16s, but the A, B, C... classification is
> derived from the number of leading 1's in the binary representation of
> the first octet of the address, not the netmask.  Thus
> 
> Binary: Decimal:Class:  Used for:
> -
>   -- 0111   (0   - 127) Class A /8 Networks
> 1000  -- 1011   (128 - 191) Class B /16 Networks
> 1100  -- 1101   (192 - 223) Class C /24 Networks
> 1110  -- 1110   (224 - 239) Class D Multicast
>  0111 --    (240 - 255) Class E Reserved, experimental

As a suggestion to the OP, installing the ipcalc port might help make
things more understandable, or otherwise facilitate learning[1] about
networking generally. 

The output is optionally coloured, so the first three bits of the
Network address, for example, would appear in red to serve as a reminder
that an address beginning with 110 does indeed define it as a Class C
address.

% ipcalc 192.168.0.0
Address:   192.168.0.0  1100.10101000.. 
Netmask:   255.255.255.0 = 24   ... 
Wildcard:  0.0.0.255... 
=>
Network:   192.168.0.0/24   1100.10101000.. 
HostMin:   192.168.0.1  1100.10101000.. 0001
HostMax:   192.168.0.2541100.10101000.. 1110
Broadcast: 192.168.0.2551100.10101000.. 
Hosts/Net: 254   Class C, Private Internet

---
1.  Handy utilities in conjunction with a requisite amount of
laziness may be considered an adequate substitute.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: mail server DNS configuration questions

2008-09-06 Thread George Davidovich
On Sat, Sep 06, 2008 at 07:28:28PM -0600, Andrew Falanga wrote:
> 
> Well, my clients at church are still having issues and after working with 
> George, a respondant to my original questions, I think that most, if not all, 
> of my problems are related to DNS and how we've got it improperly configured.
> 
> First, a crude drawing of how our mail server exists in the world:
> 
> 192.168.2.x/24   72.24.23.252  "lot's of networks"
> Private Network <--> CableOne <--> Internet
> 
> Now, our mail server's IP is 192.168.2.23.  On the router, he (the person at 
> whose house the mail server is) has IP forwarding setup so that mail get's 
> sent to our FreeBSD machine.  Using dig, here's the responses:
> 
> (from my FBSD machine at home, not the server)
> [/usr/home/andy] -> dig +short -t MX whitneybaptist.org
> 10 mail.whitneybaptist.org.
> [/usr/home/andy] -> dig +short -t A whitneybaptist.org
> 72.24.34.252
> [/usr/home/andy] -> dig +short -x 72.24.34.252
> 34-252.72-24-cpe.cableone.net.
> 
> (from the church FBSD machine)
> [/home/afalanga] -> hostname
> whitbap
> [/home/afalanga] -> ifconfig fxp0
> fxp0: flags=8843 mtu 1500
> options=8
> inet 192.168.2.23 netmask 0xff00 broadcast 255.255.255.255
> ether 00:d0:b7:74:87:48
> media: Ethernet autoselect (100baseTX )
> status: active
> [/home/afalanga] -> cat /etc/resolv.conf
> search McCutchanLAN
> nameserver 192.168.2.1
> 
> It doesn't take a rocket scientist, or a computer scientist, to figure out 
> we've got DNS issues.  I'm thinking that I should setup a domain within the 
> 192.168.2.0/24 network on this box.  I've done this before, at work.  The 
> question I've got is I've never actually integrated a domain like this to a 
> domain on the Internet.  I'm thinking that we'll setup something like: 
> internal.whitneybaptist.org with hosts in that sub-domain.
> 
> So, what would my DNS tables need to look like to make this happen.  Also, to 
> any knowledgable souls here, what RFCs address these issues?

Hello again, Andy.
 
What you're asking is actually a FAQ, but I'll spell things out anyway.
The following excerpt from RFC 1918 is most relevant:

If an enterprise uses the private address space, or a mix of
private and public address spaces, then DNS clients outside of
the enterprise should not see addresses in the private address
space used by the enterprise, since these addresses would be
ambiguous.  One way to ensure this is to run two authority
servers for each DNS zone containing both publically and
privately addressed hosts.  One server would be visible from the
public address space and would contain only the subset of the
enterprise's addresses which were reachable using public
addresses.  The other server would be reachable only from the
private network and would contain the full set of data,
including the private addresses and whatever public addresses
are reachable the private network.  In order to ensure
consistency, both servers should be configured from the same
data of which the publically visible zone only contains a
filtered version. There is certain degree of additional
complexity associated with providing these capabilities.

That's a roundabout way of saying you can't "mix and match" private
non-routable addresses with public addresses in the same namespace.

Note the "authoritative" part.  Until CableOne delegates your assigned
netblock to your organisation, your public DNS server will not be
authoritative (it currently isn't!) for 72.24.34.252.  You can reference
RFC 2317 (classless in-addr.arpa delegation) for how that works.  As to
why you must be authoritative, I've already pointed out off-list how Bad
Things can happen when you're not, especially in regards to email where
reverse lookups are integral to How Things Work.

As for other RFCs, I'd suggest instead starting with a careful reading
of the Bind ARM at http://www.isc.org/sw/bind/, followed by a once-over
of the Bind FAQ, and possibly the FreeBSD-supplied configuration files.
To save you some time, the following abbreviated context-specific
examples should explain things more clearly and get you started:

Example 1:  Two domains and two separate (sets of) name servers:

On the ns.whitneybaptist.org machine:

zone "whitneybaptist.org" {
type master;
file "master/whitneybaptist.org";
};
zone "252.34.24.72.in-addr.arpa" {
type master;
file "master/db.72.24.34.252";
};

On the ns.internal.whitneybaptist.org machine:

zone "internal.whitneybaptist.org" {
type master;
file "master/internal.whitneybaptist.org";
};
zone "1.168.1

Re: MTA advice ??

2008-08-24 Thread George Davidovich
On Sun, Aug 24, 2008 at 02:06:25PM -0400, pete wrote:
> I have a hosted domain that recently changed their mail filtering. I
> am not happy with the new setup and am considering setting up my own.
> Looking for tips on setting up something on my freeBSD 6.1 box.
> 
> My ISP is cablevision IO. Not sure what they allow, ie: whether I can
> have my hosted domain set to use my cable IP as a MTA, or if I have to
> do some kind of end run around cablevision to get a MTA set up
> locally.

Here are the pre-requisites:

- You must have a solid understanding of SMTP, DNS, etc.
- You must have one or more fixed IP addresses.
- Your ISP must be willing and agree to delegate your IP
  address(es) to you or to whomever is going to handle the DNS
  for your domain.  A call to your ISP's DNS provisioning
  department may typically be all that's required.
- DNS must be set up correctly.
- Your email server must be set up correctly.
- Your own network must be secured. 
- Your DNS and email servers must be available 24-7/365.

If all the above can't be met, you have no business sending or receiving
email.  If you want to try and PASS GO and collect the $200 by skipping
one or more of the pre-requisites (common enough, it seems), prepare
yourself for some heartache, and be aware that you're likely to cause or
participate in grief for others.

Put simply, email is one of the more complex and challenging things you
can do.  If you don't have the knowledge or technical expertise, but
feel confident you can master the fundamentals and progress from there,
be prepared to spend the next month or two or three slogging through
reading RFCs to do so.  If you do, know that your work has just begun,
and the hard part is just around the corner. ;-)

> Also looking for advice on which software would serve me bet in this
> instance.

I'd suggest setting up an internal test network and deciding for
yourself.  For example, setting up a number of FreeBSD jails, each with
its own running installation of sendmail, postfix, qmail, etc. would be
a good approach, and may more useful than relying on the opinions or
recommendations of others. 

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Tailing logs

2008-08-23 Thread George Davidovich
On Sat, Aug 23, 2008 at 11:07:59AM -0400, Chuck Robey wrote:
> DAve wrote:
> > DAve wrote:
  
> I do this commonly to catch the lines with the  word "Building" in them,
> from a file "build.out:
> 
> tail -F build.out | grep --color=always Building
> 
> When I get a free moment, I need to see about making that --color-always
> the default.

Grep provides for a number of environmental variables, the above being
one of them.  For example:

export GREP_COLOR='0;32'
export GREP_OPTIONS='--color=auto'

Perfectly acceptable for regular use, but especially useful to test
pattern matching before finalising that script you're working on.

-- 
George
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"