0
SkyDaemon

I am a PERL god

Recommended Posts

I love perl, makes my life so much easier. Just did a move of 150 websites to another ISP(we sold off our unit) and used perl everywhere to automate the transition.

No idea what Unix admins did before perl. Maybe they had to actually do work or something.

Share this post


Link to post
Share on other sites
That's awesome! Perl makes system administration something that can be accomplished. Doing everything in shell scripts or C got really old, really fast. It's nice to be able to automate so many things with PERL.

What did you have to do move everything (cue Mark to talk about rsync)

-=Raistlin
find / -name jumpers -print; cat jumpers $USER > manifest; cd /dev/airplane; more altitude; make jump; cd /pub; more beer;



Share this post


Link to post
Share on other sites
while i'm no FreeBSD / Linux / perl God, i love my Fedora Core laptop and perl.....

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GB d+(--)@ s:@ a- C++> UL++>A++$>S+C+ P+++$> L++$> E--- W++ N o? K? w O M V- PS+ PE+ Y- PGP- t- 5- X+ R tv+ b+> DI++ D G e@> h---- r+++ y+++*
------END GEEK CODE BLOCK------

Share this post


Link to post
Share on other sites
The geek code! Now that's nice :-) I haven't posted one of those in years. I think I can even read yours... ;-)

My workstations are almost all OSes, (including an old version of SunOS (prior to solaris), but most of my time is spent in bash or csh (zsh never was my thing... I'm still an original vi guy too, none of this fru-fru vim stuff.)

-=Raistlin
find / -name jumpers -print; cat jumpers $USER > manifest; cd /dev/airplane; more altitude; make jump; cd /pub; more beer;



Share this post


Link to post
Share on other sites
It's all over the map, and mostly in hacking all sorts of different modules to get along with one another. Although a part of the project that was rather cool and did involve regexs was this apache virtualhost config.

This is a pretty cool apache config, when combined with a wildcard DNS entry in BIND specified with:
########BIND Entry##################
*.domain.tld. IN A 10.0.0.1
########BIND Entry##################

will accept connections to wildcard subdomains, and parse the correct document root based on the subdomain. Thus if you setup a document root, it's immediately accessible via the web through a tertiary domain. While the following isn't ultra elegant it's pretty darn good.

########Apache Config################

LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog "| /usr/local/bin/whw/advxsplitlogfile" vcommon

RewriteEngine On
RewriteLogLevel 2

ErrorDocument 500 /cgi-bin/error_document.pl
ErrorDocument 404 /cgi-bin/error_document.pl

ServerName vhost.webhostworks.net
RewriteCond %{HTTP_HOST} ^(.*)\.([^.]*)\.([^.]*)$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^(.*)\.([^.]*)\.([^.]*)/(.*) /home/www/$1\.$2\.$3/$4 [L]

RewriteCond %{HTTP_HOST} ^(.*)\.([^.]*)$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^(.*)\.([^.]*)/(.*) /home/www/$1\.$2/$3 [L]

RewriteCond %{REQUEST_URI} ^/cgi-bin/
RewriteRule ^/cgi-bin/(.*)$ /usr/local/www/cgi-bin/$1 [L]

RewriteRule ^(.*) %{SERVER_NAME}$1
RewriteRule ^(www|ftp)\.(.*) $2

RewriteCond %{SERVER_NAME} ^(.*)\.([^.]*)\.([^.]*)$
RewriteRule ^(.*)\.([^.]*)\.([^.]*)/(.*) /home/www/$2\.$3/$1/$4 [L]

RewriteRule ^([^/]*)/(.*)$ /home/www/$1/$2

RewriteLog /var/log/httpd/rewrite_log.vhost
RewriteLogLevel 9


AllowOverride All
Options ExecCGI FollowSymLinks Includes
AddHandler cgi-script .cgi .pl
AddHandler server-parsed .html



#######/Apache Config################

This, when combined with a bunch of additional configs to my e-commerce engine, will allow me to create new websites at temporary tertiary URLs almost immediately. Whlie that particularly technology isn't new and extra special, the fact that I can do it with tertiaries makes for an elegant naming convention and UI for customers. The cool perl code comes into play as the underlying e-commerce engine which is abstract and clever enough to adapt to the tertiary convention and then switch over to FQDN when one becomes available (i.e the customer purchases on, or transfers their existing one to our hosting service, or just sticks with the tertiary setup.).

It's pretty cool stuff. :-)

-=Raistlin
find / -name jumpers -print; cat jumpers $USER > manifest; cd /dev/airplane; more altitude; make jump; cd /pub; more beer;



Share this post


Link to post
Share on other sites


FreeBSD 4.6.2-RELEASE-p2 #0: Fri Sep 13 19:06:02 CDT 2002
root@stalker:/usr/src/sys/compile/stalker
Digital Personal Workstation (Miata)
Digital Personal WorkStation 500au, 500MHz
8192 byte page size, 1 processor.
CPU: EV56 (21164A) major=7 minor=0 extensions=0x1

it's old... but you try upgrading a box that lives halfway across the country. :|

Share this post


Link to post
Share on other sites
Hehe, I love what I do :-)

Regexs are my friend ;-) I think it's part of why I like psychology... pattern matching and identification is fun ;-)

