Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
usr/share/vim/vim72/macros/urm/examples000066600000002104150777022630014060 0ustar00Note that enough temporary registers should be provided for each example. All should be initialised to 0. Initial register values for benchmarking: 0,8,3,0,... Performed on a Xenix 386/16: Operation [sec, kbyte tmp space]: program Asym. Diff.[ 7, 4]: (s2;s3)3. Abs. Diff. [90,81]: (a1;a4;s2)2; (a2;s1)1; (a1;a5;s3)3; (a3;s1)1; (s2;s3)3; (s5;s4)4; (a2;s5)5. Add [ 7, 4]: (a2;s3)3. Mult [227, 161]: (a4;a5;s2)2; ((a2;s4)4; s3; (a1;a4;s5)5; (a5;s1)1)3. Copy [ 48, 25]: (a1;a3;s2)2; (a2;s1)1. sign [ 30, 17]: (a3;s2)2; (a2;(s3)3)3. !sign[ 36, 28]: (a3;s2)2; (a2;(s3)3)3; a3; (s3;s2)2; (s3;a2)3. Div [630,1522]: (a9;s2)2; (a2;a10;s3)3; (a3;s2)2; (a2;(s3)3)3; a3; (s3;s2)2; (s3;a2)3; (a2)2;(a2;s9)9;(a3;s10)10; (a9;a10;s2)2; (a11;a12;s3)3; (a2;s12)12; (a3;s9)9; (s2;s3)3; (a3;s2)2; (a2;(s3)3)3; a3; (s3;s2)2; (s3;a2)3; (a1;s2)2; (a2;s10)10; (a3;s11)11; ((a12;a13;s3)3; (a3;s13)13; (s2;s3)3; (a3;s12)12; a14; (s1)1; (a9;a10;s2)2; (a11;a12;s3)3; (a2;s12)12; (a3;s9)9; (s2;s3)3; (a3;s2)2; (a2;(s3)3)3; a3; (s3;s2)2; (s3;a2)3; (a1;s2)2; (a2;s10)10; (a3;s11)11)1; (s2)2; (a2;s14)14. fstab.example2000066600000003103150777747460007333 0ustar00# /etc/fstab: static file system information. # # The following is an example. Please see fstab(5) for further details. # Please refer to mount(1) for a complete description of mount options. # # Format: # # # dump(8) uses the field to determine which file systems need # to be dumped. fsck(8) uses the column to determine which file # systems need to be checked--the root file system should have a 1 in # this field, other file systems a 2, and any file systems that should # not be checked (such as MS-DOS or NFS file systems) a 0. # # The `sw' option indicates that the swap partition is to be activated # with `swapon -a'. /dev/hda2 none swap sw 0 0 # The `bsdgroups' option indicates that the file system is to be mounted # with BSD semantics (files inherit the group ownership of the directory # in which they live). `ro' can be used to mount a file system read-only. /dev/hda3 / ext2 defaults 0 1 /dev/hda5 /home ext2 defaults 0 2 /dev/hda6 /var ext2 defaults 0 2 /dev/hda7 /usr ext2 defaults,ro 0 2 /dev/hda8 /usr/local ext2 defaults,bsdgroups 0 2 # The `noauto' option indicates that the file system should not be mounted # with `mount -a'. `user' indicates that normal users are allowed to mount # the file system. /dev/cdrom /cdrom iso9660 defaults,noauto,ro,user 0 0 /dev/fd0 /floppy minix defaults,noauto,user 0 0 /dev/fd1 /floppy minix defaults,noauto,user 0 0 # NFS file systems: server:/export/usr /usr nfs defaults 0 0 # proc file system: proc /proc proc defaults 0 0 sfdisk.examples.gz000066600000005547150777747460010255 0ustar00Z[w۸~~ŜɉPqN- )B%@_ߙIQ8MO& r}3l(z6REf~ vllcz+yn!S$䕂IScSbs}hQe,!% J=iqm@fPMt q:E`&/q-Mj$"Og:O- ֠ ~4V͌% FG҆λdOeo~;?{pb9'2'+T6!FR玎ufjW*I FҒxM ?=/*\8D!N'zbq 7ϫaѨKuret87K=IJvȩz tXG Oҧx8նPIMޒfК$*ReJ1}>CHtF"RHE[R6T.>@DJ̭;wh R"Ok8jWg)*.| TLڈB O+U4*v(B"td6Fu]E#xV$TYPY•zI|Fuo[sQ03Fp맒J@OS}Hj:ԍU@Dyv8S VT7VbKRMBdF?qF1ͥ?F-q)g,1.*i ė%':v+GAsyvC7\p#T+\е/8:RmZ.w5ʌi~ h<"tINNz(Q6/-5E@bȔ 84 +!:Ec ݩ}Uj8GYCt%3E,lY # CfC@T_m'drP{ { ɗvq鴺_I) gȻ5=f/ܟCؚKnͰ+-bԔHհ%DH&X>W`"Y*"8Vҍkb$C\ BW3Y誉DQ4#ܐ6Nu/CY;'F8/Nd$[gQ8)B"x9 QP~ mO2^#ơiy=z7.̭C]ڝU~5ahc_ϺXB:]R -WX"pSyfsKžcS\Zл:r=7peg;Px$եv~D,cY~fx5<1ѕ1*TRF ƨ^'~4VqoB 8k 4*0{⦂J:0k@='u"_#ey m˱q+MXDŞk't݋,^*wRj82ɍv/\$[2nVsڼF`6_>pE3%ը%r̪S[X805drk* }3*Mh?s}{HV"}MAoSԅ*U-w~wx6'OP^B*tBߟt 1.Wj?m!rUѴгQ(Y<^4o s9)vYx얞/s5rEюkR7xǭ; exa|C2m/FY!Xk:^L!es7w]*I<[ F˴+av.W2ɋj1 GJKnismމESd[4Dc hSF.C<<:=HR97>k8nW$o_]Psr^4@ ǵ3t\4%OU Sb<Ԡ=fڬ)5d30X 40lVoU.EkᅻZ_I_lhWjfSv-Y(wӳͤx}{_qܬ&|\.i<1}O5=ԨjxXU?>ia3_:GOS3\9^5iW iZlvLo53῝_n_s/= TCY"6n& >0͙y] ʶt"kQ1ޜ8(wz[찎qbO#ḱrg]^XNR۳ lrQ>܀.8ꋖ{- S(E6L1<. u& +GF%qLUʋ`U9h &a>3JD. ?!jn*Q[(Ugz*tNf20M<>S!uh|hUt9a$5Z=q ~Z;=UfFG߶ǻU>6} +{PN L}`QEү(ynsm솚{F_#"yֺX4ֈq!Z+M9hV wyׂgm-b.%%YUfa>ՃnlnDϯjU/dev/null 2>&1` ; [ $? = 4 ] ; then echo "Enhanced getopt(1)" else echo "Old getopt(1)" fi getopt-parse.tcsh000066600000004315150777747460010100 0ustar00#!/bin/tcsh # A small example program for using the new getopt(1) program. # This program will only work with tcsh(1) # An similar program using the bash(1) script language can be found # as parse.bash # Example input and output (from the tcsh prompt): # ./parse.tcsh -a par1 'another arg' --c-long 'wow\!*\?' -cmore -b " very long " # Option a # Option c, no argument # Option c, argument `more' # Option b, argument ` very long ' # Remaining arguments: # --> `par1' # --> `another arg' # --> `wow!*\?' # Note that we had to escape the exclamation mark in the wow-argument. This # is _not_ a problem with getopt, but with the tcsh command parsing. If you # would give the same line from the bash prompt (ie. call ./parse.tcsh), # you could remove the exclamation mark. # This is a bit tricky. We use a temp variable, to be able to check the # return value of getopt (eval nukes it). argv contains the command arguments # as a list. The ':q` copies that list without doing any substitutions: # each element of argv becomes a separate argument for getopt. The braces # are needed because the result is also a list. set temp=(`getopt -s tcsh -o ab:c:: --long a-long,b-long:,c-long:: -- $argv:q`) if ($? != 0) then echo "Terminating..." >/dev/stderr exit 1 endif # Now we do the eval part. As the result is a list, we need braces. But they # must be quoted, because they must be evaluated when the eval is called. # The 'q` stops doing any silly substitutions. eval set argv=\($temp:q\) while (1) switch($1:q) case -a: case --a-long: echo "Option a" ; shift breaksw; case -b: case --b-long: echo "Option b, argument "\`$2:q\' ; shift ; shift breaksw case -c: case --c-long: # c has an optional argument. As we are in quoted mode, # an empty parameter will be generated if its optional # argument is not found. if ($2:q == "") then echo "Option c, no argument" else echo "Option c, argument "\`$2:q\' endif shift; shift breaksw case --: shift break default: echo "Internal error!" ; exit 1 endsw end echo "Remaining arguments:" # foreach el ($argv:q) created problems for some tcsh-versions (at least # 6.02). So we use another shift-loop here: while ($#argv > 0) echo '--> '\`$1:q\' shift end getopt-parse.bash000066600000002734150777747460010057 0ustar00#!/bin/bash # A small example program for using the new getopt(1) program. # This program will only work with bash(1) # An similar program using the tcsh(1) script language can be found # as parse.tcsh # Example input and output (from the bash prompt): # ./parse.bash -a par1 'another arg' --c-long 'wow!*\?' -cmore -b " very long " # Option a # Option c, no argument # Option c, argument `more' # Option b, argument ` very long ' # Remaining arguments: # --> `par1' # --> `another arg' # --> `wow!*\?' # Note that we use `"$@"' to let each command-line parameter expand to a # separate word. The quotes around `$@' are essential! # We need TEMP as the `eval set --' would nuke the return value of getopt. TEMP=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \ -n 'example.bash' -- "$@"` if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi # Note the quotes around `$TEMP': they are essential! eval set -- "$TEMP" while true ; do case "$1" in -a|--a-long) echo "Option a" ; shift ;; -b|--b-long) echo "Option b, argument \`$2'" ; shift 2 ;; -c|--c-long) # c has an optional argument. As we are in quoted mode, # an empty parameter will be generated if its optional # argument is not found. case "$2" in "") echo "Option c, no argument"; shift 2 ;; *) echo "Option c, argument \`$2'" ; shift 2 ;; esac ;; --) shift ; break ;; *) echo "Internal error!" ; exit 1 ;; esac done echo "Remaining arguments:" for arg do echo '--> '"\`$arg'" ; done getopt-test.tcsh000066600000000170150777747460007740 0ustar00#!/bin/tcsh getopt -T >&/dev/null if ( $status == 4) then echo "Enhanced getopt(1)" else echo "Old getopt(1)" endif example-0.3.x.php000066600000010572151000035310007451 0ustar00 PHPMORPHY_STORAGE_FILE, // Enable prediction by suffix 'predict_by_suffix' => true, // Enable prediction by prefix 'predict_by_db' => true, // TODO: comment this 'graminfo_as_text' => true, ); // Path to directory where dictionaries located $dir = dirname(__FILE__) . '/../dicts'; $lang = 'ru_RU'; // Create phpMorphy instance try { $morphy = new phpMorphy($dir, $lang, $opts); } catch(phpMorphy_Exception $e) { die('Error occured while creating phpMorphy instance: ' . PHP_EOL . $e); } // All words in dictionary in UPPER CASE, so don`t forget set proper locale via setlocale(...) call // $morphy->getEncoding() returns dictionary encoding $words = array('', '', '', '', '', 'abc'); if(function_exists('iconv')) { foreach($words as &$word) { $word = iconv('windows-1251', $morphy->getEncoding(), $word); } unset($word); } try { foreach($words as $word) { // by default, phpMorphy finds $word in dictionary and when nothig found, try to predict them // you can change this behaviour, via second argument to getXXX or findWord methods $base = $morphy->getBaseForm($word); $all = $morphy->getAllForms($word); $part_of_speech = $morphy->getPartOfSpeech($word); // $base = $morphy->getBaseForm($word, phpMorphy::NORMAL); // normal behaviour // $base = $morphy->getBaseForm($word, phpMorphy::IGNORE_PREDICT); // don`t use prediction // $base = $morphy->getBaseForm($word, phpMorphy::ONLY_PREDICT); // always predict word $is_predicted = $morphy->isLastPredicted(); // or $morphy->getLastPredictionType() == phpMorphy::PREDICT_BY_NONE $is_predicted_by_db = $morphy->getLastPredictionType() == phpMorphy::PREDICT_BY_DB; $is_predicted_by_suffix = $morphy->getLastPredictionType() == phpMorphy::PREDICT_BY_SUFFIX; // this used for deep analysis $collection = $morphy->findWord($word); // or var_dump($morphy->getAllFormsWithGramInfo($word)); for debug if(false === $collection) { echo $word, " NOT FOUND\n"; continue; } else { } echo $is_predicted ? '-' : '+', $word, "\n"; echo 'lemmas: ', implode(', ', $base), "\n"; echo 'all: ', implode(', ', $all), "\n"; echo 'poses: ', implode(', ', $part_of_speech), "\n"; echo "\n"; // $collection collection of paradigm for given word // TODO: $collection->getByPartOfSpeech(...); foreach($collection as $paradigm) { // TODO: $paradigm->getBaseForm(); // TODO: $paradigm->getAllForms(); // TODO: $paradigm->hasGrammems(array('', '')); // TODO: $paradigm->getWordFormsByGrammems(array('', '')); // TODO: $paradigm->hasPartOfSpeech(''); // TODO: $paradigm->getWordFormsByPartOfSpeech(''); echo "lemma: ", $paradigm[0]->getWord(), "\n"; foreach($paradigm->getFoundWordForm() as $found_word_form) { echo $found_word_form->getWord(), ' ', $found_word_form->getPartOfSpeech(), ' ', '(', implode(', ', $found_word_form->getGrammems()), ')', "\n"; } echo "\n"; foreach($paradigm as $word_form) { // TODO: $word_form->getWord(); // TODO: $word_form->getFormNo(); // TODO: $word_form->getGrammems(); // TODO: $word_form->getPartOfSpeech(); // TODO: $word_form->hasGrammems(array('', '')); } } echo "--\n"; } } catch(phpMorphy_Exception $e) { die('Error occured while text processing: ' . $e->getMessage()); } example.php000066600000007010151000035310006676 0ustar00 PHPMORPHY_STORAGE_FILE, // Extend graminfo for getAllFormsWithGramInfo method call 'with_gramtab' => false, // Enable prediction by suffix 'predict_by_suffix' => true, // Enable prediction by prefix 'predict_by_db' => true ); // Path to directory where dictionaries located $dir = dirname(__FILE__) . '/../dicts'; // Create descriptor for dictionary located in $dir directory with russian language $dict_bundle = new phpMorphy_FilesBundle($dir, 'rus'); // Create phpMorphy instance try { $morphy = new phpMorphy($dict_bundle, $opts); } catch(phpMorphy_Exception $e) { die('Error occured while creating phpMorphy instance: ' . $e->getMessage()); } // All words in dictionary in UPPER CASE, so don`t forget set proper locale // Supported dicts and locales: // *------------------------------* // | Dict. language | Locale name | // |------------------------------| // | Russian | cp1251 | // |------------------------------| // | English | cp1250 | // |------------------------------| // | German | cp1252 | // *------------------------------* // $codepage = $morphy->getCodepage(); // setlocale(LC_CTYPE, array('ru_RU.CP1251', 'Russian_Russia.1251')); // Hint: in this example words $word_one, $word_two are in russian language(cp1251 encoding) $word_one = ''; $word_two = ''; echo "Testing single mode...\n"; try { // word by word processing // each function return array with result or FALSE when no form(s) for given word found(or predicted) $base_form = $morphy->getBaseForm($word_one); $all_forms = $morphy->getAllForms($word_one); $pseudo_root = $morphy->getPseudoRoot($word_one); if(false === $base_form || false === $all_forms || false === $pseudo_root) { die("Can`t find or predict $word_one word"); } echo 'base form = ' . implode(', ', $base_form) . "\n"; echo 'all forms = ' . implode(', ', $all_forms) . "\n"; echo "Testing bulk mode...\n"; // bulk mode speed-ups processing up to 50-100%(mainly for getBaseForm method) // in bulk mode all function always return array $bulk_words = array($word_one, $word_two); $base_form = $morphy->getBaseForm($bulk_words); $all_forms = $morphy->getAllForms($bulk_words); $pseudo_root = $morphy->getPseudoRoot($bulk_words); // Bulk result format: // array( // INPUT_WORD1 => array(OUTWORD1, OUTWORD2, ... etc) // INPUT_WORD2 => FALSE <-- when no form for word found(or predicted) // ) echo 'bulk mode base form = ' . implode(', ', $base_form[$word_one]) . ' ' . implode(', ', $base_form[$word_two]) . "\n"; echo 'bulk mode all forms = ' . implode(', ', $all_forms[$word_one]) . ' ' . implode(', ', $all_forms[$word_two]) . "\n"; // You can also retrieve all word forms with graminfo via getAllFormsWithGramInfo method call // $all_forms_with_gram = $morphy->getAllFormsWithGramInfo($word_one); } catch(phpMorphy_Exception $e) { die('Error occured while text processing: ' . $e->getMessage()); } e-n-if-up000066600000001735151000112000006152 0ustar00#!/bin/bash # put this file in /etc/network/if-up.d/exim4-smarthost # add an exim4-smarthost smtp.server.example.com::587 line to your interface # stanza in /etc/network/interfaces # this will only work for split config, since in non-split config we # only have a single file which is included and which would need more # serious string processing to alter. With split config, we can blindly # overwrite our previous file. # Environment: # MODE = { start | stop } # IF_EXIM4_SMARTHOST = hostname[::port] SMARTHOSTFILE="/etc/exim4/conf.d/main/00_local_DCsmarthost" if [ -z "$IF_EXIM4_SMARTHOST" ]; then exit 0 fi if [ "$MODE" = 'stop' ]; then rm -f $SMARTHOSTFILE /etc/init.d/exim4 reload > /dev/null || true exit 0 fi if [ "$IF_EXIM4_SMARTHOST" = "none" ]; then rm -f $SMARTHOSTFILE /etc/init.d/exim4 reload > /dev/null || true exit 0 fi echo "DCsmarthost = ${IF_EXIM4_SMARTHOST}" > $SMARTHOSTFILE /etc/init.d/exim4 reload > /dev/null || true /usr/sbin/exim4 -qqf cdiff.pl.gz000066600000010224151000124610006564 0ustar00VHōv{_8!!IӲTȒ[KC<>wJ^3TVinĻ#?ܝ8me q q4!Y8w??;p0K:P}D!mϧwPwYv<%RBdNL9aU^Q4ZC+b@3b#9Cv5J*]&L*p#e#$P3 Up Hn:A0b'C?n뤋ƀgOp ~:uAӛCW~2֨oTe!d3Q0/z|~t}y:\pv}ۅOIBuK?m~EAI:|H G!?A* 3׮}75qLUk^zE6J?x7 -wHxo`ACSc\Z߿Cim=G}I QH%;񿪐^]q>T!Ō$+\Wf%Y53\.qU1#N-Rm-l*ӝ:1 ~{ AN(!EG bLiЖUXKŒ^>8 ^/B~7+lPK4׆:MôB)b)nUxI *NL$q:RܓHң )8fC!"wNΎ0q`Pܻ9S$1 ]]{ˢ9ZPpC"NDf1=#X,21yUi4ѓK " bǓ=k]eW@lms_*i|v& r@4ܔCX[( T߰Lc@BD j ᏔĸLM#vS?8 ,LP\z_Z;$,@VWc =hdb͕fX>ķ~&+$sLBթP 5X/z`{sH)~Ǻ!RѪ0]7Sk"}}- 1ZwCouK2D([fR껛U` F rXaXPqk;H"P+O6%aśo+$1_, MqJP! 鵽s/Tΐ:p @q`GЗmRZc\# xd1"%6c%0a%s0,?n4EJiT+sk=xҥ뺜~CF]vFqyb"BGcsjÅv&VNqomћp2]9`Dn ql$6,jьR8cqgGɚy3.Ax* DMx8[y\6u#it L1~ԁ0]-q'gCQD@dz]]_\ c{v`a|"-_N<,½5~5D" k׸brlgG,TKLM&BT^\?bH k2^Y}54^]fCncm؏ 7~`G@ăP2͠)]:XpVf!im=Ir"8a@1* iIIQ=BTǛ(c-Z|\~M{tL^V&e %G1cb t~سۆh܊D;Eӊ,˴Ё r 0&P}P6=Fyc"}V5a>qDo¨Z5G#^$rE]EB$Wg.V4O!e9NppD8ŧ ŧ'|F\3zJossFA2L?㊮g0 ×3=kgfH02fVVԪ[#DHm'8p&7:bחBUQedkieKU9EVQ1aC@NZ>S|7+4*tXLS()yoK&v+0mӽ";nxVbSyM ZVZ <_'4M1,q!ջ+xǗ8Ë+jڷW8NO.:km_q77g{5>z`׵pcbpatôek65/VnسJ;'yy;t7 T*iStƔ:y0W+x!{ MϠmh7 4.Ri#M.-1Hw8$'Mq"D(Ɣ 8 Si )r6XD e2|WO!*;XeZq:`Q&~_i8ʬ*smp6PeʏmIvqaO(LT|1JkAh]7[k)C[rlvF>QkVEGΒ{ OT..r>MaYr02Ds=tIK d6PXy9Oz(4(FM}][OCzغܣʅ%a~wt5MZnOtO] #Z]%෸/w} :k ̋wc]~c#*;k$bsgl/_Yͥ7zl?[qDjIsi0INe}7l$sc\@1dO-gr0ĤN-i /,;hDJ5}{U ̤>/_X0֕{=~Z4`$F.Gpg/gpr}~xuzq~)̜/Jt'kxo\^f9)MԞ%0{m5һ*ou GXfWtoKߏ0pңhI'*+.tIݛUuiAAbB3ؚ-hqh!z౅4\IG}+V4$0diff.pl000066600000001721151000124610006004 0ustar00#!/usr/bin/perl # # `Diff' program in Perl # Copyright 1998 M-J. Dominus. (mjd-perl-diff@plover.com) # # This program is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. # use Algorithm::Diff qw(diff); bag("Usage: $0 oldfile newfile") unless @ARGV == 2; my ($file1, $file2) = @ARGV; # -f $file1 or bag("$file1: not a regular file"); # -f $file2 or bag("$file2: not a regular file"); -T $file1 or bag("$file1: binary"); -T $file2 or bag("$file2: binary"); open (F1, $file1) or bag("Couldn't open $file1: $!"); open (F2, $file2) or bag("Couldn't open $file2: $!"); chomp(@f1 = ); close F1; chomp(@f2 = ); close F2; $diffs = diff(\@f1, \@f2); exit 0 unless @$diffs; foreach $chunk (@$diffs) { foreach $line (@$chunk) { my ($sign, $lineno, $text) = @$line; printf "%4d$sign %s\n", $lineno+1, $text; } print "--------\n"; } exit 1; sub bag { my $msg = shift; $msg .= "\n"; warn $msg; exit 2; } htmldiff.pl000066600000003475151000124610006701 0ustar00#!/usr/bin/perl -w # diffs two files and writes an HTML output file. use strict; use CGI qw(:standard :html3); use Algorithm::Diff 'traverse_sequences'; use Text::Tabs; my ( @a, @b ); # Take care of whitespace. sub preprocess { my $arrayRef = shift; chomp(@$arrayRef); @$arrayRef = expand(@$arrayRef); } # This will be called with both lines are the same sub match { my ( $ia, $ib ) = @_; print pre( $a[$ia] ), "\n"; } # This will be called when there is a line in A that isn't in B sub only_a { my ( $ia, $ib ) = @_; print pre( { -class => 'onlyA' }, $a[$ia] ), "\n"; } # This will be called when there is a line in B that isn't in A sub only_b { my ( $ia, $ib ) = @_; print pre( { -class => 'onlyB' }, $b[$ib] ), "\n"; } # MAIN PROGRAM # Check for two arguments. print "usage: $0 file1 file2 > diff.html\n" if @ARGV != 2; $tabstop = 4; # For Text::Tabs # Read each file into an array. open FH, $ARGV[0]; @a = ; close FH; open FH, $ARGV[1]; @b = ; close FH; # Expand whitespace preprocess( \@a ); preprocess( \@b ); # inline style my $style = < "$ARGV[0] vs. $ARGV[1]", -style => { -code => $style } } ), h1( { -style => 'margin-left: 24pt' }, span( { -style => 'color: red' }, $ARGV[0] ), span(" vs. "), span( { -style => 'color: blue' }, $ARGV[1] ) ), "\n"; # And compare the arrays traverse_sequences( \@a, # first sequence \@b, # second sequence { MATCH => \&match, # callback on identical lines DISCARD_A => \&only_a, # callback on A-only DISCARD_B => \&only_b, # callback on B-only } ); print end_html(); diffnew.pl.gz000066600000012634151000124610007142 0ustar00N:#Hfy-='44L c\}σ򃮯PEW> OaTC!r'#\ùj~zϘ*"- 8H!B[Gub$# t2a#8w~څx|(IpȀINI@Q pWSc =~aK_\6@i1`R_2x9_Pe5IXd>#&*1 }K+jL]c"+\^;nix3ߠs׈)[ I0WbuG5?\0Mg冿jx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¾3o$_#od$# s+W =aB;@BCm\&mb,̨4Je%DQ$(ߺWntW8Oz\Rp6n5Mc\mc1'gz[QgK]0֖ T4Ȧ<7~],DoKJRf$^k ?3+0=lTRA7n{,vվ$>ߘr}EMOp9^ݜ]^\K0c鿣څ= |3'ZVf%=:@7A*iydf m'[ ?mbE+%Y0&gYi]RB .u'{?ʽIE@gA=*,&T艑:LNmAS |' y,Ί/~@dBwhois000066600000000724151000270530005620 0ustar00#!/usr/bin/perl -s use lib qw(lib/ ../lib); use Net::XWhois; my $whois = new Net::XWhois Domain => shift, Server => $h; if ( $e ) { my @emails = $whois->contact_emails; $" = ", "; print "Contacts: @emails\n"; exit } if ( $n ) { my @emails = $whois->nameservers; $" = ", "; print "Nameservers: @emails\n"; exit } if ( $r ) { my @emails = $whois->registrants; $" = ", "; print "Registrants: @emails\n"; exit } print $whois->response; creation_time000066600000001015151000270530007303 0ustar00#!/usr/bin/perl -I../ use Net::XWhois; use Data::Dumper; my $w = new Net::XWhois; $w->register_parser ( Name => 'INTERNIC', Retain => 1, Parser => { creation_time => 'Record created on (\S*?)\.\n', } ); my $domain = shift; my $whois = new Net::XWhois Domain => $domain; print "$domain --\n"; print "Registrant: ", $whois->registrant (); print "\nCreation Time of $domain: ", $whois->creation_time (); print "\n"; print Dumper $w; cramtest.pl000066600000003377151000273240006733 0ustar00#!/usr/bin/perl # $Cambridge: exim/exim-src/util/cramtest.pl,v 1.2 2005/08/30 09:19:33 ph10 Exp $ # This script is contributed by Vadim Vygonets to aid in debugging CRAM-MD5 # authentication. # A patch was contributed by Jon Warbrick to upgrade it to use the Digest::MD5 # module instead of the deprecated MD5 module. # The script prompts for three data values: a user name, a password, and the # challenge as sent out by an SMTP server. The challenge is a base-64 string. # It should be copied (cut-and-pasted) literally as the third data item. The # output of the program is the base-64 string that is to be returned as the # response to the challenge. Using the example in RFC 2195: # # User: tim # Password: tanstaaftanstaaf # Challenge: PDE4OTYuNjk3MTcwOTUyQHBvc3RvZmZpY2UucmVzdG9uLm1jaS5uZXQ+ # dGltIGI5MTNhNjAyYzdlZGE3YTQ5NWI0ZTZlNzMzNGQzODkw # # The last line is what you you would send back to the server. # Copyright (c) 2002 # Vadim Vygonets . All rights reserved. # Public domain is OK with me. use MIME::Base64; use Digest::MD5; print "User: "; chop($user = <>); print "Password: "; chop($passwd = <>); print "Challenge: "; chop($chal = <>); $chal =~ s/^334 //; $context = new Digest::MD5; if (length($passwd) > 64) { $context->add($passwd); $passwd = $context->digest(); $context->reset(); } @passwd = unpack("C*", pack("a64", $passwd)); for ($i = 0; $i < 64; $i++) { $pass_ipad[$i] = $passwd[$i] ^ 0x36; $pass_opad[$i] = $passwd[$i] ^ 0x5C; } $context->add(pack("C64", @pass_ipad), decode_base64($chal)); $digest = $context->digest(); $context->reset(); $context->add(pack("C64", @pass_opad), $digest); $digest = $context->digest(); print encode_base64($user . " " . unpack("H*", $digest)); # End logargs.sh000066600000001354151000273240006537 0ustar00#! /bin/sh # $Cambridge: exim/exim-src/util/logargs.sh,v 1.1 2004/10/07 10:39:03 ph10 Exp $ # This script can be interposed between a calling program and another # program, in order to log the arguments which are being used. This can # be helpful in finding out what is going on if some program is calling # Exim with arguments it doesn't understand. # Set this to the the path of the program that must ultimately be called. CALL=exim # Set this to the name of the file where the data is to be logged. The # script writes on the end of it. It must be accessible to the user who # runs the script. LOGFILE=/home/ph10/tmp/zz # The arguments are copied to the log file echo $@ >>$LOGFILE # The real program is now called exec $CALL $@ # End exim-gencert000066600000004243151000273240007057 0ustar00#!/bin/sh -e if [ -n "$EX4DEBUG" ]; then echo "now debugging $0 $@" set -x fi DIR=/etc/exim4 CERT=$DIR/exim.crt KEY=$DIR/exim.key # This exim binary was built with GnuTLS which does not support dhparams # from a file. See /usr/share/doc/exim4-base/README.Debian.gz #DH=$DIR/exim.dhparam if ! which openssl > /dev/null ;then echo "$0: openssl is not installed, exiting" 1>&2 exit 1 fi # valid for three years DAYS=1095 if [ "$1" != "--force" ] && [ -f $CERT ] && [ -f $KEY ]; then echo "[*] $CERT and $KEY exists!" echo " Use \"$0 --force\" to force generation!" exit 0 fi if [ "$1" = "--force" ]; then shift fi #SSLEAY=/tmp/exim.ssleay.$$.cnf SSLEAY="$(tempfile -m600 -pexi)" cat > $SSLEAY <); # read a paragraph, remove trailing newlines $/ = "\n"; # unset paragraph mode # Splitting up a sequence of unique headers is easy to do in Perl, but a # message may contain duplicate headers of various kinds. It is better # to extract the headers one wants from the whole paragraph, do any appropriate # munging, and then put them back (unless removing them altogether). Messing # with "Received:" headers is not in any case to be encouraged. # As a demonstration, we extract the "From:" header, add a textual comment # to it, and put it back. ($pre, $from, $post) = $headers =~ /^(|(?:.|\n)+\n) (?# Stuff preceding the From header, which is either null, or any number of characters, including \n, ending with \n.) From:[\s\t]* (?# Header name, with optional space or tab.) ((?:.|\n)*?) (?# Header body, which contains any chars, including \n, but we want to make it as short as possible so as not to include following headers by mistake.) (|\n\S(?:.|\n)*)$ (?# Header terminates at end or at \n followed by a non-whitespace character and remaining headers.) /ix; # case independent, regular expression, # use extended features (ignore whitespace) # Only do something if there was a From: header, of course. It has been # extracted without the final \n, which is on the front of the $post # variable. if ($pre) { $headers = $pre . "From: $from (this is an added comment)" . $post; } # Add a new header to the end of the headers; remember that the final # \n isn't there. $headers .= "\nX-Comment: Message munged"; # Write out the processed headers, plus a blank line to separate them from # the body. printf(STDOUT "%s\n\n", $headers); # As a demonstration of munging the body of a message, reverse all the # characters in each line. while () { chomp; $_ = reverse($_); printf(STDOUT "%s\n", $_); } # End unknownuser.sh000066600000001751151000273240007500 0ustar00#! /bin/sh # $Cambridge: exim/exim-src/util/unknownuser.sh,v 1.1 2004/10/07 10:39:03 ph10 Exp $ # This is a sample script for demonstrating how to handle unknown users in # a more friendly way than just returning a "user unknown" error. It can # be called from a pipe transport set up like this: # unknownuser_pipe: # driver = pipe; # command = "/opt/exim/util/unknownuser.sh", # ignore_status, # return_output, # user = nobody # which is specified by a smartuser director set up like this: # unknownuser: # transport = unknownuser_pipe, # no_verify, # driver = smartuser; # Any output generated by this script is then returned to the sender of # the message. You can run any commands you like at this point, for example, # to attempt fuzzy matches on the local part of the address. Here we just # give a bland message, demonstrating the availability of the variables # $LOCAL_PART and $DOMAIN. cat <>$file") || die("Couldn't append to file '$file': $!"); print "User: "; chop($user = ); print "Password: "; chop($passwd = ); $rand = join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64, rand 64, rand 64]; print PWDFILE $user . ":" . crypt($passwd, q{$1$} . $rand . q{$}) . ":" . $passwd . "\n"; close(PWDFILE); __END__ =head1 NAME exim-adduser - Add username/password to exim password-file. =head1 USAGE exim-adduser [filename] exim-adduser prompts for username and password and adds username:crypted-password:cleartext-password to the given file, if no filename is given /etc/exim4/passwd is used. =head1 BUGS Probably many, this really is just example code. =head1 SEE ALSO /usr/share/doc/exim4-base/*, exim4(8) aliases000066600000002251151000273240006106 0ustar00# $Cambridge: exim/exim-src/src/aliases.default,v 1.1 2004/10/07 10:39:01 ph10 Exp $ # Default aliases file, installed by Exim. This file contains no real aliases. # You should edit it to taste. # The following alias is required by the mail RFCs 2821 and 2822. # Set it to the address of a HUMAN who deals with this system's mail problems. # postmaster: someone@your.domain # It is also common to set the following alias so that if anybody replies to a # bounce message from this host, the reply goes to the postmaster. # mailer-daemon: postmaster # You should also set up an alias for messages to root, because it is not # usually a good idea to deliver mail as root. # root: postmaster # It is a good idea to redirect any messages sent to system accounts so that # they don't just get ignored. Here are some common examples: # bin: root # daemon: root # ftp: root # nobody: root # operator: root # uucp: root # You should check your /etc/passwd for any others. # Other commonly enountered aliases are: # # abuse: the person dealing with network and mail abuse # hostmaster: the person dealing with DNS problems # webmaster: the person dealing with your web site #### ratelimit.pl000066600000007515151000273240007101 0ustar00#!/usr/bin/perl -wT # # $Cambridge: exim/exim-src/util/ratelimit.pl,v 1.3 2006/04/12 13:37:29 fanf2 Exp $ use strict; sub usage () { print < logfile The aim of this script is to compute clients' peak sending rates from an Exim log file, using the same formula as Exim's ratelimit ACL condition. This is so that you can get an idea of a reasonable limit setting before you deploy the restrictions. This script isn't perfectly accurate, because the time stamps in Exim's log files are only accurate to a second whereas internally Exim computes sender rates to the accuracy of your computer's clock (typically 10ms). The log files to be processed can be specified on the command line after the other arguments; if no filenames are specified the script will read from stdin. The first command line argument is the smoothing period, as defined by the documentation for the ratelimit ACL condition. The second argumetn is a regular expression. Each line is matched against the regular expression. Lines that do not match are ignored. The regex may contain 0, 1, or 2 () capturing sub-expressions. If there are no () sub-expressions, then every line that matches is used to compute a single rate. Its maximum value is reported when the script finishes. If there is one () sub-expression, then the text matched by the sub-expression is used to identify a rate lookup key, similar to the lookup key used by the ratelimit ACL condition. For example, you might write a regex to match the client IP address, or the authenticated username. Separate rates are computed for each different client and the maximum rate for each client is reported when the script finishes. If there are two () sub-expressions, then the text matched by the first sub-expression is used to identify a rate lookup key as above, and the second is used to match the message size recorded in the log line, e.g. " S=(\\d+) ". In this case the byte rate is computed instead of the message rate, similar to the per_byte option of the ratelimit ACL condition. END exit 1; } sub iso2unix (@) { my ($y,$m,$d,$H,$M,$S,$zs,$zh,$zm) = @_; use integer; $y -= $m < 3; $m += $m < 3 ? 10 : -2; my $z = defined $zs ? "${zs}1" * ($zh * 60 + $zm) : 0; my $t = $y/400 - $y/100 + $y/4 + $y*365 + $m*367/12 + $d - 719499; return $t * 86400 + $H * 3600 + $M * 60 + $S - $z; } my $debug = 0; my $progress = 0; while (@ARGV && $ARGV[0] =~ /^-\w+$/) { $debug = 1 if $ARGV[0] =~ s/(-\w*)d(\w*)/$1$2/; $progress = 1 if $ARGV[0] =~ s/(-\w*)p(\w*)/$1$2/; shift if $ARGV[0] eq "-"; } usage if @ARGV < 2; my $progtime = ""; my $period = shift; my $re_txt = shift; my $re = qr{$re_txt}o; my %time; my %rate; my %max; sub debug ($) { my $key = shift; printf "%s\t%12d %8s %5.2f %5.2f\n", $_, $time{$key}, $key, $max{$key}, $rate{$key}; } while (<>) { next unless $_ =~ $re; my $key = $1 || ""; my $size = $2 || 1.0; my $time = iso2unix ($_ =~ m{^(\d{4})-(\d\d)-(\d\d)[ ] (\d\d):(\d\d):(\d\d)[ ] (?:([+-])(\d\d)(\d\d)[ ])? }x); if ($progress) { my $prog_now = substr $_, 0, 14; if ($progtime ne $prog_now) { $progtime = $prog_now; print "$progtime\n"; } } if (not defined $time{$key}) { $time{$key} = $time; $rate{$key} = 0.0; $max{$key} = 0.0; debug $key if $debug; next; } # see acl_ratelimit() for details of the following my $interval = $time - $time{$key}; $interval = 1e-9 if $interval <= 0.0; my $i_over_p = $interval / $period; my $a = exp(-$i_over_p); $time{$key} = $time; $rate{$key} = $size * (1.0 - $a) / $i_over_p + $a * $rate{$key}; $max{$key} = $rate{$key} if $rate{$key} > $max{$key}; debug $key if $debug; } print map { " " x (20 - length) . "$_ : $max{$_}\n" } sort { $max{$a} <=> $max{$b} } keys %max; # eof example.conf.gz000066600000026400151000273240007465 0ustar00}ksVw N*R,v2jˊĪe$Ofke(aDd~sI9{/$ҧ7?NgȮ$Wk{o\jQ,iۿMGyo7,9y7O>zQ~$k?狲-fyVEU&b'>jd[u$o@6-_'wtT\r:eR2̢Ww\jt: y3&OsW-m%u+=Mi6}̠P7-JBV(#])-eۜU0nJЦswU%Q~U=C)^W*auEQpe.d5r:oӴXW+=R:nOrˣ.su!O0Oy 'j+l6rw}5[4WY>ɓ%7R*qXqYɼ$9o.󻕩t0f yQa2ɜe^Wir#K@g}ҹ KA}>n#ɫG )Aݑx&7Jm0NW.TٮX_A؝aťwŴH%׀h)=L-cȖd{,Uk 9l)yJ.a9SUU #xpfY-a0'%pbOMG A%XE ld~{#_z;ifm}J$I^%ǯ~8Nj?ݿ4h?8X vE۸n@ ߼ (0^e51bBDC?}Vt4G}=xj8]_z4z-2`Ⱅ#H% uWwC[o2h | VYmXy6`B|X @ Ɗ8 Dkc> ]ڐ pLwBr AgU*]8 LmQˣJ>GUqeѨ K'/Hslq0}arRqh"X0]]m V} H^lr*Vm@Bр+# f"l X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000464210006656 0ustar00/* * This is a sample filter program, for use with pam_filter (a module * provided with Linux-PAM). This filter simply transposes upper and * lower case letters, it is intended for demonstration purposes and * it serves no purpose other than to annoy the user... */ #include "config.h" #include #include #include #include #include #include #include #include "pam_filter.h" #include /* ---------------------------------------------------------------- */ static void do_transpose(char *buffer,int len) { int i; for (i=0; i %s\r\n",environ[i]); } fprintf(stderr,"]: end\r\n"); } #endif if (argc != 1) { #ifdef DEBUG fprintf(stderr,"filter invoked as conventional executable\n"); #else syslog(LOG_ERR, "filter invoked as conventional executable"); #endif exit(1); } before_user = before_app = do_transpose; /* assign filter functions */ /* enter a loop that deals with the input and output of the user.. passing it to and from the application */ FD_ZERO(&readers); /* initialize reading mask */ for (;;) { FD_SET(APPOUT_FILENO, &readers); /* wake for output */ FD_SET(APPERR_FILENO, &readers); /* wake for error */ FD_SET(STDIN_FILENO, &readers); /* wake for input */ if ( select(APPTOP_FILE,&readers,NULL,NULL,NULL) < 0 ) { #ifdef DEBUG fprintf(stderr,"select failed\n"); #else syslog(LOG_WARNING,"select failed"); #endif break; } /* application errors */ if ( FD_ISSET(APPERR_FILENO,&readers) ) { int got = read(APPERR_FILENO, buffer, BUFSIZ); if (got <= 0) { break; } else { /* translate to give to real terminal */ if (before_user != NULL) before_user(buffer, got); if (pam_modutil_write(STDERR_FILENO, buffer, got) != got ) { syslog(LOG_WARNING,"couldn't write %d bytes?!",got); break; } } } else if ( FD_ISSET(APPOUT_FILENO,&readers) ) { /* app output */ int got = read(APPOUT_FILENO, buffer, BUFSIZ); if (got <= 0) { break; } else { /* translate to give to real terminal */ if (before_user != NULL) before_user(buffer, got); if (pam_modutil_write(STDOUT_FILENO, buffer, got) != got ) { syslog(LOG_WARNING,"couldn't write %d bytes!?",got); break; } } } if ( FD_ISSET(STDIN_FILENO, &readers) ) { /* user input */ int got = read(STDIN_FILENO, buffer, BUFSIZ); if (got < 0) { syslog(LOG_WARNING,"user input junked"); break; } else if (got) { /* translate to give to application */ if (before_app != NULL) before_app(buffer, got); if (pam_modutil_write(APPIN_FILENO, buffer, got) != got ) { syslog(LOG_WARNING,"couldn't pass %d bytes!?",got); break; } } else { /* nothing received -- an error? */ syslog(LOG_WARNING,"user input null?"); break; } } } exit(0); } sysctl.conf000066600000004042151000473250006735 0ustar00# # /etc/sysctl.conf - Configuration file for setting system variables # See /etc/sysctl.d/ for additonal system variables # See sysctl.conf (5) for information. # #kernel.domainname = example.com # Uncomment the following to stop low-level messages on console #kernel.printk = 3 4 1 3 ##############################################################3 # Functions previously found in netbase # # Uncomment the next two lines to enable Spoof protection (reverse-path filter) # Turn on Source Address Verification in all interfaces to # prevent some spoofing attacks #net.ipv4.conf.default.rp_filter=1 #net.ipv4.conf.all.rp_filter=1 # Uncomment the next line to enable TCP/IP SYN cookies # See http://lwn.net/Articles/277146/ # Note: This may impact IPv6 TCP sessions too #net.ipv4.tcp_syncookies=1 # Uncomment the next line to enable packet forwarding for IPv4 #net.ipv4.ip_forward=1 # Uncomment the next line to enable packet forwarding for IPv6 # Enabling this option disables Stateless Address Autoconfiguration # based on Router Advertisements for this host #net.ipv6.conf.all.forwarding=1 ################################################################### # Additional settings - these settings can improve the network # security of the host and prevent against some network attacks # including spoofing attacks and man in the middle attacks through # redirection. Some network environments, however, require that these # settings are disabled so review and enable them as needed. # # Do not accept ICMP redirects (prevent MITM attacks) #net.ipv4.conf.all.accept_redirects = 0 #net.ipv6.conf.all.accept_redirects = 0 # _or_ # Accept ICMP redirects only for gateways listed in our default # gateway list (enabled by default) # net.ipv4.conf.all.secure_redirects = 1 # # Do not send ICMP redirects (we are not a router) #net.ipv4.conf.all.send_redirects = 0 # # Do not accept IP source route packets (we are not a router) #net.ipv4.conf.all.accept_source_route = 0 #net.ipv6.conf.all.accept_source_route = 0 # # Log Martian Packets #net.ipv4.conf.all.log_martians = 1 # sample.sudoers000066600000007675151000473260007454 0ustar00# # Sample /etc/sudoers file. # # This file MUST be edited with the 'visudo' command as root. # # See the sudoers man page for the details on how to write a sudoers file. ## # Override built-in defaults ## Defaults syslog=auth Defaults>root !set_logname Defaults:FULLTIMERS !lecture Defaults:millert !authenticate Defaults@SERVERS log_year, logfile=/var/log/sudo.log Defaults!PAGERS noexec ## # User alias specification ## User_Alias FULLTIMERS = millert, mikef, dowdy User_Alias PARTTIMERS = bostley, jwfox, crawl User_Alias WEBMASTERS = will, wendy, wim ## # Runas alias specification ## Runas_Alias OP = root, operator Runas_Alias DB = oracle, sybase ## # Host alias specification ## Host_Alias SPARC = bigtime, eclipse, moet, anchor:\ SGI = grolsch, dandelion, black:\ ALPHA = widget, thalamus, foobar:\ HPPA = boa, nag, python Host_Alias CUNETS = 128.138.0.0/255.255.0.0 Host_Alias CSNETS = 128.138.243.0, 128.138.204.0/24, 128.138.242.0 Host_Alias SERVERS = master, mail, www, ns Host_Alias CDROM = orion, perseus, hercules ## # Cmnd alias specification ## Cmnd_Alias DUMPS = /usr/sbin/dump, /usr/sbin/rdump, /usr/sbin/restore, \ /usr/sbin/rrestore, /bin/mt Cmnd_Alias KILL = /bin/kill Cmnd_Alias PRINTING = /usr/sbin/lpc, /usr/bin/lprm Cmnd_Alias SHUTDOWN = /usr/sbin/shutdown Cmnd_Alias HALT = /usr/sbin/halt Cmnd_Alias REBOOT = /usr/sbin/reboot Cmnd_Alias SHELLS = /sbin/sh, /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh, \ /usr/local/bin/tcsh, /usr/bin/rsh, \ /usr/local/bin/zsh Cmnd_Alias SU = /usr/bin/su Cmnd_Alias VIPW = /usr/sbin/vipw, /usr/bin/passwd, /usr/bin/chsh, \ /usr/bin/chfn Cmnd_Alias PAGERS = /usr/bin/more, /usr/bin/pg, /usr/bin/less ## # User specification ## # root and users in group wheel can run anything on any machine as any user root ALL = (ALL) ALL %wheel ALL = (ALL) ALL # full time sysadmins can run anything on any machine without a password FULLTIMERS ALL = NOPASSWD: ALL # part time sysadmins may run anything but need a password PARTTIMERS ALL = ALL # jack may run anything on machines in CSNETS jack CSNETS = ALL # lisa may run any command on any host in CUNETS (a class B network) lisa CUNETS = ALL # operator may run maintenance commands and anything in /usr/oper/bin/ operator ALL = DUMPS, KILL, SHUTDOWN, HALT, REBOOT, PRINTING,\ sudoedit /etc/printcap, /usr/oper/bin/ # joe may su only to operator joe ALL = /bin/su operator # pete may change passwords for anyone but root on the hp snakes pete HPPA = /usr/bin/passwd [A-Za-z]*, !/usr/bin/passwd root # bob may run anything on the sparc and sgi machines as any user # listed in the Runas_Alias "OP" (ie: root and operator) bob SPARC = (OP) ALL : SGI = (OP) ALL # jim may run anything on machines in the biglab netgroup jim +biglab = ALL # users in the secretaries netgroup need to help manage the printers # as well as add and remove users +secretaries ALL = PRINTING, /usr/sbin/adduser, /usr/bin/rmuser # fred can run commands as oracle or sybase without a password fred ALL = (DB) NOPASSWD: ALL # on the alphas, john may su to anyone but root and flags are not allowed john ALPHA = /bin/su [!-]*, !/bin/su *root* # jen can run anything on all machines except the ones # in the "SERVERS" Host_Alias jen ALL, !SERVERS = ALL # jill can run any commands in the directory /usr/bin/, except for # those in the SU and SHELLS aliases. jill SERVERS = /usr/bin/, !SU, !SHELLS # steve can run any command in the directory /usr/local/op_commands/ # as user operator. steve CSNETS = (operator) /usr/local/op_commands/ # matt needs to be able to kill things on his workstation when # they get hung. matt valkyrie = KILL # users in the WEBMASTERS User_Alias (will, wendy, and wim) # may run any command as user www (which owns the web pages) # or simply su to www. WEBMASTERS www = (www) ALL, (root) /usr/bin/su www # anyone can mount/unmount a cd-rom on the machines in the CDROM alias ALL CDROM = NOPASSWD: /sbin/umount /CDROM,\ /sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM my-large.cnf.gz000066600000003774151000476310007404 0ustar00Xo7) B?,KKSl]]rCr-ސJvsX"3Ù73K?RreJ + f։NA2`7 htD͞]bv01R{(V@mʲR{oCNj]]V8s)uiŒL ZA WP%wUnXZ!,0q\@=}#S ܑ7qdˊ'18X8WfxV{e:_3f_mZ[.u.F=ܘcw甖L Qc`Rz'{^$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Fw}s}3^[m'11A$MUY~Jkt|5쭶t"ɞEnǒfl=CڼС=5eqDeid7BD XCҦ~2 F^\Z+M 9ZO!@Iưy5Y s;j?_ -dlV¶d|kd:ꦂ)i֮KnazΎTgH/h!; 6/k.H1FjN 9//"Q1BI w.pʀZZ#-N_i)2'r;T^T.j?P :+wF%A}[\7I=Q;`,`1/h! RDZv#ʡ qɧؔT+_©ߏ1Сl;ErMYÞvNN\i >q|g*b_x-a|Qb2B `- Å۶Koe[ z)U}e'v%r.d^88c\a% _Xm1w$ ڠ}Hvz$tE 0DbN~jiNShn2aFxl}ARyrѸxg)ZşI۹O [H\m%B;&쇷 dOY^p'8S-:+ ڨwEұD=R,'XʆR4k[=%||$b!ȇ50Ki`!8\a22¹;~g~Ù|>󼩖p<NF]dn1"aR+)+ He : k58:#9S_;W?<`'*H6Ea05*W<;nM;9|Aw1@("OkZ*4H'H]}QFL b$'ukv+sc{x뽤c֍_q PYCl\HTY Ha-SѪYu;Xfƴp$pR"u\0䏵Rpgac4Iu)Uh…\ȱ/_ pp _x x? 玿qH4Ayp Nep:PܷqSRl"%%61\z=J;m[d_>Fd|s;\)Nnңt2O9W^,wi?.ye|T/] _&dzzro|#\i{UPD&M-ޥ1_T36pjuw Wݯ5'<TjJ+Mmy-small.cnf000066600000004615151000476310006776 0ustar00# Example MySQL config file for small systems. # # This is for a system with little memory (<= 64M) where MySQL is only used # from time to time and it's important that the mysqld daemon # doesn't use much resources. # # MySQL programs look for option files in a set of # locations which depend on the deployment platform. # You can copy this option file to one of those # locations. For information about these locations, see: # http://dev.mysql.com/doc/mysql/en/option-files.html # # In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program # with the "--help" option. # The following options will be passed to all MySQL clients [client] #password = your_password port = 3306 socket = /var/run/mysqld/mysqld.sock # Here follows entries for some specific programs # The MySQL server [mysqld] port = 3306 socket = /var/run/mysqld/mysqld.sock skip-locking key_buffer_size = 16K max_allowed_packet = 1M table_open_cache = 4 sort_buffer_size = 64K read_buffer_size = 256K read_rnd_buffer_size = 256K net_buffer_length = 2K thread_stack = 128K # Don't listen on a TCP/IP port at all. This can be a security enhancement, # if all processes that need to connect to mysqld run on the same host. # All interaction with mysqld must be made via Unix sockets or named pipes. # Note that using this option without enabling named pipes on Windows # (using the "enable-named-pipe" option) will render mysqld useless! # #skip-networking server-id = 1 # Uncomment the following if you want to log updates #log-bin=mysql-bin # binary logging format - mixed recommended #binlog_format=mixed # Uncomment the following if you are using InnoDB tables #innodb_data_home_dir = /var/lib/mysql #innodb_data_file_path = ibdata1:10M:autoextend #innodb_log_group_home_dir = /var/lib/mysql # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of setting memory usage too high #innodb_buffer_pool_size = 16M #innodb_additional_mem_pool_size = 2M # Set .._log_file_size to 25 % of buffer pool size #innodb_log_file_size = 5M #innodb_log_buffer_size = 8M #innodb_flush_log_at_trx_commit = 1 #innodb_lock_wait_timeout = 50 [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash # Remove the next comment character if you are not familiar with SQL #safe-updates [myisamchk] key_buffer_size = 8M sort_buffer_size = 8M [mysqlhotcopy] interactive-timeout my-medium.cnf.gz000066600000004017151000476310007561 0ustar00XO#7W+) $-+vKTșq2.3!~&NH>~f?$ͷ׿rWjM+TB5vl/ۣR9/EK8X-iL燴)l4:TG yCٛam,0fmN6/I88KrK{ONt1w!xetiMz2+L.xl.Ұ*%GQ ]5E6-17rp|`c3ZB=C#(͊ i=rQl7gGG[>*L~I} ChUHGm.N; k> AiIY??7"ܥ oRVͷ$ c8V٨W?P"\Dp<R(n=[|sE=cWǧ3 _=1E3avc2%%Fjg]ѻ쏨qݩf 0!#ٝ.j%©H:(-: W1Ʌ5tpJ\ PZ*-@YK`VY跏J2Ȍ!~Hr&jVjv E87j o$ 3ŝRW3(B6UC\c..gg3^Z:;\ 65.8xwKOSw]{I1\ P4A0rtcڸJU?Ru^\]Ѓj GgA>S~p?\{:XUE\n׺!?3ڋd.j3Q koGt|/z8p8="ԙ N-Ez%QOt%8X}FϜ]L:'b:;LgnJ 1WF\ !3:<Ʊqo@W`hż1j1Tja-aRKK ɀG+*nߨ+h ^:) 6Oh0lRb-x?qSdob?k6L>= RkUQ  Fp҇_ P5!+l=h]Z,fUxtb%)~L$[k [ fB8LB90z/#}gOiNʚz'D>{+Ǵ8|'q?_F ?wl64/QE>mWbR-7tx:&^-Eprog/wordfreq.awk000066600000000646151000533020010047 0ustar00# wordfreq.awk --- print list of word frequencies { $0 = tolower($0) # remove case distinctions # remove punctuation gsub(/[^[:alnum:]_[:blank:]]/, "", $0) for (i = 1; i <= NF; i++) freq[$i]++ } END { for (word in freq) printf "%s\t%d\n", word, freq[word] } END { sort = "sort -k 2nr" for (word in freq) printf "%s\t%d\n", word, freq[word] | sort close(sort) } prog/alarm.awk000066600000004421151000533020007305 0ustar00# alarm.awk --- set an alarm # # Requires gettimeofday library function # # Arnold Robbins, arnold@skeeve.com, Public Domain # May 1993 # usage: alarm time [ "message" [ count [ delay ] ] ] BEGIN \ { # Initial argument sanity checking usage1 = "usage: alarm time ['message' [count [delay]]]" usage2 = sprintf("\t(%s) time ::= hh:mm", ARGV[1]) if (ARGC < 2) { print usage1 > "/dev/stderr" print usage2 > "/dev/stderr" exit 1 } else if (ARGC == 5) { delay = ARGV[4] + 0 count = ARGV[3] + 0 message = ARGV[2] } else if (ARGC == 4) { count = ARGV[3] + 0 message = ARGV[2] } else if (ARGC == 3) { message = ARGV[2] } else if (ARGV[1] !~ /[0-9]?[0-9]:[0-9][0-9]/) { print usage1 > "/dev/stderr" print usage2 > "/dev/stderr" exit 1 } # set defaults for once we reach the desired time if (delay == 0) delay = 180 # 3 minutes if (count == 0) count = 5 if (message == "") message = sprintf("\aIt is now %s!\a", ARGV[1]) else if (index(message, "\a") == 0) message = "\a" message "\a" # split up alarm time split(ARGV[1], atime, ":") hour = atime[1] + 0 # force numeric minute = atime[2] + 0 # force numeric # get current broken down time gettimeofday(now) # if time given is 12-hour hours and it's after that # hour, e.g., `alarm 5:30' at 9 a.m. means 5:30 p.m., # then add 12 to real hour if (hour < 12 && now["hour"] > hour) hour += 12 # set target time in seconds since midnight target = (hour * 60 * 60) + (minute * 60) # get current time in seconds since midnight current = (now["hour"] * 60 * 60) + \ (now["minute"] * 60) + now["second"] # how long to sleep for naptime = target - current if (naptime <= 0) { print "time is in the past!" > "/dev/stderr" exit 1 } # zzzzzz..... go away if interrupted if (system(sprintf("sleep %d", naptime)) != 0) exit 1 # time to notify! command = sprintf("sleep %d", delay) for (i = 1; i <= count; i++) { print message # if sleep command interrupted, go away if (system(command) != 0) break } exit 0 } prog/split.awk000066600000002207151000533020007344 0ustar00# split.awk --- do split in awk # # Requires ord and chr library functions # # Arnold Robbins, arnold@skeeve.com, Public Domain # May 1993 # usage: split [-num] [file] [outname] BEGIN { outfile = "x" # default count = 1000 if (ARGC > 4) usage() i = 1 if (ARGV[i] ~ /^-[0-9]+$/) { count = -ARGV[i] ARGV[i] = "" i++ } # test argv in case reading from stdin instead of file if (i in ARGV) i++ # skip data file name if (i in ARGV) { outfile = ARGV[i] ARGV[i] = "" } s1 = s2 = "a" out = (outfile s1 s2) } { if (++tcount > count) { close(out) if (s2 == "z") { if (s1 == "z") { printf("split: %s is too large to split\n", FILENAME) > "/dev/stderr" exit 1 } s1 = chr(ord(s1) + 1) s2 = "a" } else s2 = chr(ord(s2) + 1) out = (outfile s1 s2) tcount = 1 } print > out } function usage( e) { e = "usage: split [-num] [file] [outname]" print e > "/dev/stderr" exit 1 } prog/wc.awk000066600000002704151000533020006624 0ustar00# wc.awk --- count lines, words, characters # # Arnold Robbins, arnold@skeeve.com, Public Domain # May 1993 # Options: # -l only count lines # -w only count words # -c only count characters # # Default is to count lines, words, characters # # Requires getopt and file transition library functions BEGIN { # let getopt print a message about # invalid options. we ignore them while ((c = getopt(ARGC, ARGV, "lwc")) != -1) { if (c == "l") do_lines = 1 else if (c == "w") do_words = 1 else if (c == "c") do_chars = 1 } for (i = 1; i < Optind; i++) ARGV[i] = "" # if no options, do all if (! do_lines && ! do_words && ! do_chars) do_lines = do_words = do_chars = 1 print_total = (ARGC - i > 2) } function beginfile(file) { chars = lines = words = 0 fname = FILENAME } function endfile(file) { tchars += chars tlines += lines twords += words if (do_lines) printf "\t%d", lines if (do_words) printf "\t%d", words if (do_chars) printf "\t%d", chars printf "\t%s\n", fname } # do per line { chars += length($0) + 1 # get newline lines++ words += NF } END { if (print_total) { if (do_lines) printf "\t%d", tlines if (do_words) printf "\t%d", twords if (do_chars) printf "\t%d", tchars print "\ttotal" } } prog/guide.awk000066600000000245151000533020007306 0ustar00BEGIN { TEXTDOMAIN = "guide" bindtextdomain(".") # for testing print _"Don't Panic" print _"The Answer Is", 42 print "Pardon me, Zaphod who?" } prog/tee.awk000066600000001256151000533020006771 0ustar00# tee.awk --- tee in awk # # Arnold Robbins, arnold@skeeve.com, Public Domain # May 1993 # Revised December 1995 BEGIN \ { for (i = 1; i < ARGC; i++) copy[i] = ARGV[i] if (ARGV[1] == "-a") { append = 1 delete ARGV[1] delete copy[1] ARGC-- } if (ARGC < 2) { print "usage: tee [-a] file ..." > "/dev/stderr" exit 1 } ARGV[1] = "-" ARGC = 2 } { # moving the if outside the loop makes it run faster if (append) for (i in copy) print >> copy[i] else for (i in copy) print > copy[i] print } END \ { for (i in copy) close(copy[i]) } prog/awksed.awk000066600000001003151000533020007460 0ustar00# awksed.awk --- do s/foo/bar/g using just print # Thanks to Michael Brennan for the idea # # Arnold Robbins, arnold@skeeve.com, Public Domain # August 1995 function usage() { print "usage: awksed pat repl [files...]" > "/dev/stderr" exit 1 } BEGIN { # validate arguments if (ARGC < 3) usage() RS = ARGV[1] ORS = ARGV[2] # don't use arguments as files ARGV[1] = ARGV[2] = "" } # look ma, no hands! { if (RT == "") printf "%s", $0 else print } prog/igawk.sh000066600000006023151000533020007143 0ustar00#! /bin/sh # igawk --- like gawk but do @include processing # # Arnold Robbins, arnold@skeeve.com, Public Domain # July 1993 if [ "$1" = debug ] then set -x shift fi # A literal newline, so that program text is formatted correctly n=' ' # Initialize variables to empty program= opts= while [ $# -ne 0 ] # loop over arguments do case $1 in --) shift; break;; -W) shift # The ${x?'message here'} construct prints a # diagnostic if $x is the null string set -- -W"${@?'missing operand'}" continue;; -[vF]) opts="$opts $1 '${2?'missing operand'}'" shift;; -[vF]*) opts="$opts '$1'" ;; -f) program="$program$n@include ${2?'missing operand'}" shift;; -f*) f=`expr "$1" : '-f\(.*\)'` program="$program$n@include $f";; -[W-]file=*) f=`expr "$1" : '-.file=\(.*\)'` program="$program$n@include $f";; -[W-]file) program="$program$n@include ${2?'missing operand'}" shift;; -[W-]source=*) t=`expr "$1" : '-.source=\(.*\)'` program="$program$n$t";; -[W-]source) program="$program$n${2?'missing operand'}" shift;; -[W-]version) echo igawk: version 2.0 1>&2 gawk --version exit 0 ;; -[W-]*) opts="$opts '$1'" ;; *) break;; esac shift done if [ -z "$program" ] then program=${1?'missing program'} shift fi # At this point, `program' has the program. expand_prog=' function pathto(file, i, t, junk) { if (index(file, "/") != 0) return file for (i = 1; i <= ndirs; i++) { t = (pathlist[i] "/" file) if ((getline junk < t) > 0) { # found it close(t) return t } } return "" } BEGIN { path = ENVIRON["AWKPATH"] ndirs = split(path, pathlist, ":") for (i = 1; i <= ndirs; i++) { if (pathlist[i] == "") pathlist[i] = "." } stackptr = 0 input[stackptr] = ARGV[1] # ARGV[1] is first file for (; stackptr >= 0; stackptr--) { while ((getline < input[stackptr]) > 0) { if (tolower($1) != "@include") { print continue } fpath = pathto($2) if (fpath == "") { printf("igawk:%s:%d: cannot find %s\n", input[stackptr], FNR, $2) > "/dev/stderr" continue } if (! (fpath in processed)) { processed[fpath] = input[stackptr] input[++stackptr] = fpath # push onto stack } else print $2, "included in", input[stackptr], "already included in", processed[fpath] > "/dev/stderr" } close(input[stackptr]) } }' # close quote ends `expand_prog' variable processed_program=`gawk -- "$expand_prog" /dev/stdin < "/dev/stderr" exit 1 } # -c count lines. overrides -d and -u # -d only repeated lines # -u only non-repeated lines # -n skip n fields # +n skip n characters, skip fields first BEGIN \ { count = 1 outputfile = "/dev/stdout" opts = "udc0:1:2:3:4:5:6:7:8:9:" while ((c = getopt(ARGC, ARGV, opts)) != -1) { if (c == "u") non_repeated_only++ else if (c == "d") repeated_only++ else if (c == "c") do_count++ else if (index("0123456789", c) != 0) { # getopt requires args to options # this messes us up for things like -5 if (Optarg ~ /^[0-9]+$/) fcount = (c Optarg) + 0 else { fcount = c + 0 Optind-- } } else usage() } if (ARGV[Optind] ~ /^\+[0-9]+$/) { charcount = substr(ARGV[Optind], 2) + 0 Optind++ } for (i = 1; i < Optind; i++) ARGV[i] = "" if (repeated_only == 0 && non_repeated_only == 0) repeated_only = non_repeated_only = 1 if (ARGC - Optind == 2) { outputfile = ARGV[ARGC - 1] ARGV[ARGC - 1] = "" } } function are_equal( n, m, clast, cline, alast, aline) { if (fcount == 0 && charcount == 0) return (last == $0) if (fcount > 0) { n = split(last, alast) m = split($0, aline) clast = join(alast, fcount+1, n) cline = join(aline, fcount+1, m) } else { clast = last cline = $0 } if (charcount) { clast = substr(clast, charcount + 1) cline = substr(cline, charcount + 1) } return (clast == cline) } NR == 1 { last = $0 next } { equal = are_equal() if (do_count) { # overrides -d and -u if (equal) count++ else { printf("%4d %s\n", count, last) > outputfile last = $0 count = 1 # reset } next } if (equal) count++ else { if ((repeated_only && count > 1) || (non_repeated_only && count == 1)) print last > outputfile last = $0 count = 1 } } END { if (do_count) printf("%4d %s\n", count, last) > outputfile else if ((repeated_only && count > 1) || (non_repeated_only && count == 1)) print last > outputfile } prog/testbits.awk000066600000001331151000533020010047 0ustar00# bits2str --- turn a byte into readable 1's and 0's function bits2str(bits, data, mask) { if (bits == 0) return "0" mask = 1 for (; bits != 0; bits = rshift(bits, 1)) data = (and(bits, mask) ? "1" : "0") data while ((length(data) % 8) != 0) data = "0" data return data } BEGIN { printf "123 = %s\n", bits2str(123) printf "0123 = %s\n", bits2str(0123) printf "0x99 = %s\n", bits2str(0x99) comp = compl(0x99) printf "compl(0x99) = %#x = %s\n", comp, bits2str(comp) shift = lshift(0x99, 2) printf "lshift(0x99, 2) = %#x = %s\n", shift, bits2str(shift) shift = rshift(0x99, 2) printf "rshift(0x99, 2) = %#x = %s\n", shift, bits2str(shift) } prog/labels.awk000066600000001767151000533020007465 0ustar00# labels.awk --- print mailing labels # # Arnold Robbins, arnold@skeeve.com, Public Domain # June 1992 # Each label is 5 lines of data that may have blank lines. # The label sheets have 2 blank lines at the top and 2 at # the bottom. BEGIN { RS = "" ; MAXLINES = 100 } function printpage( i, j) { if (Nlines <= 0) return printf "\n\n" # header for (i = 1; i <= Nlines; i += 10) { if (i == 21 || i == 61) print "" for (j = 0; j < 5; j++) { if (i + j > MAXLINES) break printf " %-41s %s\n", line[i+j], line[i+j+5] } print "" } printf "\n\n" # footer for (i in line) line[i] = "" } # main rule { if (Count >= 20) { printpage() Count = 0 Nlines = 0 } n = split($0, a, "\n") for (i = 1; i <= n; i++) line[++Nlines] = a[i] for (; i <= 5; i++) line[++Nlines] = "" Count++ } END \ { printpage() } prog/egrep.awk000066600000003664151000533020007323 0ustar00# egrep.awk --- simulate egrep in awk # # Arnold Robbins, arnold@skeeve.com, Public Domain # May 1993 # Options: # -c count of lines # -s silent - use exit value # -v invert test, success if no match # -i ignore case # -l print filenames only # -e argument is pattern # # Requires getopt and file transition library functions BEGIN { while ((c = getopt(ARGC, ARGV, "ce:svil")) != -1) { if (c == "c") count_only++ else if (c == "s") no_print++ else if (c == "v") invert++ else if (c == "i") IGNORECASE = 1 else if (c == "l") filenames_only++ else if (c == "e") pattern = Optarg else usage() } if (pattern == "") pattern = ARGV[Optind++] for (i = 1; i < Optind; i++) ARGV[i] = "" if (Optind >= ARGC) { ARGV[1] = "-" ARGC = 2 } else if (ARGC - Optind > 1) do_filenames++ # if (IGNORECASE) # pattern = tolower(pattern) } #{ # if (IGNORECASE) # $0 = tolower($0) #} function beginfile(junk) { fcount = 0 } function endfile(file) { if (! no_print && count_only) if (do_filenames) print file ":" fcount else print fcount total += fcount } { matches = ($0 ~ pattern) if (invert) matches = ! matches fcount += matches # 1 or 0 if (! matches) next if (! count_only) { if (no_print) nextfile if (filenames_only) { print FILENAME nextfile } if (do_filenames) print FILENAME ":" $0 else print } } END \ { if (total == 0) exit 1 exit 0 } function usage( e) { e = "Usage: egrep [-csvil] [-e pat] [files ...]" e = e "\n\tegrep [-csvil] pat [files ...]" print e > "/dev/stderr" exit 1 } prog/cut.awk000066600000007130151000533020007004 0ustar00# cut.awk --- implement cut in awk # # Arnold Robbins, arnold@skeeve.com, Public Domain # May 1993 # Options: # -f list Cut fields # -d c Field delimiter character # -c list Cut characters # # -s Suppress lines without the delimiter # # Requires getopt and join library functions function usage( e1, e2) { e1 = "usage: cut [-f list] [-d c] [-s] [files...]" e2 = "usage: cut [-c list] [files...]" print e1 > "/dev/stderr" print e2 > "/dev/stderr" exit 1 } BEGIN \ { FS = "\t" # default OFS = FS while ((c = getopt(ARGC, ARGV, "sf:c:d:")) != -1) { if (c == "f") { by_fields = 1 fieldlist = Optarg } else if (c == "c") { by_chars = 1 fieldlist = Optarg OFS = "" } else if (c == "d") { if (length(Optarg) > 1) { printf("Using first character of %s" \ " for delimiter\n", Optarg) > "/dev/stderr" Optarg = substr(Optarg, 1, 1) } FS = Optarg OFS = FS if (FS == " ") # defeat awk semantics FS = "[ ]" } else if (c == "s") suppress++ else usage() } for (i = 1; i < Optind; i++) ARGV[i] = "" if (by_fields && by_chars) usage() if (by_fields == 0 && by_chars == 0) by_fields = 1 # default if (fieldlist == "") { print "cut: needs list for -c or -f" > "/dev/stderr" exit 1 } if (by_fields) set_fieldlist() else set_charlist() } function set_fieldlist( n, m, i, j, k, f, g) { n = split(fieldlist, f, ",") j = 1 # index in flist for (i = 1; i <= n; i++) { if (index(f[i], "-") != 0) { # a range m = split(f[i], g, "-") if (m != 2 || g[1] >= g[2]) { printf("bad field list: %s\n", f[i]) > "/dev/stderr" exit 1 } for (k = g[1]; k <= g[2]; k++) flist[j++] = k } else flist[j++] = f[i] } nfields = j - 1 } function set_charlist( field, i, j, f, g, t, filler, last, len) { field = 1 # count total fields n = split(fieldlist, f, ",") j = 1 # index in flist for (i = 1; i <= n; i++) { if (index(f[i], "-") != 0) { # range m = split(f[i], g, "-") if (m != 2 || g[1] >= g[2]) { printf("bad character list: %s\n", f[i]) > "/dev/stderr" exit 1 } len = g[2] - g[1] + 1 if (g[1] > 1) # compute length of filler filler = g[1] - last - 1 else filler = 0 if (filler) t[field++] = filler t[field++] = len # length of field last = g[2] flist[j++] = field - 1 } else { if (f[i] > 1) filler = f[i] - last - 1 else filler = 0 if (filler) t[field++] = filler t[field++] = 1 last = f[i] flist[j++] = field - 1 } } FIELDWIDTHS = join(t, 1, field - 1) nfields = j - 1 } { if (by_fields && suppress && index($0, FS) != 0) next for (i = 1; i <= nfields; i++) { if ($flist[i] != "") { printf "%s", $flist[i] if (i < nfields && $flist[i+1] != "") printf "%s", OFS } } print "" } prog/extract.awk000066600000003324151000533020007664 0ustar00# extract.awk --- extract files and run programs # from texinfo files # # Arnold Robbins, arnold@skeeve.com, Public Domain # May 1993 # Revised September 2000 BEGIN { IGNORECASE = 1 } /^@c(omment)?[ \t]+system/ \ { if (NF < 3) { e = (FILENAME ":" FNR) e = (e ": badly formed `system' line") print e > "/dev/stderr" next } $1 = "" $2 = "" stat = system($0) if (stat != 0) { e = (FILENAME ":" FNR) e = (e ": warning: system returned " stat) print e > "/dev/stderr" } } /^@c(omment)?[ \t]+file/ \ { if (NF != 3) { e = (FILENAME ":" FNR ": badly formed `file' line") print e > "/dev/stderr" next } if ($3 != curfile) { if (curfile != "") close(curfile) curfile = $3 } for (;;) { if ((getline line) <= 0) unexpected_eof() if (line ~ /^@c(omment)?[ \t]+endfile/) break else if (line ~ /^@(end[ \t]+)?group/) continue else if (line ~ /^@c(omment+)?[ \t]+/) continue if (index(line, "@") == 0) { print line > curfile continue } n = split(line, a, "@") # if a[1] == "", means leading @, # don't add one back in. for (i = 2; i <= n; i++) { if (a[i] == "") { # was an @@ a[i] = "@" if (a[i+1] == "") i++ } } print join(a, 1, n, SUBSEP) > curfile } } function unexpected_eof() { printf("%s:%d: unexpected EOF or error\n", FILENAME, FNR) > "/dev/stderr" exit 1 } END { if (curfile) close(curfile) } prog/id.awk000066600000002607151000533020006611 0ustar00# id.awk --- implement id in awk # # Requires user and group library functions # # Arnold Robbins, arnold@skeeve.com, Public Domain # May 1993 # Revised February 1996 # output is: # uid=12(foo) euid=34(bar) gid=3(baz) \ # egid=5(blat) groups=9(nine),2(two),1(one) BEGIN \ { uid = PROCINFO["uid"] euid = PROCINFO["euid"] gid = PROCINFO["gid"] egid = PROCINFO["egid"] printf("uid=%d", uid) pw = getpwuid(uid) if (pw != "") { split(pw, a, ":") printf("(%s)", a[1]) } if (euid != uid) { printf(" euid=%d", euid) pw = getpwuid(euid) if (pw != "") { split(pw, a, ":") printf("(%s)", a[1]) } } printf(" gid=%d", gid) pw = getgrgid(gid) if (pw != "") { split(pw, a, ":") printf("(%s)", a[1]) } if (egid != gid) { printf(" egid=%d", egid) pw = getgrgid(egid) if (pw != "") { split(pw, a, ":") printf("(%s)", a[1]) } } for (i = 1; ("group" i) in PROCINFO; i++) { if (i == 1) printf(" groups=") group = PROCINFO["group" i] printf("%d", group) pw = getgrgid(group) if (pw != "") { split(pw, a, ":") printf("(%s)", a[1]) } if (("group" (i+1)) in PROCINFO) printf(",") } print "" } prog/translate.awk000066600000002237151000533020010211 0ustar00# translate.awk --- do tr-like stuff # # Arnold Robbins, arnold@skeeve.com, Public Domain # August 1989 # February 2009 - bug fix # Bugs: does not handle things like: tr A-Z a-z, it has # to be spelled out. However, if `to' is shorter than `from', # the last character in `to' is used for the rest of `from'. function stranslate(from, to, target, lf, lt, ltarget, t_ar, i, c, result) { lf = length(from) lt = length(to) ltarget = length(target) for (i = 1; i <= lt; i++) t_ar[substr(from, i, 1)] = substr(to, i, 1) if (lt < lf) for (; i <= lf; i++) t_ar[substr(from, i, 1)] = substr(to, lt, 1) for (i = 1; i <= ltarget; i++) { c = substr(target, i, 1) if (c in t_ar) c = t_ar[c] result = result c } return result } function translate(from, to) { return $0 = stranslate(from, to, $0) } # main program BEGIN { if (ARGC < 3) { print "usage: translate from to" > "/dev/stderr" exit } FROM = ARGV[1] TO = ARGV[2] ARGC = 2 ARGV[1] = "-" } { translate(FROM, TO) print } network/protbase.request000066600000000242151000533020011455 0ustar00PROGRAM blastn DATALIB month EXPECT 0.75 BEGIN >GAWK310 the gawking gene GNU AWK tgcttggctgaggagccataggacgagagcttcctggtgaagtgtgtttcttgaaatcat caccaccatggacagcaaa network/urlchk.awk000066600000002035151000533020010222 0ustar00BEGIN { if (ARGC != 2) { print "URLCHK - check if URLs have changed" print "IN:\n the file with URLs as a command-line parameter" print " file contains URL, old length, new length" print "PARAMS:\n -v Proxy=MyProxy -v ProxyPort=8080" print "OUT:\n same as file with URLs" print "JK 02.03.1998" exit } URLfile = ARGV[1]; ARGV[1] = "" if (Proxy != "") Proxy = " -v Proxy=" Proxy if (ProxyPort != "") ProxyPort = " -v ProxyPort=" ProxyPort while ((getline < URLfile) > 0) Length[$1] = $3 + 0 close(URLfile) # now, URLfile is read in and can be updated GetHeader = "gawk " Proxy ProxyPort " -v Method=\"HEAD\" -f geturl.awk " for (i in Length) { GetThisHeader = GetHeader i " 2>&1" while ((GetThisHeader | getline) > 0) if (toupper($0) ~ /CONTENT-LENGTH/) NewLength = $2 + 0 close(GetThisHeader) print i, Length[i], NewLength > URLfile if (Length[i] != NewLength) # report only changed URLs print i, Length[i], NewLength } close(URLfile) } network/testserv.awk000066600000000516151000533020010613 0ustar00BEGIN { CGI_setup("GET", "http://www.gnu.org/cgi-bin/foo?p1=stuff&p2=stuff%26junk" \ "&percent=a %25 sign", "1.0") for (i in MENU) printf "MENU[\"%s\"] = %s\n", i, MENU[i] for (i in PARAM) printf "PARAM[\"%s\"] = %s\n", i, PARAM[i] for (i in GETARG) printf "GETARG[\"%s\"] = %s\n", i, GETARG[i] } network/protbase.result000066600000001202151000533020011300 0ustar00Sequences producing significant alignments: (bits) Value gb|AC021182.14|AC021182 Homo sapiens chromosome 7 clone RP11-733... 38 0.20 gb|AC021056.12|AC021056 Homo sapiens chromosome 3 clone RP11-115... 38 0.20 emb|AL160278.10|AL160278 Homo sapiens chromosome 9 clone RP11-57... 38 0.20 emb|AL391139.11|AL391139 Homo sapiens chromosome X clone RP11-35... 38 0.20 emb|AL365192.6|AL365192 Homo sapiens chromosome 6 clone RP3-421H... 38 0.20 emb|AL138812.9|AL138812 Homo sapiens chromosome 11 clone RP1-276... 38 0.20 gb|AC073881.3|AC073881 Homo sapiens chromosome 15 clone CTD-2169... 38 0.20 network/PostAgent.sh000066600000000422151000533020010464 0ustar00#!/bin/sh MobAg=/tmp/MobileAgent.$$ # direct script to mobile agent file cat > $MobAg # execute agent concurrently gawk -f $MobAg $MobAg > /dev/null & # HTTP header, terminator and body gawk 'BEGIN { print "\r\nAgent started" }' rm $MobAg # delete script file of agent network/mobag.awk000066600000005431151000533020010022 0ustar00BEGIN { if (ARGC != 2) { print "MOBAG - a simple mobile agent" print "CALL:\n gawk -f mobag.awk mobag.awk" print "IN:\n the name of this script as a command-line parameter" print "PARAM:\n -v MyOrigin=myhost.com" print "OUT:\n the result on stdout" print "JK 29.03.1998 01.04.1998" exit } if (MyOrigin == "") { "uname -n" | getline MyOrigin close("uname -n") } } #ReadMySelf /^function / { FUNC = $2 } /^END/ || /^#ReadMySelf/ { FUNC = $1 } FUNC != "" { MOBFUN[FUNC] = MOBFUN[FUNC] RS $0 } (FUNC != "") && (/^}/ || /^#EndOfMySelf/) \ { FUNC = "" } #EndOfMySelf function migrate(Destination, MobCode, Label) { MOBVAR["Label"] = Label MOBVAR["Destination"] = Destination RS = ORS = "\r\n" HttpService = "/inet/tcp/0/" Destination for (i in MOBFUN) MobCode = (MobCode "\n" MOBFUN[i]) MobCode = MobCode "\n\nBEGIN {" for (i in MOBVAR) MobCode = (MobCode "\n MOBVAR[\"" i "\"] = \"" MOBVAR[i] "\"") MobCode = MobCode "\n}\n" print "POST /cgi-bin/PostAgent.sh HTTP/1.0" |& HttpService print "Content-length:", length(MobCode) ORS |& HttpService printf "%s", MobCode |& HttpService while ((HttpService |& getline) > 0) print $0 close(HttpService) } END { if (ARGC != 2) exit # stop when called with wrong parameters if (MyOrigin != "") # is this the originating host? MyInit() # if so, initialize the application else # we are on a host with migrated data MyJob() # so we do our job } function MyInit() { MOBVAR["MyOrigin"] = MyOrigin MOBVAR["Machines"] = "localhost/80 max/80 moritz/80 castor/80" split(MOBVAR["Machines"], Machines) # which host is the first? migrate(Machines[1], "", "") # go to the first host while (("/inet/tcp/8080/0/0" |& getline) > 0) # wait for result print $0 # print result close("/inet/tcp/8080/0/0") } function MyJob() { # forget this host sub(MOBVAR["Destination"], "", MOBVAR["Machines"]) MOBVAR["Result"]=MOBVAR["Result"] SUBSEP SUBSEP MOBVAR["Destination"] ":" while (("who" | getline) > 0) # who is logged in? MOBVAR["Result"] = MOBVAR["Result"] SUBSEP $0 close("who") if (index(MOBVAR["Machines"], "/") > 0) { # any more machines to visit? split(MOBVAR["Machines"], Machines) # which host is next? migrate(Machines[1], "", "") # go there } else { # no more machines gsub(SUBSEP, "\n", MOBVAR["Result"]) # send result to origin print MOBVAR["Result"] |& "/inet/tcp/0/" MOBVAR["MyOrigin"] "/8080" close("/inet/tcp/0/" MOBVAR["MyOrigin"] "/8080") } } network/webgrab.awk000066600000000271151000533020010343 0ustar00BEGIN { RS = "http://[#%&\\+\\-\\./0-9\\:;\\?A-Z_a-z\\~]*" } RT != "" { command = ("gawk -v Proxy=MyProxy -f geturl.awk " RT \ " > doc" NR ".html") print command } network/stoxdata.txt000066600000000245151000533030010620 0ustar00Date,Open,High,Low,Close,Volume 9-Oct-00,22.75,22.75,21.375,22.375,7888500 6-Oct-00,23.8125,24.9375,21.5625,22,10701100 5-Oct-00,24.4375,24.625,23.125,23.50,5810300 network/coreserv.awk000066600000006474151000533030010576 0ustar00# CGI Library and core of a web server # # Juergen Kahrs, Juergen.Kahrs@vr-web.de # with Arnold Robbins, arnold@gnu.org # September 2000 # Global arrays # GETARG --- arguments to CGI GET command # MENU --- menu items (path names) # PARAM --- parameters of form x=y # Optional variable MyHost contains host address # Optional variable MyPort contains port number # Needs TopHeader, TopDoc, TopFooter # Sets MyPrefix, HttpService, Status, Reason BEGIN { if (MyHost == "") { "uname -n" | getline MyHost close("uname -n") } if (MyPort == 0) MyPort = 8080 HttpService = "/inet/tcp/" MyPort "/0/0" MyPrefix = "http://" MyHost ":" MyPort SetUpServer() while ("awk" != "complex") { # header lines are terminated this way RS = ORS = "\r\n" Status = 200 # this means OK Reason = "OK" Header = TopHeader Document = TopDoc Footer = TopFooter if (GETARG["Method"] == "GET") { HandleGET() } else if (GETARG["Method"] == "HEAD") { # not yet implemented } else if (GETARG["Method"] != "") { print "bad method", GETARG["Method"] } Prompt = Header Document Footer print "HTTP/1.0", Status, Reason |& HttpService print "Connection: Close" |& HttpService print "Pragma: no-cache" |& HttpService len = length(Prompt) + length(ORS) print "Content-length:", len |& HttpService print ORS Prompt |& HttpService # ignore all the header lines while ((HttpService |& getline) > 0) continue # stop talking to this client close(HttpService) # wait for new client request HttpService |& getline # do some logging print systime(), strftime(), $0 CGI_setup($1, $2, $3) } } function CGI_setup( method, uri, version, i) { delete GETARG delete MENU delete PARAM GETARG["Method"] = method GETARG["URI"] = uri GETARG["Version"] = version i = index(uri, "?") if (i > 0) { # is there a "?" indicating a CGI request? split(substr(uri, 1, i-1), MENU, "[/:]") split(substr(uri, i+1), PARAM, "&") for (i in PARAM) { PARAM[i] = _CGI_decode(PARAM[i]) j = index(PARAM[i], "=") GETARG[substr(PARAM[i], 1, j-1)] = \ substr(PARAM[i], j+1) } } else { # there is no "?", no need for splitting PARAMs split(uri, MENU, "[/:]") } for (i in MENU) # decode characters in path if (i > 4) # but not those in host name MENU[i] = _CGI_decode(MENU[i]) } function _CGI_decode(str, hexdigs, i, pre, code1, code2, val, result) { hexdigs = "123456789abcdef" i = index(str, "%") if (i == 0) # no work to do return str do { pre = substr(str, 1, i-1) # part before %xx code1 = substr(str, i+1, 1) # first hex digit code2 = substr(str, i+2, 1) # second hex digit str = substr(str, i+3) # rest of string code1 = tolower(code1) code2 = tolower(code2) val = index(hexdigs, code1) * 16 \ + index(hexdigs, code2) result = result pre sprintf("%c", val) i = index(str, "%") } while (i != 0) if (length(str) > 0) result = result str return result } network/protbase.awk000066600000000620151000533030010550 0ustar00{ request = request "\n" $0 } END { BLASTService = "/inet/tcp/0/www.ncbi.nlm.nih.gov/80" printf "POST /cgi-bin/BLAST/nph-blast_report HTTP/1.0\n" |& BLASTService printf "Content-Length: " length(request) "\n\n" |& BLASTService printf request |& BLASTService while ((BLASTService |& getline) > 0) print $0 close(BLASTService) } network/hello-serv.awk000066600000000717151000533030011020 0ustar00BEGIN { RS = ORS = "\r\n" HttpService = "/inet/tcp/8080/0/0" Hello = "" \ "A Famous Greeting" \ "

