Archive for the ‘Perl’ Category
Backup of Directories, version 3.5 – perl script for backup copies of directories of sites of WEB server.
Example of configuration:
Every now and again perl will become broken or corrupt either because of something we’ve done or, like most things, out of nowhere with now warning. Run the following:
If you have for example:
[root@server]# suexec -V
-D AP_DOC_ROOT=”/var/www” <<<<<<<<<<<<<<<<<<<<<<<< correct place for suexec scripts -D AP_GID_MIN=100 -D AP_HTTPD_USER="apache" -D AP_LOG_EXEC="/var/log/httpd/suexec.log" -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin" -D AP_UID_MIN=500 -D AP_USERDIR_SUFFIX="public_html" [root@server]# then: 1.) create a directory /var/www/cgi-bin (owner root / chmod 0701) 2.) create a directory /var/www/cgi-bin/YOUR_CUSTOMER (owner YOUR_CUSTOMER / chmod 0701) 3.) add symlink $HOME_of_virtualhost/cgi-bin which points to /var/www/cgi-bin/YOUR_CUSTOMER 4.) add path option which allows executing scripts (perl etc etc) in $HOME_of_virtualhost/cgi-bin CGI will work.
#!/usr/bin/perl use strict; use warnings; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser warningsToBrowser); #print header(-type=>'text/plain'); print header( -charset => 'utf-8', -refresh => '10' ); print start_html(); my $info1 = `cat /proc/mdstat`; print "...html"; print end_html();
No, this guide is not for fools but by a fool, who had kept wondering how CGI.pm is supposed to work and finally got a clue. So here’s how (I think) it works in simplest cases. I hope this might make some other people’s learning curve a little better.
- THESE ALL WRONG !!!!!!
use Cwd qw(abs_path cwd); my $cwd = cwd(); my $abs_path = abs_path(); my $FILE = __FILE__; print "1. $cwd $abs_path $FILE\n"; Read the rest of this entry »
Who the heck installed WWW::AdventCalendar on the server?
Imagine this not-exactly-hypothetical conversation:
<Alice> Who the heck installed WWW::AdventCalendar on the server? <Bob> I did. Why? <Alice> We're trying to set up a new server just like it, and we found this installed, and it wants all kinds of crazy prerequisites. Why on Earth do we need this in production? <Bob> Oh, we don't. I just wanted to play around with it. <Alice> ...so you installed it globally? <Bob> Well, how else was I going to play with it?
The fact that regex doesn’t support inverse matching is not entirely true. You can mimic this behavior by using negative look-arounds:
The regex above will match any string, or line without a line break, not containing the (sub) string ‘hede’.As mentioned, this is not something regex is “good” at (or should do), but still, it is possible.
in process …