euglug.org

[카테고리:] Uncategorized

  • [Eug-lug] tee’s opposite?



    larry priceWed Aug 2 12:10:45 PDT 2006

    or you could just
    
    tail -f /var/log/log.1 /var/log/log.2
    
    
    
    On 8/2/06, Patrick R. Wade <prwade at oip.net> wrote:
    > Rob Hudson wrote:
    > > Is there a way to tail 2 files at the same time?
    > >
    > > I remembered tee had something to do with this but it does the opposite
    > > of what I want -- 1 input, multiple outputs.
    > >
    > > I want multiple inputs, 1 output (filtered through tail).
    >
    > What about cat?
    >
    > $ cat foo bar baz | tail # yields bottom of total output
    >
    > or do you mean you want multiple columns:
    >
    > ---------------------------------------------------------------
    > tail of foo in this column  | tail of bar in this column | etc
    >
    > for that, might try column(1) or paste(1).
    >
    > --
    > On two occasions I have been asked [by members of Parliament!], 'Pray,
    > Mr. Babbage, if you put into the machine wrong figures, will the right
    > answers come out?' I am not able rightly to apprehend the kind of
    > confusion of ideas that could provoke such a question.
    >         -- Charles Babbage
    > _______________________________________________
    > EUGLUG mailing list
    > euglug at euglug.org
    > http://www.euglug.org/mailman/listinfo/euglug
    >
    
  • [Eug-lug] tee’s opposite?



    Patrick R. WadeWed Aug 2 12:07:58 PDT 2006

    Rob Hudson wrote:
    > Is there a way to tail 2 files at the same time?
    > 
    > I remembered tee had something to do with this but it does the opposite
    > of what I want -- 1 input, multiple outputs.
    > 
    > I want multiple inputs, 1 output (filtered through tail).
    
    What about cat?
    
    $ cat foo bar baz | tail # yields bottom of total output
    
    or do you mean you want multiple columns:
    
    ---------------------------------------------------------------
    tail of foo in this column  | tail of bar in this column | etc
    
    for that, might try column(1) or paste(1).
    
    -- 
    On two occasions I have been asked [by members of Parliament!], 'Pray,
    Mr. Babbage, if you put into the machine wrong figures, will the right
    answers come out?' I am not able rightly to apprehend the kind of
    confusion of ideas that could provoke such a question.
    	-- Charles Babbage
    
  • [Eug-lug] tee’s opposite?



    Fred JamesWed Aug 2 11:56:34 PDT 2006

    Rob Hudson wrote:
    
    > Is there a way to tail 2 files at the same time?
    >
    > I remembered tee had something to do with this but it does the 
    > opposite of what I want -- 1 input, multiple outputs.
    >
    > I want multiple inputs, 1 output (filtered through tail).
    >
    > Thanks,
    > Rob
    >
    Rob Hudson
    (1) static or dynamic?
    (2) sorted or one after the other?
    
    No, that doesn't mean I have the answer, just that I should like to 
    understand the requirements
    Regards
    Fred James
    
  • [Eug-lug] tee’s opposite?



    Rob HudsonWed Aug 2 11:43:14 PDT 2006

    Is there a way to tail 2 files at the same time?
    
    I remembered tee had something to do with this but it does the opposite 
    of what I want -- 1 input, multiple outputs.
    
    I want multiple inputs, 1 output (filtered through tail).
    
    Thanks,
    Rob
    
  • [Eug-lug] Shell script question



    Patrick R. WadeWed Aug 2 11:02:25 PDT 2006

    Neil Parker wrote:
    
    > How about something like this:
    > 
    >      #!/bin/sh
    >      # foo.sh: an example script
    >      trap 'kill -HUP $!;exit 1' 1 2 3 15
    >      for i in foo bar baz
    >      do find /home/$i &
    >         wait
    >      done
    >      exit 0
    > 
    > This makes sure the signal (if it's HUP, INT, QUIT, or TERM) propogates
    > to the find command.  The funny business with the "&" and the "wait" is
    > so we can get at find's pid using "$!".
    > 
    > Be careful of the trap command...in order to work, the first argument must
    > be in SINGLE quotes.
    
    I experimented with this ; i should perhaps mention that /bin/sh for
    this script is /bin/dash, the Debian Almquist shell, a Bourne shell
    clone derivative of NetBSD.
    
    What i observe, is that trap is not trapping the signal to the parent
    process.
    
    #!/bin/sh
    # foo.sh: an example script
    trap 'echo Duuude! ' USR1
    for i in foo bar baz
    	do find /home/$i &
            wait
    	done
    exit 0
    
    $ ./foo.sh &
    
    $ ps f
     PID TTY      STAT   TIME COMMAND
     123 pts/3    Ss     0:00 -bash
     247 pts/3    S+     0:00  \_ /bin/dash /home/prwade/foo.sh
     420 pts/3    S+     0:00      \_ /bin/dash /home/prwade/foo.sh
    1337 pts/3    S+     0:00          \_ /usr/bin/find
    
    $ kill -USR1 247 # no output
    
    $ kill -USR1 420
    Duuude!
    
    Perhaps the parent process is waiting for the subshell to complete
    before it looks at signals.
    
    I think Larry's idea of pgrep, together with a suggestion i got from
    another source about killing the process group, may be the direction i
    need to take ; i'm experimenting further.
    
    -- 
    On two occasions I have been asked [by members of Parliament!], 'Pray,
    Mr. Babbage, if you put into the machine wrong figures, will the right
    answers come out?' I am not able rightly to apprehend the kind of
    confusion of ideas that could provoke such a question.
    	-- Charles Babbage
    
  • [Eug-lug] data center woes in Los Angeles



    larry priceWed Aug 2 09:06:55 PDT 2006

    the shocking and lurid story of Dreamhost
    
    http://blog.dreamhost.com/2006/08/01/anatomy-of-an-ongoing-disaster/
    
    electricity is important for data centers.
    
    California is short on electricity
    
    Murphy's law applies.
    
    I would say hilarity ensues, but it's the sort of thing that's only
    funny when it's happening to someone else.
    
  • [Eug-lug] SECOND ANNOUNCEMENT: August PLUG Meeting



    David MandelWed Aug 2 01:09:57 PDT 2006

                                 MEETING ANNOUNCEMENT
    
                            The Portland Linux/Unix Group
                                      will meet
                              7 PM Thursday Aug 3, 2006
                                          at
                              Portland State University
                                          in
                                Smith Memorial Center
                                       Room 294
                               On the block bounded by
           SW Montgomery, SW Broadway (7th), SW Harrison, and SW Park (9th)
    
          *******************************************************************
              
                                     PRESENTATION
    
                            Installing Networks with Fiber
    
                                          by
    
                                      Jon Dolan
                             <jon.dolan at oregonstate.edu>
    
    
          Jon Dolan runs the core networking group for Oregon State University 
          and the OSU Open Source Lab as well.  He has been involved 
          with OSU's efforts to "Build a Champagne Internet2 Network on 
          a Beer Budget" as well as OSU's enforcement of the Digital 
          Millennium Copyright Act and many other issues involved in
          running a major campus network.
    
          *******************************************************************
    
              Agenda:
              
                  7:00 - 7:30  Business
                       We will discuss the status of our ongoing projects 
                       including PLUG's monthly Advanced Topics meetings, 
                       PLUG's monthly hands on clinics, PLUG for Education,
                       etc.
    
                  7:30 - 8:30  Presentation
              
                       See above
              
                  9:00 - ...  Beer
                                      The Lucky Labrador Brewing Company
                                      915 SE Hawthorne
              
              
              
                                              David Mandel
                                              Chief Activist
                                              Portland Linux/Unix Group
                                              560 SE Alexander
                                              Corvallis, Oregon 97333
                                              (541) 730-5285 mobile
                                              dmandel at pdxLinux.org
              
              
              P.S.  Biznix which specializes in Linux and UNIX support for 
                    the Business Computer User.
                    As I understand, they haven't been meeting for a while,
                    but intend to have regular meetings again in 2006. 
                    See http://www.Biznix.org for details.
                    
              P.S.  BLUEgroup (The Beaverton Linux Users Education Group)
                    is a group geared toward new users or those interested 
                    in learning more about Linux.  BLUE group meets on the 
                    4th Thursday of every month (except Thanksgiving and 
                    Christmas) at the corner of Beaverton Hillsdale Hwy and 
                    Western ave.  See www.BLUEgroup.org for details.
    
              P.S.  PDXLUG provides a less formal alternative to PLUG 
                    emphasizing the needs of new users.   PDXLUG meets 
                    every second Thursday of the month in southeast Portland.
                    See http://www.PDXLUG.org for details.
    
              P.S.  The Mid Willamette Valley Linux Users Group meets
                    at 6:30 PM on the first Tuesday of the month.
                    They have out grown their meeting location at PEAK
                    and are now meeting on the OSU campus.
                    See http://www.lug.corvallis.or.us/ for details.
                        
              P.S.  The Eugene Linux Users Group meets several times a month.
                    See http://www.euglug.org for details.
    
       ======================================================================
       David Mandel                        http://www.DavidMandel.com
       Portland Linux/Unix Group           http://pdxLinux.org
       LinuxFund                           http://LinuxFund.org
       ======================================================================
    
    
    
    
    
    
    
  • [Eug-lug] Shell script question



    Neil ParkerWed Aug 2 00:11:02 PDT 2006

    Patrick Wade wrote,
    >A shell script runs a for loop iterating a command:
    >
    >#!/bin/sh
    ># foo.sh ; an example script
    >
    >for i in foo bar baz
    >	do find /home/$i
    >	done
    >
    >exit 0
    >
    >If we run this and observe top, we will see three processes; one for
    >foo.sh, another for a child foo.sh (the for loop) and one for find.
    >
    >If i send a kill to the parent foo.sh process, the child foo.sh and find
    >jobs will continue running.  This, from what i gather, is normal *NIX
    >behavior.  My objective, however, is to ensure that foo.sh exits by a
    >certain time, so i have an at job waiting to send it a kill.  Is there
    >an idiom when writing the script to ensure that the kill it receives
    >will kill the child processes as well?  Is there a completely different
    >approach i need to take when the design requirement of termination by a
    >time certain is added?  Exhortations to learn Python are perhaps apropos
    >but useless in the short term.
    
    How about something like this:
    
         #!/bin/sh
         # foo.sh: an example script
         trap 'kill -HUP $!;exit 1' 1 2 3 15
         for i in foo bar baz
         do find /home/$i &
            wait
         done
         exit 0
    
    This makes sure the signal (if it's HUP, INT, QUIT, or TERM) propogates
    to the find command.  The funny business with the "&" and the "wait" is
    so we can get at find's pid using "$!".
    
    Be careful of the trap command...in order to work, the first argument must
    be in SINGLE quotes.
    
                  - Neil Parker
    
  • [Eug-lug] Linux- Mac OS X file exchange: This sounds right



    Allen BrownTue Aug 1 22:16:11 PDT 2006

    T. Joseph Carter wrote:
    > On Tue, Aug 01, 2006 at 11:18:53AM -0700, Allen Brown wrote:
    > 
    >>>suidperl is a thing that lets you run perl scripts setuid.  Normally you
    >>>can't do that anymore than you can run a shell script that way.  suidperl
    >>>is a workaround to make that possible.  It's an evil thing, you don't want
    >>>it, ever.  In fact, I suggest if you're concerned, edit your dpkg status
    >>>file and create a fake entry claiming to be suidperl with a version like
    >>>7:0.0.0 and no files associated with it or anything.
    >>
    >>This doesn't feel right.  Are you sure this is secure and won't
    >>break something else?
    >>
    >>Looking at the dpkg(8) man page I see mention of "hold"
    >>  A package marked to be on hold is not handled by dpkg, unless
    >>  forced to do that with option --force-hold.
    > 
    > 
    > hold doesn't affect uninstalled packages.  However, it seems that the
    > suidperl problem is resolved for you if Ubuntu's solution to the problem
    > comes from Debian.  A non-setuid suidperl effectively does nothing.
    
    The package for it is perl-suid.  It doesn't seem to be
    installed by default because it isn't on my machine,
    at least with Sarge.  But Ubuntu may not be very close to
    Sarge.
    
    I appended to /var/lib/dpkg/status
    Package: perl-suid
    Status: install ok installed
    Version: 7:0.0.0
    Description: perl-suid is a security hole.  This is a dummy.  Do not
      EVER install the real thing.
    
    I have no entries for Priority or Section.  After adding
    that I ran apt-get and didn't notice any problems.
    -- 
    Allen Brown  abrown at peak.org  http://www.peak.org/~abrown/
        o      o     o    o     o    <o     <o>    o>    o
       .|.    \|.   \|/   //    X     \      |    <|    <|>
        /\     >\   /<    >\   /<     >\    /<     >\    /<
    
  • [Eug-lug] Firewall, literally.



    T. Joseph CarterTue Aug 1 21:56:43 PDT 2006

    On Tue, Aug 01, 2006 at 08:24:23AM -0700, Bob Miller wrote:
    > Somebody in Verizon Marcom doesn't know the origin of the term,
    > "firewall".
    > 
    > http://biz.verizon.net/security/network/packages/virtualprivate.asp
    
    3DES encryption!  Finally my network will be safe!