Hello, world

" Len = length(Hello) + length(ORS) print "HTTP/1.0 200 OK" |& HttpService print "Content-Length: " Len ORS |& HttpService print Hello |& HttpService while ((HttpService |& getline) > 0) continue; close(HttpService) } network/remconf.awk000066600000004211151000533030010362 0ustar00function SetUpServer() { TopHeader = "Remote Configuration" TopDoc = "\

Please choose one of the following actions:

\ " TopFooter = "" if (ConfigFile == "") ConfigFile = "config.asc" } function HandleGET() { if(MENU[2] == "AboutServer") { Document = "This is a GUI for remote configuration of an\ embedded system. It is is implemented as one GAWK script." } else if (MENU[2] == "ReadConfig") { RS = "\n" while ((getline < ConfigFile) > 0) config[$1] = $2; close(ConfigFile) RS = "\r\n" Document = "Configuration has been read." } else if (MENU[2] == "CheckConfig") { Document = "" for (i in config) Document = Document "" \ "" Document = Document "
" i "" config[i] "
" } else if (MENU[2] == "ChangeConfig") { if ("Param" in GETARG) { # any parameter to set? if (GETARG["Param"] in config) { # is parameter valid? config[GETARG["Param"]] = GETARG["Value"] Document = (GETARG["Param"] " = " GETARG["Value"] ".") } else { Document = "Parameter " GETARG["Param"] " is invalid." } } else { Document = "

