[OT] Show nice columns of numers

2009-10-28 Thread Bertram Scharpf
Hi,


my company is going to shoot a TV spot that will show me at work.
The first thing my desktop will contain is some BSD/FreeBSD logo.

As it will be a movie, not a photograph, I would like to have huge
columns of numbers running over the screen or at least one window.
Does somebody know a programm that produces such nice output?

Thanks in advance.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: windoz, how do i install it last

2009-10-06 Thread Bertram Scharpf
Hi,

Am Dienstag, 06. Okt 2009, 07:05:23 -0400 schrieb Henry Olyer:
> So I have a FreeBSD system.
> Is their a way to install windoz?  Say, XP-pro?  Or whatever...

Replace or dual boot? The standard FreeBSD boot manager offers
a choice which of the slices 1-4 you want to boot from. Just
install #...@%& into the first slice and FreeBSD into the second.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: Moused crashes with Synaptics

2009-09-16 Thread Bertram Scharpf
Hi,

Am Mittwoch, 16. Sep 2009, 11:16:24 + schrieb Eitan Adler:
> >> >   hw.psm.synaptics_support="1"
> >> >   hw.psm.synaptics.vscroll_hor_area=1300
> >> >
> Did this help your problem?

Arrgh. The problem was that I had hit Fn-F7 (deactivate touchpad).
The really vicious thing was that every time I opened the psm0
device, it supplied 80-150 bytes before performing the
deactivation.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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"


Nice/priority and disk access

2009-09-11 Thread Bertram Scharpf
Hi,


as the man page tells, `nice' alters the scheduling priority.
Is there a way to reduce a processes priority for hard disk
access?

Thanks in advance.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: how to get rid of a character, 0x80?

2009-09-08 Thread Bertram Scharpf
Hi,

Am Dienstag, 08. Sep 2009, 08:00:27 +0200 schrieb Mark Stapper:
> Gary Kline wrote:
> > anybody know why getchar() doesn't see 0x80 == 0200?
> 
> Presumably, you want to read a capital C with cedille? (0x80 128 Ç)

"\x80" is a nonbreakable space in iso8859-1/-15.
(And a Euro sign in Windows-1252). Who uses cp437/cp850 on BSD?

> besides.. 0x80!=0200

  $ ruby -e 'puts 0x80, 0200'
  128
  128

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: Why /bin/sh doesn't like the line: if test "x$my_var" == "xyes"; then

2009-09-03 Thread Bertram Scharpf
Hi,

Am Donnerstag, 03. Sep 2009, 04:14:56 + schrieb jerry M:
> configure file got this line and it causes the message: test:
> xyes: unexpected operator But removing spaces around == or
> replacing == with = makes it to work.
> 
> On Linux though this line works fine.

As `man test' describes, the /bin/test executable does not
recognize a == operator.

