problem with shell script
Hello I'm in trouble with a simple shell script that give erroneous value when running ... If I run commands interactively everything runs well ps ax | grep slapd | grep -v grep | wc -l 1 If I run in the following shell script : #!/bin/sh SD=0 SD=`ps -ax | grep slapd | grep -v grep | wc -l` echo $SD the result is 3 !!! Any info welcome ! ___ 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: Which php??
Lots of warnings:: Deprecated: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0 Deprecated: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0 PHP 5.3.5 with Suhosin-Patch (cli) (built: Jan 11 2011 12:31:01) (DEBUG) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies This is kinda good, at least its installed ! To turn off deprecated notices in looging: edit /usr/local/etc/php.ini ( approx line 523) error_reporting = E_ALL ~E_DEPRECATED Make php log errors: ( line approx 646) error_log = /var/log/php_errors.log then try php -v from shell, ___ 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: Which php??
On 11/01/2011 16:46, Gary Kline wrote: So:: are there other ways of installing this stuff? Should I cp -rp this wordpress directory in [e.g.] /usr/local/www/journey? Thanks for any clues, gary It looks like you have a workign apache2 already. *For PHP *cd /usr/ports/lang/php5 make config ( choose apache module) make install clean *PHP5 Extensions *(lots to choose from but make sure you have mysql at least selected ( you'll need this installed obv for wordpress too ) cd /usr/ports/lang/php5-extensions make config make install clean in your apache httpd.conf in the AddType section add AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps In the DirectoryIndex section (or on a new line after it) Add this line DirectoryIndex index.php index.html index.htm *Checks *On shell do php-v on a webpage in your webroot (e.g test.php) add this php code ?php phpinfo(); ? http://localhost/test.php If that shows you a nice php page then you should be good to go with the wordpress installer Good luck! Paul. -- - Paul Macdonald IFDNRG Ltd Web and video hosting - t: 0131 5548070 m: 07534206249 e: p...@ifdnrg.com w: http://www.ifdnrg.com - IFDNRG 40 Maritime Street Edinburgh EH6 6SA - ___ 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
protect a single interface with IPFW ?
Hello is it possible to protect a single interface with IPFW my server has only one interface and I want to allow only SSH LDAP LDAPS thanks for any examples ___ 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: protect a single interface with IPFW ?
On 12 January 2011 14:47, Frank Bonnet f.bon...@esiee.fr wrote: Hello is it possible to protect a single interface with IPFW my server has only one interface and I want to allow only SSH LDAP LDAPS thanks for any examples ___ 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 something likes this add pass all from any to any via lo0 add pass tcp from w.x.y.z to any 22 in via $int keep-state add pass tcp from w.x.y.z to any 389 in via $int keep-state add deny ip from any to any or for pf (better in my opinion) table sshhosts const { hosta, hostb, ... } table ldaphosts const { hosta, hostb, ... } set skip on lo0 block any from any pass in quick proto tcp from sshhosts to any port ssh synproxy state pass in quick proto tcp from ldaphosts to any port ldap synproxy state ___ 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: protect a single interface with IPFW ?
On 12 January 2011 15:01, krad kra...@gmail.com wrote: On 12 January 2011 14:47, Frank Bonnet f.bon...@esiee.fr wrote: Hello is it possible to protect a single interface with IPFW my server has only one interface and I want to allow only SSH LDAP LDAPS thanks for any examples ___ 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 something likes this add pass all from any to any via lo0 add pass tcp from w.x.y.z to any 22 in via $int keep-state add pass tcp from w.x.y.z to any 389 in via $int keep-state add deny ip from any to any or for pf (better in my opinion) table sshhosts const { hosta, hostb, ... } table ldaphosts const { hosta, hostb, ... } set skip on lo0 block any from any pass in quick proto tcp from sshhosts to any port ssh synproxy state pass in quick proto tcp from ldaphosts to any port ldap synproxy state whops forgot the all important lines. Without these you box itself cant intiate connections to the outside world ipfw add before the deny add pass all from any to any out via $int keep-state and for pf, add at the end pass out from any to any keep state ___ 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: protect a single interface with IPFW ?
Thanks a lot ! On 01/12/2011 04:03 PM, krad wrote: On 12 January 2011 15:01, kradkra...@gmail.com wrote: On 12 January 2011 14:47, Frank Bonnetf.bon...@esiee.fr wrote: Hello is it possible to protect a single interface with IPFW my server has only one interface and I want to allow only SSH LDAP LDAPS thanks for any examples ___ 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 something likes this add pass all from any to any via lo0 add pass tcp from w.x.y.z to any 22 in via $int keep-state add pass tcp from w.x.y.z to any 389 in via $int keep-state add deny ip from any to any or for pf (better in my opinion) tablesshhosts const { hosta, hostb, ... } tableldaphosts const { hosta, hostb, ... } set skip on lo0 block any from any pass in quick proto tcp fromsshhosts to any port ssh synproxy state pass in quick proto tcp fromldaphosts to any port ldap synproxy state whops forgot the all important lines. Without these you box itself cant intiate connections to the outside world ipfw add before the deny add pass all from any to any out via $int keep-state and for pf, add at the end pass out from any to any keep state ___ 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 -- Frank BONNET 01.45.92.66.17 Service des Moyens Informatique Generaux ESIEE PARIS Cité Descartes / BP 99 93162 NOISY-LE-GRAND Cedex http://www.esiee.fr http://www.esiee.fr/ ___ 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: problem with shell script
On Wed, Jan 12, 2011 at 9:01 AM, Frank Bonnet f.bon...@esiee.fr wrote: Hello I'm in trouble with a simple shell script that give erroneous value when running ... If I run commands interactively everything runs well ps ax | grep slapd | grep -v grep | wc -l 1 If I run in the following shell script : #!/bin/sh SD=0 SD=`ps -ax | grep slapd | grep -v grep | wc -l` echo $SD the result is 3 !!! Any info welcome ! What's the name of your script? Hope it's not slapd_check.sh that will cause and extra count in the ps, cus it will count itself. Chad ___ 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 -- A grasshopper walks into a bar and the bartender says Hey, we have a drink named after you. And the grasshopper says Really, You have a drink named Murray? ___ 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: problem with shell script
On Wed, Jan 12, 2011 at 3:50 PM, Chad Kellerman sunck...@gmail.com wrote: On Wed, Jan 12, 2011 at 9:01 AM, Frank Bonnet f.bon...@esiee.fr wrote: Hello I'm in trouble with a simple shell script that give erroneous value when running ... If I run commands interactively everything runs well ps ax | grep slapd | grep -v grep | wc -l 1 If I run in the following shell script : #!/bin/sh SD=0 SD=`ps -ax | grep slapd | grep -v grep | wc -l` echo $SD the result is 3 !!! ps ax | grep [/]slapd | wc -l may not fix the problem but still cleaner Any info welcome ! What's the name of your script? Hope it's not slapd_check.sh that will cause and extra count in the ps, cus it will count itself. Chad ___ 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 -- A grasshopper walks into a bar and the bartender says Hey, we have a drink named after you. And the grasshopper says Really, You have a drink named Murray? ___ 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 -- Samuel Martín Moro {EPITECH.} 2011 CamTrace S.A.S Nobody wants to say how this works. Maybe nobody knows ... Xorg.conf(5) ___ 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: problem with shell script
On Wed, Jan 12, 2011 at 4:34 PM, Samuel Martín Moro faus...@gmail.comwrote: On Wed, Jan 12, 2011 at 3:50 PM, Chad Kellerman sunck...@gmail.comwrote: On Wed, Jan 12, 2011 at 9:01 AM, Frank Bonnet f.bon...@esiee.fr wrote: Hello I'm in trouble with a simple shell script that give erroneous value when running ... If I run commands interactively everything runs well ps ax | grep slapd | grep -v grep | wc -l 1 If I run in the following shell script : #!/bin/sh SD=0 SD=`ps -ax | grep slapd | grep -v grep | wc -l` echo $SD the result is 3 !!! ps ax | grep [/]slapd | wc -l ps ax | awk '/[/]slapd /{n++} END{print n}' sorry... may not fix the problem but still cleaner Any info welcome ! What's the name of your script? Hope it's not slapd_check.sh that will cause and extra count in the ps, cus it will count itself. Chad ___ 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 -- A grasshopper walks into a bar and the bartender says Hey, we have a drink named after you. And the grasshopper says Really, You have a drink named Murray? ___ 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 -- Samuel Martín Moro {EPITECH.} 2011 CamTrace S.A.S Nobody wants to say how this works. Maybe nobody knows ... Xorg.conf(5) -- Samuel Martín Moro {EPITECH.} 2011 CamTrace S.A.S Nobody wants to say how this works. Maybe nobody knows ... Xorg.conf(5) ___ 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: problem with shell script
On Jan 12, 2011, at 10:43 AM, Samuel Martín Moro wrote: On W If I run in the following shell script : #!/bin/sh SD=0 SD=`ps -ax | grep slapd | grep -v grep | wc -l` echo $SD the result is 3 !!! ps ax | grep [/]slapd | wc -l ps ax | awk '/[/]slapd /{n++} END{print n}' sorry... may not fix the problem but still cleaner ps ax | grep [s]lapd | wc -l The [] creates a one-character class that doesn't match the regex. Easier to type and grep should be a bit faster. ___ 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: problem with shell script
On Wed, 12 Jan 2011, Samuel Mart?n Moro wrote: On Wed, Jan 12, 2011 at 3:50 PM, Chad Kellerman sunck...@gmail.com wrote: On Wed, Jan 12, 2011 at 9:01 AM, Frank Bonnet f.bon...@esiee.fr wrote: I'm in trouble with a simple shell script that give erroneous value when running ... If I run commands interactively everything runs well ps ax | grep slapd | grep -v grep | wc -l 1 If I run in the following shell script : #!/bin/sh SD=0 SD=`ps -ax | grep slapd | grep -v grep | wc -l` echo $SD the result is 3 !!! ps ax | grep [/]slapd | wc -l may not fix the problem but still cleaner ps axc | grep slapd | wc -l is a little neater. ___ 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
Simple command to reset / clear all logs?
Hi, Is there a simple command to reset / clear everything in my /var/log? I've done a lot of testing, configuring, trial and error and most of my logs are just full of bullshit and I'd like a fresh start :-) 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
Re: problem with shell script
Quoth Frank Bonnet on Wednesday, 12 January 2011: Hello I'm in trouble with a simple shell script that give erroneous value when running ... If I run commands interactively everything runs well ps ax | grep slapd | grep -v grep | wc -l 1 If I run in the following shell script : #!/bin/sh SD=0 SD=`ps -ax | grep slapd | grep -v grep | wc -l` echo $SD the result is 3 !!! Any info welcome ! ___ 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 Ever hear of pgrep(1)? -- Sterling (Chip) Camden| sterl...@camdensoftware.com | 2048D/3A978E4F http://camdensoftware.com | http://chipsquips.com | http://chipstips.com pgpzsxgMvlyzm.pgp Description: PGP signature
Re: problem with shell script
(2011/01/13 01:00), Warren Block wrote: On Wed, 12 Jan 2011, Samuel Mart?n Moro wrote: On Wed, Jan 12, 2011 at 3:50 PM, Chad Kellerman sunck...@gmail.com wrote: On Wed, Jan 12, 2011 at 9:01 AM, Frank Bonnet f.bon...@esiee.fr wrote: I'm in trouble with a simple shell script that give erroneous value when running ... If I run commands interactively everything runs well ps ax | grep slapd | grep -v grep | wc -l 1 If I run in the following shell script : #!/bin/sh SD=0 SD=`ps -ax | grep slapd | grep -v grep | wc -l` echo $SD the result is 3 !!! ps ax | grep [/]slapd | wc -l may not fix the problem but still cleaner ps axc | grep slapd | wc -l is a little neater. ___ 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 hello. i would rather use pgrep(1); pgrep -afl slapd for just counting purpose, pgrep -a slapd | wc -l is enough. i believe it should work all right as expected in `` output, as well. ___ 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: problem with shell script
(2011/01/12 23:01), Frank Bonnet wrote: Hello I'm in trouble with a simple shell script that give erroneous value when running ... If I run commands interactively everything runs well ps ax | grep slapd | grep -v grep | wc -l 1 If I run in the following shell script : #!/bin/sh SD=0 SD=`ps -ax | grep slapd | grep -v grep | wc -l` echo $SD the result is 3 !!! Any info welcome ! ___ 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 hello. i would rather use pgrep(1); pgrep -afl slapd for just counting purpose, pgrep -a slapd | wc -l is enough. it should work as expected in `` output. ___ 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: Simple command to reset / clear all logs?
Hello, It might be all right to remove all normal file logs, though you may want to retain all subdirectories. find /var/log -type f -exec rm {} \; may do. # sorry. I wouldn't do that rough and not tested. # Basically, those are just incremental logs, whose # lines are mostly not referred by running system. (2011/01/13 01:04), Redd Vinylene wrote: Hi, Is there a simple command to reset / clear everything in my /var/log? I've done a lot of testing, configuring, trial and error and most of my logs are just full of bullshit and I'd like a fresh start :-) 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
which php5-extensions?
tia, folks. -- Gary Kline kl...@thought.org http://www.thought.org Public Service Unix Journey Toward the Dawn, E-Book: http://www.thought.org The 7.97a release of Jottings: http://jottings.thought.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: Simple command to reset / clear all logs?
newsyslog -F ? On 1/12/2011 11:04 AM, Redd Vinylene wrote: Hi, Is there a simple command to reset / clear everything in my /var/log? I've done a lot of testing, configuring, trial and error and most of my logs are just full of bullshit and I'd like a fresh start :-) 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: Simple command to reset / clear all logs?
On Thu, 13 Jan 2011 02:17:10 +0900, Ryuichiro Hara r...@kibug.org wrote: Hello, It might be all right to remove all normal file logs, though you may want to retain all subdirectories. find /var/log -type f -exec rm {} \; may do. Possible problem: Programs that log to files may be confused that the file has disappeared. How about simply cutting the files to zero length? # cat /dev/null /var/log/* This will affect ALL files (expansion of *) which may not be precise enough in case you want to keep some of the log files. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ 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: Simple command to reset / clear all logs?
2011-01-12 17:04, Redd Vinylene: Hi, Is there a simple command to reset / clear everything in my /var/log? I've done a lot of testing, configuring, trial and error and most of my logs are just full of bullshit and I'd like a fresh start :-) Thanks! Sometimes I use rm /var/log/* Use with utmost caution! ___ 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: Simple command to reset / clear all logs?
Will the logs automatically create themselves? I mean, I picture I have to manually touch a lotta them in order to avoid cannot find error messages? On Wed, Jan 12, 2011 at 8:19 PM, Bernt Hansson be...@bah.homeip.net wrote: 2011-01-12 17:04, Redd Vinylene: Hi, Is there a simple command to reset / clear everything in my /var/log? I've done a lot of testing, configuring, trial and error and most of my logs are just full of bullshit and I'd like a fresh start :-) Thanks! Sometimes I use rm /var/log/* Use with utmost caution! -- http://www.home.no/reddvinylene ___ 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: Which php??
On Wed, Jan 12, 2011 at 10:02:38AM +, Paul Macdonald wrote: Lots of warnings:: Deprecated: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0 Deprecated: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0 PHP 5.3.5 with Suhosin-Patch (cli) (built: Jan 11 2011 12:31:01) (DEBUG) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies This is kinda good, at least its installed ! To turn off deprecated notices in looging: edit /usr/local/etc/php.ini ( approx line 523) error_reporting = E_ALL ~E_DEPRECATED Make php log errors: ( line approx 646) error_log = /var/log/php_errors.log then try php -v from shell, Will, try, thanks much. There is one thing that someone wrote in his post, labeling php.ini as PHP.INI or PHP.ini. Last night I cp'd the php-ini-devel* to PHP.ini. I think I'm probably barking up the wrong tree. A quick, recursive grep did find PHP in some files. But ``find /usr/ports _blah_'' found no PHP.ini. What's the right file to edit as my initialization file? -- Gary Kline kl...@thought.org http://www.thought.org Public Service Unix Journey Toward the Dawn, E-Book: http://www.thought.org The 7.97a release of Jottings: http://jottings.thought.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: Simple command to reset / clear all logs?
On Wed, 12 Jan 2011 20:50:04 +0100, Redd Vinylene reddvinyl...@gmail.com wrote: Will the logs automatically create themselves? Usually not, but it depends on the logging mechanism. If a program continuously re-opens the file (after closing it) in APPEND mode, it should be created if non-existent. But if the program keeps the file open and just writes to it, it can cause trouble. Good programs check the return code of the writing operation and signal an error. Bad programs don't do that, they just keep writing to nowhere. :-) I mean, I picture I have to manually touch a lotta them in order to avoid cannot find error messages? This should be the safest method for most purposes. But as I mentioned, just trim down the files to zero length, so they keep present, and all writing processes (re-opening APPEND or contunuously keep writing) shouldn't notice that. # for FILE in /var/log/*; do cat /dev/null ${FILE}; done That would be better than my first suggestion. You can exchange the part /var/log/* for any `find ...` command that specifies the intended target(s) of your operation better than the builtin shell expansion of the * expression. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ 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: Which php??
/usr/local/etc/php.ini That is the right file On Wednesday, January 12, 2011 05:53:47 pm Gary Kline wrote: On Wed, Jan 12, 2011 at 10:02:38AM +, Paul Macdonald wrote: Lots of warnings:: Deprecated: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0 Deprecated: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0 PHP 5.3.5 with Suhosin-Patch (cli) (built: Jan 11 2011 12:31:01) (DEBUG) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies This is kinda good, at least its installed ! To turn off deprecated notices in looging: edit /usr/local/etc/php.ini ( approx line 523) error_reporting = E_ALL ~E_DEPRECATED Make php log errors: ( line approx 646) error_log = /var/log/php_errors.log then try php -v from shell, Will, try, thanks much. There is one thing that someone wrote in his post, labeling php.ini as PHP.INI or PHP.ini. Last night I cp'd the php-ini-devel* to PHP.ini. I think I'm probably barking up the wrong tree. A quick, recursive grep did find PHP in some files. But ``find /usr/ports _blah_'' found no PHP.ini. What's the right file to edit as my initialization file? ___ 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: Simple command to reset / clear all logs?
On Wed, Jan 12, 2011 at 8:58 PM, Polytropon free...@edvax.de wrote: # for FILE in /var/log/*; do cat /dev/null ${FILE}; done That would be better than my first suggestion. You can exchange the part /var/log/* for any `find ...` command that specifies the intended target(s) of your operation better than the builtin shell expansion of the * expression. Now that's just beautiful, man :-) Thanks a lot :-) Please accept this gift http://www.zshare.net/download/552763591f4802ce/as a token of my appreciation for your support! Redd ___ 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: Which php??
On Wed, Jan 12, 2011 at 05:58:12PM -0200, Rodrigo Gonzalez wrote: /usr/local/etc/php.ini That is the right file Yep! r...@ethic:/usr/local/etc# php -v PHP 5.3.5 with Suhosin-Patch (cli) (built: Jan 12 2011 11:42:40) (DEBUG) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies r...@ethic:/usr/local/etc# Now, as a last re-try to get my wordpress blog port going, I will upgrade my php5-extensions. What should I turn on or off in the Makefile [or using `make config']? gary -- Gary Kline kl...@thought.org http://www.thought.org Public Service Unix Journey Toward the Dawn, E-Book: http://www.thought.org The 7.97a release of Jottings: http://jottings.thought.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: Which php??
On Wed, 12 Jan 2011 12:35:04 -0800, Gary Kline kl...@thought.org wrote: What should I turn on or off in the Makefile [or using `make config']? Allow me a quite general comment: Do not modify a port's Makefile directly. The interface to selectable options is usually given by make config or the configuration files of the port managament tool you use (if any). A file-based mechanism has been present in ports, but I'm not fully sure it hasn't been obsoleted already. I have used this mechanism for things like configuring the options for the mplayer port. This mechanism is Makefile.local - a file you place into the port's directory and specify all the options you need, maybe based upon the Makefile itself. For example, a /usr/ports/multimedia/mplayer/Makefile.local could look this way: WITH_SDL=yes WITH_VORBIS=yes WITH_THEORA=yes WITH_XANIM=yes WITH_XVID=yes WITH_REALPLAYER=yes WITH_LIVEMEDIA=yes WITH_ESOUND=yes WITH_FREETYPE=yes WITH_LANG=yes WITH_GUI=yes WITH_DVD=yes WITH_GTK1=yes WITH_LIBDVDNAV=yes WITH_AMR=yes WITH_VPX=yes WITH_WIN32=yes WITH_V4L=yes WITH_DVD_DEVICE=/dev/dvd WITH_OPTIMIZED_CFLAGS=yes WITHOUT_RUNTIME_CPUDETECTION=yes CFLAGS+= -O2 -pipe -ffast-math You can specify the =yes as an equivalent to setting [X] in the make config screen, and you can also define variables with strings (like WITH_DVD_DEVICE or the alteration of CFLAGS in the example). Reason: Changes to Makefile will be removed within the process of make update, but Makefile.local will be ignored, so it will still be present after the update of the ports tree. Still, using a centralized configuration file for ports options as provided by port management tools (such as portupgrade or portmaster) often is the better solution if you use those tools anyway. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ 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
IP traffic reporting -- simple aggregate bytes to each IP to a log
I have an older FreeBSD 6.x machine that I need to install some sort of IP traffic logging daemon on. (This machine is being updated soon to latest -STABLE). I had one once on another machine years ago but I forget the name. It basically just gave me a text file log with aggregate data to each IP address on the machine over time. Does anyone have any recommendations? I do not need web access to the data or fancy graphs or anything. I just need a simple way to see how much incoming traffic to each IP I get during a certain time period, written to a text log. I have been trying to build things like ntop and stuff but due to the age of this machine's installation that has not been possible due to ports being too new for it and problems installing latest tools (port errors in patches etc). Thanks Chad___ 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: Which php??
r...@ethic:/usr/local/etc# php -v PHP 5.3.5 with Suhosin-Patch (cli) (built: Jan 12 2011 11:42:40) (DEBUG) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies r...@ethic:/usr/local/etc# Now, as a last re-try to get my wordpress blog port going, I will upgrade my php5-extensions. What should I turn on or off in the Makefile [or using `make config']? gary for wordpress you need only worry about having mysql on in lang/php5-extensions (possibly gd, wordpress might have some fancy image manipulation features) I wouldn't worry about the rest for just a wp install. you'll get the choice of mysql driver, there is a new native driver but i confess i've not modified any of my code to use this ( so i don;t use it) Paul. ___ 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: Which php??
On Wed, Jan 12, 2011 at 11:01:03PM +, Paul Macdonald wrote: r...@ethic:/usr/local/etc# php -v PHP 5.3.5 with Suhosin-Patch (cli) (built: Jan 12 2011 11:42:40) (DEBUG) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies r...@ethic:/usr/local/etc# Now, as a last re-try to get my wordpress blog port going, I will upgrade my php5-extensions. What should I turn on or off in the Makefile [or using `make config']? gary for wordpress you need only worry about having mysql on in lang/php5-extensions (possibly gd, wordpress might have some fancy image manipulation features) I wouldn't worry about the rest for just a wp install. you'll get the choice of mysql driver, there is a new native driver but i confess i've not modified any of my code to use this ( so i don;t use it) Paul. Hm. I keep stumbling over this autoconf required version 2.68 not found Error. Do I need to portmanage upgrade that utility or what? Here is most of the output that fails trying to build php5-extensions:: # make install === php5-extensions-1.4 depends on file: /usr/local/include/php/main/php.h - found === php5-extensions-1.4 depends on file: /usr/local/lib/php/20090626-debug/hash.so - not found ===Verifying install for /usr/local/lib/php/20090626-debug/hash.so in /usr/ports/security/php5-hash === php5-hash-5.3.5 depends on file: /usr/local/bin/phpize - found === php5-hash-5.3.5 depends on file: /usr/local/bin/autoconf-2.68 - found === PHPizing for php5-hash-5.3.5 Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 *** Error code 1 Stop in /usr/ports/security/php5-hash. *** Error code 1 Stop in /usr/ports/lang/php5-extensions. *** Error code 1 Stop in /usr/ports/lang/php5-extensions. -- Gary Kline kl...@thought.org http://www.thought.org Public Service Unix The 7.97a release of Jottings: http://jottings.thought.org/index.php http://journey.thought.org ethic ___ 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: Which php??
On Wed, Jan 12, 2011 at 11:01:03PM +, Paul Macdonald wrote: r...@ethic:/usr/local/etc# php -v PHP 5.3.5 with Suhosin-Patch (cli) (built: Jan 12 2011 11:42:40) (DEBUG) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies r...@ethic:/usr/local/etc# Now, as a last re-try to get my wordpress blog port going, I will upgrade my php5-extensions. What should I turn on or off in the Makefile [or using `make config']? gary for wordpress you need only worry about having mysql on in lang/php5-extensions (possibly gd, wordpress might have some fancy image manipulation features) I wouldn't worry about the rest for just a wp install. you'll get the choice of mysql driver, there is a new native driver but i confess i've not modified any of my code to use this ( so i don;t use it) Paul. I think I missed some out my stderr output. Here is another try at capturing the make install flub. # make install === php5-extensions-1.4 depends on file: /usr/local/include/php/main/php.h - found === php5-extensions-1.4 depends on file: /usr/local/lib/php/20090626-debug/hash.so - not found ===Verifying install for /usr/local/lib/php/20090626-debug/hash.so in /usr/ports/security/php5-hash === php5-hash-5.3.5 depends on file: /usr/local/bin/phpize - found === php5-hash-5.3.5 depends on file: /usr/local/bin/autoconf-2.68 - found === PHPizing for php5-hash-5.3.5 Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 autoconf: required version 2.68 not found *** Error code 1 Stop in /usr/ports/security/php5-hash. *** Error code 1 Stop in /usr/ports/lang/php5-extensions. *** Error code 1 Stop in /usr/ports/lang/php5-extensions. -- Gary Kline kl...@thought.org http://www.thought.org Public Service Unix The 7.97a release of Jottings: http://jottings.thought.org/index.php http://journey.thought.org ethic ___ 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: Which php??
Gary Kline wrote: [snip] autoconf: required version 2.68 not found *** Error code 1 Stop in /usr/ports/security/php5-hash. *** Error code 1 Stop in /usr/ports/lang/php5-extensions. *** Error code 1 Stop in /usr/ports/lang/php5-extensions. Setting these environment variables prior to building anything PHP is a workaround for the autoconf stuff. in tcsh/csh: setenv PHP_AUTOCONF autoconf-2.68 setenv PHP_AUTOHEADER autoheader-2.68 Then proceed to build, install, update. This is a very old, long time ago type error that recurs every so often. And this is assuming, of course, that the current versions are indeed installed. -Mike ___ 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
broken links found on your web site
Hello, I just came from visiting your website ( http://www.freebsd.org/fr/gallery/pgallery.html) and found a few links that aren't working and thought you should know: 404 Not Found - http://www.peacesex.com 404 Not Found - http://www.whizkidtech.net/cgi-bin/tutorial/ 404 Not Found - http://c36196-a.frmt1.sfba.home.com/~alexw/ While you are in fixing these links would you add a link to my web site as well? My site is: http://www.couponsaver.org - 15,000+ coupons and promotional codes. Thanks and talk to you soon! Jane (in snowy Cleveland, Ohio) ___ 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: Simple command to reset / clear all logs?
On Wed, Jan 12, 2011 at 08:21:45PM +0100, Polytropon wrote: On Thu, 13 Jan 2011 02:17:10 +0900, Ryuichiro Hara r...@kibug.org wrote: Hello, It might be all right to remove all normal file logs, though you may want to retain all subdirectories. find /var/log -type f -exec rm {} \; may do. Possible problem: Programs that log to files may be confused that the file has disappeared. How about simply cutting the files to zero length? # cat /dev/null /var/log/* or # truncate -s 0 /var/log/* That will save you two keystrokes, and that's important! ;-) ___ 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
awk question: replacing %d%s by %d %s
I'm aware that this is not an awk question list, but I'm confident there are many awk gurus here who can surely help me with such a stupid problem. I also know that I get more and more stupid myself for NOT being able to solve this, even after... some nearly infinite time. :-) I have strings of the form either number(s) or number(s)letter. I catch them with if(match(nr, [a-z])) ... where nr is the name of the string. What I need is a simple space between number(s) and letter, so for example 12a would get 12 a, 6d would get 6 d, and 58 would stay unchanged. I've tried with split(), with array manipulation and could produce 10 lines of code that didn't work as intended (it produced 1122aa, 66dd and 5588 according to the examples above). Obviously, sub(nr, [a-z], [a-z]); is nonsense. Can anybody please tell me the obvious and easy way which I am missing? Thanks a lot! =^_^= The reason I'd like to do this in awk is that I've already spent enough time creating a format converter in awk that works very fine, as intended, but is missing just this little feature. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ 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: awk question: replacing %d%s by %d %s
On Thu, 13 Jan 2011 01:00:17 -0500, Tom Limoncelli t...@whatexit.org wrote: $ awk data.txt experiment.txt '{ num = $1 ; sub(/[^0-9]+$/, , num) ; lets = $1 ; sub(/^[0-9]+/, , lets); print num lets }' ; diff -cw control.txt experiment.txt $ # The above puts a space at the end of the first 3 lines. If that is bad, try: $ awk data.txt experiment.txt '{ num = $1 ; sub(/[^0-9]+$/, , num) ; lets = $1 ; sub(/^[0-9]+/, , lets); if (length(lets)) { print num lets } else { print num } }' ; diff control.txt experiment.txt $ Thanks for your inspiration! I concluded that it is a possible way to split the string into two parts: not-numbers (letters) and numbers, and then recombining them in the desired way. Here's my code: if(match(nr, [a-z])) { z = nr; gsub(/[^0-9]+$/, , z); b = nr; gsub(/[0-9]/, , b); nr = sprintf(%s %s, z, b); } First catch all nr's that have a letter in it, then remove the letters in one copy, then the numbers in another one, and finally overwrite nr with the proper recombination that includes the space. Works as intended, FULLY. Thanks! -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ 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: awk question: replacing %d%s by %d %s
On Thu, Jan 13, 2011 at 12:28 AM, Polytropon free...@edvax.de wrote: I have strings of the form either number(s) or number(s)letter. I catch them with ... where nr is the name of the string. What I need is a simple space between number(s) and letter, so for example 12a would get 12 a, 6d would get 6 d, and 58 would stay unchanged. I've tried This feels like it could be faster, but is reasonable: $ cat data.txt 1 12 3 1d 1dc 12d 12dc 123d 123dc 123dcb $ cat control.txt 1 12 3 1 d 1 dc 12 d 12 dc 123 d 123 dc 123 dcb $ awk data.txt experiment.txt '{ num = $1 ; sub(/[^0-9]+$/, , num) ; lets = $1 ; sub(/^[0-9]+/, , lets); print num lets }' ; diff -cw control.txt experiment.txt $ # The above puts a space at the end of the first 3 lines. If that is bad, try: $ awk data.txt experiment.txt '{ num = $1 ; sub(/[^0-9]+$/, , num) ; lets = $1 ; sub(/^[0-9]+/, , lets); if (length(lets)) { print num lets } else { print num } }' ; diff control.txt experiment.txt $ Tom -- http://EverythingSysadmin.com -- my blog (new posts Mon and Wed) http://www.TomOnTime.com -- my advice (more videos coming soon) ___ 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: Simple command to reset / clear all logs?
From owner-freebsd-questi...@freebsd.org Wed Jan 12 10:09:51 2011 Date: Wed, 12 Jan 2011 17:04:26 +0100 From: Redd Vinylene reddvinyl...@gmail.com To: questions questi...@freebsd.org Cc: Subject: Simple command to reset / clear all logs? Hi, Is there a simple command to reset / clear everything in my /var/log? I've done a lot of testing, configuring, trial and error and most of my logs are just full of bullshit and I'd like a fresh start :-) something like: foreach file in (/var/log/*log) echo $file end maybe ? ___ 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: problem with shell script
On Wednesday 12 January 2011 17:58:33 David Scheidt wrote: ps ax | grep [s]lapd | wc -l The [] creates a one-character class that doesn't match the regex. Easier to type and grep should be a bit faster. And you can save another process by using ps ax | grep -c '[s]lapd' Although as others have pointed out, you can also use pgrep. Jonathan ___ 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: Simple command to reset / clear all logs?
On Wed, Jan 12, 2011 at 1:50 PM, Redd Vinylene reddvinyl...@gmail.comwrote: Will the logs automatically create themselves? I mean, I picture I have to manually touch a lotta them in order to avoid cannot find error messages? Please don't top post. do something like this: shutdown now rm /var/log/* exit upon reentering multiuser mode, each logging service will create it's new file. Typically if a service is running and you delete the log from it, the service will not like it. You can HUP the service to have it restart logging, but you'd have to do it manually for each log you deleted. -- Adam Vande More ___ 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