Change one parameter

\ \ \ \ \
ParameterValue
" } } else if (MENU[2] == "SaveConfig") { for (i in config) printf("%s %s\n", i, config[i]) > ConfigFile close(ConfigFile) Document = "Configuration has been saved." } } network/geturl.awk000066600000001423151000533030010235 0ustar00BEGIN { if (ARGC != 2) { print "GETURL - retrieve Web page via HTTP 1.0" print "IN:\n the URL as a command-line parameter" print "PARAM(S):\n -v Proxy=MyProxy" print "OUT:\n the page content on stdout" print " the page header on stderr" print "JK 16.05.1997" print "ADR 13.08.2000" exit } URL = ARGV[1]; ARGV[1] = "" if (Proxy == "") Proxy = "127.0.0.1" if (ProxyPort == 0) ProxyPort = 80 if (Method == "") Method = "GET" HttpService = "/inet/tcp/0/" Proxy "/" ProxyPort ORS = RS = "\r\n\r\n" print Method " " URL " HTTP/1.0" |& HttpService HttpService |& getline Header print Header > "/dev/stderr" while ((HttpService |& getline) > 0) printf "%s", $0 close(HttpService) } network/maze.awk000066600000005140151000533030007667 0ustar00function SetUpServer() { TopHeader = "Walk through a maze" TopDoc = "\