-=Raistlin
find / -name jumpers -print; cat jumpers $USER > manifest; cd /dev/airplane; more altitude; make jump; cd /pub; more beer;



Share this post


Link to post
Share on other sites
Until about a month ago, I had a P166 that had been running FreeBSD 4.5 for almost 6 years non-stop. It was a little server that I loved dearly. I'll hand it to those quantum disks... they could just keep going. As well as the P166. It was a cute little system with 64M of EDO RAM in SIMM format. It had a dual speed CD Rom, a 5-1/4" disk, and a 3.5" disk combination drive (pretty fancy eh?). It just kept on humming along though. I finally retired it, and replaced it's functions, but damn it was a great little box.

-=Raistlin
find / -name jumpers -print; cat jumpers $USER > manifest; cd /dev/airplane; more altitude; make jump; cd /pub; more beer;



Share this post


Link to post
Share on other sites
Quote


FreeBSD 4.6.2-RELEASE-p2 #0: Fri Sep 13 19:06:02 CDT 2002



A little behind the times arent ya? ;)

[root@osiris root]# uname -a
FreeBSD osiris.raventhorne.net 4.11-STABLE FreeBSD 4.11-STABLE #1: Thu Mar 10 16:35:27 EST 2005 [email protected]:/usr/obj/usr/src/sys/osiris-2 i386

Try "cvsup" and "make world"! Thats a good combination.

I have a 5.3-RELEASE box too but its not a production server.

I have a Pentium 75 with 32 megs of memory running 4.11-RELEASE that I use for a firewall/router
__

My mighty steed

Share this post


Link to post
Share on other sites
:-P That was the P166 I was talking about :P

I'm running 4.11-Stable for all production servers, although I'm about to try out 5.3 to take advantage of the native 64 mode for my AMD Opterons (muh hahahah)

Actually do I nightly cvsups to freebsd.org from one box and then have all the others cvsup from there. Although lately it seems the ports I'm interestedi n are broken... oh well, building from source seems more organic anyways. (although the ports tree is just -too- cool!)


A Pentium 75? You win the old computer/nerd contest. Using it for a firewall/router is perfect too. My friend did some benchmarking and found his P166 running FreeBSD could out-route a Cisco 2600. I laughed when I watched it...

-=Raistlin
find / -name jumpers -print; cat jumpers $USER > manifest; cd /dev/airplane; more altitude; make jump; cd /pub; more beer;



Share this post


Link to post
Share on other sites
Quote

Some people are afraid of heights. I'm afraid of widths.



I am -NOT- going down that path... ;-)

Planes are scary, they can crash, things can get caught on exit, the landing areas can get crowded, it's really high up, those complicated two canopy systems have electronic devices, and all sorts of new fangled stuff, I can't figure it all out. :-(

I'll stick to simpler solutions... "less is more" right?

;)
-=Raistlin
find / -name jumpers -print; cat jumpers $USER > manifest; cd /dev/airplane; more altitude; make jump; cd /pub; more beer;



Share this post


Link to post
Share on other sites
Quote

although I'm about to try out 5.3 to take advantage of the native 64 mode for my AMD Opterons (muh hahahah)



You might wanna try 5.4 beta. Supposedly 5.4 fixes a bunch of problems, especially with systems with more than 4 gigs of RAM.

now if I can just get the Beasie installed on my dual optie[:/] Me thinks I have to redo the HW RAID to less than a terrabyte for the install to work.
I promise not to TP Davis under canopy.. I promise not to TP Davis under canopy.. eat sushi, get smoochieTTK#1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

0