HELP! with Pico please.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mr. Mike
    Confirmed User
    • Aug 2004
    • 913

    #1

    HELP! with Pico please.

    How can I edit multiple files at once?

    the star is not working.
    Sig for sale. ICQ: 163-545-054
  • Apache_A
    Confirmed User
    • May 2004
    • 434

    #2
    Is that possible?
    ICQ:2116226

    Comment

    • notjoe
      Confirmed User
      • May 2002
      • 5599

      #3
      Originally posted by Mr. Mike
      How can I edit multiple files at once?

      the star is not working.

      Why not run screen?

      Comment

      • Mr. Mike
        Confirmed User
        • Aug 2004
        • 913

        #4
        Im hoping it is.

        Well, here is my problem, I cant keep uploading an htaccess file to every virtual domain, everytime I change it. Problem is, I cant get my htaccess code to work in apache. All I can work is the error docs.

        I need to get these to function:

        Deny from {ip}

        and

        RewriteRule .*\.(gif|GIF|Gif|jpg|JPG|jpeg)$ http://www.mydomain.com/error.jpg [R,NC]

        but everytime I add these lines, apache dies
        Sig for sale. ICQ: 163-545-054

        Comment

        • Mr. Mike
          Confirmed User
          • Aug 2004
          • 913

          #5
          Originally posted by notjoe
          Why not run screen?
          command screen? What does that do? If its a cut and paste job, it would still be kind of a pain cause thats over 100 files to paste.
          Sig for sale. ICQ: 163-545-054

          Comment

          • notjoe
            Confirmed User
            • May 2002
            • 5599

            #6
            Originally posted by Mr. Mike
            command screen? What does that do? If its a cut and paste job, it would still be kind of a pain cause thats over 100 files to paste.
            Screen is(like) a multitasking program which allows you to basically run multiple shells from under your login and by using keys you can switch from shell to shell to shell.

            As for your apache problem, make sure that you're not trying to set something which can only be set from the httpd.conf file.

            Comment

            • swedguy
              Confirmed User
              • Jan 2002
              • 7981

              #7
              A quick and dirty!

              I tried to get it to a one-liner but I must've missed something. This way works at least.

              Create a file that is called "edit.sh" and add this to it:

              #!/bin/bash

              echo "Deny from someip" >> $1
              echo "RewriteRule .*\.(gif|GIF|Gif|jpg|JPG|jpeg)$ http://www.mydomain.com/error.jpg [R,NC]" >> $1
              The ">>" will append the text to the .htaccess. Change it to ">" if you want to over write.

              Change the file to "chmod 755 edit.sh".

              Now run this from the main directory where you can find the .htaccess files:

              find . -name .htaccess -maxdepth 2 -exec ./edit.sh {} \;
              Change "./edit.sh" to the correct path to edit.sh.
              "-maxdepth 2" will only look for .htaccess maximum 2 directories deep, change to suit your needs.

              DISCLAIMER!
              If you fuck up, I'm not responsible
              It worked for me. So try it in a test directory first and see if it will look the way you want it.

              Comment

              Working...