Please choose one of the following actions:

\ " TopFooter = "" srand() } function HandleGET() { if (MENU[2] == "AboutServer") { Document = "If your browser has a VRML 2 plugin,\ this server shows you a simple VRML scene." } else if (MENU[2] == "VRMLtest") { XSIZE = YSIZE = 11 # initially, everything is wall for (y = 0; y < YSIZE; y++) for (x = 0; x < XSIZE; x++) Maze[x, y] = "#" delete Maze[0, 1] # entry is not wall delete Maze[XSIZE-1, YSIZE-2] # exit is not wall MakeMaze(1, 1) Document = "\ #VRML V2.0 utf8\n\ Group {\n\ children [\n\ PointLight {\n\ ambientIntensity 0.2\n\ color 0.7 0.7 0.7\n\ location 0.0 8.0 10.0\n\ }\n\ DEF B1 Background {\n\ skyColor [0 0 0, 1.0 1.0 1.0 ]\n\ skyAngle 1.6\n\ groundColor [1 1 1, 0.8 0.8 0.8, 0.2 0.2 0.2 ]\n\ groundAngle [ 1.2 1.57 ]\n\ }\n\ DEF Wall Shape {\n\ geometry Box {size 1 1 1}\n\ appearance Appearance { material Material { diffuseColor 0 0 1 } }\n\ }\n\ DEF Entry Viewpoint {\n\ position 0.5 1.0 5.0\n\ orientation 0.0 0.0 -1.0 0.52\n\ }\n" for (i in Maze) { split(i, t, SUBSEP) Document = Document " Transform { translation " Document = Document t[1] " 0 -" t[2] " children USE Wall }\n" } Document = Document " ] # end of group for world\n}" Reason = "OK" ORS "Content-type: model/vrml" Header = Footer = "" } } function MakeMaze(x, y) { delete Maze[x, y] # here we are, we have no wall here p = 0 # count unvisited fields in all directions if (x-2 SUBSEP y in Maze) d[p++] = "-x" if (x SUBSEP y-2 in Maze) d[p++] = "-y" if (x+2 SUBSEP y in Maze) d[p++] = "+x" if (x SUBSEP y+2 in Maze) d[p++] = "+y" if (p>0) { # if there are univisited fields, go there p = int(p*rand()) # choose one unvisited field at random if (d[p] == "-x") { delete Maze[x - 1, y]; MakeMaze(x - 2, y) } else if (d[p] == "-y") { delete Maze[x, y - 1]; MakeMaze(x, y - 2) } else if (d[p] == "+x") { delete Maze[x + 1, y]; MakeMaze(x + 2, y) } else if (d[p] == "+y") { delete Maze[x, y + 1]; MakeMaze(x, y + 2) } # we are back from recursion MakeMaze(x, y); # try again while there are unvisited fields } } network/statist.awk000066600000007033151000533030010431 0ustar00function SetUpServer() { TopHeader = "Statistics with GAWK" TopDoc = "\

Please choose one of the following actions:

\ " TopFooter = "" GnuPlot = "gnuplot 2>&1" m1=m2=0; v1=v2=1; n1=n2=10 } function HandleGET() { if(MENU[2] == "AboutServer") { Document = "This is a GUI for a statistical computation.\ It compares means and variances of two distributions.\ It is implemented as one GAWK script and uses GNUPLOT." } else if (MENU[2] == "EnterParameters") { Document = "" if ("m1" in GETARG) { # are there parameters to compare? Document = Document "" m1 = GETARG["m1"]; v1 = GETARG["v1"]; n1 = GETARG["n1"] m2 = GETARG["m2"]; v2 = GETARG["v2"]; n2 = GETARG["n2"] t = (m1-m2)/sqrt(v1/n1+v2/n2) df = (v1/n1+v2/n2)*(v1/n1+v2/n2)/((v1/n1)*(v1/n1)/(n1-1) \ + (v2/n2)*(v2/n2) /(n2-1)) if (v1>v2) { f = v1/v2 df1 = n1 - 1 df2 = n2 - 1 } else { f = v2/v1 df1 = n2 - 1 df2 = n1 - 1 } print "pt=ibeta(" df/2 ",0.5," df/(df+t*t) ")" |& GnuPlot print "pF=2.0*ibeta(" df2/2 "," df1/2 "," \ df2/(df2+df1*f) ")" |& GnuPlot print "print pt, pF" |& GnuPlot RS="\n"; GnuPlot |& getline; RS="\r\n" # $1 is pt, $2 is pF print "invsqrt2pi=1.0/sqrt(2.0*pi)" |& GnuPlot print "nd(x)=invsqrt2pi/sd*exp(-0.5*((x-mu)/sd)**2)" |& GnuPlot print "set term png small color" |& GnuPlot #print "set term postscript color" |& GnuPlot #print "set term gif medium size 320,240" |& GnuPlot print "set yrange[-0.3:]" |& GnuPlot print "set label 'p(m1=m2) =" $1 "' at 0,-0.1 left" |& GnuPlot print "set label 'p(v1=v2) =" $2 "' at 0,-0.2 left" |& GnuPlot print "plot mu=" m1 ",sd=" sqrt(v1) ", nd(x) title 'sample 1',\ mu=" m2 ",sd=" sqrt(v2) ", nd(x) title 'sample 2'" |& GnuPlot print "quit" |& GnuPlot GnuPlot |& getline Image while ((GnuPlot |& getline) > 0) Image = Image RS $0 close(GnuPlot) } Document = Document "\

Do these samples have the same Gaussian distribution?

\
\ \ \ \ \ \ \ \ \ \
1. Mean 1. Variance 1. Count
2. Mean 2. Variance 2. Count

