Development





Here is where i keep scripts, perl snippets and similar, they all work for me, if you try them there is no warranty and i will not be held responsible in any way. in other words, you run them completely at your own risk.

so why script cgi's in sh or bash, why do shell scripting at all? well cuz it's fun is the "why" and you get to maintain full control even if you aren't skilled in perl or C or C++. Of the shell ones, nearly all need proccgi

i do want one thing, if you use any of these scripts, i want a small link back to me somewhere, along the lines of "webbadbot banner by wlofie" where wlofie is a hotlink for this page, thanks( hey you can always stick it in on your links page or something)

here is an example of how i work, it's like a diary that i kept to see the progress of the code




NEW!!! scripting 101: bash and perl


NEW!!! Support forum for these scripts


ASP, I don't do asp!!! The reason you people who searched for asp came here is because there are referances to asp, from my wife's homework that i redid in perl to see if i could do it, here is however a page with a hint for asp and one for all webdesigners from a very smart lady, my wife two tricks, one for asp developers, one for web designers



Pro_tech_snip these aren't really scripts and definately not mine, they are hints and tips i've been given by professional support techs i know :-)




Domchk:
This script in bash, uses procgi (proccgi?) and "fwhois" (alt "whois") "nslookup" and "dig" as well as "host" to gain some information about the ip number or hostname you give it, it's a cgi. and not very secure, or pretty.

The scripts and html page above constitute "domchk"

domchk has these "dependencies":




asp fake (homework fake):
This script got made to see if i could do in perl and shell what spring did in asp for a homework, basically it's a redirect with a form choice..make the choice and get redirected. it's a cgi.

example asp fake demo

in that form i mention security...it's not really as bad as all that, but...

it DOES allow someone with bad intent and some html cgi knowhow to make a script or a page that uses up server resources, by for instance using that cgi to forward from their own site




Output example of my bash diary script
This got made cause i was:
the features being: it's a command line bash script(not cgi, although the comments system is cgi) that makes and indexes a diary, (it is _not_ template based, the template is in the script so fiddly to mess with). There is no download but mail me and i'll send it

dependencies: linux shell (bash) and commands like mv, rm, echo, grep, sed and touch



crawltrap.zip, an ugly little shellscript cgi, it uses proccgi, and works only for xitami webservers. it's one and only purpose in life is to be at the end of a link that is forbidden in robots.txt, click that link, and the ip number is added to the ip ban list for xitami, thus automating the whole "bad bot, papa spank" procedure. it also provides a log with the date, time, useragent, referer and ip that got banned


-----

crawltrap_pl.zip an ugly perl script to do exactly (even down to logging) the same as the shellscript cgi above. it has been tested on linux and windows98 with active perl, but is written so it should handle windows as well, it's not overly well documented, but it should be easy enough to use

it doesn't have any dependencies outside of perl5, if you got perl, it'll most likely work, it doesn't even use cgi.pm

if you use one of the two above "auto ipban" scripts for xitami i'd appreciate a small link back to me

"this site protected by wlofie's ipban bad bots script" it doesn't have to be on the front page, just somewhere not too obscure

thanks




apache bad bot ipban I found this one on one of the webmasters forums, so it's NOT MINE, it's for apache, not xitami, but the priciple is the same, ban bad bots. i keep it because i need to investigate what it says about "WAP's reading all" (it's in a comment)




Date.pl,

This is a subroutine to zeropad and correct the date that perl gives. It gives "human readable" numbers all corrected and done, use it at ya own risk

Date_pl.txt It was originally written to be part of my rewrite of "diary" into perl, but has now become part of my perl "lego piece" collection




htmlmaker

originally this was a "lego" piece for my diary, then i changed it a bit and now it basically takes 3 switches

htmlmaker2.pl infile templatefile outputfile

htmlmaker2.pl is the command name

infile is a text file (contains the text you want to put into the page)

templatefile is a html file containing the template for the page you want done as well as the special tag ENTRY (it is in there)

and

outputfile is the html file it writes the finished product to

as usual, no warranty or guarantees




extremely simple htmldiary maker
it's a command line perl script, it takes a given filename (just re-edit it) and adds it to one big ugly (eventually) html file, (the diary all ends up on one large file), it does date stamp all entries

it is NOT the one with an example above, this is a perl snippet only




A simple perl counter, it needs nothing more than perl, it doesn't need ssi

but..it only counts one page (this version at least)

just chmod the script to 755 the dat file to 666 alt 660 alt 600 and the html file to the same

here is an example of it in action

features i'll add when i feel up to it

-----------------------
new counter, variable ip backlog, (see above)

counterip.zip is the download

example of it in action




getting a lot of code red or nimda lines in your log? want to clean it up?

these are the ones i made for a friend, both sh and perl versions (couple of em actually)

logfixer.zip




Soon (hopefully) diary script perl. it's still very much in testing and not done

perhaps this "diary v0.001 alpha" tells a bit about how confident i am in it as yet




ifdomain: this is the last version of a script i've been using and modifying for ages, basically it does a "host" on multiple tld's with the same domainname without tld

ie "wlofie.dyndns" .com .org .net .gov .se .uk .whatevertld




whois-magix.txt, this one got made partially as an experiment and partially for my bash 101 series

it tries to do a 2 sweep look up on whois servers, ie, it looks up the short record, then tries to filter out the referance to the 'real looking up place' and use that for the second sweep




New!

jadmaker and genscript v1.1
A pair of scripts (bash/sh):
jadmaker...extracts /META-INF/MANIFEST.MF files from jar files. After extraction it checks if it contains size and url "fields" and if they don't exist it creates them and puts them in the jad file too (it also dos2unixes the output so you don't have to).

genscript...uses jad files to make a wml file list for downloads (cards and all).

dependencies:
unzip
(and the usual sed grep cut)

New!

genscript v0.1
Does what the above genscript does, only better and in perl:
This one numbers the index files sequentially and has adjustable "cards per index file" output

needs existing jad files, so jadmaker in the above jad_wmlgen is recommended




more to come..always!!!


w0nderer