Neither in `sh' nor in `bash' the `test' executable will be called
(unless written as /bin/test). In both cases it is a builtin
command. The Sh builtin works like the `test' executable; the Bash
builtin recognizes ==.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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 Bertram Scharpf
Hi,

Am Dienstag, 01. Sep 2009, 18:03:19 + schrieb Paul Schmehl:
> I found a sed tutorial once that did this, but I can't seem to find it 
> again. 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?

Probably this:

  $ echo `cat ip-file`
  $ ipline=`cat ip-file`
  $ echo $ipline | wc -l

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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-12 Thread Bertram Scharpf
Hi,

Am Montag, 10. Aug 2009, 13:00:31 -0700 schrieb Raisa Brokhshtut:
> My old desktop has FreeBSD that I have never used. [...] Now I
> want to get rid of this program and to install Windows.
>  
> Anyway, I would greatly appreciate if you would guide me how to
> uninstall that program. [...] So I want to completly remove that
> FreeBSD from my PC and to install the Windows operating system
> from CD. 

This problem is best solved the common way Windows users do with
any software: Just reinstall the desired program as often until it
works.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: Mouse still crashes with Synaptics

2009-08-07 Thread Bertram Scharpf
Hi,

Am Donnerstag, 06. Aug 2009, 15:37:34 -0800 schrieb Mel Flynn:
> On Thursday 06 August 2009 12:46:21 Bertram Scharpf wrote:
>
> You might get some help on freebsd-x11 list.

As I mentioned twice I manage to reproduce the problem just
calling "dd". It is definitely not an X11 issue.

I really made great effort on pointing this out. This is very
disappointing.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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"


Mouse still crashes with Synaptics

2009-08-06 Thread Bertram Scharpf
Hi,

Am Dienstag, 04. Aug 2009, 13:26:24 +0200 schrieb Bertram Scharpf:
> an Acer notebook with a Synaptics Touchpad makes some trouble
> here.

This is a real mess. Nobody gives me any help and I do not know
what to try any further. I reduced the problem to the following
behaviour:

  # dd if=/dev/bpsm0 bs=3 | xxd -c 3
  # dd if=/dev/bpsm0 bs=3 | od -x # alternative

This prints out 30 to 100 lines while I move my finger around the
touchpad. Then the output stops. When I press Ctrl-C and restart
the command, I get about 30 to 100 lines again.

Moused and any other program that reads /dev/psm0 yield the same
behaviour.

I tried FreeBSD 6.4, 7.0 and 7.2. It is the same with all three of
them. They were all virgin; I just unpacked the base distribution
and the generic kernel.

As there is nobody out there who likes to help me could at least
anyone point me to a documentation how to debug the kernel driver?
Or could at least anyone point me to a list where I can get help
with severe kernel problems?

I have to solve it with 7.2 as the previous versions don't
recognize the network card.

kernel
list


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: Moused crashes with Synaptics

2009-08-05 Thread Bertram Scharpf
Hi Mel,

Am Dienstag, 04. Aug 2009, 18:50:24 -0800 schrieb Mel Flynn:
> On Tuesday 04 August 2009 03:26:24 Bertram Scharpf wrote:
> > Further I seem to have missed something else. I found the page
> > http://wiki.freebsd.org/SynapticsTouchpad where are mentioned some
> > sysctls:
> >
> >   hw.psm.synaptics_support="1"
> >   hw.psm.synaptics.vscroll_hor_area=1300
> >
> > I don't have those ctls here and I cannot find the kernel driver
> > that provides them.
> 
> That's because they're loader tunables. You set them in
> /boot/loader.conf. The LOADER TUNABLES section of psm(4) details
> it.

Ah, I did not know that there are options that have to be set at
boot time.

Thank you!

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: Moused crashes with Synaptics

2009-08-04 Thread Bertram Scharpf
Hi,

Am Dienstag, 04. Aug 2009, 21:28:37 +0200 schrieb Bertram Scharpf:
> Am Dienstag, 04. Aug 2009, 13:26:24 +0200 schrieb Bertram Scharpf:
> > Hi,
> > 
> > an Acer notebook with a Synaptics Touchpad makes some trouble
> > here. My primary problem is: I restart the mouse daemon and then I
> > can move the mouse only for a short distance; suddenly the mouse
> > freezes.
> 
> In the meantime I learned that there is /dev/bpsm0 and I wrote a
> litte Ruby script that reads /dev/psm0. Both devices refuse to
> supply anything after a very short period of time.

Hello, anybody there?

Could at least someone point me to a documentation how to debug
the psm kernel device?

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: Moused crashes with Synaptics

2009-08-04 Thread Bertram Scharpf
Hi,

Am Dienstag, 04. Aug 2009, 13:26:24 +0200 schrieb Bertram Scharpf:
> Hi,
> 
> an Acer notebook with a Synaptics Touchpad makes some trouble
> here. My primary problem is: I restart the mouse daemon and then I
> can move the mouse only for a short distance; suddenly the mouse
> freezes.
> 
> To analyze the problem I do the following:
> 
>   # /etc/rc.d/moused restart
>   # dd if=/dev/sysmouse bs=4 | xxd -c 4
>   ...
>   048: 87 .
>   18+1 records in
>   18+1 records out
>   73 bytes transferred in 21.774484 secs (3 bytes/sec)
>   # 
> 
> You see: dd stops without reporting an error. Obviously the moused
> doesn't work properly any more.

In the meantime I learned that there is /dev/bpsm0 and I wrote a
litte Ruby script that reads /dev/psm0. Both devices refuse to
supply anything after a very short period of time.

What could this be?

Thanks in advance.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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"


Moused crashes with Synaptics

2009-08-04 Thread Bertram Scharpf
Hi,

an Acer notebook with a Synaptics Touchpad makes some trouble
here. My primary problem is: I restart the mouse daemon and then I
can move the mouse only for a short distance; suddenly the mouse
freezes.

To analyze the problem I do the following:

  # /etc/rc.d/moused restart
  # dd if=/dev/sysmouse bs=4 | xxd -c 4
  000: 87fb 05fb  
  004: 0687 f709  
  008: 8787 f207  
  00c: 87e1 09e1  
  010: 0a87 f600  
  014: f600 87e2  
  018: f8e3 f987  
  01c: f7fa f8fb  
  020: 87f3 f7f4  
  024: f887 f3f5  
  028: f3f6 87f4  
  02c: f3f4 f487  
  030: f7f4 f8f5  
  034: 87fa f5fb  
  038: f587 fcf5  
  03c: fdf6 87ff  
  040: f6ff f787  
  044: 01f6 02f6  
  048: 87 .
  18+1 records in
  18+1 records out
  73 bytes transferred in 21.774484 secs (3 bytes/sec)
  # 

You see: dd stops without reporting an error. Obviously the moused
doesn't work properly any more.

Further I seem to have missed something else. I found the page
http://wiki.freebsd.org/SynapticsTouchpad where are mentioned some
sysctls:

  hw.psm.synaptics_support="1"
  hw.psm.synaptics.vscroll_hor_area=1300

I don't have those ctls here and I cannot find the kernel driver
that provides them.

Does anybody have some advice for me?

Thanks in advance.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: how to do a live migration of a freebsd box to another box with rsync

2009-07-05 Thread Bertram Scharpf
Hi,

Am Sonntag, 05. Jul 2009, 18:18:03 +0200 schrieb insrc:
> - as the UFS write support is still experimental in the Linux kernel, it
> seems that i've to use a BSD liveCD but i can't find one :-/ I heard about
> frenzy ( http://frenzy.org.ua/en/ ) but the homepage says that the project
> is no longer maintained !

There is a livefs with the original ISO images:

  ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/7.2/

I further found DesktopBSD but I didn't try that.

I strongly recommend that you build yourself an USB stick.
Here's what you need to do:

  
http://typo.submonkey.net/articles/2006/4/13/installing-freebsd-on-usb-stick-episode-2

I went forth, chrooted into the stick and installed Vim, some
diagnose/repair tools and an XFCE. I even managed to install Grub
and let the user switch the boot process back to the hard disk.
Further, I made a second partition named "transfer" formatted with
FAT so that I can write some data from a Windows to it.

I look enviously at the Grml project and I find it a great pity
that there is no BSD equivalent.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: what character is a physical newline

2009-06-29 Thread Bertram Scharpf
Hi,

Am Sonntag, 28. Jun 2009, 22:27:49 -0400 schrieb Aryeh M. Friedman:
> Glen Barber wrote:
>> On Sun, Jun 28, 2009 at 10:21 PM, Aryeh M.
>> Friedman wrote:
>>   
>>> I am writting a parser (tokenizes all characters among other things) and
>>> need to know what control char is equivelent to a newline (I do not need
>>> windows cross compatibility)
>>
>> What do you mean exactly?  What language(s)?  If I understand your
>> question correctly, the C / C++ / Java / PHP (and I think Perl)
>> 'newline' character is '\n'
>>   
> I meant what ascii character does \n actual correspond to (I assume  
> but just making sure)

  $ perl -e 'print ord("\n"), "\n"'
  10
  $ python -c 'print ord("\n")'
  10
  $ ruby -e 'puts "\n"[0]'
  10
  $ cat nl.c 
  #include "stdio.h"
  int main(int argc, char **argv)
  {
  printf( "%d\n", '\n');
  return 0;
  }
  $ cc -o nl nl.c
  $ ./nl
  10
  $ echo | od -d
  00010
  001


Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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 bash script

2009-06-16 Thread Bertram Scharpf
Hi,

Am Dienstag, 16. Jun 2009, 09:09:09 -0400 schrieb Carmel NY:
> [...] It seems to work until I get to the copy part where it fails.
> 
> My scripting skills are not that good. Perhaps someone could tell me
> what I am doing wrong.
> 
> # copy the file to another directory using the base name
> cp $i /usr/home/tmp/$BN

Please provide the error message next time.

I guess the filenames contain spaces. Try

  cp "$i" "/usr/home/tmp/$BN"

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: Terminal / vim / shortcuts

2009-06-14 Thread Bertram Scharpf
Hi,

Am Samstag, 13. Jun 2009, 20:18:02 -0400 schrieb Daniel Underwood:
> I edit python code in vim using Terminal on xfce.  I find myself, not
> surprisingly, having to exit "insert mode" and save changes frequently
> (when making code changes and wishing to test the immediate effects of
> the changes in a separate terminal).  This requires pressing 4 keys:
> "esc", ":", "w", and "enter".  How can I configure a shortcut (ideally
> using an F# key) that will perform this sequence of 4 key-presses?

This would rather be a question for the Vim mailing list.

  imap  :wsleep 1gi

The purpose of the sleep is that you see the "written" message.


Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: /bin/sh does not read profile

2009-03-05 Thread Bertram Scharpf
Hi Frank,

Am Donnerstag, 05. Mär 2009, 04:15:05 + schrieb Frank Shute:
> On Wed, Mar 04, 2009 at 04:08:03PM +0100, Bertram Scharpf wrote:
> > from "man sh":
> > 
> >Invocation
> >  [...]  the shell inspects
> >  argument 0, and if it begins with a dash (`-'), the shell is also 
> > consid-
> >  ered a login shell.  [...] A login shell first reads commands from the
> >  files /etc/profile and then .profile in a user's home directory, if 
> > they
> >  exist.  [...]
> > 
> > I use Slim (X login manager) which calls
> > 
> >   exec /bin/sh - ~/.xinitrc
> 
> I've never before seen the syntax you've used and I think it comes
> from a misunderstanding of the manpage for sh and/or it's a bashism or
> a typo.

