Re: List Spam Filtering

2013-05-16 Thread Erich Dollansky
Hi,

On Thu, 16 May 2013 23:05:33 +0100
Bruce Cran  wrote:

> On 11/05/2013 02:34, Julian H. Stacey wrote:
> > Good question. I don't know why. I wish all were, it would keep
> > spam out.
> 
> There have been some discussions about this in the past. 
> freebsd-questions doesn't require subscribing to avoid people who may
> be unfamiliar with mailing lists being put off posting to it.
> 

we running in a circle here.

I noticed that on other FreeBSD lists, a moderator enables later mails
which are sent from an unregistered address. Why can't this be done
here?

Get a group of volunteers in different time zones to handle this and
off we go.

Of course, I could be one of them in the Eastern World.

Erich
___
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: List Spam Filtering

2013-05-16 Thread Julian H. Stacey
Bruce Cran wrote:
> On 11/05/2013 02:34, Julian H. Stacey wrote:
> > Good question. I don't know why. I wish all were, it would keep spam out.
> 
> There have been some discussions about this in the past. 
> freebsd-questions doesn't require subscribing to avoid people who may be 
> unfamiliar with mailing lists being put off posting to it.

That burdens FreeBSD lists with clueless, lazy non subscribers, & spammers.

Web forums exist for those too lame to subscribe & forums can have Captcha.

Cheers,
Julian
-- 
Julian Stacey, BSD Unix Linux C Sys Eng Consultant, Munich http://berklix.com
 Reply below not above, like a play script.  Indent old text with "> ".
 Send plain text.  No quoted-printable, HTML, base64, multipart/alternative.
___
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: List Spam Filtering

2013-05-16 Thread Bruce Cran

On 11/05/2013 02:34, Julian H. Stacey wrote:

Good question. I don't know why. I wish all were, it would keep spam out.


There have been some discussions about this in the past. 
freebsd-questions doesn't require subscribing to avoid people who may be 
unfamiliar with mailing lists being put off posting to it.


--
Bruce Cran
___
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: check variable content size in sh script

2013-05-16 Thread Teske, Devin

On May 16, 2013, at 9:27 AM, Teske, Devin wrote:


On May 16, 2013, at 9:06 AM, Teske, Devin wrote:


On May 16, 2013, at 8:28 AM, Tim Daneliuk wrote:

On 05/16/2013 10:08 AM, Joe wrote:
Hello

Have script that has max size on content in a variable.
How to code size less than 51 characters?


FOO="Some string you want to check length of"
FOOLEN=`echo $FOO | wc | awk '{print $3}'`


Uh, without forking to 2 separate programs…

