#!/usr/local/perl5/bin/perl -T # PREAMBLE vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv #for security $ENV{'PATH'}=""; #redirect stderr to stdout so we can see err msgs on the web $|=1; #force flush of buffers after each print open (STDERR, ">&STDOUT") || die "can't dup stdout ($!)\n"; use lib "/w3/utilities"; # my utilities require "timelocal.pl"; #includes 'timegm' for calculations in gmt require "cgi-lib.pl"; #get directory and URL use File::Basename; ($basename,$thisDir) = fileparse($0); #untaint it $thisDir =~ /([a-zA-Z0-9\.\/\~]*)/; $thisDir = $1; $basename =~ /([a-zA-Z0-9\.\/\~]*)/; $basename=$1; #change to the proper directory use Cwd 'chdir'; #use perl version so this isn't unix-dependent chdir ("$thisDir") || die "Content-type: text/html\n\nCan't cd to $thisDir: $!\n"; #get best return address $returnAddress = ($ENV{'REMOTE_HOST'} || $ENV{REMOTE_ADDR} || "(Unknown-Requestor)"); #parse the query string $parse_val = &ReadParse(*input); #useful DEBUGGING info vvvvvvvvvvvvvv #print "Content-type: text/html\n\n"; #print "QS=|$ENV{'QUERY_STRING'}|\n"; #print &PrintVariables(%input); #end useful DEBUGGING info ^^^^^^^^^^^^^^^^^ #set up some nice variables @month=(Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec); @day=(Sun,Mon,Tue,Wed,Thu,Fri,Sat); #get time for log file $time = time(); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($time); #if($year > 99){$year = $year - 100} $year = $year%=100; $thisMonth=$month[$mon]; $to = " to "; $stringout = "$returnAddress"; $blanks = " "; $denied = "...DENIED...."; # END OF PREAMBLE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #execute stuff here $logFile = "${thisDir}LAPS_SOFTWARE.cgi.log"; $x = `/bin/head -1 ../software/tarversions.txt | /bin/tail -1`; $lapsTarFile="laps_$x.tar.gz"; $x=`/bin/head -1 ../software/newlaps_tarversions.txt | /bin/tail -1`; $newlapsTarFile="laps-$x.tar.gz"; $ftpTarFile="laps-$x.html"; $lapsTerrainFile="laps_terrain.tar.gz"; $globalTerrainFile="world_topo_30s"; $lapsDataTarFile="lapsdata"; $lapsCompiledTarFile="compiled"; $version1 = `/bin/head -1 ../software/newlaps_tarversions.txt | /bin/tail -1`; $version2 = `/bin/head -2 ../software/newlaps_tarversions.txt | /bin/tail -1`; $version3 = `/bin/head -3 ../software/newlaps_tarversions.txt | /bin/tail -1`; $version_data = `/bin/head -1 ../software/lapsdata.version`; #allow only certain sites to access this #seawfo.noaa.gov = WFO - Seattle (Dave Ovens : ovens@atmos.washington.edu) #atmos.washington.edu = " " " #ucar.edu = NCAR (Dave Jorgenson : davej@ncar.ucar.edu) #ws3.wwb.noaa.gov = ????? #und.nodak.edu = UND (Bryan Hahn : bryanh@rwic.und.nodak.edu) #und.edu = " " " #140.90.186.10 = WFO - Monterey? (Dave Reynolds : ) #ou.edu = OU - CAPS (Keith Brewster : kbrews@thunder.caps.ou.edu) #204.158.58.7 = WFO - Lubbock (Don Baker : dvbaker@dryline.nws.noaa.gov) #lmco.com = Lockheed (Dave Bennett : laps@cyclone.lmms.lmco.com) #llnl.gov = Lawrence Livermore (Robert Lee : bllee@bleesun2.llnl.gov) #sage.dir.edu = WFO - Reno (Mary Cairns : ) #dri.edu = " " #204.228.191 = " " #climate.usu.edu = Utah State Univ. #dis.anl.gov = Bosnia ( : simunich@dis.anl.gov) #baaqmd.gov = Bay area air quality mangement #192.69.142.6 = Bay area air quality mangement #comet.ucar.edu = SOO from Hanford at COMAP (Larry Greiss : larryg@tamari.comet.ucar.edu) #204.228.183.10 = SOO from Hanford at Hanford (Larry Greiss : gempak@hay.hnx.noaa.gov) #198.177.182.100 = NWS - Western Region #sac.dvn.noaa.gov = WFO - Davenport #ssesco.com = ????? ( : dam@ssesco.com) #192.149.4.6 = Aerojet ( : kreissb@ms4.aes.com) #fw1.hitsdn.com = Raytheon (Magda Hashem : ) #209.186.167.2 = Raytheon (Magda Hashem : ) #gandalf.etl.noaa.gov = NOAA/ETL (Bob Zamora : x6526) #129.193.164.137 = TRW (Al Ronn : Al.Ronn@trw.com) #129.193.164.81 = " " " #129.193.165.8 = " " #PCWML.MSFC.NASA.GOV = NASA/Marshall #jsc.nasa.gov = NOAA/SFMG (NASA/JSC) (Tim Garner : ) #fl.ensco.com = Hughes (John Manobianco : johnm@FL.ENSCO.COM) #koyukuk.gi.alaska.edu = NWS - FAI (Peter Olsson : olsson@koyukuk.gi.alaska.edu) #198.206.34 = NWS - Sterling VA (Steven Zubrick : steven.zubrick@noaa.gov) #wlwx.noaa.gov = " " " #bro.noaa.gov = NWS - BRO (Mark Jackson : Mark.Jackson@noaa.gov) #saic.com = SAIC (David Bacon : bacon@apo.saic.com) #afgwc.af.mil = AFGWC (Jennifer Roman : ) #195.62.164.235 = " " " #aster.com = Aster (Craig Tremback : ) #140.90.12.131 = NWS - ? (Bill Carrigg : William.Carrigg@noaa.gov) #nrlmry.navy.mil = NRL (Monterey) (Qin Xu : xuq@helium.nrlmry.navy.mil) #spock.serfc.noaa.gov = NWS - ATL (Clark Safford : lcs@serfc.noaa.gov) #207.64.72.78 = " " " #lma.fi.upm.es = Technical University of Madrid (Roberto San Jose : roberto@fi.upm.es) #wimauma.tbw.noaa.gov = Ruskin (Tampa) NWSFO (Charlie Paxton : Charlie.Paxton@noaa.gov) #165.212.229.244 = FORETELL (iMSC) (Greg Chesney : greg.chesney@imsc.com) #sheba.oce.orst.edu = Oregon State University (Eric Skyllingstad: skylling@oce.orst.edu) #jhuapl.edu = Johns Hopkins University (Richard M. Giannola: GiannaRM1@APLMSG.JHUAPL.EDU) #128.244.68.129 = Johns Hopkins University (Richard M. Giannola: GiannaRM1@APLMSG.JHUAPL.EDU) #niwa.cri.nz = New Zealand (Nat. Inst. of Water & Atm Res. Jeff Copeland): j.copeland@niwa.cri.nz) #las.noaa.gov = Las Vegas NWSFO (Kim Runk : krunk@cumulus.las.noaa.gov) #thecount.prc.com = IR&D/Litton/PRC weather system (Lee Tsengdar: ) #dryline.nws.noaa.gov = Lubbock NWSFO (Loren Phillips : loren.phillips@noaa.gov) #ralph.contact-paging.com = MCSD Denver (Ralph Forsythe : ralph@contact-paging.com) #204.133.18* = " " " #140.90.192.191 = NCEP Mesoscale Branch (Matthew Pyle :) if($returnAddress =~ /goodplace1\.com/ || # $returnAddress =~ /noaa\.gov/ || $returnAddress =~ /fsl\.noaa\.gov/ || $returnAddress =~ /seawfo\.noaa\.gov/ || $returnAddress =~ /atmos\.washington\.edu/ || $returnAddress =~ /ucar\.edu/ || $returnAddress =~ /ws3\.wwb\.noaa\.gov/ || $returnAddress =~ /und\.nodak\.edu/ || $returnAddress =~ /und\.edu/ || $returnAddress =~ /140\.90\.186\.10/ || $returnAddress =~ /ou\.edu/ || $returnAddress =~ /204\.158\.58\.7/ || $returnAddress =~ /lmco\.com/ || $returnAddress =~ /llnl\.gov/ || $returnAddress =~ /sage\.dir\.edu/ || $returnAddress =~ /dri\.edu/ || $returnAddress =~ /204\.228\.191/ || $returnAddress =~ /CIRA\.ColoState\.EDU/ || # CIRA.ColoState.EDU = CIRA $returnAddress =~ /climate\.usu\.edu/ || $returnAddress =~ /dis\.anl\.gov/ || $returnAddress =~ /baaqmd\.gov/ || $returnAddress =~ /192\.69\.142\.6/ || $returnAddress =~ /comet\.ucar\.edu/ || $returnAddress =~ /204\.228\.183\.10/ || $returnAddress =~ /198\.177\.182\.100/ || $returnAddress =~ /sac\.dvn\.noaa\.gov/ || $returnAddress =~ /ssesco\.com/ || $returnAddress =~ /192\.149\.4\.6/ || $returnAddress =~ /fw1\.hitsdn\.com/ || $returnAddress =~ /209\.186\.167\.2/ || $returnAddress =~ /gandalf\.etl\.noaa\.gov/ || $returnAddress =~ /129\.193\.164\.137/ || $returnAddress =~ /129\.193\.164\.81/ || $returnAddress =~ /129\.193\.165\.8/ || $returnAddress =~ /PCWML\.MSFC\.NASA\.GOV/ || $returnAddress =~ /jsc\.nasa\.gov/ || $returnAddress =~ /fl\.ensco\.com/ || $returnAddress =~ /koyukuk\.gi\.alaska\.edu/ || $returnAddress =~ /198\.206\.34/ || $returnAddress =~ /wlwx\.noaa\.gov/ || $returnAddress =~ /bro\.noaa\.gov/ || $returnAddress =~ /saic\.com/ || $returnAddress =~ /afgwc\.af\.mil/ || $returnAddress =~ /195\.62\.164\.235/ || $returnAddress =~ /aster\.com/ || $returnAddress =~ /140\.90\.12\.131/ || $returnAddress =~ /nrlmry\.navy\.mil/ || $returnAddress =~ /spock\.serfc\.noaa\.gov/ || $returnAddress =~ /207\.64\.72\.78/ || $returnAddress =~ /lma\.fi\.upm\.es/ || # Europe $returnAddress =~ /smr\.arpa\.emr\.it/ || # Italy (Paolo Alberoni : p.alberoni@smr.arpa.emr.it) $returnAddress =~ /aquila\.infn\.it/ || # University of L'Aquila, Italy (Rossella Ferretti: ) $returnAddress =~ /193\.204\.130\.155/ || # Abruzzo, L'Aquila (Italy) (Memmo Adelaide : memmo@tesre.bo.cnr.it) $returnAddress =~ /tin\.it/ || # Telespazio (Luca Pietranera : gometpz@tin.it) $returnAddress =~ /digsys\.bg/ || # Varna Bulgaria (Angel Dimitrov : stormlaboratory@yahoo.com) $returnAddress =~ /skiron\.mg\.uoa\.gr/ || # University of Athens (George Kallos) : kallos@skiron.mg.uoa.gr) $returnAddress =~ /wimauma\.tbw\.noaa\.gov/ || $returnAddress =~ /165\.212\.229\.244/ || $returnAddress =~ /sheba\.oce\.orst\.edu/ || $returnAddress =~ /jhuapl\.edu/ || $returnAddress =~ /128\.244\.68\.129/ || $returnAddress =~ /niwa\.cri\.nz/ || $returnAddress =~ /ncd\.noaa\.gov/ || # NOS (NWS - Sterling) (Kevin Fuell : kevin.fuell@noaa.gov) $returnAddress =~ /las\.noaa\.gov/ || $returnAddress =~ /thecount\.prc\.com/ || $returnAddress =~ /dryline\.nws\.noaa\.gov/ || $returnAddress =~ /ralph\.contact-paging\.com/ || $returnAddress =~ /204\.133\.18/ || $returnAddress =~ /colorado-research\.com/ || # Colorado Research Assoc. (John Snook : snook@colorado-research.com) $returnAddress =~ /209\.38\.140\.39/ || # " " $returnAddress =~ /plansys\.com/ || # PSI (Bob Wright) : rwright@plansys.com) $returnAddress =~ /140\.90\.192\.191/ || $returnAddress =~ /137\.51\.15\.225/ || # Archive Systems (Michael Robinson : mrobinson@logicon.com) $returnAddress =~ /163\.29\.179\.14/ || # Taiwan CWB (Yi-Chih Huang : jh@cwb.gov.tw) $returnAddress =~ /cwb\.gov\.tw/ || # " " " $returnAddress =~ /210\.219\.35\.3/ || # Korea (iris.metri.re.kr) (Yong Sang Kim : yskim@fsl.noaa.gov) $returnAddress =~ /metri\.re\.kr/ || # " " " $returnAddress =~ /crp\.noaa\.gov/ || # NWS - CRP (Waylon Collins : waylon.collins@noaa.gov) $returnAddress =~ /boeing\.com/ || # Boeing (Justin Davidson ) $returnAddress =~ /simepar\.br/ || # Brasilia (Jose Eduardo Prates : jeprates@simepar.br) $returnAddress =~ /192\.168\.99\.71/ || # Brazil (Jim Edwards : jedwards@inmet.gov.br) $returnAddress =~ /200\.252\.242\.89/ || # " " " $returnAddress =~ /inmet\.gov\.br/ || # " " " $returnAddress =~ /saopaulo\.sgi\.com/ || # " " " $returnAddress =~ /199\.45\.218/ || # Quetzal Computational Assoc (Daniel R. Fuka : dan@quetzalcoatl.com) $returnAddress =~ /syncrasy\.com/ || # " " $returnAddress =~ /wsicorp\.com/ || # WSI (Steve Honey : sjhoney@wsicorp.com) $returnAddress =~ /another_place\.com/ || $returnAddress =~ /last_place\.com/ ) { #let this guy in } else { #throw this guy out open(LOG,">>$logFile") || die "Content-type: text/html\n\nCan't open $logFile: $!\n"; # printf LOG "%10d%02d%02d%02d%02d to $returnAddress " . # "$input{'request'}\n ... DENIED... \n" # ,$year,$mon+1,$mday,$hour,$min # ; printf LOG "%01s%02d%02d%02d%02d%02d%35s%04s%05s" . "\n" ,$blanks,$year,$mon+1,$mday,$hour,$min,$denied,$to,$stringout ; close LOG; die "Content-type: text/html\n\n Sorry, Access Denied. Please contact the LAPS group (mcginley\@fsl\.noaa\.gov) if you wish to register for free access. We will need your IP address (numeric characters) and domain name (alphabetic characters). There is no restriction on the use of LAPS.\n"; } #restrict.sh takes care of telling the user s/he is denied #system("restrict.sh $returnAddress $allowedHosts"); #system("/w3/lapb/cgi/restrict.sh $returnAddress $allowedHosts >> $logFile"); #if ($? == 1) # { # echo "`date -u +%t%y%m%d%H%M`, .........DENIED......... $returnAddress" >> $logFile; # print "........DENIED......... $returnAddress" >> $logFile; # } if($parse_val == 0 ) { #original call, with no arguments #now tell the world print<<"EOI"; Content-Type: text/html LAPS software

Notice: We are experiencing some intermittent server or network problems that can corrupt the downloading of tar files. If you find that you cannot 'gunzip' a tar file, please download the file and try again a couple of times. You might also send us an email reporting the details to help us track it down. Thank you for your patience.

Latest release of LAPS software ($version2):


(Back to LAPB homepage)

Feedback: laps-bugs\@fsl.noaa.gov | LAPS Users Mailing List

navigation bar FSL whatsnew organization current weather data projects publications software search our site FSL
[ FSL | What's New | Organization | Weather | Data | Projects | Publications | Software | Search ]

Last modified: Thu Feb 4 11:26:17 1999 EOI } else { print <<"EOI"; Location: ../software/restrct/$input{'request'} EOI } # POSTLUDE vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv #log accesses open(LOG,">>$logFile") || die "Content-type: text/html\n\nCan't open $logFile: $!\n"; printf LOG "%01s%02d%02d%02d%02d%02d%35s%04s%05s" . "\n" ,$blanks,$year,$mon+1,$mday,$hour,$min,$input{'request'},$to,$stringout ; close LOG;