" } else if (MENU[2] ~ "Image") { Reason = "OK" ORS "Content-type: image/png" #Reason = "OK" ORS "Content-type: application/x-postscript" #Reason = "OK" ORS "Content-type: image/gif" Header = Footer = "" Document = Image } } network/fingerclient.awk000066600000000241151000533030011401 0ustar00BEGIN { NetService = "/inet/tcp/0/localhost/finger" print "var{name}" |& NetService while ((NetService |& getline) > 0) print $0 close(NetService) } network/eliza.awk.gz000066600000007503151000533030010463 0ustar00Z{sߟYl$l;2Ƞ$"8td0 YX$BN{Ϲ/]v';/)~٭2^CMm3'j M?=G[GM;]ZC? GO$z=I7/vSqv߶7Zi|X4Z&z,p熶m0_̶I^/٬.M ^w7|d= !i O8 aVϐy IHdǾf\EEWLCv~=Mwr!^cAglN2/C)OА)pk09v(,T:NѠNρd]n+LI0["M7EDaa-:#V+rr Q'u=J :K#M ~D*[vh_'thEve9a*+g8ؒ;& z9Po~6R;٬/)_fN WDo8b!,TWDUתXwb}ӵDE4^5`œ>`:ki"! L|3-i1#P0 `6j2.ku`o@uK֛Dt~>jзHINfҚCNqjM%'RBP<.1Z_)lX[[6ql8б\_ ,hG߷F#ƃ.>3#`|?9WEp1j KZ=%')A̺ } ֽņ}|z!R %P7FyOLu+owᓿ3DmN缔4yt|X̩n(-Osa"% Yf3CqJ*'+IB0@Prڽv#Q5rT"9!.PwGfkzG|`F `>̲J:D\n^qC>.зþWH,#o!sGQSF_=kwh8\ >߻>0_2~;XD70M[+k;yTrzfEq[сc¨VfWA̕JzPfoք; +Bs@ؑѡзSᬕ5ENd͂,GSL ,Dν\XkU-Dy%CgԒ:{X#o*Akw lh iɰ@RJ)M$MZ8pkI+22]q)<9i.&{<5ٖ*ؿ "A/D؃ _ ca4m@$~ (kY#$8>>-$e#ӌn29dW[&Xt>HkP!0uQ5*9ztn {x`H|"F49ҡrļdÄ`RaaqHO2O=%')$YИqEhz+=F6,βH$s"MoYAJvi1TYK{5ߧ=n^3F?w3GtFǃ˯_$d)M(C:V& T8;d,uh@Z?*(RhiYhh TY.lz$(P6ŭ]s\rUe1kPCar^f T ZtV(T0dWjPC&T2 8ps&

" \ "This site is temporarily out of service." \ "

" Len = length(Hello) + length(ORS) while ("awk" != "complex") { print "HTTP/1.0 200 OK" |& HttpService print "Content-Length: " Len ORS |& HttpService print Hello |& HttpService while ((HttpService |& getline) > 0) continue; close(HttpService) } } network/stoxpred.awk.gz000066600000003277151000533030011233 0ustar00XYs6~ز-W-%>$Vj'nnLc"W"F$r{Rv"2\ ,u@H6R3`* 0<&2%g00[4#(#8K?1ã(aʄKHF2;2lb/z`^:+;+ctIaZOhۏhDb=i%OO{`E#{1 3Gp0VcaX3rNx5d&1 j)>~=3%g8Yaju+\,b:|.2r:W Fa; '~D6xW;G ';C|AӛwJiVMvnv5$Ǽcd?C2N0 pA0SFk$% cby sM|U~@)qʃ> ;]?^;o%DP. )aϷ2.A^AԗAwU,FjG~~+[6q6,)kd*Ō%6HP{믞E \[^6n œF'u]wN*0G2_7jBWoj<$S9ܪ[oS]57g)+4%D FtkȘXn!$i ƔJad~ipQa[ {S6&[74.+|~̟zY*"$oK8QyE ZTx՗Y7zʫ\]i_vFIk)*imE|ZFwÍÓW~>`.iJslPncqARt OY-dLԛ^tGC}dAFQ/P!01 vnI%! +[fmlkU'^6L:2KF,mlf\iC|v ⍋(h7C-UOMp!a4 ;01YZ^G\=}rj7+F_h.25i+p&blIؑQH?c̹BNMmCDs 6Wڎ4a I#cqvܶ3{Y7 /r_YlozsbޮCx7c][%|U_;Nt~׶S`J&9_B4)|=GE6k2/yp-4-lMqܿ۹6Yg\G)2k>GZ$*1dq6>4:(<={۵~r["dG!YbdB.r,+H'K ˈl hlfd2&켱i~C'Mǵ|QT_ȅ!U/⦧3< :EՏÚI'9gTCc= .1 oˬs.vH" :O*(c]RfIg¦k_1?wO((}R&ؖ^9⮀ Gp04m-wNO]7e4sT=9U4k뒾ݑRQو9Zᮆ37){Qlz؀๔1R%lA;GW@jxLmNSs:|!Cdata/inventory-shipped000066600000000501151000533030011055 0ustar00Jan 13 25 15 115 Feb 15 32 24 226 Mar 15 24 34 228 Apr 31 52 63 420 May 16 34 29 208 Jun 31 42 75 492 Jul 24 34 67 436 Aug 15 34 47 316 Sep 13 55 37 277 Oct 29 54 68 525 Nov 20 87 82 577 Dec 17 35 61 401 Jan 21 36 64 620 Feb 26 58 80 652 Mar 24 75 70 495 Apr 21 70 74 514 data/guide-mellow.po000066600000000177151000533030010406 0ustar00#: guide.awk:4 msgid "Don't Panic" msgstr "Hey man, relax!" #: guide.awk:5 msgid "The Answer Is" msgstr "Like, the scoop is" data/BBS-list000066600000000772151000533030006757 0ustar00aardvark 555-5553 1200/300 B alpo-net 555-3412 2400/1200/300 A barfly 555-7685 1200/300 A bites 555-1675 2400/1200/300 A camelot 555-0542 300 C core 555-2912 1200/300 C fooey 555-1234 2400/1200/300 B foot 555-6699 1200/300 B macfoo 555-6480 1200/300 A sdace 555-3430 2400/1200/300 A sabafoo 555-2127 1200/300 C data/guide.po000066600000000136151000533030007104 0ustar00#: guide.awk:4 msgid "Don't Panic" msgstr "" #: guide.awk:5 msgid "The Answer Is" msgstr "" misc/arraymax.awk000066600000000147151000533030010023 0ustar00{ if ($1 > max) max = $1 arr[$1] = $0 } END { for (x = 1; x <= max; x++) print arr[x] } misc/findpat.data000066600000000203151000533030007744 0ustar00FIND ru+n My program runs but not very quickly FIND Melvin JF+KM This line is property of Reality Engineering Co. Melvin was here. misc/findpat.awk000066600000000330151000533030007616 0ustar00{ if ($1 == "FIND") regex = $2 else { where = match($0, regex) if (where != 0) print "Match of", regex, "found at", where, "in", $0 } } misc/arraymax.data000066600000000177151000533030010155 0ustar005 I am the Five man 2 Who are you? The new number two! 4 . . . And four on the floor 1 Who is number one? 3 I three you. js/awstats_misc_tracker.js.gz000066600000005164151000671360012362 0ustar00Yms6l ")iId:N껼]6sv2 QIIKj~(I.xYe/Jٜ&iVД32l"( LıXP7/΀PTg ܗQVbq*~n==j\5w:=jS ;NO$*T|ݕżp-yYl\bC ʳ[=cHņ .ÚyAZjxY ^HEH0;s/PdC&R2.iԠ]**ıϹ14/~Ah*"2wJ!V ƗY,$DT0^ %y&dqMS"ZE+ MREd4s< 5 1Rz\rvqBDKia Ze8`tZ%AvDGqD5 mt0X|0 ~\!7;DdɆKl"(^+FrSvE)RoDfk.;]]X|r9\{[2$"IdʥΙBȾjɾQ˕hG'֌(lY:CQ;[tQ4u6nmQ+֦7Ӝ2ZG״Կai[H7js5Xpyt|Vԭ4-j%5-TYHePq%+tLoi&3_' Zl]M o >pOkZ~t< Cк2+.9 q7*B6iJtxhE*g5yvyy3/T0WՀGPiHEkj\Ɯ>kVHAo{R4+?NLK^-քU!a~SEW&E)JuLWGvtKG@n$y;#t,SL~}Uv]%6dƶ=z=ΑKSwV5D?8`\r1%MzHXRBm\c&`[+zq}(ޏПtџD'  .O{wRAQPԧ"aoxԯܤ;dKQe4?ՃrJC۝֡vMH'a` 'vAZ%^ȇ,,[/c"ر}:e{K!CgȇL`P0UR͐j*JwvMbfC:&Qb!! Au0gyDE/ryY*r;vFn*H@,=DfxQor*0~4_}ܵ8;;DIK\tz7kAn1!CT!4UUSkvLW׀o@ 1]X_[w@Wf'3tgCdI )b%SՉ.qFZ/DϨ6zlF͸|`ToE o'*+>bw]ߚEl8\,TӧPW'Y{J߂(Z&vN誎SWBHϻdQ /V^HY? V*Pϣ8dw:"~[}~^zjގ_紸9<Ut{Lapache.conf000066600000002641151000671360006642 0ustar00# This provides worldwide access to everything below the directory # Security concerns: # * Raw log processing data is accessible too for everyone # * The directory is by default writable by the httpd daemon, so if # any PHP, CGI or other script can be tricked into copying or # symlinking stuff here, you have a looking glass into your server, # and if stuff can be uploaded to here, you have a public warez site! Options None AllowOverride None Order allow,deny Allow from all # This provides worldwide access to everything below the directory # Security concerns: none known Options None AllowOverride None Order allow,deny Allow from all # This provides worldwide access to everything below the directory # Security concerns: none known Options FollowSymLinks AllowOverride None Order allow,deny Allow from all # This provides worldwide access to everything in the directory # Security concerns: none known Alias /awstats-icon/ /usr/share/awstats/icon/ # This provides worldwide access to everything in the directory # Security concerns: none known Alias /awstatsclasses/ /usr/share/java/awstats/ # This (hopefully) enables _all_ CGI scripts in the default directory # Security concerns: Are you sure _all_ CGI scripts are safe? ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ redostats.sh000066600000001556151000671360007122 0ustar00#! /bin/bash CONFDIR=/etc/awstats DATADIR=/var/lib/awstats PROGRAM=/usr/lib/cgi-bin/awstats.pl if [ `id -u` != 0 ]; then exit 1 fi set -e cd $DATADIR OLDSTATS=`date -I` if mkdir $OLDSTATS 2> /dev/null; then mv *.txt *.bak $OLDSTATS fi rm -f *.txt *.bak TMPLOG=`mktemp --tmpdir access.log.XXXXXXXX` TMPCRON=$CONFDIR/awstats.cron CRONORIG=/etc/cron.d/awstats CONFORIG=$CONFDIR/conf.orig CONFFILE=$CONFDIR/awstats.conf trap 'rm $TMPLOG; mv -f $CONFORIG $CONFFILE; mv -f $TMPCRON $CRONORIG; /etc/init.d/cron reload' EXIT mv -f $CONFFILE $CONFORIG cat $CONFORIG | sed "\|/var/log/apache2/access.log|s||$TMPLOG|" > $CONFFILE mv -f $CRONORIG $TMPCRON /etc/init.d/cron reload ls -rt /var/log/apache2/access.log* | while read file do zcat -f $file > $TMPLOG echo Processing ${file}... sudo -u www-data $PROGRAM -config=awstats done rm -f $DATADIR/*.bak xslt/README.txt000066600000001717151000671360007245 0ustar00----- README.txt about AWStats XSLT demo ----- This directory is absolutely not required to make AWStats working. All files here are demo files you can use if you want to manipulate AWStats XML database to build report by yourself and without using AWStats output features. The following file describe the structure of the AWStats XML database (built when BuildHistoryOutput is set to 'xml'). * awstats.xsd File descriptor for AWStats xml database schema. The following two files can be used to test a xslt processing to transform an AWStats XML database (built when BuildHistoryOutput is set to 'xml'). into a report. * awstats.datademo1.xml A xml data demo file to test xslt transform with style sheet. * awstats.datademo1.xslt A demo xsl style sheet to transform de xml data demo file. To build a report using this 2 files and a xslt processor, you must run the command: xsltproc awstats.datademo1.xslt awstats.datademo1.xml > output.html xslt/awstats.xsd000066600000005642151000671360007756 0ustar00 xslt/awstats.datademo1.xml.gz000066600000006316151000671360012234 0ustar00r8)TsU3uO0ST1a' 9H6wuXwJ&>8I6&YR5nuݒ|{5uz? ŧFcZ)+CdUUkzs=> ?FkǷpQX0p{b 3"Uwg;:?<;Cpѹu4 |-]b[͏'g єu@o6x gKЏzH]cV p`'Ae#]]ifYޠ%ej@v^_v[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@;7m8wx)c?k%ԙfCmnʥ1`qتf>Tbe/k^>_^Pg%c%bq@(F~J Nw!,57K\GˬuGubNUjX-ۚ #de󦒁ƔO+ $"vì^\AIѩVJ* xusK.lpB|A]HvTz W#]=JiL"a YP)-xjGYԣ/4$U3)0#'ZӨHհ-_*h /{25z%**&J`SZ姜&xhA}/]mǞȧ_./J'+eir)]'`N Y2@ e ^t97o7Sui YShPna~K@)uO$rIHZlĴN9O~ANV VI؋TT4ֿ ^3rg*mGX`#!)$_Ej$u: 8~1uJRqdmpbXᖷlŽ:q0nM6C:Ǔ>egJXZv cnI֒u(Qh.˳$I@awstats_exportlib.pl000066600000030755151000671360010674 0ustar00#!/usr/bin/perl #----------------------------------------------------------------------------- # Export lib data values to a text files to allow to use AWStats robots, # os, browsers, search_engines database with other log analyzers #----------------------------------------------------------------------------- # $Revision: 1.4 $ - $Author: eldy $ - $Date: 2003/12/05 23:53:37 $ #use warnings; # Must be used in test mode only. This reduce a little process speed #use diagnostics; # Must be used in test mode only. This reduce a lot of process speed use strict;no strict "refs"; #----------------------------------------------------------------------------- # Defines #----------------------------------------------------------------------------- use vars qw/ $REVISION $VERSION /; my $REVISION='$Revision: 1.4 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; my $VERSION="5.1 (build $REVISION)"; # ---------- Init variables ------- # Constants use vars qw/ $DEBUGFORCED /; $DEBUGFORCED=0; # Force debug level to log lesser level into debug.log file (Keep this value to 0) # Running variables use vars qw/ $DIR $PROG $Extension $Debug $DebugResetDone /; $DIR=$PROG=$Extension=''; $Debug=0; $DebugResetDone=0; use vars qw/ $LevelForRobotsDetection $LevelForBrowsersDetection $LevelForOSDetection $LevelForRefererAnalyze $LevelForSearchEnginesDetection $LevelForKeywordsDetection /; ($LevelForRobotsDetection, $LevelForBrowsersDetection, $LevelForOSDetection, $LevelForRefererAnalyze, $LevelForSearchEnginesDetection, $LevelForKeywordsDetection)= (2,1,1,1,1,1); use vars qw/ $DirLock $DirCgi $DirData $DirIcons $DirLang $AWScript $ArchiveFileName $AllowAccessFromWebToFollowingIPAddresses $HTMLHeadSection $HTMLEndSection $LinksToWhoIs $LinksToIPWhoIs $LogFile $LogFormat $LogSeparator $Logo $LogoLink $StyleSheet $WrapperScript $SiteDomain /; ($DirLock, $DirCgi, $DirData, $DirIcons, $DirLang, $AWScript, $ArchiveFileName, $AllowAccessFromWebToFollowingIPAddresses, $HTMLHeadSection, $HTMLEndSection, $LinksToWhoIs, $LinksToIPWhoIs, $LogFile, $LogFormat, $LogSeparator, $Logo, $LogoLink, $StyleSheet, $WrapperScript, $SiteDomain)= ("","","","","","","","","","","","","","","","","","","",""); use vars qw/ $QueryString $LibToExport $ExportFormat /; ($QueryString, $LibToExport, $ExportFormat)= ('','',''); # ---------- Init arrays -------- use vars qw/ @RobotsSearchIDOrder_list1 @RobotsSearchIDOrder_list2 @RobotsSearchIDOrder_listgen @SearchEnginesSearchIDOrder_list1 @SearchEnginesSearchIDOrder_list2 @SearchEnginesSearchIDOrder_listgen @BrowsersSearchIDOrder @OSSearchIDOrder @WordsToExtractSearchUrl @WordsToCleanSearchUrl @WormsSearchIDOrder @RobotsSearchIDOrder @SearchEnginesSearchIDOrder /; @RobotsSearchIDOrder = @SearchEnginesSearchIDOrder = (); # ---------- Init hash arrays -------- use vars qw/ %BrowsersHashIDLib %BrowsersHashIcon %BrowsersHereAreGrabbers %DomainsHashIDLib %MimeHashLib %MimeHashIcon %MimeHashFamily %OSHashID %OSHashLib %RobotsHashIDLib %SearchEnginesHashID %SearchEnginesHashLib %SearchEnginesKnownUrl %NotSearchEnginesKeys %WormsHashID %WormsHashLib /; #----------------------------------------------------------------------------- # Functions #----------------------------------------------------------------------------- #------------------------------------------------------------------------------ # Function: Write error message and exit # Parameters: $message $secondmessage $thirdmessage $donotshowsetupinfo # Input: $LogSeparator $LogFormat # Output: None # Return: None #------------------------------------------------------------------------------ sub error { my $message=shift||""; my $secondmessage=shift||""; my $thirdmessage=shift||""; my $donotshowsetupinfo=shift||0; if ($Debug) { debug("$message $secondmessage $thirdmessage",1); } print STDERR "$message"; print STDERR "\n"; exit 1; } #------------------------------------------------------------------------------ # Function: Write debug message and exit # Parameters: $string $level # Input: $Debug = required level $DEBUGFORCED = required level forced # Output: None # Return: None #------------------------------------------------------------------------------ sub debug { my $level = $_[1] || 1; if ($level <= $DEBUGFORCED) { my $debugstring = $_[0]; if (! $DebugResetDone) { open(DEBUGFORCEDFILE,"debug.log"); close DEBUGFORCEDFILE; chmod 0666,"debug.log"; $DebugResetDone=1; } open(DEBUGFORCEDFILE,">>debug.log"); print DEBUGFORCEDFILE localtime(time)." - $$ - DEBUG $level - $debugstring\n"; close DEBUGFORCEDFILE; } if ($level <= $Debug) { my $debugstring = $_[0]; print localtime(time)." - DEBUG $level - $debugstring\n"; } } #------------------------------------------------------------------------------ # Function: Load the reference databases # Parameters: None # Input: $DIR # Output: Arrays and Hash tables are defined # Return: None #------------------------------------------------------------------------------ sub Read_Ref_Data { # Check lib files in common possible directories : # Windows : "${DIR}lib" (lib in same dir than awstats.pl) # Debian package : "/usr/share/awstats/lib" # Other possible directories : "./lib" my $lib=shift; my $dir=$lib; $lib=~ s/^.*[\\\/]//; $dir =~ s/[^\\\/]+$//; $dir =~ s/[\\\/]+$//; debug("Lib: $lib, Dir: $dir"); my @PossibleLibDir=("$dir","{DIR}lib","/usr/share/awstats/lib","./lib"); my %FilePath=(); my @FileListToLoad=(); push @FileListToLoad, "$lib"; foreach my $file (@FileListToLoad) { foreach my $dir (@PossibleLibDir) { my $searchdir=$dir; if ($searchdir && (!($searchdir =~ /\/$/)) && (!($searchdir =~ /\\$/)) ) { $searchdir .= "/"; } if (! $FilePath{$file}) { if (-s "${searchdir}${file}") { $FilePath{$file}="${searchdir}${file}"; if ($Debug) { debug("Call to Read_Ref_Data [FilePath{$file}=\"$FilePath{$file}\"]"); } # push @INC, "${searchdir}"; require "${file}"; require "$FilePath{$file}"; } } } if (! $FilePath{$file}) { my $filetext=$file; $filetext =~ s/\.pm$//; $filetext =~ s/_/ /g; &error("Error: Can't read file \"$file\".\nCheck if file is in ".($PossibleLibDir[0])." directory and is readable."); } } } #------------------------------------------------------------------------------ # Function: Unregex a string # Parameters: String # Input: - # Output: - # Return: Unregexed string #------------------------------------------------------------------------------ sub unregex { my $ss=shift; $ss=~s/\\//g; return $ss; } #------------------------------------------------------------------------------ # Function: Unregex a keyword code extractor # Parameters: String # Input: - # Output: - # Return: Unregexed string #------------------------------------------------------------------------------ sub unregexkeywordcode { my $ss=shift; my $firstoneonly=shift||0; my @xx=split(/\|/,$ss); my @ll=map { s/[\(\)]//g; $_; } @xx; if ($firstoneonly) { return $ll[0]; } return join(',',@ll); } #------------------------------------------------------------------------------ # MAIN #------------------------------------------------------------------------------ ($DIR=$0) =~ s/([^\/\\]*)$//; ($PROG=$1) =~ s/\.([^\.]*)$//; $Extension=$1; my @AllowedArgs=('-lib','-exportformat','-debug'); $QueryString=""; for (0..@ARGV-1) { # TODO Check if ARGV is an AllowedArg if ($_ > 0) { $QueryString .= "&"; } my $NewLinkParams=$ARGV[$_]; $NewLinkParams =~ s/^-+//; $NewLinkParams =~ s/\s/%20/g; $QueryString .= "$NewLinkParams"; } $ExportFormat="text"; if ($QueryString =~ /lib=([^\s&]+)/i) { $LibToExport="$1"; } if ($QueryString =~ /exportformat=([^\s&]+)/i) { $ExportFormat="$1"; } if ($QueryString =~ /debug=(\d+)/i) { $Debug=$1; } if ($Debug) { debug("$PROG - $VERSION - Perl $^X $]",1); debug("QUERY_STRING=$QueryString",2); } if (! $LibToExport || ! $ExportFormat) { print "----- $PROG $VERSION (c) Laurent Destailleur -----\n"; print "$PROG is a tool to export AWStats lib (Robots, Os, Browsers, search\n"; print "engines database) to text files. This allow you to use AWStats lib with some\n"; print "other log analyzers (to enhance their capabilities or to make comparison).\n"; print "$PROG comes with ABSOLUTELY NO WARRANTY. It's a free software distributed\n"; print "with a GNU General Public License (See LICENSE file for details).\n"; print "\n"; print "Syntax: $PROG.$Extension -lib=/awstatslibpath/libfile.pm [-exportformat=format]\n"; print "\n"; print "Where format can be:\n"; print " text (default)\n"; print " webalizer\n"; print " analog\n"; print "\n"; exit 2; } &Read_Ref_Data($LibToExport); my $libisexportable=0; # Export data #------------ if ($LibToExport =~ /browsers/) { foreach my $key (@BrowsersSearchIDOrder) { if ($ExportFormat eq 'text') { print "$key\t$BrowsersHashIDLib{$key}\n"; } if ($ExportFormat eq 'webalizer') { print "GroupAgent\t$key\n"; } if ($ExportFormat eq 'analog') { print "Analog does not support self-defined browsers.\nUse 'text' export format if you want an export list of AWStats Browsers.\n"; last; } } $libisexportable=1; } if ($LibToExport =~ /mime/) { if ($ExportFormat eq 'analog') { foreach my $key (sort keys %MimeHashFamily) { if ($MimeHashFamily{$key} =~ /(text|page|script|document)/) { print "PAGEINCLUDE *.$key\n"; } } } foreach my $key (sort keys %MimeHashFamily) { if ($ExportFormat eq 'text') { print "$key\t$MimeHashLib{$MimeHashFamily{$key}}\n"; } if ($ExportFormat eq 'webalizer') { print "Webalizer does not support self-defined mime types.\nUse 'text' export format if you want an export list of AWStats Mime types.\n"; last; } if ($ExportFormat eq 'analog') { print "TYPEALIAS .$key \"$key [$MimeHashLib{$MimeHashFamily{$key}}]\"\n"; } } $libisexportable=1; } if ($LibToExport =~ /operating_systems/) { foreach my $key (sort keys %OSHashLib) { if ($ExportFormat eq 'text') { print "Feature not ready yet\n"; last; } if ($ExportFormat eq 'webalizer') { print "Webalizer does not support self-defined added OS.\nUse 'text' export format if you want an export list of AWStats OS.\n"; last; } if ($ExportFormat eq 'analog') { print "Analog does not support self-defined added OS.\nUse 'text' export format if you want an export list of AWStats OS.\n"; last; } } $libisexportable=1; } if ($LibToExport =~ /robots/) { my %robotlist=(); my @list; # Init RobotsSearchIDOrder required for update process @list=(); foreach (1..2) { push @list,"list$_"; } push @list,"listgen"; foreach my $key (@list) { push @RobotsSearchIDOrder,@{"RobotsSearchIDOrder_$key"}; } foreach my $key (@RobotsSearchIDOrder) { if ($ExportFormat eq 'text') { print "$key\t$RobotsHashIDLib{$key}\n"; } if ($ExportFormat eq 'webalizer') { print "GroupAgent\t$key\n"; } if ($ExportFormat eq 'analog') { print "ROBOTINCLUDE REGEXPI:$key\n"; } } $libisexportable=1; } if ($LibToExport =~ /search_engines/) { my @list; # Init SearchEnginesIDOrder required for update process @list=(); foreach (1..2) { push @list,"list$_"; } push @list,"listgen"; # Always added foreach my $key (@list) { push @SearchEnginesSearchIDOrder,@{"SearchEnginesSearchIDOrder_$key"}; } foreach my $key (@SearchEnginesSearchIDOrder) { if ($ExportFormat eq 'text') { print "$key\t$SearchEnginesKnownUrl{$SearchEnginesHashID{$key}}\t$SearchEnginesHashLib{$SearchEnginesHashID{$key}}\n"; } if ($ExportFormat eq 'webalizer') { my $urlkeywordsyntax=$SearchEnginesKnownUrl{$SearchEnginesHashID{$key}}; my $urlkeywordsyntax=&unregexkeywordcode($urlkeywordsyntax,1); if (! $urlkeywordsyntax) { next; } # This has no keywordextractcode my $newkey=&unregex($key); if ($newkey =~ /[\[\]\(\)\|\?\*\+]/) { next; } # This was a regex value that i can't clean print "SearchEngine\t$newkey\t$urlkeywordsyntax\n"; print "GroupReferrer\t$newkey\t$SearchEnginesHashLib{$SearchEnginesHashID{$key}}\n"; } if ($ExportFormat eq 'analog') { my $urlkeywordsyntax=$SearchEnginesKnownUrl{$SearchEnginesHashID{$key}}; $urlkeywordsyntax=~s/=$//; $urlkeywordsyntax=&unregexkeywordcode($urlkeywordsyntax); if (! $urlkeywordsyntax) { next; } # This has no keywordextractcode my $newkey=&unregex($key); if ($newkey =~ /[\[\]\(\)\|\?\*\+]/) { next; } # This was a regex value that i can't clean print "SEARCHENGINE http://*$newkey*/* $urlkeywordsyntax\n"; } } $libisexportable=1; } if (! $libisexportable) { print "Export for AWStats lib '$LibToExport' is not supported in this tool version.\n"; } 0; # Do not remove this line example.pm.gz000066600000005002151000671360007154 0ustar00Z{sH>EGfc0I.we'Q#^%`tÏr=3}:صA_f[ʡǖS^0n}̟h|a3PŰU^[ jNox PBS#};Gnt04{plyF}0pdCɥ}V뚘ruZ.[Z4١KȬk ThI9XRi1h0RA8PW;x|u$)tih3za31-?L/":_\[:P)U>BBN Wal\+ݝA.M!GHc4Рnt:jMj>ZzZ 1jku Wܴ!- pƄ*eoPkTJz>R4#9sP]\s>b,>?Iu\N}e/Kzt~UZk~wΨC.Ԡ fl~++!R M ZIfWF|jRoZS.%&߈e_VR≍XvS3=9־E%P q'-ly01}VH:ԗP`{%IKRǴL1Y X: 2kuGFrp`JBrC0|8ct)Hl4|iB0BS;L5q >HܜXrΓx[Z Kϑ)F J5wzb^oHM)'wD-\u_s1A%lRs_p}rS``Dm;T8T) zNUw9S-\/,Zi5qFEdBR@xhϧR,ZM_[Պ-H0uq[!XmA$7TQfIb Ubg[Dbn n7~7~O;p=Lf|/e(Q7b^ԧ?:­snIa8A UӼb m8I6 )"%wMvyX!W(:7e"X8g5cOfMyE:!ZhT7.k-hq/t7tcͰ(9Y56⚟\6Gap΁Wr0B{9| =(.i_- f63@ѥؖ+.  @My󋩸E]YQm,֚VVn^X|/O4zL42Vy )ςO3&V߂R]5=8cW~/Dvg81q-HDL8E:u?59иrԷ?qs4r~,[q.~,-+L/):[htΣ;Mt".WsxYS+=.Il)ezoT6"b-  4?>s2g.s.E|;YV+1, 'Feb'=>2, 'Mar'=>3, 'Apr'=>4, 'May'=>5, 'Jun'=>6, 'Jul'=>7, 'Aug'=>8, 'Sep'=>9, 'Oct'=>10, 'Nov'=>11, 'Dec'=>12 ); #------------------------------------------------------- # Functions #------------------------------------------------------- sub error { print STDERR "Error: $_[0].\n"; exit 1; } sub debug { my $level = $_[1] || 1; if ($Debug >= $level) { my $debugstring = $_[0]; if ($ENV{"GATEWAY_INTERFACE"}) { $debugstring =~ s/^ /   /; $debugstring .= "
"; } print localtime(time)." - DEBUG $level - $. - : $debugstring\n"; } 0; } sub CleanVadminUser { $_=shift||''; s/[#<|>\[\]]//g; # Remove unwanted characters first s/^(.*?)-//gi; # Strip off unixuser- at beginning return $_; } sub CleanEmail { $_=shift||''; s/[#<|>\[\]]//g; # Remove unwanted characters first return $_; } # Clean host addresses # Input: "servername[123.123.123.123]", "servername [123.123.123.123]" # "root@servername", "[123.123.123.123]" # Return: servername or 123.123.123.123 if servername is 'unknown' sub CleanHost { $_=shift||''; if (/^\[(.*)\]$/) { $_=$1; } # If [ip] we keep ip if (/^unknown\s*\[/) { $_ =~ /\[(.*)\]/; $_=$1; } # If unknown [ip], we keep ip else { $_ =~ s/\s*\[.*$//; } $_ =~ s/^.*\@//; # If x@y, we keep y return $_; } # Return domain # Input: host.domain.com, , <> # sub CleanDomain { $_=shift; s/>.*$//; s/[<>]//g; s/^.*@//; if (! $_) { $_ = 'localhost'; } return $_; } # Return string without starting and ending space # sub trim { $_=shift; s/^\s+//; s/\s+$//; return $_; } # Write a record # sub OutputRecord { my $year=shift; my $month=shift; # Jan,Feb,... or 1,2,3... my $day=shift; my $time=shift; my $from=shift; my $to=shift; my $relay_s=shift; my $relay_r=shift; my $code=shift; my $size=shift||0; my $forwardto=shift; my $extinfo=shift||'-'; # Clean day and month $day=sprintf("%02d",$day); $month=sprintf("%02d",$MonthNum{$month}||$month); # Clean from $from=&CleanEmail($from); $from||='<>'; # Clean to if ($mode eq 'vadmin') { $to=&CleanVadminUser($to); } else { $to=&CleanEmail($to); } $to||='<>'; # Clean relay_s $relay_s=&CleanHost($relay_s); $relay_s||=&CleanDomain($from); $relay_s=~s/\.$//; if ($relay_s eq 'local' || $relay_s eq 'localhost.localdomain') { $relay_s='localhost'; } # Clean relay_r $relay_r=&CleanHost($relay_r); $relay_r||="-"; $relay_r=~s/\.$//; if ($relay_r eq 'local' || $relay_r eq 'localhost.localdomain') { $relay_r='localhost'; } #if we don't have info for relay_s, we keep it unknown, awstats might then guess it # Write line print "$year-$month-$day $time $from $to $relay_s $relay_r SMTP $extinfo $code $size\n"; # If there was a redirect if ($forwardto) { # Redirect to local address # TODO # Redirect to external address # TODO } } #------------------------------------------------------- # MAIN #------------------------------------------------------- # Prepare QueryString my %param=(); for (0..@ARGV-1) { $param{$_}=$ARGV[$_]; } foreach my $key (sort keys %param) { if ($param{$key} =~ /(^|-|&)debug=([^&]+)/i) { $Debug=$2; shift; next; } if ($param{$key} =~ /^(\d+)$/) { $year=$1; shift; next; } if ($param{$key} =~ /^(standard|vadmin)$/i) { $mode=$1; shift; next; } } if ($mode ne 'standard' and $mode ne 'vadmin') { $help = 1; } ($DIR=$0) =~ s/([^\/\\]*)$//; ($PROG=$1) =~ s/\.([^\.]*)$//; $Extension=$1; my $starttime=time(); my ($nowsec,$nowmin,$nowhour,$nowday,$nowmonth,$nowyear,$nowwday,$nowyday) = localtime($starttime); $year||=($nowyear+1900); # Show usage help if ($help) { print "----- $PROG $VERSION -----\n"; print < output The first parameter specifies what format the mail logfile is : standard - logfile is standard postfix,sendmail,qmail or mdaemon log format vadmin - logfile is qmail log format with vadmin multi-host support The second parameter specifies what year to timestamp logfile with, if current year is not the correct one (ie. 2002). Always use 4 digits. If not specified, current year is used. If no output is specified, it goes to the console (stdout). HELPTEXT sleep 1; exit; } # # Start Processing Input Logfile # $lastmon=0; my $numrecord=0; my $numrecordforflush=0; while (<>) { chomp $_; s/\r//; $numrecord++; $numrecordforflush++; my $mailid=0; if (/^__BREAKPOINT__/) { last; } # For debug only ### ### my ($mon)=m/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s/; if ($mon) { $mon = $MonthNum{$mon}; if ($mon==12 && $lastmon==1 ){$year--;} if ($mon==1 && $lastmon==12){$year++;} $lastmon=$mon; } ### ### if (/^#/) { debug("Comment record"); next; } # # Get sender host for postfix # elsif (/: client=/) { $MailType||='postfix'; # Example: # postfix: Jan 01 07:27:32 apollon.com postfix/smtpd[1684]: 2BC793B8A4: client=remt30.cluster1.abcde.net[209.225.8.40] my ($id,$relay_s)=m/\w+\s+\d+\s+\d+:\d+:\d+\s+[\w\-\.\@]+\s+(?:sendmail|postfix\/(?:local|lmtp|smtpd|smtp|virtual|pipe))\[\d+\]:\s+(.*?):\s+client=(.*)/; $mailid=$id; $mail{$id}{'relay_s'}=$relay_s; debug("For id=$id, found host sender on a 'client' line: $mail{$id}{'relay_s'}"); } # # See if we received postfix email reject error # elsif (/: reject/) { $MailType||='postfix'; # Example: # postfix ?.? : Jan 01 12:00:00 halley postfix/smtpd[9245]: reject: RCPT from unknown[203.156.32.33]: 554 : Recipient address rejected: Relay access denied; from= to= # postfix 2.1+: Jan 01 12:00:00 localhost postfix/smtpd[11120]: NOQUEUE: reject: RCPT from unknown[62.205.124.145]: 450 Client host rejected: cannot find your hostname, [62.205.124.145]; from= to= proto=ESMTP helo= # postfix ?.? : Jan 01 12:00:00 apollon postfix/smtpd[26553]: 1954F3B8A4: reject: RCPT from unknown[80.245.33.2]: 450 : User unknown in local recipient table; from= to= proto=ESMTP helo= my ($mon,$day,$time,$id,$code,$from,$to)=m/(\w+)\s+(\d+)\s+(\d+:\d+:\d+)\s+[\w\-\.\@]+\s+(?:postfix\/(?:local|lmtp|smtpd|smtp|virtual|pipe))\[\d+\]:\s+(.*?):\s+(.*)\s+from=([^\s,]*)\s+to=([^\s,]*)/; # postfix: Jan 01 14:10:16 juni postfix/smtpd[2568]: C34ED1432B: reject: RCPT from relay2.tp2rc.edu.tw[163.28.32.177]: 450 : User unknown in local recipient table; from=<> proto=ESMTP helo= if (! $mon) { ($mon,$day,$time,$id,$code,$from)=m/(\w+)\s+(\d+)\s+(\d+:\d+:\d+)\s+[\w\-\.\@]+\s+(?:postfix\/(?:local|lmtp|smtpd|smtp|virtual|pipe))\[\d+\]:\s+(.*?):\s+(.*)\s+from=([^\s,]*)/; } $mailid=($id eq 'reject' || $id eq 'NOQUEUE'?'999':$id); # id not provided in log, we take '999' if ($mailid) { # $code='reject: RCPT from unknown[203.156.32.33]: 554 : Recipient address rejected: Relay access denied;' # or 'reject: RCPT from unknown[62.205.124.145]: 450 Client host rejected: cannot find your hostname, [62.205.124.145]; from= to= proto=ESMTP helo=' # or 'reject: RCPT from unknown[80.245.33.2]: 450 : User unknown in local recipient table;' if ($code =~ /\s+(\d\d\d)\s+/) { $mail{$mailid}{'code'}=$1; } else { $mail{$mailid}{'code'}=999; } # Unkown error if (! $mail{$mailid}{'relay_s'} && $code =~ /from\s+([^\s]+)\s+/) { $mail{$mailid}{'relay_s'}=&trim($1); } $mail{$mailid}{'from'}=&trim($from); if ($to) { $mail{$mailid}{'to'}=&trim($to); } elsif ($code =~ /<(.*)>/) { $mail{$mailid}{'to'}=&trim($1); } $mail{$mailid}{'year'}=$year; ### ### $mail{$mailid}{'mon'}=$mon; $mail{$mailid}{'day'}=$day; $mail{$mailid}{'time'}=$time; if (! defined($mail{$mailid}{'size'})) { $mail{$mailid}{'size'}='?'; } debug("For id=$mailid, found a postfix error incoming message: code=$mail{$mailid}{'code'} from=$mail{$mailid}{'from'} to=$mail{$mailid}{'to'} time=$mail{$mailid}{'time'}"); } } # # See if we received postfix email bounced error # elsif (/stat(us)?=bounced/) { $MailType||='postfix'; # Example: # postfix: Sep 9 18:24:23 halley postfix/local[22003]: 12C6413EC9: to=, relay=local, delay=0, status=bounced (unknown user: "etavidian") my ($mon,$day,$time,$id,$to,$relay_r)=m/(\w+)\s+(\d+)\s+(\d+:\d+:\d+)\s+[\w\-\.\@]+\s+(?:postfix\/(?:local|lmtp|smtpd|smtp|virtual|pipe))\[\d+\]:\s+(.*?):\s+to=([^\s,]*)[\s,]+relay=([^\s,]*)/; $mailid=($id eq 'reject'?'999':$id); # id not provided in log, we take '999' if ($mailid) { $mail{$mailid}{'code'}=999; # Unkown error (bounced) $mail{$mailid}{'to'}=&trim($to); $mail{$mailid}{'relay_r'}=&trim($relay_r); $mail{$mailid}{'year'}=$year; ### ### $mail{$mailid}{'mon'}=$mon; $mail{$mailid}{'day'}=$day; $mail{$mailid}{'time'}=$time; if (! defined($mail{$mailid}{'size'})) { $mail{$mailid}{'size'}='?'; } debug("For id=$mailid, found a postfix bounced incoming message: code=$mail{$mailid}{'code'} to=$mail{$mailid}{'to'} relay_r=$mail{$mailid}{'relay_r'}"); } } # # See if we received sendmail reject error # elsif (/, reject/) { $MailType||='sendmail'; # Example: # sm-mta: Jul 27 04:06:05 androneda sm-mta[6641]: h6RB44tg006641: ruleset=check_mail, arg1=<7ms93d4ms@topprodsource.com>, relay=crelay1.easydns.com [216.220.57.222], reject=451 4.1.8 Domain of sender address 7ms93d4ms@topprodsource.com does not resolve # sm-mta: Jul 27 06:21:24 androneda sm-mta[11461]: h6RDLNtg011461: ruleset=check_rcpt, arg1=, relay=freedom.myhostdns.com [66.246.77.42], reject=550 5.7.1 ... Relaying denied # sendmail: Sep 30 04:21:32 halley sendmail[3161]: g8U2LVi03161: ruleset=check_rcpt, arg1=, relay=moon.partenor.fr [10.0.0.254], reject=550 5.7.1 ... Relaying denied # sendmail: Jan 10 07:37:48 smtp sendmail[32440]: ruleset=check_relay, arg1=[211.228.26.114], arg2=211.228.26.114, relay=[211.228.26.114], reject=554 5.7.1 Rejected 211.228.26.114 found in dnsbl.sorbs.net # sendmail: Jan 10 07:37:08 smtp sendmail[32439]: ruleset=check_relay, arg1=235.Red-213-97-175.pooles.rima-tde.net, arg2=213.97.175.235, relay=235.Red-213-97-175.pooles.rima-tde.net [213.97.175.235], reject=550 5.7.1 Mail from 213.97.175.235 refused. Rejected for bad WHOIS info on IP of your SMTP server - see http://www.rfc-ignorant.org/ # sendmail: Jan 10 17:15:42 smtp sendmail[12770]: ruleset=check_relay, arg1=[63.218.84.21], arg2=63.218.84.21, relay=[63.218.84.21], reject=553 5.3.0 Rejected - see http://spamhaus.org/ my ($mon,$day,$time,$id,$ruleset,$arg,$relay_s,$code)=m/(\w+)\s+(\d+)\s+(\d+:\d+:\d+)\s+[\w\-\.\@]+\s+(?:sendmail|sm-mta)\[\d+\][:\s]*(.*?):\sruleset=(\w+),\s+arg1=(.*),\s+relay=(.*),\s+(reject=.*)/; # sendmail: Jan 10 18:00:34 smtp sendmail[5759]: i04Axx2c005759: Milter: data, reject=511 Virus found in email! if (! $mon) { ($mon,$day,$time,$id,$ruleset,$code)=m/(\w+)\s+(\d+)\s+(\d+:\d+:\d+)\s+[\w\-\.\@]+\s+(?:sendmail|sm-mta)\[\d+\]:\s+(.*?):\s\w+:\s(\w+),\s+(reject=.*)/; } $mailid=(! $id && $mon?'999':$id); # id not provided in log, we take '999' if ($mailid) { if ($ruleset eq 'check_mail') { $mail{$mailid}{'from'}=$arg; } if ($ruleset eq 'check_rcpt') { $mail{$mailid}{'to'}=$arg; } if ($ruleset eq 'check_relay') { } if ($ruleset eq 'data') { } $mail{$mailid}{'relay_s'}=$relay_s; # $code='reject=550 5.7.1 ... Relaying denied' if ($code =~ /=(\d\d\d)\s+/) { $mail{$mailid}{'code'}=$1; } else { $mail{$mailid}{'code'}=999; } # Unkown error $mail{$mailid}{'year'}=$year; ### ### $mail{$mailid}{'mon'}=$mon; $mail{$mailid}{'day'}=$day; $mail{$mailid}{'time'}=$time; if (! defined($mail{$mailid}{'size'})) { $mail{$mailid}{'size'}='?'; } debug("For id=$mailid, found a sendmail error incoming message: code=$mail{$mailid}{'code'} from=$mail{$mailid}{'from'} to=$mail{$mailid}{'to'} relay_s=$mail{$mailid}{'relay_s'}"); } } # # See if we send a sendmail (with ctladdr tag) email # elsif (/, ctladdr=/) { $MailType||='sendmail'; # # Matched outgoing sendmail/postfix message # my ($mon,$day,$time,$id,$to,$fromorto)=m/(\w+)\s+(\d+)\s+(\d+:\d+:\d+)\s+[\w\-\.\@]+\s+(?:sm-mta|sendmail(?:-out|)|postfix\/(?:local|lmtp|smtpd|smtp|virtual|pipe))\[.*?\]:\s+([^:]*):\s+to=(.*?)[,\s]+ctladdr=([^\,\s]*)/; $mailid=$id; if (m/\s+relay=([^\s,]*)[\s,]/) { $mail{$id}{'relay_r'}=$1; } elsif (m/\s+mailer=local/) { $mail{$id}{'relay_r'}='localhost'; } if (/, stat\=Sent/) { $mail{$id}{'code'}=1; } elsif (/, stat\=User\s+unknown/) { $mail{$id}{'code'}=550; } elsif (/, stat\=Local\s+configuration/) { $mail{$id}{'code'}=451; } elsif (/, stat\=Deferred:\s+(\d*)/) { $mail{$id}{'code'}=$1; } else { $mail{$id}{'code'}=999; } $mail{$mailid}{'year'}=$year; ### ### $mail{$id}{'mon'}=$mon; $mail{$id}{'day'}=$day; $mail{$id}{'time'}=$time; if (&trim($to)=~/^\|/) { # In particular case of mails are sent to a pipe, the ctladdr contains the to $mail{$id}{'to'}=&trim($fromorto); } else { # In most cases $mail{$id}{'to'}=&trim($to); $mail{$id}{'from'}=&trim($fromorto); } if (! defined($mail{$id}{'size'})) { $mail{$id}{'size'}='?'; } debug("For id=$id, found a sendmail outgoing message: to=$mail{$id}{'to'} from=$mail{$id}{'from'} size=$mail{$id}{'size'} relay_r=".($mail{$id}{'relay_r'}||'')); } # # Matched incoming qmail message # elsif (/info msg .* from/) { # Example: Sep 14 09:58:09 gandalf qmail: 1063526289.292776 info msg 270182: bytes 10712 from qp 54945 uid 82 $MailType||='qmail'; #my ($id,$size,$from)=m/info msg \d+: bytes (\d+) from <(.*)>/; my ($id,$size,$from)=m/info msg (\d+): bytes (\d+) from <(.*)>/; $mailid=$id; delete $mail{$mailid}; # If 'info msg' found, we start a new mail. This is to protect from wrong file if (! $mail{$id}{'from'} || $mail{$id}{'from'} ne '<>') { $mail{$id}{'from'}=$from; } # TODO ??? $mail{$id}{'size'}=$size; if (m/\s+relay=([^\,]+)[\s\,]/ || m/\s+relay=([^\s\,]+)$/) { $mail{$id}{'relay_s'}=$1; } debug("For id=$id, found a qmail 'info msg' message: from=$mail{$id}{'from'} size=$mail{$id}{'size'}"); } # # Matched incoming sendmail or postfix message # elsif (/: from=/) { # sm-mta: Jul 28 06:55:13 androneda sm-mta[28877]: h6SDtCtg028877: from=, size=2556, class=0, nrcpts=1, msgid=, proto=ESMTP, daemon=MTA, relay=smtp.easydns.com [205.210.42.50] # postfix: Jul 3 15:32:26 apollon postfix/qmgr[13860]: 08FB63B8A4: from=, size=3302, nrcpt=1 (queue active) # postfix: Sep 24 14:45:15 wideboy postfix/qmgr[22331]: 7E0E6196: from=, size=1141 (queue active) my ($id,$from,$size)=m/\w+\s+\d+\s+\d+:\d+:\d+\s+[\w\-\.\@]+\s+(?:sm-mta|sendmail(?:-in|)|postfix\/qmgr|postfix\/nqmgr)\[\d+\]:\s+(.*?):\s+from=(.*?),\s+size=(\d+)/; $mailid=$id; if (! $mail{$id}{'code'}) { $mail{$id}{'code'}=1; } # If not already defined, we define it if (! $mail{$id}{'from'} || $mail{$id}{'from'} ne '<>') { $mail{$id}{'from'}=$from; } $mail{$id}{'size'}=$size; if (m/\s+relay=([^\,]+)[\s\,]/ || m/\s+relay=([^\s\,]+)$/) { $mail{$id}{'relay_s'}=$1; } debug("For id=$id, found a sendmail/postfix incoming message: from=$mail{$id}{'from'} size=$mail{$id}{'size'} relay_s=".($mail{$id}{'relay_s'}||'')); } # # Matched exchange message # elsif (/^([^\t]+)\t([^\t]+)\t[^\t]+\t([^\t]+)\t([^\t]+)\t([^\t]+)\t[^\t]+\t([^\t]+)\t([^\t]+)\t([^\t]+)\t[^\t]+\t[^\t]+\t([^\t]+)\t[^\t]+\t[^\t]+\t[^\t]+\t[^\t]+\t[^\t]+\t([^\t]+)\t([^\t]+)/) { # date hour GMT ip_s relay_s partner relay_r ip_r to code id size subject from # Example: 2003-8-12 0:58:14 GMT 66.218.66.69 n14.grp.scd.yahoo.com - PACKRAT 192.168.1.2 christina@pirnie.org 1019 bh9e3f+5qvo@eGroups.com 0 0 4281 1 2003-8-12 0:58:14 GMT 0 Version: 6.0.3790.0 - [SRESafeHaven] Re: More Baby Stuff jtluvs2cq@wmconnect.com - $MailType||='exchange'; my $date=$1; my $time=$2; my $relay_s=$3; my $partner=$4; my $relay_r=$5; my $to=$6; $to =~ s/\s/%20/g; my $code=$7; my $id=$8; my $size=$9; my $subject=&trim($10); my $from=$11; $from =~ s/\s/%20/g; $id=sprintf("%s_%s_%s",$id,$from,$to); # Check if record is significant record my $ok=0; # Code 1031=SMTP End Outbound Transfer if ($code == 1031) { # This is for external bound mails $ok=1; my $savrelay_s=$relay_s; $relay_s=$relay_r; $relay_r=$savrelay_s; #$relay_s=$relay_r; #$relay_r=$partner; $code=1; } # Code 1028=SMTP Store Driver: Message Delivered Locally to Store if ($code == 1028) { # This is for local bound mails $code=1; $ok=1; } # Code 1030=SMTP: Non-Delivered Report (NDR) Generated if ($code == 1030) { # This is for errors. $code=999; $ok=1; } if ($ok && !$mail{$id}{'code'} ) { $mailid=$id; if ($date =~ /(\d+)-(\d+)-(\d+)/) { $mail{$id}{'year'}=sprintf("%02s",$1); $mail{$id}{'mon'}=sprintf("%02s",$2); $mail{$id}{'day'}=sprintf("%02s",$3); } if ($time =~ /^(\d+):(\d+):(\d+)/) { $mail{$id}{'time'}=sprintf("%02s:%02s:%02s",$1,$2,$3); } if ( $from eq '<>' && $subject =~ /^Delivery\s+Status/) { $from='postmaster@localhost'; } $mail{$id}{'from'}=$from; $mail{$id}{'to'}=$to; $mail{$id}{'code'}=$code; $mail{$id}{'size'}=$size; $mail{$id}{'relay_s'}=$relay_s; $mail{$id}{'relay_r'}=$relay_r; debug("For id=$id, found an exchange message: year=$mail{$id}{'year'} mon=$mail{$id}{'mon'} day=$mail{$id}{'day'} time=$mail{$id}{'time'} from=$mail{$id}{'from'} to=$mail{$id}{'to'} size=$mail{$id}{'size'} code=$mail{$id}{'code'} relay_s=$mail{$id}{'relay_s'} relay_r=$mail{$id}{'relay_r'}"); } } # # Matched sendmail or postfix "to" message # elsif (/: to=.*stat(us)?=sent/i) { # Example: # postfix: Jan 01 07:27:38 apollon postfix/local[1689]: 2BC793B8A4: to=, orig_to=, relay=local, delay=6, status=sent ("|/usr/bin/procmail") my ($mon,$day,$time,$id,$to)=m/(\w+)\s+(\d+)\s+(\d+:\d+:\d+)\s+[\w\-\.\@]+\s+(?:sm-mta|sendmail(?:-out|)|postfix\/(?:local|lmtp|smtpd|smtp|virtual|pipe))\[.*?\]:\s+(.*?):\s+to=(.*?),/; $mailid=$id; $mail{$id}{'code'}='1'; if (m/\s+relay=([^\s,]*)[\s,]/) { $mail{$id}{'relay_r'}=$1; } elsif (m/\s+mailer=local/) { $mail{$id}{'relay_r'}='localhost'; } if (m/forwarded as/) { # If 'forwarded as idnewmail' is found, we discard this mail to avoid counting it twice debug("For id=$id, mail was forwarded to other id, we discard it"); delete $mail{$id}; } ########################################### elsif (m/\s*dsn=2.6.0\s*/) { # if the DSN is not 2.0.0, we discard this mail to avoid counting it twice # postfix: Aug 29 19:22:38 example postfix/smtp[1347]: D989FD6C302: to=, relay=127.0.0.1[127.0.0.1]:10024, delay=2.9, delays=0.31/0.01/0/2.6, dsn=2.6.0, status=sent (250 2.6.0 Ok, id=01182-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 995DCD6C315) debug("For id=$id, mail DSN is not 2.0.0, we discard it"); delete $mail{$id}; } ########################################### else { if (m/\s+orig_to=([^\s,]*)[\s,]/) { # If we have a orig_to, we used it as receiver $mail{$id}{'to'}=&trim($1); $mail{$id}{'forwardedto'}=&trim($to); } else { $mail{$id}{'to'}=&trim($to); } $mail{$mailid}{'year'}=$year; ### ### $mail{$id}{'mon'}=$mon; $mail{$id}{'day'}=$day; $mail{$id}{'time'}=$time; debug("For id=$id, found a sendmail/postfix record: mon=$mail{$id}{'mon'} day=$mail{$id}{'day'} time=$mail{$id}{'time'} to=$mail{$id}{'to'} relay_r=$mail{$id}{'relay_r'}"); } } # # Matched qmail "to" record # elsif (/starting delivery/) { # Example: Sep 14 09:58:09 gandalf qmail: 1063526289.574100 starting delivery 251: msg 270182 to local spamreport@john.do # Example: 2003-09-27 11:22:07.039237500 starting delivery 3714: msg 163844 to local name_also_removed@maildomain.com $MailType||='qmail'; my ($yea,$mon,$day,$time,$delivery,$id,$relay_r,$to)=(); ($mon,$day,$time,$delivery,$id,$relay_r,$to)=m/^(\w+)\s+(\d+)\s+(\d+:\d+:\d+)\s+.*\s+\d+(?:\.\d+)?\s+starting delivery (\d+):\s+msg\s+(\d+)\s+to\s+(.*)?\s+(.*)$/; if (! $id) { ($yea,$mon,$day,$time,$delivery,$id,$relay_r,$to)=m/^(\d+)-(\d+)-(\d+)\s+(\d+:\d+:\d+).*\s+starting delivery (\d+):\s+msg\s+(\d+)\s+to\s+(.*)?\s+(.*)$/; } $mailid=$id; if ($relay_r eq 'local') { $mail{$id}{'relay_r'}='localhost'; } elsif (m/\s+relay=([^\s,]*)[\s,]/) { $mail{$id}{'relay_r'}=$1; } elsif (m/\s+mailer=local/) { $mail{$id}{'relay_r'}='localhost'; } $qmaildelivery{$delivery}=$id; # Save mail id for this delivery to be able to get error code if ($yea) { $mail{$id}{'year'}=$yea; } $mail{$id}{'mon'}=$mon; $mail{$id}{'day'}=$day; $mail{$id}{'time'}=$time; $mail{$id}{'to'}{$delivery}=&trim($to); debug("For id=$id, found a qmail 'start delivery' record: year=".($mail{$id}{'year'}||'')." mon=$mail{$id}{'mon'} day=$mail{$id}{'day'} time=$mail{$id}{'time'} to=$mail{$id}{'to'}{$delivery} relay_r=".($mail{$id}{'relay_r'}||'')." delivery=$delivery"); } # # Matched qmail status code record # elsif (/delivery (\d+): (\w+):/) { # Example: Sep 14 09:58:09 gandalf qmail: 1063526289.744259 delivery 251: success: did_0+0+1/ # Example: 2003-09-27 11:22:07.070367500 delivery 3714: success: did_1+0+0/ $MailType||='qmail'; my ($delivery,$code)=($1,$2); my $id=$qmaildelivery{$delivery}; $mailid=$id; if ($code =~ /success/i) { $mail{$id}{'code'}{$delivery}=1; } elsif ($code =~ /deferral/i) { $mail{$id}{'code'}{$delivery}=999; } else { $mail{$id}{'code'}{$delivery}=999; } debug("For id=$qmaildelivery{$delivery}, found a qmail 'delivery' record: delivery=$delivery code=$mail{$id}{'code'}{$delivery}"); } # # Matched qmail end of mail record # elsif (/end msg (\d+)/ && scalar %{$mail{$1}{'to'}}) { # If records for mail id are finished and still mails with no delivery status # Example: Sep 14 09:58:12 gandalf qmail: 1063526292.782444 end msg 270182 $MailType||='qmail'; my ($id)=($1); $mailid=$id; foreach my $delivery (keys %{$mail{$mailid}{'to'}}) { $mail{$id}{'code'}{$delivery}||=1; } debug("For id=$id, found a qmail 'end msg' record. This replace 'delivery' record for delivery=".join(',',keys %{$mail{$id}{'code'}})); } # # Matched MDaemon log file record # elsif (/^\"(\d\d\d\d)-(\d\d)-(\d\d) (\d\d:\d\d:\d\d)\",\"[^\"]*\",(\w+),\d+,\"([^\"]*)\",\"([^\"]*)\",\"([^\"]*)\",\"[^\"]*\",\"([^\"]*)\",\"([^\"]*)\",\"([^\"]*)\",([\.\d]+),(\d+),(\d+)/) { # Example: "2003-11-06 00:00:42","2003-11-06 00:00:45",SMTPI,9443,"dillon_fm@aaaaa.net","cpeltier@domain.com","","","10.0.0.16","","",0,4563,1 $MailType||='mdaemon'; my ($id)=($numrecord); if ($5 eq 'SMTPI' || $5 eq 'SMTPO') { $mail{$id}{'year'}=$1; $mail{$id}{'mon'}=$2; $mail{$id}{'day'}=$3; $mail{$id}{'time'}=$4; $mail{$id}{'direction'}=($5 eq 'SMTPI'?'in':'out'); $mail{$id}{'from'}=$6; $mail{$id}{'to'}=$7||$8; if ($5 eq 'SMTPI') { $mail{$id}{'relay_s'}=$9; $mail{$id}{'relay_r'}='-'; } if ($5 eq 'SMTPO') { $mail{$id}{'relay_s'}=$9; $mail{$id}{'relay_r'}='-'; } $mail{$id}{'code'}=1; $mail{$id}{'size'}=$13; $mail{$id}{'extinfo'}="?virus=$10&rbl=$11&heuristicspam=$12&ssl=$14"; $mail{$id}{'extinfo'}=~s/\s/_/g; $mailid=$id; } } # # Write record if all required data were found # if ($mailid) { my $code; my $to; my $delivery=0; my $canoutput=0; debug("ID:$mailid RELAY_S:".($mail{$mailid}{'relay_s'}||'')." RELAY_R:".($mail{$mailid}{'relay_r'}||'')." FROM:".($mail{$mailid}{'from'}||'')." TO:".($mail{$mailid}{'to'}||'')." CODE:".($mail{$mailid}{'code'}||'')); # Check if we can output a mail line if ($MailType eq 'qmail') { if ($mail{$mailid}{'code'} && scalar %{$mail{$mailid}{'code'}}) { # This is a hash variable foreach my $key (keys %{$mail{$mailid}{'code'}}) { $delivery=$key; $code=$mail{$mailid}{'code'}{$key}; $to=$mail{$mailid}{'to'}{$key}; } $canoutput=1; } } elsif ($MailType eq 'mdaemon') { $code=$mail{$mailid}{'code'}; $to=$mail{$mailid}{'to'}; $canoutput=1; } else { $code=$mail{$mailid}{'code'}; $to=$mail{$mailid}{'to'}; if ($mail{$mailid}{'from'} && $mail{$mailid}{'to'}) { $canoutput=1; } if ($mail{$mailid}{'from'} && $mail{$mailid}{'code'} > 1) { $canoutput=1; } if ($mailid && $mail{$mailid}{'code'} > 1) { $canoutput=1; } } # If we can if ($canoutput) { &OutputRecord($mail{$mailid}{'year'}?$mail{$mailid}{'year'}:$year,$mail{$mailid}{'mon'},$mail{$mailid}{'day'},$mail{$mailid}{'time'},$mail{$mailid}{'from'},$to,$mail{$mailid}{'relay_s'},$mail{$mailid}{'relay_r'},$code,$mail{$mailid}{'size'},$mail{$mailid}{'forwardto'},$mail{$mailid}{'extinfo'}); # Delete mail with generic unknown id (This id can by used by another mail) if ($mailid eq '999') { debug(" Delete mail for id=$mailid",3); delete $mail{$mailid}; } # Delete delivery instance for id if qmail (qmail can use same id for several mails with multiple delivery) elsif ($MailType eq 'qmail') { debug(" Delete delivery instances for mail id=$mailid and delivery id=$delivery",3); if ($delivery) { delete $mail{$mailid}{'to'}{$delivery}; delete $mail{$mailid}{'code'}{$delivery}; } } # We flush %mail if too large if (scalar keys %mail > $NBOFENTRYFOFLUSH) { debug("We reach $NBOFENTRYFOFLUSH records in %mail, so we flush mail hash array"); #foreach my $id (keys %mail) { # debug(" Delete mail for id=$id",3); # delete $mail{$id}; #} %mail=(); %qmaildelivery=(); } } } else { debug("Not interesting row"); } } #foreach my $key (keys %mail) { # print ".$key.$mail{$key}{'to'}.\n"; #} 0; awstats_configure.pl000066600000063150151000671360010640 0ustar00#!/usr/bin/perl #------------------------------------------------------- # This script configures AWStats so that it works immediately. # - Get Apache config file from registry (ask if not found) # - Change common log to combined (ask to confirm) # - Add AWStats directives # - Restart web server # - Create AWStats config file # See COPYING.TXT file about AWStats GNU General Public License. #------------------------------------------------------- # $Revision: 1.8 $ - $Author: eldy $ - $Date: 2008/04/06 13:45:23 $ require 5.005; use strict; #------------------------------------------------------- # IF YOU ARE A PACKAGE BUILDER, CHANGE THIS TO MATCH YOUR PATH # SO THAT THE CONFIGURE WILL WORK ON YOUR DISTRIB !!! # Following path are the one #------------------------------------------------------- use vars qw/ $AWSTATS_PATH $AWSTATS_ICON_PATH $AWSTATS_CSS_PATH $AWSTATS_CLASSES_PATH $AWSTATS_CGI_PATH $AWSTATS_MODEL_CONFIG $AWSTATS_DIRDATA_PATH /; $AWSTATS_PATH=''; $AWSTATS_ICON_PATH='/usr/local/awstats/wwwroot/icon'; $AWSTATS_CSS_PATH='/usr/local/awstats/wwwroot/css'; $AWSTATS_CLASSES_PATH='/usr/local/awstats/wwwroot/classes'; $AWSTATS_CGI_PATH='/usr/local/awstats/wwwroot/cgi-bin'; $AWSTATS_MODEL_CONFIG='/etc/awstats/awstats.model.conf'; # Used only when configure ran on linux $AWSTATS_DIRDATA_PATH='/var/lib/awstats'; # Used only when configure ran on linux #------------------------------------------------------- # Defines #------------------------------------------------------- # For windows registry management my $reg; eval('use Win32::TieRegistry ( Delimiter=>"/", TiedRef=>\$reg )'); use vars qw/ $REVISION $VERSION /; $REVISION='$Revision: 1.8 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; use vars qw/ $DIR $PROG $Extension $Debug /; use vars qw/ @WEBCONF /; # Possible dirs for Apache conf files @WEBCONF=( 'C:/Program Files/Apache Group/Apache2/conf/httpd.conf', 'C:/Program Files/Apache Group/Apache/conf/httpd.conf', '/Applications/MAMP/conf/apache/httpd.conf', '/etc/httpd/httpd.conf', '/usr/local/apache/conf/httpd.conf', '/usr/local/apache2/conf/httpd.conf', ); use vars qw/ $WebServerChanged $UseAlias $Step %LogFormat %ConfToChange %OSLib /; $WebServerChanged=0; $UseAlias=0; %LogFormat=(); %ConfToChange=(); %OSLib=('linux'=>'Linux, BSD or Unix','macosx'=>'Mac OS','windows'=>'Windows'); $Step=0; #------------------------------------------------------- # Functions #------------------------------------------------------- #------------------------------------------------------- # error #------------------------------------------------------- sub error { print STDERR "Error: $_[0].\n"; exit 1; } #------------------------------------------------------- # debug #------------------------------------------------------- sub debug { my $level = $_[1] || 1; if ($Debug >= $level) { my $debugstring = $_[0]; if ($ENV{"GATEWAY_INTERFACE"}) { $debugstring =~ s/^ /   /; $debugstring .= "
"; } print "DEBUG $level - ".time." : $debugstring\n"; } 0; } #------------------------------------------------------- # update_httpd_config # Replace common to combined in Apache config file #------------------------------------------------------- sub update_httpd_config { my $file=shift; if (! $file) { error("Call to update_httpd_config with wrong parameter"); } open(FILE, $file) || error("Failed to open $file for update"); open(FILETMP, ">$file.tmp") || error("Failed to open $file.tmp for writing"); # $%conf contains param and values my %confchanged=(); my $conflinenb = 0; # First, change values that are already present in old config file while() { my $savline=$_; chomp $_; s/\r//; $conflinenb++; # Remove comments not at beginning of line $_ =~ s/\s#.*$//; # Change line if ($_ =~ /^(\s*)CustomLog\s(.*)\scommon$/i) { $savline="$1CustomLog $2 combined"; } # Write line print FILETMP "$savline"; } close(FILE); close(FILETMP); # Move file to file.sav if (rename("$file","$file.old")==0) { error("Failed to make backup of current config file to $file.old"); } # Move tmp file into config file if (rename("$file.tmp","$file")==0) { error("Failed to move tmp config file $file.tmp to $file"); } return 0; } #------------------------------------------------------- # update_awstats_config # Update an awstats model [to another one] #------------------------------------------------------- sub update_awstats_config { my $file=shift; my $fileto=shift||"$file.tmp"; if (! $file) { error("Call to update_awstats_config with wrong parameter"); } if ($file =~ /Developpements[\\\/]awstats/i) { print " This is my dev area. Don't touch.\n"; return; } # To avoid script working in my dev area open(FILE, $file) || error("Failed to open '$file' for read"); open(FILETMP, ">$fileto") || error("Failed to open '$fileto' for writing"); # $%conf contains param and values my %confchanged=(); my $conflinenb = 0; # First, change values that are already present in old config file while() { my $savline=$_; chomp $_; s/\r//; $conflinenb++; # Remove comments not at beginning of line $_ =~ s/\s#.*$//; # Extract param and value my ($param,$value)=split(/=/,$_,2); $param =~ s/^\s+//; $param =~ s/\s+$//; $value =~ s/#.*$//; $value =~ s/^[\s\'\"]+//; $value =~ s/[\s\'\"]+$//; if ($param) { # cleanparam is param without begining # my $cleanparam=$param; my $wascleaned=0; if ($cleanparam =~ s/^#//) { $wascleaned=1; } if (defined($ConfToChange{"$cleanparam"}) && $ConfToChange{"$cleanparam"}) { $savline = ($wascleaned?"#":"")."$cleanparam=\"".$ConfToChange{"$cleanparam"}."\"\n"; } } # Write line print FILETMP "$savline"; } close(FILE); close(FILETMP); if ($fileto eq "$file.tmp") { # Move file to file.sav if (rename("$file","$file.old")==0) { error("Failed to make backup of current config file to $file.old"); } # Move tmp file into config file if (rename("$fileto","$file")==0) { error("Failed to move tmp config file $fileto to $file"); } # Remove .old file unlink "$file.old"; } else { print " Config file $fileto created.\n"; } return 0; } #------------------------------------------------------- # MAIN #------------------------------------------------------- ($DIR=$0) =~ s/([^\/\\]+)$//; ($PROG=$1) =~ s/\.([^\.]*)$//; $Extension=$1; $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/; my $QueryString=""; for (0..@ARGV-1) { $QueryString .= "$ARGV[$_] "; } if ($QueryString =~ /debug=/i) { $Debug=$QueryString; $Debug =~ s/.*debug=//; $Debug =~ s/&.*//; $Debug =~ s/ .*//; } my $helpfound=0; my $OS=''; my $CR=''; for (0..@ARGV-1) { if ($ARGV[$_] =~ /^-*h/i) { $helpfound=1; last; } if ($ARGV[$_] =~ /^-*awstatspath=([^\s\"]+)/i) { $AWSTATS_PATH=$1; last; } } # If AWSTATS_PATH was not forced on command line if (! $AWSTATS_PATH) { $AWSTATS_PATH=($DIR eq '.'?'..':$DIR); $AWSTATS_PATH=~s/tools[\\\/]?$//; $AWSTATS_PATH=~s/[\\\/]$//; } # On utilise le format de spearateur / partout (dans Apache et appels Perl) $AWSTATS_PATH =~ s/\\/\//g; # Show usage help if ($helpfound) { print "----- AWStats $PROG $VERSION (c) Laurent Destailleur -----\n"; print "$PROG is a tool to setup AWStats. It works with Apache only.\n"; print " - Detect Apache config file (ask if not found)\n"; print " - Change common log to combined (ask to confirm)\n"; print " - Add AWStats directives\n"; print " - Restart web server\n"; print " - Create one AWStats config file (if asked)\n"; print "\n"; print "Usage: $PROG.$Extension\n"; print "\n"; exit 0; } # Get current time my $nowtime=time; my ($nowsec,$nowmin,$nowhour,$nowday,$nowmonth,$nowyear) = localtime($nowtime); if ($nowyear < 100) { $nowyear+=2000; } else { $nowyear+=1900; } my $nowsmallyear=$nowyear;$nowsmallyear =~ s/^..//; if (++$nowmonth < 10) { $nowmonth = "0$nowmonth"; } if ($nowday < 10) { $nowday = "0$nowday"; } if ($nowhour < 10) { $nowhour = "0$nowhour"; } if ($nowmin < 10) { $nowmin = "0$nowmin"; } if ($nowsec < 10) { $nowsec = "0$nowsec"; } print "\n"; print "----- AWStats $PROG $VERSION (c) Laurent Destailleur -----\n"; print "This tool will help you to configure AWStats to analyze statistics for\n"; print "one web server. You can try to use it to let it do all that is possible\n"; print "in AWStats setup, however following the step by step manual setup\n"; print "documentation (docs/index.html) is often a better idea. Above all if:\n"; print "- You are not an administrator user,\n"; print "- You want to analyze downloaded log files without web server,\n"; print "- You want to analyze mail or ftp log files instead of web log files,\n"; print "- You need to analyze load balanced servers log files,\n"; print "- You want to 'understand' all possible ways to use AWStats...\n"; print "Read the AWStats documentation (docs/index.html).\n"; # Detect OS type # -------------- if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='linux'; $CR=''; } if ("$^O" !~ /linux/i && -d "/etc" && -d "/Users") { $OS='macosx'; $CR=''; } if ("$^O" =~ /cygwin/i || "$^O" =~ /win32/i) { $OS='windows'; $CR="\r"; } if (! $OS) { print "configure.pl was not able to detect your OS. You must configure AWStats\n"; print "manually following the setup documentation (docs/index.html).\n"; print "configure.pl aborted.\n"; exit 1; } #print "Running OS detected: $OS (Perl $^[)\n"; print "\n-----> Running OS detected: $OSLib{$OS}\n"; if ($OS eq 'linux') { $AWSTATS_PATH=`pwd`; $AWSTATS_PATH =~ s/[\r\n]//; $AWSTATS_PATH=~s/tools[\\\/]?$//; $AWSTATS_PATH=~s/[\\\/]$//; if ($AWSTATS_PATH ne '/usr/local/awstats') { print "Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'.\n"; print "If you want to use standard directory, you should first move all content\n"; print "of AWStats distribution from current directory:\n"; print "$AWSTATS_PATH\n"; print "to standard directory:\n"; print "/usr/local/awstats\n"; print "And then, run configure.pl from this location.\n"; print "Do you want to continue setup from this NON standard directory [yN] ? "; my $bidon=''; while ($bidon !~ /^[yN]/i) { $bidon=; } if ($bidon !~ /^y/i) { print "configure.pl aborted.\n"; exit 1; } $AWSTATS_ICON_PATH="$AWSTATS_PATH/wwwroot/icon"; $AWSTATS_CSS_PATH="$AWSTATS_PATH/wwwroot/css"; $AWSTATS_CLASSES_PATH="$AWSTATS_PATH/wwwroot/classes"; $AWSTATS_CGI_PATH="$AWSTATS_PATH/wwwroot/cgi-bin"; } } elsif ($OS eq 'macosx') { $AWSTATS_PATH=`pwd`; $AWSTATS_PATH =~ s/[\r\n]//; $AWSTATS_PATH=~s/tools[\\\/]?$//; $AWSTATS_PATH=~s/[\\\/]$//; if ($AWSTATS_PATH ne '/Library/WebServer/awstats') { print "Warning: AWStats standard directory on Mac OS X is '/Library/WebServer/awstats'.\n"; print "If you want to use standard directory, you should first move all content\n"; print "of AWStats distribution from current directory:\n"; print "$AWSTATS_PATH\n"; print "to standard directory:\n"; print "/Library/WebServer/awstats\n"; print "And then, run configure.pl from this location.\n"; print "Do you want to continue setup from this NON standard directory [yN] ? "; my $bidon=''; while ($bidon !~ /^[yN]/i) { $bidon=; } if ($bidon !~ /^y/i) { print "configure.pl aborted.\n"; exit 1; } $AWSTATS_ICON_PATH="$AWSTATS_PATH/wwwroot/icon"; $AWSTATS_CSS_PATH="$AWSTATS_PATH/wwwroot/css"; $AWSTATS_CLASSES_PATH="$AWSTATS_PATH/wwwroot/classes"; $AWSTATS_CGI_PATH="$AWSTATS_PATH/wwwroot/cgi-bin"; } } elsif ($OS eq 'windows') { # We do not use default values for awstats directives # but thoose defined from AWSTATS_PATH $AWSTATS_ICON_PATH="$AWSTATS_PATH/wwwroot/icon"; $AWSTATS_CSS_PATH="$AWSTATS_PATH/wwwroot/css"; $AWSTATS_CLASSES_PATH="$AWSTATS_PATH/wwwroot/classes"; $AWSTATS_CGI_PATH="$AWSTATS_PATH/wwwroot/cgi-bin"; } # Detect web server path # ---------------------- print "\n-----> Check for web server install\n"; my %ApachePath=(); # All Apache path found (used on windows only) my %ApacheConfPath=(); # All Apache config found my $tips; if ($OS eq 'linux' || $OS eq 'macosx') { my $found=0; foreach my $conf (@WEBCONF) { if (-s "$conf") { print " Found Web server Apache config file '$conf'\n"; $ApacheConfPath{"$conf"}=++$found; } } } if ($OS eq 'windows' && "$^O" !~ /cygwin/i) { $reg->Delimiter("/"); if ($tips=$reg->{"LMachine/Software/Apache Group/Apache/"}) { # If Apache registry call successfull my $found=0; foreach( sort keys %$tips ) { my $path=$reg->{"LMachine/Software/Apache Group/Apache/$_/ServerRoot"}; $path=~s/[\\\/]$//; if (-d "$path" && -s "$path/conf/httpd.conf") { print " Found a Web server Apache install in '$path'\n"; $ApachePath{"$path"}=++$found; $ApacheConfPath{"$path/conf/httpd.conf"}=++$found; } } } } if (! scalar keys %ApacheConfPath) { my $bidon=''; if ($OS eq 'windows') { # Ask web server path (need to restart on windows) print "$PROG did not find your Apache web main runtime.\n"; print "\nPlease, enter full directory path of your Apache web server or\n"; print "'none' to skip this step if you don't have local web server or\n"; print "don't have permission to change its setup.\n"; print "Example: c:\\Program files\\apache group\\apache\n"; while ($bidon ne 'none' && ! -d "$bidon") { print "Apache Web server path ('none' to skip):\n> "; $bidon=; chomp $bidon; if ($bidon && ! -d "$bidon" && $bidon ne 'none') { print "- The directory '$bidon' does not exists.\n"; } } } if ($bidon ne 'none') { if ($bidon) { $ApachePath{"$bidon"}=1; } print "\n".($bidon?"Now, enter":"Enter")." full config file path of your Web server.\n"; print "Example: /etc/httpd/httpd.conf\n"; print "Example: /usr/local/apache2/conf/httpd.conf\n"; print "Example: c:\\Program files\\apache group\\apache\\conf\\httpd.conf\n"; $bidon=''; while ($bidon ne 'none' && ! -f "$bidon") { print "Config file path ('none' to skip web server setup):\n> "; $bidon=; chomp $bidon; if ($bidon && ! -f "$bidon" && $bidon ne 'none') { print "- This file does not exists.\n"; } } if ($bidon ne 'none') { $ApacheConfPath{"$bidon"}=1; } } } if (! scalar keys %ApacheConfPath) { print "\n"; print "Your web server config file(s) could not be found.\n"; print "You will need to setup your web server manually to declare AWStats\n"; print "script as a CGI, if you want to build reports dynamically.\n"; print "See AWStats setup documentation (file docs/index.html)"; print "\n"; } # Open Apache config file # ----------------------- foreach my $key (keys %ApacheConfPath) { print "\n-----> Check and complete web server config file '$key'\n"; # Read config file to search for awstats directives my $commonchangedtocombined=0; READ: $LogFormat{$key}=4; open(CONF,"<$key") || error("Failed to open config file '$key' for reading"); binmode CONF; my $awstatsjsfound=0; my $awstatsclassesfound=0; my $awstatscssfound=0; my $awstatsiconsfound=0; my $awstatscgifound=0; my $awstatsdirectoryfound=0; while() { if ($_ =~ /^\s*CustomLog\s(.*)\scommon$/i) { print "Warning: You Apache config file contains directives to write 'common' log files\n"; print "This means that some features can't work (os, browsers and keywords detection).\n"; print "Do you want me to setup Apache to write 'combined' log files [y/N] ? "; my $bidon=''; while ($bidon !~ /^[yN]/i) { $bidon=; } if ($bidon =~ /^y/i) { close CONF; update_httpd_config("$key"); $WebServerChanged=1; $commonchangedtocombined=1; goto READ; } } if ($_ =~ /^\s*CustomLog\s(.*)\scombined$/i) { $LogFormat{$key}=1; } if ($_ =~ /Alias \/awstatsclasses/) { $awstatsclassesfound=1; } if ($_ =~ /Alias \/awstatscss/) { $awstatscssfound=1; } if ($_ =~ /Alias \/awstatsicons/) { $awstatsiconsfound=1; } if ($_ =~ /ScriptAlias \/awstats\//) { $awstatscgifound=1; } my $awstats_path_quoted=quotemeta($AWSTATS_PATH); if ($_ =~ /Directory "$awstats_path_quoted\/wwwroot"/) { $awstatsdirectoryfound=1; } } close CONF; if ($awstatsclassesfound && $awstatscssfound && $awstatsiconsfound && $awstatscgifound && $awstatsdirectoryfound) { $UseAlias=1; if ($commonchangedtocombined) { print " Common log files changed to combined.\n"; } print " All AWStats directives are already present.\n"; next; } # Add awstats directives open(CONF,">>$key") || error("Failed to open config file '$key' for adding AWStats directives"); binmode CONF; if (! $awstatsclassesfound || ! $awstatscssfound || ! $awstatsiconsfound || ! $awstatscgifound) { print CONF "$CR\n"; print CONF "#$CR\n"; print CONF "# Directives to allow use of AWStats as a CGI$CR\n"; print CONF "#$CR\n"; } if (! $awstatsclassesfound) { print " Add 'Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"'\n"; print CONF "Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"$CR\n"; } if (! $awstatscssfound) { print " Add 'Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"'\n"; print CONF "Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"$CR\n"; } if (! $awstatsiconsfound) { print " Add 'Alias \/awstatsicons \"$AWSTATS_ICON_PATH\/\"'\n"; print CONF "Alias \/awstatsicons \"$AWSTATS_ICON_PATH\/\"$CR\n"; } if (! $awstatscgifound) { print " Add 'ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"'\n"; print CONF "ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"$CR\n"; } if (! $awstatsdirectoryfound) { print " Add '' directive\n"; print CONF "$CR\n"; print CONF < Options None AllowOverride None Order allow,deny Allow from all EOF } close CONF; $UseAlias=1; $WebServerChanged=1; print " AWStats directives added to Apache config file.\n"; } # Define model config file path # ----------------------------- my $modelfile=''; if ($OS eq 'linux') { if (-f "$AWSTATS_PATH/wwwroot/cgi-bin/awstats.model.conf") { $modelfile="$AWSTATS_PATH/wwwroot/cgi-bin/awstats.model.conf"; } else { $modelfile="$AWSTATS_MODEL_CONFIG"; if (! -s $modelfile || ! -w $modelfile) { $modelfile="$AWSTATS_PATH/wwwroot/cgi-bin/awstats.model.conf"; } } } elsif ($OS eq "macosx") { $modelfile="$AWSTATS_PATH/wwwroot/cgi-bin/awstats.model.conf"; } elsif ($OS eq 'windows') { $modelfile="$AWSTATS_PATH\\wwwroot\\cgi-bin\\awstats.model.conf"; } else { $modelfile="$AWSTATS_PATH\\wwwroot\\cgi-bin\\awstats.model.conf"; } # Update model config file # ------------------------ if (-s $modelfile && -w $modelfile) { print "\n-----> Update model config file '$modelfile'\n"; %ConfToChange=(); if ($OS eq 'linux' || $OS eq "macosx") { $ConfToChange{'DirData'}="$AWSTATS_DIRDATA_PATH"; } elsif ($OS eq 'windows') { $ConfToChange{'DirData'}='.'; } else { $ConfToChange{'DirData'}='.'; } if ($UseAlias) { $ConfToChange{'DirCgi'}='/awstats'; $ConfToChange{'DirIcons'}='/awstatsicons'; } update_awstats_config("$modelfile"); print " File awstats.model.conf updated.\n"; } # Ask if we need to create a config file #--------------------------------------- my $site=''; my $configfile=''; print "\n-----> Need to create a new config file ?\n"; print "Do you want me to build a new AWStats config/profile\n"; print "file (required if first install) [y/N] ? "; my $bidon=''; while ($bidon !~ /^[yN]/i) { $bidon=; } if ($bidon =~ /^y/i) { # Ask value for web site name #---------------------------- print "\n-----> Define config file name to create\n"; print "What is the name of your web site or profile analysis ?\n"; # TODO Add example that use value found in ServerName ? print "Example: www.mysite.com\n"; print "Example: demo\n"; ASKCONFIG: my $bidon=''; while (! $bidon) { print "Your web site, virtual server or profile name:\n> "; $bidon=; chomp $bidon; if ($bidon =~ /\s/) { print " Space chars are not allowed.\n"; $bidon=''; } } $site=$bidon; # Define config file path # ----------------------- if ($OS eq 'linux') { print "\n-----> Define config file path\n"; print "In which directory do you plan to store your config file(s) ?\n"; print "Default: /etc/awstats\n"; my $bidon=''; print "Directory path to store config file(s) (Enter for default):\n> "; $bidon=; chomp $bidon; if (! $bidon) { $bidon = "/etc/awstats"; } my $configdir=$bidon; if (! -d $configdir) { # Create the directory for config files my $mkdirok=mkdir "$configdir", 0755; if (! $mkdirok) { error("Failed to create directory '$configdir', required to store config files."); } } $configfile="$configdir/awstats.$site.conf"; } elsif ($OS eq "macosx") { $configfile="$AWSTATS_PATH/wwwroot/cgi-bin/awstats.$site.conf"; } elsif ($OS eq 'windows') { $configfile="$AWSTATS_PATH\\wwwroot\\cgi-bin\\awstats.$site.conf"; } else { $configfile="$AWSTATS_PATH\\wwwroot\\cgi-bin\\awstats.$site.conf"; } if (-s "$configfile") { print "Warning: A config file for this name already exists. Choose another one.\n"; goto ASKCONFIG; } # Create awstats.conf file # ------------------------ print "\n-----> Create config file '$configfile'\n"; if (-s $configfile) { print " Config file already exists. No overwrite possible on existing config files.\n"; } else { %ConfToChange=(); # TODO Ask path of log file to change LogFile parameter if ($OS eq 'linux' || $OS eq "macosx") { $ConfToChange{'DirData'}="$AWSTATS_DIRDATA_PATH"; } if ($OS eq 'windows') { $ConfToChange{'DirData'}='.'; } if ($UseAlias) { $ConfToChange{'DirCgi'}='/awstats'; $ConfToChange{'DirIcons'}='/awstatsicons'; } $ConfToChange{'SiteDomain'}="$site"; my $sitewithoutwww=lc($site); $sitewithoutwww =~ s/^www\.//i; $ConfToChange{'HostAliases'}="$sitewithoutwww www.$sitewithoutwww 127.0.0.1 localhost"; update_awstats_config("$modelfile","$configfile"); } } # Restart Apache if change were made # ---------------------------------- if ($WebServerChanged) { if ($OS eq 'linux') { if (-f "/etc/debian_version") { # We are on debian my $command="/etc/init.d/apache restart"; print "\n-----> Restart Web server with '$command'\n"; my $ret=`$command`; print "$ret"; } elsif (-x "/sbin/service") { # We are not on debian my $command="/sbin/service httpd restart"; print "\n-----> Restart Web server with '$command'\n"; my $ret=`$command`; print "$ret"; } else { print "\n-----> Don't forget to restart manually your web server\n"; } } elsif ($OS eq 'macosx') { print "\n-----> Restart Web server with '/usr/sbin/apachectl restart'\n"; my $ret=`/usr/sbin/apachectl restart`; print "$ret"; } elsif ($OS eq 'windows') { foreach my $key (keys %ApachePath) { if (-f "$key/bin/Apache.exe") { print "\n-----> Restart Apache with '\"$key/bin/Apache.exe\" -k restart'\n"; my $ret=`"$key/bin/Apache.exe" -k restart`; } } } else { foreach my $key (keys %ApachePath) { if (-f "$key/bin/Apache.exe") { print "\n-----> Restart Apache with '\"$key/bin/Apache.exe\" -k restart'\n"; my $ret=`"$key/bin/Apache.exe" -k restart`; } } } } # TODO # Scan logorate for a log file # If apache log has a logrotate log found, we create a config and add line in prerotate # prerotate # ... # endscript # If not found # Schedule awstats update process # ------------------------------- print "\n-----> Add update process inside a scheduler\n"; if ($OS eq 'linux' || $OS eq "macosx") { print "Sorry, configure.pl does not support automatic add to cron yet.\n"; print "You can do it manually by adding the following command to your cron:\n"; print "$AWSTATS_CGI_PATH/awstats.pl -update -config=".($site?$site:"myvirtualserver")."\n"; print "Or if you have several config files and prefer having only one command:\n"; print "$AWSTATS_PATH/tools/awstats_updateall.pl now\n"; print "Press ENTER to continue... "; $bidon=; } elsif ($OS eq 'windows') { print "Sorry, for Windows users, if you want to have statistics to be\n"; print "updated on a regular basis, you have to add the update process\n"; print "in a scheduler task manually (See AWStats docs/index.html).\n"; print "Press ENTER to continue... "; $bidon=; } else { print "Sorry, if you want to have statistics to be\n"; print "updated on a regular basis, you have to add the update process\n"; print "in a scheduler task manually (See AWStats docs/index.html).\n"; print "Press ENTER to continue... "; $bidon=; } #print "\n-----> End of configuration\n"; print "\n\n"; if ($site) { print "A SIMPLE config file has been created: $configfile\n"; print "You should have a look inside to check and change manually main parameters.\n"; print "You can then manually update your statistics for '$site' with command:\n"; print "> perl awstats.pl -update -config=$site\n"; if (scalar keys %ApacheConfPath) { print "You can also read your statistics for '$site' with URL:\n"; print "> http://localhost/awstats/awstats.pl?config=$site\n"; } else { print "You can also build static report pages for '$site' with command:\n"; print "> perl awstats.pl -output=pagetype -config=$site\n"; } print "\n"; } else { print "No config file was built. You can run this tool later to build as\n"; print "much config/profile files as you want.\n"; print "Once you have a config/profile file, for example 'awstats.demo.conf',\n"; print "You can manually update your statistics for 'demo' with command:\n"; print "> perl awstats.pl -update -config=demo\n"; if (scalar keys %ApacheConfPath) { print "You can also read your statistics for 'demo' with URL:\n"; print "> http://localhost/awstats/awstats.pl?config=demo\n"; } else { print "You can also build static report pages for 'demo' with command:\n"; print "> perl awstats.pl -output=pagetype -config=demo\n"; } print "\n"; } print "Press ENTER to finish...\n"; $bidon=; 0; # Do not remove this line awstats_updateall.pl000066600000012600151000671360010624 0ustar00#!/usr/bin/perl #------------------------------------------------------------------------------ # Launch update process for all config files found in a particular directory. # See COPYING.TXT file about AWStats GNU General Public License. #------------------------------------------------------------------------------ # $Revision: 1.15 $ - $Author: eldy $ - $Date: 2006/07/23 22:57:48 $ #------------------------------------------------------------------------------ # Defines #------------------------------------------------------------------------------ my $REVISION='$Revision: 1.15 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; my $VERSION="1.0 (build $REVISION)"; # Default value of DIRCONFIG my $DIRCONFIG = "/etc/awstats"; my $Debug=0; my $Awstats='awstats.pl'; my $AwstatsDir=''; my $AwstatsProg=''; my $LastLine=''; #------------------------------------------------------------------------------ # Functions #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Function: Write error message and exit # Parameters: $message # Input: None # Output: None # Return: None #------------------------------------------------------------------------------ sub error { print STDERR "Error: $_[0].\n"; exit 1; } #------------------------------------------------------------------------------ # Function: Write debug message and exit # Parameters: $string $level # Input: %HTMLOutput $Debug=required level $DEBUGFORCED=required level forced # Output: None # Return: None #------------------------------------------------------------------------------ sub debug { my $level = $_[1] || 1; if ($Debug >= $level) { my $debugstring = $_[0]; if ($ENV{"GATEWAY_INTERFACE"}) { $debugstring =~ s/^ /   /; $debugstring .= "
"; } print localtime(time)." - DEBUG $level - $debugstring\n"; } } #------------------------------------------------------------------------------ # MAIN #------------------------------------------------------------------------------ # Change default value if options are used my $helpfound=0;my $nowfound=0; my %confexcluded=(); for (0..@ARGV-1) { if ($ARGV[$_] =~ /^-*h/i) { $helpfound=1; last; } if ($ARGV[$_] =~ /^-*awstatsprog=(.*)/i) { $Awstats="$1"; next; } if ($ARGV[$_] =~ /^-*configdir=(.*)/i) { $DIRCONFIG="$1"; next; } if ($ARGV[$_] =~ /^-*excludeconf=(.*)/i) { #try to get the different files to exclude @conftoexclude = split(/,/, $1); foreach (@conftoexclude) { $confexcluded{"$_"}=1; } next; } if ($ARGV[$_] =~ /^-*debug=(\d+)/i) { $Debug=$1; next; } if ($ARGV[$_] =~ /^-*lastline=(\d+)/i) { $LastLine=$1; next; } if ($ARGV[$_] =~ /^now/i) { $nowfound=1; next; } } # Show usage help my $DIR; my $PROG; my $Extension; ($DIR=$0) =~ s/([^\/\\]*)$//; ($PROG=$1) =~ s/\.([^\.]*)$//; $Extension=$1; if (!$nowfound || $helpfound || ! @ARGV) { print "----- $PROG $VERSION (c) Laurent Destailleur -----\n"; print "awstats_updateall launches update process for all AWStats config files (except\n"; print "awstats.model.conf) found in a particular directory, so you can easily setup a\n"; print "cron/scheduler job. The scanned directory is by default $DIRCONFIG.\n"; print "\n"; print "Usage: $PROG.$Extension now [options]\n"; print "\n"; print "Where options are:\n"; print " -awstatsprog=pathtoawstatspl\n"; print " -configdir=directorytoscan\n"; print " -excludeconf=conftoexclude[,conftoexclude2,...] (Note: awstats.model.conf is always excluded)\n"; print "\n"; exit 0; } debug("Scan directory $DIRCONFIG"); # Scan directory $DIRCONFIG opendir(DIR, $DIRCONFIG) || error("Can't scan directory $DIRCONFIG"); my @filesindir = grep { /^awstats\.(.*)conf$/ } sort readdir(DIR); closedir(DIR); debug("List of files found :".join(",",@filesindir)); # Build file list my @files=(); foreach my $file (@filesindir) { if ($confexcluded{$file}) { next; } # Should be useless if ($file =~ /^awstats\.(.*)conf$/) { my $conf=$1; $conf =~ s/\.$//; if ($conf eq 'model') { next; } if ($confexcluded{$conf}) { next; } } push @files, $file; } debug("List of files qualified :".join(",",@files)); # Run update process for each config file found if (@files) { # Check if AWSTATS prog is found my $AwstatsFound=0; if (-s "$Awstats") { $AwstatsFound=1; } elsif (-s "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl") { $Awstats="/usr/local/awstats/wwwroot/cgi-bin/awstats.pl"; $AwstatsFound=1; } if (! $AwstatsFound) { error("Can't find AWStats program ('$Awstats').\nUse -awstatsprog option to solve this"); exit 1; } # Define AwstatsDir and AwstatsProg ($AwstatsDir=$Awstats) =~ s/([^\/\\]+)$//; $AwstatsProg=$1; $AwstatsDir||='.'; $AwstatsDir =~ s/([^\/\\])[\\\/]+$/$1/; debug("AwstatsDir=$AwstatsDir"); debug("AwstatsProg=$AwstatsProg"); foreach (@files) { if ($_ =~ /^awstats\.(.*)conf$/) { my $domain = $1||"default"; $domain =~ s/\.$//; # Define command line my $command="\"$AwstatsDir/$AwstatsProg\" -update -config=$domain"; $command.=" -configdir=\"$DIRCONFIG\""; if ($LastLine) { $command.=" -lastline=$LastLine"; } # Run command line print "Running '$command' to update config $domain\n"; my $output = `$command 2>&1`; print "$output\n"; } } } else { print "No AWStats config file found in $DIRCONFIG\n"; } 0; # Do not remove this line css/awstats_bw.css000066600000004750151000671360010235 0ustar00body { font: 11px verdana, arial, helvetica, sans-serif; background-color: #FFFFFF; margin-top: 0 } .aws_bodyl { } .aws_border { background-color: #BBBBBB; padding: 1px 1px 1px 1px; margin-top: 0 } .aws_title { font: 13px verdana, arial, helvetica, sans-serif; font-weight: bold; background-color: #BBBBBB; text-align: center; margin-bottom: 0; padding: 1px 1px 1px 1px; } .aws_blank { font: 13px verdana, arial, helvetica, sans-serif; background-color: #FFFFFF; text-align: center; margin-bottom: 0; padding: 1px 1px 1px 1px; } .aws_data { background-color: #FFFFFF; border-top-width: 1px; border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; } .aws_formfield { font: 13px verdana, arial, helvetica; } .aws_button { font-family: arial,verdana,helvetica, sans-serif; font-size: 12px; border: 1px solid #ccd7e0; background-image: url(/awstatsicons/other/button.gif); } th { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 0px; padding: 2px 2px 2px 2px; font: 11px verdana, arial, helvetica, sans-serif; text-align:center; color: #000000; } th.aws { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 0px; padding: 2px 2px 2px 2px; font-size: 13px; font-weight: bold; } td { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 0px; padding: 2px 2px 2px 2px; font: 11px verdana, arial, helvetica, sans-serif; text-align:center; color: #000000; } td.aws { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 0px; padding: 2px 2px 2px 2px; font: 11px verdana, arial, helvetica, sans-serif; text-align:left; color: #000000; } td.awsm { border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; padding: 0px 0px 0px 0px; font: 11px verdana, arial, helvetica, sans-serif; color: #000000; } b { font-weight: bold; } a { font: 11px verdana, arial, helvetica, sans-serif; } a:link { color: #001133; text-decoration: none; } a:visited { color: #001133; text-decoration: none; } a:hover { color: #444444; text-decoration: underline; } div { font: 12px arial,verdana,helvetica; text-align:justify; } .ctooltip { position:absolute; top:0px; left:0px; z-index:2; width:380; visibility:hidden; font: 8pt MS Comic Sans,arial,sans-serif; background-color: #EEEEEE; padding: 8px; border: 1px solid black; }css/awstats_default.css000066600000005076151000671360011253 0ustar00body { font: 11px verdana, arial, helvetica, sans-serif; background-color: #FFFFFF; margin-top: 0 } .aws_bodyl { background-image: url(/awstatsicons/other/backleft.png); background-repeat: repeat-y; } .aws_border { background-color: #CCCCDD; padding: 1px 1px 1px 1px; margin-top: 0 } .aws_title { font: 13px verdana, arial, helvetica, sans-serif; font-weight: bold; background-color: #CCCCDD; text-align: center; margin-bottom: 0; padding: 1px 1px 1px 1px; } .aws_blank { font: 13px verdana, arial, helvetica, sans-serif; background-color: #FFFFFF; text-align: center; margin-bottom: 0; padding: 1px 1px 1px 1px; } .aws_data { background-color: #FFFFFF; border-top-width: 1px; border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; } .aws_formfield { font: 13px verdana, arial, helvetica; } .aws_button { font-family: arial,verdana,helvetica, sans-serif; font-size: 12px; border: 1px solid #ccd7e0; background-image: url(/awstatsicons/other/button.gif); } th { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 0px; padding: 2px 2px 2px 2px; font: 11px verdana, arial, helvetica, sans-serif; text-align:center; color: #000000; } th.aws { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 0px; padding: 2px 2px 2px 2px; font-size: 13px; font-weight: bold; } td { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 0px; padding: 2px 2px 2px 2px; font: 11px verdana, arial, helvetica, sans-serif; text-align:center; color: #000000; } td.aws { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 0px; padding: 2px 2px 2px 2px; font: 11px verdana, arial, helvetica, sans-serif; text-align:left; color: #000000; } td.awsm { border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; padding: 0px 0px 0px 0px; font: 11px verdana, arial, helvetica, sans-serif; color: #000000; } b { font-weight: bold; } a { font: 11px verdana, arial, helvetica, sans-serif; } a:link { color: #0011BB; text-decoration: none; } a:visited { color: #0011BB; text-decoration: none; } a:hover { color: #605040; text-decoration: underline; } div { font: 12px arial,verdana,helvetica; text-align:justify; } .ctooltip { position:absolute; top:0px; left:0px; z-index:2; width:380; visibility:hidden; font: 8pt MS Comic Sans,arial,sans-serif; background-color: #FFFFE6; padding: 8px; border: 1px solid black; }awstats.model.conf.gz000066600000042430151000671360010625 0ustar00\{sFߟbɞ;Nb=bUIV"' $V CSۿ`@6N,`/7vt}p=R/NN:V'g7?QfR,$N¨`Aeo<^h҉ H(.dG )o&h9EBGZȄ\ 6)y_EqdN^ϴL˼Pc`yOL$se2^4~i<@B?Hk.վ, yvͽ^ &eJqfR\I=YrjAFG:SmGe$*Ӌ$A#2.fߜv'V˙NiAwjb, Mc0_$zv^:㋟/ΏZ*JH"2X*ғ8#6ּ rS2MjTU%2${__b1S[=(N<9 v}~7Էu~pzF7}/I"(< &|m֙6gf.X@Hb]@2m4HVh!Bp:Px.`$ gjOڱ`DN"g!Pz=UhcH&bJ M4VV,&*Z8=Bs$I nVĴZD@)xUq/(c=YBG0sY4 { 2d l mSzSZ #?fԸ~s o]$ `y׻wvam r>&U 暔&b{k5|@`n蘾wH<̓n/;nw vUfEwy[T8yXQ lU" -Hae aWx^]E %6Cw0qbPc6oO/.*/|woM~޿|8G׀B&0;7@-[֢˽?ڎnOw:oHkr9AR! "5 %g0&qfs<Φq,ʒc&(9ʉS 9\ee@\|%Bn)8aoH7M^P`7{"-r'A n|Mzc`doLo HS9Ge۸ @)E3D(ݱ&xk H41ބ96{lfb?w[~̻A>q6-IAlGdݝ Ջ8%I"P6ӕu|+KCWc#F*|Kg5/.34N,4YEW "V}Qag4%ub6^IЮ=~{d))S}OmɷB-aF!X Dn я͹1#6NGՙQRJIuQ!PO ܣ Bn让`2I)g{CB ^zK OoH%\sihEBJMs]JW8kY8Mupۦv[tw;o|x֜Vk!-\MÝDf._N biEX5zFk~imtձ=@_^^dzZ&+U*E;bFFlquOUW($01q'0D3zOzrUvl}o@ZLDo6ȟ&vKpv.*Hawn,Io1RD1\8Uz.\8+ ]N\PBa`h`Eʕ'M%hASp z8~i tODy/dMY 5E1U#KML=`".mdC:LRkYT y숀h\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7hR|yʘJ Wk\T9c$L=,q̜i&q+lP\ x5\<J As) Z Wƫ第m^\h(H BKlhHu͇:Bӯ H,z?|urlaliasbuilder.pl000066600000023113151000671360010267 0ustar00#!/usr/bin/perl #------------------------------------------------------- # Small script to auto-generate URL Alias files for 5.2+ AWStats # Requires two Perl modules below. # From original title-grabber.pl file # (Feedback/suggestions to: simonjw@users.sourceforge.net) # Modified by eldy@users.sourceforge.net # # Note: If you want to retrieve document titles over SSL you must have OpenSSL and # the Net::SSL(eay) Perl Module available. This code will check that SSL is # supported before attempting to retrieve via it. #------------------------------------------------------- use LWP::UserAgent; use strict;no strict "refs"; # variables, etc my $REVISION='$Revision: 1.7 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; my $VERSION="1.0 (build $REVISION)"; ############### EDIT HERE ############### # you can set this manually if you will only grep one site my $SITECONFIG = ""; # Where the default input is located. my $awStatsDataDir = "/var/lib/awstats"; # Throttle HTTP requests - help avoid DoS-like results if on a quick network. # Number is the number of seconds to pause between requests. Set to zero for # no throttling. my $throttleRequestsTime = 0; # LWP settings # UA string passed to server. You should add this to SkipUserAgents in the # awstats.conf file if you want to ignore hits from this code. my $userAgent = "urlaliasbuilder/$VERSION"; # Put a sensible e-mail address here my $spiderOwner = "spider\@mydomain.com"; # Timeout (in seconds) for each HTTP request (increase on slow connections) my $getTimeOut = 2; # Proxy server to use when doing http/s - leave blank if you don't have one #my $proxyServer = "http://my.proxy.server:port/"; my $proxyServer = ""; # Hosts not to use a proxy for my @hostsNoProxy = ("host1","host1.my.domain.name"); # Make sure we don't download multi-megabyte files! We need only head section my $maxDocSizeBytes = 4096; # number is bytes ############### DON'T EDIT BELOW HERE ############### # Don't edit these my $FILEMARKER1 = "BEGIN_SIDER"; my $FILEMARKER2 = "END_SIDER"; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my $fullMonth = sprintf("%02d",$mon+1); my $fullYear = sprintf("%04d",$year+1900); # ====== main ====== # Change default value if options are used my $helpfound=0; my $nohosts=0; my $overwritedata=0; my $hostname=""; my $useHTTPS=0; # Data file to open my $fileToOpen = $awStatsDataDir . "/awstats" . $fullMonth . $fullYear . ($SITECONFIG?".$SITECONFIG":"") . ".txt"; # URL Alias file to open my $urlAliasFile = "urlalias" . ($SITECONFIG?".$SITECONFIG":"") . ".txt"; for (0..@ARGV-1) { if ($ARGV[$_] =~ /^-*urllistfile=([^\s&]+)/i) { $fileToOpen="$1"; next; } if ($ARGV[$_] =~ /^-*urlaliasfile=([^\s&]+)/i) { $urlAliasFile="$1"; next; } if ($ARGV[$_] =~ /^-*site=(.*)/i) { $hostname="$1"; next; } if ($ARGV[$_] =~ /^-*h/i) { $helpfound=1; next; } if ($ARGV[$_] =~ /^-*overwrite/i) { $overwritedata=1; next; } if ($ARGV[$_] =~ /^-*secure/i) { $useHTTPS=1; next; } } # if no host information provided, we bomb out to usage if(! $hostname && ! $SITECONFIG) { $nohosts=1; } # if no hostname set (i.e. -site=) then we use the config value if(! $hostname && $SITECONFIG) { $hostname=$SITECONFIG; } # Show usage help my $DIR; my $PROG; my $Extension; ($DIR=$0) =~ s/([^\/\\]*)$//; ($PROG=$1) =~ s/\.([^\.]*)$//; $Extension=$1; if ($nohosts || $helpfound || ! @ARGV) { print "\n----- $PROG $VERSION -----\n"; print ucfirst($PROG)." generates an 'urlalias' file from an input file.\n"; print "The input file must contain a list of URLs (It can be an AWStats history file).\n"; print "For each of thoose URLs, the script get the corresponding HTML page and catch the\n"; print "header information (title), then it writes an output file that contains one line\n"; print "for each URLs and several fields:\n"; print "- The first field is the URL,\n"; print "- The second is title caught from web page.\n"; print "This resulting file can be used by AWStats urlalias plugin.\n"; print "\n"; print "Usage: $PROG.$Extension -site=www.myserver.com [options]\n"; print "\n"; print "The site parameter contains the web server to get the page from.\n"; print "Where options are:\n"; print " -urllistfile=Input urllist file\n"; print " If this file is an AWStats history file then urlaliasbuilder will use the\n"; print " SIDER section of this file as its input URL's list.\n"; print " -urlaliasfile=Output urlalias file to build\n"; print " -overwrite Overwrite output file if exists\n"; print " -secure Use https protocol\n"; print "\n"; print "Example: $PROG.$Extension -site=www.someotherhost.com\n"; print "\n"; print "This is default configuration used when no option are provided on command line:\n"; print "Input urllist file: $fileToOpen (overwritten by -urllistfile option)\n"; print "Output urlalias file: $urlAliasFile (overwritten by -urlaliasfile option)\n"; print "\n"; print "This script was written from Simon Waight original works title-grabber.pl.\n"; print "\n"; exit 0; } my @archivedKeys=(); my $counter = 0; my $pageTitle = ""; # only read the alias file if we want to do a comparison # and append new items only (i.e. not overwrite) if($overwritedata == 0) { open(FILE,$urlAliasFile); my @bits = (); while() { chomp $_; s/\r//; @bits=split(/\t/,$_); @archivedKeys[$counter]=@bits[0]; $counter++; #print "key: " . @bits[0] . "\n"; } close(FILE); @bits = (); } # open input file (might be an AWStats history data file) print "Reading input file: $fileToOpen\n"; open(FILE,$fileToOpen) || die "Error: Can't open input urllist file $fileToOpen"; binmode FILE; my @field=(); my @addToAliasFile=(); my $addToAliasFileCount=0; my $isawstatshistoryfile=0; while () { chomp $_; s/\r//; if ($_ =~ /^AWSTATS DATA FILE/) { print "This file looks like an AWStats history file. Searching URLs list...\n"; $isawstatshistoryfile=1; } # Split line out into fields @field=split(/\s+/,$_); if (! $field[0]) { next; } # If we're at the start of the URL section of file if (! $isawstatshistoryfile || $field[0] eq $FILEMARKER1) { $_=; chomp $_; s/\r//; my @field=split(/\s+/,$_); my $count=0; my $matched = 0; while ($field[0] ne $FILEMARKER2) { if ($field[0]) { # compare awstats data entry against urlalias entry # only if we don't just want to write current items # to the file (i.e. overwrite) if($overwritedata == 0) { foreach my $key (@archivedKeys) { if($field[0] eq $key) { $matched = 1; last; } } # it's a new URL, so add to list of items to retrieve if($matched == 0) { @addToAliasFile[$addToAliasFileCount] = $field[0]; $addToAliasFileCount++; #print "new: " . $field[0] . "\n" } $matched = 0; } else { # no comparison, so everything is 'new' @addToAliasFile[$addToAliasFileCount] = $field[0]; $addToAliasFileCount++; } } $_=; chomp $_; s/\r//; @field=split(/\s+/,$_); } } } close(FILE); if($addToAliasFileCount == 0) { print "Found no new documents.\n\n" ; exit(); } print "Found " . $addToAliasFileCount . " new documents with no alias.\n"; my $fileOutput = ""; print "Looking thoose pages on web site '$hostname' to get alias...\n"; # Create a user agent (browser) object my $ua = new LWP::UserAgent; # set user agent name $ua->agent($userAgent); # set user agents owners e-mail address $ua->from($spiderOwner); # set timeout for requests $ua->timeout($getTimeOut); if ($proxyServer) { # set proxy for access to external sites $ua->proxy(["http","https"],$proxyServer); # avoid proxy for these hosts $ua->no_proxy(@hostsNoProxy); } # set maximum size of document to retrieve (in bytes) $ua->max_size($maxDocSizeBytes); if(!($ua->is_protocol_supported('https')) && $useHTTPS) { print "SSL is not supported on this machine.\n\n"; exit(); } my $fileOutput = ""; # Now lets build the contents to write (or append) to urlalias file foreach my $newAlias (@addToAliasFile) { sleep $throttleRequestsTime; my $newAliasEntry = &Generate_Alias_List_Entry($newAlias); $fileOutput .= $newAliasEntry . "\n"; } # write the data back to urlalias file if (! $overwritedata) { # Append to file open(FILE,">>$urlAliasFile") || die "Error: Failed to open file for writing: $_\n\n"; print FILE $fileOutput; close(FILE); } else { # Overwrite the file open(FILE,">$urlAliasFile") || die "Error: Failed to open file for writing: $_\n\n"; foreach my $newAlias (@addToAliasFile) { my $newAliasEntry = &Generate_Alias_List_Entry($newAlias); print FILE "$newAliasEntry\n"; } close(FILE); } print "File $urlAliasFile created/updated.\n"; exit(); #--------------------------- End of Main ----------------------------- # # Generate new lines for urlalias file by doing a http get using data # supplied. # sub Generate_Alias_List_Entry { # take in the path & document my $urltoget = shift; my $urlPrefix = "http://"; if($useHTTPS) { $urlPrefix = "https://"; } my $AliasLine = ""; $pageTitle = ""; $AliasLine = $urltoget; $AliasLine .= "\t"; # build a full HTTP request to pass to user agent my $fullurltoget = $urlPrefix . $hostname . $urltoget; # Create a HTTP request print "Getting page $fullurltoget\n"; my $req = new HTTP::Request GET => $fullurltoget; # Pass request to the user agent and get a response back my $res = $ua->request($req); # Parse returned document for page title if ($res->is_success()) { $pageTitle = $res->title; } else { print "Failed to get page: ".$res->status_line."\n"; $pageTitle = "Unknown Title"; } if ($pageTitle eq "") { $pageTitle = "Unknown Title"; } return $AliasLine . $pageTitle; } hypermap.m4.gz000066600000010410151000674110007245 0ustar00ZYwu~~Ees(ŤF"Rڎv2ɴ@Hl s|sc++1`jGuW};dW޻=3V_ʇ6x NƐltIf\*HdLpc}P9FބEŇI.H^?Bw'b;ʨ3 '-ZhIS8G{'ǶsjS;WIޏX;^:\(8׾~޲޶w m2d6~٢ԁ|/?d\E-[r.f$g e_J/f-j~8AjD_PI0kƏr':Hש=ۿܹ=>鑭&F|Vn%%/0??=Fb[ĒcLP .m ə8U~DrT02ӘB Y|>on(@]Es-w{->[b>o}Ė<~6`p+mnePap) 5yjI Ln1+ 8]-Ѳ=z=Kl/mxr:߸Եҧ<ʼnD|aT\uNlEE ЊM*m䣾d`;=pz@/D81cʿﬡhd %P]4P{HigBӽS]XHbH ?ib$5*"O+0h|9UcmWJ,G7`M,]5}h˨SmRc@+@yMXuJP \ˇ.+|P, '0PsKGLB'Y68{Qa ;k(ۣ~6ŋ@_:8EutTktJTW+覨#`*~`"+N@Nlvt[2!>Ac"_^[V :fΆ}ˆN8Lݝ{upr*-#<{]a)v*EMYV>SpD b?*b[|IPdH- O2*KO)FO-1UyFLrMEѯi5)^&eWJ 'OrWSEwWx (;ic، ̲!v }xwnWs*@ n,)J>lGHX n41(>Tĺ󗖢;~"=fx&}IK)zو~FkX.Ϩd圯f"Jn&ipKWFrE. ]HZv#c%fy?Ye4 VG>}uq4.0PaZ]8'.+Te5Y1Ћp} VQv8}ij\%a*kW3熮v!,I s&d싗pI_C=l`$GmS>hע;Ytע}YtDW,<Ёrl8aqŭ[#;=fv.n l5޳v{nenŭ]wko?U\7[]0V))* &wt_9 ±UޱCݨy\] hͫhn7#5Y} ܴ?Y 8'jSĺ߱?S ;YN,_8so?{O?WhkXY 5z /q׵_oj0ܿ\ ֶx_Cu}mj `ߨ'kkjjp[oompn 6^slÁߵ_[5_hkp[oodƿVǗ_>8<:j_Qۋ5Os#ÛJnšҭ**q[Vͻ'>6-~6Xڏmб K:85y6oaiSKz 3K1Y8ӆUA~rK6Ӻ+Ɠ/apt-ftparchive.conf000066600000002555151000711370010336 0ustar00// This config is for use with the pool-structure for the packages, thus we // don't use a Tree Section in here // The debian archive should be in the current working dir Dir { ArchiveDir "."; CacheDir "."; }; // Create Packages, Packages.gz and Packages.bz2, remove what you don't need Default { Packages::Compress ". gzip bzip2"; Sources::Compress ". gzip bzip2"; Contents::Compress ". gzip bzip2"; }; // Includes the main section. You can structure the directory tree under // ./pool/main any way you like, apt-ftparchive will take any deb (and // source package) it can find. This creates a Packages a Sources and a // Contents file for these in the main section of the sid release BinDirectory "pool/main" { Packages "dists/sid/main/binary-i386/Packages"; Sources "dists/sid/main/source/Sources"; Contents "dists/sid/Contents-i386"; } // This is the same for the contrib section BinDirectory "pool/contrib" { Packages "dists/sid/contrib/binary-i386/Packages"; Sources "dists/sid/contrib/source/Sources"; Contents "dists/sid/Contents-i386"; } // This is the same for the non-free section BinDirectory "pool/non-free" { Packages "dists/sid/non-free/binary-i386/Packages"; Sources "dists/sid/non-free/source/Sources"; Contents "dists/sid/Contents-i386"; }; // By default all Packages should have the extension ".deb" Default { Packages { Extensions ".deb"; }; }; fstab000066600000003103151000713200005554 0ustar00# /etc/fstab: static file system information. # # The following is an example. Please see fstab(5) for further details. # Please refer to mount(1) for a complete description of mount options. # # Format: # # # dump(8) uses the field to determine which file systems need # to be dumped. fsck(8) uses the column to determine which file # systems need to be checked--the root file system should have a 1 in # this field, other file systems a 2, and any file systems that should # not be checked (such as MS-DOS or NFS file systems) a 0. # # The `sw' option indicates that the swap partition is to be activated # with `swapon -a'. /dev/hda2 none swap sw 0 0 # The `bsdgroups' option indicates that the file system is to be mounted # with BSD semantics (files inherit the group ownership of the directory # in which they live). `ro' can be used to mount a file system read-only. /dev/hda3 / ext2 defaults 0 1 /dev/hda5 /home ext2 defaults 0 2 /dev/hda6 /var ext2 defaults 0 2 /dev/hda7 /usr ext2 defaults,ro 0 2 /dev/hda8 /usr/local ext2 defaults,bsdgroups 0 2 # The `noauto' option indicates that the file system should not be mounted # with `mount -a'. `user' indicates that normal users are allowed to mount # the file system. /dev/cdrom /cdrom iso9660 defaults,noauto,ro,user 0 0 /dev/fd0 /floppy minix defaults,noauto,user 0 0 /dev/fd1 /floppy minix defaults,noauto,user 0 0 # NFS file systems: server:/export/usr /usr nfs defaults 0 0 # proc file system: proc /proc proc defaults 0 0 mimp5.ttc.hints000066600000001050151000770620007431 0ustar00category truetype begin mimp5.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Foundry Priority Family = DFMincho FontName = DFMincho-Medium Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Mincho Weight = Medium Width = Fixed Shape = Serif Upright Foundry = Dynalab Priority = 20 Family1 = DFPMincho FontName1 = DFPMincho-Regular Width1 = Variable Family2 = DFGMincho FontName2 = DFGMincho-Regular Width2 = Variable end mimp3.ttc.hints000066600000001042151000770620007430 0ustar00category truetype begin mimp3.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Foundry Priority Family = DFMincho FontName = DFMincho-Light Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Mincho Weight = Light Width = Fixed Shape = Serif Upright Foundry = Dynalab Priority = 20 Family1 = DFPMincho FontName1 = DFPMincho-Light Width1 = Variable Family2 = DFGMincho FontName2 = DFGMincho-Light Width2 = Variable end higasiyama.ttf.hints000066600000000466151000770620010533 0ustar00category truetype begin higasiyama.ttf Family = HigashiyamaW09 FontName = HigashiyamaW09-Regular Encoding = Unicode Location = Japanese Charset = JISX0208 JISX0201 JISX0212 GeneralFamily = Mincho Weight = Medium Width = Variable Shape = NoSerif Upright Priority = 30 X-Foundry = ttja end gotp5.ttc.hints000066600000001052151000770620007442 0ustar00category truetype begin gotp5.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Foundry Priority Family = DFGothic FontName = DFGothic-Medium Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Gothic Weight = Medium Width = Fixed Shape = NoSerif Upright Foundry = Dynalab Priority = 20 Family1 = DFPGothic FontName1 = DFPGothic-Medium Width1 = Variable Family2 = DFGGothic FontName2 = DFGGothic-Medium Width2 = Variable end dfktl8.ttc.hints000066600000001142151000770620007600 0ustar00category truetype begin DFKtl8.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Priority Foundry X-Weight Family = DFKanTeiRyu FontName = DFKanTeiRyu-ExtraBold Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Gothic Weight = ExtraBold Width = Fixed Shape = NoSerif Upright Priority = 30 Foundry = Dynalab X-Weight = w8 Family1 = DFPKanTeiRyu FontName1 = DFPKanTeiRyu-ExtraBold Width1 = Variable Family2 = DFGKanTeiRyu FontName2 = DFGKanTeiRyu-ExtraBold Width2 = Variable end momoyama.ttf.hints000066600000000456151000770620010235 0ustar00category truetype begin momoyama.ttf Family = MomoyamaW06 FontName = MomoyamaW06-Regular Encoding = Unicode Location = Japanese Charset = JISX0208 JISX0201 JISX0212 GeneralFamily = Mincho Weight = Medium Width = Variable Shape = NoSerif Upright Priority = 30 X-Foundry = ttja end dfcrd3.ttc.hints000066600000001133151000770620007551 0ustar00category truetype begin DFCrd3.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Priority Foundry X-Weight Family = DFCraftDou FontName = DFCraftDou-W3 Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Roman Weight = Medium Width = Fixed Shape = NoSerif Upright Priority = 30 Foundry = Dynalab X-Weight = w3 X-Family = dfcraftdou Family1 = DFPCraftDou FontName1 = DFPCraftDou-W3 Width1 = Variable Family2 = DFGCraftDou FontName2 = DFGCraftDou-W3 Width2 = Variable end dfsgyo5.ttc.hints000066600000001041151000770620007762 0ustar00begin dfsgyo5.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Foundry Priority Family = DFSNGyoSho FontName = DFSNGyoSho-Regular Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Mincho Weight = Medium Width = Fixed Shape = Upright Foundry = Dynalab Priority = 10 Family1 = DFPSNGyoSho FontName1 = DFPSNGyoSho-Regular Width1 = Variable Family2 = DFGSNGyoSho FontName2 = DFGSNGyoSho-Regular Width2 = Variable end dfhsg5.ttc.hints000066600000001104151000770620007562 0ustar00category truetype begin DFHsg5.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Priority Foundry X-Weight Family = DFHSGothic FontName = DFHSGothic-W5 Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Gothic Weight = Medium Width = Fixed Shape = NoSerif Upright Priority = 30 Foundry = Dynalab X-Weight = w5 Family1 = DFPHSGothic FontName1 = DFPHSGothic-W5 Width1 = Variable Family2 = DFGHSGothic FontName2 = DFGHSGothic-W5 Width2 = Variable end dfheic.ttc.hints000066600000001141151000770620007625 0ustar00category truetype begin DFHeiC.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Priority Foundry X-Weight Family = DFGothic FontName = DFGothic-UltraBold Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Gothic Weight = UltraBold Width = Fixed Shape = NoSerif Upright Priority = 30 Foundry = Dynalab AbiFamily = DFGothic_UltraBold Family1 = DFPGothic FontName1 = DFPGothic-UltraBold Width1 = Variable Family2 = DFGGothic FontName2 = DFGGothic-UltraBold Width2 = Variable end gotp3.ttc.hints000066600000001046151000770620007443 0ustar00category truetype begin gotp3.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Foundry Priority Family = DFGothic FontName = DFGothic-Light Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Gothic Weight = Light Width = Fixed Shape = NoSerif Upright Foundry = Dynalab Priority = 20 Family1 = DFPGothic FontName1 = DFPGothic-Light Width1 = Variable Family2 = DFGGothic FontName2 = DFGGothic-Light Width2 = Variable end kamakura.ttf.hints000066600000000456151000770620010212 0ustar00category truetype begin kamakura.ttf Family = KamakuraW06 FontName = KamakuraW06-Regular Encoding = Unicode Location = Japanese Charset = JISX0208 JISX0201 JISX0212 GeneralFamily = Mincho Weight = Medium Width = Variable Shape = NoSerif Upright Priority = 30 X-Foundry = ttja end dfminc.ttc.hints000066600000001151151000770620007644 0ustar00category truetype begin DFMinC.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Fixed Priority Foundry X-Weight Family = DFMincho FontName = DFMincho-UltraBold Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Mincho Weight = Ultrabold Width = Fixed Shape = NoSerif Upright Priority = 30 Foundry = Dynalab AbiFamily = DFMincho_UltraBold Family1 = DFPMincho FontName1 = DFPMincho-UltraBold Width1 = Variable Family2 = DFGMincho FontName2 = DFGMincho-UltraBold Width2 = Variable end dfmrg5.ttc.hints000066600000001133151000770620007570 0ustar00category truetype begin DFMrg5.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Width Shape Fixed Priority Foundry X-Weight Family = DFMaruGothic FontName = DFMaruGothic-Medium Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = RoundGothic Weight = Medium Width = Fixed Shape = NoSerif Upright Priority = 30 Foundry = Dynalab Family1 = DFPMaruGothic FontName1 = DFPMaruGothic-Medium Width1 = Variable Family2 = DFGMaruGothic FontName2 = DFGMaruGothic-Medium Width2 = Variable end dfmrm7.ttf.hints000066600000000537151000770620007612 0ustar00category truetype begin DFMrm7.ttf Family = DFMaruMoji FontName = DFMaruMoji-W7 Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = MaruMoji Weight = Medium Width = Fixed Shape = NoSerif Upright Priority = 30 Foundry = Dynalab X-Family = dfmarumoji X-weight = w7 end dfmrm5.ttc.hints000066600000001112151000770620007573 0ustar00category truetype begin dfmrm5.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Foundry Priority X-Weight Family = DFMaruMoji FontName = DFMaruMoji-W5 Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = RoundGothic Weight = Semilight Width = Fixed Shape = NoSerif Upright Foundry = Dynalab Priority = 20 X-weight = w5 Family1 = DFPMaruMoji FontName1 = DFPMaruMoji-W5 Width1 = Variable Family2 = DFGMaruMoji FontName2 = DFGMaruMoji-W5 Width2 = Variable end dfbrs9.ttf.hints000066600000000507151000770620007604 0ustar00category truetype begin DFBrs9.ttf Family = DFBrushSQ FontName = DFBrushSQ-W9 Encoding = Symbol Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Gothic Weight = Semibold Width = Variable Shape = NoSerif Upright Priority = 30 Foundry = Dynalab X-Weight = w9 end dfhsm5.ttc.hints000066600000001102151000770620007566 0ustar00category truetype begin DFHsm5.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Priority Foundry X-Weight Family = DFHSMincho FontName = DFHSMincho-W5 Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Mincho Weight = Medium Width = Fixed Shape = NoSerif Upright Priority = 30 Foundry = Dynalab X-Weight = w5 Family1 = DFPHSMincho FontName1 = DFPHSMincho-W5 Width = Variable Family2 = DFGHSMincho FontName2 = DFGHSMincho-W5 Width = Variable end dfheia.ttc.hints000066600000001126151000770620007626 0ustar00category truetype begin dfheia.ttc FaceNum = 3 Inherit = Encoding Location Charset GeneralFamily Weight Shape Foundry Priority Family = DFGothic FontName = DFGothic-ExtraBold Encoding = Unicode Location = English Japanese Charset = ISO8859-1 JISX0208 JISX0201 JISX0212 GeneralFamily = Gothic Weight = Extrabold Width = Fixed Shape = NoSerif Upright Foundry = Dynalab Priority = 20 AbiFamily = DFGothic_ExtraBold Family1 = DFPGothic FontName1 = DFPGothic-ExtraBold Width1 = Variable Family2 = DFGGothic FontName2 = DFGGothic-ExtraBold Width2 = Variable end ikaruga.ttf.hints000066600000000453151000770620010036 0ustar00category truetype begin ikaruga.ttf Family = IkarugaW06 FontName = IkarugaW06-Regular Encoding = Unicode Location = Japanese Charset = JISX0208 JISX0201 JISX0212 GeneralFamily = Mincho Weight = Medium Width = Variable Shape = NoSerif Upright Priority = 30 X-Foundry = ttja end manpath.config.gz000066600000003660151001022600007776 0ustar00XkoܶC+8M h 1p[\_\e+*I=CR?\^i 3sMЭ0R˭mZ)G%9YbC~%Yv^.b):+yBxb. jDLԅU5kUJu$*;OFK6+?FiP>]DR5ZX%- U;rr-< p<Yih!J`~!a.lR+˜gJ &SgbB@qܮpJyvW+ƺ<[Bm[-(t `a黳7gW?zols#k;R<tq7?FemI2XY#Bkylnmϟ\K!y@mlh)D,3U]##*%ql}gvsH> 8V8/NO '=umT<P(ꐓsb B1Ԁ %$8RYY /7!/g=ָGo^4><Qԗ}UQ4ѯvߠ}_?SHyKH堙'iwwI ̭zlp*o"]CQu re3Hb1PE.0kIQ6݄氐2R(а$:kNXQ z%A:zrx exPDa%55L@0-=E^UD쎢[UJtuCTDՃxS{#b8,B׏MEj `P*&Ư`h*F\}K O Qj;&40@18EFR\C+DBfRHb ‹ua;m tYg'~q{M(,wl8N0).3=щ>#")& U |hVaN*4$`rz0ez+af*CwZ{J`ҊN(ThNH`<3r?`uHQMdHr:Vnz)_Ȓ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ƣ{nG|CAeਏ:>RanO)nZC@d(40B)a$pjӗ/5BJf#Rlґ6{C/"R,Yh.!S J%Z e){<'a  Ҡw2W3Npvxd%6 vk~s#MyOFOې+$@~jg);`ۣ24{G*wi`lk8}2K6 [[tze%!lw_+miq~EQu#riP; D5̾m_a9/xAɧLO;ZZW (,,;K)͒HLoC4@[6_^#蹥MKj~ipgmanpage.example000066600000005625151001022600007530 0ustar00.\" In .TH, FOO should be all caps, SECTION should be 1-8, maybe w/ subsection .\" other parms are allowed: see man(7), man(1) .\" .\" This template provided by Tom Christiansen . .\" .TH FOO SECTION .SH NAME foo, bar \- programs to do something .SH SYNOPSIS A short usage summary. .PP .B foo { .BR this | that } [ .B -flags ] [ .B \-o .I option ] .I argument [ .I more... ] .SH DESCRIPTION .\" Putting a newline after each sentence can generate better output. Long drawn-out discussion of the program. It's a good idea to break this up into subsections using the .SS macro, like these: .SS "A Sample Subsection" .SS "Yet Another Sample Subsection" References to the .BR foo (SECTION) (or other) manual page should use the .BR macro as here. .PP Use the .PP macro to start a new paragraph within a section. .SH OPTIONS Some people make this separate from the description. The following style is typically used to document options: .TP .BR this | that The user MUST specify either .B this or .B that to run the program. The { and } braces mean one of the enclosed is required. The bar (|) separates exclusive options (i.e. you cannot have both at once). .TP .B \-o Pass the user-supplied .I option to .B foo to change its behaviour. The fact that .I option is underlined or in italics means that the user replaces it with a valid value for this option. The [ and ] brackets mean it isn't required. .IP Use \(oq\e-\(cq rather than \(oq-\(cq for dashes in command-line options. \(oq-\(cq means hyphen, and formats differently when using certain output devices. .TP .I argument The last .I argument is required, because it is not in brackets. .TP .I more means that the user can optionally specify additional arguments at the end. The ellipses (...) indicate one or more of this parameter is allowed. .SH "RETURN VALUE" What the program or function returns if successful. .SH ERRORS Return codes, either exit status or errno settings. .SH EXAMPLES Give some example uses of the program. .SH ENVIRONMENT Environment variables this program might care about. .SH FILES All files used by the program. Typical usage is like this: .br .nf .\" set tabstop to longest possible filename, plus a wee bit .ta \w'/usr/lib/perl/getopts.pl 'u \fI/usr/man\fR default man tree \fI/usr/man/man*/*.*\fR unformatted (nroff source) man pages .SH NOTES Miscellaneous commentary. .SH CAVEATS Things to take special care with, sometimes called WARNINGS. .SH DIAGNOSTICS All the possible error messages the program can print out, what they mean, and how to correct them if applicable. .SH BUGS Things that are broken or just don't work quite right. .SH RESTRICTIONS Bugs you don't plan to fix. :-) .SH AUTHOR Who wrote it (or AUTHORS if multiple). .SH HISTORY Programs derived from other sources sometimes have this. .SH "SEE ALSO" .\" Always quote multiple words for .SH Other man pages to check out, like .BR man (1), .BR man (7), .BR mandb (8), .BR catman (8). manpage.example.mdoc000066600000007343151001022600010450 0ustar00.\" -mdoc is a groff macro package supporting logical formatting. The author .\" of this example considers it the best package available in groff for .\" writing manual pages. If you're used to the traditional Unix -man .\" macros, give this a try; it doesn't take long to learn. groff_mdoc(7) is .\" a complete reference manual. .\" .\" Many of the macros below stack, so ".Op Ar foo" means an optional .\" argument called "foo", while ".Ar foo" means an argument called "foo". .\" Where you see things like ".Ql .Fl" below, the second dot causes ".Fl" .\" to be interpreted as ordinary text rather than calling the .Fl macro. .Dd June 4, 2005 .Os FooOS .Dt FOO 1 .Sh NAME .Nm foo .Nd program to do something .Sh SYNOPSIS A short usage summary. .Pp .Nm .Brq Cm this | Cm that .Op Fl flags .Op Fl o Ar option .Ar argument .\" Punctuation is treated specially by -mdoc, and often gets pushed up .\" against whatever precedes it without the special formatting, so having .\" an underlined argument immediately followed by a normal comma is easy. .\" If you want to make sure this special handling isn't applied, put a .\" zero-width space, \&, before the punctuation. .Op Ar more \&... .Sh DESCRIPTION .\" Putting a newline after each sentence generates better output. Long drawn-out discussion of the program. It's a good idea to break this up into subsections using the .Ql .Ss macro, like these: .Ss A Sample Subsection .Ss Yet Another Sample Subsection .Pp References to the .Xr foo SECTION (or other) manual page should use the .Ql .Xr macro as here. References to the .Sx OPTIONS (or other) section within this manual page should use the .Ql .Sx macro as here. .Pp Use the .Ql .Pp macro to start a new paragraph within a section. .Sh OPTIONS Some people make this separate from the description. The following list style is typically used to document options: .Bl -tag -width 4n .It Cm this | Cm that The user MUST specify either .Cm this or .Cm that to run the program. The { and } braces (using the .Ql .Brq macro) mean one of the enclosed is required. The bar (|) separates exclusive options (i.e. you cannot have both at once). .It Fl o Pass the user-supplied .Ar option to .Nm to change its behaviour. The fact that .Ar option is underlined or in italics means that the user replaces it with a valid value for this option. The [ and ] brackets (using the .Ql .Op macro) mean it isn't required. .Pp Use the .Ql .Fl macro to render dashes in command-line option. .It Ar argument The last .Ar argument is required, because it is not in brackets. .It Ar more means that the user can optionally specify additional arguments at the end. The ellipses .Pf ( Ar ... ) indicate one or more of this parameter is allowed. .\" Remember to close lists you open with .Bl. .El .Sh RETURN VALUE What the program or function returns if successful. .Sh ERRORS Return codes, either exit status or errno settings. .Sh EXAMPLES Give some example uses of the program. .Sh ENVIRONMENT Environment variables this program might care about. .Sh FILES All files used by the program. Typical usage is like this: .Pp .Bl -tag -width "/usr/man/man*/*.*" -compact .It Pa /usr/man default man tree .It Pa /usr/man/man*/*.* unformatted (nroff source) man pages .El .Sh NOTES Miscellaneous commentary. .Sh CAVEATS Things to take special care with, sometimes called WARNINGS. .Sh DIAGNOSTICS All the possible error messages the program can print out, what they mean, and how to correct them if applicable. .Sh BUGS Things that are broken or just don't work quite right. .Sh RESTRICTIONS Bugs you don't plan to fix. :-) .Sh AUTHOR Who wrote it (or AUTHORS if multiple). .Sh HISTORY Programs derived from other sources sometimes have this. .Sh SEE ALSO Other man pages to check out, like .Xr man 1 , .Xr man 7 , .Xr mandb 8 , .Xr catman 8 . manpage.example.pod000066600000005316151001022600010306 0ustar00=head1 NAME foo, bar - programs to do something =head1 SYNOPSIS A short usage summary. B { B|B } [ B<-flags> ] [ B<-o> I