FOOLEN=${#FOO}


You can then use $FOOLEN in a conditional.



However, if the OP wanted to actually truncate $FOO to 51 characters:


NEWFOO=$( echo "$FOO" | awk -v max=51 '{print substr($0,0,max)}' )


However, if you want to handle the case of $FOO containing newlines (and you 
want the newline to count toward the max), then this instead would do the trick:


NEWFOO=$( echo "$FOO" | awk -v max=51 '
{
len = length($0)
max -= len
print substr($0,0,(max > 0 ? len : max + len))
if ( max < 0 ) exit
max--
}' )


For fun, I decided to expand on the solution I provided immediately above… 
turning it into a function that you might be a little more familiar with:

snprintf()
{
   local __var_to_set="$1" __size="$2"
   shift 2 # var_to_set/size
   eval "$__var_to_set"=\$\( printf \"\$@\" \| awk -v max=\"\$__size\" \''
   {
   len = length($0)
   max -= len
   print substr($0,0,(max > 0 ? len : max + len))
   if ( max < 0 ) exit
   max--
   }'\' \)
}

Example usage:

FOO=$( printf "abc\n123\n" )
snprintf NEWFOO 6 "%s" "$FOO"
echo "NEWFOO=[$NEWFOO] len=[${#NEWFOO}]"

Produces:

NEWFOO=[abc
12] len=[6]

Hopefully this should help some folks.

I figured I'd help as many folks as I can…

http://svnweb.freebsd.org/base?view=revision&revision=250701

Added it to my string processing library. Lots of other useful functions in 
there.
--
Cheers,
Devin




$NEWFOO, even if multi-line, will be limited to 51-bytes (adjust max=51 
accordingly for other desired-lengths). Newlines are preserved.

Last, but not least, if you want to be able to handle multi-line values but 
only want to return the first line up-to N bytes (using 51 as the OP used):


NEWFOO=$( echo "$FOO" | awk -v max=51 '{ print substr($0,0,max); exit }' )


If $FOO had multiple lines, $NEWFOO will have only the first line (and it will 
be truncated to 51 bytes or less).
--
Devin

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
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: check variable content size in sh script

2013-05-16 Thread Teske, Devin

On May 16, 2013, at 9:06 AM, Teske, Devin wrote:

> 
> On May 16, 2013, at 8:28 AM, Tim Daneliuk wrote:
> 
>> On 05/16/2013 10:08 AM, Joe wrote:
>>> Hello
>>> 
>>> Have script that has max size on content in a variable.
>>> How to code size less than 51 characters?
>>> 
>> 
>> FOO="Some string you want to check length of"
>> FOOLEN=`echo $FOO | wc | awk '{print $3}'`
>> 
> 
> Uh, without forking to 2 separate programs…
> 
> FOOLEN=${#FOO}
> 
> 
>> You can then use $FOOLEN in a conditional.
>> 
> 
> 
> However, if the OP wanted to actually truncate $FOO to 51 characters:
> 
> 
> NEWFOO=$( echo "$FOO" | awk -v max=51 '{print substr($0,0,max)}' )
> 
> 
> However, if you want to handle the case of $FOO containing newlines (and you 
> want the newline to count toward the max), then this instead would do the 
> trick:
> 
> 
> NEWFOO=$( echo "$FOO" | awk -v max=51 '
>   {
>   len = length($0)
>   max -= len
>   print substr($0,0,(max > 0 ? len : max + len))
>   if ( max < 0 ) exit
>   max--
>   }' )
> 

For fun, I decided to expand on the solution I provided immediately above… 
turning it into a function that you might be a little more familiar with:

snprintf()
{
local __var_to_set="$1" __size="$2"
shift 2 # var_to_set/size
eval "$__var_to_set"=\$\( printf \"\$@\" \| awk -v max=\"\$__size\" \''
{
len = length($0)
max -= len
print substr($0,0,(max > 0 ? len : max + len))
if ( max < 0 ) exit
max--
}'\' \)
}

Example usage:

FOO=$( printf "abc\n123\n" )
snprintf NEWFOO 6 "%s" "$FOO"
echo "NEWFOO=[$NEWFOO] len=[${#NEWFOO}]"

Produces:

NEWFOO=[abc
12] len=[6]

Hopefully this should help some folks.
-- 
Devin



> 
> $NEWFOO, even if multi-line, will be limited to 51-bytes (adjust max=51 
> accordingly for other desired-lengths). Newlines are preserved.
> 
> Last, but not least, if you want to be able to handle multi-line values but 
> only want to return the first line up-to N bytes (using 51 as the OP used):
> 
> 
> NEWFOO=$( echo "$FOO" | awk -v max=51 '{ print substr($0,0,max); exit }' )
> 
> 
> If $FOO had multiple lines, $NEWFOO will have only the first line (and it 
> will be truncated to 51 bytes or less).
> -- 
> Devin

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
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: check variable content size in sh script

2013-05-16 Thread Tim Daneliuk

On 05/16/2013 10:45 AM, Dan Nelson wrote:

In the last episode (May 16), Tim Daneliuk said:

On 05/16/2013 10:08 AM, Joe wrote:

Hello

Have script that has max size on content in a variable.
How to code size less than 51 characters?



FOO="Some string you want to check length of"
FOOLEN=`echo $FOO | wc | awk '{print $3}'`

You can then use $FOOLEN in a conditional.


Much better way:

FOO="Some string you want to check length of"
FOOLEN=${#FOO}




D'Oh, you're right ... what was I thinking ...



--

Tim Daneliuk tun...@tundraware.com
PGP Key: http://www.tundraware.com/PGP/

___
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: check variable content size in sh script

2013-05-16 Thread Teske, Devin

On May 16, 2013, at 8:28 AM, Tim Daneliuk wrote:

> On 05/16/2013 10:08 AM, Joe wrote:
>> Hello
>> 
>> Have script that has max size on content in a variable.
>> How to code size less than 51 characters?
>> 
> 
> FOO="Some string you want to check length of"
> FOOLEN=`echo $FOO | wc | awk '{print $3}'`
> 

Uh, without forking to 2 separate programs…

FOOLEN=${#FOO}


> You can then use $FOOLEN in a conditional.
> 


However, if the OP wanted to actually truncate $FOO to 51 characters:


NEWFOO=$( echo "$FOO" | awk -v max=51 '{print substr($0,0,max)}' )


However, if you want to handle the case of $FOO containing newlines (and you 
want the newline to count toward the max), then this instead would do the trick:


NEWFOO=$( echo "$FOO" | awk -v max=51 '
{
len = length($0)
max -= len
print substr($0,0,(max > 0 ? len : max + len))
if ( max < 0 ) exit
max--
}' )


$NEWFOO, even if multi-line, will be limited to 51-bytes (adjust max=51 
accordingly for other desired-lengths). Newlines are preserved.

Last, but not least, if you want to be able to handle multi-line values but 
only want to return the first line up-to N bytes (using 51 as the OP used):


NEWFOO=$( echo "$FOO" | awk -v max=51 '{ print substr($0,0,max); exit }' )


If $FOO had multiple lines, $NEWFOO will have only the first line (and it will 
be truncated to 51 bytes or less).
-- 
Devin

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
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: check variable content size in sh script

2013-05-16 Thread markham breitbach
something like this:

#!/bin/sh
if [ $# -lt 1 ] ; then
echo "put a nickel in the slot, pal!"
exit 1;
fi
NUMCHARS=`echo $1 | wc -m`
if [ $NUMCHARS -lt 51 ] ; then
echo "You input "$NUMCHARS" characters."
exit 0
else
echo "whoa sailor I can't take all that!"
exit 1
fi


On 13-05-16 9:08 AM, Joe wrote:
> Hello
>
> Have script that has max size on content in a variable.
> How to code size less than 51 characters?
>
> Thanks
> ___
> 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"

___
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: check variable content size in sh script

2013-05-16 Thread Dan Nelson
In the last episode (May 16), Tim Daneliuk said:
> On 05/16/2013 10:08 AM, Joe wrote:
> > Hello
> >
> > Have script that has max size on content in a variable.
> > How to code size less than 51 characters?
> >
> 
> FOO="Some string you want to check length of"
> FOOLEN=`echo $FOO | wc | awk '{print $3}'`
> 
> You can then use $FOOLEN in a conditional.

Much better way:

FOO="Some string you want to check length of"
FOOLEN=${#FOO}

-- 
Dan Nelson
dnel...@allantgroup.com
___
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: check variable content size in sh script

2013-05-16 Thread Tim Daneliuk

On 05/16/2013 10:08 AM, Joe wrote:

Hello

Have script that has max size on content in a variable.
How to code size less than 51 characters?



FOO="Some string you want to check length of"
FOOLEN=`echo $FOO | wc | awk '{print $3}'`

You can then use $FOOLEN in a conditional.




--

Tim Daneliuk tun...@tundraware.com
PGP Key: http://www.tundraware.com/PGP/

___
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"


check variable content size in sh script

2013-05-16 Thread Joe

Hello

Have script that has max size on content in a variable.
How to code size less than 51 characters?

Thanks
___
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"


Errors building vortex port

2013-05-16 Thread C. L. Martinez
Hi all,

 I am trying to build vortex port using poudriere in a FreeBSD 9.1
amd64 host, but it fails:

===
===>   Returning to build of vortex-2.9.0.59
===>   vortex-2.9.0.59 depends on file: /usr/local/bin/libnet11-config
- not found
===>Verifying install for /usr/local/bin/libnet11-config in
/usr/ports/net/libnet
===>   Installing existing package
/usr/ports/packages/All/libnet11-1.1.6_1,1.txz
Installing libnet11-1.1.6_1,1... done
===>   Returning to build of vortex-2.9.0.59
===>   vortex-2.9.0.59 depends on shared library: glib-2.0 - found
===>   vortex-2.9.0.59 depends on shared library: pcre - found
===
===>  Cleaning for vortex-2.9.0.59
=
===
=
===>  License GPLv2 accepted by the user
===>   vortex-2.9.0.59 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by vortex-2.9.0.59 for building
===
=
===>  License GPLv2 accepted by the user
===>   vortex-2.9.0.59 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by vortex-2.9.0.59 for building
=> SHA256 Checksum OK for vortex-2.9.0-59.tgz.
===
=
===>  License GPLv2 accepted by the user
===>   vortex-2.9.0.59 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by vortex-2.9.0.59 for building
===>  Extracting for vortex-2.9.0.59
=> SHA256 Checksum OK for vortex-2.9.0-59.tgz.
===
=
===>  Patching for vortex-2.9.0.59
===>  Applying FreeBSD patches for vortex-2.9.0.59
===
=
===>   vortex-2.9.0.59 depends on file: /usr/local/lib/libnids.a - found
===>   vortex-2.9.0.59 depends on file: /usr/local/bin/libnet11-config - found
===>   vortex-2.9.0.59 depends on shared library: glib-2.0 - found
===>   vortex-2.9.0.59 depends on shared library: pcre - found
===>  Configuring for vortex-2.9.0.59
===
=
===>  Building for vortex-2.9.0.59
cd /wrkdirs/usr/ports/net/vortex/work/vortex-2.9.0 && cc -c vortex.c
-I/usr/local/include
cd /wrkdirs/usr/ports/net/vortex/work/vortex-2.9.0 && cc -o vortex
vortex.o -L/usr/local/lib /usr/local/lib/libnids.a
`/usr/local/bin/libnet11-config --libs` -lgthread-2.0 -lpcap
/usr/local/lib/libnids.a(killtcp.o): In function `raw_init':
killtcp.c:(.text+0xa): undefined reference to `libnet_open_raw_sock'
/usr/local/lib/libnids.a(killtcp.o): In function `nids_killtcp_seq':
killtcp.c:(.text+0xc7): undefined reference to `libnet_build_ip'
killtcp.c:(.text+0x14d): undefined reference to `libnet_write_ip'
killtcp.c:(.text+0x18f): undefined reference to `libnet_build_ip'
killtcp.c:(.text+0x20f): undefined reference to `libnet_write_ip'
*** [do-build] Error code 1

Stop in /usr/ports/net/vortex.
===>  Cleaning for vortex-2.9.0.59
build of /usr/ports/net/vortex ended at Thu May 16 14:28:07 UTC 2013

How can I fix this??
___
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: Hot Swapping SATA drive?

2013-05-16 Thread Robert Huff

Warren Block writes:
>  > I don't there there is any difference between SATA and eSATA above the
>  > physical layer. I'm not sure what that setting would do.
>  
>  At a guess, it could connect one of the internal SATA ports to
>  the eSATA connector.

That's the way mine works; on the other hand, it's specially
marked internal connector.


Robert Huff


___
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: Hot Swapping SATA drive?

2013-05-16 Thread Warren Block

On Tue, 14 May 2013, RW wrote:


On Tue, 14 May 2013 07:45:21 -0400
Robert Huff wrote:



Ronald F. Guilmette writes:


 3) Assuming that I want to do this stuff, what BIOS options
 should I be setting or unsetting on the motherboard?


I am unable to check the BIOS settings on that MB (which may
be ASrock as well), but I don't believe I had to do anything other
hand make sure eSATA was enabled.


I don't there there is any difference between SATA and eSATA above the
physical layer. I'm not sure what that setting would do.


At a guess, it could connect one of the internal SATA ports to the eSATA 
connector.

___
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"


[PKGNG] i386-wine-1.5.30

2013-05-16 Thread David Naylor
Hi,

Pkgng packages are available for i386-wine-1.5.30 [1] at local-distfiles [2].  
Currently packages are available for FreeBSD 8 and 9 [3][4].  For previous 
version of i386-wine replace 'latest' with the version number.  

To install the port try one of the following options:

 - Method 1 (Quick and easy)
For FreeBSD 8 (as root)
# pkg add http://alturl.com/4smzi
For FreeBSD 9 (as root)
# pkg add http://alturl.com/tn8mv

 - Method 2 (Repo)
This method will only be fully supported with pkgng v1.1.  
1) Set `PKG_MULTIREPOS' to `YES' in ${LOCALBASE}/etc/pkg.conf
2) Add repo `wine-devel' with URL [2] to ${LOCALBASE}/etc/pkg.conf
3) Install (as root):
# pkg install -r wine-devel i386-wine
or upgrade (as root):
# pkg upgrade -r wine-devel

Regards

David

P.S. I'll be available on Saturday to address any issues / questions.  

[1] See the wiki for more details: http://wiki.FreeBSD.org/i386-Wine (WIP)
[2] See your local FreeBSD mirror under ports/local-distfiles/dbn/i386-wine-
devel/${ABI}/latest where ABI=freebsd:X:x86:64 for X in {8, 9}.  
[3] Packages are built from FreeBSD 8.3 and 9.1 respectively.  
[4] Packaging for FreeBSD 10 will be resumed in due course.  


signature.asc
Description: This is a digitally signed message part.