GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   HELP! with Pico please. (https://gfy.com/showthread.php?t=406572)

Mr. Mike 12-22-2004 04:45 AM

HELP! with Pico please.
 
How can I edit multiple files at once?

the star is not working.

Apache_A 12-22-2004 04:48 AM

Is that possible?

notjoe 12-22-2004 04:52 AM

Quote:

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

the star is not working.


Why not run screen?

Mr. Mike 12-22-2004 04:53 AM

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 :(

Mr. Mike 12-22-2004 04:55 AM

Quote:

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.

notjoe 12-22-2004 05:18 AM

Quote:

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.

swedguy 12-22-2004 05:22 AM

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:

Quote:

#!/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:

Quote:

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 :winkwink:
It worked for me. So try it in a test directory first and see if it will look the way you want it.


All times are GMT -7. The time now is 03:57 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123