It's the original FreeBSD port.

> E.g:
> 
> /bin/sh -c somecommand (login shell - arg 0 starts with a dash)

Sorry, this doesn't call /etc/profile either.

  $ uname -v
  FreeBSD 7.1-RELEASE #0: Thu Jan  1 14:37:25 UTC 2009 
r...@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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"


/bin/sh does not read profile

2009-03-04 Thread Bertram Scharpf
Hi,

from "man sh":

   Invocation
 [...]  When first starting, the shell inspects
 argument 0, and if it begins with a dash (`-'), the shell is also consid-
 ered a login shell.  This is normally done automatically by the system
 when the user first logs in.  A login shell first reads commands from the
 files /etc/profile and then .profile in a user's home directory, if they
 exist.  [...]

I use Slim (X login manager) which calls

  exec /bin/sh - ~/.xinitrc

I first wondered why none of my commands in "/etc/profile" and
"~/.profile" got executed.  Finally, I modified
"/usr/src/bin/sh/main.c" to trace what files are read, recompiled
the "sh" command and: the only file that is executed is "~/.shrc".

I just cannot believe that FreeBSD has such a severe bug. What is
going wrong here?

Thanks in advance,

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: OT: sed + exit status

2009-02-17 Thread Bertram Scharpf
Hi,

Am Samstag, 14. Feb 2009, 08:53:42 -0500 schrieb Robert Huff:
> According to the man page:
> 
> EXIT STATUS
>  The sed utility exits 0 on success, and >0 if an error occurs.
> 
> 
> However, what constitutes "success" is undefined.

A short peek at the source code reveals: An exit code of 1 will be
returned when (1) the -? option or an unknown one requested a
usage message and (2) the input file cannot be opened.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: well, blew it... sed or perl q again.

2008-12-30 Thread Bertram Scharpf
Hi Gary,

Am Dienstag, 30. Dez 2008, 17:48:02 -0800 schrieb Gary Kline:
> On Tue, Dec 30, 2008 at 10:16:33PM +0100, Bertram Scharpf wrote:
> > Hi Gary,
> > 
> > Am Dienstag, 30. Dez 2008, 11:31:14 -0800 schrieb Gary Kline:
> > > The problem is that there are many, _many_ embedded 
> > > "http://whatever> Site in my hundreds, or
> > > thousands, or files.  I only want to delete the
> > > "http://" lines, _not_ the other Href links.
> > >
> > > sed or perl?
> > 
> > Ruby. Untested:
> > 
> >   $ ruby -i.bak -pe 'next if ~/href="([^"]*)"/i and $1 == 
> > "http://example.com";' somefile.html
> > 
> > Probably you want to do something more sophisticated.
> 
>   no errors, but the new.htm is == new.htm.bak; in other words,
>   it looks like a partial match on just "http" fails.  Don't
>   know why.  i'm pretty sure the entire "http://foobar.com";> xxx 
> "
>   would do it.  

This is not FreeBSD-specific, though.

I still wonder why you rely on lines just containing
%r{^.*$} . Maybe you're doing a quick'n'dirty solution
but I'm quite sure you won't get along with a one-liner.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: well, blew it... sed or perl q again.

2008-12-30 Thread Bertram Scharpf
Hi Gary,

Am Dienstag, 30. Dez 2008, 11:31:14 -0800 schrieb Gary Kline:
> The problem is that there are many, _many_ embedded 
> "http://whatever> Site in my hundreds, or
> thousands, or files.  I only want to delete the
> "http://" lines, _not_ the other Href links.
>
> sed or perl?

Ruby. Untested:

  $ ruby -i.bak -pe 'next if ~/href="([^"]*)"/i and $1 == "http://example.com";' 
somefile.html

Probably you want to do something more sophisticated.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: Sed question

2008-12-21 Thread Bertram Scharpf
Hi,

Am Sonntag, 21. Dez 2008, 02:08:04 -0800 schrieb Gary Kline:
> On Sun, 2008-12-21 at 07:42 +0200, Giorgos Keramidas wrote:
> > On Sat, 20 Dec 2008 21:34:10 -0800, Gary Kline  wrote:
> > >
> > > sed '8,10d'< file> newfile
> > > or is there a better way?
> > 
> >   keram...@kobe:/tmp$ sed -i '' -e '2d' foo
> > 
> thanks much.  it works just fine in-place.  ...but i did made a separate
> copy, just in case;-)

To make a copy, call

  $ sed -i .bak 8,10d myfile

Be aware that the -i option is not portable. -> man sed /^STANDARDS

Consider Perl or

  $ ruby -i.bak -pe 'next if 8..10 === $.' x

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
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: Switch to alternate screen buffer

2008-07-26 Thread Bertram Scharpf
Hi,

Am Donnerstag, 24. Jul 2008, 16:57:40 +0200 schrieb Wojciech Puchar:
>> I know from some old Linux installations that Less and Vim are able to
>> switch to an alternate screen buffer. They use the escape sequences
>> "\e[?1047h" and "\e[?1047l" to switch back respectively.
>>
>> How can I activate this in FreeBSD?
>
> no idea but do
>
> someprg 2>&1|vim -

No. I will not waive. This is not Microsoft here.

Edit /usr/share/misc/termcap. Change the following entry:

  xterm|xterm-color|X11 terminal emulator:\
  :ti=\E[?47h:te=\E[?47l:tc=xterm-xfree86:

Don't forget to execute "cap_mkdb termcap".

No need to get over with a poor workaround.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Switch to alternate screen buffer

2008-07-24 Thread Bertram Scharpf
Hi,

this is difficult to google for.

In a terminal window I oftenly pipe some progams output to vim or to
less:

  $ someprg | vim -

When the program fails and outputs an error message to stderr this will
be overwritten by Vim.

I know from some old Linux installations that Less and Vim are able to
switch to an alternate screen buffer. They use the escape sequences
"\e[?1049h" and "\e[?1049l" to switch back respectively.

How can I activate this in FreeBSD?

Thanks in advance.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: A sed question

2008-07-09 Thread Bertram Scharpf
Hii,

Am Mittwoch, 09. Jul 2008, 00:35:32 -0700 schrieb Unga:
> I want to translate following GNU sed lines to FreeBSD sed:
> 
> 1. sed -e '/\*address:/{n;[EMAIL PROTECTED]@replaceText @}'
> 2. sed -e '/\*address:/{n;[EMAIL PROTECTED]@ [EMAIL PROTECTED]'

An obvious problem is that a semicolon is missing before the closing
brace.

sed -e '/\*address:/{n;[EMAIL PROTECTED]@replaceText @;}'

I'm almost sure your version won't work with GNU sed either.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Permissions and SANE/scanimage

2008-06-21 Thread Bertram Scharpf
Hi,

Am Samstag, 21. Jun 2008, 12:53:37 +0200 schrieb Marc Fonvieille:
> On Sat, Jun 21, 2008 at 12:36:24PM +0200, Bertram Scharpf wrote:
> > my scanner works perfectly when I log in in as root. As an
> > unprivileged user, I just get this error message:
> > 
> >   $ scanimage -L
> > 
> >   No scanners were identified. [...]
> See 7.6.4 Giving Other Users Access to the Scanner
> in
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/scanners.html

Argh. Was a long day yesterday. I stopped reading it when Xsane
appeared.

Sorry for the noise.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Permissions and SANE/scanimage

2008-06-21 Thread Bertram Scharpf
Hi,


my scanner works perfectly when I log in in as root. As an
unprivileged user, I just get this error message:

  $ scanimage -L

  No scanners were identified. If you were expecting something different,
  check that the scanner is plugged in, turned on and detected by the
  sane-find-scanner tool (if appropriate). Please read the documentation
  which came with this software (README, FAQ, manpages).

I ended up in a brute force attempt saying in /etc/devfs.conf:

  perm * 0666

Still, this didn't work. Starting "truss" and "diff" relvealed the
following difference:

root:
  open("/dev/ugen0.2",O_RDWR,00)   ERR#6 'Device not configured'
  open("/dev/ugen0.2",O_WRONLY,00)   = 6 (0x6)
unprivileged user:
  open("/dev/ugen0.2",O_RDWR,00)   ERR#13 'Permission denied'

Even when saying something like

  chmod 0666 /dev/ugen0.2

the permissions will be 0644 after the run of "scanimage -L".

Could somebody please enlighten me what's going on here? What did I miss
when installing Sane?

"pkg_info -Dx sane-backends" stays empty.

Thanks in advance.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"