initial checkin
authorMichael Prokop <mika@grml.org>
Fri, 27 Oct 2006 22:16:21 +0000 (22:16 +0000)
committerMichael Prokop <mika@grml.org>
Fri, 27 Oct 2006 22:16:21 +0000 (22:16 +0000)
134 files changed:
compile/Makefile [new file with mode: 0644]
compile/align.c [new file with mode: 0644]
compile/cpu-screen.c [new file with mode: 0644]
compile/dpkg_not_running.c [new file with mode: 0644]
compile/gtf.c [new file with mode: 0644]
compile/ip-screen.c [new file with mode: 0644]
compile/pong.c [new file with mode: 0644]
compile/reread_partition_table.c [new file with mode: 0644]
compile/vmware-detect.c [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/dirs [new file with mode: 0644]
debian/docs [new file with mode: 0644]
debian/overrides [new file with mode: 0644]
debian/postinst [new file with mode: 0755]
debian/preinst [new file with mode: 0755]
debian/rules [new file with mode: 0755]
debian/substvars [new file with mode: 0644]
makefile.postfix [new file with mode: 0644]
manpages/getsf.1 [new file with mode: 0644]
manpages/grml-ap.8 [new file with mode: 0644]
manpages/grml-bind.8 [new file with mode: 0644]
manpages/grml-bridge.8 [new file with mode: 0644]
manpages/grml-iptstate.8 [new file with mode: 0644]
manpages/grml-router.8 [new file with mode: 0644]
manpages/grml-scripts.1 [new file with mode: 0644]
manpages/grml-setkeyboard.8 [new file with mode: 0644]
manpages/grml-setlang.8 [new file with mode: 0644]
manpages/gtf.1 [new file with mode: 0644]
manpages/random-hostname.1 [new file with mode: 0644]
manpages/reread_partition_table.8 [new file with mode: 0644]
net-functions [new file with mode: 0644]
routersetup [new file with mode: 0644]
script-functions [new file with mode: 0644]
usr_bin/XF86AudioLowerVolume [new file with mode: 0755]
usr_bin/XF86AudioMute [new file with mode: 0755]
usr_bin/XF86AudioRaiseVolume [new file with mode: 0755]
usr_bin/attach-screen [new file with mode: 0755]
usr_bin/bincompare.pl [new file with mode: 0755]
usr_bin/caps-ctrl [new file with mode: 0755]
usr_bin/cicqhist [new file with mode: 0755]
usr_bin/code2color [new file with mode: 0755]
usr_bin/code2html [new file with mode: 0755]
usr_bin/cpu-screen.sh [new file with mode: 0755]
usr_bin/cpufreq-detect.sh [new file with mode: 0755]
usr_bin/dir2html [new file with mode: 0755]
usr_bin/exifinfo [new file with mode: 0755]
usr_bin/fex [new file with mode: 0755]
usr_bin/find-hidden-word-text [new file with mode: 0755]
usr_bin/find-text [new file with mode: 0755]
usr_bin/findchanged [new file with mode: 0755]
usr_bin/findwaste [new file with mode: 0755]
usr_bin/firevim [new file with mode: 0755]
usr_bin/get_tw_cli [new file with mode: 0755]
usr_bin/getsf [new file with mode: 0755]
usr_bin/grepc [new file with mode: 0755]
usr_bin/grepedit [new file with mode: 0755]
usr_bin/grml-bind [new file with mode: 0755]
usr_bin/grml-config-user [new file with mode: 0755]
usr_bin/grml-info [new file with mode: 0755]
usr_bin/grml-init [new file with mode: 0755]
usr_bin/grml-init-screen [new file with mode: 0755]
usr_bin/grml-lang [new file with mode: 0755]
usr_bin/grml-lock [new file with mode: 0755]
usr_bin/grml-mutt [new file with mode: 0755]
usr_bin/grml-muttng [new file with mode: 0755]
usr_bin/grml-resolution [new file with mode: 0755]
usr_bin/grml-screen [new file with mode: 0755]
usr_bin/grml-slrn [new file with mode: 0755]
usr_bin/grml-start [new file with mode: 0755]
usr_bin/hgrep.sh [new file with mode: 0755]
usr_bin/iimage [new file with mode: 0755]
usr_bin/irclog2html-2.1.pl [new file with mode: 0755]
usr_bin/lesspipe.sh [new file with mode: 0755]
usr_bin/logview [new file with mode: 0755]
usr_bin/mailhops [new file with mode: 0755]
usr_bin/myip [new file with mode: 0755]
usr_bin/osd_server.py [new file with mode: 0755]
usr_bin/random-hostname [new file with mode: 0755]
usr_bin/runit [new file with mode: 0755]
usr_bin/say [new file with mode: 0755]
usr_bin/search [new file with mode: 0755]
usr_bin/sepdate.pl [new file with mode: 0755]
usr_bin/sepdate.rb [new file with mode: 0755]
usr_bin/sepdate.sh [new file with mode: 0755]
usr_bin/soundtest [new file with mode: 0755]
usr_bin/tinyp2p.py [new file with mode: 0755]
usr_bin/twebgal [new file with mode: 0755]
usr_bin/unbleach.pl [new file with mode: 0755]
usr_bin/urlgrep.awk [new file with mode: 0755]
usr_bin/usbtree [new file with mode: 0755]
usr_bin/wm-ng [new file with mode: 0755]
usr_bin/wwwis [new file with mode: 0755]
usr_bin/xsay [new file with mode: 0755]
usr_bin/zsh-login [new file with mode: 0755]
usr_sbin/PrintAnalyzer [new file with mode: 0755]
usr_sbin/apt-check-sigs [new file with mode: 0755]
usr_sbin/blacklist [new file with mode: 0755]
usr_sbin/bt-audio [new file with mode: 0755]
usr_sbin/bt-hid [new file with mode: 0755]
usr_sbin/dpkg-rebuild [new file with mode: 0755]
usr_sbin/grml-ap [new file with mode: 0755]
usr_sbin/grml-bridge [new file with mode: 0755]
usr_sbin/grml-config [new file with mode: 0755]
usr_sbin/grml-config-root [new file with mode: 0755]
usr_sbin/grml-hostname [new file with mode: 0755]
usr_sbin/grml-iptstate [new file with mode: 0755]
usr_sbin/grml-nessus [new file with mode: 0755]
usr_sbin/grml-network [new file with mode: 0755]
usr_sbin/grml-postfix [new file with mode: 0755]
usr_sbin/grml-pptp-inode [new file with mode: 0755]
usr_sbin/grml-pptp-vcgraz [new file with mode: 0755]
usr_sbin/grml-pptp-xdsl-students [new file with mode: 0755]
usr_sbin/grml-router [new file with mode: 0755]
usr_sbin/grml-setkeyboard [new file with mode: 0755]
usr_sbin/grml-setlang [new file with mode: 0755]
usr_sbin/grml-tpm [new file with mode: 0755]
usr_sbin/grml-vpnc-tugraz [new file with mode: 0755]
usr_sbin/make_chroot_jail [new file with mode: 0755]
usr_sbin/mkdosswapfile [new file with mode: 0755]
usr_sbin/modemlink [new file with mode: 0755]
usr_sbin/ndiswrapper.sh [new file with mode: 0755]
usr_sbin/netcardconfig [new file with mode: 0755]
usr_sbin/noeject [new file with mode: 0755]
usr_sbin/noprompt [new file with mode: 0755]
usr_sbin/prepare_ramdisk.sh [new file with mode: 0755]
usr_sbin/prepare_tmpfs.sh [new file with mode: 0755]
usr_sbin/scanmodem [new file with mode: 0755]
usr_sbin/service [new file with mode: 0755]
usr_sbin/suspenduser.sh [new file with mode: 0755]
usr_sbin/suspenduser_gui.sh [new file with mode: 0755]
usr_share/include [new file with mode: 0644]

diff --git a/compile/Makefile b/compile/Makefile
new file mode 100644 (file)
index 0000000..8f29c0f
--- /dev/null
@@ -0,0 +1,41 @@
+PROGS = ip-screen pong vmware-detect align cpu-screen dpkg_not_running reread_partition_table gtf
+
+#ifndef CFLAGS
+CFLAGS = -O2 -Wall
+#endif
+
+#ifndef LDFALGS
+LDFLAGS = -s
+#endif
+
+#ifndef CC
+CC = gcc
+#endif
+
+all: $(PROGS)
+
+ip-screen: ip-screen.c
+       diet $(CC) $(CFLAGS) -o $@ $^
+       strip --strip-all $@
+
+cpu-screen: cpu-screen.c
+       diet $(CC) $(CFLAGS) -o $@ $^
+       strip --strip-all $@
+
+pong: pong.c
+
+vmware-detect: vmware-detect.c
+
+dpkg_not_running: dpkg_not_running.c
+
+align: align.c
+       $(CC) -Wall -o align align.c
+
+reread_partition_table: reread_partition_table.c
+       diet $(CC) -s -Os -o reread_partition_table reread_partition_table.c
+
+gtf: gtf.c
+       $(CC) gtf.c -lm -Wall -o gtf
+
+clean:
+       rm -f $(PROGS)
diff --git a/compile/align.c b/compile/align.c
new file mode 100644 (file)
index 0000000..6ef0fb1
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * By Patrick Reynolds <reynolds@cs.duke.edu>
+ * Too trivial to copyright.  It's in the public domain!
+ *
+ * To build:
+ *   gcc align.c -o align
+ *
+ * To run:
+ *   ./align
+ *
+ * Note that optimizing compilers will almost certainly reorder the data
+ * segment, throwing off the values you get for structure alignments.
+ * Annoyingly, some compilers don't let you disable optimizations.
+ * GCC by default (with optimizations off) doesn't reorder data segments.
+ * So use GCC.
+ */
+
+#include <stdio.h>
+
+typedef struct { char a; } s_char;
+typedef struct { short a; } s_short;
+typedef struct { int a; } s_int;
+typedef struct { long a; } s_long;
+typedef struct { long long a; } s_long_long;
+typedef struct { float a; } s_float;
+typedef struct { double a; } s_double;
+typedef struct { int *a; } s_intp;
+
+int main() {
+  int i = 0x01020304;
+  char *ch = (char*)&i;
+  char c1;        char ch0;  char c2;
+  double d1;      char ch1;  double d2;
+  float f1;       char ch2;  float f2;
+  short s1;       char ch3;  short s2;
+  int i1;         char ch4;  int i2;
+  long long ll1;  char ch5;  long long ll2;
+  int *p1;        char ch6;  int *p2;
+  long l1;        char ch7;  long l2;
+  s_char sc1;     char ch8;  s_char sc2;
+  s_short ss1;    char ch9;  s_short ss2;
+  s_int si1;      char ch10; s_int si2;
+  s_long sl1;     char ch11; s_long sl2;
+  s_long_long sll1;char ch12;s_long_long sll2;
+  s_float sf1;    char ch13; s_float sf2;
+  s_double sd1;   char ch14; s_double sd2;
+  s_intp sp1;     char ch15; s_intp sp2;
+
+  if (ch[0] == 0x01)
+    printf("Big endian (%d %d %d %d)\n",     ch[0], ch[1], ch[2], ch[3]);
+  else if (ch[0] == 0x04)
+    printf("Little endian (%d %d %d %d)\n",  ch[0], ch[1], ch[2], ch[3]);
+  else
+    printf("Unknown endian (%d %d %d %d)\n", ch[0], ch[1], ch[2], ch[3]);
+
+  printf("sizes:\n");
+  printf("  char:      %d\n", sizeof(char));
+  printf("  short:     %d\n", sizeof(short));
+  printf("  int:       %d\n", sizeof(int));
+  printf("  long:      %d\n", sizeof(long));
+  printf("  long long: %d\n", sizeof(long long));
+  printf("  float:     %d\n", sizeof(float));
+  printf("  double:    %d\n", sizeof(double));
+  printf("  int*:      %d\n", sizeof(int*));
+  printf("alignments:\n");
+  printf("  char:      %d (%p %p %p)\n",
+    (char*)&c1  - (char*)&c2  - sizeof(char),       &c1,  &ch0, &c2);
+  printf("  short:     %d (%p %p %p)\n",
+    (char*)&s1  - (char*)&s2  - sizeof(short),      &s1,  &ch3, &s2);
+  printf("  int:       %d (%p %p %p)\n",
+    (char*)&i1  - (char*)&i2  - sizeof(int),        &i1,  &ch4, &i2);
+  printf("  long:      %d (%p %p %p)\n",
+    (char*)&l1  - (char*)&l2  - sizeof(long),       &l1,  &ch7, &l2);
+  printf("  long long: %d (%p %p %p)\n",
+    (char*)&ll1 - (char*)&ll2 - sizeof(long long),  &ll1, &ch5, &ll2);
+  printf("  float:     %d (%p %p %p)\n",
+    (char*)&f1  - (char*)&f2  - sizeof(float),      &f1,  &ch2, &f2);
+  printf("  double:    %d (%p %p %p)\n",
+    (char*)&d1  - (char*)&d2  - sizeof(double),     &d1,  &ch1, &d2);
+  printf("  int*:      %d (%p %p %p)\n",
+    (char*)&p1  - (char*)&p2  - sizeof(int*),       &p1,  &ch6, &p2);
+  printf("structure alignments:\n");
+  printf("  char struct:      %d (%p %p %p)\n",
+    (char*)&sc1  - (char*)&sc2  - sizeof(s_char),   &sc1,  &ch8, &sc2);
+  printf(" short struct:      %d (%p %p %p)\n",
+    (char*)&ss1  - (char*)&ss2  - sizeof(s_short),  &ss1,  &ch9, &ss2);
+  printf("   int struct:      %d (%p %p %p)\n",
+    (char*)&si1  - (char*)&si2  - sizeof(s_int),    &si1,  &ch10,&si2);
+  printf("  long struct:      %d (%p %p %p)\n",
+    (char*)&sl1  - (char*)&sl2  - sizeof(s_long),   &sl1,  &ch11,&sl2);
+  printf(" llong struct:      %d (%p %p %p)\n",
+    (char*)&sll1  - (char*)&sll2  - sizeof(s_long_long),&sll1,&ch12,&sll2);
+  printf(" float struct:      %d (%p %p %p)\n",
+    (char*)&sf1  - (char*)&sf2  - sizeof(s_float),  &sf1,  &ch13,&sf2);
+  printf("double struct:      %d (%p %p %p)\n",
+    (char*)&sd1  - (char*)&sd2  - sizeof(s_double), &sd1,  &ch14,&sd2);
+  printf("  int* struct:      %d (%p %p %p)\n",
+    (char*)&sp1  - (char*)&sp2  - sizeof(s_intp),   &sp1,  &ch15,&sp2);
+
+  return 0;
+}
diff --git a/compile/cpu-screen.c b/compile/cpu-screen.c
new file mode 100644 (file)
index 0000000..3170e9e
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Filename:      cpu-screen.c
+ * Purpose:       output current / available cpu frequence (useful for integration into GNU screen)
+ * Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+ * Bug-Reports:   see http://grml.org/bugs/
+ * License:       This file is licensed under the GPL v2.
+ * Latest change: Tue Mar 28 11:01:43 CEST 2006 [mika]
+ *******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define LINE_LEN 10
+
+static int cpu_cur_frequency(void)
+{
+        FILE *fp;
+        char puffer[LINE_LEN];
+        char *nl;
+        fp = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r");
+        if(!fp) {
+                printf("[ cpufreq n/a ]\n");
+                return 1;
+        }
+        else {
+                while(fgets(puffer, LINE_LEN, fp)){
+                        if ((nl = strchr(puffer,'\n')))
+                            *nl = 0;
+                        int value = atoi(puffer);
+                        value /= 1000;
+                        fprintf(stdout, "%u", value);
+                }
+        }
+        fclose(fp);
+
+        return 0;
+}
+
+static int cpu_max_frequency(void)
+{
+        FILE *fp;
+        char puffer[LINE_LEN];
+        fp = fopen("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", "r");
+        if(!fp) {
+                return 2;
+        }
+        else {
+                while(fgets(puffer, LINE_LEN, fp)){
+                        int value = atoi(puffer);
+                        value /= 1000;
+                        fprintf(stdout, "%u\n", value);
+                }
+        }
+        fclose(fp);
+
+        return 0;
+}
+
+// function inspired by cpufreq-info.c of cpufrequtils-0.4 by Dominik Brodowski
+static int count_cpus(void)
+{
+        FILE *fp;
+        char value[LINE_LEN];
+        unsigned int ret = 0;
+        unsigned int cpunr = 0;
+
+        fp = fopen("/proc/stat", "r");
+        // assume "1" cpu if we can't count it
+        if(!fp) {
+                return 1;
+        }
+
+        while (!feof(fp)) {
+                fgets(value, LINE_LEN, fp);
+                if (strlen(value) < (LINE_LEN - 2))
+                        continue;
+                if (strstr(value, "cpu "))
+                        continue;
+                if (sscanf(value, "cpu%d ", &cpunr) != 1)
+                        continue;
+                if (cpunr > ret)
+                        ret = cpunr;
+        }
+        fclose(fp);
+
+        return (ret+1);
+}
+
+int main()
+{
+        int cpus;
+        int ret;
+
+        cpus = count_cpus();
+        if (cpus != 1){
+                printf("%d * ", cpus);
+        }
+
+        ret = cpu_cur_frequency();
+        if (!ret) {
+                printf(" / ");
+                ret = cpu_max_frequency();
+        }
+        return (ret);
+}
+
+/* EOF */
diff --git a/compile/dpkg_not_running.c b/compile/dpkg_not_running.c
new file mode 100644 (file)
index 0000000..d50c5c4
--- /dev/null
@@ -0,0 +1,35 @@
+/* Filename:      dpkg_not_running
+*  Purpose:       check whether Debian's package management (dpkg) is running
+*  Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+*  Bug-Reports:   see http://grml.org/bugs/
+*  License:       This file is licensed under the GPL v2.
+*  Latest change: Mit Jun 28 18:13:43 CEST 2006 [mika]
+*******************************************************************************/
+// return 0 if it is not running; return 1 if it is running
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+int main(int argc, char *argv[])
+{
+    struct flock fl = { F_WRLCK, SEEK_SET, 0, 0, 0 };
+    int fd;
+    fl.l_pid = getpid();
+
+    if ((fd = open("/var/lib/dpkg/lock", O_RDWR)) == -1) {
+        exit(1);
+    }
+
+    if (fcntl(fd, F_SETLK, &fl) == -1) {
+        exit(1); // it is running
+    }
+    else {
+        exit(0); // it is not running
+    }
+
+    return 0;
+}
+
+/* END OF FILE ****************************************************************/
diff --git a/compile/gtf.c b/compile/gtf.c
new file mode 100644 (file)
index 0000000..b5d88c3
--- /dev/null
@@ -0,0 +1,740 @@
+/* gtf.c  Generate mode timings using the GTF Timing Standard
+ *
+ * gcc gtf.c -o gtf -lm -Wall
+ *
+ * Copyright (c) 2001, Andy Ritger  aritger@nvidia.com
+ * All rights reserved.
+ *
+ * Source http://osdn.dl.sourceforge.net/sourceforge/gtf/gtf.c
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * o Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * o Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer
+ *   in the documentation and/or other materials provided with the
+ *   distribution.
+ * o Neither the name of NVIDIA nor the names of its contributors
+ *   may be used to endorse or promote products derived from this
+ *   software without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * 
+ *
+ * This program is based on the Generalized Timing Formula(GTF TM)
+ * Standard Version: 1.0, Revision: 1.0
+ *
+ * The GTF Document contains the following Copyright information:
+ *
+ * Copyright (c) 1994, 1995, 1996 - Video Electronics Standards
+ * Association. Duplication of this document within VESA member
+ * companies for review purposes is permitted. All other rights
+ * reserved.
+ *
+ * While every precaution has been taken in the preparation
+ * of this standard, the Video Electronics Standards Association and
+ * its contributors assume no responsibility for errors or omissions,
+ * and make no warranties, expressed or implied, of functionality
+ * of suitability for any purpose. The sample code contained within
+ * this standard may be used without restriction.
+ *
+ * 
+ *
+ * The GTF EXCEL(TM) SPREADSHEET, a sample (and the definitive)
+ * implementation of the GTF Timing Standard, is available at:
+ *
+ * ftp://ftp.vesa.org/pub/GTF/GTF_V1R1.xls
+ *
+ *
+ *
+ * This program takes a desired resolution and vertical refresh rate,
+ * and computes mode timings according to the GTF Timing Standard.
+ * These mode timings can then be formatted as an XFree86 modeline
+ * or a mode description for use by fbset(8).
+ *
+ *
+ *
+ * NOTES:
+ *
+ * The GTF allows for computation of "margins" (the visible border
+ * surrounding the addressable video); on most non-overscan type
+ * systems, the margin period is zero.  I've implemented the margin
+ * computations but not enabled it because 1) I don't really have
+ * any experience with this, and 2) neither XFree86 modelines nor
+ * fbset fb.modes provide an obvious way for margin timings to be
+ * included in their mode descriptions (needs more investigation).
+ * 
+ * The GTF provides for computation of interlaced mode timings;
+ * I've implemented the computations but not enabled them, yet.
+ * I should probably enable and test this at some point.
+ *
+ * 
+ *
+ * TODO:
+ *
+ * o Add support for interlaced modes.
+ *
+ * o Implement the other portions of the GTF: compute mode timings
+ *   given either the desired pixel clock or the desired horizontal
+ *   frequency.
+ *
+ * o It would be nice if this were more general purpose to do things
+ *   outside the scope of the GTF: like generate double scan mode
+ *   timings, for example.
+ *   
+ * o Printing digits to the right of the decimal point when the
+ *   digits are 0 annoys me.
+ *
+ * o Error checking.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+
+
+#define MARGIN_PERCENT    1.8   /* % of active vertical image                */
+#define CELL_GRAN         8.0   /* assumed character cell granularity        */
+#define MIN_PORCH         1     /* minimum front porch                       */
+#define V_SYNC_RQD        3     /* width of vsync in lines                   */
+#define H_SYNC_PERCENT    8.0   /* width of hsync as % of total line         */
+#define MIN_VSYNC_PLUS_BP 550.0 /* min time of vsync + back porch (microsec) */
+#define M                 600.0 /* blanking formula gradient                 */
+#define C                 40.0  /* blanking formula offset                   */
+#define K                 128.0 /* blanking formula scaling factor           */
+#define J                 20.0  /* blanking formula scaling factor           */
+
+/* C' and M' are part of the Blanking Duty Cycle computation */
+
+#define C_PRIME           (((C - J) * K/256.0) + J)
+#define M_PRIME           (K/256.0 * M)
+
+
+/* struct definitions */
+
+typedef struct __mode
+{
+    int hr, hss, hse, hfl;
+    int vr, vss, vse, vfl;
+    float pclk, h_freq, v_freq;
+} mode;
+
+
+typedef struct __options
+{
+    int x, y;
+    int xf86mode, fbmode;
+    float v_freq;
+} options;
+
+
+
+
+/* prototypes */
+
+void print_value(int n, char *name, float val);
+void print_xf86_mode (mode *m);
+void print_fb_mode (mode *m);
+mode *vert_refresh (int h_pixels, int v_lines, float freq,
+                    int interlaced, int margins);
+options *parse_command_line (int argc, char *argv[]);
+
+
+
+
+/*
+ * print_value() - print the result of the named computation; this is
+ * useful when comparing against the GTF EXCEL spreadsheet.
+ */
+
+int global_verbose = 0;
+
+void print_value(int n, char *name, float val)
+{
+    if (global_verbose) {
+        printf("%2d: %-27s: %15f\n", n, name, val);
+    }
+} // print_value()
+
+
+
+/* print_xf86_mode() - print the XFree86 modeline, given mode timings. */
+
+void print_xf86_mode (mode *m)
+{
+    printf ("\n");
+    printf ("  # %dx%d @ %.2f Hz (GTF) hsync: %.2f kHz; pclk: %.2f MHz\n",
+            m->hr, m->vr, m->v_freq, m->h_freq, m->pclk);
+    
+    printf ("  Modeline \"%dx%d_%.2f\"  %.2f"
+            "  %d %d %d %d"
+            "  %d %d %d %d"
+            "  -HSync +Vsync\n\n",
+            m->hr, m->vr, m->v_freq, m->pclk,
+            m->hr, m->hss, m->hse, m->hfl,
+            m->vr, m->vss, m->vse, m->vfl);
+    
+} // print_xf86_mode()
+
+
+
+/*
+ * print_fb_mode() - print a mode description in fbset(8) format;
+ * see the fb.modes(8) manpage.  The timing description used in
+ * this is rather odd; they use "left and right margin" to refer
+ * to the portion of the hblank before and after the sync pulse
+ * by conceptually wrapping the portion of the blank after the pulse
+ * to infront of the visible region; ie:
+ * 
+ *
+ * Timing description I'm accustomed to:
+ *
+ *
+ *
+ *     <--------1--------> <--2--> <--3--> <--4-->
+ *                                _________
+ *    |-------------------|_______|       |_______
+ *
+ *                        R       SS      SE     FL
+ *       
+ * 1: visible image
+ * 2: blank before sync (aka front porch)
+ * 3: sync pulse
+ * 4: blank after sync (aka back porch)
+ * R: Resolution
+ * SS: Sync Start
+ * SE: Sync End
+ * FL: Frame Length
+ *
+ *
+ * But the fb.modes format is:
+ *
+ *
+ *    <--4--> <--------1--------> <--2--> <--3--> 
+ *                                       _________
+ *    _______|-------------------|_______|       |
+ *  
+ * The fb.modes(8) manpage refers to <4> and <2> as the left and
+ * right "margin" (as well as upper and lower margin in the vertical
+ * direction) -- note that this has nothing to do with the term
+ * "margin" used in the GTF Timing Standard.
+ *
+ * XXX always prints the 32 bit mode -- should I provide a command
+ * line option to specify the bpp?  It's simple enough for a user
+ * to edit the mode description after it's generated.
+ */
+
+void print_fb_mode (mode *m)
+{
+    printf ("\n");
+    printf ("mode \"%dx%d %.2fHz 32bit (GTF)\"\n",
+            m->hr, m->vr, m->v_freq);
+    printf ("    # PCLK: %.2f MHz, H: %.2f kHz, V: %.2f Hz\n",
+            m->pclk, m->h_freq, m->v_freq);
+    printf ("    geometry %d %d %d %d 32\n",
+            m->hr, m->vr, m->hr, m->vr);
+    printf ("    timings %d %d %d %d %d %d %d\n",
+            (int) rint(1000000.0/m->pclk),// pixclock in picoseconds
+            m->hfl - m->hse,              // left margin (in pixels)
+            m->hss - m->hr,               // right margin (in pixels)
+            m->vfl - m->vse,              // upper margin (in pixel lines)
+            m->vss - m->vr,               // lower margin (in pixel lines)
+            m->hse - m->hss,              // horizontal sync length (in pixels)
+            m->vse - m->vss);             // vert sync length (in pixel lines)
+    printf ("    hsync low\n");
+    printf ("    vsync high\n");
+    printf ("endmode\n\n");
+    
+} // print_fb_mode()
+
+
+
+
+/*
+ * vert_refresh() - as defined by the GTF Timing Standard, compute the
+ * Stage 1 Parameters using the vertical refresh frequency.  In other
+ * words: input a desired resolution and desired refresh rate, and
+ * output the GTF mode timings.
+ *
+ * XXX All the code is in place to compute interlaced modes, but I don't
+ * feel like testing it right now.
+ *
+ * XXX margin computations are implemented but not tested (nor used by
+ * XFree86 of fbset mode descriptions, from what I can tell).
+ */
+
+mode *vert_refresh (int h_pixels, int v_lines, float freq,
+                    int interlaced, int margins)
+{
+    float h_pixels_rnd;
+    float v_lines_rnd;
+    float v_field_rate_rqd;
+    float top_margin;
+    float bottom_margin;
+    float interlace;
+    float h_period_est;
+    float vsync_plus_bp;
+    float v_back_porch;
+    float total_v_lines;
+    float v_field_rate_est;
+    float h_period;
+    float v_field_rate;
+    float v_frame_rate;
+    float left_margin;
+    float right_margin;
+    float total_active_pixels;
+    float ideal_duty_cycle;
+    float h_blank;
+    float total_pixels;
+    float pixel_freq;
+    float h_freq;
+
+    float h_sync;
+    float h_front_porch;
+    float v_odd_front_porch_lines;
+
+    mode *m = (mode*) malloc (sizeof (mode));
+    
+    
+    /*  1. In order to give correct results, the number of horizontal
+     *  pixels requested is first processed to ensure that it is divisible
+     *  by the character size, by rounding it to the nearest character
+     *  cell boundary:
+     *
+     *  [H PIXELS RND] = ((ROUND([H PIXELS]/[CELL GRAN RND],0))*[CELLGRAN RND])
+     */
+    
+    h_pixels_rnd = rint((float) h_pixels / CELL_GRAN) * CELL_GRAN;
+    
+    print_value(1, "[H PIXELS RND]", h_pixels_rnd);
+
+    
+    /*  2. If interlace is requested, the number of vertical lines assumed
+     *  by the calculation must be halved, as the computation calculates
+     *  the number of vertical lines per field. In either case, the
+     *  number of lines is rounded to the nearest integer.
+     *   
+     *  [V LINES RND] = IF([INT RQD?]="y", ROUND([V LINES]/2,0),
+     *                                     ROUND([V LINES],0))
+     */
+
+    v_lines_rnd = interlaced ?
+            rint((float) v_lines) / 2.0 :
+            rint((float) v_lines);
+    
+    print_value(2, "[V LINES RND]", v_lines_rnd);
+    
+    
+    /*  3. Find the frame rate required:
+     *
+     *  [V FIELD RATE RQD] = IF([INT RQD?]="y", [I/P FREQ RQD]*2,
+     *                                          [I/P FREQ RQD])
+     */
+
+    v_field_rate_rqd = interlaced ? (freq * 2.0) : (freq);
+
+    print_value(3, "[V FIELD RATE RQD]", v_field_rate_rqd);
+    
+
+    /*  4. Find number of lines in Top margin:
+     *
+     *  [TOP MARGIN (LINES)] = IF([MARGINS RQD?]="Y",
+     *          ROUND(([MARGIN%]/100*[V LINES RND]),0),
+     *          0)
+     */
+
+    top_margin = margins ? rint(MARGIN_PERCENT / 100.0 * v_lines_rnd) : (0.0);
+
+    print_value(4, "[TOP MARGIN (LINES)]", top_margin);
+    
+
+    /*  5. Find number of lines in Bottom margin:
+     *
+     *  [BOT MARGIN (LINES)] = IF([MARGINS RQD?]="Y",
+     *          ROUND(([MARGIN%]/100*[V LINES RND]),0),
+     *          0)
+     */
+
+    bottom_margin = margins ? rint(MARGIN_PERCENT/100.0 * v_lines_rnd) : (0.0);
+
+    print_value(5, "[BOT MARGIN (LINES)]", bottom_margin);
+
+    
+    /*  6. If interlace is required, then set variable [INTERLACE]=0.5:
+     *   
+     *  [INTERLACE]=(IF([INT RQD?]="y",0.5,0))
+     */
+
+    interlace = interlaced ? 0.5 : 0.0;
+
+    print_value(6, "[INTERLACE]", interlace);
+    
+
+    /*  7. Estimate the Horizontal period
+     *
+     *  [H PERIOD EST] = ((1/[V FIELD RATE RQD]) - [MIN VSYNC+BP]/1000000) /
+     *                    ([V LINES RND] + (2*[TOP MARGIN (LINES)]) +
+     *                     [MIN PORCH RND]+[INTERLACE]) * 1000000
+     */
+
+    h_period_est = (((1.0/v_field_rate_rqd) - (MIN_VSYNC_PLUS_BP/1000000.0))
+                    / (v_lines_rnd + (2*top_margin) + MIN_PORCH + interlace)
+                    * 1000000.0);
+
+    print_value(7, "[H PERIOD EST]", h_period_est);
+    
+
+    /*  8. Find the number of lines in V sync + back porch:
+     *
+     *  [V SYNC+BP] = ROUND(([MIN VSYNC+BP]/[H PERIOD EST]),0)
+     */
+
+    vsync_plus_bp = rint(MIN_VSYNC_PLUS_BP/h_period_est);
+
+    print_value(8, "[V SYNC+BP]", vsync_plus_bp);
+    
+    
+    /*  9. Find the number of lines in V back porch alone:
+     *
+     *  [V BACK PORCH] = [V SYNC+BP] - [V SYNC RND]
+     *
+     *  XXX is "[V SYNC RND]" a typo? should be [V SYNC RQD]?
+     */
+    
+    v_back_porch = vsync_plus_bp - V_SYNC_RQD;
+    
+    print_value(9, "[V BACK PORCH]", v_back_porch);
+    
+
+    /*  10. Find the total number of lines in Vertical field period:
+     *
+     *  [TOTAL V LINES] = [V LINES RND] + [TOP MARGIN (LINES)] +
+     *                    [BOT MARGIN (LINES)] + [V SYNC+BP] + [INTERLACE] +
+     *                    [MIN PORCH RND]
+     */
+
+    total_v_lines = v_lines_rnd + top_margin + bottom_margin + vsync_plus_bp +
+        interlace + MIN_PORCH;
+    
+    print_value(10, "[TOTAL V LINES]", total_v_lines);
+    
+
+    /*  11. Estimate the Vertical field frequency:
+     *
+     *  [V FIELD RATE EST] = 1 / [H PERIOD EST] / [TOTAL V LINES] * 1000000
+     */
+
+    v_field_rate_est = 1.0 / h_period_est / total_v_lines * 1000000.0;
+    
+    print_value(11, "[V FIELD RATE EST]", v_field_rate_est);
+    
+
+    /*  12. Find the actual horizontal period:
+     *
+     *  [H PERIOD] = [H PERIOD EST] / ([V FIELD RATE RQD] / [V FIELD RATE EST])
+     */
+
+    h_period = h_period_est / (v_field_rate_rqd / v_field_rate_est);
+    
+    print_value(12, "[H PERIOD]", h_period);
+    
+
+    /*  13. Find the actual Vertical field frequency:
+     *
+     *  [V FIELD RATE] = 1 / [H PERIOD] / [TOTAL V LINES] * 1000000
+     */
+
+    v_field_rate = 1.0 / h_period / total_v_lines * 1000000.0;
+
+    print_value(13, "[V FIELD RATE]", v_field_rate);
+    
+
+    /*  14. Find the Vertical frame frequency:
+     *
+     *  [V FRAME RATE] = (IF([INT RQD?]="y", [V FIELD RATE]/2, [V FIELD RATE]))
+     */
+
+    v_frame_rate = interlaced ? v_field_rate / 2.0 : v_field_rate;
+
+    print_value(14, "[V FRAME RATE]", v_frame_rate);
+    
+
+    /*  15. Find number of pixels in left margin:
+     *
+     *  [LEFT MARGIN (PIXELS)] = (IF( [MARGINS RQD?]="Y",
+     *          (ROUND( ([H PIXELS RND] * [MARGIN%] / 100 /
+     *                   [CELL GRAN RND]),0)) * [CELL GRAN RND],
+     *          0))
+     */
+
+    left_margin = margins ?
+        rint(h_pixels_rnd * MARGIN_PERCENT / 100.0 / CELL_GRAN) * CELL_GRAN :
+        0.0;
+    
+    print_value(15, "[LEFT MARGIN (PIXELS)]", left_margin);
+    
+
+    /*  16. Find number of pixels in right margin:
+     *
+     *  [RIGHT MARGIN (PIXELS)] = (IF( [MARGINS RQD?]="Y",
+     *          (ROUND( ([H PIXELS RND] * [MARGIN%] / 100 /
+     *                   [CELL GRAN RND]),0)) * [CELL GRAN RND],
+     *          0))
+     */
+    
+    right_margin = margins ?
+        rint(h_pixels_rnd * MARGIN_PERCENT / 100.0 / CELL_GRAN) * CELL_GRAN :
+        0.0;
+    
+    print_value(16, "[RIGHT MARGIN (PIXELS)]", right_margin);
+    
+
+    /*  17. Find total number of active pixels in image and left and right
+     *  margins:
+     *
+     *  [TOTAL ACTIVE PIXELS] = [H PIXELS RND] + [LEFT MARGIN (PIXELS)] +
+     *                          [RIGHT MARGIN (PIXELS)]
+     */
+
+    total_active_pixels = h_pixels_rnd + left_margin + right_margin;
+    
+    print_value(17, "[TOTAL ACTIVE PIXELS]", total_active_pixels);
+    
+    
+    /*  18. Find the ideal blanking duty cycle from the blanking duty cycle
+     *  equation:
+     *
+     *  [IDEAL DUTY CYCLE] = [C'] - ([M']*[H PERIOD]/1000)
+     */
+
+    ideal_duty_cycle = C_PRIME - (M_PRIME * h_period / 1000.0);
+    
+    print_value(18, "[IDEAL DUTY CYCLE]", ideal_duty_cycle);
+    
+
+    /*  19. Find the number of pixels in the blanking time to the nearest
+     *  double character cell:
+     *
+     *  [H BLANK (PIXELS)] = (ROUND(([TOTAL ACTIVE PIXELS] *
+     *                               [IDEAL DUTY CYCLE] /
+     *                               (100-[IDEAL DUTY CYCLE]) /
+     *                               (2*[CELL GRAN RND])), 0))
+     *                       * (2*[CELL GRAN RND])
+     */
+
+    h_blank = rint(total_active_pixels *
+                   ideal_duty_cycle /
+                   (100.0 - ideal_duty_cycle) /
+                   (2.0 * CELL_GRAN)) * (2.0 * CELL_GRAN);
+    
+    print_value(19, "[H BLANK (PIXELS)]", h_blank);
+    
+
+    /*  20. Find total number of pixels:
+     *
+     *  [TOTAL PIXELS] = [TOTAL ACTIVE PIXELS] + [H BLANK (PIXELS)]
+     */
+
+    total_pixels = total_active_pixels + h_blank;
+    
+    print_value(20, "[TOTAL PIXELS]", total_pixels);
+    
+
+    /*  21. Find pixel clock frequency:
+     *
+     *  [PIXEL FREQ] = [TOTAL PIXELS] / [H PERIOD]
+     */
+    
+    pixel_freq = total_pixels / h_period;
+    
+    print_value(21, "[PIXEL FREQ]", pixel_freq);
+    
+
+    /*  22. Find horizontal frequency:
+     *
+     *  [H FREQ] = 1000 / [H PERIOD]
+     */
+
+    h_freq = 1000.0 / h_period;
+    
+    print_value(22, "[H FREQ]", h_freq);
+    
+
+
+    /* Stage 1 computations are now complete; I should really pass
+       the results to another function and do the Stage 2
+       computations, but I only need a few more values so I'll just
+       append the computations here for now */
+
+    
+
+    /*  17. Find the number of pixels in the horizontal sync period:
+     *
+     *  [H SYNC (PIXELS)] =(ROUND(([H SYNC%] / 100 * [TOTAL PIXELS] /
+     *                             [CELL GRAN RND]),0))*[CELL GRAN RND]
+     */
+
+    h_sync = rint(H_SYNC_PERCENT/100.0 * total_pixels / CELL_GRAN) * CELL_GRAN;
+
+    print_value(17, "[H SYNC (PIXELS)]", h_sync);
+    
+
+    /*  18. Find the number of pixels in the horizontal front porch period:
+     *
+     *  [H FRONT PORCH (PIXELS)] = ([H BLANK (PIXELS)]/2)-[H SYNC (PIXELS)]
+     */
+
+    h_front_porch = (h_blank / 2.0) - h_sync;
+
+    print_value(18, "[H FRONT PORCH (PIXELS)]", h_front_porch);
+    
+    
+    /*  36. Find the number of lines in the odd front porch period:
+     *
+     *  [V ODD FRONT PORCH(LINES)]=([MIN PORCH RND]+[INTERLACE])
+     */
+    
+    v_odd_front_porch_lines = MIN_PORCH + interlace;
+    
+    print_value(36, "[V ODD FRONT PORCH(LINES)]", v_odd_front_porch_lines);
+    
+
+    /* finally, pack the results in the mode struct */
+    
+    m->hr  = (int) (h_pixels_rnd);
+    m->hss = (int) (h_pixels_rnd + h_front_porch);
+    m->hse = (int) (h_pixels_rnd + h_front_porch + h_sync);
+    m->hfl = (int) (total_pixels);
+
+    m->vr  = (int) (v_lines_rnd);
+    m->vss = (int) (v_lines_rnd + v_odd_front_porch_lines);
+    m->vse = (int) (int) (v_lines_rnd + v_odd_front_porch_lines + V_SYNC_RQD);
+    m->vfl = (int) (total_v_lines);
+
+    m->pclk   = pixel_freq;
+    m->h_freq = h_freq;
+    m->v_freq = freq;
+
+    return (m);
+    
+} // vert_refresh()
+
+
+
+
+/*
+ * parse_command_line() - parse the command line and return an
+ * alloced structure containing the results.  On error print usage
+ * and return NULL.
+ */ 
+
+options *parse_command_line (int argc, char *argv[])
+{
+    int n;
+
+    options *o = (options *) calloc (1, sizeof (options));
+
+    if (argc < 4) goto bad_option;
+
+    o->x = atoi (argv[1]);
+    o->y = atoi (argv[2]);
+    o->v_freq = atof (argv[3]);
+
+    /* XXX should check for errors in the above */
+    
+    n = 4;
+
+    while (n < argc) {
+        if ((strcmp (argv[n], "-v") == 0) ||
+            (strcmp (argv[n], "--verbose") == 0)) {
+            global_verbose = 1;
+        } else if ((strcmp (argv[n], "-f") == 0) ||
+                   (strcmp (argv[n], "--fbmode") == 0)) {
+            o->fbmode = 1;
+        } else if ((strcmp (argv[n], "-x") == 0) ||
+                   (strcmp (argv[n], "--xf86mode") == 0)) {
+            o->xf86mode = 1;
+        } else {
+            goto bad_option;
+        }
+        
+        n++;
+    }
+
+    /* if neither xf86mode nor fbmode were requested, default to
+       xf86mode */
+
+    if (!o->fbmode && !o->xf86mode) o->xf86mode = 1;
+    
+    return (o);
+    
+ bad_option:
+
+    fprintf (stderr, "\n");
+    fprintf (stderr, "usage: %s x y refresh [-v|--verbose] "
+             "[-f|--fbmode] [-x|-xf86mode]\n", argv[0]);
+
+    fprintf (stderr, "\n");
+    
+    fprintf (stderr, "            x : the desired horizontal "
+             "resolution (required)\n");
+    fprintf (stderr, "            y : the desired vertical "
+             "resolution (required)\n");
+    fprintf (stderr, "      refresh : the desired refresh "
+             "rate (required)\n");
+    fprintf (stderr, " -v|--verbose : enable verbose printouts "
+             "(traces each step of the computation)\n");
+    fprintf (stderr, "  -f|--fbmode : output an fbset(8)-style mode "
+             "description\n");
+    fprintf (stderr, " -x|-xf86mode : output an XFree86-style mode "
+             "description (this is the default\n"
+             "                if no mode description is requested)\n");
+    
+    fprintf (stderr, "\n");
+    
+    free (o);
+    return (NULL);
+
+} // parse_command_line()
+
+
+
+int main (int argc, char *argv[])
+{
+    mode *m;
+    options *o;
+
+    o = parse_command_line (argc, argv);
+    if (!o) exit (1);
+    
+    m = vert_refresh (o->x, o->y, o->v_freq, 0, 0);
+    if (!m) exit (1);
+
+    if (o->xf86mode)
+        print_xf86_mode(m);
+    
+    if (o->fbmode)
+        print_fb_mode(m);
+    
+    return 0;
+    
+} // main()
diff --git a/compile/ip-screen.c b/compile/ip-screen.c
new file mode 100644 (file)
index 0000000..d4c8e0f
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Filename:      ip-screen.c
+ * Purpose:       print ip address of configured network interfaces
+ * Authors:       grml-team (grml.org), (c) Michael Gebetsroither <gebi@grml.org>
+ * Bug-Reports:   see http://grml.org/bugs/
+ * License:       This file is licensed under the GPL v2.
+ * Latest change: Thu Mar 30 23:09:28 CEST 2006 [mika]
+ *********************************************************************************/
+
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#define MAX_IFS 32
+#define WRITE(x) write(1, x, strlen(x))
+
+// USER CONFIG
+#define ERR_MSG "[running ip-screen failed]\n"
+#define NO_IFACE_MSG "[ network n/a ]\n"
+
+void die(int errcode)
+{
+    WRITE(ERR_MSG);
+    exit(errcode);
+}
+
+int main()
+{
+    int sockfd;
+    int total, remaining, current;
+    struct ifconf ifc;
+    struct ifreq *ifrp;
+    struct sockaddr_in *addr;
+    struct in_addr *tmp = NULL;
+    char buf[sizeof(struct ifreq)*MAX_IFS];
+    char *ctmp = NULL;
+
+    sockfd = socket(PF_INET,SOCK_DGRAM,0);
+    if(-1 == sockfd)
+        die(1);
+
+    ifc.ifc_buf = buf;
+    ifc.ifc_len = sizeof(buf);
+    if (-1 == ioctl(sockfd, SIOCGIFCONF, &ifc))
+        die(2);
+
+    remaining = total = ifc.ifc_len;
+    ifrp = ifc.ifc_req;
+    while(remaining) {
+        if( ifrp->ifr_addr.sa_family == AF_INET ) {
+            if (-1 == ioctl(sockfd, SIOCGIFFLAGS, ifrp)) {
+                die(3);
+            }
+            addr = (struct sockaddr_in *)&(ifrp->ifr_addr);
+            if(!(ifrp->ifr_flags & IFF_LOOPBACK)) {
+                if(tmp) {
+                    ctmp = inet_ntoa(*tmp);
+                    WRITE(ctmp);
+                    WRITE(" | ");
+                }
+                tmp = &addr->sin_addr;
+            }
+        }
+
+        current = sizeof(struct ifreq);
+        ifrp = (struct ifreq *)( ((char *)ifrp)+current );
+        remaining -= current;
+    }
+
+    if(tmp){
+        ctmp = inet_ntoa(*tmp);
+        WRITE(ctmp);
+        WRITE("\n");
+    } else {
+        WRITE(NO_IFACE_MSG);
+    }
+
+    return 0;
+}
+
+/** END OF FILE *****************************************************************/
diff --git a/compile/pong.c b/compile/pong.c
new file mode 100644 (file)
index 0000000..0ca49e2
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * By Patrick Reynolds <reynolds@cs.duke.edu>
+ * Distributed under GPL.
+ *
+ * Build instructions
+ *   gcc pong.c -o pong
+ *
+ * Usage:
+ *   pong 1.2.3.0     # as root!
+ */
+
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <netinet/ip_icmp.h>
+#include <sys/socket.h>
+
+#define PONG_DEAD 0
+#define PONG_BROKEN 1
+#define PONG_OKAY 2
+
+#undef I_CARE_ABOUT_BAD_RETURN_PACKETS
+
+int id, sock;
+int datalen = 0;
+int nhosts = 256;
+int vec[256];
+int foo_set = 0;
+struct sockaddr_in dest;
+
+void pong();
+void catch();
+int in_cksum(u_short *addr, int len);
+void print();
+void foo(int i) { foo_set = 1; }
+
+int main(int argc, char **argv) {
+  id = getpid();
+  if ((sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0) {
+    perror("pong: socket");
+    return -1;
+  }
+  if (argc != 2) {
+    fprintf(stderr, "Usage:\n  %s aaa.bbb.ccc.0\n\n", argv[0]);
+    return -1;
+  }
+  bzero(&dest, sizeof(dest));
+  dest.sin_family = AF_INET;
+  inet_aton(argv[1], &dest.sin_addr);
+  pong();
+  catch();
+  print();
+  return 0;
+}
+
+void pong() {
+  unsigned char buf[sizeof(struct icmphdr)];
+  struct icmphdr *p = (struct icmphdr *)buf;
+  int ret, i;
+
+       fprintf(stderr, "Sending packets");
+
+  p->type = ICMP_ECHO;
+  p->code = 0;
+  p->checksum = 0;
+  p->un.echo.sequence = 0;
+  p->un.echo.id = id;
+
+  p->checksum = in_cksum((u_short *)p, datalen + 8);
+
+  dest.sin_addr.s_addr &= 0xffffff;
+  for (i=1; i<=254; i++) {
+               fputc('.', stderr);
+               fflush(stderr);
+    dest.sin_addr.s_addr &= 0xffffff;
+    dest.sin_addr.s_addr |= (i<<24);
+    ret = sendto(sock, (char *)buf, 8 + datalen, 0,
+      (struct sockaddr *)&dest, sizeof(struct sockaddr_in));
+    if (ret != 8 + datalen) {
+      if (ret < 0)
+        perror("pong: sendto");
+      printf("pong: wrote %d chars, ret=%d\n", 8+datalen, ret);
+    }
+  }
+       fputc('\n', stderr);
+}
+
+void catch() {
+  int ret;
+  char incoming[128];
+       fprintf(stderr, "Gathering responses");
+  bzero(vec, nhosts*sizeof(int));
+  alarm(5);
+  signal(SIGALRM, foo);
+  signal(SIGINT, foo);
+  while (!foo_set) {
+    struct sockaddr_in from;
+               fd_set rfds;
+               struct timeval tv = { 1, 0 };
+    socklen_t fromlen = sizeof(from);
+               FD_ZERO(&rfds);
+               FD_SET(sock, &rfds);
+               if (select(sock+1, &rfds, NULL, NULL, &tv) <= 0) continue;
+    ret = recvfrom(sock, (char *)incoming, 128, 0, (struct sockaddr *)&from,
+      &fromlen);
+#ifdef I_CARE_ABOUT_BAD_RETURN_PACKETS
+    if (ret != datalen + 16 && (ret >= 0 || errno != EINTR)) {
+      if (ret < 0)
+        perror("pong: recvfrom");
+      else
+        vec[from.sin_addr.s_addr >> 24] = PONG_BROKEN;
+      printf("pong: read %d chars, ret=%d, host=%d\n", 16+datalen, ret,
+        from.sin_addr.s_addr>>24);
+    }
+    else
+#endif
+               {
+                       fputc('.', stderr);
+                       fflush(stderr);
+      vec[from.sin_addr.s_addr >> 24] = PONG_OKAY;
+               }
+  }
+       fputc('\n', stderr);
+}
+
+int in_cksum(u_short *addr, int len) {
+  register int nleft = len;
+  register u_short *w = addr;
+  register int sum = 0;
+  u_short answer = 0;
+        
+  while (nleft > 1)  {
+    sum += *w++;
+    nleft -= 2;
+  }
+  if (nleft == 1) {
+    *(u_char *)(&answer) = *(u_char *)w ;
+    sum += answer;
+  }
+  sum = (sum >> 16) + (sum & 0xffff);
+  sum += (sum >> 16);
+  answer = ~sum;
+  return(answer);
+}
+
+void print() {
+  int i, count = 0;
+  for (i=0; i<=255; i++)
+    if (vec[i]) {
+      unsigned int ip = ntohl(dest.sin_addr.s_addr);
+      count++;
+      printf("%d.%d.%d.%d: %s\n", ip>>24, (ip>>16)&0xff, (ip>>8)&0xff, i,
+        vec[i]==PONG_OKAY ? "found" : "broken");
+    }
+  printf("\nTotal hosts: %d\n", count);
+}
diff --git a/compile/reread_partition_table.c b/compile/reread_partition_table.c
new file mode 100644 (file)
index 0000000..f80dd7b
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Filename:      reread_partition_table.c
+ * Purpose:       re-read partition table on Linux
+ * Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+ * Bug-Reports:   see http://grml.org/bugs/
+ * License:       This file is licensed under the GPL v2.
+ * Latest change: Die Sep 05 23:13:57 CEST 2006 [mika]
+ *******************************************************************************/
+
+// diet gcc -s -Os -o reread_partition_table reread_partition_table.c
+
+#include <fcntl.h>
+#include <linux/fs.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+void usage()
+{
+  printf("Usage: reread_partition_table <device>\n");
+}
+
+int reread_partition_table(char *dev)
+{
+  int fd;
+
+  sync();
+
+  if ((fd = open(dev, O_RDONLY)) < 0) {
+    perror("error opening device");
+    return(1);
+  }
+
+  if (ioctl(fd, BLKRRPART) < 0) {
+    perror("unable to reload partition table");
+    return(1);
+  }
+  else {
+    printf("successfully reread partition table\n");
+    return(0);
+  }
+}
+
+void main(int argc, char** argv)
+{
+  if (getuid() != 0){
+    printf("Error: reread_partition_table requires root permissions\n");
+    exit(1);
+  }
+
+  if (argc < 2) {
+    usage();
+    exit(1);
+  }
+  else {
+    if (strncmp(argv[1], "/dev/", 5) != 0) {
+      printf("Invalid argument.\n");
+      usage();
+      exit(1);
+    }
+    reread_partition_table(argv[1]);
+  }
+}
+
+/* END OF FILE ****************************************************************/
diff --git a/compile/vmware-detect.c b/compile/vmware-detect.c
new file mode 100644 (file)
index 0000000..d242a38
--- /dev/null
@@ -0,0 +1,13 @@
+#include <stdio.h>
+int main() {
+  unsigned char idtr[6];
+  asm("sidt %0" : "=m" (idtr));
+  if(0xff==idtr[5])
+  {
+    return 0;
+  }
+  else
+  {
+    return 1;
+  }
+}
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..7f7e1c2
--- /dev/null
@@ -0,0 +1,1936 @@
+grml-scripts (0.8-25) unstable; urgency=low
+
+  * Added new hostnames to random-hostname, thanks Filippo Cattaneo.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 13 Oct 2006 12:08:43 +0200
+
+grml-scripts (0.8-24) unstable; urgency=low
+
+  * Add grml-iptstate (wrapper around iptstate).
+
+ -- Michael Prokop <mika@grml.org>  Thu, 12 Oct 2006 17:28:01 +0200
+
+grml-scripts (0.8-23) unstable; urgency=low
+
+  * net-functions: fix getLanDriver (we have to s/ath/wifi/)
+  * routersetup: support $AP_DEVICE and $ATH_MODE
+  * grml-ap: some fixes, improvements,...
+
+ -- Michael Prokop <mika@grml.org>  Thu, 12 Oct 2006 11:28:29 +0200
+
+grml-scripts (0.8-22) unstable; urgency=low
+
+  * Applied patch by Moritz 'moemoe' Augsburger, thanks!
+    - net-functions: improve + extend functions
+    - grml-bridge: extended => some new features
+    - grml-ap: added support for hostap, generic mode,...
+
+ -- Michael Prokop <mika@grml.org>  Wed, 11 Oct 2006 23:04:19 +0200
+
+grml-scripts (0.8-21) unstable; urgency=low
+
+  * Added grml-bridge and grml-ap.
+  * Update grml-router (some small improvements).
+
+ -- Michael Prokop <mika@grml.org>  Sun,  8 Oct 2006 00:18:45 +0200
+
+grml-scripts (0.8-20) unstable; urgency=low
+
+  * Added grml-router (set up your box as NAT-router).
+
+ -- Michael Prokop <mika@grml.org>  Sat,  7 Oct 2006 14:09:07 +0200
+
+grml-scripts (0.8-19) unstable; urgency=low
+
+  * grml-setlang: do not set $COUNTRY, causes problems with mtools
+    (and therefore syslinux as well). Also do not set $CHARSET, should
+    not be necessary as well.
+  * modemlink, mkdosswapfile, netcardconfig and grml-network:
+    source /etc/default/locale instead of /etc/sysconfig/*
+
+ -- Michael Prokop <mika@grml.org>  Wed,  4 Oct 2006 10:22:24 +0200
+
+grml-scripts (0.8-18) unstable; urgency=low
+
+  * grml-hostname: info message for 'New hostname' proposal,
+    adjust message if $GRML2HD is set.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 30 Sep 2006 12:36:28 +0200
+
+grml-scripts (0.8-17) unstable; urgency=low
+
+  * random-hostname: added some more hostnames - thanks, Ronny!
+  * debian/control: it's "make life easier", thanks Mark!
+
+ -- Michael Prokop <mika@grml.org>  Sat, 30 Sep 2006 11:46:10 +0200
+
+grml-scripts (0.8-16) unstable; urgency=low
+
+  * Added script getsf (download project from sourceforge.net).
+  * Bumbed Standard-Version to 3.7.2. Some more cosmetic stuff
+    to make lintian a little bit happier.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 29 Sep 2006 13:32:36 +0200
+
+grml-scripts (0.8-15) unstable; urgency=low
+
+  * Add script random-hostname (print random hostname to stdout).
+  * Adjust grml-hostname to support use of random-hostname. Adjust
+    ipv6 line in /etc/hosts as well.
+  * Added manpages for grml-setlang and grml-setkeyboard.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 26 Sep 2006 11:18:59 +0200
+
+grml-scripts (0.8-14) unstable; urgency=low
+
+  * grml-setlang: support all languages defined in
+    /etc/grml/language-functions. Don't set $LC_ALL by default anymore.
+    Support non-interactive use via 'grml-setlang <language>'.
+  * Added grml-autoconfig >= 0.5-10 to Suggests.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 23 Sep 2006 13:17:43 +0200
+
+grml-scripts (0.8-13) unstable; urgency=low
+
+  * grml-muttng: use set header_cache="~/.muttng/cache" instead of
+    ~/.mutt/headers and create directory ~/.muttng if it's not yet present.
+    Thanks for reporting, moemoe!
+
+ -- Michael Prokop <mika@grml.org>  Thu, 21 Sep 2006 20:00:28 +0200
+
+grml-scripts (0.8-12) unstable; urgency=low
+
+  * Remove create_mnt_labels as it has been deprecated by new
+    udev and rebuildfstab solution.
+
+ -- Michael Prokop <mika@grml.org>  Mon, 18 Sep 2006 19:07:56 +0200
+
+grml-scripts (0.8-11) unstable; urgency=low
+
+  * Another fix in debian/preinst, thanks for mabu for reporting.
+
+ -- Michael Prokop <mika@grml.org>  Mon, 18 Sep 2006 13:37:27 +0200
+
+grml-scripts (0.8-10) unstable; urgency=low
+
+  * Ship /etc/grml/script-functions.
+
+ -- Michael Prokop <mika@grml.org>  Mon, 18 Sep 2006 00:51:54 +0200
+
+grml-scripts (0.8-9) unstable; urgency=low
+
+  * Rename debian/postinst into debian/preinst, hopefully this fixes a problem
+    when running a Debian upgrade where maintainer scripts need [ef]grep.
+    Thanks for noticing, Kevin Krammer!
+
+ -- Michael Prokop <mika@grml.org>  Sun, 17 Sep 2006 17:33:39 +0200
+
+grml-scripts (0.8-8) unstable; urgency=low
+
+  * Added gtf (Generate mode timings using the GTF Timing Standard).
+  * Remove empty README-Debian.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 15 Sep 2006 16:04:10 +0200
+
+grml-scripts (0.8-7) unstable; urgency=low
+
+  * Remove /bin/[ef]grep, we don't need it any more as /bin/sh
+    isn't /bin/zsh on grml.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 14 Sep 2006 00:04:34 +0200
+
+grml-scripts (0.8-6) unstable; urgency=low
+
+  * Remove dpkg-divert of /bin/[ef]grep.
+
+ -- Michael Prokop <mika@grml.org>  Wed, 13 Sep 2006 23:47:44 +0200
+
+grml-scripts (0.8-5) unstable; urgency=low
+
+  * grml-nessus: update handling of /var/lib/nessus/nessus-services
+
+ -- Michael Prokop <mika@grml.org>  Mon, 11 Sep 2006 17:31:42 +0200
+
+grml-scripts (0.8-4) unstable; urgency=low
+
+  * Updated manpage reread_partition_table.8.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  7 Sep 2006 11:42:36 +0200
+
+grml-scripts (0.8-3) unstable; urgency=low
+
+  * Added reread_partition_table (re-read partition table on
+    Linux).
+
+ -- Michael Prokop <mika@grml.org>  Tue,  5 Sep 2006 23:37:44 +0200
+
+grml-scripts (0.8-2) unstable; urgency=low
+
+  * Added create_mnt_labels (create directories for filesystems
+    with a label).
+
+ -- Michael Prokop <mika@grml.org>  Sun,  3 Sep 2006 19:21:16 +0200
+
+grml-scripts (0.8-1) unstable; urgency=low
+
+  * Bumb version, grml 0.8 is coming...
+
+ -- Michael Prokop <mika@grml.org>  Fri, 11 Aug 2006 11:44:45 +0200
+
+grml-scripts (0.7-53) unstable; urgency=low
+
+  * grml-pptp-inode: recommend usage of pppoeconf.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 11 Aug 2006 11:42:12 +0200
+
+grml-scripts (0.7-52) unstable; urgency=low
+
+  * bt-hid: start dbus and /etc/init.d/bluetooth (thanks for
+    testing, Spida).
+
+ -- Michael Prokop <mika@grml.org>  Thu, 10 Aug 2006 00:19:24 +0200
+
+grml-scripts (0.7-51) unstable; urgency=low
+
+  * myip: use /bin/zsh as interpreter to make lintian happy. 
+
+ -- Michael Prokop <mika@grml.org>  Mon,  7 Aug 2006 23:39:54 +0200
+
+grml-scripts (0.7-50) unstable; urgency=low
+
+  * Removed deprecated ath-switcher script (madwifi-ng is the default
+    now).
+
+ -- Michael Prokop <mika@grml.org>  Mon,  7 Aug 2006 23:36:20 +0200
+
+grml-scripts (0.7-49) unstable; urgency=low
+
+  * bt-audio: Send dbus-output to /dev/null. Warn that dbus won't be
+    stopped with 'bt-audio stop' (preventing other subsystems to
+    fail then).
+
+ -- Michael Prokop <mika@grml.org>  Sun,  6 Aug 2006 20:30:52 +0200
+
+grml-scripts (0.7-48) unstable; urgency=low
+
+  * bt-audio: dbus needs to be running, handling passphrase
+    stuff via new infrastructure of bluez-utils. 
+
+ -- Michael Prokop <mika@grml.org>  Sun,  6 Aug 2006 18:35:50 +0200
+
+grml-scripts (0.7-47) unstable; urgency=low
+
+  * grml-setlang/grml-setkeyboard: mention [us] in en-selection.
+
+ -- Michael Prokop <mika@grml.org>  Sat,  5 Aug 2006 11:40:31 +0200
+
+grml-scripts (0.7-46) unstable; urgency=low
+
+  * grml-hostname: adjust myhostname in /etc/postfix/main.cf as well.
+    (Thanks for hint, Nico!)
+  * blacklist: warn if module does not exist (thanks for hint, Nico).
+
+ -- Michael Prokop <mika@grml.org>  Fri,  4 Aug 2006 11:32:27 +0200
+
+grml-scripts (0.7-45) unstable; urgency=low
+
+  * XF86AudioRaiseVolume, XF86AudioLowerVolume: use percentage bar
+    instead of simple text. Thanks, schula!
+
+ -- Michael Prokop <mika@grml.org>  Tue,  1 Aug 2006 01:19:35 +0200
+
+grml-scripts (0.7-44) unstable; urgency=low
+
+  * grml-setkeyboard: oh, it's $LANGUAGE instead of $KEYBOARD
+    of course, as we source /etc/grml/language-functions.
+    Read in /etc/sysconfig/keyboard instead of bootoption lang.
+  * grml-setlang: read in /etc/environment and /etc/default/locale
+    instead of bootoption lang.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 27 Jul 2006 18:49:45 +0200
+
+grml-scripts (0.7-43) unstable; urgency=low
+
+  * grml-tpm: exit script if running trousers daemon fails.
+  * grml-nessus: use lsb-functions, make sure directory
+    /var/lib/nessus/nessus-services exists.
+  * grml-config-root: add grml-setlang and grml-setkeyboard to menu.
+  * grml-setkeyboard: added info text for grml-lang.
+
+ -- Michael Prokop <mika@grml.org>  Wed, 26 Jul 2006 02:23:13 +0200
+
+grml-scripts (0.7-42) unstable; urgency=low
+
+  * Update myip: added 'ztcp -c $REPLY' (thanks, formorer).
+
+ -- Michael Prokop <mika@grml.org>  Tue, 25 Jul 2006 21:33:30 +0200
+
+grml-scripts (0.7-41) unstable; urgency=low
+
+  * Updated manpage of grml-setlang (mention /etc/default/locale).
+  * Added script 'myip' (return IP address of running system on stdout)
+    by formorer, thanks!
+
+ -- Michael Prokop <mika@grml.org>  Mon, 24 Jul 2006 21:34:49 +0200
+
+grml-scripts (0.7-40) unstable; urgency=low
+
+  * Added symlinks for manpages of grml-setlang/grml-setkeyboard.
+
+ -- Michael Prokop <mika@grml.org>  Mon, 24 Jul 2006 21:24:56 +0200
+
+grml-scripts (0.7-39) unstable; urgency=low
+
+  * grml-setlang/grml-setkeyboard: updated corresponding to
+    new file /etc/grml/language-functions and don't use
+    /etc/environment anymore but /etc/default/locale (zsh
+    will source /etc/environment as well to be backwards
+    compatible).
+
+ -- Michael Prokop <mika@grml.org>  Wed, 19 Jul 2006 21:16:03 +0200
+
+grml-scripts (0.7-38) unstable; urgency=low
+
+  * x-say: hmpf, wmiplumb has been renamed into wmiipsel in wmii[-3].
+    Adjusted in script x-say therefore.
+  * make_chroot_jail: update to latest upstream version which
+    incorporates suggest fix for /dev/-permissions.
+  * Added grml-setlang and grml-setkeyboard (need heavy testing
+    before going public).
+  * grml-policy-rc.d got its own manpage with much more details.
+  * Moved grml-policy-rc.d to its own package.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 14 Jul 2006 01:29:51 +0200
+
+grml-scripts (0.7-37) unstable; urgency=low
+
+  * Check for existence of /dev/fb0 in grml-info.
+  * Added osd_server.py.
+  * Added grml-policy-rc.d.
+
+ -- Michael Prokop <mika@grml.org>  Fri,  7 Jul 2006 22:42:48 +0200
+
+grml-scripts (0.7-36) unstable; urgency=low
+
+  * Rename dpkg_running into dpkg_not_running as it is more logical.
+
+ -- Michael Prokop <mika@grml.org>  Wed, 28 Jun 2006 20:24:31 +0200
+
+grml-scripts (0.7-35) unstable; urgency=low
+
+  * Added dpkg_running: check whether Debian's package management
+    (dpkg) is running (return 0 if it is running; return 1 if it is
+    not running).
+
+ -- Michael Prokop <mika@grml.org>  Wed, 28 Jun 2006 18:15:56 +0200
+
+grml-scripts (0.7-34) unstable; urgency=low
+
+  * netcardconfig: adjusted tail commands to avoid the warning:
+    'Warning: "+number" syntax is deprecated, please use "-n +number'
+
+ -- Michael Prokop <mika@grml.org>  Sun,  4 Jun 2006 17:25:59 +0200
+
+grml-scripts (0.7-33) unstable; urgency=low
+
+  * Update iimage to latest revision, thanks for hint - Sven Guckes!
+
+ -- Michael Prokop <mika@grml.org>  Sun, 28 May 2006 14:24:16 +0200
+
+grml-scripts (0.7-32) unstable; urgency=low
+
+  * Mention zsh-help in zsh-login.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 28 May 2006 14:20:13 +0200
+
+grml-scripts (0.7-31) unstable; urgency=low
+
+  * grml-network: support more than one default route when checking
+    network status. Thanks for reporting and bugfix, Kai Wilke!
+
+ -- Michael Prokop <mika@grml.org>  Sat, 27 May 2006 23:02:15 +0200
+
+grml-scripts (0.7-30) unstable; urgency=low
+
+  * Again use /bin/zsh as shebang line for zsh scripts.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 27 May 2006 14:45:49 +0200
+
+grml-scripts (0.7-29) unstable; urgency=low
+
+  * Updated grml-tpm: added support for "real TPM hardware".
+    Tested with IBM ThinkPad T60's TPM 1.2 chip and tpm_tis
+    of 2.6.17-rc5 including special patch (thanks to
+    Kylene Jo Hall).
+
+ -- Michael Prokop <mika@grml.org>  Fri, 26 May 2006 00:46:48 +0200
+
+grml-scripts (0.7-28) unstable; urgency=low
+
+  * Improved error handling in grml-hostname.
+  * Some small adjustments in ath-switcher.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 14 May 2006 15:28:38 +0200
+
+grml-scripts (0.7-27) unstable; urgency=low
+
+  * Updated XF86Audio*-scripts: improved status information.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 14 May 2006 15:03:09 +0200
+
+grml-scripts (0.7-26) unstable; urgency=low
+
+  * Updated XF86AudioMute: use amixer instead of aumix, check
+    for running X instead of set $DISPLAY, use osd_cat for
+    on-screen-display.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 14 May 2006 02:58:18 +0200
+
+grml-scripts (0.7-25) unstable; urgency=low
+
+  * Don't use gawk but just 'awk' in grml-pptp-inode.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 12 May 2006 18:09:07 +0200
+
+grml-scripts (0.7-24) unstable; urgency=low
+
+  * Added dialog to depends, thanks for notice - Martin Buchleitner!
+
+ -- Michael Prokop <mika@grml.org>  Wed, 10 May 2006 19:30:42 +0200
+
+grml-scripts (0.7-23) unstable; urgency=low
+
+  * Added grml-tpm: set up a system for use with TPM technology
+
+ -- Michael Prokop <mika@grml.org>  Sun,  7 May 2006 17:06:14 +0200
+
+grml-scripts (0.7-22) unstable; urgency=low
+
+  * Added grml-resolution: change X resolution via a simple menu
+    frontend; script based on work by Florian Keller, thanks!
+
+ -- Michael Prokop <mika@grml.org>  Thu,  4 May 2006 23:13:49 +0200
+
+grml-scripts (0.7-21) unstable; urgency=low
+
+  * grml-hostname: adjust hostname in /etc/hosts as well. Thanks
+    for report, Thomas Ulz!
+
+ -- Michael Prokop <mika@grml.org>  Tue,  2 May 2006 20:49:04 +0200
+
+grml-scripts (0.7-20) unstable; urgency=low
+
+  * grml-hostname: write hostname also to /etc/hostname.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 30 Apr 2006 18:17:46 +0200
+
+grml-scripts (0.7-19) unstable; urgency=low
+
+  * Added grml-hostname to set hostname.
+  * Rewrote grml-postfix: run 'dpkg-reconfigure postfix' instead
+    of the own, old shellscript stuff..
+
+ -- Michael Prokop <mika@grml.org>  Thu, 27 Apr 2006 18:22:58 +0200
+
+grml-scripts (0.7-18) unstable; urgency=low
+
+  * Mention unblacklist in manpage.
+  * Exit if no parameters given to [un]blacklist.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 22 Apr 2006 13:18:51 +0200
+
+grml-scripts (0.7-17) unstable; urgency=low
+
+  * Don't run Xdialog in modemlink, grml-network, netcardconfig,
+    ndiswrapper.sh and mkdosswapfile.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 21 Apr 2006 22:24:16 +0200
+
+grml-scripts (0.7-16) unstable; urgency=low
+
+  * bt-audio: add support for setting PIN via $PIN=...
+
+ -- Michael Prokop <mika@grml.org>  Fri, 21 Apr 2006 22:01:13 +0200
+
+grml-scripts (0.7-15) unstable; urgency=low
+
+  * prepare_ramdisk.sh + prepare_tmpfs.sh: use zsh instead of
+    /bin/sh; setopt nonomatch
+
+ -- Michael Prokop <mika@grml.org>  Fri, 21 Apr 2006 11:13:06 +0200
+
+grml-scripts (0.7-14) unstable; urgency=low
+
+  * grml-lang: use us-latin1 instead of us-intl.iso15 for us.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 21 Apr 2006 02:02:57 +0200
+
+grml-scripts (0.7-13) unstable; urgency=low
+
+  * netcardconfig: send error messages to /dev/null when
+    checking for $WLAN via /proc/net/wireless
+
+ -- Michael Prokop <mika@grml.org>  Thu, 20 Apr 2006 23:05:36 +0200
+
+grml-scripts (0.7-12) unstable; urgency=low
+
+  * grml-network: don't run network status check if nmap
+    isn't present.
+  * grml-pptp-vcgraz: provide more useful error message if
+    network isn't 10.x.x.x.
+  * Updated make_chroot_jail.sh to latest upstream version.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 20 Apr 2006 22:58:09 +0200
+
+grml-scripts (0.7-11) unstable; urgency=low
+
+  * Reworked grml-network: merged network-setup into it.
+  * Removed deprecated network-setup.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 20 Apr 2006 22:15:00 +0200
+
+grml-scripts (0.7-10) unstable; urgency=low
+
+  * Added blacklist / unblacklist.
+  * Removed wlardconfig.
+  * Updated network-setup.
+  * Use Xdialog in netcardconfig so it can be used via network-setup
+    as well.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 20 Apr 2006 18:34:27 +0200
+
+grml-scripts (0.7-9) unstable; urgency=low
+
+  * netcardconfig: don't use Xdialog even though $DISPLAY is set
+
+ -- Michael Prokop <mika@grml.org>  Thu, 20 Apr 2006 15:56:44 +0200
+
+grml-scripts (0.7-8) unstable; urgency=low
+
+  * cpufreq-detect.sh: use p4-clockmod for 'Intel(R) Celeron(R)
+    M processor'.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 18 Apr 2006 19:10:00 +0200
+
+grml-scripts (0.7-7) unstable; urgency=low
+
+  * netcardconfig: merged with latest Kanotix version.
+    Now /etc/network/interfaces is used for wpa-supplicant
+    as suggested by Debian upstream. Some further improvements
+    in WPA and wireless handling.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 18 Apr 2006 18:17:47 +0200
+
+grml-scripts (0.7-6) unstable; urgency=low
+
+  * grml-lang: rename 'en' to 'us' as this is much more consistent.
+    Improved error message output.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 15 Apr 2006 11:26:03 +0200
+
+grml-scripts (0.7-5) unstable; urgency=low
+
+  * grml-lang: fixed the 'line 62: return: can only `return from a
+    function or sourced script' problem.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 15 Apr 2006 10:41:05 +0200
+
+grml-scripts (0.7-4) unstable; urgency=low
+
+  * Updated lesspipe.sh to new upstream version 1.53.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 11 Apr 2006 15:20:01 +0200
+
+grml-scripts (0.7-3) unstable; urgency=low
+
+  * ath-switcher: Fixed installation command for madwifi-ng-modules.
+    Updated $LAST_LOAD_OF_ATH_LINE as suggested by Spida. Thanks!
+  * Added symlink for ath-switcher manpage.
+
+ -- Michael Prokop <mika@grml.org>  Fri,  7 Apr 2006 18:36:52 +0200
+
+grml-scripts (0.7-2) unstable; urgency=low
+
+  * Bash does not like "local" inside functions, fixed in bt-hid.
+  * ath-switcher: don't execute anything if no Atheros chip is
+    present.
+
+ -- Michael Prokop <mika@grml.org>  Fri,  7 Apr 2006 13:16:51 +0200
+
+grml-scripts (0.7-1) unstable; urgency=low
+
+  * New grml version.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  6 Apr 2006 16:19:53 +0200
+
+grml-scripts (0.6-31) unstable; urgency=low
+
+  * Added ath-switcher.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  6 Apr 2006 14:04:05 +0200
+
+grml-scripts (0.6-30) unstable; urgency=low
+
+  * Fixed nroff problem in manpage (thanks for reporting, Jimmy).
+  * Improved documentation of noeject/noprompt in manpage.
+
+ -- Michael Prokop <mika@grml.org>  Wed,  5 Apr 2006 00:10:49 +0200
+
+grml-scripts (0.6-29) unstable; urgency=low
+
+  * And one more typo fix in manpage (thanks again, Peter Czyz).
+
+ -- Michael Prokop <mika@grml.org>  Mon,  3 Apr 2006 18:25:54 +0200
+
+grml-scripts (0.6-28) unstable; urgency=low
+
+  * Fixed another typo in manpage (thanks again, Peter Czyz).
+
+ -- Michael Prokop <mika@grml.org>  Mon,  3 Apr 2006 18:13:41 +0200
+
+grml-scripts (0.6-27) unstable; urgency=low
+
+  * Fixed typo in manpage (thanks, Peter Czyz).
+
+ -- Michael Prokop <mika@grml.org>  Mon,  3 Apr 2006 18:04:00 +0200
+
+grml-scripts (0.6-26) unstable; urgency=low
+
+  * Applied patch by Gebi to improve programs and Makefile in
+    compile/ - thanks!
+
+ -- Michael Prokop <mika@grml.org>  Fri, 31 Mar 2006 22:36:51 +0200
+
+grml-scripts (0.6-25) unstable; urgency=low
+
+  * Adjusted NO_IFACE_MSG_LEN in ip-screen for new "not available"
+    message.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 30 Mar 2006 23:09:37 +0200
+
+grml-scripts (0.6-24) unstable; urgency=low
+
+  * Reduced "not available" messages in cpu-screen and ip-screen.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 28 Mar 2006 11:01:46 +0200
+
+grml-scripts (0.6-23) unstable; urgency=low
+
+  * We don't have to modify the route in grml-vpnc-tugraz anymore.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 28 Mar 2006 10:02:50 +0200
+
+grml-scripts (0.6-22) unstable; urgency=low
+
+  * netcardconfig: Check whether $NETDEVICES is already set, otherwise
+    search for network devices. This allows us to use netcardconfig
+    through 'NETDEVICES=foobar netcardconfig' on systems with
+    persistent NIC interface names (not using the default NIC names).
+
+ -- Michael Prokop <mika@grml.org>  Sun, 26 Mar 2006 23:56:40 +0200
+
+grml-scripts (0.6-21) unstable; urgency=low
+
+  * We don't need any output to stdout in cpufreq-detect.sh.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 24 Mar 2006 23:35:59 +0100
+
+grml-scripts (0.6-20) unstable; urgency=low
+
+  * Added cpufreq-detect.sh for the new config_cpu() in
+    grml-autoconfig.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 24 Mar 2006 11:19:51 +0100
+
+grml-scripts (0.6-19) unstable; urgency=low
+
+  * Added support for /etc/release_info to zsh-login. Sound
+    output if any of the accessibility related bootoptions
+    found.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 23 Mar 2006 12:06:57 +0100
+
+grml-scripts (0.6-18) unstable; urgency=low
+
+  * dpkg-divert sucks. Thanks to Michael Sucha for hint that
+    egrep/fgrep was missing since last update. Fixed that.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 19 Mar 2006 01:11:43 +0100
+
+grml-scripts (0.6-17) unstable; urgency=low
+
+  * Updated clean target in debian/rules.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 17 Mar 2006 20:25:01 +0100
+
+grml-scripts (0.6-16) unstable; urgency=low
+
+  * Updated grml-vpnc-tugraz (use vpnc-connect now).
+
+ -- Michael Prokop <mika@grml.org>  Thu, 16 Mar 2006 16:43:49 +0100
+
+grml-scripts (0.6-15) unstable; urgency=low
+
+  * Updated make_chroot_jail to latest upstream version, fixes
+    the login-problem.
+
+ -- Michael Prokop <mika@grml.org>  Wed,  1 Mar 2006 23:04:31 +0100
+
+grml-scripts (0.6-14) unstable; urgency=low
+
+  * Upps, forgot to mention in the previous changelog entry that
+    grml-setlang has been renamed to grml-lang because the LC/LANG
+    stuff does not work as intented (therefor we don't have to
+    start another zsh instance via grml-lang alias in /etc/zsh/zshrc).
+  * Adjusted Build-Depends, it's dietlibc-dev and not dietlibc of
+    course (thanks, gebi).
+
+ -- Michael Prokop <mika@grml.org>  Sat, 25 Feb 2006 18:04:33 +0100
+
+grml-scripts (0.6-13) unstable; urgency=low
+
+  * Updated grml-pptp-vcgraz: write initscript /etc/init.d/pptp-vcgraz
+    instead of /etc/init.d/pptp, provide usage-information, status-
+    option and slightly improved file handling.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 25 Feb 2006 00:06:47 +0100
+
+grml-scripts (0.6-12) unstable; urgency=low
+
+  * Updated grml-lock. Improved security via not using tmpfile.
+  * Updated grml-slrn. Make dialog boxes larger...
+
+ -- Michael Prokop <mika@grml.org>  Thu, 23 Feb 2006 15:36:35 +0100
+
+grml-scripts (0.6-11) unstable; urgency=low
+
+  * Updated grml-vpnc-tugraz. The gateway will change from 172.27.12.2
+    to 129.27.200.1 within the next days.
+
+ -- Michael Prokop <mika@grml.org>  Wed, 22 Feb 2006 13:15:21 +0100
+
+grml-scripts (0.6-10) unstable; urgency=low
+
+  * Updated grml-vpnc-tugraz. Added usage information.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 21 Feb 2006 20:30:34 +0100
+
+grml-scripts (0.6-9) unstable; urgency=low
+
+  * Small fix in grml-nessus.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 19 Feb 2006 21:53:03 +0100
+
+grml-scripts (0.6-8) unstable; urgency=low
+
+  * Updated grml-nessus. Fixes parsing problem and adds use of
+    nessus-mkcert.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 18 Feb 2006 22:25:51 +0100
+
+grml-scripts (0.6-7) unstable; urgency=low
+
+  * Updated bt-audio, fixed some small issues - improved error
+    handling.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 18 Feb 2006 18:59:01 +0100
+
+grml-scripts (0.6-6) unstable; urgency=low
+
+  * Oh, forgot to add cpu-screen. ;-) Adjusted format of output
+    of cpu-screen as well.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 12 Feb 2006 00:29:19 +0100
+
+grml-scripts (0.6-5) unstable; urgency=low
+
+  * Implemented cpu-screen in C now. Renamed cpu-screen
+    to cpu-screen.sh.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 11 Feb 2006 23:15:43 +0100
+
+grml-scripts (0.6-4) unstable; urgency=low
+
+  * Compile ip-screen with diet.
+  * Added dietgcc and gcc to build-depends.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 11 Feb 2006 00:55:32 +0100
+
+grml-scripts (0.6-3) unstable; urgency=low
+
+  * Added get_tw_cli.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  9 Feb 2006 12:22:04 +0100
+
+grml-scripts (0.6-2) unstable; urgency=low
+
+  * Fixed typo (it's hcid and not hicd) in bt-hid.
+  * Added check for root permissions to bt-hid.
+  * First version of bt-audio.
+  * Adjusted make_chroot_jail in manpage (removed the .sh).
+
+ -- Michael Prokop <mika@grml.org>  Wed,  1 Feb 2006 20:08:41 +0100
+
+grml-scripts (0.6-1) unstable; urgency=low
+
+  * The 'get your winterschlapfn' release.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 21 Jan 2006 14:03:44 +0100
+
+grml-scripts (0.5-36) unstable; urgency=low
+
+  * Applied patch for netcardconfig, contributed by
+    Wolfgang Karall (thanks a lot!):
+    - reread passphrase correctly if reconfiguring
+    - handle backslashes in passphrase correctly
+    - kill wpa_supplicant on ifdown
+
+ -- Michael Prokop <mika@grml.org>  Fri, 20 Jan 2006 10:25:10 +0100
+
+grml-scripts (0.5-35) unstable; urgency=low
+
+  * Fixed some more $VARIABLES handling in several scripts.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 15 Jan 2006 22:50:39 +0100
+
+grml-scripts (0.5-34) unstable; urgency=low
+
+  * Updated grml-pptp-inode (thanks, gebi!).
+
+ -- Michael Prokop <mika@grml.org>  Sun, 15 Jan 2006 18:37:36 +0100
+
+grml-scripts (0.5-33) unstable; urgency=low
+
+  * Let's quote the $VARIABLES in some grml-* scripts.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 15 Jan 2006 16:31:36 +0100
+
+grml-scripts (0.5-32) unstable; urgency=low
+
+  * Fixed problem with $USERNAME in suspenduser_gui.sh.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 12 Jan 2006 22:17:44 +0100
+
+grml-scripts (0.5-31) unstable; urgency=low
+
+  * Slightly improved error handling of bt-hid.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 12 Jan 2006 09:55:51 +0100
+
+grml-scripts (0.5-30) unstable; urgency=low
+
+  * Made grml-screen dash-compatible.
+
+ -- Michael Prokop <mika@grml.org>  Sun,  8 Jan 2006 15:30:12 +0100
+
+grml-scripts (0.5-29) unstable; urgency=low
+
+  * Updated make_chroot_jail once more (thanks, Wolfgang Fuschlberger!).
+
+ -- Michael Prokop <mika@grml.org>  Sat,  7 Jan 2006 17:21:22 +0100
+
+grml-scripts (0.5-28) unstable; urgency=low
+
+  * Fixed prepare_ramdisk.sh:
+    - Removed size-option of prepare_ramdisk.sh as it causes problems.
+    - Adjusted info text as well (it's not a tmpfs but a ramdisk).
+    - Hmpf. Only losetup of loop-aes-utils knows about the '-a' option.
+      Removed 'losetup -d ...' code therefor in the meanwhile.
+
+ -- Michael Prokop <mika@grml.org>  Fri,  6 Jan 2006 17:31:29 +0100
+
+grml-scripts (0.5-27) unstable; urgency=low
+
+  * Added prepare_ramdisk.sh and prepare_tmpfs.sh.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  5 Jan 2006 13:34:37 +0100
+
+grml-scripts (0.5-26) unstable; urgency=low
+
+  * Updated make_chroot_jail to latest upstream version (thanks
+    for information, Wolfgang Fuschlberger!).
+
+ -- Michael Prokop <mika@grml.org>  Wed,  4 Jan 2006 19:19:03 +0100
+
+grml-scripts (0.5-25) unstable; urgency=low
+
+  * Updated grml-info script for usage on grml-small.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 22 Dec 2005 01:46:37 +0100
+
+grml-scripts (0.5-24) unstable; urgency=low
+
+  * Adjusted xsay for use with wmiiplumb.
+
+ -- Michael Prokop <mika@grml.org>  Wed, 21 Dec 2005 20:39:11 +0100
+
+grml-scripts (0.5-23) unstable; urgency=low
+
+  * Mention grml-tips in welcome info in zsh-login.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 20 Dec 2005 17:24:06 +0100
+
+grml-scripts (0.5-22) unstable; urgency=low
+
+  * Integrate grml-vpnc-tugraz in grml-network.
+  * Added grml-terminalserver to grml-config-root.
+  * Removed network-setup (duplicate entry for grml-network)
+    in grml-config-root.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 20 Dec 2005 12:44:06 +0100
+
+grml-scripts (0.5-21) unstable; urgency=low
+
+  * Updated bt-hid: warn if running hidd was successfull but
+    no connection could be established.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 18 Dec 2005 20:32:48 +0100
+
+grml-scripts (0.5-20) unstable; urgency=low
+
+  * WTF is LC_MESSAGEWS in netcardconfig?
+    It should be LC_MESSAGES of course. Fixed that.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 18 Dec 2005 12:33:33 +0100
+
+grml-scripts (0.5-19) unstable; urgency=low
+
+  * Adjusted dialog window size in grml-postfix.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 16 Dec 2005 00:09:30 +0100
+
+grml-scripts (0.5-18) unstable; urgency=low
+
+  * Do not overwrite wpa-config file in netcardconfig (thx4hint, mabu!).
+
+ -- Michael Prokop <mika@grml.org>  Thu,  8 Dec 2005 17:05:28 +0100
+
+grml-scripts (0.5-17) unstable; urgency=low
+
+  * bt-hid: start hcid instead of bluez-utils. Added status cmdline
+    option.
+
+ -- Michael Prokop <mika@grml.org>  Mon,  5 Dec 2005 15:59:43 +0100
+
+grml-scripts (0.5-16) unstable; urgency=low
+
+  * Start bluez-utils through bt-hid.
+  * Split of grml-config: grml-config as main interface calling
+    grml-config-user and grml-config-root.
+
+ -- Michael Prokop <mika@grml.org>  Mon,  5 Dec 2005 11:14:55 +0100
+
+grml-scripts (0.5-15) unstable; urgency=low
+
+  * Added script bt-hid (connect human input device via bluetooth
+    to local system).
+
+ -- Michael Prokop <mika@grml.org>  Sun,  4 Dec 2005 23:50:04 +0100
+
+grml-scripts (0.5-14) unstable; urgency=low
+
+  * Improved code layout of grml-network, added program name to
+    title dialog interface.
+
+ -- Michael Prokop <mika@grml.org>  Sun,  4 Dec 2005 01:09:31 +0100
+
+grml-scripts (0.5-13) unstable; urgency=low
+
+  * Added grml-config (central config interface) [thx, Nico!].
+  * Added suspenduser_gui.sh (dialog interface for
+    suspenduser.sh) [thx, Nico!].
+
+ -- Michael Prokop <mika@grml.org>  Sat,  3 Dec 2005 23:02:52 +0100
+
+grml-scripts (0.5-12) unstable; urgency=low
+
+  * Fixed small parsing bug and improved infotext in script soundtest.
+
+ -- Michael Prokop <mika@grml.org>  Sat,  3 Dec 2005 16:12:37 +0100
+
+grml-scripts (0.5-11) unstable; urgency=low
+
+  * Oh, let's move python and ruby from depends to suggests. :)
+
+ -- Michael Prokop <mika@grml.org>  Thu,  1 Dec 2005 15:21:40 +0100
+
+grml-scripts (0.5-10) unstable; urgency=low
+
+  * Remove grml-network from Suggests as the package does not exist.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  1 Dec 2005 15:11:28 +0100
+
+grml-scripts (0.5-9) unstable; urgency=low
+
+  * Big update of debian/control so grml-scripts works "smoother"
+    on plain debian and grml-small.
+  * Updated script attach-screen [check for grml's screenrc and
+    use it if present. Don't run keychain if it's not preset].
+  * Updated grml-pptp-*-scripts [removed the zsh-specific stuff].
+  * Mention XF86*-scripts in manpage grml-scripts.
+  * Adjusted path for zsh in grml-info - now we lintian-clean again.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  1 Dec 2005 14:43:35 +0100
+
+grml-scripts (0.5-8) unstable; urgency=low
+
+  * Dropped support of $BROWSER in grml-info, it might break
+    X-startup via ~/.xinitrc which runs grml-info.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  1 Dec 2005 00:22:56 +0100
+
+grml-scripts (0.5-7) unstable; urgency=low
+
+  * Compile ip-screen with '-O2'.
+  * Updated script grml-info [use links on plain console,
+    w3m with no set $DISPLAY and dillo when $DISPLAY is set].
+
+ -- Michael Prokop <mika@grml.org>  Wed, 30 Nov 2005 20:45:50 +0100
+
+grml-scripts (0.5-6) unstable; urgency=low
+
+  * Added ip-screen for integration in GNU screen (thx, gebi!).
+
+ -- Michael Prokop <mika@grml.org>  Wed, 30 Nov 2005 00:10:51 +0100
+
+grml-scripts (0.5-5) unstable; urgency=low
+
+  * Added scripts for handling audio volume:
+    - XF86AudioLowerVolume
+    - XF86AudioMute
+    - XF86AudioRaiseVolume
+
+ -- Michael Prokop <mika@grml.org>  Sat, 12 Nov 2005 16:17:31 +0100
+
+grml-scripts (0.5-4) unstable; urgency=low
+
+  * Added script noprompt.
+  * Added script zsh-login.
+  * Updated manpage.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 10 Nov 2005 23:19:36 +0100
+
+grml-scripts (0.5-3) unstable; urgency=low
+
+  * Updated caps-ctrl - included patch by wuehlmaus which improves
+    compatibility on plain console. Thanks, wuehlmaus!
+
+ -- Michael Prokop <mika@grml.org>  Thu, 10 Nov 2005 22:57:01 +0100
+
+grml-scripts (0.5-2) unstable; urgency=low
+
+  * Added wm-ng, a wrapper script for fluxbox with some additional features.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  3 Nov 2005 15:33:20 +0100
+
+grml-scripts (0.5-1) unstable; urgency=low
+
+  * The grml 0.5 release - bump version therefore.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 23 Oct 2005 19:21:50 +0200
+
+grml-scripts (0.4-37) unstable; urgency=low
+
+  * Removed forgotten manpages of removed binaries.
+  * Added grml-saveconfig to suggests.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 23 Oct 2005 01:16:26 +0200
+
+grml-scripts (0.4-36) unstable; urgency=low
+
+  * Moved save-config, restore-config and mkpersistenthome
+    to package grml-saveconfig.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 23 Oct 2005 00:51:35 +0200
+
+grml-scripts (0.4-35) unstable; urgency=low
+
+  * Update of grml-pptp-xdsl-students (thanks, hecka!).
+
+ -- Michael Prokop <mika@grml.org>  Sat, 22 Oct 2005 09:49:37 +0200
+
+grml-scripts (0.4-34) unstable; urgency=low
+
+  * Redirect mke2fs output to /dev/null in mkpersistenthome.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 18 Oct 2005 23:59:49 +0200
+
+grml-scripts (0.4-33) unstable; urgency=low
+
+  * Removed unused variables in restore-config.
+  * Improved handling of $GRML_VERSION in save-config.
+  * Updated mkpersistenthome.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 18 Oct 2005 15:54:46 +0200
+
+grml-scripts (0.4-32) unstable; urgency=low
+
+  * Updated help information of save-config and restore-config.
+
+ -- Michael Prokop <mika@grml.org>  Mon, 17 Oct 2005 14:52:16 +0200
+
+grml-scripts (0.4-31) unstable; urgency=low
+
+  * Finished main work on restore-config.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 15 Oct 2005 23:22:20 +0200
+
+grml-scripts (0.4-30) unstable; urgency=low
+
+  * Added save-config and restore-config.
+    Knoppix based script saveconfig was dropped.
+    Notice: restore-config is still under development.
+  * Updated vmware-detect (use 'int main' to supress gcc warning).
+  * Added script findchanged.
+  * Added script grepedit -> http://bigasterisk.com/grepedit
+
+ -- Michael Prokop <mika@grml.org>  Thu, 13 Oct 2005 10:32:15 +0200
+
+grml-scripts (0.4-29) unstable; urgency=low
+
+  * Update of grml-network and netcardconfig by Marcel (thanks!).
+
+ -- Michael Prokop <mika@grml.org>  Wed, 12 Oct 2005 22:12:18 +0200
+
+grml-scripts (0.4-28) unstable; urgency=low
+
+  * New upstream release of make_chroot_jail and moved it from
+    /usr/bin/ to /usr/sbin/.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 27 Sep 2005 18:08:51 +0200
+
+grml-scripts (0.4-27) unstable; urgency=low
+
+  * Use 'set generate_message_id 0' in grml-slrn.
+  * Applied patch to grml-setlang by Tobias for supporting
+    'ch' in grml-lang (thanks!). Adjusted message for not-
+    supported languages.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 24 Sep 2005 23:12:56 +0200
+
+grml-scripts (0.4-26) unstable; urgency=low
+
+  * Use dh_link instead of manual symlink farm.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 24 Sep 2005 21:25:17 +0200
+
+grml-scripts (0.4-25) unstable; urgency=low
+
+  * Added logview by Joey Hess.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 16 Sep 2005 18:19:39 +0200
+
+grml-scripts (0.4-24) unstable; urgency=low
+
+  * Script soundtest should be located in /usr/bin/ of course and
+    not in /bin, upps.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  1 Sep 2005 12:22:16 +0200
+
+grml-scripts (0.4-23) unstable; urgency=low
+
+  * Added script soundtest for testing sound on grml-system.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  1 Sep 2005 12:02:10 +0200
+
+grml-scripts (0.4-22) unstable; urgency=low
+
+  * Added fgrep and egrep with fix for zsh (diverts original fgrep and
+    egrep).
+
+ -- Michael Prokop <mika@grml.org>  Thu, 18 Aug 2005 11:53:22 +0200
+
+grml-scripts (0.4-21) unstable; urgency=low
+
+  * Switched backed to browser w3m instead of links.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 14 Aug 2005 14:30:16 +0200
+
+grml-scripts (0.4-20) unstable; urgency=low
+
+  * Added urlgrep.awk (thanks to marcel!).
+
+ -- Michael Prokop <mika@grml.org>  Tue,  9 Aug 2005 16:05:51 +0200
+
+grml-scripts (0.4-19) unstable; urgency=low
+
+  * The 'we are lintian-clean'-release:
+    - debian/control: 'any' architecture but not 'all' (vmware probably
+      will not work on anything else than x86)
+    - modified /bin/zsh to /usr/bin/zsh for zsh-scripts
+    - added dash as dependency, removed bash (as it's an essential-package)
+  * Added symlinks for executables without own manpage pointing to 'man
+    grml-scripts'.
+  * Added script noeject. Use it via 'noeject <cmd>' (where <cmd>
+    is either reboot or halt) to avoid ejecting of CD-ROM and
+    prompting for it.
+
+ -- Michael Prokop <mika@grml.org>  Mon,  8 Aug 2005 21:20:05 +0200
+
+grml-scripts (0.4-18) unstable; urgency=low
+
+  * Removed acpi-screen as yacpi >= 1.3 supports it via 'yacpi -t'.
+
+ -- Michael Prokop <mika@grml.org>  Sun,  7 Aug 2005 21:51:21 +0200
+
+grml-scripts (0.4-17) unstable; urgency=low
+
+  * Added script service (wrapper script for /etc/init.d/-scripts,
+    use it e.g. via 'service postfix start').
+
+ -- Michael Prokop <mika@grml.org>  Sun,  7 Aug 2005 12:18:37 +0200
+
+grml-scripts (0.4-16) unstable; urgency=low
+
+  * Removed grml-hwinfo and sysdump, they got their own package
+    namend grml-hwinfo.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 28 Jul 2005 09:22:58 +0200
+
+grml-scripts (0.4-15) unstable; urgency=low
+
+  * Updated grml-start and grml-info: let's use links2 for
+    console instead of w3m (which again doesn't display images on
+    fb...).
+
+ -- Michael Prokop <mika@grml.org>  Tue, 26 Jul 2005 10:49:43 +0200
+
+grml-scripts (0.4-14) unstable; urgency=low
+
+  * New upstream release up lesspipe.sh (version 1.52).
+
+ -- Michael Prokop <mika@grml.org>  Wed, 20 Jul 2005 00:06:33 +0200
+
+grml-scripts (0.4-13) unstable; urgency=low
+
+  * Added apt-check-sigs (taken from http://people.debian.org/~ajt/apt-check-sigs).
+
+ -- Michael Prokop <mika@grml.org>  Fri,  1 Jul 2005 02:11:06 +0200
+
+grml-scripts (0.4-12) unstable; urgency=low
+
+  * Restore 'export' - it's important for GNU screen. grml.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 25 Jun 2005 12:13:49 +0200
+
+grml-scripts (0.4-11) unstable; urgency=low
+
+  * Removed 'export' of $USER in grml-init.
+  * Updated grml-screen (change dir to $HOME).
+  * Updated grml-init-screen (fixed 'export' and cd to $HOME).
+
+ -- Michael Prokop <mika@grml.org>  Sat, 25 Jun 2005 00:59:36 +0200
+
+grml-scripts (0.4-10) unstable; urgency=low
+
+  * Added scanmodem (taken from
+    http://linmodems.technion.ac.il/packages/scanModem.gz), conflicts with
+    old package scanmodem.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 11 Jun 2005 16:40:40 +0200
+
+grml-scripts (0.4-9) unstable; urgency=low
+
+  * Removed dependency ruby, added to suggests.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 10 Jun 2005 10:15:28 +0200
+
+grml-scripts (0.4-8) unstable; urgency=low
+
+  * Removed dependency grml-x, added to suggests.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 10 Jun 2005 09:44:08 +0200
+
+grml-scripts (0.4-7) unstable; urgency=low
+
+  * Fixed grml-screen for use with dash.
+
+ -- Michael Prokop <mika@grml.org>  Sun,  5 Jun 2005 23:15:09 +0200
+
+grml-scripts (0.4-6) unstable; urgency=low
+
+  * Updated manpage grml-scripts (fixed #16).
+  * Don't run nroff but ship manpages as they are.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 29 May 2005 11:21:43 +0200
+
+grml-scripts (0.4-5) unstable; urgency=low
+
+  * Removed grml-x, provide grml-x in it's own package!
+    Notice: grml-scripts depends on grml-x just too make sure
+    everyone installs grml-x. This will be changed in a few
+    days/weeks/...
+  * Removed mkxconf [we don't need it any more...].
+  * Updated grml-hwinfo [use hwinfo log=... instead of 1>...].
+
+ -- Michael Prokop <mika@grml.org>  Mon, 23 May 2005 23:41:06 +0200
+
+grml-scripts (0.4-4) unstable; urgency=low
+
+  * Added dpkg-rebuild (see
+    http://www.cs.duke.edu/~reynolds/projects/dpkg-rebuild).
+  * Added pong (see
+    http://www.cs.duke.edu/~reynolds/projects/pong.c).
+  * Added align (see
+    http://www.cs.duke.edu/~reynolds/projects/align.c).
+
+ -- Michael Prokop <mika@grml.org>  Sun, 22 May 2005 12:51:23 +0200
+
+grml-scripts (0.4-3) unstable; urgency=low
+
+  * Added dialog to dependencies.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 12 May 2005 19:55:43 +0200
+
+grml-scripts (0.4-2) unstable; urgency=low
+
+  * Removed some dependencies.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 12 May 2005 19:39:56 +0200
+
+grml-scripts (0.4-1) unstable; urgency=low
+
+  * Let's release it!
+
+ -- Michael Prokop <mika@grml.org>  Mon,  9 May 2005 13:45:59 +0200
+
+grml-scripts (0.3-44) unstable; urgency=low
+
+  * Updated saveconfig.
+  * Updated iimage to latest release.
+
+ -- Michael Prokop <mika@grml.org>  Sun,  8 May 2005 23:12:50 +0200
+
+grml-scripts (0.3-43) unstable; urgency=low
+
+  * Updated grml-pptp-xdsl-students [thanks, hecka!].
+  * Updated grml-vpnc-tugraz.
+
+ -- Michael Prokop <mika@grml.org>  Sun,  8 May 2005 20:25:47 +0200
+
+grml-scripts (0.3-42) unstable; urgency=low
+
+  * Updated grml-init-screen. 
+
+ -- Michael Prokop <mika@grml.org>  Sun,  8 May 2005 16:00:28 +0200
+
+grml-scripts (0.3-41) unstable; urgency=low
+
+  * Updated grml-hwinfo (some more error-handling, echo message
+    when running not as user root).
+  * Updated grml-nessus (we don't need the copying of files anymore
+    due to unionfs-support).
+  * Updated grml-pptp-xdsl-students (replaced example 'grml.g' with
+    'grml' because of new accounting system).
+
+ -- Michael Prokop <mika@grml.org>  Sun,  8 May 2005 12:06:36 +0200
+
+grml-scripts (0.3-40) unstable; urgency=low
+
+  * Removed .old-files (backup stuff).
+  * Updated grml-x (changed order of resolutions).
+  * Updated grml-postfix (removed postfix-tls hint, removed sudo).
+
+ -- Michael Prokop <mika@grml.org>  Sat,  7 May 2005 21:40:25 +0200
+
+grml-scripts (0.3-39) unstable; urgency=low
+
+  * Updated grml-lock (added support for locking X).
+
+ -- Michael Prokop <mika@grml.org>  Fri,  6 May 2005 12:41:23 +0200
+
+grml-scripts (0.3-38) unstable; urgency=low
+
+  * Added firevim (open file from firefox with vim).
+
+ -- Michael Prokop <mika@grml.org>  Tue,  3 May 2005 17:05:42 +0200
+
+grml-scripts (0.3-37) unstable; urgency=low
+
+  * Updated manpages for grml-scripts and grml-x.
+  * Added grml-init-screen (required for /etc/inittab).
+  * Added 'exec ...' to grml-screen, grml-init, grml-init-screen,
+    grml-start.
+  * Updated grml-network (DISPLAY='', added grml-vpnc-tugraz).
+
+ -- Michael Prokop <mika@grml.org>  Sun,  1 May 2005 21:26:09 +0200
+
+grml-scripts (0.3-36) unstable; urgency=low
+
+  * Updated grml-muttng (applied
+    <URL:http://user.cs.tu-berlin.de/~pdmef/mutt-ng/update-config.pl>).
+
+ -- Michael Prokop <mika@grml.org>  Fri, 29 Apr 2005 20:04:47 +0200
+
+grml-scripts (0.3-35) unstable; urgency=low
+
+  * Updated grml-vpnc-tugraz (tested at TUGraz).
+  * Updated grml-network (improved exit-handling).
+
+ -- Michael Prokop <mika@grml.org>  Wed, 27 Apr 2005 13:50:11 +0200
+
+grml-scripts (0.3-34) unstable; urgency=low
+
+  * Added exifinfo script
+    (<URL:http://www.shelldorado.com/scripts/cmds/exifinfo>).
+  * Added sysdump script
+    (<URL:http://club.black.co.at/david/hwdb/Sysfs/sysdump>).
+  * Updated grml-hwinfo (the "let's collect hwinfo"-release).
+  * Updated grml-scripts manpage.
+
+ -- Michael Prokop <mika@grml.org>  Mon, 25 Apr 2005 23:33:56 +0200
+
+grml-scripts (0.3-33) unstable; urgency=low
+
+  * Updated grml-vpnc-tugraz (provide config file as parameter to vpnc).
+  * Added twebgal script (create tiny webgallery using CSS-features)
+    [thanks, Worf!].
+
+ -- Michael Prokop <mika@grml.org>  Mon, 25 Apr 2005 00:39:14 +0200
+
+grml-scripts (0.3-32) unstable; urgency=low
+
+  * Added grml-vpnc-tugraz (not yet tested!).
+
+ -- Michael Prokop <mika@grml.org>  Mon, 25 Apr 2005 00:11:56 +0200
+
+grml-scripts (0.3-31) unstable; urgency=low
+
+  * Updated lesspipe.sh and code2color to latest upstream
+    version (1.50).
+  * Added script usbtree.
+  * Updated grml-x (change fbdev to vesa in help-text,
+    fixed vt-switching-problem).
+
+ -- Michael Prokop <mika@grml.org>  Fri, 22 Apr 2005 00:52:08 +0200
+
+grml-scripts (0.3-30) unstable; urgency=low
+
+  * Fixed grml-x (use hsyncval instead of hsyncvalue, *d'oh*).
+
+ -- Michael Prokop <mika@grml.org>  Thu, 21 Apr 2005 16:02:37 +0200
+
+grml-scripts (0.3-29) unstable; urgency=low
+
+  * Fixed xsay (missing quotes).
+
+ -- Michael Prokop <mika@grml.org>  Thu, 21 Apr 2005 12:29:53 +0200
+
+grml-scripts (0.3-28) unstable; urgency=low
+
+  * Added script xsay.
+  * Added (updated) netcardconfig and wlcardconfig
+    and their frontend grml-network (which also supports the
+    grml-pptp*-scripts) [thanks, Marcel Wichern!].
+
+ -- Michael Prokop <mika@grml.org>  Wed, 20 Apr 2005 22:31:55 +0200
+
+grml-scripts (0.3-27) unstable; urgency=low
+
+  * Updated cpu-screen (improved output).
+  * Updated grml-x (just some typos in output).
+
+ -- Michael Prokop <mika@grml.org>  Wed, 20 Apr 2005 00:06:49 +0200
+
+grml-scripts (0.3-26) unstable; urgency=low
+
+  * Updated grml-x (fix -hsync/-vsync options).
+
+ -- Michael Prokop <mika@grml.org>  Tue, 19 Apr 2005 15:35:47 +0200
+
+grml-scripts (0.3-25) unstable; urgency=low
+
+  * Updated grml-x (set XkbRules xorg and XkbVariant nodeadkeys for xorg,
+    reset_color for xfree86-common).
+
+ -- Michael Prokop <mika@grml.org>  Tue, 19 Apr 2005 11:47:27 +0200
+
+grml-scripts (0.3-24) unstable; urgency=low
+
+  * Updated grml-x (removed debug-info, removed invalid font-entries,
+    if detected resolution is 1024x768-only, then provide manual
+    settings) and manpage of grml-x.
+
+ -- Michael Prokop <mika@grml.org>  Mon, 18 Apr 2005 15:18:54 +0200
+
+grml-scripts (0.3-23) unstable; urgency=low
+
+  * Added nostart-option to manpage of grml-x.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 17 Apr 2005 20:13:11 +0200
+
+grml-scripts (0.3-22) unstable; urgency=low
+
+  * Added '-nostart'-option to grml-x.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 16 Apr 2005 13:56:44 +0200
+
+grml-scripts (0.3-21) unstable; urgency=low
+
+  * Fixed display-option of grml-x.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 15 Apr 2005 17:55:43 +0200
+
+grml-scripts (0.3-20) unstable; urgency=low
+
+  * Added '-help'-option to grml-x.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 12 Apr 2005 20:42:02 +0200
+
+grml-scripts (0.3-19) unstable; urgency=low
+
+  * Updated grml-x (let's try to provide /dev/input/mice in any case).
+
+ -- Michael Prokop <mika@grml.org>  Sun, 10 Apr 2005 12:37:48 +0200
+
+grml-scripts (0.3-18) unstable; urgency=low
+
+  * Updated grml-x (let's activate the force-option when detecting
+    manual options) and manpage for grml-x.
+  * Removed grml-x2 (hey, grml-x works and grml-x2 just breaks
+    things ;-)).
+
+ -- Michael Prokop <mika@grml.org>  Fri,  8 Apr 2005 15:22:00 +0200
+
+grml-scripts (0.3-17) unstable; urgency=low
+
+  * Now really added grml-x-manpage. 8-)
+
+ -- Michael Prokop <mika@grml.org>  Mon,  4 Apr 2005 14:10:27 +0200
+
+grml-scripts (0.3-16) unstable; urgency=low
+
+  * Fixed grml-x.
+
+ -- Michael Prokop <mika@grml.org>  Mon,  4 Apr 2005 09:09:34 +0200
+
+grml-scripts (0.3-15) unstable; urgency=low
+
+  * Updated grml-x for another devel-release.
+  * Added manpage for grml-x.
+
+ -- Michael Prokop <mika@grml.org>  Sun,  3 Apr 2005 23:28:37 +0200
+
+grml-scripts (0.3-14) unstable; urgency=low
+
+  * Big update of grml-x but still under development.
+  * Updated grml-hwinfo (not yet finished!).
+
+ -- Michael Prokop <mika@grml.org>  Sat,  2 Apr 2005 13:20:58 +0200
+
+grml-scripts (0.3-13) unstable; urgency=low
+
+  * Fixed grml-x.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 26 Mar 2005 12:02:01 +0100
+
+grml-scripts (0.3-12) unstable; urgency=low
+
+  * Updated grml-x (several improvements and fixes).
+
+ -- Michael Prokop <mika@grml.org>  Fri, 25 Mar 2005 20:51:07 +0100
+
+grml-scripts (0.3-11) unstable; urgency=low
+
+  * Updated grml-x (fixed HSYNC/VSYNC, prepare for usage with xorg).
+
+ -- Michael Prokop <mika@grml.org>  Thu, 24 Mar 2005 09:52:50 +0100
+
+grml-scripts (0.3-10) unstable; urgency=low
+
+  * Fixed grml-network [wrong entry in interfaces when chosing dhcp, thx
+    riesebie!].
+
+ -- Michael Prokop <mika@grml.org>  Tue, 22 Mar 2005 14:13:33 +0100
+
+grml-scripts (0.3-9) unstable; urgency=low
+
+  * The "another devel-ISO"-release.
+  * grml-x3 seems to work for "first public tests" - ergo:
+    - removed grml-x2
+    - renamed grml-x to grml-x2
+    - renamed grml-x3 to grml-x
+    -> Want to start X? Use grml-x.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 20 Mar 2005 22:39:40 +0100
+
+grml-scripts (0.3-8) unstable; urgency=low
+
+  * Updated grml-x3.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 20 Mar 2005 19:15:54 +0100
+
+grml-scripts (0.3-7) unstable; urgency=low
+
+  * Added grml-x3 (still under development).
+
+ -- Michael Prokop <mika@grml.org>  Sat, 19 Mar 2005 18:45:05 +0100
+
+grml-scripts (0.3-6) unstable; urgency=low
+
+  * Changed Architecture to all in debian/rules.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 19 Mar 2005 17:30:34 +0100
+
+grml-scripts (0.3-5) unstable; urgency=low
+
+  * Improved grml-network (use 'ifconfig -a' to detect not yet
+    configured devices).
+
+ -- Michael Prokop <mika@grml.org>  Sun, 13 Mar 2005 00:33:01 +0100
+
+grml-scripts (0.3-4) unstable; urgency=low
+
+  * Added vmware-detect.
+
+ -- Michael Prokop <mika@grml.org>  Sat, 12 Mar 2005 15:03:21 +0100
+
+grml-scripts (0.3-3) unstable; urgency=low
+
+  * Fixed fex ('unzip -v' did not uncompress files).
+
+ -- Michael Prokop <mika@grml.org>  Fri, 11 Mar 2005 22:12:12 +0100
+
+grml-scripts (0.3-2) unstable; urgency=low
+
+  * Improved info-screen inside grml-lock.
+  * Added grml-network (added ipcalc to Suggests).
+  * Updated cpu-screen.
+  * Extended debian/control description.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 11 Mar 2005 01:51:34 +0100
+
+grml-scripts (0.3-1) unstable; urgency=low
+
+  * The "hustenstopper" release - let's go public!
+  * Ok, rename grml-pptp-xdsl to grml-pptp-xdsl-students (because
+    the script only works for XDSL@students) [thanks, hecka!].
+
+ -- Michael Prokop <mika@grml.org>  Thu,  3 Mar 2005 23:09:56 +0100
+
+grml-scripts (0.2-25) unstable; urgency=low
+
+  * Added grml-lock (lock console).
+  * Updated fex.
+  * Removed grml-encrypt (I don't want the devel-release in release 0.3).
+  * Renamed grml-pptp* scripts, we now have:
+      - grml-pptp-inode
+      - grml-pptp-vcgraz
+      - grml-pptp-xdsl
+
+ -- Michael Prokop <mika@grml.org>  Wed,  2 Mar 2005 15:49:08 +0100
+
+grml-scripts (0.2-24) unstable; urgency=low
+
+  * Added tpp-devel (current svn-snapshot from tpp).
+
+ -- Michael Prokop <mika@grml.org>  Wed,  2 Mar 2005 12:45:26 +0100
+
+grml-scripts (0.2-23) unstable; urgency=low
+
+  * Added grml-pptp-xdsl-students (thanks, hecka!).
+  * Updated grml-muttng (improve config).
+
+ -- Michael Prokop <mika@grml.org>  Tue,  1 Mar 2005 00:26:21 +0100
+
+grml-scripts (0.2-22) unstable; urgency=low
+
+  * Updated cpu-screen [switch display of $CUR / $MHZ ].
+  * Updated mkxconf ('getBootParam xmodule').
+
+ -- Michael Prokop <mika@grml.org>  Mon, 28 Feb 2005 15:24:11 +0100
+
+grml-scripts (0.2-21) unstable; urgency=low
+
+  * Updated grml-info (don't use $BROWSER but hardcoded values).
+  * Updated grml-mutt (ask for account details as in grml-muttng).
+
+ -- Michael Prokop <mika@grml.org>  Mon, 28 Feb 2005 15:13:37 +0100
+
+grml-scripts (0.2-20) unstable; urgency=low
+
+  * Added grml-muttng.
+  * Added fex.
+  * Updated grml-mutt ('color attachment black white').
+
+ -- Michael Prokop <mika@grml.org>  Sun, 27 Feb 2005 14:54:54 +0100
+
+grml-scripts (0.2-19) unstable; urgency=low
+
+  * Added unbleach.pl.
+  * Updated mkxconf (use of 'hwinfo --gfxcard').
+
+ -- Michael Prokop <mika@grml.org>  Sat, 26 Feb 2005 23:34:24 +0100
+
+grml-scripts (0.2-18) unstable; urgency=low
+
+  * Added hgrep.sh.
+
+ -- Michael Prokop <mika@grml.org>  Mon, 21 Feb 2005 23:19:40 +0100
+
+grml-scripts (0.2-17) unstable; urgency=low
+
+  * Updated grml-x2.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 11 Feb 2005 19:31:22 +0100
+
+grml-scripts (0.2-16) unstable; urgency=low
+
+  * Updated mkxconf (let's set 1600x1200 as maximum)
+  * Updated grml-x and grml-x2.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 11 Feb 2005 14:28:38 +0100
+
+grml-scripts (0.2-15) unstable; urgency=low
+
+  * Updated cpu-screen (read /sys/...).
+
+ -- Michael Prokop <mika@grml.org>  Fri, 11 Feb 2005 13:30:26 +0100
+
+grml-scripts (0.2-14) unstable; urgency=low
+
+  * Another grml-bind update [by gebi].
+  * Updated cpu-screen (read /sys/...).
+
+ -- Michael Prokop <mika@grml.org>  Thu, 10 Feb 2005 09:31:13 +0100
+
+grml-scripts (0.2-13) unstable; urgency=low
+
+  * Fixed grml-bind for use with new sh-lib ('die' instead of 'warn').
+
+ -- Michael Prokop <mika@grml.org>  Thu, 10 Feb 2005 04:12:28 +0100
+
+grml-scripts (0.2-12) unstable; urgency=low
+
+  * Updated mkxconf ('head -1' for jimmy's box).
+
+ -- Michael Prokop <mika@grml.org>  Thu, 10 Feb 2005 00:29:40 +0100
+
+grml-scripts (0.2-11) unstable; urgency=low
+
+  * Added suspenduser.sh to sbin/.
+  * Updated grml-bind and man page of grml-bind.
+
+ -- Michael Prokop <mika@grml.org>  Tue,  8 Feb 2005 16:47:25 +0100
+
+grml-scripts (0.2-10) unstable; urgency=low
+
+  * Updated grml-x2 (echo warning if running from inside screen)
+
+ -- Michael Prokop <mika@grml.org>  Thu,  3 Feb 2005 20:46:27 +0100
+
+grml-scripts (0.2-9) unstable; urgency=low
+
+  * Fixed grml-x2.
+  * Fixed cpu-screen.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  3 Feb 2005 18:42:17 +0100
+
+grml-scripts (0.2-8) unstable; urgency=low
+
+  * Added grml-x2 (using new xconfiguration tool mkxconf).
+
+ -- Michael Prokop <mika@grml.org>  Wed,  2 Feb 2005 22:37:51 +0100
+
+grml-scripts (0.2-7) unstable; urgency=low
+
+  * acpi-screen should go to bin of course. (grml)
+  * updated acpi-screen code.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 30 Jan 2005 23:23:48 +0100
+
+grml-scripts (0.2-6) unstable; urgency=low
+
+  * Added acpi-screen (thanks to Nico Golde for coding!)
+    [notice: broken devel version]
+  * Added cpu-screen.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 30 Jan 2005 18:46:23 +0100
+
+grml-scripts (0.2-5) unstable; urgency=low
+
+  * Added mkxconf to sbin/. (devel-release!)
+  * Added grml-encrypt to bin/. (devel-release!)
+  * Added grml-init to bin/.
+  * Updated 'say' (provide usage information).
+  * Removed chown...$TTY-stuff in grml-mutt and grml-slrn
+    cause it's handled via grml-init from now on.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 30 Jan 2005 14:39:08 +0100
+
+grml-scripts (0.2-4) unstable; urgency=low
+
+  * Updated 'say' (use flite instead of festival by default).
+
+ -- Michael Prokop <mika@grml.org>  Fri, 28 Jan 2005 22:56:42 +0100
+
+grml-scripts (0.2-3) unstable; urgency=low
+
+  * Added PrintAnalyzer (generate some stats from cups page_log file)
+    to sbin/.
+  * Added tinyp2p.py to bin/.
+  * Added grml-pptp-xdsl to bin/.
+  * Moved grml-postfix, grml-pptp* from bin/ to sbin/.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 27 Jan 2005 10:46:10 +0100
+
+grml-scripts (0.2-2) unstable; urgency=low
+
+  * Fixed tty-settings for console on grml system in grml-mutt and
+    grml-slrn.
+
+ -- Michael Prokop <mika@grml.org>  Sun,  9 Jan 2005 23:01:58 +0100
+
+grml-scripts (0.2-1) unstable; urgency=low
+
+  * grml 0.2 release.
+  * Fixed spelling error in grml-nessus.
+  * Added additional information to english version of saveconfig
+    output.
+
+ -- Michael Prokop <mika@grml.org>  Sun,  9 Jan 2005 22:11:41 +0100
+
+grml-scripts (0.1-19) unstable; urgency=low
+
+  * Added mkpersistenthome to bin/.
+  * French translation in saveconfig by Alexander Prokop.
+
+ -- Michael Prokop <mika@grml.org>  Sun,  9 Jan 2005 16:28:34 +0100
+
+grml-scripts (0.1-18) unstable; urgency=low
+
+  * Updated manual page grml-scripts.
+
+ -- Michael Prokop <mika@grml.org>  Sun,  9 Jan 2005 14:49:25 +0100
+
+grml-scripts (0.1-17) unstable; urgency=low
+
+  * Added grepc to bin/.
+  * Added runit to bin/.
+  * Updated /etc/postfix/Makefile.
+  * Updated grml-nessus.
+
+ -- Michael Prokop <mika@grml.org>  Fri,  7 Jan 2005 10:46:30 +0100
+
+grml-scripts (0.1-16) unstable; urgency=low
+
+  * Added irclog2html-2.1.pl ->
+    http://perkypants.org/projects/irclog2html/
+    to bin/.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  6 Jan 2005 22:22:27 +0100
+
+grml-scripts (0.1-15) unstable; urgency=low
+
+  * Fixed color-setup-bug in grml-mutt and grml-slrn.
+  * Added grml-nessus to sbin/.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  6 Jan 2005 16:05:02 +0100
+
+grml-scripts (0.1-14) unstable; urgency=low
+
+  * Added ndiswrapper.sh to sbin/.
+
+ -- Michael Prokop <mika@grml.org>  Thu,  6 Jan 2005 11:17:02 +0100
+
+grml-scripts (0.1-13) unstable; urgency=low
+
+  * Added modemlink to sbin/.
+  * Added network-setup to sbin/.
+  * Added mkdosswapfile to sbin/.
+
+ -- Michael Prokop <mika@grml.org>  Sun,  2 Jan 2005 12:40:30 +0100
+
+grml-scripts (0.1-12) unstable; urgency=low
+
+  * Moved netcardconfig from bin/ to sbin/.
+  * Added wlcardconfig to sbin/.
+  * Removed script helpztags (due to fallback to older vim-version
+    which brings helpztags out of box).
+  * Adjusted shebang-line in script 'say'.
+
+ -- Michael Prokop <mika@grml.org>  Sat,  1 Jan 2005 15:45:57 +0100
+
+grml-scripts (0.1-11) unstable; urgency=low
+
+  * Added script 'search' by Jeffrey Friedl (it performs recursive
+    searches for strings, is fast and has many options).
+  * Added script 'find-text' (taken from Whoppix's find-sploits.pl).
+  * Added script 'findwaste' by David Coppit:
+    http://www.coppit.org/code/findwaste
+
+ -- Michael Prokop <mika@grml.org>  Sat,  1 Jan 2005 15:04:08 +0100
+
+grml-scripts (0.1-10) unstable; urgency=low
+
+  * Added script 'helpztags' (generate tags for Vim helpfiles).
+
+ -- Michael Prokop <mika@grml.org>  Thu, 30 Dec 2004 00:34:16 +0100
+
+grml-scripts (0.1-9) unstable; urgency=low
+
+  * Hidden typing of password in grml-postfix.
+
+ -- Michael Prokop <mika@grml.org>  Wed, 29 Dec 2004 23:02:00 +0100
+
+grml-scripts (0.1-8) unstable; urgency=low
+
+  * Added script 'say' (output via festival).
+
+ -- Michael Prokop <mika@grml.org>  Thu, 23 Dec 2004 11:49:52 +0100
+
+grml-scripts (0.1-7) unstable; urgency=low
+
+  * Removed grml-pine (pine sucks).
+
+ -- Michael Prokop <mika@grml.org>  Tue, 21 Dec 2004 20:22:46 +0100
+
+grml-scripts (0.1-6) unstable; urgency=low
+
+  * Updated wwwis from upstream.
+  * Cosmetic changes in grml-postfix.
+  * Improved grml-slrn and grml-mutt (--radiolist).
+
+ -- Michael Prokop <mika@grml.org>  Sat, 18 Dec 2004 00:10:34 +0100
+
+grml-scripts (0.1-5) unstable; urgency=low
+
+  * Updated iimage from upstream. 
+
+ -- Michael Prokop <mika@grml.org>  Thu, 16 Dec 2004 00:28:54 +0100
+
+grml-scripts (0.1-4) unstable; urgency=low
+
+  * Added grml-mutt, grml-slrn, grml-postfix and grml-pptp-inode.
+  * Removed Makefile and improved debian/rules.
+
+ -- Michael Prokop <mika@grml.org>  Sat,  4 Dec 2004 17:08:18 +0100
+
+grml-scripts (0.1-3) unstable; urgency=low
+
+  * Improved grml-x: now it takes additional arguments, for example:
+      grml-x wmi -- :9
+    to start wmi on tty9.
+  * Added dir2html.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 16 Nov 2004 13:09:07 +0100
+
+grml-scripts (0.1-2) unstable; urgency=low
+
+  * Added find-hidden-word-text and dir2html.
+
+ -- Michael Prokop <mika@grml.org>  Sun, 31 Oct 2004 11:55:27 +0100
+
+grml-scripts (0.1-1) unstable; urgency=low
+
+  * Added netcardconfig.
+  * Renamed make_chroot_jail.sh to make_chroot_jail
+
+ -- Michael Prokop <mika@grml.org>  Thu, 28 Oct 2004 22:24:08 +0200
+
+grml-scripts (0.1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Michael Prokop <mika@grml.org>  Fri, 17 Sep 2004 20:28:21 +0200
+
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..133a97c
--- /dev/null
@@ -0,0 +1,24 @@
+Source: grml-scripts
+Section: utils
+Priority: optional
+Maintainer: Michael Prokop <mika@grml.org>
+Build-Depends: debhelper (>= 4.0.0), dietlibc-dev
+Standards-Version: 3.7.2
+
+Package: grml-scripts
+Architecture: any
+Depends: dialog, perl, zsh, dash, w3m | links | links2, screen, console-tools | xbase-clients
+Suggests: ruby, python, grml-x, ipcalc, hwinfo, antiword, grml-etc, grml-rebuildfstab, grml-scanpartitions, grml-files, grml-hwinfo, grml-saveconfig, pptp-linux, flite, wmii, mutt | mutt-ng, slrn, grml-docs, grml-autoconfig (>= 0.5-10)
+Conflicts: scanmodem, grml-etc-core (<< 0.1-6)
+Description: some small scripts which should make life easier
+ Some scripts which should make life easier. For example:
+ code2color, grml-mutt, grml-muttng, grml-slrn,
+ iimage, lesspipe.sh make_chroot_jail.sh, sepdate.pl,
+ sepdate.rb, sepdate.sh*, wwwis.
+ .
+ Notice: not all the packages which are required in all the scripts
+ are in the "Depends:" line. If you want to get a full featured
+ grml-scripts-package install the packages from the 'Suggests' line
+ too or just use the grml(-large)-system.
+ .
+ For more details take a look at the manpage grml-scripts.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..c581bdc
--- /dev/null
@@ -0,0 +1,15 @@
+This package was debianized by Michael Prokop <mika@grml.org> on
+Fri, 17 Sep 2004 20:28:21 +0200.
+
+It was downloaded from http://grml.org/
+
+Upstream Author: Michael Prokop <mika@grml.org>
+
+Copyright:
+
+This packages contains several scripts from several people.
+Please see the copyright information in the scripts for more details.
+Scripts by the grml-team are licensed under GPL v2.
+
+On Debian GNU/Linux systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
diff --git a/debian/dirs b/debian/dirs
new file mode 100644 (file)
index 0000000..d53d4bb
--- /dev/null
@@ -0,0 +1,6 @@
+bin
+etc/grml
+etc/postfix
+usr/bin
+usr/sbin
+sbin
diff --git a/debian/docs b/debian/docs
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/debian/overrides b/debian/overrides
new file mode 100644 (file)
index 0000000..3356a03
--- /dev/null
@@ -0,0 +1,6 @@
+grml-scripts: shell-script-fails-syntax-check ./usr/bin/grml-lock
+grml-scripts: shell-script-fails-syntax-check ./usr/sbin/grml-nessus
+grml-scripts: shell-script-fails-syntax-check ./usr/sbin/grml-pptp-vcgraz
+grml-scripts: executable-not-elf-or-script ./usr/bin/tinyp2p.py
+grml-scripts: executable-not-elf-or-script ./usr/bin/wwwis
+grml-scripts: executable-not-elf-or-script ./usr/bin/exifinfo
diff --git a/debian/postinst b/debian/postinst
new file mode 100755 (executable)
index 0000000..15fdb44
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+# Filename:      postinst
+# Purpose:       postinst script for package grml-scripts
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mon Sep 18 16:12:57 CEST 2006 [mika]
+################################################################################
+
+set -e
+
+case "$1" in
+   configure)
+
+     [ -f /bin/egrep.dpkg-bak ] && mv /bin/egrep.dpkg-bak /bin/egrep
+     [ -f /bin/egrep.old      ] && rm /bin/egrep.old
+     [ -f /bin/fgrep.dpkg-bak ] && mv /bin/fgrep.dpkg-bak /bin/fgrep
+     [ -f /bin/fgrep.old      ] && rm /bin/fgrep.old
+
+     ;;
+
+   *)
+     exit 0
+esac
+
+exit 0
+
+## END OF FILE #################################################################
diff --git a/debian/preinst b/debian/preinst
new file mode 100755 (executable)
index 0000000..f8a7631
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Filename:      preinst
+# Purpose:       preinst script for package grml-scripts
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mon Sep 18 16:13:18 CEST 2006 [mika]
+################################################################################
+
+set -e
+
+case "$1" in
+   upgrade)
+
+     # remove (nowadays deprecated) "dpkg-divert"ion of [ef]grep
+     dpkg-divert --list /bin/egrep | grep grml-scripts && \
+     mv /bin/egrep /bin/egrep.old && \
+     cp /bin/egrep.original /bin/egrep.dpkg-bak && \
+     dpkg-divert --quiet --package grml-scripts --remove --rename --divert /bin/egrep.original /bin/egrep
+
+     dpkg-divert --list /bin/fgrep | grep grml-scripts && \
+     mv /bin/fgrep /bin/fgrep.old && \
+     cp /bin/fgrep.original /bin/fgrep.dpkg-bak && \
+     dpkg-divert --quiet --package grml-scripts --remove --rename --divert /bin/fgrep.original /bin/fgrep
+
+     ;;
+   *)
+     exit 0
+esac
+
+exit 0
+
+## END OF FILE #################################################################
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..f0bfd7e
--- /dev/null
@@ -0,0 +1,179 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+configure-stamp:
+       dh_testdir
+       # Add here commands to configure the package.
+
+       touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+       dh_testdir
+       cd $(CURDIR)/compile/ && make
+       touch build-stamp
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       rm -rf $(CURDIR)/debian/grml-scripts/
+       cd compile ; make clean
+
+       dh_clean
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       dh_installdirs
+
+       # Add here commands to install the package into debian/grml-scripts.
+       cp usr_bin/*         debian/grml-scripts/usr/bin/
+       cp usr_sbin/*        debian/grml-scripts/usr/sbin/
+       cp makefile.postfix  debian/grml-scripts/etc/postfix/Makefile
+       install -m 755 compile/align                  debian/grml-scripts/usr/bin/align
+       install -m 755 compile/cpu-screen             debian/grml-scripts/usr/bin/cpu-screen
+       install -m 755 compile/ip-screen              debian/grml-scripts/usr/bin/ip-screen
+       install -m 755 compile/gtf                    debian/grml-scripts/usr/bin/gtf
+       install -m 755 compile/pong                   debian/grml-scripts/usr/sbin/pong
+       install -m 755 compile/vmware-detect          debian/grml-scripts/usr/bin/vmware-detect
+       install -m 755 compile/dpkg_not_running       debian/grml-scripts/usr/sbin/dpkg_not_running
+       install -m 755 compile/reread_partition_table debian/grml-scripts/usr/sbin/reread_partition_table
+       install -m 644 script-functions               debian/grml-scripts/etc/grml/script-functions
+       install -m 644 net-functions                  debian/grml-scripts/etc/grml/net-functions
+       install -m 644 routersetup                    debian/grml-scripts/etc/grml/routersetup
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs
+       dh_installdocs
+       dh_installman manpages/grml-scripts.1 manpages/grml-bind.8 manpages/reread_partition_table.8 manpages/gtf.1 manpages/random-hostname.1 \
+       manpages/grml-setkeyboard.8 manpages/grml-setlang.8 manpages/getsf.1 manpages/grml-router.8 manpages/grml-ap.8 manpages/grml-bridge.8 \
+       manpages/grml-iptstate.8
+#      cp --no-dereference man/*.1.gz debian/grml-scripts/usr/share/man/man1/
+       dh_link /usr/sbin/blacklist /usr/sbin/unblacklist
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/align.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/apt-check-sigs.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/attach-screen.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/bincompare.pl.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/blacklist.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/bt-hid.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/bt-audio.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/caps-ctrl.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/cicqhist.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/code2color.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/code2html.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/cpu-screen.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/cpu-screen.sh.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/cpufreq-detect.sh.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/dir2html.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/dpkg_not_running.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/dpkg-rebuild.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/exifinfo.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/fex.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/findchanged.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/find-hidden-word-text.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/find-text.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/findwaste.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/firevim.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/get_tw_cli.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grepc.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grepedit.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-bind.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-config.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-config-root.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-config-user.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-hostname.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-info.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-init.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-init-screen.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-lock.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-mutt.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-muttng.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-nessus.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-network.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-postfix.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-pptp-inode.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-pptp-vcgraz.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-pptp-xdsl-students.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-screen.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-lang.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-resolution.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-slrn.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-start.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-tpm.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-vpnc-tugraz.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/hgrep.sh.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/iimage.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/ip-screen.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/irclog2html-2.1.pl.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/lesspipe.sh.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/logview.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/mailhops.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/make_chroot_jail.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/mkdosswapfile.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/modemlink.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/myip.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/ndiswrapper.sh.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/netcardconfig.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/noeject.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/noprompt.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/osd_server.py.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/pong.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/prepare_ramdisk.sh.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/prepare_tmpfs.sh.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/PrintAnalyzer.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/runit.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/say.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/scanmodem.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/search.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/sepdate.pl.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/sepdate.rb.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/sepdate.sh.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/service.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/soundtest.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/suspenduser.sh.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/suspenduser_gui.sh.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/tinyp2p.py.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/twebgal.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/unblacklist.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/unbleach.pl.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/urlgrep.awk.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/usbtree.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/vmware-detect.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/wm-ng.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/wwwis.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/xsay.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/XF86AudioLowerVolume.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/XF86AudioMute.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/XF86AudioRaiseVolume.1.gz
+       dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/zsh-login.1.gz
+       dh_strip
+       dh_compress
+       mkdir -p $(CURDIR)/debian/grml-scripts/usr/share/lintian/overrides/
+       cp -av debian/overrides $(CURDIR)/debian/grml-scripts/usr/share/lintian/overrides/grml-scripts
+       dh_fixperms
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/debian/substvars b/debian/substvars
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/makefile.postfix b/makefile.postfix
new file mode 100644 (file)
index 0000000..92aad2f
--- /dev/null
@@ -0,0 +1,20 @@
+# Makefile for postfix
+
+TARGETS = postmap alias reload
+
+restart:
+       /etc/init.d/postfix restart
+
+reload:
+       /etc/init.d/postfix reload
+
+postmap:
+#      postmap recipient_checks
+#      postmap regexp_table
+#      postmap sender_canonical
+       postmap virtual
+
+alias:
+       newaliases
+
+all: Makefile $(TARGETS)
diff --git a/manpages/getsf.1 b/manpages/getsf.1
new file mode 100644 (file)
index 0000000..ca9fb5f
--- /dev/null
@@ -0,0 +1,28 @@
+.TH getsf 1
+.SH "NAME"
+getsf \- download project from sourceforge.net
+.SH SYNOPSIS
+.B getsf <projectame-version.archive>
+.SH DESCRIPTION
+This manual page documents briefly the
+.B getsf
+command.
+.SH OPTIONS
+The first option is taken as the project's name which is downloaded via wget.
+You can specify the mirror which should be used via environment variable MIRROR.
+The default mirror is mesh (DE/germany).
+.SH USAGE EXAMPLES
+.TP
+.B getsf htop-0.6.3.tar.gz
+Download htop version 0.6.3 from default mirror (mesh).
+.TP
+.B getsf http://prdownloads.sourceforge.net/htop/htop-0.6.3.tar.gz
+Download htop version 0.6.3 from default mirror (mesh).
+.TP
+.B MIRROR=puzzle getsf http://prdownloads.sourceforge.net/htop/htop-0.6.3.tar.gz
+Download htop version 0.6.3 from mirror puzzle.
+.SH AUTHOR
+getsf was written by Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the Debian project (but may be used by others).
diff --git a/manpages/grml-ap.8 b/manpages/grml-ap.8
new file mode 100644 (file)
index 0000000..2daf402
--- /dev/null
@@ -0,0 +1,57 @@
+.TH grml-ap 8
+.SH "NAME"
+grml-ap \- set up your box as access point
+.SH SYNOPSIS
+.B grml-ap
+.RI " start|stop|restart|info "
+.SH DESCRIPTION
+This manual page documents briefly the
+.B grml-ap
+command.
+.SH NOTES
+grml-ap uses the capabilities of your WLAN cards driver. Therefore
+you need a card including drivers providing access point features.
+atheros-based cards using the madwifi[-ng] drivers are known to work
+very well.
+.SH CONFIGURATION
+Configure setup via configuration file /etc/grml/routersetup.
+The variable AP_ESSID sets the essid of the accesspoint, if it is unset the essid grml-ap will be used by default.
+The variable AP_ENC toggles the use of encryption; set it off (that is the default) if you do not want to use encryption at all or if you want to enable encryption set the encryption key via the AP_ENC variable.
+
+.SH USAGE
+
+On the server side (where running grml-ap):
+
+  ,----
+  | # grml-ap start
+  | # cat /etc/network/interfaces
+  | iface ap inet static
+  |   address 192.168.10.1
+  |   netmask 255.255.255.0
+  |   network 192.168.10.0
+  |   broadcast 192.168.10.255
+  | # ifup ath0=ap
+  | # grml-router start
+  `----
+
+On the client side (assuming eth0 is your WLAN device):
+
+  ,----
+  | # cat /etc/network/interfaces
+  | iface ap inet static
+  |   address 192.168.10.2
+  |   netmask 255.255.255.0
+  |   network 192.168.10.0
+  |   broadcast 192.168.10.255
+  |   gateway 192.168.10.1
+  | # ifup eth0=ap
+  `----
+  
+.SH SEE ALSO
+.BR grml-bridge (8),
+.BR grml-router (8).
+.SH AUTHOR
+grml-ap was written by Ulrich Dangel <schula@grml.org> and Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the Debian project (but may be used by others).
diff --git a/manpages/grml-bind.8 b/manpages/grml-bind.8
new file mode 100644 (file)
index 0000000..ace8688
--- /dev/null
@@ -0,0 +1,49 @@
+.TH grml\-bind 8 "2005-05-29" "grml-bind"
+.SH "NAME"
+grml\-bind \- a program to prepare a file on a read-only filesystem for writing
+.SH SYNOPSIS
+.B grml\-bind
+.RI [ OPTIONS ] " <file/directory you want to edit>"
+.SH DESCRIPTION
+grml-bind is a program to prepare a file on a read-only filesystem for writing.
+It copies the file to a ramdisk and mount --bind it back.
+Very usefull for distributions like grml.
+.SH OPTIONS
+.TP
+.B \-h
+Show summary of options.
+.TP
+.B \-c
+Create the file-mapping
+.TP
+.B \-r
+Remove the file-mapping
+.TP
+.B \-v
+Verbose (show what is going on)
+.TP
+.B \<>
+If no Option is given, -c (create) is assumed
+.SH EXAMPLES
+.TP 
+.B grml-bind -c /etc/inputrc
+The file /etc/inputrc will be copied to /ramdisk/grml-bind/inputrc and mounted back with --bind
+.TP
+.B grml-bind -r /etc/inputrc
+If you already unlocked /etc/inputrc (with grml-bind -c /etc/inputrc), then the mount will be removed and rm -r /ramdisk/grml-bind/inputrc will be executed
+.TP
+.B grml-bind -c /etc/vim
+Now you can edit your vim configuration.
+.TP
+.B grml-bind -rc /etc/vim
+To see what's going on
+.SH BUGS/LIMITATIONS
+.TP
+.B no hardlinks
+grml-bind can not work with hardlinks because grml-bind copies the files to another filesystem.
+So hardlinks do not work.
+.TP
+.B only one mapping with the same name
+grml-bind /a/b && grml-bind /c/b  (will not work)
+.SH AUTHOR
+This manual page was written by the grml-team. http://grml.org/ (c)Michael Gebetsroither <gebi@grml.org>
diff --git a/manpages/grml-bridge.8 b/manpages/grml-bridge.8
new file mode 100644 (file)
index 0000000..f16abac
--- /dev/null
@@ -0,0 +1,85 @@
+.TH grml-bridge 8
+.SH "NAME"
+grml-bridge \- set up your box as bridge
+.SH SYNOPSIS
+.B grml-bridge
+.RI " start|stop|restart|info "
+.SH DESCRIPTION
+This manual page documents briefly the
+.B grml-bridge
+command.
+.SH USAGE
+Configure setup via configuration file /etc/grml/routersetup.
+To specify which DEVICES should be bridged, use BRIDGE_DEVICES, e.g.
+
+  BRIDGE_DEVICES="eth0 eth1"
+
+would bridge device eth0 and eth1. 
+Note: The auto interface name is not allowed here!
+
+To specify the name of the bridge, use BRIDGE_NAME, e.g.
+
+  BRIDGE_NAME="br0"
+
+Note: this entry is optional, per default the name br0 is choosen.
+
+If you want do disable Spanning Tree Protocol (STP) on your bridge, just set BRIDGE_STP to no, e.g.
+
+  BRIDGE_STP="no"
+
+Per default stp is on.
+
+Example Configuration file:
+
+  ,----[ /etc/grml/routersetup ]
+  | # Bridges eth0 and ath0 together
+  | BRIDGE_DEVICES="eth0 ath0"
+  |
+  | # Bridge name is grml-bridge
+  | BRIDGE_NAME="grml-bridge"
+  |
+  | # Disable stp
+  | BRIDGE_STP="no"
+  `----
+
+Start the bridge:
+
+  ,----
+  | # grml-bridge start
+  `----
+
+Now, your bridging device is up and running. Now you have to set the ip address of
+your bridged devices to 0.0.0.0. You can do this with following command:
+
+  ,----
+  | source /etc/grml/routersetup
+  | for i in $BRIDGED_DEVICES ; do ifconfig $i 0.0.0.0 ; done
+  `----
+
+Now your bridge is working. If you want that your bridge is reachable, please
+give your bridge an ip adress. You can do this for example with
+
+  ,----
+  | ifconfig grml-bridge 192.168.0.1
+  `----
+
+Stop the bridge:
+
+  ,----
+  | # grml-bridge stop
+  `----
+
+Note, your devices do not have an ip address, so you have to give them an ip address. You can do this with
+
+  ,----
+  | ifconfig eth1 $IP_ADDR
+  `----
+
+.SH SEE ALSO
+.BR grml-ap (8),
+.BR grml-router (8).
+.SH AUTHOR
+grml-bridge was written by Ulrich Dangel <schula@grml.org> and Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the Debian project (but may be used by others).
diff --git a/manpages/grml-iptstate.8 b/manpages/grml-iptstate.8
new file mode 100644 (file)
index 0000000..203fa34
--- /dev/null
@@ -0,0 +1,24 @@
+.TH grml-iptstate 8
+.SH "NAME"
+grml-iptstate \- startup wrapper script around iptstate
+.SH SYNOPSIS
+.B grml-iptstate
+.SH DESCRIPTION
+This manual page documents briefly the
+.B grml-iptstate
+command.
+.SH OPTIONS
+grml-iptstate does not support any options.
+.SH PURPOSE OF grml-iptstate
+iptstate (a top-like display of IP Tables state table entries) requires
+a present kernel module named ip_conntrack, otherwise it does not start.
+To be able to autostart iptstate on grml (especially in live-cd mode) this
+wrapper prompts for loading ip_conntrack and starting iptstate afterwards.
+If the ip_conntrack is present already grml-iptstate automatically invokes
+iptstate, if the module is not yet ready you will be asked whether you want
+to load it (just answer with yes or no, by default yes will be assumed).
+.SH AUTHOR
+grml-iptstate was written by Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the Debian project (but may be used by others).
diff --git a/manpages/grml-router.8 b/manpages/grml-router.8
new file mode 100644 (file)
index 0000000..89f1467
--- /dev/null
@@ -0,0 +1,32 @@
+.TH grml-router 8
+.SH "NAME"
+grml-router \- set up your box as NAT-router
+.SH SYNOPSIS
+.B grml-router
+.RI " start|stop|restart|info "
+.SH DESCRIPTION
+This manual page documents briefly the
+.B grml-router
+command.
+.SH USAGE
+grml-router reads the configuration file /etc/grml/routerconfig and uses the
+variable OUTDEV for setting the WAN device. If OUTDEV is set to auto, the
+device with a default route entry is used.
+
+You have to set up a DNS-server server, or use the DNS-server provided by your
+provider.
+
+On the client(s) you have to specify the gateway manually, also specify a
+nameserver. You can run the following commands on the client:
+
+  route add default gw $IP_ADDRSS_OF_GW
+  echo "nameserver $IP_OF_NAMESERVER" >> /etc/resolv.conf
+
+.SH SEE ALSO
+.BR grml-ap (8),
+.BR grml-bridge (8).
+.SH AUTHOR
+grml-router was written by Ulrich Dangel <schula@grml.org> and Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the Debian project (but may be used by others).
diff --git a/manpages/grml-scripts.1 b/manpages/grml-scripts.1
new file mode 100644 (file)
index 0000000..6f5f393
--- /dev/null
@@ -0,0 +1,235 @@
+.\" Filename:      grml-scripts.1
+.\" Purpose:       man page for grml-scripts
+.\" Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+.\" Bug-Reports:   see http://grml.org/bugs/
+.\" License:       This file is licensed under the GPL v2.
+.\" Latest change: Die Sep 26 12:37:06 CEST 2006 [mika]
+.\"###############################################################################
+
+.\"###############################################################
+.TH grml\-scripts 1 "grml-scripts"
+.SH "NAME"
+grml\-scripts \- script collection for the grml distribution
+.\"#######################################################
+.SH "USER SCRIPTS"
+
+.SS align
+find out a platform's endianness, alignment rules, and type
+sizes. Moderately useful for porting stuff.
+.SS attach-screen
+attach to a running screen-session
+.SS bincompare.pl
+binary file similarity checking (using entropy)
+.SS caps-ctrl
+Switch keyboard settings of key known as "Caps-Lock" between
+using Caps-Lock either as control- or shift-key. Notice:
+running caps-ctrl on console requires root-permissions,
+running it in X window system works as normal user.
+.SS cicqhist
+create a human-readable version of centericq history
+.SS code2color
+convert a source code to syntax highlighted HTML
+.SS code2html
+convert code to html
+.SS cpu-screen
+output current / available cpu frequence (useful for integration into GNU screen)
+.SS cpufreq-detect.sh
+detect cpu type and set $MODULE to appropriate kernel module for cpufrequency scaling
+.SS dir2html
+create HTML-listing for a directory
+.SS exifinfo
+print EXIF information of an image file
+.SS fex
+extract archives via smart frontend
+.SS find-hidden-word-text
+find hidden text in MS Word documents
+.SS find-text
+search for text pattern in text file only
+.SS findwaste
+find good directories for archiving based on the average age
+of files (access time) in the directory and the directory size
+.SS firevim
+open a file from firefox with vim
+.SS get_tw_cli
+get 3ware RAID controller command line interface tool (tw_cli)
+.SS grepc
+grep for pattern and cut it
+.SS grml-bind
+make a readonly-file writeable (not necessary when using
+unionfs)
+.SS grml-config-user
+Configuration interface for user tasks on the grml system.
+.SS grml-hwinfo
+collect hardware information and write it to info.tar.bz2
+.SS grml-info
+start browser with documentation for grml
+.SS grml-init
+fix tty permissions and run screen and zsh (notice: not required for
+interactive usage but only for startup of grml system)
+.SS grml-lock
+lock virtual consoles
+.SS grml-mutt
+configuration script for mailclient mutt
+.SS grml-muttng
+configuration script for mailclient mutt-ng
+.SS grml-resolution
+change X resolution via a simple menu frontend
+.SS grml-screen
+start screen session and fix console permissions
+.SS grml-lang
+switch keyboard layout
+.SS grml-slrn
+configuration script for newsreader slrn
+.SS grml-start
+start browser with information page on grml
+.SS hgrep.sh
+highlight grep output
+.SS iimage
+create statical webgallery
+.SS ip-screen
+print ip address of configured network interfaces to stdout.
+.SS irclog2html-2.1.pl
+create html output of irc log files
+.SS lesspipe.sh
+wrapper for less
+.SS logview
+Log viewer program. Pass it parameters of the logs to view, or it will automatically view some.
+.SS mailhops
+shows the route of an Internet mail message
+.SS make_chroot_jail
+create chroot environment for a user
+.SS myip
+return IP address of running system on stdout (requires network access)
+.SS osd_server.py
+Listen for incoming messages on a specific port and print
+them via osd_cat.
+.SS runit
+prompt for command via Xdialog and execute it afterwards
+.SS say
+wrapper for festival to use the text to speech system
+.SS search
+perl script by Jeffrey Friedl - a combo of find and grep
+.SS sepdate.pl sepdate.rb sepdate.sh
+"endless september"
+.SS soundtest
+Test sound on your grml system via playing a ogg-file.
+Provide the files you want to play as arguments,
+adjust player which should be used for playing the files
+via environment variable PLAYER. Calling the script without
+any arguments will play the default file via ogg123.
+.SS sysdump
+dump /sys to a textformat
+.SS tinyp2p.py
+a functional peer-to-peer file sharing application, written in
+fifteen lines of code, in the Python programming language
+.SS twebgal
+create a tiny webgallery using CSS-features
+.SS unbleach.pl
+replace all the unsighted unprintable characters
+bleached out of your source, useful for really
+dirty perl programs
+.SS urlgrep.awk
+print http|ftp|rstp|mms:// text entries in text.
+.SS usbtree
+Reads /proc/bus/usb/devices and selectively lists and/or interprets it.
+.SS wwwis
+read in an HTML file and insert 'HEIGHT=### WIDTH=###' directives into the inlined images used in the file
+.SS XF86AudioLowerVolume
+Lower audio volume.
+.SS XF86AudioMute
+Mute and - if run again - restore audio settings.
+.SS XF86AudioRaiseVolume
+Raise audio volume.
+.SS xsay
+output X clipboard text via flite (soundsystem)
+.SS zsh-login
+Start zsh using login-option through exec.
+
+.SH "ADMIN SCRIPTS"
+
+.SS blacklist
+Blacklist module via module-init-tools (/etc/modprobe.d/grml).
+.SS bt-audio
+Connect audio bluetooth device (e.g. bluetooth headset) to local system.
+.SS bt-hid
+Connect human input device via bluetooth to local system.
+.SS dpkg_not_running
+Check whether Debian's package management (dpkg) is running.
+Returns 0 if it is not running and 1 if it is already running.
+.SS dpkg-rebuild
+rebuild your Debian dpkg/apt status file if it got
+corrupted by a system crash.
+.SS grml-config
+Central configuration interface to configure the grml system.
+.SS grml-config-root
+Configuration interface for admin tasks on the grml system.
+.SS grml-hostname
+Simple frontend to set hostname.
+.SS grml-nessus
+Prepare nessus for use on grml system.
+.SS grml-network
+Main interface to configure network setup / cards.
+Synopsis: 'grml-network'. Set environment variable NOCHECK
+to skip network status check. Run 'grml-network check' to
+execute network status check and exit immediately afterwards.
+.SS grml-postfix
+Configuration script to set up postfix on grml system for
+use with TLS.
+.SS grml-pptp-inode
+Connect via PPTP at ISP Inode.
+.SS grml-pptp-vcgraz
+Connect via PPTP in Virtual Campus Graz.
+.SS grml-pptp-xdsl-students
+Connect via PPTP at ISP Inode (XDSL@students).
+.SS grml-tpm
+Set up a system for use with TPM technology.
+.SS grml-vpnc-tugraz
+Connect to TU Graz network via vpnc.
+.SS grml-pptp-vcgraz
+Connect via PPTP in Virtual Campus Graz.
+.SS grml-pptp-xdsl-students
+Connect via PPTP at ISP Inode (XDSL@students).
+.SS grml-vpnc-tugraz
+Connect to TU Graz network via vpnc.
+.SS mkdosswapfile
+Create GRML swapfile on an existing DOS partition.
+.SS modemlink
+Start device drivers and set /dev/modem link in GRML.
+.SS ndiswrapper.sh
+NdisWrapper configuration script.
+.SS netcardconfig
+A very light-weight text-based network configuration tool.
+.SS noeject
+Wrapper script to avoid ejecting and prompting for CD removal when
+rebooting/halting system. Use it via 'noeject <cmd>', e.g. 'noeject reboot'
+to reboot system without ejecting CD and without prompting.
+.SS noprompt
+Wrapper script to avoid prompting for CD removal when rebooting/halting
+system. Use it via 'noprompt <cmd>', e.g. 'noprompt reboot' to reboot system
+without prompting.
+.SS pong
+Ping a class-C subnet in parallel without using a broadcast
+address. Useful for seeing which IPs are in use.
+.SS prepare_ramdisk.sh
+Set up a ramdisk.
+.SS prepare_tmpfs.sh
+Set up a tmpfs.
+.SS PrintAnalyzer
+Generate some stats from cups page_log file.
+.SS service
+Wrapper script for /etc/init.d/-scripts. Use it e.g. via 'service postfix start'.
+.SS suspenduser.sh
+Suspend a user account for the indefinite future.
+.SS unblacklist
+Remove blacklisted module from /etc/modprobe.d/grml.
+
+.SH "BUGS"
+Probably. Please report any bugs you find and report
+feedback and suggestions to the grml-team.
+See http://grml.org/bugs/ for further information.
+Thank you!
+
+.SH "COPYRIGHT"
+Copyright \(co 2004-2006 by the grml-team.
+.\"###### END OF FILE ##########################################################
+.\" vim:tw=60
diff --git a/manpages/grml-setkeyboard.8 b/manpages/grml-setkeyboard.8
new file mode 100644 (file)
index 0000000..43e729d
--- /dev/null
@@ -0,0 +1,25 @@
+.TH grml-setkeyboard 8
+.SH "NAME"
+grml-setkeyboard \- set keyboard layout system-wide on grml system via /etc/sysconfig/keyboard.
+.SH SYNOPSIS
+.B grml-setkeyboard
+.SH DESCRIPTION
+This manual page documents briefly the
+.B grml-setkeyboard
+command.
+.SH OPTIONS
+grml-setkeyboard does not support any options.
+.SH NOTES
+grml-setkeyboard does not affect the currently used keyboard layout, use grml-lang instead to temporarly change settings.
+Use loadkeys on the console and setxkbmap on X to modify keyboard layout manually.
+.SH USAGE EXAMPLES
+.TP
+.B grml-setkeyboard
+TODO
+.SH SEE ALSO
+.BR grml-setlang (8).
+.SH AUTHOR
+grml-setkeyboard was written by Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the Debian project (but may be used by others).
diff --git a/manpages/grml-setlang.8 b/manpages/grml-setlang.8
new file mode 100644 (file)
index 0000000..71433d4
--- /dev/null
@@ -0,0 +1,31 @@
+.TH grml-setlang 8
+.SH "NAME"
+grml-setlang \- set language system-wide on grml system
+.SH SYNOPSIS
+.B grml-setlang
+.RI " [ <language> ] "
+.SH DESCRIPTION
+This manual page documents briefly the
+.B grml-setlang
+command.
+.SH OPTIONS
+If you invoke grml-setlang without any further options you will get a
+dialog based configuration frontend.  If you invoke grml-setlang with one
+option, grml-setlang will take the first option as input for regenerating
+/etc/default/locale according to the definitions in
+/etc/grml/language-functions. If the provided option is not supported the
+default (en_US) will be taken.
+.SH USAGE EXAMPLES
+.TP
+.B grml-setlang de
+Write german environment variables LANGUAGE, LANG, LC_MESSAGES, COUNTRY, CHARSET and TZ into /etc/default/locales.
+.TP
+.B grml-setlang at-utf8
+Write austrian environment variables LANGUAGE, LANG, LC_MESSAGES, COUNTRY, CHARSET and TZ with unicode/utf8-support into /etc/default/locales.
+.SH SEE ALSO
+.BR grml-setkeyboard (8).
+.SH AUTHOR
+grml-setlang was written by Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the Debian project (but may be used by others).
diff --git a/manpages/gtf.1 b/manpages/gtf.1
new file mode 100644 (file)
index 0000000..6a4da0e
--- /dev/null
@@ -0,0 +1,34 @@
+.TH gtf 1
+.SH NAME
+gtf \- generate mode timings using the GTF Timing Standard
+.SH SYNOPSIS
+.B gtf
+.RI "x y refresh" " [ options ]"
+.SH DESCRIPTION
+This manual page documents briefly the
+.B gtf
+command.
+.SH OPTIONS
+The following options are available.
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-v, \-\-verbose
+Enable verbose printouts (traces each step of the computation).
+.TP
+.B \-f, \-\-fbmode
+Output an fbset(8)-style mode description.
+.TP
+.B \-x, \-\-xf86mode
+Output an XFree86-style mode description (this is the default if no mode description is requested).
+.SH USAGE EXAMPLE
+\fBgtf 1024 768 65\fP
+.PP
+Print modelines for resolution 1024x768 with refresh rate of 65.
+.SH AUTHOR
+gtf was written by Andy Ritger <aritger@nvidia.com>.
+Taken from http://osdn.dl.sourceforge.net/sourceforge/gtf/gtf.c
+.PP
+This manual page was written by #USERNAME# <#EMAIL#>,
+for the Debian project (but may be used by others).
diff --git a/manpages/random-hostname.1 b/manpages/random-hostname.1
new file mode 100644 (file)
index 0000000..1cf7b19
--- /dev/null
@@ -0,0 +1,20 @@
+.TH random-hostname 1
+.SH "NAME"
+random-hostname \- print random hostname to stdout
+.SH SYNOPSIS
+.B random-hostname
+.SH DESCRIPTION
+This manual page documents briefly the
+.B random-hostname
+command.
+.SH OPTIONS
+random-hostname does not support any options.
+.SH USAGE EXAMPLE
+.TP
+.B random-hostname
+Print a random hostname to stdout.
+.SH AUTHOR
+random-hostname was written by Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the Debian project (but may be used by others).
diff --git a/manpages/reread_partition_table.8 b/manpages/reread_partition_table.8
new file mode 100644 (file)
index 0000000..72d7fda
--- /dev/null
@@ -0,0 +1,26 @@
+.TH reread_partition_table 8
+.SH "NAME"
+reread_partition_table \- re-read partition table on Linux
+.SH SYNOPSIS
+.B reread_partition_table
+.RI " <partition> "
+.SH DESCRIPTION
+This manual page documents briefly the
+.B reread_partition_table
+command. reread_partition_table uses the BLKRRPART ioctl()
+to re-read a partition table on Linux. It is the same as
+running 'blockdev --rereadpt <device>' or 'partprobe'.
+.SH OPTIONS
+This program does not support any options.
+.SH USAGE EXAMPLE
+.TP
+.B reread_partition_table /dev/hda
+Reread partition table for disk /dev/hda.
+.SH SEE ALSO
+.BR cfdisk (8).
+.SH AUTHOR
+reread_partition_table was written by Michael Prokop
+<mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the Debian project (but may be used by others).
diff --git a/net-functions b/net-functions
new file mode 100644 (file)
index 0000000..a54676a
--- /dev/null
@@ -0,0 +1,30 @@
+# Filename:      net-functions
+# Purpose:       network related functions for use in shellscripts
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Don Okt 12 09:41:32 CEST 2006 [mika]
+################################################################################
+
+defaultGWDev() {
+  ip r s | awk '/^default/ {print $5}'
+}
+
+getLanDevices() {
+  ignore="vmnet lo sit $(brctl show | awk '{ if(NR >1 ) print  $1 }' | xargs)"
+  filter=$(for mask in $ignore; do echo -n '&& $1 !~ /^'$mask/; done)
+  awk 'FS=":" {gsub(" ", ""); if(NR>2 '"$filter"' )  print $1 | "sort" } ' /proc/net/dev
+}
+
+getWlanDevices() {
+  awk 'FS=":" {gsub(" ", ""); if(NR>2 ) print $1 | "sort" } ' /proc/net/wireless
+}
+
+# getLanDriver deviceName
+getLanDriver() {
+  DEVICE="$1"
+  echo $DEVICE | grep -q ath && DEVICE=$(echo $DEVICE | sed 's/ath/wifi/')
+  ethtool -i $DEVICE 2>/dev/null | awk '/^driver:/{print $2}'
+}
+
+## END OF FILE #################################################################
diff --git a/routersetup b/routersetup
new file mode 100644 (file)
index 0000000..3beee06
--- /dev/null
@@ -0,0 +1,28 @@
+# Filename:      /etc/grml/routersetup
+# Purpose:       configuration file for grml-router, grml-bridge and grml-ap
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Don Okt 12 10:50:51 CEST 2006 [mika]
+################################################################################
+
+# configuration for grml-router:
+# IPTABLES=/sbin/iptables       # the iptables binary
+OUTDEV='auto'                   # outgoing device [auto|default|eth0|...]
+
+# configuration for grml-bridge:
+# BRCTL=/usr/sbin/brctl         # the brctl binary
+BRIDGE_NAME='br0'               # name used for the bridge
+BRIDGE_DEVICES='eth0 eth1'      # the devices used for bilding the bridge
+STP='on'                        # enable STP (Spanning-Tree Protocol)? on|off
+BRIDGE_CONFIG='DHCP'            # Use DHCP, Fixed IP or Ipless? DHCP|FIXED|NONE
+BRIDGE_IP="192.168.1.1/24"      # ip address used for bridge
+
+# configuration for grml-ap:
+# AP_DEVICE='wlan0'             # device used as access point
+# AP_ESSID='grml-ap'            # set essid of accesspoint, by default (if unset) it's grml-ap
+# AP_ENC='secretkey'            # use encryption? 'off' deactivates encryption
+                                # (default), any other value is used as WEP encr. key
+# ATH_MODE=2                    # mode for ath device
+
+## END OF FILE #################################################################
diff --git a/script-functions b/script-functions
new file mode 100644 (file)
index 0000000..bc30ca5
--- /dev/null
@@ -0,0 +1,145 @@
+# Filename:      /etc/grml/script-functions
+# Purpose:       some often used functions for use in shellscripts
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Sep 16 13:08:16 CEST 2006 [mika]
+################################################################################
+
+# {{{ set default PATH
+setpath(){
+  export PATH=${PATH:-'/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin'}
+}
+# }}}
+
+# {{{ check for root-permissions
+check4root(){
+  if [ "$UID" != 0 ] ; then
+    echo 1>&2 "Error: please run this script with uid 0 (root)." ; return 1
+  fi
+}
+# }}}
+
+# {{{ check for user permissions
+check4user(){
+  if [ "$UID" == 0 ] ; then
+    echo 1>&2 "Error: please do not run this script with uid 0 (root)." ; return 1
+  fi
+}
+# }}}
+
+# {{{ check for running zsh
+iszsh(){
+  if ! [ -z "$ZSH_VERSION" ] ; then
+    return 0
+  else
+    return 1
+  fi
+}
+# }}}
+
+# {{{ check for (X)dialog
+setdialog(){
+  if [ -n "$DISPLAY" ] ; then
+     [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog" && export XDIALOG_HIGH_DIALOG_COMPAT=1
+  else
+     [ -x /usr/bin/dialog ] && DIALOG='dialog' || ( echo 1>&2 "dialog not available" ; return 1 )
+  fi
+}
+# }}}
+
+# {{{ check for availability of program(s)
+check4progs(){
+  local RC=''
+  for arg in $* ; do
+    type -p $arg >/dev/null 2>&1 || RC="$arg"
+  done
+  if [ -n "$RC" ] ; then
+     echo "$RC not installed"
+     return 1
+  fi
+}
+# }}}
+
+# {{{ simple shell grep
+stringinfile(){
+  case "$(cat $2)" in *$1*) return 0;; esac
+  return 1
+}
+# }}}
+
+# {{{ simple shell grep for strings
+stringinstring(){
+  case "$2" in *$1*) return 0;; esac
+  return 1
+}
+# }}}
+
+# {{{ reread boot command line; echo last parameter's argument or return false.
+getbootparam(){
+  stringinstring " $1=" /proc/cmdline || return 1
+  result="${/proc/cmdline##*$1=}"
+  result="${result%%[   ]*}"
+  echo "$result"
+  return 0
+}
+# }}}
+
+# {{{ check boot commandline for specified option
+checkbootparam(){
+  stringinstring " $1" /proc/cmdline
+  return "$?"
+}
+# }}}
+
+# {{{ check whether $1 is yes
+checkvalue(){
+  if [ "$1" = "yes" -o "$1" = "YES" ] ; then
+    return 0
+  else
+    return 1
+  fi
+}
+# }}}
+
+# {{{ grml specific checks
+isgrml(){
+  [ -f /etc/grml_version ] && return 0 || return 1
+}
+
+grmlversion(){
+ cat /etc/grml_version
+}
+
+isgrmlcd(){
+  [ -f /etc/grml_cd ] && return 0 || return 1
+}
+
+isgrmlhd(){
+  [ -f /etc/grml_cd ] && return 1 || return 0
+}
+
+checkgrmlsmall(){
+  grep -q small /etc/grml_version 2>/dev/null && return 0 || return 1
+}
+# }}}
+
+# {{{ filesystems (proc, pts, sys)
+mount_proc(){
+  check4root || return 1
+  [ -f /proc/version ] || mount -t proc /proc /proc 2>/dev/null
+}
+
+mount_pts(){
+  check4root || return 1
+  stringinfile "/dev/pts" /proc/mounts || mount -t devpts /dev/pts /dev/pts 2>/dev/null
+}
+
+mount_sys(){
+  check4root || return 1
+  [ -d /sys/devices ] || mount -t sysfs /sys /sys 2>/dev/null
+}
+# }}}
+
+## END OF FILE #################################################################
+# vim:foldmethod=marker tw=80 ai expandtab shiftwidth=2 tabstop=2
diff --git a/usr_bin/XF86AudioLowerVolume b/usr_bin/XF86AudioLowerVolume
new file mode 100755 (executable)
index 0000000..40ad441
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Filename:      XF86AudioLowerVolume
+# Purpose:       lower audio volume
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Die Aug 01 01:18:07 CEST 2006 [mika]
+################################################################################
+
+. /etc/grml/lsb-functions
+
+aumix -v -5 ; RC=$?
+
+if ! [ "$RC" = 0 ] ; then
+   eend "Error running 'aumix -v -5'" ; eend 1
+fi
+
+VOLUME=$(aumix -q | awk -F, '/vol/ {print $2}')
+
+if [ -n "$DISPLAY" ] ; then
+  einfo "Lowered audio volume to${VOLUME}" ; eend $?
+  osd_cat -b percentage -P $VOLUME -d 2 -c orange -A center -p middle
+else
+  einfo "Lowered audio volume to${VOLUME}" ; eend $?
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/XF86AudioMute b/usr_bin/XF86AudioMute
new file mode 100755 (executable)
index 0000000..4f4151d
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Filename:      XF86AudioMute
+# Purpose:       mute and restore audio settings
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sun May 14 15:03:53 CEST 2006 [mika]
+################################################################################
+
+. /etc/grml/lsb-functions
+
+UNMUT="Sound unmuted"
+MUT="Sound muted"
+
+if [ -f ~/.aumixtmp ] ; then
+  amixer set PCM unmute &>/dev/null ; RC=$?
+  if [ -n "$DISPLAY" ] ; then
+    einfo "$UNMUT" ; eend $?
+      echo "$UNMUT" | \
+      osd_cat --delay=2 -c orange -A center -p middle -f "-misc-fixed-medium-r-normal-*-*-150-*-*-c-*-iso8859-15"
+  else
+    einfo "$UNMUT" ; eend $RC
+  fi
+  rm -f ~/.aumixtmp
+else
+  touch ~/.aumixtmp
+  amixer set PCM mute &>/dev/null ; RC=$?
+  if [ -n "$DISPLAY" ] ; then
+    einfo "$MUT" ; eend $RC
+      echo "$MUT" | \
+      osd_cat --delay=2 -c orange -A center -p middle -f "-misc-fixed-medium-r-normal-*-*-150-*-*-c-*-iso8859-15"
+  else
+    einfo "$MUT" ; eend $RC
+  fi
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/XF86AudioRaiseVolume b/usr_bin/XF86AudioRaiseVolume
new file mode 100755 (executable)
index 0000000..527c383
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Filename:      XF86AudioRaiseVolume
+# Purpose:       raise audio volume
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Die Aug 01 01:18:11 CEST 2006 [mika]
+################################################################################
+
+. /etc/grml/lsb-functions
+
+aumix -v +5 ; RC=$?
+
+if ! [ "$RC" = 0 ] ; then
+   eend "Error running 'aumix -v +5'" ; eend 1
+fi
+
+VOLUME=$(aumix -q | awk -F, '/vol/ {print $2}')
+
+if [ -n "$DISPLAY" ] ; then
+  einfo "Raised audio volume to${VOLUME}" ; eend $?
+  osd_cat -b percentage -P $VOLUME -d 2 -c orange -A center -p middle
+else
+  einfo "Raised audio volume to${VOLUME}" ; eend $RC
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/attach-screen b/usr_bin/attach-screen
new file mode 100755 (executable)
index 0000000..ba55fb5
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Filename:      attach-screen
+# Purpose:       multi-attach to GNU screen session, creating a new one if necessary
+# Authors:       (c) Phil Gregory <phil_g@pobox.com>, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       Taken from http://aperiodic.net/phil/configs/bin/attach-screen
+# Latest change: Thu Dec 01 14:30:24 CET 2005 [mika]
+################################################################################
+
+# -U option basically means "terminal does not have UTF-8 support"
+if [ "$1" == "-U" ]; then
+    unset LC_CTYPE
+fi
+
+# Bring in my ssh-agent, so screen will have it available in all windows.
+if [ -x /usr/bin/keychain ] ; then
+  keychain --nocolor --quiet ~/.ssh/id_rsa
+  . ~/.keychain/`hostname`-sh
+fi
+
+# Not a standard environment variable, but I need it for host-dependent
+# decisions in .screenrc.
+export HOST=`hostname`
+
+# multi-attach to main session, creating it if necessary.  exec to save a
+# process.
+[ -r /etc/grml/screenrc ] && SCREENRC='-c /etc/grml/screenrc'
+exec screen -S main -xRR $SCREENRC
+
+## END OF FILE #################################################################
diff --git a/usr_bin/bincompare.pl b/usr_bin/bincompare.pl
new file mode 100755 (executable)
index 0000000..3892547
--- /dev/null
@@ -0,0 +1,69 @@
+#!/usr/bin/perl
+# Filename:      bincompare.pl
+# Purpose:       Binary File Similarity Checking
+# Authors:       (C) Copyright 2004 Diomidis Spinellis
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       See notes by author (Diomidis Spinellis).
+# Latest change: Sam Okt 16 22:54:03 CEST 2004 [mika]
+################################################################################
+# See http://www.dmst.aueb.gr/dds/blog/20040319/index.html
+#
+# Original notes:
+# 
+# (C) Copyright 2004 Diomidis Spinellis
+#
+# Permission to use, copy, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted,
+# provided that the above copyright notice appear in all copies and that
+# both that copyright notice and this permission notice appear in
+# supporting documentation.
+#
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+# Return the entropy of the file passed as the argument
+sub
+entropy
+{
+        my($file) = @_;
+        my($i, $l);
+
+        # File length
+        $l = `wc -c $file`;
+        # File information (approximation)
+        $i = `bzip2 -c $file | wc -c`;
+        print STDERR "$0: warning file size exceeds bzip2 block size\n" if ($l > 900 * 1024);
+        return ($i / $l);
+}
+
+
+# Return the entropy of the two files passed as arguments
+sub
+entropy2
+{
+        my($file1, $file2) = @_;
+        my($oldrs) = ($/);
+        my($tmp) = ("/tmp/entropy.$$");
+
+        undef($/);
+        open(IN, $file1) || die "read from $file1: $!\n";
+        binmode(IN);
+        open(OUT, ">$tmp") || die "write to $tmp: $!\n";
+        print OUT <IN>;
+        open(IN, $file2) || die "read from $file2: $!\n";
+        binmode(IN);
+        print OUT <IN>;
+        close(IN);
+        close(OUT);
+        my($e) = (entropy($tmp));
+        unlink($tmp);
+        return ($e);
+}
+
+$#ARGV == 1 || die "Usage $0: file1 file2\n";
+
+printf("%.3g - Entropy of $ARGV[0]\n", $e0 = entropy($ARGV[0]));
+printf("%.3g - Entropy of $ARGV[1]\n", $e1 = entropy($ARGV[1]));
+printf("%.3g - Combined predicted entropy\n", ($e0 + $e1) / 2);
+printf("%.3g - Combined actual entropy\n", entropy2($ARGV[0], $ARGV[1]));
diff --git a/usr_bin/caps-ctrl b/usr_bin/caps-ctrl
new file mode 100755 (executable)
index 0000000..502b46c
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+# Filename:      caps-ctrl
+# Purpose:       switch setting of caps-control key (switch between ctrl + shift)
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sun Jan 15 22:45:27 CET 2006 [mika]
+################################################################################
+
+if [ -z "$DISPLAY" ] ; then
+ if [ "$UID" != 0 ] ; then
+   echo "Sorry, you need root permissions for running $0 on console
+using loadkeys. Run this program with root permissions. Exiting."
+   exit -1
+ fi
+ dumpkeys | grep -q '^keycode  58 = Caps_Lock' && \
+ ( echo "Caps lock mapped to shift-function. Switching caps lock key to control key."
+   echo $'keycode 58 = Control Control Control Control Control Control Control Control  Control  Control  Control  Control  Control  Control  Control\nkeycode 29 = Caps_Lock Caps_Lock Caps_Lock Caps_Lock Caps_Lock Caps_Lock Caps_Lock' | loadkeys
+ ) ||
+ ( echo "Caps lock mapped to control-function. Switching caps lock key to shift key."
+   echo $'keycode 58 = Caps_Lock Caps_Lock Caps_Lock Caps_Lock Caps_Lock Caps_Lock Caps_Lock Caps_Lock  Caps_Lock  Caps_Lock  Caps_Lock  Caps_Lock  Caps_Lock  Caps_Lock  Caps_Lock\nkeycode 29 = Control Control Control Control Control Control Control ' | loadkeys
+ )
+else
+ xmodmap -pm | grep -q 'control.*Caps_Lock' && \
+ ( echo "Caps lock mapped to control-function. Switching caps lock key to shift key."
+   xmodmap -e "add lock = Caps_Lock"
+   echo "clear Lock
+         keycode 66 = Shift_Lock
+         add Lock = Shift_Lock" | xmodmap -
+   echo "Problems? Try to run 'setxkbmap -option caps:shift' manually."
+ ) ||
+ ( echo "Caps lock mapped to shift-function. Switching caps lock key to control key"
+   xmodmap -e "keycode 66 = Caps_Lock"
+   xmodmap -e "remove lock = Caps_Lock" -e "add control = Caps_Lock"
+   echo "Problems? Try to run 'setxkbmap -option ctrl:nocaps' manually."
+ )
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/cicqhist b/usr_bin/cicqhist
new file mode 100755 (executable)
index 0000000..73bf02f
--- /dev/null
@@ -0,0 +1,174 @@
+#!/usr/bin/perl -w
+
+# Julius Plenz <jp@cvmx.de>
+# http://www.plenz.com/
+#
+# $Id: cicqhist,v 0.4 2004/07/20 18:33:36 plenz Exp $
+#
+# This script has just been written because of a simple purpose:
+# To learn Perl. Or at least to make first few steps with perl.
+# It just aims to be like http://centericq.de/misc/cicq-history.sh -
+# and maybe it's even a bit more powerful... ;-)
+#
+# Released under the GNU GPL.
+
+use strict;
+use Getopt::Std;
+
+my %options = ();
+getopts ('d:hisv', \%options);
+
+$\ = "\n";
+$0 =~ s/^.*\///;
+
+my ($VER, $DATE);
+$VER =  '$Revision: 0.4 $';
+$VER =~ s/^.*: ([0-9\.,]+)\s*\$$/$1/;
+$DATE = '$Date: 2004/07/20 18:33:36 $';
+$DATE =~ s/^.*: ([0-9\/]{10})[0-9: ]*\$$/$1/;
+$DATE =~ s/\//-/g;
+
+if ($options{"v"}) {
+    print $0, ' ', $VER, ' ', $DATE;
+    exit;
+}
+
+if (!$ARGV[0]     ||
+    $options{"h"} ||
+    $ARGV[0] eq "") {
+
+    # print help
+    print $0, ' ', $VER, ' ', $DATE;
+    print 'by Julius Plenz <jp@cvmx.de>';
+    print 'http://www.plenz.com/';
+    print '(just to learn Perl :-)';
+    print '';
+    print 'Usage:   ' . $0 . ' [-d <dir>] [-h] [-i] [-s] <number>';
+    print '-d ...   Use ... as cicq-directory (default: ~/.centericq)';
+    print '-h       Display this message';
+    print '-i       Display initials rather than full nicknames';
+    print '-s       Display shortened date (yymmdd hh:mm)';
+    print '-v       Display program version';
+    exit;
+}
+
+
+# Change this, if you want!
+my $mynick = $ENV{"USER"};
+# my $mynick = "Goofy";
+
+
+# The main directory
+my $cicqdir;
+if ($options{"d"}) {
+    $cicqdir = $options{"d"};
+} else {
+    $cicqdir  = $ENV{"HOME"} . '/.centericq';
+}
+
+# Three basic settings
+my $number   = $ARGV[0];
+my $infofile = "$cicqdir/$number/info";
+my $histfile = "$cicqdir/$number/history";
+
+# Getting the nickname
+open (INFO, $infofile) || die ("Couldn't open file $infofile");
+my @lines = <INFO>;
+
+my $i = $#lines;
+$i++;
+
+my $nickname;
+foreach (@lines) {
+    $i--;
+    if ($i == 6) {
+        chomp;
+        $nickname = $_;
+    }
+}
+
+close (INFO);
+
+
+# Opening History
+print "--- Displaying conversation with $nickname ---\n";
+
+open (HIST, $histfile) || die ("Couldn't open file $histfile");
+
+my $linenumber = 0;
+my $nick = '';
+my $displaytime;
+
+while (<HIST>) {
+    chomp;
+    my $line = $_;
+
+    if ($line eq "\f") {
+        $linenumber = 0;
+        next;
+    }
+
+    if ($linenumber < 4) {
+        if ($line =~ /^IN$/) {
+            $nick = sprintf ('%-13s', $nickname);
+        }
+
+        if ($line =~ /^OUT$/) {
+            $nick = sprintf ('%-13s', $mynick);
+        }
+
+        if (/^[0-9]+$/) {
+            my $tstamp = $_;
+            chomp ($tstamp);
+
+            if ($tstamp < 3) {
+                next;
+            }
+
+            my ($sec, $min, $hour, $mday, $mon, $year) =
+                localtime ($tstamp);
+
+            if ($options{"s"}) {
+                $year += 1900;
+                $displaytime = sprintf ('%02d%02d%02d %02d:%02d  ',
+                    substr ($year, 2, 2), $mon, $mday, $hour, $min);
+            } else {
+                $displaytime =
+                    sprintf ('[%02d.%02d.%02d, %02d:%02d:%02d] ',
+                    $mday, $mon, (1900+$year), $hour, $min, $sec);
+            }
+        }
+
+        $linenumber++;
+        if ($linenumber == 4) {
+
+            $\ = "";
+
+            if ($options{"i"}) {
+                    print $displaytime . substr ($nick, 0, 1) . ':  ';
+                } else {
+                    print $displaytime . $nick . ':  ';
+                }
+
+            $\ = "\n";
+        }
+
+    } else {
+        print $line;
+    }
+
+}
+
+close (HIST);
+
+if ($options{"i"}) {
+    print '';
+    print '';
+    print ' 'x8 . $number .' = '. substr ($nickname, 0, 1) .
+        ' = ' . $nickname;
+    print ' 'x8 . substr ($mynick, 0, 1) . ' = ' . $mynick;
+}
+
+print "\n--- End of conversation with $nickname ---";
+
+# EOF  vim: set et sm nu ft=perl
diff --git a/usr_bin/code2color b/usr_bin/code2color
new file mode 100755 (executable)
index 0000000..0d159c8
--- /dev/null
@@ -0,0 +1,3370 @@
+#!/usr/bin/env perl
+
+#use strict;
+use Getopt::Long;
+use POSIX;
+
+my $VERSION = "0.1";
+my $vernr = "0.9.1"; # this is the underlying version of Peter Palfrader's script
+##########################################################################
+#
+# very early check whether this routine is called from less -R or less -r
+# or if the variable LESS contains -R or -r
+# return if not (escape sequences would not be interpreted as colors)
+# on systems with process info in /proc this could be coded in lesspipe.sh
+#
+##########################################################################
+if ( $ARGV[0] =~ /^\d+$/  and $ARGV[1] ) {
+  # we were called from lesspipe.sh with first arg = PPID
+  my $PPID = shift;
+  # if env variable LESS contains -r or -R we are sure that colors get displayed
+  if ( $ENV{LESS} !~ /-\w*r\w*\b/i ) {
+    # check if less is called with -r or -R (highly OS dependent)
+    # tested only for Linux, Solaris, IRIX, True64, MacOS X, FreeBSD and AIX !!!
+    my $psargs = '-oppid= -oargs=';
+    if ( $^O eq 'darwin' || $^O =~ /bsd$/ ) {
+      $psargs = '-oppid -ocommand';
+    } elsif ( $^O eq 'hpux' ) {
+      $procvers = "0.36";
+      $psargs = '-f';
+    }
+    eval "use Proc::ProcessTable $procvers";
+    if ( $@ ) { 
+      my $p = `ps -p $PPID $psargs`;
+      exit 1 if $p =~ /\bless\s+/ and $p !~ /less\s+-\w*r\w*\b/is;
+      if ( $p !~ /\bless\s+/ ) {
+       if ($p =~ /\d+\s+(\d+)/) {
+         $PPID = $1;
+       } else {
+         $PPID = $1 if $p =~ /(\d+)/;
+       }
+       my $p2 = `ps -p $PPID $psargs`;
+       exit 1 if $p2 !~ /less\s+-\w*r\w*\b/is;
+      }
+    } else {
+      my $pt = new Proc::ProcessTable;
+      for (@{$pt->table}) {
+       next unless $_->pid eq $PPID;
+       $p = $_->cmndline;
+       exit 1 if $p =~ /\bless\s+/ and $p !~ /less\s+-\w*r\w*\b/i;
+       if ( $p !~ /\bless\s+/ ) {
+         $PPID = $_->ppid;
+         for (@{$pt->table}) {
+           next unless $_->pid eq $PPID;
+           $p = $_->cmndline;
+           exit 1 if $p !~ /less\s+-\w*r\w*\b/i;
+         }
+       }
+      }
+    }
+  }
+}
+
+########################################################################
+#                                                                      #
+# Code2HTML                                                            #
+# ---------                                                            #
+#                                                                      #
+# Code2Html, peter AT palfrader.org                                    #
+#                                                                      #
+# $Date: 2002/01/12 21:17:02 $
+# $Revision: 1.13 $
+# $Id: code2html,v 1.13 2002/01/12 21:17:02 weaselp Exp $
+#                                                                      #
+# AUTHOR                                                               #
+#        Peter  Palfrader. Written in 1999, 2000, 2001, 2002.          #
+#        A lot of other people. See CREDITS file.                      #
+#                                                                      #
+# DESCRIPTION                                                          #
+#        code2html is a  perlscript  which  converts  a  program       #
+#        source  code  to syntax highlighted HTML by applying a set    #
+#        of   regular   expressions   depending   on  the  language    #
+#        the source code is written.                                   #
+#                                                                      #
+#        see the man-page for details,                                 #
+#                                                                      #
+########################################################################
+
+#added 2/2001 bdk
+my $LINE_NUMBER_DEFAULT = "none";       # 'none', 'normal', 'linked'
+my $REPLACE_TAB_DEFAULT = "8";
+
+my $LANG_TEST_LENGTH = 1024;
+
+my $DEFAULT_OUTPUTFORMAT='xterm';
+my $ENTITIES;
+my %ENTITIES;
+my $STYLE_AND_LANGUAGE_FLAG;
+my %STYLESHEET;
+my %LANGUAGE;
+Usage() unless @ARGV;
+# =======================================================================
+# == subroutines ========================================================
+# =======================================================================
+
+sub Usage {
+  (my $prog = $0) =~ s!.*/!!;
+  my $time = strftime("%F", localtime( (stat($0))[9]));
+  print <<EOF;
+$prog V$VERSION $time based on Code2Html version $vernr (peter\@palfrader.org)
+EOF
+  my $origtext = <<EOF;
+Usage: $prog [options] [input_file [output_file]]
+
+Convert a program source to syntax highlighted HTML,
+or any other format for wich rules are defined.
+
+-l, --language-mode   set language mode
+    --fallback LANG   fallback language mode
+-v, --verbose         prints progress information to STDER
+-n, --linenumbers     print out the source code with line numbers
+-P, --prefix          optional prefix to use for linenumber anchors
+-N, --linknumbers     linenumbers will link to themselves
+-t, --replace-tabs[=TABSTOP-WIDTH]
+                      replace <tabs> with spaces
+-L, --language-file=LANGUAGE-FILE
+                      specify an alternate file for definitions
+-m, --modes           print all available modes
+-h, --help            print this message
+-V, --version         print version
+-c, --content-type    prints a Content-Type header
+-o, --output-format   selects the output-format
+-H, --no-header       don't use the template
+    --template=FILE   override template
+-T, --title           set title
+
+-w, --linewidth       max characters per line
+-b, --linebreakprefix prefix of the new lines
+
+see the man-page code2html for further help
+EOF
+  exit;
+}
+
+####
+#### main
+####
+
+sub main {
+    my %params = %{shift()};
+    my $html;   # end result
+
+    # undefine the input record separator so everything gets loaded in one turn
+    local $/ = undef;  # don't propogate this change outside this package.
+
+    # Only set %STYLESHEET and %LANGUAGE if they haven't been 
+    # already set in a previous call ( if, say, we're running 
+    # in a persistent environment under mod_perl) 
+    # or if the langfile is passed in explicitly.
+    if ( $params{'langfile'} or ! $STYLE_AND_LANGUAGE_FLAG ) {
+      $STYLE_AND_LANGUAGE_FLAG = 1;  # now they will be defined.
+      
+      print STDERR "getting patterns...\n"  if ($params{'verbose'});
+      # building up the database
+      # newer entries overwrite old ones
+      my @CONFIG_FILES;
+      push @CONFIG_FILES, "/etc/code2html.config";
+      push @CONFIG_FILES, 
+        $ENV{'HOME'}."/.code2html.config"   if $ENV{'HOME'};
+      push @CONFIG_FILES, 
+        split(/:/,$ENV{'CODE2HTML_CONFIG'}) if $ENV{'CODE2HTML_CONFIG'};
+      push @CONFIG_FILES, 
+        split(/:/,$params{'langfile'})      if $params{'langfile'};
+      
+      %STYLESHEET = %{ &get_default_stylesheet } ; 
+      %LANGUAGE   = %{ &get_default_database   } ; 
+
+      for (@CONFIG_FILES) {
+        if ( -r $_){
+          # if I use `do $_` instead of scalar eval... 
+          #  %LANGUAGE is not exported and imported correctly 
+          # (read: at all) (PP)
+          unless (scalar eval `cat $_`) {     
+            warn "couldn't parse $_: $@" if $@;
+          };
+        };
+      };
+    }
+
+    # set outputformat
+    #   When called as a package, "die" is impolite. Changed to "return".
+    # die "Outputformat $params{'outputformat'} not defined" 
+    # unless defined $STYLESHEET{$params{'outputformat'}};
+    return "Outputformat $params{'outputformat'} not defined" 
+      unless defined $STYLESHEET{$params{'outputformat'}};
+
+    my %STYLE = % { $STYLESHEET{$params{'outputformat'}} };
+      
+    # load alternate template if given
+    if (($params{'template'} ne "") && ( ! $params{'noheader'} )) {
+#         open (FILE, $params{'template'}) || 
+#           die ("Could not open template file $params{'template'}: $!");
+      open (FILE, $params{'template'}) || 
+        return ("Could not open template file $params{'template'}: $!");
+      $STYLE{'template'} = <FILE>;
+      close (FILE);
+    };
+
+    # set up the global ENTITIES variables ( the scalar and the hash ) 
+    # from the STYLE definition
+    $ENTITIES =     $ { $STYLE{'entities'} }{'listofchars'};
+    %ENTITIES = % { $ { $STYLE{'entities'} }{'replace_by' } };
+
+    # modify the header and footer so that the template variables 
+    # are set correcly
+
+    unless ($STYLE{'template'} =~ /^(.*)%%code%%(.*)$/s) {
+      return "template does not contain a %%code%% variable";
+    };
+
+    $STYLE{'header'} = $1;
+    $STYLE{'footer'} = $2;
+    $STYLE{'header'} =~ s/%%title%%/$params{'title'}/g;
+    $STYLE{'footer'} =~ s/%%title%%/$params{'title'}/g;
+    $STYLE{'header'} =~ s/%%version%%/$vernr/g;
+    $STYLE{'footer'} =~ s/%%version%%/$vernr/g;
+
+    # load the input file and set params{'langmode'} 
+    # if it is not already. this is done by probing a
+    # set of rules defined in %LANGUAGE
+    my $code_ref;
+    print STDERR "loading input file...\n"    if ($params{'verbose'});
+    $code_ref = &get_input_file(\%params, 
+                                \%LANGUAGE, 
+                                $params{'langmode'}, 
+                                $params{'alt_langmode'});
+
+    return 0 if ! ref $code_ref;
+    # select the rules for out language.
+    my $language_rules_ref = 
+      $LANGUAGE{ lc($params{'langmode'}) }->{'patterns'};
+
+    print STDERR "applying stylesheet...\n"      if ($params{'verbose'});
+    # Apply the Stylesheets
+    # set 'starttag' and 'endtag' for every rule according to 
+    # its 'style' value the tags are defined in the stylesheet
+    &apply_stylesheets_to_rules( $language_rules_ref, \%STYLE );
+
+    print STDERR "getting headers ...\n"  if ($params{'verbose'});
+    $html = &put_headers(\%params, \%STYLE);
+
+    my $snippetlist_ref = [] ;
+    print STDERR "creating snippet-list...\n"    if $params{'verbose'};
+    &create_snippetlist( $language_rules_ref, 
+                         $$code_ref, $snippetlist_ref, \%STYLE);
+
+    print STDERR "getting html converted code ...\n"  if $params{'verbose'};
+    $html .= &put_output(\%params, $snippetlist_ref, \%STYLE);
+
+    # --- debug
+    # print " - debug :  \n";
+    # foreach my $key (keys %params) {
+    #   print " $key => " . $params{key} . "\n";
+    # }
+    #  return " - debug: done";
+    # ---------
+
+    $html =~ s/\e\[0m(\e\[\d\d?m)/$1/g;
+    $ii++ while $html =~ s/(\e\[0m[^\e]+)\e\[0m/$1/g;
+
+    # Output $html code.
+    if ( $params{outfile} ) {
+      if ( $params{outfile} eq '-') {
+        print $html;
+      }
+      else {
+        open(FILEHANDLE, '>'.$params{outfile}) or 
+          return( " Couldn't open output file " . $params{outfile} . "$!");
+
+        print FILEHANDLE $html;
+        close FILEHANDLE;
+      }
+    }
+    else {
+      return $html;
+    }
+
+  }
+
+
+####
+#### parse_passed_params
+####   replaces parse_params for package version of program,
+####   constructing %RESULT hash from options passed by calling routine.
+sub parse_passed_params {
+  if ( @_ == 1 ) {
+    @_ = ( input => $_[0] );
+  };
+
+  my %RESULT = (
+
+        input               =>  '',             # text to convert
+
+        infile              =>  '',             # filename to get text from
+        outfile             =>  '',             # file to write html to
+
+        langmode            =>  '',             # language (perl,java,html,...)
+        alt_langmode        =>  'html',         # language to use if can't tell
+        langfile            =>  '',             # more definitions of languages
+
+        line_number_prefix  =>  '',
+        linenumbers         =>  $LINE_NUMBER_DEFAULT,
+        outputformat        =>  $DEFAULT_OUTPUTFORMAT,
+        replacetabs         =>  $REPLACE_TAB_DEFAULT,
+
+        title               =>  '',
+        noheader            =>  '',             # 1 => don't print template
+        content_type        =>  '',
+        content_encoding    =>  '',
+        template            =>  '',             # more template definitions
+
+        verbose             =>  '',
+        what_to_do          =>  'normal',
+
+        @_ ,                                    # any input key=>value pairs
+                                                # will override the defaults
+                                                # given above.
+               );
+  $RESULT{title} = $RESULT{infile} if $RESULT{infile} && !$RESULT{title};
+  $RESULT{title} = 'Code2HTML' unless $RESULT{title};
+  if ( $RESULT{linenumbers} and 
+       $RESULT{linenumbers} !~ m/^none|normal|linked$/ ) {
+    $RESULT{linenumbers} = 'normal';
+  };
+  return \%RESULT;
+}
+
+
+###########################################################################
+######################## checkTabulator ###################################
+##########################################################################
+sub checkTabulator
+{
+    my ($line, $TABSTOP) = @_;
+    
+    while ((my $at = index($line, "\t")) != -1)
+      {
+          my $cnt = ($TABSTOP - ($at % $TABSTOP));
+          my $replace_with = ' ' x $cnt if ($cnt);
+          $line =~ s/\t/$replace_with/;
+      };
+
+    return $line;
+}
+
+##########################################################################
+####################### get_input_file ###################################
+##########################################################################
+sub get_input_file
+  {
+
+    # in  : \%params
+    # in : \%LANGUAGE;
+    # in/out : $langmode;
+    # in/out : $alt_langmode;
+    # returns: input file
+    
+      my %PARAMS       = %{$_[0]};
+      my %LANGUAGE     = %{$_[1]};
+      my $langmode     = $_[2];
+      my $alt_langmode  = $_[3];
+      my $code;
+
+      if ( $PARAMS{'input'} )
+        {
+            $code = $PARAMS{'input'};
+            $code =~ s/\r//g;
+        }
+      else
+        {
+           if ($PARAMS{'infile'} eq '-') {
+               *FILEHANDLE = *STDIN;
+           } else {
+                open(FILEHANDLE, $PARAMS{'infile'}) 
+                || return("While opening '$PARAMS{'infile'}' for input: ".$!."\n");
+           }
+           local $/=undef;
+            $code = <FILEHANDLE>;
+            close(FILEHANDLE);
+           $PARAMS{'infile'} = $opt_i || $PARAMS{'infile'};
+        };
+      
+      if ($PARAMS{'replacetabs'} != 0)
+        {
+            $code = join (
+                          "\n",
+                          map{
+                              &checkTabulator($_, $PARAMS{'replacetabs'})
+                          }
+                          my @dummy = split(/\n/, $code)
+                         );
+        };
+      
+
+      
+      if ( not $langmode )
+        {
+            my $test_code = substr($code, 0, $LANG_TEST_LENGTH);
+            # warn("language mode not given. guessing...\n");
+
+            $langmode = '';
+
+            for (keys %LANGUAGE)
+              {
+                  if (  (($LANGUAGE{$_}->{'filename'} ne '') 
+                         && ($PARAMS{'infile'} 
+                             =~  m/$LANGUAGE{$_}->{filename}/))  ||
+                        (($LANGUAGE{$_}->{'regex'}    ne '') 
+                         && ($test_code  =~  m/$LANGUAGE{$_}->{regex}/   ))   
+                     )
+                    {
+                        $langmode = $_;
+                        last;
+                    };
+              };
+
+            if ($langmode eq '')
+              {
+                  if ( not $alt_langmode )
+                    {
+                      warn("Guessing language mode failed. " . 
+                           "Using fallback mode: '$alt_langmode'\n");
+                      $langmode = $alt_langmode;
+                      $alt_langmode = '';
+                    }
+                  else
+                    {
+                        print $code unless $str;
+                        return("Guessing language mode failed.\n")
+                    };
+              }
+            else
+              {
+                  # warn("using '$langmode'\n");
+              };
+        };
+      
+      $_[2] = $langmode;
+      $_[3] = $alt_langmode;
+      print "==> append : to filename to switch off syntax highlighting\n";
+      return \$code;
+  };
+
+
+###########################################################################
+####################### put_headers #######################################
+###########################################################################
+sub put_headers
+{       
+      my $html;    
+      my %PARAMS = %{shift()};
+      my $STYLE_REF = shift();
+
+      if ( $PARAMS{'content_type'}) {
+        $html .= "Content-Type: $$STYLE_REF{'content-type'}\n";
+        if ($PARAMS{'content_encoding'}) {
+          $html .= "Content-Encoding: $PARAMS{'encoding'}\n";
+        }
+        $html .= "\n";
+      }
+      $html .= $$STYLE_REF{'header'} unless $PARAMS{'noheader'};
+
+      return $html;
+};
+
+############################################################################
+####################### apply_stylesheets_to_rules #########################
+############################################################################
+sub apply_stylesheets_to_rules
+  {
+      my ( $regexps_ref, $style_ref ) = @_;
+
+      for ( @$regexps_ref ) {
+          warn ("Style '".$_->{style}."' not defined in stylesheet.\n") unless defined $ { $$style_ref{'tags'} } { $_->{style} };
+          $_->{'starttag'} = $ { $ { $$style_ref{'tags'} } { $_->{style} } } { 'start' };
+          $_->{'endtag'}   = $ { $ { $$style_ref{'tags'} } { $_->{style} } } { 'stop' };
+          apply_stylesheets_to_rules( $_->{childregex}, $style_ref ) if $_->{childregex};
+      };
+  };
+
+###########################################################################
+####################### create_snippetlist ################################
+###########################################################################
+sub create_snippetlist
+  {
+    my ( $regexps_ref, $code, $snippetlist_ref, $style_ref ) = @_ ;
+    my $length = length( $code );
+
+    ## An array of regular expression sturctures, each of which is an
+    ## array.  @res is kept sorted by starting position of the RExen and
+    ## then by the position of the regex in the language file.  This allows
+    ## us to just evaluate $res[0], and to hand write fast code that typically
+    ## handles 90% of the cases without resorting to the _big_ guns.
+    ##
+    ## FWIW, I pronounce '@res' REEZE, as in the plural of '$re'.
+    ##
+    my @res ;
+    
+    my $pos ;
+    
+    for ( @$regexps_ref ) {
+        pos( $code ) = 0 ;
+#++$m ;
+        next unless $code =~ m/($_->{regex})/gms ;
+
+        $pos = pos( $code ) ;
+#       $res[@res] = [ 
+#                     $_->{regex},
+#                     $ { $ { $$style_ref{'tags'} } { $_->{style} } } { 'start' },
+#                     $ { $ { $$style_ref{'tags'} } { $_->{style} } } { 'stop' },
+#                     $_->{childregex},
+#                     $pos - length( $1 ),
+#                     $pos,
+#                     scalar( @res ),
+#                    ] ;
+        $res[@res] = [ 
+                      $_->{regex},
+                      $_->{starttag},
+                      $_->{endtag},
+                      $_->{childregex},
+                      $pos - length( $1 ),
+                      $pos,
+                      scalar( @res ),
+                     ] ;
+    }
+    
+    ## 90% of all child regexes end up with 0 or 1 regex that needs to be
+    ## worried about. Trimming out the 0's speeds things up a bit and
+    ## makes the below loop simpler, since there's always at least
+    ## 1 regexp.  It donsn't speed things up much by itself: the percentage 
+    ## of times this fires is really small.  But it does simplify the loop
+    ## below and speed it up.
+    unless ( @res ) {
+        $code =~ s/($ENTITIES)/$ENTITIES{$1}/ge ;
+        push @$snippetlist_ref, $code ;
+        return ;
+    }
+    
+    @res = sort { $a->[4] <=> $b->[4] || $a->[6] <=> $b->[6] } @res ;
+    
+    ## Add a dummy at the end, which makes the logic below simpler / faster.
+    $res[@res] = [
+                  undef,
+                  undef,
+                  undef,
+                  undef,
+                  $length,
+                  $length,
+                  scalar( @res ),
+                 ] ;
+    
+    ## These are declared here for (minor) speed improvement.
+    my $re ;
+    my $match_spos ;
+    my $match_pos ;
+    my $re_spos ;
+    my $re_pos ;
+    my $re_num ;
+    my $prefix ;
+    my $snippet ;
+    my $rest ;
+    my $i ;
+    my $l ;
+    
+my @changed_res ;
+my $j ;
+
+    $pos = 0 ;
+MAIN:
+    while ( $pos < $length ) {
+        $re = $res[0] ;
+        
+        $match_spos = $re->[4] ;
+        $match_pos  = $re->[5] ;
+        
+        if ( $match_spos > $pos ) {
+            $prefix  = substr( $code, $pos, $match_spos - $pos ) ;
+            $prefix  =~ s/($ENTITIES)/$ENTITIES{$1}/ge ;
+            push @$snippetlist_ref, $prefix ;
+        }
+        
+        if ( $match_pos > $match_spos ) {
+            $snippet = substr( $code, $match_spos, $match_pos - $match_spos ) ;
+            if ( @{$re->[3]} ) {
+                push @$snippetlist_ref, $re->[1] ;
+                create_snippetlist( $re->[3], $snippet, $snippetlist_ref, $style_ref ) ;
+                push @$snippetlist_ref, $re->[2] ;
+            }
+            else {
+                $snippet =~ s/($ENTITIES)/$ENTITIES{$1}/ge ;
+                push @$snippetlist_ref, $re->[1], $snippet, $re->[2];
+            }
+        }
+        
+        $pos = $match_pos ;
+        
+        ##
+        ## Hand coded optimizations.  Luckily, the cases that arise most often
+        ## are the easiest to tune.
+        ##
+
+# =pod
+
+        if ( $res[1]->[4] >= $pos ) {
+            ## Only first regex needs to be moved, 2nd and later are still valid.
+            ## This is often 90% of the cases for Perl or C (others not tested,
+            ## just uncomment the $n, $o, and $p lines and try it yourself).
+#++$n{1} ;
+#++$m ;
+            pos( $code ) = $pos ;
+            unless ( $code =~ m/($re->[0])/gms ) {
+#++$o{'0'} ;
+                if ( @res == 2 ) {
+                    ## If the only regexp left is the dummy, we're done.
+                    $rest = substr( $code, $pos ) ;
+                    $rest =~ s/($ENTITIES)/$ENTITIES{$1}/ge ;
+                    push @$snippetlist_ref, $rest ;
+                    last ;
+                }
+                shift @res ;
+            }
+            else {
+                $re->[5] = $re_pos  = pos( $code ) ;
+                $re->[4] = $re_spos = $re_pos - length( $1 ) ;
+                
+                ## Walk down the array looking for $re's new home.
+                ## The first few loop iterations are unrolled and done manually 
+                ## for speed, which handles 85 to 90% of the cases where only
+                ## $re needs to be moved.
+                ##
+                ## Here's where that dummy regexp at the end of the array comes
+                ## in handy: we don't need to worry about array size here, since
+                ## it will always be after $re no matter what.  The unrolled
+                ## loop stuff is outdented to make the conditionals fit on one
+                ## 80 char line.
+                ## Element 4 in @{$res[x]} is the start position of the match.
+                ## Element 6 is the order in which it was declared in the lang file.
+                $re_num = $re->[6] ;
+                if ( ( $re_spos <=> $res[1]->[4] || $re_num <=> $res[1]->[6] ) <= 0 ) {
+#++$o{'1'} ;
+                    next 
+                }
+                $res[0] = $res[1] ;
+
+#++$o{'2'} ;
+                if ( ( $re_spos <=> $res[2]->[4] || $re_num <=> $res[2]->[6] ) <= 0 ) {
+                    $res[1] = $re ;
+                    next ;
+                }
+                $res[1] = $res[2] ;
+                
+                if ( ( $re_spos <=> $res[3]->[4] || $re_num <=> $res[3]->[6] ) <= 0 ) {
+#++$o{'3'} ;
+                    $res[2] = $re ;
+                    next ;
+                }
+                $res[2] = $res[3] ;
+                
+                if ( ( $re_spos <=> $res[4]->[4] || $re_num <=> $res[4]->[6] ) <= 0 ) {
+#++$o{'3'} ;
+                    $res[3] = $re ;
+                    next ;
+                }
+                $res[3] = $res[4] ;
+                
+                if ( ( $re_spos <=> $res[5]->[4] || $re_num <=> $res[5]->[6] ) <= 0 ) {
+#++$o{'4'} ;
+                    $res[4] = $re ;
+                    next ;
+                }
+                $res[4] = $res[5] ;
+
+#++$o{'ugh'} ;
+                $i = 6 ;
+                $l = $#res ;
+                for ( ; $i < $l ; ++$i ) {
+                    last
+                      if ( 
+                          ( $re_spos <=> $res[$i]->[4] || $re_num <=> $res[$i]->[6] )
+                          <= 0
+                         ) ;
+                    $res[$i-1] = $res[$i] ;
+                }
+#++$p{sprintf( "%2d", $i )} ;
+                $res[$i-1] = $re ;
+            }
+            
+            next ;
+        }
+        
+# =cut
+
+        ##
+        ## End optimizations.  You can comment them all out and this net
+        ## does all the work, just more slowly.  If you do that, then
+        ## you also need to comment out the code below that deals with
+        ## the second entry in @res.
+        ##
+
+#my $ni = 0 ;
+        ## First re always needs to be tweaked
+#++$m ;
+#++$ni ;
+        pos( $code ) = $pos ;
+        unless ( $code =~ m/($re->[0])/gms ) {
+            if ( @res == 2 ) {
+                ## If the only regexp left is the dummy, we're done.
+                $rest = substr( $code, $pos ) ;
+                $rest =~ s/($ENTITIES)/$ENTITIES{$1}/ge ;
+                push @$snippetlist_ref, $rest ;
+                last ;
+            }
+            shift @res ;
+            @changed_res = () ;
+            $i = 0 ;
+        }
+        else {
+            $re->[5] = $re_pos  = pos( $code ) ;
+            $re->[4] = $re_pos - length( $1 ) ;
+            @changed_res = ( $re ) ;
+            $i = 1 ;
+        }
+        
+        ## If the optimizations above are in, the second one always
+        ## needs to be tweaked, too.
+        $re = $res[$i] ;
+#++$m ;
+#++$ni ;
+        pos( $code ) = $pos ;
+        unless ( $code =~ m/($re->[0])/gms ) {
+            if ( @res == 2 ) {
+                ## If the only regexp left is the dummy, we're done.
+                $rest = substr( $code, $pos ) ;
+                $rest =~ s/($ENTITIES)/$ENTITIES{$1}/ge ;
+                push @$snippetlist_ref, $rest ;
+                last ;
+            }
+            shift @res ;
+        }
+        else {
+            $re->[5] = $re_pos  = pos( $code ) ;
+            $re->[4] = $re_spos = $re_pos - length( $1 ) ;
+            if ( @changed_res &&
+                 ( $changed_res[0]->[4] <=> $re_spos || 
+                   $changed_res[0]->[6] <=> $re->[6]
+                 ) > 0
+               ) {
+                unshift @changed_res, $re ;
+            }
+            else {
+                $changed_res[$i] = $re ;
+            }
+            ++$i ;
+        }
+        
+        for ( ; ; ++$i ) {
+            local $_ = $res[$i] ;
+#++$m ;
+            last if $_->[4] >= $pos ;
+#++$ni ;
+#++$m ;
+            pos( $code ) = $pos ;
+            unless ( $code =~ m/($_->[0])/gms ) {
+                if ( @res <= 2 ) {
+                    $rest = substr( $code, $pos ) ;
+                    $rest =~ s/($ENTITIES)/$ENTITIES{$1}/ge ;
+                    push @$snippetlist_ref, $rest ;
+                    last MAIN ;
+                }
+                ## If this regex is no longer needed, remove it by not pushing it
+                ## on to @changed_res.  This means we need one less slot in @res.
+                shift @res ;
+                redo ;
+            }
+
+            $_->[5] = $re_pos  = pos( $code ) ;
+            $_->[4] = $re_spos = $re_pos - length( $1 ) ;
+            
+            ## Insertion sort in to @changed_res
+            $re_num = $_->[6] ;
+            for ( $j = $#changed_res ; $j > -1 ; --$j ) {
+                last
+                  if ( 
+                      ( $changed_res[$j]->[4] <=> $re_spos || 
+                        $changed_res[$j]->[6] <=> $re_num 
+                      ) < 0
+                     ) ;
+                $changed_res[$j+1] = $changed_res[$j] ; 
+            }
+            $changed_res[$j+1] = $_ ;
+        }
+
+        ## Merge sort @changed_res and @res in to @res
+        $j = 0 ;
+        $l = $#res ;
+        for ( @changed_res ) {
+            while (
+                   $i < $l &&
+                   ( $_->[4] <=> $res[$i]->[4] || $_->[6] <=> $res[$i]->[6] ) > 0
+                  ) {
+                $res[$j++] = $res[$i++] ;
+            }
+            $res[$j++] = $_ ;
+        }
+# =cut
+    }
+};
+
+
+##########################################################################
+####################### put_output #######################################
+##########################################################################
+sub put_output {
+    my ( $params, $snippetlist_ref, $STYLE_REF ) = @_ ;
+
+    my $result;
+
+    my $prefix = ''; 
+    $prefix = $params->{'line_number_prefix'}.'_'  
+      if $params->{'line_number_prefix'};
+
+    $result = &{ $ { $$STYLE_REF{'linenumbers'}} {$params->{'linenumbers'}} 
+               }(join ('', @$snippetlist_ref), $prefix);
+
+    # print FILEHANDLE $result unless $params->{'dont_print_output'} ;
+    # print FILEHANDLE $$STYLE_REF{'footer'}  unless $params->{'noheader'};
+    
+    $result .= $$STYLE_REF{'footer'} unless $params->{noheader};
+
+    return $result;
+};
+
+
+############################################################################
+####################### get_default_stylesheet #############################
+############################################################################
+sub get_default_stylesheet
+{
+
+my %STYLESHEET;
+
+
+##########
+########## different color modes for html. 
+# those are named html-dark, html-nobc and html-light. 
+# html-light is also named html
+# the only difference between html-light and html-nobc is
+# that html-light defines a body background and text color.
+# nobc stands for no body colors.
+
+my ($bold, $underline, $reverse, $reset, $red, $green, $yellow, $blue,
+    $magenta, $cyan);
+eval "use Term::ANSIColor";
+if ($@) {
+  $bold = "\e[1m";
+  $underline = "\e[4m";
+  $reverse = "\e[7m";
+  $reset = "\e[0m";
+  $red = "\e[31m";
+  $green = "\e[32m";
+  $yellow = "\e[33m";
+  $blue = "\e[34m";
+  $magenta = "\e[35m";
+  $cyan = "\e[36m";
+} else {
+  $bold = color('bold');
+  $underline = color('underline');
+  $reverse = color('reverse');
+  $reset = color('reset');
+  $red = color('red');
+  $green = color('green');
+  $yellow = color('yellow');
+  $blue = color('blue');
+  $magenta = color('magenta');
+  $cyan = color('cyan');
+}
+$STYLESHEET{'xterm'} =  { 'template'       => '%%code%%',
+                         'content-type' => 'text/html',
+                         'linenumbers'  => {
+                                            'none'          => sub { 
+                                                                    return $_[0];
+                                                                   },
+                                            'normal'        => sub { 
+                                                                   # o as the first parameter is the joined snippetlist
+                                                                   # o the second is an optional prefix, needed if more than one block
+                                                                   #   in a file is highlighted. needed in patch-mode. may be empty
+                                                                   # the sub should the return a scalar made up of the joined lines including linenumbers
+                                                                   my @lines = split ( /\n/, $_[0] );
+                                                                   my $nr = 0;
+                                                                   my $lengthofnr = length(@lines);
+                                                                   my $format = qq{%${lengthofnr}u %s\n} ;
+                                                                   join ('', map (  {$nr++; sprintf ( $format , $nr, $_ )} @lines));
+                                                                   },
+                                             'linked'       => sub { 
+                                                                   # is not defined for xterm output, therefore do nothing
+                                                                    return $_[0];
+                                                                   },
+                                           },
+                         'tags'         => { 
+                                            'comment'                => { 'start' => $blue,
+                                                                          'stop'  => $reset },
+                                            'doc comment'            => { 'start' => "$bold$blue",
+                                                                          'stop'  => $reset },
+                                            'string'                 => { 'start' => $red,
+                                                                          'stop'  => $reset },
+                                            'esc string'             => { 'start' => $magenta,
+                                                                          'stop'  => $reset },
+                                            'character'              => { 'start' => $reset,
+                                                                          'stop'  => $reset },
+                                            'esc character'          => { 'start' => $magenta,
+                                                                          'stop'  => $reset },
+                                            'numeric'                => { 'start' => $red,
+                                                                          'stop'  => $reset },
+                                            'identifier'             => { 'start' => $cyan,
+                                                                          'stop'  => $reset },
+                                            'predefined identifier'  => { 'start' => $cyan,
+                                                                          'stop'  => $reset },
+                                            'type'                   => { 'start' => $cyan,
+                                                                          'stop'  => $reset },
+                                            'predefined type'        => { 'start' => $green,
+                                                                          'stop'  => $reset },
+                                            'reserved word'          => { 'start' => "$yellow",
+                                                                          'stop'  => $reset },
+                                            'library function'       => { 'start' => $reset,
+                                                                          'stop'  => $reset },
+                                            'include'                => { 'start' => $green,
+                                                                          'stop'  => $reset },
+                                            'preprocessor'           => { 'start' => $green,
+                                                                          'stop'  => $reset },
+                                            'braces'                 => { 'start' => $reset,
+                                                                          'stop'  => $reset },
+                                            'symbol'                 => { 'start' => $green,
+                                                                          'stop'  => $reset },
+                                            'function header'        => { 'start' => "$bold$red",
+                                                                          'stop'  => $reset },
+                                            'function header name'   => { 'start' => "$bold$cyan",
+                                                                          'stop'  => $reset },
+                                            'function header args'   => { 'start' => $cyan,
+                                                                          'stop'  => $reset },
+                                            'regex'                  => { 'start' => $magenta,
+                                                                          'stop'  => $reset },
+                                            'text'                   => { 'start' => $red,
+                                                                          'stop'  => $reset},
+
+                                            # HTML
+                                            'entity'                 => { 'start' => $green,
+                                                                          'stop'  => $reset },
+
+                                            # MAKEFILE
+                                            'assignment'             => { 'start' => $green,
+                                                                          'stop'  => $reset },
+                                            'dependency line'        => { 'start' => $cyan,
+                                                                          'stop'  => $reset },
+                                            'dependency target'      => { 'start' => $blue,
+                                                                          'stop'  => $reset },
+                                            'dependency continuation'=> { 'start' => $magenta,
+                                                                          'stop'  => $reset },
+                                            'continuation'           => { 'start' => $magenta,
+                                                                          'stop'  => $reset },
+                                            'macro'                  => { 'start' => $red,
+                                                                          'stop'  => $reset },
+                                            'int macro'              => { 'start' => $red,
+                                                                          'stop'  => $reset },
+                                            'esc $$$'                => { 'start' => $yellow,
+                                                                          'stop'  => $reset },
+                                            'separator'              => { 'start' => $green,
+                                                                          'stop'  => $reset },
+                                            'line spec'              => { 'start' => $cyan,
+                                                                          'stop'  => $reset },
+                                            'deletion'               => { 'start' => $red,
+                                                                          'stop'  => $reset },
+                                            'insertion'              => { 'start' => $blue,
+                                                                          'stop'  => $reset },
+                                            'modification'           => { 'start' => $magenta,
+                                                                          'stop'  => $reset },
+                                     }
+                       };
+$STYLESHEET{'html-light'} =  { 'template'       =>
+'<html>
+<head>
+  <title>%%title%%</title>
+</head>
+<body bgcolor="#ffffff" text="#000000">
+<pre>
+%%code%%
+</pre>
+<p align=right><small><font color=gray>syntax highlighted by 
+<a href="http://www.palfrader.org/code2html"><font 
+color=gray>Code2HTML</font></a>, v. %%version%%</font></small></p>
+</body>
+</html>
+',
+                         'content-type' => 'text/html',
+                         'entities'     => { 'listofchars' => '[<>&"]',   # a regex actually
+                                             'replace_by'  => {
+                                                               '&' => '&amp;',
+                                                               '<' => '&lt;',
+                                                               '>' => '&gt;',
+                                                               '"' => '&quot;'
+                                                              }
+                                           },
+                         'linenumbers'  => {
+                                            'none'          => sub { 
+                                                                    return $_[0];
+                                                                   },
+                                            'normal'        => sub { 
+                                                                   # o as the first parameter is the joined snippetlist
+                                                                   # o the second is an optional prefix, needed if more than one block
+                                                                   #   in a file is highlighted. needed in patch-mode. may be empty
+                                                                   # the sub should the return a scalar made up of the joined lines including linenumbers
+                                                                   my @lines = split ( /\n/, $_[0] );
+
+                                                                   my $nr = 0;
+                                                                   my $lengthofnr = length(@lines);
+                                                                   my $format = qq{<a name="$_[1]line%u">%${lengthofnr}u</a> %s\n} ;
+                                                                   join ('', map (  {$nr++; sprintf ( $format , $nr, $nr, $_ )} @lines));
+                                                                   },
+                                             'linked'       => sub { 
+                                                                   # this should do the same as above only with linenumbers that link to themselves
+                                                                   # If this style does not support this, use the same as above.
+                                                                   my @lines = split ( /\n/, $_[0] );
+
+                                                                   my $nr = 0; 
+                                                                   my $lengthofnr = length(@lines);
+                                                                   my $format = qq{<a name="$_[1]line%u" href="#$_[1]line%u">%$ {lengthofnr}u</a> %s\n};
+                                                                   join ('', map (  {$nr++; sprintf ( $format , $nr, $nr, $nr, $_ )} @lines));
+                                                                   }
+                                           },
+                         'tags'         => { 
+                                            'comment'                => { 'start' => '<font color="#444444">',
+                                                                          'stop'  => '</font>' },
+                                            'doc comment'            => { 'start' => '<font color="#444444"><i>',
+                                                                          'stop'  => '</i></font>' },
+                                            'string'                 => { 'start' => '<font color="#008000">',
+                                                                          'stop'  => '</font>' },
+                                            'esc string'             => { 'start' => '<font color="#77dd77">',
+                                                                          'stop'  => '</font>' },
+                                            'character'              => { 'start' => '<font color="#008000">',
+                                                                          'stop'  => '</font>' },
+                                            'esc character'          => { 'start' => '<font color="#77dd77">',
+                                                                          'stop'  => '</font>' },
+                                            'numeric'                => { 'start' => '<font color="#FF0000">',
+                                                                          'stop'  => '</font>' },
+                                            
+                                            'identifier'             => { 'start' => '<font color="#2040a0">',
+                                                                          'stop'  => '</font>' },
+                                            'predefined identifier'  => { 'start' => '<font color="#2040a0"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                     
+                                            'type'                   => { 'start' => '<font color="#2040a0"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                            'predefined type'        => { 'start' => '<font color="#2040a0"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                            
+                                            'reserved word'          => { 'start' => '<strong>',
+                                                                          'stop'  => '</strong>' },
+                                            'library function'       => { 'start' => '<font color="a52a2a"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                            
+                                            'include'                => { 'start' => '<font color="0000ff"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                            'preprocessor'           => { 'start' => '<font color="0000ff"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                            
+                                            'braces'                 => { 'start' => '<font color="4444FF"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                            'symbol'                 => { 'start' => '<font color="4444FF">',
+                                                                          'stop'  => '</font>' },
+
+                                            'function header'        => { 'start' => '<strong>',
+                                                                          'stop'  => '</strong>' },
+                                            'function header name'   => { 'start' => '<font color="ff0000">',
+                                                                          'stop'  => '</font>' },
+                                            'function header args'   => { 'start' => '<font color="2040a0">',
+                                                                          'stop'  => '</font>' },
+                                            
+                                            'regex'                  => { 'start' => '<font color="b000d0">',
+                                                                          'stop'  => '</font>' },
+                                            
+                                            'text'                   => { 'start' => '<i>',
+                                                                          'stop'  => '</i>'},
+
+                                            # HTML
+                                            'entity'                 => { 'start' => '<font color="ff0000">',
+                                                                          'stop'  => '</font>' },
+
+                                            # MAKEFILE
+                                            'assignment'             => { 'start' => '<font color="2040a0">',
+                                                                          'stop'  => '</font>' },
+                                            'dependency line'        => { 'start' => '<font color="8b2252">',
+                                                                          'stop'  => '</font>' },
+                                            'dependency target'      => { 'start' => '<strong>',
+                                                                          'stop'  => '</strong>' },
+                                            'dependency continuation'=> { 'start' => '<font color="000000"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                            'continuation'           => { 'start' => '<strong>',
+                                                                          'stop'  => '</strong>' },
+                                            'macro'                  => { 'start' => '<font color="2040a0">',
+                                                                          'stop'  => '</font>' },
+                                            'int macro'              => { 'start' => '<font color="4080ff">',
+                                                                          'stop'  => '</font>' },
+                                            'esc $$$'                => { 'start' => '<font color="444444">',
+                                                                          'stop'  => '</font>' }
+                                     }
+                       };
+# html-light is also called html
+
+$STYLESHEET{'html'} = $STYLESHEET{'html-light'};
+
+
+# html-nobc is a modification of html-light
+# in such a way, that the body tag does not define
+# a background and a text color
+# nobc stands for no body colors.
+
+%{$STYLESHEET{'html-nobg'}} = %{$STYLESHEET{'html-light'}};
+${ $STYLESHEET{'html-nobg'}} {'template'} = '<html>
+<head>
+  <title>%%title%%</title>
+</head>
+<body>
+<pre>
+%%code%%
+</pre>
+<p align=right><small><font color=gray>syntax highlighted by 
+<a href="http://www.palfrader.org/code2html"><font 
+color=gray>Code2HTML</font></a>, v. %%version%%</font></small></p>
+</body>
+</html>
+';
+
+
+# html-dark is a modification of html-light
+# in such a way, that the body tag does define 
+# different colors and that the <font> colors are different.
+
+%{$STYLESHEET{'html-dark'}} = %{$STYLESHEET{'html-light'}};
+${ $STYLESHEET{'html-dark'}} {'template'} = '<html>
+<head>
+  <title>%%title%%</title>
+</head>
+<body bgcolor="#000000"  text="#C0C0C0" vlink="#FFFFFF" alink="#00FF00" link="#FFFFFF">
+<pre>
+%%code%%
+</pre>
+<p align=right><small><font color=gray>syntax highlighted by 
+<a href="http://www.palfrader.org/code2html"><font 
+color=gray>Code2HTML</font></a>, v. %%version%%</font></small></p>
+</body>
+</html>
+';
+${ $STYLESHEET{'html-dark'}} {'tags'} = {
+                                            'comment'                => { 'start' => '<font color="#909000">',
+                                                                          'stop'  => '</font>' },
+                                            'doc comment'            => { 'start' => '<font color="#909000"><i>',
+                                                                          'stop'  => '</i></font>' },
+                                            'string'                 => { 'start' => '<font color="yellow">',
+                                                                          'stop'  => '</font>' },
+                                            'esc string'             => { 'start' => '<font color="#77dd77">',
+                                                                          'stop'  => '</font>' },
+                                            'character'              => { 'start' => '<font color="yellow">',
+                                                                          'stop'  => '</font>' },
+                                            'esc character'          => { 'start' => '<font color="#77dd77">',
+                                                                          'stop'  => '</font>' },
+                                            'numeric'                => { 'start' => '<font color="#FF0000">',
+                                                                          'stop'  => '</font>' },
+                                           
+                                            'identifier'             => { 'start' => '<font color="#B0B0B0">',
+                                                                          'stop'  => '</font>' },
+                                            'predefined identifier'  => { 'start' => '<font color="#2040a0"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                     
+                                            'type'                   => { 'start' => '<font color="#2040a0"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                            'predefined type'        => { 'start' => '<font color="#2040a0"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                            
+                                            'reserved word'          => { 'start' => '<strong>',
+                                                                          'stop'  => '</strong>' },
+                                            'library function'       => { 'start' => '<font color="a52a2a"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                            
+                                            'include'                => { 'start' => '<font color="#00FF00">',
+                                                                          'stop'  => '</font>' },
+                                            'preprocessor'           => { 'start' => '<font color="#00FF00">',
+                                                                          'stop'  => '</font>' },
+                                            
+                                            'braces'                 => { 'start' => '<font color="darkCyan"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                            'symbol'                 => { 'start' => '<font color="darkCyan">',
+                                                                          'stop'  => '</font>' },
+
+                                            'function header'        => { 'start' => '<strong>',
+                                                                          'stop'  => '</strong>' },
+                                            'function header name'   => { 'start' => '<font color="ff0000">',
+                                                                          'stop'  => '</font>' },
+                                            'function header args'   => { 'start' => '<font color="2040a0">',
+                                                                          'stop'  => '</font>' },
+                                            
+                                            'regex'                  => { 'start' => '<font color="b000d0">',
+                                                                          'stop'  => '</font>' },
+                                            
+                                            'text'                   => { 'start' => '<i>',
+                                                                          'stop'  => '</i>'},
+
+                                            # HTML
+                                            'entity'                 => { 'start' => '<font color="ff0000">',
+                                                                          'stop'  => '</font>' },
+
+                                            # MAKEFILE
+                                            'assignment'             => { 'start' => '<font color="2040a0">',
+                                                                          'stop'  => '</font>' },
+                                            'dependency line'        => { 'start' => '<font color="8b2252">',
+                                                                          'stop'  => '</font>' },
+                                            'dependency target'      => { 'start' => '<strong>',
+                                                                          'stop'  => '</strong>' },
+                                            'dependency continuation'=> { 'start' => '<font color="000000"><strong>',
+                                                                          'stop'  => '</strong></font>' },
+                                            'continuation'           => { 'start' => '<strong>',
+                                                                          'stop'  => '</strong>' },
+                                            'macro'                  => { 'start' => '<font color="2040a0">',
+                                                                          'stop'  => '</font>' },
+                                            'int macro'              => { 'start' => '<font color="4080ff">',
+                                                                          'stop'  => '</font>' },
+                                            'esc $$$'                => { 'start' => '<font color="444444">',
+                                                                          'stop'  => '</font>' }
+                                     };
+
+
+return \%STYLESHEET;
+
+};
+
+
+
+#############################################################################
+####################### get_default_database ################################
+#############################################################################
+sub get_default_database
+{
+
+my %LANGUAGE;
+
+# written by PP
+$LANGUAGE{'plain'}      = {
+                            'filename'   => '',
+                            'regex'      => '',
+                            'patterns'   => []
+                          };
+
+
+
+
+# taken from nedit
+# modified by PP
+$LANGUAGE{'ada'}        = {
+                            'filename'   => '(?i)\\.a(d[asb]?)?$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'Comments',
+                                                'regex'      => '--.*?$',
+                                                'style'      => 'comment',
+                                                'childregex' => [],
+                                              },
+                                              {
+                                                'name'       => 'String Literals',
+                                                'regex'      => '".*?("|$)',
+                                                'style'      => 'string',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Character Literals',
+                                                'regex'      => '\'.\'',
+                                                'style'      => 'character',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Ada Attributes',
+                                                'regex'      => '\'[a-zA-Z][a-zA-Z_]+\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Numeric Literals',
+                                                'regex'      => '(((2|8|10|16)#[_0-9a-fA-F]*#)|[0-9.]+)',
+                                                'style'      => 'numeric',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Withs Pragmas Use',
+                                                'regex'      => '\\b(?i)((with|pragma|use)[ \\t\\n\\f\\r]+[a-zA-Z0-9_.]+;)+\\b',
+                                                'style'      => 'include',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Predefined Types',
+                                                'regex'      => '\\b(?i)(boolean|character|count|duration|float|integer|long_float|long_integer|priority|short_float|short_integer|string)\\b',
+                                                'style'      => 'predefined type',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Predefined Subtypes',
+                                                'regex'      => '\\b(?i)field|natural|number_base|positive|priority\\b',
+                                                'style'      => 'predefined type',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Reserved Words',
+                                                'regex'      => '\\b(?i)(abort|abs|accept|access|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|is|limited|loop|mod|new|not|null|of|or|others|out|package|pragma|private|procedure|raise|range|record|rem|renames|return|reverse|select|separate|subtype|task|terminate|then|type|use|when|while|with|xor)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Ada 95 Only',
+                                                'regex'      => '\\b(?i)(abstract|tagged|all|protected|aliased|requeue|until)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Identifiers',
+                                                'regex'      => '\\b[a-zA-Z][a-zA-Z0-9_]*\\b',
+                                                'style'      => 'identifier',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Dot All',
+                                                'regex'      => '(?i)\\.all\\b',
+                                                'style'      => 'predefined identifier',
+                                                'childregex' => []
+                                              }
+                                            ]
+                          };
+$LANGUAGE{'ada95'}      = $LANGUAGE{'ada'};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# written by JA
+$LANGUAGE{'awk'}       =  {
+                            'filename'   => '(?i)\\.awk$',
+                            'regex'      => '^\\s*#\\s*![^\\s]*awk',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'comment',
+                                                'regex'      => '#.*?$',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'string',
+                                                'regex'      => '""|".*?([^\\\\](\\\\\\\\)*)"|"\\\\\\\\"',
+#                                                'regex'      => '""|"\\\\\\\\"|"[^"\\\\]"|"[^"].*?[^\\\\]"',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'string',
+                                                'regex'      => '\'\'|\'.*?([^\\\\](\\\\\\\\)*)\'|\'\\\\\\\\\'',
+#                                                'regex'      => '\'\'|\'\\\\\\\\\'|\'[^\'\\\\]\'|\'[^\'].*?[^\\\\]\'',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'function header',
+                                                'regex'      => 'function[\\t ]+([a-zA-Z0-9_]+)[\\t \\n]*(\\{|\\n)',
+                                                'style'      => 'function header',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'function coloring',
+                                                                    'regex'      => '[\\t ]([a-zA-Z0-9_]+)',
+                                                                    'style'      => 'function header name',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'regex matching I 1',
+                                                'regex'      => '(\\b| )?(/)(\\\\/|[^/\\n])*(/[gimesox]*)',
+                                                'style'      => 'regex',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'regex matching I 2',
+                                                'regex'      => '(?:\\b| )(?:(?:m|q|qq)([!"#$%&\'*+-/]))(\\\\\\2|[^\\2\\n])*(\\2[gimesox]*)',
+                                                'style'      => 'regex',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'regex matching II',
+                                                'regex'      => '(?:\\b| )?(?:s([!"#$%&\'*+-/]))(?:\\\\\\2|[^\\2\\n])*?(\\2)[^(\\2)\\n]*?(\\2[gimesox]*)',
+                                                'style'      => 'regex',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'translate',
+                                                'regex'      => '(?:\\b| )(?:(?:tr|y)([^\w\s]))(?:\\\\\\2|[^\\2\\n])*?(\\2)[^(\\2)\\n]*?(\\2[gimesox]*)',
+                                                'style'      => 'regex',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'keywords',
+                                                'regex'      => '\\b(BEGIN|END|ARGC|ARGIND|ARGV|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS|FILENAME|FNR|FS|IGNORECASE|NF|NR|OFMT|OFS|ORS|RS|RT|RSTART|RLENGTH|SUBSEP)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'keywords 2',
+                                                'regex'      => '\\b(if|while|do|for|in|break|continue|delete|exit|next|nextfile|function)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'library fns',
+                                                'regex'      => '\\b(close|getline|print|printf|system|fflush|atan2|cos|exp|int|log|rand|sin|sqrt|srand|gensub|gsub|index|length|split|sprintf|sub|substr|tolower|toupper|systime|strftime)\\b',
+                                                'style'      => 'library function',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'braces and parens',
+                                                'regex'      => '[\\[\\]\\{\\}\\(\\)]',
+                                                'style'      => 'braces',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => '<< stuff',
+                                                'regex'      => '<<\'([^\\n]*)\';.*?^\\2$',
+                                                'style'      => 'text',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => '<< stuff',
+                                                'regex'      => '<<([^\\n]*).*?^\\2$',
+                                                'style'      => 'text',
+                                                'childregex' => []
+                                              }
+                                            ]
+                           };
+# taken from nedit
+# modified by PP
+$LANGUAGE{'c'}          = {
+                            'filename'   => '\\.[ch]$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'doc comment',
+                                                'regex'      => '/\\*\\*.*?\\*/',
+                                                'style'      => 'doc comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'comment',
+                                                'regex'      => '/\\*.*?\\*/',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'string',
+                                                'regex'      => '""|".*?([^\\\\](\\\\\\\\)*)"|"\\\\\\\\"',
+#                                                'regex'      => '""|"\\\\\\\\"|"[^"\\\\]"|"[^"].*?[^\\\\]"',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'preprocessor line',
+                                                'regex'      => '^[ \\t]*#.*?$',
+                                                'style'      => 'preprocessor',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'string',
+                                                                    'regex'      => '""|".*?([^\\\\](\\\\\\\\)*)"|"\\\\\\\\"',
+#                                                                    'regex'      => '""|"\\\\\\\\"|"[^"\\\\]"|"[^"].*?[^\\\\]"',
+                                                                    'style'      => 'string',
+                                                                    'childregex' => [
+                                                                                      {
+                                                                                        'name'       => 'esc character',
+                                                                                        'regex'      => '\\\\.',
+                                                                                        'style'      => 'esc character',
+                                                                                        'childregex' => []
+                                                                                      }
+                                                                                    ]
+                                                                  },
+                                                                  {
+                                                                    'name'       => '<files>',
+                                                                    'regex'      => '<.*?>',
+                                                                    'style'      => 'string',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'comment',
+                                                                    'regex'      => '[^/]/\\*.*?\\*/',
+                                                                    'style'      => 'comment',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'character constant',
+                                                'regex'      => '\'(\\\\)?.\'',
+                                                'style'      => 'character',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character', 
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'numeric constant',
+                                                'regex'      => '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b',
+                                                'style'      => 'numeric',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'storage keyword',
+                                                'regex'      => '\\b(const|extern|auto|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'keyword',
+                                                'regex'      => '\\b(return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'braces',
+                                                'regex'      => '[\\{\\}]',
+                                                'style'      => 'braces',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'symbols',
+                                                'regex'      => '([\\*\\-\\+=:;%&\\|<>\\(\\)\\[\\]!])',
+                                                'style'      => 'symbol',
+                                                'childregex' => []
+                                              },
+                                              { 
+                                                'name'       => 'identifiers',
+                                                'regex'      => '([a-zA-Z_][a-zA-Z_0-9]*)',
+                                                'style'      => 'identifier',
+                                                'childregex' => []
+                                              }
+                                            ]
+                          };
+# taken from nedit
+# modified by PP
+$LANGUAGE{'c++'}        = {
+                            'filename'   => '\\.(c(c|pp|xx)|h(h|pp|xx)|C(C|PP|XX)?|H(H|PP|XX)?|i)$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'doc comment',
+                                                'regex'      => '/\\*\\*.*?\\*/',
+                                                'style'      => 'doc comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'comment',
+                                                'regex'      => '/\\*.*?\\*/',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'cplus comment',
+                                                'regex'      => '//.*?$',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'string',
+                                                'regex'      => '""|"\\\\\\\\"|".*?([^\\\\](\\\\\\\\)*)"',
+#                                                'regex'      => '""|"\\\\\\\\"|"[^"\\\\]"|"[^"].*?[^\\\\]"',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'preprocessor line',
+                                                'regex'      => '^[ \\t]*#.*?$',
+                                                'style'      => 'preprocessor',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'string',
+                                                                    'regex'      => '""|".*?([^\\\\](\\\\\\\\)*)"|"\\\\\\\\"',
+#                                                                    'regex'      => '""|"\\\\\\\\"|"[^"\\\\]"|"[^"].*?[^\\\\]"',
+                                                                    'style'      => 'string',
+                                                                    'childregex' => [
+                                                                                      {
+                                                                                        'name'       => 'esc character',
+                                                                                        'regex'      => '\\\\.',
+                                                                                        'style'      => 'esc character',
+                                                                                        'childregex' => []
+                                                                                      }
+                                                                                    ]
+                                                                  },
+                                                                  {
+                                                                    'name'       => '<files>',
+                                                                    'regex'      => '<.*?>',
+                                                                    'style'      => 'string',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'comment',
+                                                                    'regex'      => '[^/]/\\*.*?\\*/',
+                                                                    'style'      => 'comment',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'cplus comment',
+                                                                    'regex'      => '//.*?$',
+                                                                    'style'      => 'comment',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'character constant',
+                                                'regex'      => '\'(\\\\)?.\'',
+                                                'style'      => 'character',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'numeric constant',
+                                                'regex'      => '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b',
+                                                'style'      => 'numeric',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'storage keyword',
+                                                'regex'      => '\\b(class|typename|typeid|template|friend|virtual|inline|explicit|operator|overload|public|private|protected|const|extern|auto|register|static|mutable|unsigned|signed|volatile|char|double|float|int|long|short|bool|wchar_t|void|typedef|struct|union|enum)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => [],
+                                              },
+                                              {
+                                                'name'       => 'keyword',
+                                                'regex'      => '\\b(new|delete|this|return|goto|if|else|case|default|switch|break|continue|while|do|for|catch|throw|sizeof|true|false|namespace|using|dynamic_cast|static_cast|reinterpret_cast)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'braces',
+                                                'regex'      => '[\\{\\}]',
+                                                'style'      => 'braces',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'symbols',
+                                                'regex'      => '([\\*\\-\\+=:;%&\\|<>\\(\\)\\[\\]!])',
+                                                'style'      => 'symbol',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'identifiers',
+                                                'regex'      => '([a-zA-Z_][a-zA-Z_0-9]*)',
+                                                'style'      => 'identifier',
+                                                'childregex' => []
+                                              }
+                                            ]
+                          };
+$LANGUAGE{'cc'}         = $LANGUAGE{'c++'};
+$LANGUAGE{'cpp'}        = $LANGUAGE{'c++'};
+$LANGUAGE{'cxx'}        = $LANGUAGE{'c++'};
+
+
+
+
+
+
+
+
+
+
+# written by VRS
+$LANGUAGE{'gpasm'}      = {
+                            'filename'   => '(?i)\\.(asm|inc)$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'args',
+                                                'regex'      => '^.*$',
+                                               'style'      => 'symbol',
+                                                'childregex' => [
+                                                {
+                                                    'name'       => 'comment',
+                                                    'regex'      => ';.*?$',
+                                                    'style'      => 'comment',
+                                                     'childregex' => []
+                                                 },
+                                                 {
+                                                     'name'       => 'labels',
+                                                     'regex'      => '^[A-Za-z_][A-Za-z_0-9]*:?',
+                                                    'style'      => 'identifier',
+                                                     'childregex' => []
+                                                 },
+
+                                                 {
+                                                     'name'       => 'menonics',
+                                                     'regex'      => '^[ \t]+[A-Za-z_][A-Za-z_0-9]*',
+                                                    'style'      => 'reserved word',
+                                                     'childregex' => []
+                                                 },
+                                              {
+                                                'name'       => 'string',
+                                                'regex'      => '""|".*?([^\\\\](\\\\\\\\)*)"|"\\\\\\\\"',
+                                               'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                   'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              }
+
+
+                                                                 ]
+                                              }
+                                            ]
+                          };
+
+
+
+
+
+
+
+
+# written by JA
+$LANGUAGE{'groff'}      = {
+                            'filename'   => '\\.groff$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'comment',
+                                                'regex'      => '\\\\".*?$',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              }
+                                            ]
+                          };
+
+
+
+
+
+
+
+
+
+
+
+# taken from nedit
+# modified by PP
+$LANGUAGE{'html'}       = {
+                            'filename'   => '(?i)\\.(html?|mhtml|php)$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'comment',
+                                                'regex'      => '<!--.*?-->',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'entity',
+                                                'regex'      => '\\&[-.a-zA-Z0-9#]*;?',
+                                                'style'      => 'entity',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'tag',
+                                                'regex'      => '<(/|!)?[-.a-zA-Z0-9]*.*?>',
+                                                'style'      => 'predefined identifier',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'double quote string',
+                                                                    'regex'      => '".*?"',
+                                                                    'style'      => 'string',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'single quote string',
+                                                                    'regex'      => '\'.*?\'',
+                                                                    'style'      => 'string',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'brackets',
+                                                                    'regex'      => '[<>]',
+                                                                    'style'      => 'braces',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'attribute',
+                                                                    'regex'      => '[^\'" ]+(?=.)',
+                                                                    'style'      => 'identifier',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              }
+                                            ]
+                       };
+
+# Added May 17, 2002, Jim M. 
+$LANGUAGE{'xml'}       = {
+                            'filename'   => '(?i)\\.(xml|xps|xsl|axp|ppd)?$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'comment',
+                                                'regex'      => '<!--.*?-->',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'entity',
+                                                'regex'      => '\\&[-.a-zA-Z0-9#]*;?',
+                                                'style'      => 'entity',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'tag',
+                                                'regex'      => '<(/|!)?[-.a-zA-Z0-9]*.*?>',
+                                                'style'      => 'predefined identifier',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'double quote string',
+                                                                    'regex'      => '".*?"',
+                                                                    'style'      => 'string',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'single quote string',
+                                                                    'regex'      => '\'.*?\'',
+                                                                    'style'      => 'string',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'brackets',
+                                                                    'regex'      => '[<>]',
+                                                                    'style'      => 'braces',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'attribute',
+                                                                    'regex'      => '[^\'" ]+(?=.)',
+                                                                    'style'      => 'identifier',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              }
+                                            ]
+                       };
+
+
+
+
+
+
+
+
+
+
+
+
+# taken from nedit
+# modified by PP
+$LANGUAGE{'java'}       = {
+                            'filename'   => '\\.java$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'doc comment',
+                                                'regex'      => '/\\*\\*.*?\\*/',
+                                                'style'      => 'doc comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'comment',
+                                                'regex'      => '/\\*.*?\\*/',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'cplus comment',
+                                                'regex'      => '//.*?$',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'string',
+                                                'regex'      => '""|".*?([^\\\\](\\\\\\\\)*)"|"\\\\\\\\"',
+#                                                'regex'      => '""|"\\\\\\\\"|"[^"\\\\]"|"[^"].*?[^\\\\]"',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'single quoted',
+                                                'regex'      => '\'\'|\'.*?([^\\\\](\\\\\\\\)*)\'|\'\\\\\\\\\'',
+#                                                'regex'      => '\'\'|\'\\\\\\\\\'|\'[^\'\\\\]\'|\'[^\'].*?[^\\\\]\'',
+                                                'style'      => 'string',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'numeric constant',
+                                                'regex'      => '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b',
+                                                'style'      => 'numeric',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'include',
+                                                'regex'      => '\\b(import|package)\\b.*?$',
+                                                'style'      => 'include',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\(.|\\n)',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'comment',
+                                                                    'regex'      => '[^/]/\\*.*?\\*/',
+                                                                    'style'      => 'comment',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'storage keyword',
+                                                'regex'      => '\\b(abstract|boolean|byte|char|class|double|extends|final|float|int|interface|long|native|private|protected|public|short|static|transient|synchronized|void|volatile|implements)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'keyword',
+                                                'regex'      => '\\b(break|case|catch|continue|default|do|else|false|finally|for|if|instanceof|new|null|return|super|switch|this|throw|throws|true|try|while)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'braces and parens',
+                                                'regex'      => '[\\{\\}\\(\\)\\[\\]]',
+                                                'style'      => 'braces',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Identifiers',
+                                                'regex'      => '\\b[a-zA-Z_][a-zA-Z0-9_]*\\b',
+                                                'style'      => 'identifier',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'symbols',
+                                                'regex'      => '([\\*\\-\\+=:;%&\\|<>!])',
+                                                'style'      => 'symbol',
+                                                'childregex' => []
+                                              }
+                                            ]
+                          };
+# taken from nedit
+# modified by PP
+$LANGUAGE{'javascript'} = {
+                            'filename'   => '(?i)\\.js$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'comment',
+                                                'regex'      => '/\\*.*?\\*/',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'cplus comment',
+                                                'regex'      => '//.*?$',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'numeric constant',
+                                                'regex'      => '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b',
+                                                'style'      => 'numeric',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'events',
+                                                'regex'      => '\\b(onAbort|onBlur|onClick|onChange|onDblClick|onDragDrop|onError|onFocus|onKeyDown|onKeyPress|onLoad|onMouseDown|onMouseMove|onMouseOut|onMouseOver|onMouseUp|onMove|onResize|onSelect|onSubmit|onUnload)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'braces',
+                                                'regex'      => '[\\{\\}]',
+                                                'style'      => 'braces',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'statements',
+                                                'regex'      => '\\b(break|continue|else|for|if|in|new|return|this|typeof|var|while|with)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'function',
+                                                'regex'      => 'function[\\t ]+([a-zA-Z0-9_]+)[\\t \\(]+.*?[\\n{]',
+                                                'style'      => 'function header',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'function args',
+                                                                    'regex'      => '\\(.*?\\)',
+                                                                    'style'      => 'function header args',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'function name',
+                                                                    'regex'      => '[\\t ][a-zA-Z0-9_]+',
+                                                                    'style'      => 'function header name',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },  
+                                              {
+                                                'name'       => 'built in object type',
+                                                'regex'      => '\\b(anchor|Applet|Area|Array|button|checkbox|Date|document|elements|FileUpload|form|frame|Function|hidden|history|Image|link|location|Math|navigator|Option|password|Plugin|radio|reset|select|string|submit|text|textarea|window)\\b',
+                                                'style'      => 'predefined type',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'string',
+                                                'regex'      => '".*?("|$)',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'colors',
+                                                                    'regex'      => '(aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|#008000|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|#[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9])',
+                                                                    'style'      => 'identifier',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'string',
+                                                'regex'      => '\'.*?(\'|$)',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'colors',
+                                                                    'regex'      => '(aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|#008000|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|#[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9])',
+                                                                    'style'      => 'identifier',
+                                                                    'childregex' => [],
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'event capturing',
+                                                'regex'      => '\\b(captureEvents|releaseEvents|routeEvent|handleEvent)\\b.*?(\\)|$)',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'predefined methods',
+                                                'regex'      => '\\b(abs|acos|alert|anchor|asin|atan|atan2|back|big|blink|blur|bold|ceil|charAt|clear|clearTimeout|click|close|confirm|cos|escape|eval|exp|fixed|floor|focus|fontcolor|fontsize|forward|getDate|getDay|getHours|getMinutes|getMonth|getSeconds|getTime|getTimezoneOffset|getYear|go|indexOf|isNaN|italics|javaEnabled|join|lastIndexOf|link|log|max|min|open|parse|parseFloat|parseInt|pow|prompt|random|reload|replace|reset|reverse|round|scroll|select|setDate|setHours|setMinutes|setMonth|setSeconds|setTimeout|setTime|setYear|sin|small|sort|split|sqrt|strike|sub|submit|substring|sup|taint|tan|toGMTString|toLocaleString|toLowerCase|toString|toUpperCase|unescape|untaint|UTC|write|writeln)\\b',
+                                                'style'      => 'library function',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'properties',
+                                                'regex'      => '\\b(action|alinkColor|anchors|appCodeName|appName|appVersion|bgColor|border|checked|complete|cookie|defaultChecked|defaultSelected|defaultStatus|defaultValue|description|E|elements|enabledPlugin|encoding|fgColor|filename|forms|frames|hash|height|host|hostname|href|hspace|index|lastModified|length|linkColor|links|LN2|LN10|LOG2E|LOG10E|lowsrc|method|name|opener|options|parent|pathname|PI|port|protocol|prototype|referrer|search|selected|selectedIndex|self|SQRT1_2|SQRT2|src|status|target|text|title|top|type|URL|userAgent|value|vlinkColor|vspace|width|window)\\b',
+                                                'style'      => 'predefined identifier',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'operators',
+                                                'regex'      => '([=;->/&|])',
+                                                'style'      => 'symbol',
+                                                'childregex' => []
+                                              }
+                                            ]
+                          };
+$LANGUAGE{'js'}         = $LANGUAGE{'javascript'};
+
+
+
+
+
+
+
+
+# written by Andreas Krennmair
+# extremely incomplete
+
+$LANGUAGE{'lisp'}       = {
+                            'filename' => '\\.(lsp|l)$',
+                           'regex' => '',
+                            'patterns' => [
+                               {
+                                 'name'       => 'parens',
+                                 'regex'      => '[()]',
+                                 'style'      => 'braces',
+                                 'childregex' => []
+                               },
+                               {
+                                 'name'       => 'comment',
+                                 'regex'      => ';.*?$',
+                                 'style'      => 'comment',
+                                 'childregex' => []
+                               },
+                               {
+                                 'name'       => 'string',
+                                 'regex'      => '".*?("|$)',
+                                 'style'      => 'string',
+                                 'childregex' => []
+                               },
+                               {
+                                 'name'       => 'keywords',
+                                 'regex'      => '\\b(defun |xyz)\\b',
+                                 'style'      => 'reserved word',
+                                 'childregex' => []
+                               },
+                               {
+                                 'name'       => 'numeric constant',
+                                 'regex'      => '(#\([0-9]+ [0-9]+\)|[0-9]+)',
+                                 'style'      => 'numeric',
+                                 'childregex' => []
+                               },
+                               {
+                                 'name'       => 'identifiers',
+                                 'regex'      => '([-a-zA-Z]+)',
+                                 'style'      => 'identifier',
+                                 'childregex' => []
+                               }
+                            ]
+                          };
+
+
+
+
+
+
+
+
+
+
+# written by JA
+$LANGUAGE{'m4'}         = {
+                            'filename'   => '\\.m4$',
+                            'regex'      => '',
+                            'patterns' => [
+                                            {
+                                              'regex'      => 'dnl.*?$',
+                                              'style'      => 'doc comment',
+                                              'childregex' => []
+                                            },
+                                            {
+                                              'regex'      => '#.*?$',
+                                              'style'      => 'comment',
+                                              'childregex' => []
+                                            },
+                                            {
+                                              'regex'      => '\\b(define|undefine|defn|pushdef|popdef|indir|builtin|changequote|changecom|changeword|m4wrap|m4exit|include|sinclude|divert|undivert|divnum|cleardiv|shift|dumpdef|traceon|traceoff|debugfile|debugmode|len|index|regexp|substr|translit|patsubst|format|incr|decr|syscmd|esyscmd|sysval|maketemp|errprint)\\b',
+                                              'style'      => 'reserved word',
+                                              'childregex' => []
+                                            },
+                                            {
+                                              'regex'      => '\\b(ifdef|ifelse|loops)\\b',
+                                              'style'      => 'reserved word',
+                                              'childregex' => [
+                                                                {
+                                                                  'regex'      => '[$]\\$?({[^}]*}|[^a-zA-Z0-9_/\\t\\n\\.,\\\\[\\\\{\\\\(]|[0-9]+|[a-zA-Z_][a-zA-Z0-9_]*)?',
+                                                                  'style'      => 'identifier',
+                                                                  'childregex' => []
+                                                                }
+                                                              ]
+                                            }
+                                          ]
+                          };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# taken from nedit
+# modified by PP
+$LANGUAGE{'make'}       = {
+                            'filename'   => '[Mm]akefile.*',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'Comment',
+                                                'regex'      => '#.*?$',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Assignment',
+                                                'regex'      => '^( *| [ \\t]*)[A-Za-z0-9_+]*[ \\t]*(\\+|:)?=',
+                                                'style'      => 'assignment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Dependency Line',
+                                                'regex'      => '^ *([A-Za-z0-9./$(){} _%+-]|\\n)*::?',
+                                                'style'      => 'dependency line',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'Dependency Target',
+                                                                    'regex'      => '[A-Za-z0-9./$(){} _%+-]+',
+                                                                    'style'      => 'dependency target',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'Dependency Continuation',
+                                                                    'regex'      => '\\\\\\n',
+                                                                    'style'      => 'dependency continuation',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'comment',
+                                                                    'regex'      => '#.*?$',
+                                                                    'style'      => 'comment',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'macro',
+                                                                    'regex'      => '\\$([A-Za-z0-9_]|\\([^)]*\\)|{[^}]*})',
+                                                                    'style'      => 'macro',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'int macro',
+                                                                    'regex'      => '\\$([<@*?%]|\\$@)',
+                                                                    'style'      => 'int macro',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'Continuation',
+                                                'regex'      => '\\\\$',
+                                                'style'      => 'continuation',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Macro',
+                                                'regex'      => '\\$([A-Za-z0-9_]|\\([^)]*\\)|{[^}]*})',
+                                                'style'      => 'macro',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Internal Macro',
+                                                'regex'      => '\\$([<@*?%]|\\$@)',
+                                                'style'      => 'int macro',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Escaped $$$',
+                                                'regex'      => '\\$\\$',
+                                                'style'      => 'esc $$$',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'Include',
+                                                'regex'      => '^include[ \\t]',
+                                                'style'      => 'include',
+                                                'childregex' => []
+                                              }
+                                            ]
+                          };
+$LANGUAGE{'makefile'} = $LANGUAGE{'make'};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# taken from nedit
+# modified by PP
+$LANGUAGE{'pas'}        = {
+                            'filename'   => '(?i)\\.p(as)?$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'comment1 (*    *)',
+                                                'regex'      => '\\(\\*.*?\\*\\)',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'comment2 {    }',
+                                                'regex'      => '\\{.*?\\}',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'string',
+                                                'regex'      => '\'.*?(\'|$)',
+                                                'style'      => 'string',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'preprocessor line',
+                                                'regex'      => '^[ \\t]*#.*?$',
+                                                'style'      => 'preprocessor',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'comment1 (*    *)',
+                                                                    'regex'      => '\\(\\*.*?\\*\\)',
+                                                                    'style'      => 'comment',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'comment2 {    }',
+                                                                    'regex'      => '\\{.*?\\}',
+                                                                    'style'      => 'comment',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'character constant',
+                                                'regex'      => '\'.\'',
+                                                'style'      => 'character',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'numeric constant',
+                                                'regex'      => '\\b((0(x|X)[0-9a-fA-F]*)|[0-9.]+((e|E)(\\+|-)?)?[0-9]*)(L|l|UL|ul|u|U|F|f)?\\b',
+                                                'style'      => 'numeric',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'storage and ops',
+                                                'regex'      => '\\b(?i)(and|array|const|div|export|file|function|import|in|label|mod|module|nil|not|only|or|packed|pow|pragma|procedure|program|protected|qualified|record|restricted|set|type|var)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'keywords',
+                                                'regex'      => '\\b(?i)(begin|case|do|downto|else|end|for|goto|if|of|otherwise|repeat|then|to|until|while|with)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'sumbols',
+                                                'regex'      => '([\\*\\-\\+=:;<>\\(\\)\\[\\]!]|[^/]/[^/])',
+                                                'style'      => 'symbol',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'identifiers',
+                                                'regex'      => '([a-zA-Z_][a-zA-Z_0-9.^]*[a-zA-Z_0-9]|[a-zA-Z_][a-zA-Z_0-9]*)',
+                                                'style'      => 'identifier',
+                                                'childregex' => [
+                                                                  {
+                                                                    'regex'      => '(\\.|\\^)+',
+                                                                    'style'      => 'symbol',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              }
+                                            ],
+                          };
+$LANGUAGE{'pascal'}     = $LANGUAGE{'pas'};
+
+# taken from nedit
+# modified by PP
+# modified by BS
+# modified by JD
+# modified by JP
+$LANGUAGE{'perl'}       = {
+                            'filename'   => '(?i)\\.p([lm5]|od)$',
+                            'regex'      => '^\\s*#\\s*!([^\\s]*\\b|.*env\\s+)perl',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'comment',
+                                                'regex'      => '(?:#.*?(?:\r?\n\s*)+)+',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'variables',
+                                                'regex'      => '[\\$@%]\\$?(?:{[^}]*}|[^a-zA-Z0-9_/\\t\\n\\.,\\\\[\\\\{\\\\(]|[0-9]+|[a-zA-Z_][a-zA-Z0-9_]*)?',
+                                                'style'      => 'identifier',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => '"" string',
+                                                'regex'      => '""|".*?([^\\\\](\\\\\\\\)*)"|"\\\\\\\\"',
+#                                                'regex'      => '""|"\\\\\\\\"|"[^"\\\\]"|"[^"].*?[^\\\\]"',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'variables',
+                                                                    'regex'      => '[\\$@%]\\$?(?:{[^}]*}|[^a-zA-Z0-9_/\\t\\n\\.,\\\\[\\\\{\\\\(]|[0-9]+|[a-zA-Z_][a-zA-Z0-9_]*)?',
+                                                                    'style'      => 'identifier',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => '\'\' string',
+                                                'regex'      => '\'\'|\'.*?([^\\\\](\\\\\\\\)*)\'|\'\\\\\\\\\'',
+#                                                'regex'      => '\'\'|\'\\\\\\\\\'|\'[^\'\\\\]\'|\'[^\'].*?[^\\\\]\'',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'more strings - q// qw//',
+                                                'regex'      => '(?:\\b| )(?:q|qw)([^\w\s])(?:\\\\\\2|[^\\2\\n])*\\2',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'more strings - qq// qx//',
+                                                'regex'      => '(?:\\b| )(?:qq|qx)([^\w\s])(?:\\\\\\2|[^\\2\\n])*\\2',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'variables',
+                                                                    'regex'      => '[\\$@%]\\$?(?:{[^}]*}|[^a-zA-Z0-9_/\\t\\n\\.,\\\\[\\\\{\\\\(]|[0-9]+|[a-zA-Z_][a-zA-Z0-9_]*)?',
+                                                                    'style'      => 'identifier',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'subroutine header',
+                                                'regex'      => 'sub[\\t ]+(?:[a-zA-Z0-9_]+)[\\t \\n]*(?:\\{|\\(|\\n)',
+                                                'style'      => 'function header',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'subroutine header coloring',
+                                                                    'regex'      => '[\\t ][a-zA-Z0-9_]+',
+                                                                    'style'      => 'function header name',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'regex matching I',
+                                                'regex'      => '(?:\\b| )?(?:/(?:\\\\/|[^/\\n])*(?:/[gimesox]*)|s([^\w\s])(?:\\\\\\2|[^\\2\\n])*?(\\2)[^(\\2)\\n]*?(\\2[gimesox]*))',
+                                                'style'      => 'regex',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'regex matching II',
+                                                'regex'      => '(?:\\b| )(?:m|qq?|tr|y)([^\w\s])(?:\\\\\\2|[^\\2\\n])*(?:\\2[gimesox]*)',
+                                                'style'      => 'regex',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'keywords',
+                                                'regex'      => '\\b(my|local|new|if|until|while|elsif|else|eval|unless|for|foreach|continue|exit|die|last|goto|next|redo|return|local|exec|do|use|require|package|eval|BEGIN|END|eq|ne|not|\\|\\||\\&\\&|and|or)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'library functions',
+                                                'regex'      => '\\b(?:a(?:bs|ccept|larm|tan2)|b(?:ind|inmode|less)|c(?:aller|hdir|hmod|homp|hop|hr|hroot|hown|losedir|lose|onnect|os|rypt)|d(?:bmclose|bmopen|efined|elete|ie|ump)|e(?:ach|nd(?:grent|hostent|netent|protoent|pwent|servent)|of|xec|xists|xp)|f(?:ctnl|ileno|lock|ork|ormat|ormline)|g(?:et(?:c|grent|grgid|grnam|hostbyaddr|hostbyname|hostent|login|netbyaddr|netbyname|netent|peername|pgrp|ppid|priority|protobyname|protobynumber|protoent|pwent|pwnam|pwuid|servbyname|servbyport|servent|sockname|sockopt)|lob|mtime|rep)|hex|i(?:mport|ndex|nt|octl)|join|keys|kill|l(?:cfirst|c|ength|ink|isten|og|ocaltime|stat)|m(?:ap|kdir|sgctl|sgget|sgrcv)|no|o(?:ct|pendir|pen|rd)|p(?:ack|ipe|op|os|rintf|rint|ush)|quotemeta|r(?:and|eaddir|ead|eadlink|ecv|ef|ename|eset|everse|ewinddir|index|mdir)|s(?:calar|eekdir|eek|elect|emctl|emget|emop|end|et(?:grent|hostent|netent|pgrp|priority|protoent|pwent|sockopt)|hift|hmctl|hmget|hmread|hmwrite|hutdown|in|leep|ocket|ocketpair|ort|plice|plit|printf|qrt|rand|tat|tudy|ubstr|ymlink|yscall|ysopen|ysread|ystem|yswrite)|t(?:elldir|ell|ie|ied|ime|imes|runcate)|u(?:c|cfirst|mask|ndef|nlink|npack|nshift|ntie|time)|values|vec|w(?:ait|aitpid|antarray|arn|rite)|qw|-[rwxoRWXOezsfdlpSbctugkTBMAC])\\b',
+                                                'style'      => 'library function',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'braces, parens and brakets',
+                                                'regex'      => '[\\[\\]\\{\\}\\(\\)]',
+                                                'style'      => 'braces',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => '<< stuff',
+                                                'regex'      => '<<(?:("|\')([^\\n]*)\\2|\\w*).*?^\\3$',
+                                                'style'      => 'text',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'POD',
+                                                'regex'      => '^=.*?^(?:=cut|\\Z)',
+                                                'style'      => 'doc comment',
+                                                'childregex' => []
+                                              }
+                                            ]
+                          };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Thanks to Matt Giwer <jull43 AT ij.net>
+$LANGUAGE{'pov'}        = {
+                            'filename'   => '(?i)\\.pov$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'doc comment',
+                                                'regex'      => '/\\*\\*.*?\\*/',
+                                                'style'      => 'doc comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'comment',
+                                                'regex'      => '/\\*.*?\\*/',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'cplus comment',
+                                                'regex'      => '//.*?$',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'string',
+                                                'regex'      => '""|".*?([^\\\\](\\\\\\\\)*)"|"\\\\\\\\"',
+#                                                'regex'      => '""|"\\\\\\\\"|"[^"\\\\]"|"[^"].*?[^\\\\]"',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'preprocessor line',
+                                                'regex'      => '^[ \\t]*#.*?$',
+                                                'style'      => 'preprocessor',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'string',
+                                                                    'regex'      => '""|".*?([^\\\\](\\\\\\\\)*)"|"\\\\\\\\"',
+#                                                                    'regex'      => '""|"\\\\\\\\"|"[^"\\\\]"|"[^"].*?[^\\\\]"',
+                                                                    'style'      => 'string',
+                                                                    'childregex' => [
+                                                                                      {
+                                                                                        'name'       => 'esc character',
+                                                                                        'regex'      => '\\\\.',
+                                                                                        'style'      => 'esc character',
+                                                                                        'childregex' => []
+                                                                                      }
+                                                                                    ]
+                                                                  },
+                                                                  {
+                                                                    'name'       => '<files>',
+                                                                    'regex'      => '<.*?>',
+                                                                    'style'      => 'string',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'comment',
+                                                                    'regex'      => '[^/]/\\*.*?\\*/',
+                                                                    'style'      => 'comment',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'cplus comment',
+                                                                    'regex'      => '//.*?$',
+                                                                'style'      => 'comment',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'character constant',
+                                                'regex'      => '\'(\\\\)?.\'',
+                                                'style'      => 'character',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                    'style'      => 'esc character', 
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'numeric constant',
+                                                'regex'      => '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b',
+                                                'style'      => 'numeric',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'keyword',
+                                                'regex'      => '\\b(abs|absorption|acos|acosh|adaptive|adc_bailout|agate|agate_turb|all|alpha|ambient|ambient_light|angle|aperture|append|arc_angle|area_light|array|asc|asin|asinh|assumed_gamma|atan|atan2|atanh|average|background|bezier_spline|bicubic_patch|black_hole|blob|blue|blur_samples|bounded_by|box|boxed|bozo|break|brick|brick_size|brightness|brilliance|bumps|bump_map|bump_size|camera|case|caustics|ceil|checker|chr|clipped_by|clock|clock_delta|color|color_map|colour|colour_map|component|composite|concat|cone|confidence|conic_sweep|control0|control1|cos|cosh|count|crackle|crand|cube|cubic|cubic_spline|cubic_wave|cylinder|cylindrical|debug|declare|default|defined|degrees|density|density_file|density_map|dents|difference|diffuse|dimensions|dimension_size|direction|disc|distance|distance_maximum|div|eccentricity|else|emission|end|error|error_bound|exp|extinction|fade_distance|fade_power|falloff|falloff_angle|false|fclose|file_exists|filter|finish|fisheye|flatness|flip|floor|focal_point|fog|fog_alt|fog_offset|fog_type|fopen|frequency|gif|global_settings|gradient|granite|gray_threshold|green|height_field|hexagon|hf_gray_16|hierarchy|hollow|hypercomplex|if|ifdef|iff|ifndef|image_map|include|int|interior|interpolate|intersection|intervals|inverse|ior|irid|irid_wavelength|jitter|julia_fractal|lambda|lathe|leopard|light_source|linear_spline|linear_sweep|local|location|log|looks_like|look_at|low_error_factor|macro|mandel|map_type|marble|material|material_map|matrix|max|max_intersections|max_iteration|max_trace_level|media|media_attenuation|media_interaction|merge|mesh|metallic|min|minimum_reuse|mod|mortar|nearest_count|no|normal|normal_map|no_shadow|number_of_waves|object|octaves|off|offset|omega|omnimax|on|once|onion|open|orthographic|panoramic|perspective|pgm|phase|phong|phong_size|pi|pigment|pigment_map|planar|plane|png|point_at|poly|polygon|poly_wave|pot|pow|ppm|precision|prism|pwr|quadratic_spline|quadric|quartic|quaternion|quick_color|quick_colour|quilted|radial|radians|radiosity|radius|rainbow|ramp_wave|rand|range|ratio|read|reciprocal|recursion_limit|red|reflection|reflection_exponent|refraction|render|repeat|rgb|rgbf|rgbft|rgbt|right|ripples|rotate|roughness|samples|scale|scallop_wave|scattering|seed|shadowless|sin|sine_wave|sinh|sky|sky_sphere|slice|slope_map|smooth|smooth_triangle|sor|specular|sphere|spherical|spiral1|spiral2|spotlight|spotted|sqr|sqrt|statistics|str|strcmp|strength|strlen|strlwr|strupr|sturm|substr|superellipsoid|switch|sys|t|tan|tanh|text|texture|texture_map|tga|thickness|threshold|tightness|tile2|tiles|torus|track|transform|translate|transmit|triangle|triangle_wave|true|ttf|turbulence|turb_depth|type|u|ultra_wide_angle|undef|union|up|use_color|use_colour|use_index|u_steps|v|val|variance|vaxis_rotate|vcross|vdot|version|vlength|vnormalize|vrotate|v_steps|warning|warp|water_level|waves|while|width|wood|wrinkles|write|x|y|yes|z)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'braces',
+                                                'regex'      => '[\\{\\}]',
+                                                'style'      => 'braces',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'symbols',
+                                                'regex'      => '([\\*\\-\\+=:;%&\\|<>\\(\\)\\[\\]!])',
+                                                'style'      => 'symbol',
+                                                'childregex' => []
+                                              },
+                                              { 
+                                                'name'       => 'identifiers',
+                                                'regex'      => '([a-zA-Z_][a-zA-Z_0-9]*)',
+                                                'style'      => 'identifier',
+                                                'childregex' => []
+                                              }
+                                            ]
+                            };
+$LANGUAGE{'povray'}     = $LANGUAGE{'pov'};
+   
+
+
+# by Tom Good 
+$LANGUAGE{'python'}        = {
+                            'filename'   => '(?i)\\.py$',
+                            'regex'      => '^\\s*#\\s*![^\\s]*python',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'python comment',
+                                                'regex'      => '#.*?$',
+                                               'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                             {
+                                                'name'       => 'single quote string',
+                                                'regex'      => '\'.*?\'',
+                                               'style'      => 'string',
+                                                'childregex' => []
+                                              },
+                                                            
+                                              {
+                                                'name'       => 'string',
+                                                'regex'      => '""|"\\\\\\\\"|".*?([^\\\\](\\\\\\\\)*)"',
+                                                'regex'      => '""|".*?([^\\\\](\\\\\\\\)*)"|"\\\\\\\\"',
+                                                'regex'      => '""|"\\\\\\\\"|"[^"\\\\]"|"[^"].*?[^\\\\]"',
+                                               'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                   'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'character constant',
+                                                'regex'      => '\'(\\\\)?.\'',
+                                               'style'      => 'character',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '\\\\.',
+                                                                   'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'numeric constant',
+                                                'regex'      => '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b',
+                                               'style'      => 'numeric',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'keyword',
+                                                'regex'      => '\\b(and|assert|break|class|continue|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while)\\b',
+                                               'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'braces',
+                                                'regex'      => '[\\{\\}]',
+                                               'style'      => 'braces',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'symbols',
+                                                'regex'      => '([\\*\\-\\+=:;%&\\|<>\\(\\)\\[\\]!])',
+                                               'style'      => 'symbol',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'identifiers',
+                                                'regex'      => '([a-zA-Z_][a-zA-Z_0-9]*)',
+                                               'style'      => 'identifier',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'function',
+                                                'regex'      => '[\\t ]*def[\\t ]+([a-zA-Z0-9_]+)[\\t \\(]+.*?[\\n{]',
+                                               'style'      => 'function header',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'function args',
+                                                                    'regex'      => '\\(.*?\\)',
+                                                                   'style'      => 'function header args',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'function name',
+                                                                    'regex'      => '[\\t ][a-zA-Z0-9_]+',
+                                                                   'style'      => 'function header name',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },  
+                                              {
+                                                'name'       => 'library functions',
+                                                'regex'      => '\\b(__import__|abs|apply|buffer|callable|chr|cmp|coerce|compile|complex|delatter|dir|divmod|eval|execfile|filter|float|getattr|globals|hasattr|hash|hex|id|input|int|intern|isinstance|issubclass|len|list|locals|long|map|max|min|oct|open|ord|pow|range|raw_input|reduce|reload|repr|round|setattr|slice|str|tuple|type|unichr|unicode|vars|xrange|zip)\\b',
+                                               'style'      => 'library function',
+                                                'childregex' => []
+                                              },
+                                            ]
+                          };
+
+
+# by Joshua Swink <jswink AT pacbell.net>
+$LANGUAGE{'ruby'}       = {
+                            'filename'   => '\\.rb$',
+                            'regex'      => '^\\s*#\\s*![^\\s]*\\bruby\\b',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'comment',
+                                                'regex'      => '(?:#.*?(?:\r?\n\s*)+)+',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'predefined variables',
+                                                'regex'      => '(?:\\$(?:[!@&`\'+\\d~=/\\\\,;.<>_*\\$?:"]|DEBUG|FILENAME|LOAD_PATH|stdin|stdout|stderr|VERBOSE|-[0adFiIlpv])|\\b(?:TRUE|FALSE|NIL|STDIN|STDOUT|STDERR|ENV|ARGF|ARGV|DATA|RUBY_VERSION|RUBY_RELEASE_DATE|RUBY_PLATFORM)\\b)',
+                                                'style'      => 'predefined identifier',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'variables',
+                                                'regex'      => '[\\$@](?:{[^}]*}|[^\\w/\\t\\n\\.,\\\\[\\\\{\\\\(]|[0-9]+|[a-zA-Z_][\\w.]*)?',
+                                                'style'      => 'identifier',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => '"" string',
+                                                'regex'      => '""|"(?:\\\\\\\\)+"|".*?(?:[^\\\\](?:\\\\\\\\)*)"|%[Qwx]?([^\\w\\[\\](){}<>])\\2|%[Qwx]?([^\\w\\[\\](){}<>]).*?(?:[^\\\\](?:\\\\\\\\)*)\\3|%[Qwx]?([^\\w\\[\\](){}<>])\\\\\\\\\\4|%[Qwx]?\\[\\]|%[Qwx]?\\[.*?([^\\\\](\\\\\\\\)*)\\]|%[Qwx]?\\[\\\\\\\\\\]|%[Qwx]?\\{\\}|%[Qwx]?\\{.*?([^\\\\](\\\\\\\\)*)\\}|%[Qwx]?\\{\\\\\\\\\\}|%[Qwx]?\\(\\)|%[Qwx]?\\(.*?([^\\\\](\\\\\\\\)*)\\)|%[Qwx]?\\(\\\\\\\\\\)|%[Qwx]?<>|%[Qwx]?<.*?([^\\\\](\\\\\\\\)*)>|%[Qwx]?<\\\\\\\\>',
+
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex',     => '\\\\(?:x[\\da-fA-F]{2}|\d\d\d|c.|M-\\\\C-.|M-.|C-.|.)',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'string expression',
+                                                                    'regex'      => '#[\\$\\@][a-zA-Z_][\\w.]*|#\\{[\\$\\@]?[^\\}]*\\}',
+                                                                    'style'      => 'identifier',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => '\'\' string',
+                                                'regex'      => '\'\'|\'(?:\\\\\\\\)+\'|\'.*?(?:[^\\\\](?:\\\\\\\\)*)\'|%q([^\\w\\[\\](){}<>])\\2|%q([^\\w\\[\\](){}<>]).*?(?:[^\\\\](?:\\\\\\\\)*)\\3|%q([^\\w\\[\\](){}<>])\\\\\\\\\\4|%q\\[\\]|%q\\[.*?([^\\\\](\\\\\\\\)*)\\]|%q\\[\\\\\\\\\\]|%q\\{\\}|%q\\{.*?([^\\\\](\\\\\\\\)*)\\}|%q\\{\\\\\\\\\\}|%q\\(\\)|%q\\(.*?([^\\\\](\\\\\\\\)*)\\)|%q\\(\\\\\\\\\\)|%q<>|%q<.*?([^\\\\](\\\\\\\\)*)>|%q<\\\\\\\\>',
+                                                'style'      => 'string',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'esc character',
+                                                                    'regex'      => '(?:\\\\\'|\\\\\\\\)',
+                                                                    'style'      => 'esc character',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'subroutine header',
+                                                'regex'      => 'def[\\t ]+\\w[\\w.]*(?:\\([^)]*\\))?',
+                                                'style'      => 'function header',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'arg list',
+                                                                    'regex'      => '\\(.*\\)',
+                                                                    'style'      => 'function header args',
+                                                                    'childregex' => [
+                                                                         {
+                                                                         'name' => 'arg list parens',
+                                                                         'regex' => '[\\(\\)]',
+                                                                         'style' => 'symbol',
+                                                                         'childregex' => []
+                                                                         }
+                                                                                    ]
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'subroutine header',
+                                                                    'regex'      => '[\\t ]\w+',
+                                                                    'style'      => 'function header name',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'class header',
+                                                'regex'      => 'class[\\t ]+\\w+(?:\\s*<\\s*\\w+)?',
+                                                'style'      => 'function header',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'class ancestor',
+                                                                    'regex'      => '<\\s*\\w+',
+                                                                    'style'      => 'include',
+                                                                    'childregex' => [
+                                                                             {
+                                                                             'name' => 'inheritance doohickey',
+                                                                             'regex' => '<',
+                                                                             'style' => 'symbol',
+                                                                             'childregex' => []
+                                                                             }
+                                                                                    ]
+                                                                  },
+                                                                  {
+                                                                    'name'       => 'class main',
+                                                                    'regex'      => '[\\t ]\\w+',
+                                                                    'style'      => 'type',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'regex matching 0',
+                                                'regex'      => '(?:%r([^\\w\\[\\](){}<>])\\2|%r([^\\w\\[\\](){}<>]).*?(?:[^\\\\](?:\\\\\\\\)*)\\3|%r([^\\w\\[\\](){}<>])\\\\\\\\\\4|%r\\[\\]|%r\\[.*?([^\\\\](\\\\\\\\)*)\\]|%r\\[\\\\\\\\\\]|%r\\{\\}|%r\\{.*?([^\\\\](\\\\\\\\)*)\\}|%r\\{\\\\\\\\\\}|%r\\(\\)|%r\\(.*?([^\\\\](\\\\\\\\)*)\\)|%r\\(\\\\\\\\\\)|%r<>|%r<.*?([^\\\\](\\\\\\\\)*)>|%r<\\\\\\\\>)[ixpno]*',
+                                                'style'      => 'regex',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'string expression',
+                                                                    'regex'      => '#[\\$\\@][a-zA-Z_][\\w.]*|#\\{[\\$\\@]?[a-zA-Z_][^\\}]*\\}',
+                                                                    'style'      => 'identifier',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'regex matching I',
+                                                'regex'      => '(?:\\b| )?(?:/(?:\\\\/|[^/\\n])*(?:/[ixpno]*))',
+                                                'style'      => 'regex',
+                                                'childregex' => [
+                                                                  {
+                                                                    'name'       => 'string expression',
+                                                                    'regex'      => '#[\\$\\@][a-zA-Z_][\\w.]*|#\\{[\\$\\@]?[a-zA-Z_][^\\}]*\\}',
+                                                                    'style'      => 'identifier',
+                                                                    'childregex' => []
+                                                                  }
+                                                                ]
+                                              },
+                                              {
+                                                'name'       => 'reserved words',
+                                                'regex'      => '\\b(BEGIN|class|ensure|nil|self|when|END|def|false|not|super|while|alias|defined|for|or|then|yield|and|do|if|redo|true|begin|else|in|rescue|undef|break|elsif|module|retry|unless|case|end|next|return|until)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'kernel module methods',
+                                                'regex',     => '\\b(Array|Float|Integer|String|at_exit|autoload|binding|caller|catch|chop|chomp|chomp!|eval|exec|exit|fail|fork|format|gets|global_variables|gsub|iterator|lambda|load|local_variables|loop|open|p|print|printf|proc|putc|puts|raise|rand|readline|readlines|require|select|sleep|split|sprintf|srand|sub|syscall|system|test|trace_var|trap|untrace_var)\\b',
+                                                'style'      => 'library function',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'braces, parens and brakets',
+                                                'regex'      => '[\\[\\]\\{\\}\\(\\)]',
+                                                'style'      => 'braces',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => '<< stuff',
+                                                'regex'      => '<<(?:("|\')([^\\n]*)\\2|\\w*).*?^\\3$',
+                                                'style'      => 'text',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'symbols',
+                                                'regex'      => '(?:[:*-+<>=^!,/]+|\.\.+)',
+                                                'style'      => 'symbol',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'numbers',
+                                                'regex'      => '\d[\d.]*',
+                                                'style'      => 'numeric',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'embedded documentation',
+                                                'regex'      => '^=.*?^(?:=end|\\Z)',
+                                                'style'      => 'doc comment',
+                                                'childregex' => []
+                                              }
+                                            ]
+                          };
+
+# taken from nedit
+# modified by PP
+# very inclomplete!
+$LANGUAGE{'sql'}        = {
+                            'filename'   => '(?i)\\.sql$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'keywords I',
+                                                'regex'      => '(?i)(,|%|<|>|:=|=|\\(|\\)|\\bselect|on|from|order by|desc|where|and|or|not|null|true|false)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'comment I',
+                                                'regex'      => '--.*?$',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'comment II',
+                                                'regex'      => '/\\*.*?\\*/',
+                                                'style'      => 'comment',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'string',
+                                                'regex'      => '\'\'|\'.*?([^\\\\](\\\\\\\\)*)\'|\'\\\\\\\\\'',
+#                                                'regex'      => '(\'\'|\'[^\'\\\\]\'|\'[^\'].*?[^\\\\]\')',
+                                                'style'      => 'string',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'keywords II',
+                                                'regex'      => '(?i)end if;|\\b(create|replace|begin|end|function|return|fetch|open|close|into|is|in|when|others|grant|on|to|exception|show|set|out|pragma|as|package)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'keywords III',
+                                                'regex'      => '(?i)\\balter\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'datatypes',
+                                                'regex'      => '(?i)\\b(integer|blol|date|numeric|character|varying|varchar|char)\\b',
+                                                'style'      => 'predefined type',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'words',
+                                                'regex'      => '(?i)\\b(constraint|key|references|primary|table|foreign|add|insert|group by)\\b',
+                                                'style'      => 'reserved word',
+                                                'childregex' => []
+                                              }
+                                            ]
+                            };
+
+   
+
+# enhanced by W. Friebel
+$LANGUAGE{'patch'}        = {
+                            'filename'   => '(?i)\\.patch$|\\.diff$',
+                            'regex'      => '',
+                            'patterns'   => [
+                                              {
+                                                'name'       => 'header',
+                                                'regex'      => '^Index: .*?$|^===== .*?$|^diff .*?$|^--- .*?$|^\+\+\+ .*?$|^\*\*\* .*?$',
+                                                'style'      => 'separator',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'hunk',
+                                                'regex'      => '^@@ .*?$',
+                                                'style'      => 'line spec',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'from',
+                                                'regex'      => '^-.*?$',
+                                                'style'      => 'deletion',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'to',
+                                                'regex'      => '^\+.*?$',
+                                                'style'      => 'insertion',
+                                                'childregex' => []
+                                              },
+                                              {
+                                                'name'       => 'mod',
+                                                'regex'      => '^\!.*?$',
+                                                'style'      => 'modification',
+                                                'childregex' => []
+                                              },
+                                            ]
+                            };
+
+
+
+#####
+#
+# LANGUAGE: shell script
+#
+
+$LANGUAGE{'shellscript'} = {
+       'filename' => '\\.(sh|shell)$',
+       'regex' => '^\\s*#\\s*![^\\s]*(sh|bash|ash|zsh|ksh)',
+       'patterns' => [ {
+               'name' => 'comment',
+#              'regex' => '^[ \t]*[^$]?\#[^!]?.*?$',
+               'regex' => '(^| )#([^\\!].)*?$',
+               'style' => 'comment',
+               'childregex' => []
+       }, {
+               'name' => 'identifier',
+               'regex' => '[a-zA-Z][a-zA-Z0-9_]*=',
+               'style' => 'identifier',
+               'childregex' => [ {
+                       'name' => 'identifier',
+                       'regex' => '[a-zA-Z][a-zA-Z0-9_]*',
+                       'style' => 'identifier',
+                       'childregex' => []
+               } ]
+       }, {
+               'name' => 'identifier',
+               'regex' => '\\$([0-9#\\*]|[a-zA-Z][a-zA-Z0-9_]*)',
+               'style' => 'identifier',
+               'childregex' => []
+       }, {
+               'name' => 'interpreter line',
+               'regex' => '^[ \t]*#!.*?$',
+               'style' => 'preprocessor',
+               childregex => []
+       }, {
+               'name' => 'string',
+               'regex' => '""|"(\\\\"|[^\\"])*"',
+               'style' => 'string',
+               childregex => [ {
+                       'name' => 'identifier',
+                       'regex' => '\\$([0-9#\\*]|[a-zA-Z][a-zA-Z0-9_]*)',
+                       'style' => 'identifier',
+                       'childregex' => []
+               } ]
+       } ]
+};
+
+$LANGUAGE{'sh'} = $LANGUAGE{'shellscript'};
+return \%LANGUAGE;
+
+};
+use Getopt::Std;
+getopts('i:l:') || exit 2;
+  $str = main(parse_passed_params( infile        => $ARGV[0] || '-',
+             outfile       => '-',
+#             linenumbers   => 1 ,
+             langmode   => $opt_l ,
+             outputformat  => 'xterm' ,
+             # many other options
+           ));
+
+1;
+
+__END__
+
+=head1 Code2HTML
+
+ Convert source code (c,java,perl,html,...) into formatted html.
+
+=head1 SYNOPSIS
+
+  use Code2HTML;
+  $html = code2html( $sourcecode );
+  # or
+  code2html( infile        => 'file.java' , 
+             outfile       => 'file.html', 
+             linenumbers   => 1 ,
+             langmode      => 'perl' ,
+             # many other options
+           );
+
+=head1 DESCRIPTION
+
+Code2HTML converts source code into color-coded, formatted html,
+either as a simple code2html() function call, or as an Apache handler.
+
+This package is an adaptation of Peter Palfrader's code2html application.
+
+The statement 
+
+ use Code2HTML;
+
+exports the function code2html(), which takes the following arguments
+
+ $html = code2html(
+                        input           => $source_code,
+                        infile          => 'filename.extension',
+
+                        outfile         => 'file.html',
+                        outputformat    => 'html',      # or html-dark, or ...
+
+                        langmode        => 'java',      # or perl,html,c,...
+                        langfile        => 'langFile',  # specify alternative
+                                                        # syntax definitions
+
+                        linenumbers     => 1,           # turn on linenumbers
+                        linknumbers     => 1,           # linenumber links
+                        line_number_prefix => '-',      # linenumber anchors
+                        replacetabs     => 8,           # tabs to spaces 
+
+                        noheader        => '',          # don't use template
+                        template        => 'filename',  # override template
+
+                        title           => $title,      # set html page title
+                        content_type    => 1,           # output httpd header
+                  );
+
+All input parameters are optional except the source code 
+specification, which must be defined by either input or infile keys, or
+by passing exactly one argument which will then be taken to be the 
+source code.
+
+ input          source code to be converted (or set source -infile)
+
+ infile         name of file with code  to be converted (or use -input)
+
+ langmode       language of source file.  If omitted, code2html
+                will try to guess from the language from the file extension
+                or start of the source code.  Language modes provided are
+
+                        ada, ada95, awk, c, c++, cc, cxx, groff, html,
+                        java, javascript, js, m4, make, makefile, pas,
+                        pas, pascal, perl, plain, pov, povray, ruby, sql.
+
+ langfile       filename of file with alternative syntax definitions
+
+ outfile        name of file to put html in.  If omitted, 
+                just return html in $html=code2html(...)
+
+ outputformat   style of output html.  Available formats are 
+                html (default), html-dark, html-light, html-nobg.
+
+ replacetabs    replace tabs in source with given number of spaces
+
+ title          set title of output html page
+
+ content_type   output a Content-Type httpd header
+ linenumbers    print line numbers in source code listing
+
+=head1 AUTHOR
+
+Jim Mahoney (mahoney AT marlboro.edu), Peter Palfrader, and others.
+
+=head1 COPYRIGHT and LICENSE
+
+ Copyright (c) 1999, 2000 by Peter Palfrader and others.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+``Software''), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+=head1 SEE ALSO
+
+ Peter Palfrader's Code2HTML page at http://www.palfrader.org/code2html/
+
diff --git a/usr_bin/code2html b/usr_bin/code2html
new file mode 100755 (executable)
index 0000000..bf2402e
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -p
+#
+# code2html - convert code to html for posting to slashdot
+#
+# tchrist@perl.com
+# Sunday, December 19th, 1999
+
+BEGIN { print "<TT>\n" }        # and the spirit of awk...
+
+# first kill all the tabs
+1 while s{ \t + }
+         { " " x (length($&)*8 - length($`)%8) }ex;
+
+# then the four standard naughty bits
+s/&/&amp;/g;        # must remember to do this one first!
+s/</&lt;/g;         # this is the most important one
+s/>/&gt;/g;         # don't close too early
+s/"/&quot;/g;       # only in embedded tags, i guess
+
+# make lines break where they should
+s/^\s*$/<P>/ || s/$/<BR>/;
+
+# make sure spaces aren't squishticated so we
+# can do indentation and properly align comments
+s/  /&nbsp; /g;
+
+END { print "</TT>\n" }         # ...shall be with us always
diff --git a/usr_bin/cpu-screen.sh b/usr_bin/cpu-screen.sh
new file mode 100755 (executable)
index 0000000..f3f4b25
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Filename:      cpu-screen
+# Purpose:       script for use inside GNU screen
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mit Apr 20 00:06:21 CEST 2005 [mika]
+################################################################################
+
+if [ -r /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq ] ; then
+  TMP=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq` && \
+  CUR="`echo "scale=0; $TMP/1000" | bc -l` / "
+else
+  [ -z "$CUR" ] && CUR=''
+fi
+
+if ! [ -d /proc ] ; then
+  echo "no /proc" && exit
+else
+  if [ -r /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq ] ; then
+    TMP=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq` && \
+    MHZ=`echo "scale=0; $TMP/1000" | bc -l`
+  else
+    MHZ=$(grep 'cpu MHz' /proc/cpuinfo | sed 's/.*: // ; s/\..*//')
+  fi
+  MULT=$(echo "$MHZ" | wc -l)
+  if [ $MULT -gt 1 ] ; then
+    RESULT=$(echo "$MHZ" | head -1)
+    echo "$CUR${RESULT}*${MULT}"
+  else
+    echo "$CUR$MHZ"
+  fi
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/cpufreq-detect.sh b/usr_bin/cpufreq-detect.sh
new file mode 100755 (executable)
index 0000000..881ced8
--- /dev/null
@@ -0,0 +1,133 @@
+#!/bin/sh
+# Filename:      cpufreq-detect.sh
+# Purpose:       detect cpu type and set $MODULE to appropriate kernel module for cpufrequency scaling
+# Authors:       grml-team (grml.org), (C) Ubuntu, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Tue Apr 18 19:09:55 CEST 2006 [mika]
+################################################################################
+# Notice: taken from http://people.ubuntulinux.org/~scott/patches/powernowd/
+################################################################################
+
+/usr/sbin/laptop-detect 2>/dev/null && LAPTOP=1
+
+CPUINFO=/proc/cpuinfo
+IOPORTS=/proc/ioports
+
+if [ ! -f $CPUINFO ] ; then
+   echo >&2 $CPUINFO not detected...
+   exit 1
+fi
+
+# /lib/modules/2.6.16-grml/kernel/arch/i386/kernel/cpu/cpufreq/ ->
+# modulename          [used?]
+# acpi-cpufreq        [x]
+# cpufreq-nforce2     [ ] nForce2 FSB changing cpufreq driver
+# gx-suspmod          [ ] Cpufreq driver for Cyrix MediaGX and NatSemi Geode
+# longhaul            [x]
+# longrun             [x]
+# p4-clockmod         [~] cpufreq driver for Pentium(TM) 4/Xeon(TM)
+# powernow-k6         [x]
+# powernow-k7         [x]
+# powernow-k8         [x]
+# speedstep-centrino  [x]
+# speedstep-ich       [x]
+# speedstep-lib       [ ] Library for Intel SpeedStep 1 or 2 cpufreq drivers.
+# speedstep-smi       [x]
+#
+# /lib/modules/2.6.16-grml/kernel/drivers/cpufreq ->
+# cpufreq_conservative
+# cpufreq_ondemand
+# cpufreq_powersave
+# cpufreq_stats
+# cpufreq_userspace
+# freq_table
+
+MODEL_NAME=`grep '^model name' "$CPUINFO" | head -n 1 | sed -e 's/^.*: //;'`
+CPU=`grep -E '^cpud[^:]+:' "$CPUINFO" | head -n 1 | sed -e 's/^.*: //;'`
+VENDOR_ID=`grep -E '^vendor_id[^:]+:' "$CPUINFO" | head -n 1 | sed -e 's/^.*: //;'`
+CPU_FAMILY=$(sed -e '/^cpu family/ {s/.*: //;p;Q};d' $CPUINFO)
+
+MODULE=none
+MODULE_FALLBACK=acpi-cpufreq
+
+# Two modules for PIII-M depending the chipset.
+# modprobe speedstep-ich$EXT || modprobe speestep-smi$EXT  would be another way
+if [ -f $IOPORTS ] && grep -q 'Intel .*ICH' $IOPORTS ; then
+  PIII_MODULE=speedstep-ich
+else
+  PIII_MODULE=speedstep-smi
+fi
+
+case "$VENDOR_ID" in
+    GenuineIntel*)
+    # If the CPU has the est flag, it supports enhanced speedstep and should
+    # use the speedstep-centrino driver
+    if [ "`grep est $CPUINFO`" ]; then
+        MODULE=speedstep-centrino;
+    elif [ $CPU_FAMILY = 15 ]; then
+    # Right. Check if it's a P4 without est.
+        # Could be speedstep-ich, or could be p4-clockmod.
+        MODULE=speedstep-ich;
+        # Disabled for now - the latency tends to be bad enough to make it
+        # fairly pointless.
+        # echo "FREQDRIVER=p4-clockmod" >/etc/default/powernowd
+        # to override this
+        #if [ $LAPTOP = "1" ]; then
+        #    MODULE_FALLBACK=p4-clockmod;
+        #fi
+    else
+    # So it doesn't have Enhanced Speedstep, and it's not a P4. It could be
+    # a Speedstep PIII, or it may be unsupported. There's no terribly good
+    # programmatic way of telling.
+        case "$MODEL_NAME" in
+            Intel\(R\)\ Pentium\(R\)\ III\ Mobile\ CPU*)
+            MODULE=$PIII_MODULE ;;
+
+        # JD: says this works with   cpufreq_userspace
+            Mobile\ Intel\(R\)\ Pentium\(R\)\ III\ CPU\ -\ M*)
+            MODULE=$PIII_MODULE ;;
+
+        # https://bugzilla.ubuntu.com/show_bug.cgi?id=4262
+        # UNCONFIRMED
+            Pentium\ III\ \(Coppermine\)*)
+            MODULE=$PIII_MODULE ;;
+
+            Intel\(R\)\ Celeron\(R\)\ M\ processor*)
+            MODULE=p4-clockmod ;;
+
+        esac
+    fi
+    ;;
+    AuthenticAMD*)
+    # Hurrah. This is nice and easy.
+    case $CPU_FAMILY in
+        5)
+        # K6
+        MODULE=powernow-k6
+        ;;
+        6)
+        # K7
+        MODULE=powernow-k7
+        ;;
+        15)
+        # K8
+        MODULE=powernow-k8
+        ;;
+    esac
+    ;;
+    CentaurHauls*)
+    # VIA
+    if [ $CPU_FAMILY == 6 ]; then
+        MODULE=longhaul;
+    fi
+    ;;
+    GenuineTMx86*)
+    # Transmeta
+    if [ "`grep longrun $CPUINFO`" ]; then
+        MODULE=longrun
+    fi
+    ;;
+esac
+
+## END OF FILE #################################################################
diff --git a/usr_bin/dir2html b/usr_bin/dir2html
new file mode 100755 (executable)
index 0000000..246a280
--- /dev/null
@@ -0,0 +1,177 @@
+#!/bin/sh
+
+# Karsten Kruse - www.tecneeq.de
+#
+# dir2html - create HTML-listung for a directory
+#
+#  Copyright (c) 2001 - 2004, Karsten Kruse tecneeq(at)tecneeq(dot)de
+#  All rights reserved.
+#
+#  Redistribution and use in source and binary forms, with or without
+#  modification, are permitted provided that the following conditions
+#  are met:
+#
+#  1. Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following  disclaimer.
+#  2. Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#  3. Neither the name of the author nor the names of its contributors
+#     may be used to endorse or promote products derived from this
+#     software without specific prior written permission.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# any last words before we die?
+die(){
+       echo ERROR: $1
+       exit 1
+}
+
+# print some help
+usage(){
+cat <<EOF
+
+ Usage:
+   `basename $0` [Options]
+
+ Options:
+  -h          => print this help
+  -o out.html => output to file             => default: $my_output
+  -t title    => title                      => default: $my_title
+  -s file.css => path to a css              => default: $my_style
+  -e exclude  => exclude this from listing  => default: $my_exclude
+  -k keywords => keywords for metatag       => default: $my_keywords
+  -d diricon  => icon for directorys        => default: $my_diricon
+  -f fileicon => icon for files             => default: $my_fileicon
+  -p path     => directory to HTMLifiy      => default: $my_dir
+
+EOF
+}
+
+# hardwired defaults
+my_output="stdout"
+my_title="Filelisting"
+my_style="unset"
+my_exclude="index.html"
+my_keywords="Files, Stuff"
+my_diricon="/icons/folder.gif"
+my_fileicon="/icons/"
+my_dir=$(pwd)
+
+#parse commandline
+while getopts ho:t:s:e:k:i:d:f:p: opt ; do
+  case "$opt" in
+    h)  usage ; exit          ;;
+    o)  my_output="$OPTARG"   ;;
+    t)  my_title="$OPTARG"    ;;
+    s)  my_style="$OPTARG"    ;;
+    e)  my_exclude="$OPTARG"  ;;
+    k)  my_keywords="$OPTARG" ;;
+    d)  my_diricon="$OPTARG"  ;;
+    f)  my_fileicon="$OPTARG" ;;
+    p)  my_dir="$OPTARG"      ;;
+    \?) usage >&2 ; exit 1    ;;
+  esac
+done
+shift `expr $OPTIND - 1`
+
+do_work(){
+
+  cd $my_dir || die "Could not change directory to $my_dir"
+
+  cat <<EOF
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <title>$my_title</title>
+    <meta name="description" content="$my_title">
+    <meta name="keywords" content="$my_keywords">
+    <meta name="generator" content="dir2html from www.tecneeq.de">
+    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+EOF
+
+  if [ ! $my_style = unset ] ; then
+    echo "      <link rel=\"stylesheet\" href=\"'$my_style'\" type=\"text/css\">"
+  fi
+
+  cat <<EOF
+    $style
+  </head>
+  <body>
+    <h1 align="center">$my_title</h1>
+    <table summary="Verzeichnislisting" align="center" border="1" cellpadding="6" cellspacing="0">
+      <tr bgcolor="grey">
+        <td>&nbsp;</td>
+        <td>Name</td>
+        <td>Grösse</td>
+        <td>Mimetype</td>
+      </tr>
+EOF
+
+for i in `find -type d -maxdepth 1 -printf "%f\n" | sort | sed 's/ /+++A_BLANK+++/g'` ; do
+  doit=true
+  for e in $(echo "$my_exclude .") ; do
+    if [ "$i" = "$e" ] ; then
+      doit=false
+      break
+    fi
+  done
+  if [ $doit = true ] ; then
+    rname="$(echo $i | sed 's/+++A_BLANK+++/ /g')"
+    echo "      <tr>"
+    echo "        <td><img src=\"$my_diricon\" alt=\"Verzeichnis\"></td>"
+    echo "        <td><a href=\"$rname\">$rname/</a></td>"
+    echo "        <td>&nbsp;</td>"
+    echo "        <td>Verzeichnis</td>"
+    echo "      </tr>"
+  fi
+done
+
+for i in `find ! -type d -maxdepth 1 -printf "%f\n" | sort | sed 's/ /+++A_BLANK+++/g'` ; do
+  doit=true
+  for e in $(echo "$my_exclude") ; do
+    if [ "$e" = "$i" ] ; then
+      doit=false
+      break
+    fi
+  done
+  if [ $doit = true ] ; then
+    rname="$(echo $i | sed 's/+++A_BLANK+++/ /g')"
+    echo "      <tr>"
+    echo "        <td><img src=\"$my_fileicon\"   alt=\"File     \"></td>"
+    echo "        <td><a href=\"$rname\">$rname</a></td>"
+    echo "        <td>$([ -h "$rname" ] || du -h "$rname" | awk '{print $1}')&nbsp;</td>"
+    echo "        <td>$(file -biL "$rname" | awk '{print $1}' | sed 's/;//g')&nbsp;</td>"
+    echo "      </tr>"
+  fi
+done
+
+  cat <<EOF
+    </table>
+    <p align="center"><small>Created with <a href="http://www.tecneeq.de/">dir2html</a>.</small></p>
+  </body>
+</html>
+
+EOF
+}
+
+if [ $my_output = "stdout" ] ; then
+  do_work
+else
+  echo Writing to $my_output
+  do_work > $my_output
+fi
+
+# eof
diff --git a/usr_bin/exifinfo b/usr_bin/exifinfo
new file mode 100755 (executable)
index 0000000..a470c21
--- /dev/null
@@ -0,0 +1,135 @@
+:
+##########################################################################
+# Title      : exifinfo - print EXIF information of an image file
+# Author     : Heiner Steven <heiner.steven@odn.de>
+# Date       : 2004-01-09
+# Category   : Graphics
+# Requires   : identify
+# SCCS-Id.   : @(#) exifinfo   1.3 04/10/13
+##########################################################################
+# Description
+#
+# Caveats
+#    o EXIF tags that would result in invalid shell variable names
+#      should be rewritten, e.g. by replacing invalid characters with a
+#      '_' character
+#    o Individual tag names (e.g. "ImageWidth") should be allowed
+#
+# Bibiliography
+#    o exif.org: "Specifications"
+#      http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html
+#    o TsuruZoh Tachibanaya: "Description of Exif file format",
+#      http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html
+#
+# Output example (identify 5.5.4)
+#   EXIF_Make='EASTMAN KODAK COMPANY'
+#   EXIF_Model='KODAK DX4530 ZOOM DIGITAL CAMERA'
+#   EXIF_Orientation='1'
+#   EXIF_XResolution='230/1'
+#   EXIF_YResolution='230/1'
+#   EXIF_ResolutionUnit='2'
+#   EXIF_YCbCrPositioning='1'
+#   EXIF_ExifOffset='506'
+#   EXIF_ExposureTime='1/30'
+#   EXIF_FNumber='28/10'
+#   EXIF_ExposureProgram='2'
+#   EXIF_ExifVersion='0220'
+#   EXIF_DateTimeOriginal='2003:01:03 08:41:52'
+#   EXIF_DateTimeDigitized='2003:01:03 08:41:52'
+#   EXIF_ComponentsConfiguration='...'
+#   EXIF_ShutterSpeedValue='50/10'
+#   EXIF_ApertureValue='3/1'
+#   EXIF_ExposureBiasValue='0/1000'
+#   EXIF_MaxApertureValue='30/10'
+#   EXIF_MeteringMode='5'
+#   EXIF_LightSource='0'
+#   EXIF_Flash='25'
+#   EXIF_FocalLength='80/10'
+#   EXIF_MakerNote='KDK0002IDX4530  ..'
+#   EXIF_FlashPixVersion='0100'
+#   EXIF_ColorSpace='1'
+#   EXIF_ExifImageWidth='2580'
+#   EXIF_ExifImageLength='1932'
+#   EXIF_InteroperabilityOffset='2320'
+#   EXIF_unknown='R98'
+#   EXIF_unknown='0100'
+#   EXIF_ExposureIndex='140/1'
+#   EXIF_SensingMethod='2'
+#   EXIF_FileSource='.'
+#   EXIF_SceneType='.'
+#   EXIF_unknown='0'
+#   EXIF_unknown='0'
+#   EXIF_unknown='0'
+#   EXIF_unknown='0/100'
+#   EXIF_unknown='38'
+#   EXIF_unknown='0'
+#   EXIF_unknown='1'
+#   EXIF_unknown='0'
+#   EXIF_unknown='0'
+#   EXIF_unknown='0'
+#   EXIF_unknown='0'
+##########################################################################
+
+PN=`basename "$0"`                     # Program name
+VER='1.3'
+
+usage () {
+    echo >&2 "$PN - print EXIF information of an image file, $VER
+usage: $PN [-p prefix] image [image ...]
+    -p:  variable prefix (default is \"EXIF_\")
+
+Prints the EXIF information from the image files. The output is printed
+as "var=value" pairs in a way suitable as input to the shell, e.g.
+
+       eval \`$PN image.jpg\`
+
+can be used to set variables e.g. \"EXIF_ExifVersion\". Note that EXIF
+tags with names that would be invalid shell variable names are silently
+ignored."
+    exit 1
+}
+
+msg () {
+    for MsgLine
+    do echo "$PN: $MsgLine" >&2
+    done
+}
+
+fatal () { msg "$@"; exit 1; }
+
+Prefix=
+while getopts :hp: opt
+do
+    case "$opt" in
+       p)      Prefix=$OPTARG;;
+       h)      usage;;
+       ?)      usage;;
+    esac
+done
+shift `expr $OPTIND - 1`
+
+[ $# -lt 1 ] && usage
+
+prefix=${Prefix:-EXIF_}
+info='*'
+
+for file
+do
+    # Explanation of the "sed" expressions:
+    #   o  remove all lines not containing a "="
+    #   o  remove all lines containing tag names that would form invalid
+    #      shell variable names
+    #   o  quote all apostrophy characters ' as '\''
+    #   o  add an apostrophy at the front and the end of the value
+    #      string
+    #    o  write the variable name prefix in front of each variable
+
+    identify -format "%[EXIF:$info]" "$file" |
+       sed \
+               -e '/^[^=]*$/d'         \
+               -e '/[^A-Za-z0-9_=][^=]*=/d'    \
+               -e "s/'/'\\\\''/g"      \
+               -e "s/=/='/"            \
+               -e "s/\$/'/"            \
+               -e "s/^/$prefix/"
+done
diff --git a/usr_bin/fex b/usr_bin/fex
new file mode 100755 (executable)
index 0000000..330a412
--- /dev/null
@@ -0,0 +1,70 @@
+#!/bin/zsh
+# Filename:      fex
+# Purpose:       extract archives via smart frontend
+# Authors:       grml-team (grml.org), (c) Matthias Kopfermann, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Mai 27 15:12:16 CEST 2006 [mika]
+################################################################################
+
+autoload -U colors && colors
+emulate zsh
+
+ file=$1
+ qprompt="
+        $fg_bold[red]Really decompress $fg_bold[magenta]${file}$fg[default]? Press y or Y for YES
+        or any other key for NO $fg[default]
+"
+
+ nothing_to_do="
+        $fg_bold[green]Okay, I will not uncompress the file $fg_bold[magenta]${file}$fg[default]$fg[default] as requested.
+"
+
+decision="read -q '?$qprompt'"
+(( ${+PAGER} )) || local PAGER=less
+
+ if [ -f $file ]
+ then
+         case $file in
+         (*.tar.bz2) 
+                tar -tvjf $file \
+                       | \
+                     $PAGER && eval $decision && tar -xvjf $file \
+                      || print $nothing_to_do ;;
+         (*.tar.gz)
+                tar -tvzf $file  | $PAGER && eval $decision \
+                && tar -xvzf $file \
+                || print $nothing_to_do ;;
+         (*.bz2)
+                bzip2 -tv $file  | $PAGER && eval $decision \
+                && bzip2 -vd $file || print $nothing_to_do ;;
+         (*.gz)
+                gzip -tv  $file | $PAGER && eval $decision \
+                && gzip -d $file || print $nothing_to_do ;;
+         (*.tar)
+                tar -tvf $file | $PAGER && eval $decision \
+                && tar xvf $file || print $nothing_to_do ;;
+         (*.tgz)
+                tar -tvzf $file | $PAGER&& eval $decision \
+                && tar xzvf $file || print $nothing_to_do ;;
+         (*.zip)
+                unzip -tv $file | $PAGER&& eval $decision \
+                && unzip $file || print $nothing_to_do ;;
+         (*.Z)
+                uncompress -tv $file | $PAGER && eval $decision \
+                && uncompress -v $file || print $nothing_to_do ;;
+         (*.rar)
+                unrar t $file | $PAGER && eval $decision \
+                && unrar x $file || print $nothing_to_do ;; 
+         (*.lzo)
+                lzop -t $file | $PAGER && eval $decision \
+                && lzop -x $file || print $nothing_to_do ;;
+         (*)
+                echo 'Error. Not the expected arguments!'
+                echo "Usage: $0 file" ; exit 1 ;;
+         esac
+ else
+         echo "'$file' is not a valid file"
+ fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/find-hidden-word-text b/usr_bin/find-hidden-word-text
new file mode 100755 (executable)
index 0000000..7612e5e
--- /dev/null
@@ -0,0 +1,94 @@
+#!/usr/bin/perl -w
+=head1 NAME
+
+find-hidden-word-text - find hidden text in MS Word documents
+
+=head1 SYNOPSIS
+
+find-hidden-word-text word.doc > hidden.txt
+
+=head1 DESCRIPTION
+
+This is a command-line UNIX tool to ease the task of discovering hidden text
+in MS Word documents. 
+
+More specifically, it is an implementation of Method 2 from Simon Byers'
+paper, _Scalable Exploitation of, and Responses to Information Leakage
+Through Hidden Data in Published Documents_, at
+<URL:http://www.user-agent.org/word_docs.pdf>.
+
+This goes a little further in that it removes some common 'noise' strings,
+like 'Word.Document.8', 'Title', 'PAGE', 'Microsoft Word Document' and
+the like.  It will also remove any strings that do not contain at least
+1 whitespace character.
+
+=head1 PREREQUISITES
+
+This tool requires antiword be installed.
+
+=head1 AUTHOR
+
+Justin Mason, C<jm dash wordtext at jmason dot org>
+
+=head1 VERSION
+
+1.0 Aug 15 2003 jm
+
+=cut
+
+my $print_names = 0;
+if (scalar @ARGV > 1) { $print_names = 1; }
+
+foreach my $file (@ARGV) {
+  if ($print_names) {
+    print "\n$file\n\n";
+  }
+
+  open (IN, "antiword -t $file |") or die "cannot run antiword";
+  my $aw = join ('', <IN>);
+  close IN or die "cannot run antiword -t $file";
+
+  open (IN, "strings $file |") or die "cannot run strings";
+  my $str = join ('', <IN>);
+  close IN;
+
+  # normalize the antiword version
+  $aw =~ s/\s+/ /gs;
+
+  # get each string from strings, and see if we can find it in the "visible"
+  # text from antiword
+  my %count = ();
+  foreach (split (/\n/, $str)) {
+    s/\s+/ /g; s/^ //gs; s/ $//gs;
+    next if ($aw =~ /\Q$_\E/);
+
+    # killfile.
+    # skip almost-entirely non-alpha 4-byte snippets
+    #next if /^(?:\W\w\W\W|\W\W\w\W|\w\W{3,3}|\W{4,4}|\W{3,3}\w)$/;
+
+    next if (!/ /);    # no spaces!
+
+    # skip 4-to-6-byte snippets with 1 nonalpha and no spaces
+    #next if (/^\S{4,6}$/ && /\W/);
+
+    # common word droppings
+    next if /^\s*PAGE\s*$/;
+    #next if /^Word.Document.\d$/;
+    next if /^Microsoft Word 9.0$/;
+    next if /^Microsoft Word Document$/;
+    #next if /^Normal$/;
+    #next if /^Title$/;
+    #next if /^MSWordDoc$/;
+    next if /^Click to edit Master text styles$/;
+    next if /^Click to edit Master title style$/;
+    next if /^Embedded OLE Servers$/;
+
+    $count{$_}++;
+  }
+
+# output the strings and their counts
+  foreach (sort keys %count) {
+    my $cnt = $count{$_};
+    print "$cnt|$_\n";
+  }
+}
diff --git a/usr_bin/find-text b/usr_bin/find-text
new file mode 100755 (executable)
index 0000000..1cdbfba
--- /dev/null
@@ -0,0 +1,86 @@
+#!/usr/bin/perl -s
+# Written By Shamir Biton , 27/08/2001
+# This script can search for text pattern in text file only
+
+use Cwd;                                               # to use internal perl libreary
+sub ScanDirectory
+{      
+       my ($workdir) = shift;
+       my ($startdir) = &cwd;                          # $startdir will get the current directory value
+       
+       # This part of code take the list of names from $workdir and place it in @names array
+       
+       chdir($workdir) or die "Unable to enter dir $workdir:$!\n";
+       opendir(DIR,".") or die "Unable to open dir $workdir:$!\n";
+       my @names = readdir(DIR) or die "Unable to read dir $workdir:$!\n";
+       closedir(DIR);
+       
+       #
+       foreach my $name (@names)
+       {
+               next if ($name eq ".");
+               next if ($name eq "..");
+               next if ($name eq "lost+found");
+               
+               if (-d $name) 
+               {
+                       &ScanDirectory($name);
+                       next;
+               }
+               
+               if (-T $name)                                 # only if it is text file
+               {
+                        # print ("Checking $name..\n");
+                       $NofTimes = 0;
+                       open(FILENAME,$name);
+                       
+                               while(<FILENAME>)
+                               {
+                               
+                                       if (/$wordTOfind/i)             # key word to search
+                                       {
+                                       $NofTimes +=1;
+                                       }       
+                               }
+                               
+                               close(FILENAME);
+                               if ($NofTimes > 0) 
+                               {
+                                       print ("Found in $workdir/$name [$NofTimes Times]\n");
+                               }       
+                       
+               }       
+       }
+       
+       chdir($startdir) or die "Unable to change dir $startdir:$!\n";
+}
+
+my ($defaultdir) = &cwd;
+printf("Enter root path: [$defaultdir] ");
+$userdir = <STDIN>;
+chomp $userdir;
+
+if (! $userdir eq "")
+{
+       while (! -d $userdir) 
+       {
+               printf("Wrong Directory name, Please Enter Valid path name:");
+               $userdir = <STDIN>;
+               chomp $userdir;
+       }                       
+}
+printf("Enter Text To seach: ");
+$wordTOfind = <STDIN>;
+chomp $wordTOfind;
+
+if ($userdir eq "") 
+       {
+               &ScanDirectory(".")
+       }
+else
+       {
+        print $userdir ;
+       &ScanDirectory($userdir);
+                       
+       }
+
diff --git a/usr_bin/findchanged b/usr_bin/findchanged
new file mode 100755 (executable)
index 0000000..79e7395
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Filename:      findchanged
+# Purpose:       find changes in (real) files of dir1 ... dir2
+# Authors:       grml-team (grml.org), (c) Klaus Knopper, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Thu Oct 13 12:21:03 CEST 2005 [mika]
+################################################################################
+
+  if [ -d "$1" ]; then
+    for i in `( cd "$1"; find . -type f 2>/dev/null | sed 's,^\./,,g' | grep -v ' ' )`; do
+      cmp -s "$1/$i" "$2/$i" || echo "$1/$i"
+    done
+  elif [ -e "$1" ]; then
+    cmp -s "$1" "$2" || echo "$1"
+  fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/findwaste b/usr_bin/findwaste
new file mode 100755 (executable)
index 0000000..58ccacc
--- /dev/null
@@ -0,0 +1,96 @@
+#!/usr/bin/perl -w
+
+# This script finds good directories for archiving based on the
+# average age of files (access time) in the directory and the
+# directory size.
+
+# Directories whose size (in megabytes) is less than this value will
+# not be displayed
+my $size_minimum = 5;
+
+# Directories whose average file age (in days) is less than this value
+# will not be displayed
+my $average_age_minimum = 30;
+
+use strict;
+
+die "Usage: $0 [directory1, directory2, ...]\n" unless @ARGV;
+
+use File::Find;
+
+# ---------------------------------------------------------------------------
+
+# Global so that the callback can see them
+my $total_files;
+my $total_size;
+my $total_age;
+
+sub compute_age_callback
+{
+  my $file_location = $File::Find::name;
+  my $filename = $_;
+
+  # Return if it's the '.' or '..' files;
+  return if $filename eq '.' || $filename eq '..';
+  # Return if it's a directory
+  return if -d $filename; 
+  # Ignore links
+  return if -l $filename; 
+
+  my @stats = stat $filename or die "Couldn't stat $filename: $!";
+  my $access_time = $stats[8];
+  my $size = $stats[7];
+
+  my $current_time = time;
+
+#  print "# $file_location\n# Current: $current_time, Access time: $access_time\n";
+  my $age = $current_time - $access_time;
+  $total_age += $age;
+  $total_files++;
+
+  $total_size += $size;
+}
+
+sub compute_directory_stats
+{
+  my $starting_directory = shift;
+
+  $total_age = 0;
+  $total_size = 0;
+  $total_files = 0;
+
+  find(\&compute_age_callback, $starting_directory);
+
+  return (0,0) if $total_files == 0;
+
+  return ($total_age / $total_files / 60 / 60 / 24,
+    $total_size / 1024 / 1024);
+}
+
+# ---------------------------------------------------------------------------
+
+@ARGV = ('.') unless @ARGV;
+
+my @directory_stats;
+
+foreach my $directory (@ARGV)
+{
+  next unless -d $directory;
+
+  my ($average_age, $size) = compute_directory_stats($directory);
+  push @directory_stats, [$directory, $average_age, $size];
+}
+
+@directory_stats = sort { $b->[2] <=> $a->[2] } @directory_stats;
+
+@directory_stats = grep { $_->[2] > $size_minimum } @directory_stats;
+@directory_stats = grep { $_->[1] > $average_age_minimum } @directory_stats;
+
+foreach my $directory_stat (@directory_stats)
+{
+  print "$directory_stat->[0]:\n";
+  my $size_string = sprintf 'Size: %6.2f megabytes', $directory_stat->[2];
+  my $age_string = sprintf 'Average age: %6.2f days', $directory_stat->[1];
+  printf '  %-38s%s', $size_string, $age_string;
+  printf "\n";
+}
diff --git a/usr_bin/firevim b/usr_bin/firevim
new file mode 100755 (executable)
index 0000000..a873030
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Filename:      firevim
+# Purpose:       small wrapper to open any file from firefox with vim
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Die Mai 03 17:05:35 CEST 2005 [mika]
+################################################################################
+
+xterm -e "vim $*"
+
+## END OF FILE #################################################################
diff --git a/usr_bin/get_tw_cli b/usr_bin/get_tw_cli
new file mode 100755 (executable)
index 0000000..1dbbdbe
--- /dev/null
@@ -0,0 +1,63 @@
+#!/bin/sh
+# Filename:      get_tw_cli
+# Purpose:       get 3ware RAID controller command line interface tool (tw_cli)
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>, Wolfram Schlich <wschlich@gentoo.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Thu Feb 09 12:20:30 CET 2006 [mika]
+################################################################################
+# Notice: this file is based on:
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/www.gentoo.org/raw_cvs/gentoo-x86/sys-block/tw_cli/tw_cli-9.3.0.2.ebuild,v 1.1 2006/01/12 23:36:17 wschlich Exp $
+################################################################################
+
+if [ -r /etc/grml/lsb-functions ] ; then
+  . /etc/grml/lsb-functions
+else
+  alias einfo="echo"
+fi
+
+PN="tw_cli"
+PV="9.3.0.2"
+MY_P="${PN}-linux-x86-${PV}"
+SRC_URI_BASE="http://www.3ware.com/download/Escalade9000Series/${PV}"
+SRC_URI="${SRC_URI_BASE}/${PN}-linux-x86-${PV}.tgz"
+DOWNLOAD_URL="http://www.3ware.com/support/windows_agree.asp?path=/download/Escalade9000Series/${PV}/${MY_P}.tgz"
+
+info() {
+        einfo "get_tw_cli - get 3ware RAID controller command line interface tool (tw_cli)"
+        einfo "==========================================================================="
+        einfo ""
+}
+
+supportedcards() {
+        einfo "This binary supports all current cards, including, but not limited to:"
+        einfo ""
+        einfo "PATA: 7210, 7410, 7450, 7810, 7850, 7000-2, 7500-4, 7500-8,"
+        einfo "      7500-12, 7006-2, 7506-4, 7506-4LP, 7506-8, 7506-12"
+        einfo ""
+        einfo "SATA: 8500-4, 8500-8, 8500-12, 8006-2, 8506-4, 8506-12,"
+        einfo "      8506-8MI, 8506-12MI, 9500S-4LP, 9500S-8, 9500S-12,"
+        einfo "      9500S-8MI, 9500S-12MI"
+        einfo "      9500S-8MI, 9500S-12MI"
+        einfo ""
+}
+
+pkg_nofetch() {
+        einfo "Please agree to the license at URL"
+        einfo ""
+        einfo "\t${DOWNLOAD_URL}"
+        einfo ""
+        einfo "And then use the following URL to download the correct tarball:"
+        einfo ""
+        einfo "\t${SRC_URI}"
+        einfo ""
+}
+
+info
+pkg_nofetch
+supportedcards
+# unp ${MY_P}.tgz
+
+## END OF FILE #################################################################
diff --git a/usr_bin/getsf b/usr_bin/getsf
new file mode 100755 (executable)
index 0000000..9d77fc1
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh
+# Filename:      getsf
+# Purpose:       download project from sourceforge.net
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Fre Sep 29 13:56:15 CEST 2006 [mika]
+################################################################################
+
+if ! type wget 1>&/dev/null 2>&1 ; then
+   echo "Binary wget not available. Exiting." 1>&2
+   exit 1
+fi
+
+if [ -z "$1" ] ; then
+   echo "$0 - download project from sourceforge.net" 1>&2
+   echo 1>&2
+   echo "Usage: $0 <projectname-version.archive>" 1>&2
+
+   echo 1>&2 "
+Usage examples:
+
+  $0 htop-0.6.3.tar.gz
+  $0 http://prdownloads.sourceforge.net/htop/htop-0.6.3.tar.gz
+  MIRROR=puzzle $0 http://prdownloads.sourceforge.net/htop/htop-0.6.3.tar.gz
+
+Available mirrors:
+
+  superb-east (US), jaist (JP), ovh (FR), optusnet (AU), kent (UK), mesh (DE),
+  superb-west (US), easynews (US), surfnet (NL), ufpr (BR), heanet (IE),
+  nchc (TW), umn (US), belnet (BE), puzzle (CH), switch (CH)
+
+Send bug reports to Michael Prokop <mika@grml.org>"
+   exit 1
+fi
+
+[ -n "$MIRROR" ] || MIRROR=mesh # set default mirror if not already set
+
+case "$PROG" in
+  *http://*)
+      PROG=${PROG##*/}
+      BASENAME=${PROG%%-*}
+      BASENAME=${BASENAME%%_*}
+      BASENAME=$(echo $BASENAME| tr 'A-Z' 'a-z')
+      wget http://$MIRROR.dl.sourceforge.net/sourceforge/$BASENAME/$PROG
+      ;;
+  *)
+      PROG="$1"
+      BASENAME=${PROG%%-*}
+      BASENAME=${BASENAME%%_*}
+      BASENAME=$(echo $BASENAME| tr 'A-Z' 'a-z')
+      wget http://$MIRROR.dl.sourceforge.net/sourceforge/$BASENAME/$PROG
+      ;;
+esac
+
+## END OF FILE #################################################################
diff --git a/usr_bin/grepc b/usr_bin/grepc
new file mode 100755 (executable)
index 0000000..63eb37b
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/perl -w
+# Filename:      grepc
+# Purpose:       grep for pattern and cut it
+# Authors:       Olaf Klischat <klischat@cs.tu-berlin.de>
+# Bug-Reports:   see http://grml.org/bugs/
+# Latest change: Fre Jän 07 10:41:17 CET 2005 [mika]
+################################################################################
+
+################################################################################
+# Usage-Examples taken from:
+# http://groups.google.de/groups?selm=87acw742ea.fsf%40swangoose.isst.fhg.de
+
+# get ipaddress of interface ppp0:
+# $ ifconfig ppp0 | grepc 'inet addr:(.*?)\s'
+
+# list all debian packages which have dependency on a given package
+# $ apt-cache showpkg perl-tk | grepc '(.*?),perl-tk'
+
+# list all files which have been changed in comparison to the
+# cvs repository:
+# $ cvs diff 2>/dev/null | grepc '^RCS file: (.*?),v$'
+
+# get environment variable of a specific process:
+# $ grepc 'PATH=(.*?)\0' </proc/<pid>/environ
+
+# list destination ports of iptables lol:
+# $ </var/log/messages grepc 'DPT=(.*?) '
+
+# get debian packages on host1, download them on host2:
+# host1:$ apt-get install --yes --force-yes --print-uris gnome >uris.txt
+# host2:$ <uris.txt grepc "^'(.*?)'" | xargs -l ncftpget
+
+# list all directories containing apache-java source:
+# $ find . -path '*org/apache/*.java' | grepc '^(.*?)/org/apache' | sort | uniq
+################################################################################
+
+my $re = shift or die "usage: grepc <perl regexp containing a capture buffer>\n";
+
+$re = eval { qr/$re/ } or die "invalid regexp: $@";
+
+while (<>) {
+    if (/$re/) {
+        print "$1\n";
+    }
+}
+
+## END OF FILE #################################################################
diff --git a/usr_bin/grepedit b/usr_bin/grepedit
new file mode 100755 (executable)
index 0000000..2d5730b
--- /dev/null
@@ -0,0 +1,134 @@
+#!/usr/bin/python
+
+##  Copyright 2005 Drew Perttula
+  
+##  This program is free software; you can redistribute it and/or modify
+##  it under the terms of the GNU General Public License as published by
+##  the Free Software Foundation; either version 2 of the License, or
+##  (at your option) any later version.
+
+##  This program is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+##  GNU General Public License for more details.
+
+##  You should have received a copy of the GNU General Public License
+##  along with this program; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+"""sometimes we grep for something in a bunch of files, and then we
+want to make edits to the lines that were returned from the grep. It's
+a hassle to edit all the files; this program puts the match lines in a
+temp file for easy editing all at once.
+
+EDITOR is used on the temporary file.
+
+The cmdline arguments to grepedit are the same as those to grep. Do
+not use arguments that alter the output line format; -C is ok.
+
+grepedit also reads the following arguments:
+
+  --sort-text sort lines by the text part of the line (this probably
+    doesn't make sense with -C)
+
+
+
+The grep output usually looks like this:
+ez_setup.py:136:        import setuptools
+ez_setup.py:138:        import tempfile, shutil
+
+Output might be like this with -C 2:
+--
+ez_setup.py-174-    '''Update our built-in md5 registry'''
+ez_setup.py-175-
+ez_setup.py:176:    import re
+ez_setup.py:177:    from md5 import md5
+ez_setup.py-178-
+ez_setup.py-179-    for name in filenames:
+--
+
+"""
+
+import tempfile, sys, os, re
+from sets import Set
+
+def grep_parse(filename):
+    """parse grep output lines in given file into a dict of
+    (filename, lineno) : text"""
+    parse = {}
+    for line in open(filename):
+        if line == "--\n":
+            continue
+        m = re.match(r"(?P<filename>.*?)(?P<sep>[-:])(?P<lineno>\d+)(?P=sep)(?P<line>.*\n)$", line)
+        if m is None:
+            print "couldn't parse grep result line %r" % line
+            continue
+        filename, lineno, text = (m.group('filename'), int(m.group('lineno')),
+                                  m.group('line'))
+        if (filename,lineno) in parse:
+            raise ValueError("multiple results found for %s:%s" %
+                             (filename, lineno))
+        parse[(filename, lineno)] = text
+    return parse
+
+options = {}
+passthru_args = []
+for arg in sys.argv[1:]:
+    if arg == "--sort-text":
+        options['sort-text'] = True
+        continue
+    passthru_args.append(arg)
+
+tf = tempfile.NamedTemporaryFile(prefix="grepedit_")
+tf.close()
+
+cmd = ("grep --with-filename --line-number --binary-files=without-match %s > %s" %
+       (" ".join(['"%s"' % s.replace("\\","\\\\").replace('"','\\"')
+                  for s in passthru_args]),tf.name))
+os.system(cmd)
+
+originals = grep_parse(tf.name)
+
+if options.get('sort-text', False):
+    orig = [(v,k) for k,v in originals.items()]
+    orig.sort()
+    f = open(tf.name, "w")
+    for text, (filename,lineno) in orig:
+        f.write("%s:%s:%s" % (filename, lineno, text))
+    f.close()
+
+os.system("%s %s" % (os.getenv("EDITOR"), tf.name))
+
+corrections = grep_parse(tf.name)
+
+files = Set([filename for filename,lineno in corrections.keys()])
+for orig_filename in files:
+    (copy_fd, copy_filename) = tempfile.mkstemp(
+        dir=os.path.dirname(orig_filename),
+        prefix="_%s_tmp_grepedit" % os.path.basename(orig_filename))
+
+    any_changes = False
+    for lineno,line in enumerate(open(orig_filename)):
+        lineno = lineno + 1 # grep is 1-based
+        key = orig_filename,lineno
+        if key in corrections:
+            if line != originals[key]:
+                print "%s:%s has changed since the grep command ran- not modifying this line" % key
+                print repr(line)
+                print repr(originals[key])
+            elif corrections[key] == line:
+                pass
+            else:
+                print "%s:%s substituting new line" % key
+                line = corrections[key]
+                any_changes = True
+        os.write(copy_fd, line)
+
+    os.close(copy_fd)
+    if any_changes:
+        os.rename(copy_filename, orig_filename)
+    else:
+        print "no changes made in file %s" % orig_filename
+        os.unlink(copy_filename)
+        
+    
diff --git a/usr_bin/grml-bind b/usr_bin/grml-bind
new file mode 100755 (executable)
index 0000000..d3a8d8f
--- /dev/null
@@ -0,0 +1,156 @@
+#!/bin/sh
+# Filename:      grml-bind
+# Purpose:       Program to copy config files and mount them back for editing
+# Authors:       grml-team (grml.org), (c) Michael Gebetsroither <gebi@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Thu Feb 10 06:25:01 CET 2005 [gebi]
+################################################################################
+
+
+###
+### __INCLUDES
+###
+. /etc/grml/sh-lib
+#. /etc/grml/sysexits-sh
+
+
+
+###
+### __VARIABLES
+###
+
+# real vars (script defaults)
+target_="/ramdisk/grml-bind"
+runsFromHd && target_="/tmp/grml-bind"   # where to save the file
+file_ro_=""   # secured input filename (source)
+target_path_="" #secured path to target + filename
+
+# command parameter vars
+verbose_=0
+remove_mapping_=0   # user wants to remove the mapping
+create_mapping=0    # user wants to create the mapping
+
+
+
+###
+### __FUNCTIONS
+###
+
+# print program usage
+function printUsage
+{
+cat << EOF
+Usage: "grml-bind" [OPTIONS] <file you want to edit>
+
+grml-bind is a program to prepare a file on a read-only fs for writing
+It copies the file to a ramdisk and mount --bind it back.
+Very usefull for knoppix-like distributions.
+
+OPTIONS:
+   -c     create the file-mapping
+   -r     remove the file-mapping
+   -v     verbose (show what is going on, v++)
+   -h     this help text
+   ()     create the file-mapping
+
+EOF
+}
+
+
+# function to create the mapping
+function createMapping
+{
+  isExistent "$file_ro_" die
+  isNotExistent "$target_path_" die
+
+  # --preserve=mode,ownership,timestamps can be a problem for normal user
+  # but neverless mount --bind requires extended privilegs, so who cares?
+  execute "cp -rL \"$file_ro_\" \"$target_\"" warn \
+    "Problms copying data to ramdisk"
+
+  # mount--bind the file from ramdisk back over the r/o file
+  execute "mount --bind \"$target_path_\" \"$file_ro_\"" warn || \
+    execute "rm -r \"$target_path_\"" die
+  
+  exit 0
+}
+
+
+# remove the mapping
+function removeMapping
+{
+  isExistent "$target_path_" die \
+    "You have not edited this file yet: \"$target_path_\""
+
+  execute "umount \"$file_ro_\"" warn
+  execute "rm -r \"$target_path_\"" die
+
+  exit 0
+}
+
+
+###
+### __START
+###
+
+# parse commandline
+while getopts vrhc opt_ ; do
+  case "$opt_" in
+    r) remove_mapping_=1 ;;
+    c) create_mapping=1 ;;
+    h) printUsage; exit ;;
+    v) let verbose_=$verbose_+1 ;;
+    ?) printUsage; exit 64 ;;
+  esac
+done
+shift $(($OPTIND - 1))  # set ARGV to the first not parsed commandline parameter
+setVerbose $verbose_
+
+
+###
+# Working part
+###
+
+setExitFunction "printUsage"
+# hmmm user has not given us a filename/path
+if [ -z "$1" ]; then
+  die "you need to give me a file/path" 64
+fi
+
+# hmmm user gave us the wrong number of arguments
+if [ "$#" -ne 1 ]; then
+  die "wrong number of arguments" 64
+fi
+resetExitFunction
+
+checkRoot die
+
+# does our target-path exist? if not create it
+if [ ! -d $target_ ]; then
+  warn "target path \"$target_\" does not exist => creating"
+  execute "mkdir -p $target_" die
+  runsFromHd && execute "chmod 751 $target_" die
+fi
+
+# secure the input file/path
+file_ro_=`secureInput "$1"`
+
+# check if input file is a link, if yes resolve it
+if [ -L $file_ro_ ]; then
+  file_ro_=`execute "readlink \"$file_ro_\""`
+fi
+
+#create all possible pathformats to absolut paths
+normalized_source_path_=`relToAbs "$file_ro_"`
+file_ro_=$normalized_source_path_
+target_path_=$target_/`execute "basename \"$normalized_source_path_\""`
+
+# do what the user wants, maybee *g*
+if [ $remove_mapping_ -eq 1 ]; then # ok, the user wants to remove his mapping
+  removeMapping
+else # no, user wants to create the mapping
+  createMapping
+fi
+
+# END OF FILE ################################################################################
diff --git a/usr_bin/grml-config-user b/usr_bin/grml-config-user
new file mode 100755 (executable)
index 0000000..360e359
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh
+# Filename:      grml-config-user
+# Purpose:       interface for configuring userland software on grml system
+# Authors:       grml-team (grml.org), (c) Nico Golde <nico@grml.org>, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mon Dec 05 11:12:49 CET 2005 [mika]
+################################################################################
+
+PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}
+
+# set up some variables
+DIALOG=$(which dialog)
+PN=$(basename $0)
+
+function allover() {
+MENU=$($DIALOG --stdout --clear --title "$PN" --menu \
+"Configure userland tools." 0 0 0 \
+"grml-mutt" "Configure the mutt MUA" \
+"grml-muttng" "Configuration of mutt next generation" \
+"grml-slrn" "Configure the slrn newsreader" \
+"exit" "Exit this program")
+
+retval=$?
+
+case $retval in
+  0)
+        if [ $MENU == grml-mutt ]; then
+          exec grml-mutt
+        fi
+        if [ $MENU == grml-muttng ]; then
+          exec grml-muttng
+        fi
+        if [ $MENU == grml-slrn ]; then
+          exec grml-slrn
+        fi
+        if [ $MENU == exit ]; then
+          exit
+        fi
+        ;;
+  1)
+        echo "Cancel pressed.";;
+  255)
+        echo "ESC pressed.";;
+esac
+}
+
+allover
+
+## END OF FILE #################################################################
diff --git a/usr_bin/grml-info b/usr_bin/grml-info
new file mode 100755 (executable)
index 0000000..86b9904
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/zsh
+# Filename:      grml-info
+# Purpose:       start browser with documentation for grml
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Fre Jul 07 22:42:18 CEST 2006 [mika]
+################################################################################
+
+local PAGE='/usr/share/doc/grml-docs/startpage.html'
+
+# do we have X?
+if ! [ -n "$DISPLAY" ]; then
+ # is it grml-small?
+ if grep -q small /etc/grml_version ; then
+    links $PAGE
+ else
+  # do we have a real console?
+  if [[ $(tty) == /dev/tty* ]] ; then
+    # do we have framebuffer support?
+    if [ -c /dev/fb0 ] ; then
+      links2 -driver fb $PAGE
+    else
+      # no, we don't have framebuffer
+      w3m $PAGE
+    fi
+  # no, probably we are running inside GNU screen
+  else
+    w3m $PAGE
+  fi
+ fi
+# oh, we have X!
+else
+  dillo $PAGE
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/grml-init b/usr_bin/grml-init
new file mode 100755 (executable)
index 0000000..b0fdc07
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/dash
+# Filename:      grml-init
+# Purpose:       fix tty permissions and run zsh
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Jun 25 12:11:15 CEST 2005 [mika]
+################################################################################
+
+# export variable USER for use withing GNU screen:
+  export USER=`id -un`
+
+# fix rungetty:
+  TTY=`tty`
+  sudo chown $USER.$USER $TTY
+
+# now start the shell:
+  exec /bin/zsh
+
+## END OF FILE #################################################################
diff --git a/usr_bin/grml-init-screen b/usr_bin/grml-init-screen
new file mode 100755 (executable)
index 0000000..2247760
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/dash
+# Filename:      grml-init-screen
+# Purpose:       fix tty permissions and run screen and zsh afterwards
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Jun 25 12:11:22 CEST 2005 [mika]
+################################################################################
+
+# export variable USER for use withing GNU screen:
+  export USER=`id -un`
+
+# fix rungetty:
+  TTY=`tty`
+  sudo chown $USER.$USER $TTY
+
+# now start screen:
+  cd $HOME
+  /usr/bin/screen -c /etc/grml/screenrc ; exec /bin/zsh
+
+## END OF FILE #################################################################
diff --git a/usr_bin/grml-lang b/usr_bin/grml-lang
new file mode 100755 (executable)
index 0000000..68c8a4d
--- /dev/null
@@ -0,0 +1,75 @@
+#!/bin/sh
+# Filename:      grml-lang
+# Purpose:       load specific keyboard layout settings
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Fri Apr 21 02:02:54 CEST 2006 [mika]
+################################################################################
+
+usage(){
+    echo "Usage: $0 <language>"
+    echo "supported values: at, de, ch, us"
+}
+
+if [[ $# -lt "1" ]] ; then
+   usage
+   exit -1
+fi
+
+if [[ $DISPLAY == "" ]] ;then
+  if [[ "$1" == "de" ]] ; then
+    echo "Loading keymap for Germany..."
+    sudo loadkeys i386/qwertz/de-latin1-nodeadkeys.kmap.gz
+    echo -e "\nDone."
+  elif [[ "$1" == "at" ]] ; then
+    echo "Loading keymap for Austria..."
+    sudo loadkeys i386/qwertz/de-latin1-nodeadkeys.kmap.gz
+    echo -e "\nDone."
+  elif [[ "$1" == "ch" ]] ; then
+    echo "Loading keymap for Switzerland..."
+    sudo loadkeys i386/qwertz/sg-latin1.kmap.gz
+    echo -e "\nDone."
+  elif [[ "$1" == "us" ]] ; then
+    echo 'Loading keymap us...'
+    # sudo loadkeys /etc/console/boottime.kmap.gz
+    sudo loadkeys i386/qwerty/us-latin1.kmap.gz
+    echo -e "\nDone."
+  else echo "No valid parameter given.
+
+Notice: Use loadkeys on console and setxkbmap when running X for
+modifying keyboard layout. Adjust \$LANG and \$LC_ALL for setting locales." ; exit 1
+  fi
+else
+  if [[ $# == "0" ]] ; then
+      echo "Usage: $0 <language>"
+      echo "supported values: at, de, ch, us"
+  else
+    if [[ "$1" == "de" ]] ; then
+      echo "Loading keymap for Germany..."
+      [ -r $HOME/.Xmodmap.german ] && xmodmap $HOME/.Xmodmap.german || setxkbmap de
+      echo -e "\nDone."
+    elif [[ "$1" == "at" ]] ; then
+      echo "Loading keymap for Austria..."
+      setxkbmap de
+      echo -e "\nDone."
+    elif [[ "$1" == "ch" ]] ; then
+      echo "Loading keymap for Switzerland..."
+      setxkbmap ch
+      echo -e "\nDone."
+    elif [[ "$1"  == "us" ]] ; then
+      echo 'Loading keymap us...'
+      [ -r $HOME/.Xmodmap ] && xmodmap $HOME/.Xmodmap || setxkbmap us
+      echo -e "\nDone."
+    else
+      echo "No valid parameter given."
+      echo
+      usage
+      echo
+      echo "Notice: Use loadkeys on console and setxkbmap when running X for
+modifying keyboard layout. Adjust \$LANG and \$LC_ALL for setting locales." ; exit 1
+    fi
+  fi
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/grml-lock b/usr_bin/grml-lock
new file mode 100755 (executable)
index 0000000..2d75050
--- /dev/null
@@ -0,0 +1,97 @@
+#!/bin/zsh
+# Filename:      grml-lock
+# Purpose:       lock console
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Mai 27 15:12:24 CEST 2006 [mika]
+################################################################################
+
+PN=$0
+
+if [ -r /etc/grml_version ] ; then
+else
+  dialog --stdout --title "$PN" --msgbox "Warning: this system does not look like a grml-system
+it might not work as intended." 7 70
+fi
+
+welcome_screen() {
+dialog --stdout --title "$PN" --msgbox "Welcome to $PN!
+
+This script will lock virtual consoles when running
+on console or lock X server when running X.
+
+Notice that you can not lock a GNU screen-session
+via this script, use the lockscreen command
+instead (default is pressing ctrl-a x inside
+GNU screen)!
+
+Report bugs, send wishes and feedback to the grml team:
+http://www.grml.org/ - contact (at) grml.org
+" 16 65
+}
+
+lockcons()
+{
+  vlock -a
+}
+
+lockx()
+{
+  xlock
+}
+
+askxlock()
+{
+  dialog --stdout --title "$PN" --yesno "Now lock X?" 0 0
+  retval=$?
+  case $retval in
+    0) 
+       lockx
+       ;;
+  esac
+}
+
+askvlock()
+{
+  dialog --stdout --title "$PN" --yesno "Now lock consoles?" 0 0
+  retval=$?
+  case $retval in
+    0)
+       lockcons
+       ;;
+  esac
+}
+
+askpwd()
+{
+dialog --stdout --title "$PN" --yesno "Set password for user $USER?" 0 0
+retval=$?
+case $retval in
+  0) 
+     while [ -z "$PASSWD" ] ; do
+       PASSWD=$(dialog --stdout --title "$PN" --passwordbox "Set password (hidden typing):" 0 0)
+       if [ -n "$PASSWD" ] ; then
+         echo "$USER:$PASSWD" | sudo chpasswd
+       else
+         dialog --stdout --title "$PN" --msgbox "Error while setting password. Empty passwords are not accepted." 6 65
+       fi
+     done
+     ;;
+  *)
+#     asklock
+     ;;
+esac
+}
+
+if [[ $(tty) == /dev/tty* ]] ; then
+  welcome_screen
+  askpwd
+  askvlock
+elif [ -n "$DISPLAY" ] ; then
+  welcome_screen
+  askpwd
+  askxlock
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/grml-mutt b/usr_bin/grml-mutt
new file mode 100755 (executable)
index 0000000..135ad3c
--- /dev/null
@@ -0,0 +1,417 @@
+#!/bin/sh
+# Filename:      grml-mutt
+# Purpose:       configuration script for mutt
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Son Apr 24 16:55:51 CEST 2005 [mika]
+################################################################################
+
+PATH=${PATH:-'/bin/:/sbin/:/usr/local/bin:/usr/bin:/usr/sbin'}
+PN=`basename "$0"`
+
+writemuttrc() {
+cat > $MUTTRC << EOF
+# Filename:      .muttrc
+# Purpose:       configuration for mailclient mutt, created by 'grml-mutt'
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Son Apr 24 16:55:51 CEST 2005 [mika]
+################################################################################
+
+# important variables - adjust them if necessary
+  set realname="$REALNAME"
+  set from="$MAILADDR"
+
+# mailboxes
+  set pop_host="$POP3"
+$POPDATA
+  mailboxes $IMAP
+$IMAPDATA
+# some default options:
+    set allow_8bit           # send data as it is.  no conversion.
+  unset arrow_cursor         #  Show current mail with an inverse bar.
+    set ascii_chars          # set: use ASCII characters to build the thread tree
+    set autoedit             # call editor without prompting for To: and Subject:
+  unset confirmappend        # set: prompt for confirmation on appending mail to folder
+    set confirmcreate        # set: prompt for confirmation on creation of folders
+    set copy                 # Always keep a copy of my mails!
+    set delete=ask-yes       # ask before deleting any messages
+    set edit_headers         # edit all headers lines in the editor
+    set editor=vim           # use Vim as the editor (Vi IMproved www.vim.org)
+    set folder=~/Mail        # directory with all mail folders
+  unset followup_to          # do not generate a Followup-To header
+    set force_name           # set: save outbound mail by username
+    set hidden_host          # do not use a hostname in the address - PROBLEMATIC!
+    set history=100          # number of input lines for prompts to remember
+    set include              # set: include mail as quoted text in replies
+  unset mark_old             # set: make distinction between New mail and Old mail.
+    set mime_forward=ask-yes # ask: attach message - or just quote it?
+  unset move                 # do not move read mails from mailbox to $mbox (was: "set hold")
+    set pager_context=1      # number of lines that overlap on paging
+#   set pager_index_lines=0  # number of lines to see from the index
+    set pager_stop           # "next_page" won't jump to next message at end of messages
+#   set print_command="mp|lpr" # pipe message to "mp" for formattting - then on to "lpr"
+  unset prompt_after         # set: gives you a prompt when pager exits
+    set quote_regexp="^>"    # some people just use '>' - *sigh*
+    set read_inc=10          # '10': show count number for every tenth mail
+    set record=+outbox       # outbox / where to save outgoing mails
+    set recall=ask-yes       # do not prompt for recalling postponed mails with 'm'
+    set reply_to=ask-yes     # "reply":          set:  Use address in Reply-To?
+    set reverse_alias        # show the name of sender as set with my alias for him
+    set reverse_name         # reply as the user to whom the mail was sent to
+    set save_name            # set: save outbound mail to =username if it exists
+#   set shell=zsh            # use the zsh for shell commands
+    set sort=threads         # sorting method - I definitely like "threads" best
+    set status_on_top        # set: present the status bar at top, ie before the index
+    set strict_threads       # set: use references: for threading only, ie do not
+                             # thread by subject or in-reply-to
+    set tilde                # show non-existant lines of text with a tilde at begin-of-line
+    set tmpdir="/tmp"        # directory where temporary files are to be placed
+    set to_chars="X+TCF"     # message flags: non-personal,personal,To:,Cc:,From:
+    set use_from             # 'set from=' requires a 'set use_from'!
+    set write_inc=10         # update number after each tenth read mail
+
+# Options with a long value:
+#   set alternates=...
+    set attribution="* %n <%a> [%(%y%m%d %H:%M)]:"              # how to cite the author
+    set reply_regexp="^((aw|antw.?|antwort|re|r e|r?f|sv):[ \t]*)*"
+
+# Format Options
+    set forw_format="(forw) %s"
+    set index_format="%4C %Z %[!%y%m%d] %-17.17F (%3l) %s"
+    set pager_format="%S [%C/%T] %n (%l) %s"
+    set status_format="%v: %f (%s) [%M/%m] [N=%n,*=%t,new=%b]"
+
+# Show the "text/plain" part *before* the "text/html" part:
+  alternative_order text/plain text/html
+  auto_view text/html
+
+# KEY BINDINGS
+  bind index zt current-top
+  bind index zz current-middle
+  bind index zb current-bottom
+
+# HEADER DISPLAY
+  ignore *
+  unignore from: date: subject: to: cc: reply-to:
+  unignore sender:
+  unignore priority: importance:
+  unignore organization organisation
+  unignore mail-followup-to:
+  unignore resent- x-resent
+# unignore user-agent: x-agent: x-mailer: x-newsreader: x-mailing-list:
+# unignore x-editor
+# unignore message-id: newsgroups: posted-to: posted-and-mailed:
+# unignore x-also-posted-to: x-newsgroups:
+# unignore delivered-to x-envelope-to:
+# unignore x-accept-language
+  unhdr_order *
+  hdr_order Sender: From From: Reply-To: Subject: Organization: Date: Message-Id: User-Agent: X-Editor: X-Mailer: X-Newsreader: X-Agent: To: Cc: Newsgroups: X-Resent Followup-To: Mail-Followup-To:
+EOF
+}
+
+lightcolors() {
+cat >> $MUTTRC << EOF
+
+## color setup
+
+## some misc stuff:
+  color normal     black      white
+  color error      red        white
+  color indicator  blue       green
+  color status     white      blue
+  color tree       blue       white
+  color hdrdefault red        white
+  color quoted     blue       white
+  color quoted1    green     white
+  color quoted2    magenta    white
+  color quoted3    cyan       white
+  color tilde      yellow     black
+  color signature  blue       white
+  color search     white      blue   # "search" - matches found with search within the internal pager.
+  color markers    red        black  # "markers" indicate a wrapped line when showing messages with looong lines.
+  color bold       green      black
+  color underline  yellow     black
+
+## index-colors:
+  uncolor index *
+
+# mail from myself *and* to myself (TODO items):
+#  color index black  brightyellow  '~p ~f prokop'
+
+# Flagged Messages are important!
+  color index blue white ~N      # New
+  color index magenta default ~T # Tagged
+  color index blue black ~D      # Deleted Mails - use dark color as these are already "dealt with".
+  color index red default ~O     # old messages
+
+# mail from important people (like myself ;-):
+# color index white  red '~f prokop'
+
+# Mails with no obvious addresses (empty To: and Cc: lines)
+   color index cyan white "! ~C ."
+
+# "DONE mails" ie those I have already replied to.
+   color index blue white  '~Q'
+
+# non-multipart mails which are tex/html almost always are spam:
+  color index brightmagenta white "~h 'Content-Type: text/html'"
+
+# Sent to "Undisclosed Recipients":
+  color index white      magenta  '~C Undisclosed.*Recipients'
+
+# When the Subject indicates a reply (with ":re" but without "Fwd"!)
+# then there *must* be a reference to the previous message!
+# So if there is neither an In-Reply-To nor a References line
+# then it must have been sent with a crappy mailer....
+  color index yellow white "~s re: ! ~s fwd: ! ~x . ! ~h 'in-reply-to: '"
+
+# No characters in body -> SPAM!
+  color index white white   "! ~b ."
+
+  color index brightred black ~F # Flagged
+
+## body-colors:
+
+# highlight important keywords
+  color body  brightyellow black  "grml"
+
+# URLs (General Internet addresses):
+  color body yellow red "(finger|ftp|http|news|telnet)://[^ >]*"
+  color body yellow red "<URL:[^ ]*>"
+# web address without "http":
+  color body yellow red "www\\.[-.a-z0-9]+\\.[a-z][a-z][a-z]?([-_./~a-z0-9]+)?"
+
+# HTTPS addresses:
+  color body yellow red "https://[^ >]*"
+
+# FTP addresses:
+  color body yellow red "ftp://[^ ]*"
+
+# HTTP addresses:
+  color body yellow red "[[:alnum:]][-+.#_[:alnum:]]*@[-+.[:alnum:]]*[[:alnum:]]"
+
+# File names ("/path/file")
+#  color body brightgreen white "\\~?\(/[-_.,a-zA-Z0-9{}äöüß]+\)+"
+  color body blue white "\\~?\(/[-_.,a-zA-Z0-9{}äöüß]+\)+"
+
+# Path names ("/path/")
+  color body brightred   white "\(/[-_.a-zA-Z0-9]+\)+/"
+
+# Variables  ("$HOME")
+  color body brightmagenta white "\\$[a-zA-Z][-_a-zA-Z]+"
+
+# Attribution line:
+# color body red white "^[*] .*:$"
+
+## abbreviations and "SCREAMING IN CAPS" in body:
+# The following includes umlauts - but that's quite clunky.
+# color body brightyellow  red "[A-ZÄÖÜ][-A-ZÄÖÜ]+[A-ZÄÖÜ][ .!?]?"
+
+# "+USE_GNU_REGEX":
+# When you use "+USE_GNU_REGEX" then you can also make use
+# of "start of word" ("\<") and "end of word" ("\>"):
+  color body red  white    "\\<[-A-Z']{3,}\\>"
+
+# *Emphasized*, /emphasized/, and _emphasized_ words:
+# color body brightred      black   "[*/_]+ *[- &[:alnum:]]+ *[*/_]+"
+# this would catch false positives of the kind _foo* and /bar_
+# so we should choose matching pairs only:
+  color body brightred  white   "[*][-[:alnum:]]+[*]"
+  color body brightred  white     "/[-[:alnum:]]+/"
+  color body brightred  white     "_[-[:alnum:]]+_"
+
+# Smileys:  :-)  ;-)  :-|  :-/  :-(
+  color body brightyellow white    "[;:]-[)/(|]"
+# Grinning:  "grin" ([g]) and "big grin" ([bg]):
+  color body blue   red      "<[Gg]>"
+  color body blue   red      "<[Bb][Gg]>"
+
+# Border Lines of length three or more.
+# (Several Newsletters use border lines..)
+  color body green  white    "[-_=+~/\*]{3,}"
+
+# Extensive use of exclamation and question marks:
+# "!!!"  "???"
+  color body red    white    "[!?]{3,}"
+
+# Percentages ("Save xx.x %!")
+  color body brightgreen white "[.0-9]+ ?%"
+
+# Copyright (C) and Registered Trademark (r)
+  color body red white "[(][cr][)]"
+  color body red white "\\(c\\)"
+
+# Year Numbers 1980-2002
+  color body blue white "19[89][0-9]"
+  color body blue white "200[012]"
+
+# Phone Numbers:
+  color body blue white "1-[0-9]{3}[- ][-0-9]+ +ext.? [0-9]+"
+  color body blue white \
+"(tele)?(cell|fax|fon|phone|tel)[.: ]+[+]?[- 0-9/()]{4,}[0-9]"
+
+# RTFM!
+# " man word"
+  color body white red "^ +[$]? *man \\w+"
+
+# Lists
+# bulleted list:
+# * one
+# * two
+# * three
+# dashed list:
+# - one
+# - two
+# - three
+# color body red          black "^ *[-*] +"
+# this pattern yields many false positives as it
+# spans lines for which there is no syntax language.
+# this is easier with Vim's syntax coloring.
+  color body red white "^ *[-*] +"
+
+# special IP host addresses:
+# 192.x.x.x
+  color body white blue  "129.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}"
+  color body white blue  "193.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}"
+
+# HTML tags
+  color body yellow       black "</?\w+>"
+
+# Emphasis by interspersed spaces
+# Example: E M P H A S I S
+  color body red white '\<\w( +\w\>)+'
+
+# verbatim marks (#v+ till #v-)
+  color body yellow red  ^\#v[-+]
+
+  color attachment black white
+EOF
+}
+
+dialog --stdout --title "$PN" --msgbox "Welcome to $PN!
+
+This script will create a simple base
+configuration for the mailclient mutt.
+
+Report bugs, send wishes and feedback to the grml team:
+http://www.grml.org/ - contact (at) grml.org
+" 13 65
+
+GETREALNAME=$(dialog --stdout --title "$PN" --inputbox "Your real name (eg 'John GRML User'):" 0 56) || exit 0
+REALNAME=${GETREALNAME%/*}
+
+GETMAILADDR=$(dialog --stdout --title "$PN" --inputbox "Your main mail address (eg 'joedoe@grml.org'):" 0 56) || exit 0
+MAILADDR=${GETMAILADDR%/*}
+
+askpop(){
+  GETPOPUSER=$(dialog --stdout --title "$PN" --inputbox "Enter username for POP3 account" 0 0)
+  POPUSER=${GETPOPUSER}
+
+  GETPOPPWD=$(dialog --stdout --title "$PN" --passwordbox "Enter password for POP3 account (typing hidden)" 0 0)
+  POPPWD=${GETPOPPWD}
+}
+
+ASKPOP=$(dialog --stdout --title "$PN" --yesno "Configure POP3?" 0 0)
+retval=$?
+
+case $retval in
+  0) 
+     GETPOP3=$(dialog --stdout --title "$PN" --inputbox  "Your POP3 account (pop[s]://[user]@hostname[:port]):" 0 56 "pop://") || exit 0
+     POP3=${GETPOP3}
+     askpop && \
+POPDATA="  set pop_user=\"$POPUSER\"
+  set pop_pass=\"$POPPWD\"
+"
+     ;;
+esac
+
+askimap(){
+  GETIMAPUSER=$(dialog --stdout --title "$PN" --inputbox "Enter username for IMAP account" 0 0)
+  IMAPUSER=${GETIMAPUSER}
+
+  GETIMAPPWD=$(dialog --stdout --title "$PN" --passwordbox "Enter password for IMAP account (typing hidden)" 0 0)
+  IMAPPWD=${GETIMAPPWD}
+}
+
+ASKIMAP=$(dialog --stdout --title "$PN" --yesno "Configure IMAP?" 0 0)
+retval=$?
+
+case $retval in
+  0) 
+     GETIMAP=$(dialog --stdout --title "$PN" --inputbox  "Your IMAP account (imap[s]://[user@]hostname[:port]/mailbox):" 0 65 "imap://") || exit 0
+     IMAP=${GETIMAP}
+     askimap && \
+IMAPDATA="  set imap_user=\"$IMAPUSER\"
+  set imap_pass=\"$IMAPPWD\"
+"
+     ;;
+esac
+
+GETCOLOR=$(dialog --stdout --title "$PN" \
+        --radiolist "Which color setup do you want to use?" 10 65 2 \
+          dark   "dark color setup (default)" on \
+          light  "light color setup" off)
+retval=$?
+
+case $retval in
+  0) COLOR=$GETCOLOR ;;
+  *) exit 1 ;;
+esac
+
+writecolors() {
+  if [ "$COLOR" == 'light' ] ; then
+    lightcolors
+  fi
+}
+
+GETMUTTRC=$(dialog --stdout --title "$PN" --inputbox "Choose a filename for this configuration:" 0 56 "$HOME/.muttrc") || exit 0
+MUTTRC=${GETMUTTRC}
+
+WRITEMUTTRC=$(dialog --stdout --title "$PN" --yesno "Write $MUTTRC?" 5 65)
+retval=$?
+
+case $retval in
+  0) 
+    if [ -f "$MUTTRC" ] ; then
+      dialog --stdout --title "$PN" --yesno "$MUTTRC exists. Overwrite?" 5 65
+      retval=$?
+      case $retval in
+        0) 
+          writemuttrc && writecolors && \
+          dialog --stdout --title "$PN" --msgbox "Writing $MUTTRC was successful." 7 65 || \
+          dialog --stdout --title "$PN" --msgbox "Error $?: writing $MUTTRC failed." 7 65
+          ;;
+#        *) exit 1 ;;
+      esac
+    else
+       writemuttrc && writecolors && \
+       dialog --stdout --title "$PN" --msgbox "Writing $MUTTRC was successfull." 7 65 || \
+       dialog --stdout --title "$PN" --msgbox "Error $?: writing $MUTTRC failed." 7 65
+    fi
+    ;;
+#  *) exit 1 ;;
+esac
+
+dialog --stdout --title "$PN" --msgbox "Thanks for using $PN!
+
+More information on mutt:
+
+Manuals: man 1 mutt
+         man 5 muttrc
+
+Webpages:
+www.mutt.org
+wiki.mutt.org
+www.spinnaker.de/mutt/
+www.michael-prokop.at/mutt/
+
+#######################################################
+
+Report bugs, send wishes and feedback to the grml team:
+http://www.grml.org/ - contact (at) grml.org
+" 24 65
+
+## END OF FILE #################################################################
diff --git a/usr_bin/grml-muttng b/usr_bin/grml-muttng
new file mode 100755 (executable)
index 0000000..c539562
--- /dev/null
@@ -0,0 +1,442 @@
+#!/bin/sh
+# Filename:      grml-muttng
+# Purpose:       configuration script for mutt-ng
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Don Sep 21 20:00:07 CEST 2006 [mika]
+################################################################################
+
+PATH=${PATH:-'/bin/:/sbin/:/usr/local/bin:/usr/bin:/usr/sbin'}
+PN=`basename "$0"`
+
+writemuttngrc() {
+cat > $MUTTRC << EOF
+# Filename:      .muttngrc
+# Purpose:       configuration for mailclient muttng, created by 'grml-muttng'
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Don Sep 21 20:00:07 CEST 2006 [mika]
+################################################################################
+
+## some general settings mutt understands:
+
+# important variables - adjust them if necessary
+  set realname="$REALNAME"
+  set from="$MAILADDR"
+
+# mailboxes
+  set pop_host="$POP3"
+$POPDATA
+  mailboxes $IMAP
+$IMAPDATA
+# some default options:
+    set allow_8bit           # send data as it is.  no conversion.
+  unset arrow_cursor         #  Show current mail with an inverse bar.
+    set ascii_chars          # set: use ASCII characters to build the thread tree
+    set autoedit             # call editor without prompting for To: and Subject:
+  unset confirmappend        # set: prompt for confirmation on appending mail to folder
+    set confirmcreate        # set: prompt for confirmation on creation of folders
+    set copy                 # Always keep a copy of my mails!
+    set delete=ask-yes       # ask before deleting any messages
+    set edit_headers         # edit all headers lines in the editor
+    set editor=vim           # use Vim as the editor (Vi IMproved www.vim.org)
+    set folder=~/Mail        # directory with all mail folders
+  unset followup_to          # do not generate a Followup-To header
+    set force_name           # set: save outbound mail by username
+    set hidden_host          # do not use a hostname in the address - PROBLEMATIC!
+    set history=100          # number of input lines for prompts to remember
+    set include              # set: include mail as quoted text in replies
+  unset mark_old             # set: make distinction between New mail and Old mail.
+    set mime_forward=ask-yes # ask: attach message - or just quote it?
+  unset move                 # do not move read mails from mailbox to $mbox (was: "set hold")
+    set pager_context=1      # number of lines that overlap on paging
+#   set pager_index_lines=0  # number of lines to see from the index
+    set pager_stop           # "next_page" won't jump to next message at end of messages
+#   set print_command="mp|lpr" # pipe message to "mp" for formattting - then on to "lpr"
+  unset prompt_after         # set: gives you a prompt when pager exits
+    set quote_regexp="^>"    # some people just use '>' - *sigh*
+    set read_inc=10          # '10': show count number for every tenth mail
+    set recall=ask-yes       # do not prompt for recalling postponed mails with 'm'
+    set record=+outbox       # outbox / where to save outgoing mails
+    set reply_to=ask-yes     # "reply":          set:  Use address in Reply-To?
+    set reverse_alias        # show the name of sender as set with my alias for him
+    set reverse_name         # reply as the user to whom the mail was sent to
+    set save_name            # set: save outbound mail to =username if it exists
+#   set shell=zsh            # use the zsh for shell commands
+    set sort=threads         # sorting method - I definitely like "threads" best
+    set status_on_top        # set: present the status bar at top, ie before the index
+    set strict_threads       # set: use references: for threading only, ie do not
+                             # thread by subject or in-reply-to
+    set tilde                # show non-existant lines of text with a tilde at begin-of-line
+    set tmpdir="/tmp"        # directory where temporary files are to be placed
+    set to_chars="X+TCF"     # message flags: non-personal,personal,To:,Cc:,From:
+    set use_from             # 'set from=' requires a 'set use_from'!
+    set write_inc=10         # update number after each tenth read mail
+
+# Options with a long value:
+#   set alternates=...
+    set attribution="* %n <%a> [%(%y%m%d %H:%M)]:"              # how to cite the author
+    set reply_regexp="^((aw|antw.?|antwort|re|r e|r?f|sv):[ \t]*)*"
+
+# Format Options
+    set forward_format="(forw) %s"
+    set index_format="%4C %Z %[!%y%m%d] %-17.17F (%3l) %s"
+    set pager_format="%S [%C/%T] %n (%l) %s"
+    set status_format="%v: %f (%s) [%M/%m] [N=%n,*=%t,new=%b]"
+
+# Show the "text/plain" part *before* the "text/html" part:
+  alternative_order text/plain text/html
+  auto_view text/html
+
+# KEY BINDINGS
+  bind index zt current-top
+  bind index zz current-middle
+  bind index zb current-bottom
+
+# HEADER DISPLAY
+  ignore *
+  unignore from: date: subject: to: cc: reply-to:
+  unignore sender:
+  unignore priority: importance:
+  unignore organization organisation
+  unignore mail-followup-to:
+  unignore resent- x-resent
+# unignore user-agent: x-agent: x-mailer: x-newsreader: x-mailing-list:
+# unignore x-editor
+# unignore message-id: newsgroups: posted-to: posted-and-mailed:
+# unignore x-also-posted-to: x-newsgroups:
+# unignore delivered-to x-envelope-to:
+# unignore x-accept-language
+  unhdr_order *
+  hdr_order Sender: From From: Reply-To: Subject: Organization: Date: Message-Id: User-Agent: X-Editor: X-Mailer: X-Newsreader: X-Agent: To: Cc: Newsgroups: X-Resent Followup-To: Mail-Followup-To:
+
+## now the mutt-ng specific settings
+
+# path to header cache file:
+  set header_cache="~/.muttng/cache"
+
+# sidebar stuff:
+  set sidebar_visible="no"
+  set sidebar_width=25
+  set sidebar_shorten_hierarchy
+  color sidebar_new yellow default
+
+# keybindings:
+  bind index F flag-message
+  bind pager F flag-message
+
+  macro index z    "c?\t"                            "List mailboxes and switch to selected one"
+  macro index <f2> "<enter-command>set invsidebar_visible<enter>" "Toggle sidebar visibility"
+  macro index \cW  ':push <sidebar-prev-new><enter>' "Jump to previous mailbox with new messages in sidebar"
+  macro index \cE  ':push <sidebar-next-new><enter>' "Jump to next mailbox with new messages in sidebar"
+  macro index \cP  ':push <sidebar-prev><enter>'     "Jump to previous mailbox in sidebar"
+  macro index \cN  ':push <sidebar-next><enter>'     "Jump to next mailbox in sidebar"
+  macro index \cO  ':push <sidebar-open><enter>'     "Open selected mailbox in sidebar"
+# bind index <space> sidebar-open
+
+EOF
+}
+
+lightcolors() {
+cat >> $MUTTRC << EOF
+
+## color setup
+
+## some misc stuff:
+  color normal     black      white
+  color error      red        white
+  color indicator  blue       green
+  color status     white      blue
+  color tree       blue       white
+  color hdrdefault red        white
+  color quoted     blue       white
+  color quoted1    green     white
+  color quoted2    magenta    white
+  color quoted3    cyan       white
+  color tilde      yellow     black
+  color signature  blue       white
+  color search     white      blue   # "search" - matches found with search within the internal pager.
+  color markers    red        black  # "markers" indicate a wrapped line when showing messages with looong lines.
+  color bold       green      black
+  color underline  yellow     black
+
+## index-colors:
+  uncolor index *
+
+# mail from myself *and* to myself (TODO items):
+#  color index black  brightyellow  '~p ~f prokop'
+
+# Flagged Messages are important!
+  color index blue white ~N      # New
+  color index magenta default ~T # Tagged
+  color index blue black ~D      # Deleted Mails - use dark color as these are already "dealt with".
+  color index red default ~O     # old messages
+
+# mail from important people (like myself ;-):
+# color index white  red '~f prokop'
+
+# Mails with no obvious addresses (empty To: and Cc: lines)
+   color index cyan white "! ~C ."
+
+# "DONE mails" ie those I have already replied to.
+   color index blue white  '~Q'
+
+# non-multipart mails which are tex/html almost always are spam:
+  color index brightmagenta white "~h 'Content-Type: text/html'"
+
+# Sent to "Undisclosed Recipients":
+  color index white      magenta  '~C Undisclosed.*Recipients'
+
+# When the Subject indicates a reply (with ":re" but without "Fwd"!)
+# then there *must* be a reference to the previous message!
+# So if there is neither an In-Reply-To nor a References line
+# then it must have been sent with a crappy mailer....
+  color index yellow white "~s re: ! ~s fwd: ! ~x . ! ~h 'in-reply-to: '"
+
+# No characters in body -> SPAM!
+  color index white white   "! ~b ."
+
+  color index brightred black ~F # Flagged
+
+## body-colors:
+
+# highlight important keywords
+  color body  brightyellow black  "grml"
+
+# URLs (General Internet addresses):
+  color body yellow red "(finger|ftp|http|news|telnet)://[^ >]*"
+  color body yellow red "<URL:[^ ]*>"
+# web address without "http":
+  color body yellow red "www\\.[-.a-z0-9]+\\.[a-z][a-z][a-z]?([-_./~a-z0-9]+)?"
+
+# HTTPS addresses:
+  color body yellow red "https://[^ >]*"
+
+# FTP addresses:
+  color body yellow red "ftp://[^ ]*"
+
+# HTTP addresses:
+  color body yellow red "[[:alnum:]][-+.#_[:alnum:]]*@[-+.[:alnum:]]*[[:alnum:]]"
+
+# File names ("/path/file")
+#  color body brightgreen white "\\~?\(/[-_.,a-zA-Z0-9{}äöüß]+\)+"
+  color body blue white "\\~?\(/[-_.,a-zA-Z0-9{}äöüß]+\)+"
+
+# Path names ("/path/")
+  color body brightred   white "\(/[-_.a-zA-Z0-9]+\)+/"
+
+# Variables  ("$HOME")
+  color body brightmagenta white "\\$[a-zA-Z][-_a-zA-Z]+"
+
+# Attribution line:
+# color body red white "^[*] .*:$"
+
+## abbreviations and "SCREAMING IN CAPS" in body:
+# The following includes umlauts - but that's quite clunky.
+# color body brightyellow  red "[A-ZÄÖÜ][-A-ZÄÖÜ]+[A-ZÄÖÜ][ .!?]?"
+
+# "+USE_GNU_REGEX":
+# When you use "+USE_GNU_REGEX" then you can also make use
+# of "start of word" ("\<") and "end of word" ("\>"):
+  color body red  white    "\\<[-A-Z']{3,}\\>"
+
+# *Emphasized*, /emphasized/, and _emphasized_ words:
+# color body brightred      black   "[*/_]+ *[- &[:alnum:]]+ *[*/_]+"
+# this would catch false positives of the kind _foo* and /bar_
+# so we should choose matching pairs only:
+  color body brightred  white   "[*][-[:alnum:]]+[*]"
+  color body brightred  white     "/[-[:alnum:]]+/"
+  color body brightred  white     "_[-[:alnum:]]+_"
+
+# Smileys:  :-)  ;-)  :-|  :-/  :-(
+  color body brightyellow white    "[;:]-[)/(|]"
+# Grinning:  "grin" ([g]) and "big grin" ([bg]):
+  color body blue   red      "<[Gg]>"
+  color body blue   red      "<[Bb][Gg]>"
+
+# Border Lines of length three or more.
+# (Several Newsletters use border lines..)
+  color body green  white    "[-_=+~/\*]{3,}"
+
+# Extensive use of exclamation and question marks:
+# "!!!"  "???"
+  color body red    white    "[!?]{3,}"
+
+# Percentages ("Save xx.x %!")
+  color body brightgreen white "[.0-9]+ ?%"
+
+# Copyright (C) and Registered Trademark (r)
+  color body red white "[(][cr][)]"
+  color body red white "\\(c\\)"
+
+# Year Numbers 1980-2002
+  color body blue white "19[89][0-9]"
+  color body blue white "200[012]"
+
+# Phone Numbers:
+  color body blue white "1-[0-9]{3}[- ][-0-9]+ +ext.? [0-9]+"
+  color body blue white \
+"(tele)?(cell|fax|fon|phone|tel)[.: ]+[+]?[- 0-9/()]{4,}[0-9]"
+
+# RTFM!
+# " man word"
+  color body white red "^ +[$]? *man \\w+"
+
+# Lists
+# bulleted list:
+# * one
+# * two
+# * three
+# dashed list:
+# - one
+# - two
+# - three
+# color body red          black "^ *[-*] +"
+# this pattern yields many false positives as it
+# spans lines for which there is no syntax language.
+# this is easier with Vim's syntax coloring.
+  color body red white "^ *[-*] +"
+
+# special IP host addresses:
+# 192.x.x.x
+  color body white blue  "129.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}"
+  color body white blue  "193.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}"
+
+# HTML tags
+  color body yellow       black "</?\w+>"
+
+# Emphasis by interspersed spaces
+# Example: E M P H A S I S
+  color body red white '\<\w( +\w\>)+'
+
+# verbatim marks (#v+ till #v-)
+  color body yellow red  ^\#v[-+]
+
+  color attachment black white
+EOF
+}
+
+dialog --stdout --title "$PN" --msgbox "Welcome to $PN!
+
+This script will create a simple base
+configuration for the mailclient mutt-ng.
+
+Report bugs, send wishes and feedback to the grml team:
+http://www.grml.org/ - contact (at) grml.org
+" 13 65
+
+GETREALNAME=$(dialog --stdout --title "$PN" --inputbox "Your real name (eg 'John GRML User'):" 0 56) || exit 0
+REALNAME=${GETREALNAME%/*}
+
+GETMAILADDR=$(dialog --stdout --title "$PN" --inputbox "Your main mail address (eg 'joedoe@grml.org'):" 0 56) || exit 0
+MAILADDR=${GETMAILADDR%/*}
+
+askpop(){
+  GETPOPUSER=$(dialog --stdout --title "$PN" --inputbox "Enter username for POP3 account" 0 0)
+  POPUSER=${GETPOPUSER}
+
+  GETPOPPWD=$(dialog --stdout --title "$PN" --passwordbox "Enter password for POP3 account (typing hidden)" 0 0)
+  POPPWD=${GETPOPPWD}
+}
+
+ASKPOP=$(dialog --stdout --title "$PN" --yesno "Configure POP3?" 0 0)
+retval=$?
+
+case $retval in
+  0) 
+     GETPOP3=$(dialog --stdout --title "$PN" --inputbox  "Your POP3 account (pop[s]://[user]@hostname[:port]):" 0 56 "pop://") || exit 0
+     POP3=${GETPOP3}
+     askpop && \
+POPDATA="  set pop_user=\"$POPUSER\"
+  set pop_pass=\"$POPPWD\"
+"
+     ;;
+esac
+
+askimap(){
+  GETIMAPUSER=$(dialog --stdout --title "$PN" --inputbox "Enter username for IMAP account" 0 0)
+  IMAPUSER=${GETIMAPUSER}
+
+  GETIMAPPWD=$(dialog --stdout --title "$PN" --passwordbox "Enter password for IMAP account (typing hidden)" 0 0)
+  IMAPPWD=${GETIMAPPWD}
+}
+
+ASKIMAP=$(dialog --stdout --title "$PN" --yesno "Configure IMAP?" 0 0)
+retval=$?
+
+case $retval in
+  0) 
+     GETIMAP=$(dialog --stdout --title "$PN" --inputbox  "Your IMAP account (imap[s]://[user@]hostname[:port]/mailbox):" 0 65 "imap://") || exit 0
+     IMAP=${GETIMAP}
+     askimap && \
+IMAPDATA="  set imap_user=\"$IMAPUSER\"
+  set imap_pass=\"$IMAPPWD\"
+"
+     ;;
+esac
+
+GETCOLOR=$(dialog --stdout --title "$PN" \
+        --radiolist "Which color setup do you want to use?" 10 65 2 \
+          dark   "dark color setup (default)" on \
+          light  "light color setup" off)
+retval=$?
+
+case $retval in
+  0) COLOR=$GETCOLOR ;;
+  *) exit 1 ;;
+esac
+
+writecolors() {
+  if [ "$COLOR" == 'light' ] ; then
+    lightcolors
+  fi
+}
+
+GETMUTTRC=$(dialog --stdout --title "$PN" --inputbox "Choose a filename for this configuration:" 0 56 "$HOME/.muttngrc") || exit 0
+MUTTRC=${GETMUTTRC}
+
+WRITEMUTTRC=$(dialog --stdout --title "$PN" --yesno "Write $MUTTRC?" 5 65)
+retval=$?
+
+case $retval in
+  0) 
+    [ -d ~/.muttng ] || mkdir ~/.muttng
+    if [ -f "$MUTTRC" ] ; then
+      dialog --stdout --title "$PN" --yesno "$MUTTRC exists. Overwrite?" 5 65
+      retval=$?
+      case $retval in
+        0) 
+          writemuttngrc && writecolors && \
+          dialog --stdout --title "$PN" --msgbox "Writing $MUTTRC was successful." 7 65 || \
+          dialog --stdout --title "$PN" --msgbox "Error $?: writing $MUTTRC failed." 7 65
+          ;;
+      esac
+    else
+       writemuttngrc && writecolors && \
+       dialog --stdout --title "$PN" --msgbox "Writing $MUTTRC was successfull." 7 65 || \
+       dialog --stdout --title "$PN" --msgbox "Error $?: writing $MUTTRC failed." 7 65
+    fi
+    ;;
+esac
+
+dialog --stdout --title "$PN" --msgbox "Thanks for using $PN!
+
+More information on mutt-ng:
+
+Manuals: man 1 muttng
+         man 5 muttngrc
+
+Webpages:
+http://mutt-ng.berlios.de/
+http://mutt-ng.supersized.org/
+http://www.strcat.de/muttng/pmwiki.php
+
+#######################################################
+
+Report bugs, send wishes and feedback to the grml team:
+http://www.grml.org/ - contact (at) grml.org
+" 24 65
+
+## END OF FILE #################################################################
diff --git a/usr_bin/grml-resolution b/usr_bin/grml-resolution
new file mode 100755 (executable)
index 0000000..928a23c
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/sh
+# Filename:      grml-resolution
+# Purpose:       change X resolution via a simple menu frontend
+# Authors:       Florian Keller <florian.keller@zuerich.ch>, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Thu May 04 23:13:39 CEST 2006 [mika]
+################################################################################
+
+PN=$(basename $0)
+RESOLUTION=$(mktemp)
+ERROR=$(mktemp)
+
+bailout(){
+  rm -f $RESOLUTION $ERROR
+  exit $1
+}
+
+trap bailout 1 2 3 15
+
+main(){
+# menu
+COUNTER=0
+STRING=""
+
+# current mode
+CURRENT_NUM=$(xrandr | awk '/\*/ {print $1}' | tr -d '*')
+CURRENT_RESOLUTION=$(xrandr | awk '/\*/ {print $2 $3 $4}')
+
+# menu
+for i in $(xrandr | awk {'print $2$3$4'} | grep "^[0-9]") ; do
+  STRING="$STRING $COUNTER $i"
+  ((COUNTER++))
+done
+
+# Menue Tool
+dialog --title "$PN" --menu "Change X resolution via xrandr (current resolution: $CURRENT_RESOLUTION):" 0 0 0 $STRING 2>$RESOLUTION
+retval=$?
+case $retval in
+      (1)   echo "Cancel pressed." ; exit 1 ;;
+      (255) echo "ESC pressed."    ; exit 1 ;;
+esac
+
+CHOSE=$(cat $RESOLUTION)
+
+if [ "$CHOSE" = "$CURRENT_NUM" ] ; then
+   dialog --title "$PN" --msgbox "Chosen resolution corresponds to current resolution. No changes needed." 0 0
+elif [ -n "$CHOSE" ] ; then
+  xrandr -s $CHOSE 2>$ERROR && \
+  dialog --title "$PN" --msgbox "Running xrandr with resolution was succesful." 0 0 || \
+  dialog --title "$PN" --msgbox "Error when running xrandr with resolution $CHOSE: `cat $ERROR`" 0 0
+fi
+}
+
+while true ; do
+  main
+done
+
+bailout
+
+# EOF #
diff --git a/usr_bin/grml-screen b/usr_bin/grml-screen
new file mode 100755 (executable)
index 0000000..1288aa1
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/dash
+# Filename:      grml-screen
+# Purpose:       wrapper for screen
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sun Jan 08 15:30:06 CET 2006 [mika]
+################################################################################
+
+# fix tty permissions
+#  sudo chmod 660      $TTY
+#  sudo chown root.tty $TTY
+
+# export variable USER for use withing GNU screen:
+  export USER=`id -un`
+
+# fix tty permissions
+  TTY=`tty`
+  sudo chmod 660       $TTY
+  sudo chown $USER.tty $TTY
+
+# now run screen with config
+  cd $HOME     # important for e.g. hardcopy-feature
+  if [ `id -u` = 0 ] ; then
+    exec screen -c /etc/grml/screenrc
+  elif [ -r $HOME/.screenrc ] ; then
+    exec screen -c $HOME/.screenrc
+  else
+    exec screen -c /etc/grml/screenrc_grml
+  fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/grml-slrn b/usr_bin/grml-slrn
new file mode 100755 (executable)
index 0000000..a59e3b3
--- /dev/null
@@ -0,0 +1,349 @@
+#!/bin/sh
+# Filename:      grml-slrn
+# Purpose:       configuration script for slrn
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sun Jan 15 22:46:00 CET 2006 [mika]
+################################################################################
+
+PATH=${PATH:-'/bin/:/sbin/:/usr/local/bin:/usr/bin:/usr/sbin'}
+PN=$(basename "$0")
+USER=$(grep \`whoami\` /etc/passwd | cut -d: -f5 | cut -d, -f1)
+HOST=$(hostname -f)
+
+[ -z "$EDITOR" ] && EDITOR='vim'
+[ -z "$NNTPSERVER" ] && NNTPSERVER="news.`hostname`"
+
+# some functions used in the interactive part
+testfiles() {
+  [ -d $HOME/News ] || mkdir $HOME/News
+  [ -f $HOME/.slrn_scoring ] || touch $HOME/.slrn_scoring
+}
+
+writeslrnrc() {
+cat > $SLRNRC << EOF
+% Filename:      .slrnrc
+% Purpose:       configuration for newsreader slrn, created by 'grml-slrn'
+% Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+% Bug-Reports:   see http://grml.org/bugs/
+% License:       This file is licensed under the GPL v2.
+% Latest change: Son Nov 28 22:38:30 CET 2004 [mika]
+%###############################################################################
+
+%###############################################################################
+% Ressources:
+% TFM:                         http://slrn.sourceforge.net/manual/slrn-manual.html
+% Andrew Preater's .slrnrc:    http://www.preater.f9.co.uk/slrn/slrnrc.gz
+% Jurriaan's page:             http://www.xs4all.nl/~thunder7/
+% Emmanuele's page:            http://digilander.libero.it/ebassi/slrn.html
+% Sven's site:                 http://www.guckes.net/slrn/
+% tsca's s-lang macros:        http://www.geocities.com/tsca.geo/slang.html
+% Tomasz K³oczko's slrn-stuff: http://cvs.pld.org.pl/slrn-pl/
+% Tomasz K³oczko's macros:     http://cvs.pld.org.pl/slrn-pl/macros
+% jbn's S-Lang code:           http://forestfield.org/slrn/
+% S-lang regexps:              http://www.s-lang.org/doc/html/slang-18.html
+%###############################################################################
+
+% important variables - adjust them if necessary
+  set username "$USERNAME_SLRN"
+  set hostname "$HOSTNAME_SLRN"
+  set realname "$REALNAME_SLRN"
+  set organization "www.grml.org"
+% set replyto  "devnull@grml.org"
+
+% set signature "signature_ng"
+% set signoff_string "-mika-"
+
+  server "$NEWSSERVER"  ".newsrc_$NEWSSERVER"
+
+% If a server requires authentication, add a nnrpaccess line for it.
+% If you leave username and/or password empty, slrn will prompt for it.
+% nnrpaccess "news.isp.tld" "username" "password"
+
+  set write_newsrc_flags 0
+
+  set generate_message_id 0
+  set generate_date_header 1
+  set read_active 1
+
+  set editor_command "$EDITOR -f +%d '%s'"
+  set mail_editor_command "mutt -H '%s'"
+  set score_editor_command "$EDITOR '%s'" % $HOME/.slrn_scoring"
+  set abort_unmodified_edits 1
+  set metamail_command "metamail"
+  set non_Xbrowser "screen -t 'url' $BROWSER %s"
+  set Xbrowser "screen -t 'url' $BROWSER %s"
+
+% Command to use for printing
+#ifdef UNIX
+        set printer_name "muttprint"
+#elifdef WIN32
+        % set printer_name "MyPrinter"
+#endif
+
+  set save_posts "News/My_Posts"
+  set save_replies "News/My_Replies"
+  set failed_posts_file "~/dead.letter"
+
+  set scorefile "$HOME/.slrn_scoring"
+  set decode_directory "News"
+  set save_directory "News"
+  set postpone_directory "News/postponed"
+  set followup_string "* %r <%f> wrote:"
+  set followup_strip_signature 0
+  ignore_quotes "^ *[a-zA-Z-]*>" "^ *[\]|)]" "^ *:[^-()^]"
+  set reply_string "* %r <%f> [%n]:
+  set cc_followup 1
+  set cc_post_string "[This message has also been posted to %n.]"
+
+  header_display_format 0 "%F%-5S%-5l: [%20r] %t %70s %-12g[%10d]"
+  header_display_format 1 "%F%G%-5l:[%12r]%t%s"
+  header_display_format 2 "%F%-5l:%t%s"
+  header_display_format 3 "%F%-5S%-5l:%t%50s %r"
+  header_display_format 4 "%F%-5S [%10r]:%t%49s %-19g[%17d]"
+
+% How to display the groups index
+  group_display_format 0 "  %F%-5u  %n%45g%d"
+  group_display_format 1 "  %F%-5u [%-6t]  %n"
+  group_display_format 2 "  %F [%-5u|%-6t] %n%45g%d"
+  group_display_format 3 "  %F%-5u  %n%50g%-8l-%h"
+
+  set spoiler_display_mode 1
+
+  set charset isolatin
+  set use_mime 1
+  set mime_charset "iso-8859-15"
+
+  set sorting_method 5
+  set check_new_groups 1         % let slrn check for new newsgroups
+  set unsubscribe_new_groups 1   % new groups are unsubscribed by default
+
+  set beep 2
+  set new_subject_breaks_threads 0 % No, no!
+
+  visible_headers "Subject:,From:,Organization:,Newsgroups:,Date:,Followup-To:,Mail-Copies-To:,Reply-To:,Message-ID:,Supersedes:,User-Agent,Approved,X-Mailer,X-Newsreader:,X-Posting-Agent:,X-Http-User-Agent:,X-,!X-Trace:,!X-Complaints-To:,!X-Face:,!X-MSMail-Priority:,!X-MimeOLE:,!X-Priority:,!X-Accept-Language:"
+
+  set process_verbatim_marks 1
+  set simulate_graphic_chars 1
+  set display_cursor_bar 0
+  set scroll_by_page 0
+  set color_by_score 3
+  set highlight_unread_subjects 2
+  set highlight_urls 1
+  set confirm_actions 31   % 1 & 2 & 4 & 8 & 16
+  set warn_followup_to 2
+  set emphasized_text_mask 1 % message only
+  set emphasized_text_mode 3 % Display text as text!
+  set query_next_article 0 % Very annoying until I turned it off.
+  set wrap_flags 7  % _Automatically_ wrap quoted material and body
+  set wrap_method 2
+EOF
+}
+
+lightcolors() {
+cat >> $SLRNRC << EOF
+
+% color setup
+color article              "blue"         "white"
+color author               "red"          "white"
+color boldtext             "black"        "white"
+color box                  "black"        "white"
+color cursor               "yellow"       "red"
+color date                 "brightblue"   "black"
+color description          "black"        "white"
+color error                "red"          "white"
+color frame                "yellow"       "blue"
+color from_myself          "brightred"    "black"
+color group                "blue"         "white"
+color grouplens_display    "yellow"       "red"
+color header_name          "green"        "white"
+color header_number        "green"        "white"
+color headers              "blue"         "white"
+color high_score           "brightred"    "white"
+color italicstext          "magenta"      "white"
+color menu                 "yellow"       "red"
+color menu_press           "blue"         "yellow"
+color message              "black"        "white"
+color neg_score            "magenta"      "white"
+color normal               "black"        "white"
+color pgpsignature         "brown"        "white"
+color pos_score            "blue"         "white"
+color quotes               "red"          "white"
+color quotes1              "magenta"      "white"
+color quotes2              "brown"        "white"
+color quotes3              "red"          "white"
+color quotes4              "brown"        "white"
+color quotes5              "blue"         "white"
+color quotes6              "black"        "white"
+color quotes7              "brown"        "white"
+color response_char        "green"        "white"
+color selection            "yellow"       "white"
+color signature            "black"        "white"
+color status               "yellow"       "red"
+color subject              "black"        "white"
+color thread_number        "blue"         "white"
+color tilde                "green"        "white"
+color tree                 "red"          "white"
+color underlinetext        "cyan"         "white"
+color verbatim             "red"          "white"
+
+% This color object is only used when highlight_unread_subjects is set to 2
+% (see the reference manual for details)
+color unread_subject   "red"        "white"
+mono  unread_subject   "bold"
+
+% These attributes are for terminals that cannot display color:
+mono article           "none"
+mono author            "none"
+mono boldtext          "bold"
+mono cursor            "bold"  "reverse"
+mono date              "none"
+mono description       "none"
+mono error             "blink" "bold"
+mono frame             "reverse"
+mono from_myself       "bold"
+mono group             "bold"
+mono grouplens_display "none"
+mono header_number     "none"
+mono headers           "bold"
+mono high_score                "bold"
+mono italicstext       "bold"
+mono menu              "reverse"
+mono menu_press                "none"
+mono normal            "none"
+mono pgpsignature      "none"
+mono quotes            "underline"
+mono quotes1           "underline"
+mono quotes2           "underline"
+mono quotes3           "underline"
+mono quotes4           "underline"
+mono quotes5           "underline"
+mono quotes6           "underline"
+mono quotes7           "underline"
+mono response_char     "bold"
+mono selection         "bold"  
+mono signature         "none"
+mono status            "reverse"
+mono subject           "none"
+mono thread_number     "bold"
+mono tree              "bold"
+mono underlinetext     "underline"
+mono url               "bold"
+mono verbatim          "none"
+EOF
+}
+
+# FIXME TODO
+darkcolors() {
+cat >> $SLRNRC << EOF
+% dark color setup
+% ....
+EOF
+}
+
+infoscreen() {
+dialog --stdout --title "$PN" --msgbox "Thanks for using $PN!
+
+More information on slrn:
+
+Manual: man 1 slrn
+
+Webpages:
+www.slrn.org
+www.michael-prokop.at/slrn/
+
+#######################################################
+
+Report bugs, send wishes and feedback to the grml team:
+http://www.grml.org/ - contact (at) grml.org
+" 20 65
+}
+
+# interactive part
+dialog --stdout --title "$PN" --msgbox "Welcome to $PN!
+
+This script will create a simple base
+configuration for the newsreader slrn.
+
+Report bugs, send wishes and feedback to the grml team:
+http://www.grml.org/ - contact (at) grml.org
+" 13 65
+
+GETREALNAME_SLRN=$(dialog --stdout --title "$PN" --inputbox "Your real name (eg 'John GRML User'):" 0 65 "$USER" ) || exit 0
+REALNAME_SLRN=${GETREALNAME_SLRN%/*}
+
+GETMAILADDR=$(dialog --stdout --title "$PN" --inputbox "Your main mail address (eg 'joedoe@grml.org'):" 0 65 `whoami`@$HOST ) || exit 0
+MAILADDR=${GETMAILADDR}
+USERNAME_SLRN=$(echo "$MAILADDR" | sed "s/@.*//")
+HOSTNAME_SLRN=$(echo "$MAILADDR" | sed "s/.*@//")
+
+GETNEWSSERVER=$(dialog --stdout --title "$PN" --inputbox "What's the newsserver you want to use?
+(eg 'news."$HOSTNAME_SLRN"'):" 8 65 "$HOST" ) || exit 0
+NEWSSERVER=${GETNEWSSERVER}
+
+GETCOLOR=$(dialog --stdout --title "$PN" \
+          --radiolist "Which color setup do you want to use?" 10 65 2 \
+          dark   "dark color setup (default)" on \
+          light  "light color setup" off)
+retval=$?
+case $retval in
+  0) COLOR=$GETCOLOR ;;
+  *) exit 1 ;;
+esac
+
+writecolors() {
+  if [ "$COLOR" == 'light' ] ; then
+    lightcolors
+  fi
+  if [ "$COLOR" == 'dark' ] ; then
+    darkcolors
+  fi
+}
+
+GETSLRNRC=$(dialog --stdout --title "$PN" --inputbox "Choose a filename for this configuration:" 0 65 "$HOME/.slrnrc") || exit 0
+SLRNRC=${GETSLRNRC}
+
+WRITESLRNRC=$(dialog --stdout --title "$PN" --yesno "Write $SLRNRC?" 5 65)
+retval=$?
+
+case $retval in
+  0) 
+    if [ -f "$SLRNRC" ] ; then
+      dialog --stdout --title "$PN" --yesno "$SLRNRC exists. Overwrite?" 5 65
+      retval=$?
+      case $retval in
+        0) 
+          writeslrnrc && writecolors && \
+          dialog --stdout --title "$PN" --msgbox "Writing $SLRNRC was successful." 7 65 || \
+          dialog --stdout --title "$PN" --msgbox "Error $?: writing $SLRNRC failed." 7 65
+          ;;
+#        *) exit 1 ;;
+      esac
+    else
+       writeslrnrc && writecolors && \
+       dialog --stdout --title "$PN" --msgbox "Writing $SLRNRC was successfull." 7 65 || \
+       dialog --stdout --title "$PN" --msgbox "Error $?: writing $SLRNRC failed." 7 65
+    fi
+    ;;
+#  *) exit 1 ;;
+esac
+
+infoscreen
+
+ASKRUN=$(dialog --stdout --title "$PN" --yesno "Run slrn now?" 0 0)
+retval=$?
+
+case $retval in
+  0) 
+     slrn -create -h $NEWSSERVER -f $HOME/.newsrc_$NEWSSERVER -i $SLRNRC && \
+     echo ""
+     echo "Start slrn with taken settings via:
+$ slrn -h $NEWSSERVER -f $HOME/.newsrc_$NEWSSERVER -i $SLRNRC
+
+Thanks for using $PN and have fun with slrn!"
+     ;;
+esac
+
+
+## END OF FILE #################################################################
diff --git a/usr_bin/grml-start b/usr_bin/grml-start
new file mode 100755 (executable)
index 0000000..9bc28cc
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Filename:      grml-start
+# Purpose:       start browser with information page on grml
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Fre Jul 07 22:42:40 CEST 2006 [mika]
+################################################################################
+
+ (( ${+BROWSER} )) || BROWSER="w3m"
+#(( ${+BROWSER} )) || BROWSER="links2 -driver fb"
+exec $BROWSER /usr/share/doc/grml-docs/startpage.html
+
+## END OF FILE #################################################################
diff --git a/usr_bin/hgrep.sh b/usr_bin/hgrep.sh
new file mode 100755 (executable)
index 0000000..09bce84
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/zsh
+# Filename:      hgrep.sh
+# Purpose:       highlight grep
+# Authors:       Oliver Kiddle (<URL:http://www.zsh.org/mla/workers/2001/msg00390.html>)
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Mai 27 15:12:27 CEST 2006 [mika]
+################################################################################
+
+if (( ! $# )); then
+  echo "Usage: $0:t [-e pattern...] [file...]" >&2
+  return 1
+fi
+
+local -a regex
+local htext=`echotc so` ntext=`echotc se`
+
+while [[ "$1" = -e ]]; do
+  regex=( $regex "$2" )
+  shift 2
+done
+
+if (( ! $#regex )); then
+  regex=( "$1" )
+  shift
+fi
+
+regex=( "-e
+s/${^regex[@]}/$htext&$ntext/g" )
+sed ${(Ff)regex[@]} "$@"
+
+## END OF FILE #################################################################
diff --git a/usr_bin/iimage b/usr_bin/iimage
new file mode 100755 (executable)
index 0000000..14ef84f
--- /dev/null
@@ -0,0 +1,2048 @@
+#!/bin/bash
+######################################################################
+#
+#           I_I_M_A_G_E
+#
+# Copyright (c) 1996-2004, Ronald Schmidt    <ronsc@ronsc.de>
+#               2000-2004, Holm Sieber       <sieber@prudsys.com>
+#                    2004, Daniel Molkentin  <daniel@molkentin.de>
+#                    2004, Sven Guckes       <guckes@guckes.net>
+#
+# Download: http://www.ronsc.de
+#
+######################################################################
+#
+# All rights reserved.
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# Neither the name of the organization nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+######################################################################
+#
+#     Web:     http://www.ronsc.de/iimage/
+#
+#     List:    https://mailman.ronsc.de/listinfo/iimage
+#
+######################################################################
+
+SVN_ID="$Id: iimage 36 2006-01-14 20:19:46Z ronsc $"
+
+# old templates might still use CVS_VERSION
+CVS_VERSION="$SVN_ID"
+
+##############################################################
+# Defaults
+
+PATH=$PATH:/usr/X11R6/bin:/usr/bin
+# external commands: convert identify jpegtran metacam mplayer
+# awk basename cat cp date echo find grep mkdir mv rm uname
+
+FONT="fixed"
+COLOR="white"
+FONTSIZE="14"
+
+DATADIR=".tmp"
+
+LANG=en_US
+
+DISPLAY_GEOMETRY=640x480
+THUMBNAIL_GEOMETRY=150x150
+THUMBNAIL_QUALITY=75
+
+THUMBNAILS="$DISPLAY_GEOMETRY $THUMBNAIL_GEOMETRY"
+
+# Slide-Show Options
+SLIDE_DELAY=5
+SLIDE_LOOP=false
+
+EXCLUDE_ORGINAL=false
+RECURSIVE=false
+IIMAGE_SPECIAL=false
+
+COLUMNS=4
+
+VARIABLES="title description order date ignore iorder \
+           FONT COLOR FONTSIZE CTAG \
+           THUMBNAIL_QUALITY \
+           SLIDE_DELAY SLIDE_LOOP \
+           EXCLUDE_ORGINAL RECURSIVE COLUMNS \
+           AUDIODIR IIMAGE_SPECIAL"
+
+##############################################################
+# handlers
+
+FILE_EXTENSIONS='jpg jpeg gif png avi mov mpeg'
+function AVI_handler_prepare() {
+   # evtl ein bild aus den ersten 10 sec
+
+   if [ "$MPLAYER" ] ; then
+
+
+      DST="$DATADIR/$1.1st.jpg"
+
+      if [ "$DST" -ot "$1" ]; then
+
+         echo -n " 1st"
+         rm -f $DATADIR 00000001.jpg 00000002.jpg
+
+         mplayer -quiet -frames 1 -ao none -vo jpeg -jpeg outdir=$DATADIR $1 >/dev/null 2>/dev/null
+
+         if  [ -f "$DATADIR/00000001.jpg" ] ; then
+            convert "$DATADIR/00000001.jpg" -geometry $THUMBNAIL_GEOMETRY "$DST"
+         fi
+
+         rm -f $DATADIR 00000001.jpg 00000002.jpg
+      fi
+   fi
+   true
+}
+
+function AVI_handler_index() {
+   echo -n " I"
+
+   THIS_IMAGE="$1"
+   THIS_HTML="$DATADIR/$THIS_IMAGE.html"
+   THIS_HTML_INFO="$DATADIR/$THIS_IMAGE.info.html"
+
+   if [ -f "$DATADIR/$1.1st.jpg" ] ; then
+      ITEM_ICON=$1.1st.jpg
+   else
+      ITEM_ICON=avi.jpg
+   fi
+   { . $INDEX_ICON_TEMPLATE;} >> "$INDEX_HTML"
+}
+
+function AVI_handler_html() {
+   # keine extra ansicht
+   true;
+}
+
+function MPEG_handler_prepare() {
+   AVI_handler_prepare $@
+}
+function MPEG_handler_index() {
+   AVI_handler_index $@
+}
+function MPEG_handler_html() {
+   AVI_handler_html $@
+}
+
+function MOV_handler_prepare() {
+   # evtl ein bild aus den ersten 10 sec
+   AVI_handler_prepare $1
+}
+
+function MOV_handler_index() {
+   echo -n " I"
+
+   THIS_IMAGE="$1"
+   THIS_HTML="$DATADIR/$THIS_IMAGE.html"
+   THIS_HTML_INFO="$DATADIR/$THIS_IMAGE.info.html"
+   if [ -f "$DATADIR/$1.1st.jpg" ] ; then
+      ITEM_ICON=$1.1st.jpg
+   else
+      ITEM_ICON=mov.jpg
+   fi
+   { . $INDEX_ICON_TEMPLATE ;} >> "$INDEX_HTML"
+}
+
+function MOV_handler_html() {
+   # keine extra ansicht
+   true;
+}
+
+
+function default_handler_index() {
+   echo -n " I"
+
+   THIS_IMAGE="$1"
+   THIS_HTML="$DATADIR/$THIS_IMAGE.html"
+   THIS_HTML_INFO="$DATADIR/$THIS_IMAGE.info.html"
+
+   load_image_infos $1
+
+   { . $INDEX_ITEM_TEMPLATE ; } >> "$INDEX_HTML"
+}
+
+function default_handler_html() {
+
+   FILE="$1"; THIS_IMAGE="$1";
+   load_image_infos $1
+
+   PREV_IMAGE=`( echo index ; cat $DATADIR/slideable ; echo index ; ) | grep -1 "^$THIS_IMAGE$" | head -n 1`
+   NEXT_IMAGE=`( echo index ; cat $DATADIR/slideable ; echo index ; ) | grep -1 "^$THIS_IMAGE$" | tail -n 1`
+
+   POS=$[ $POS + 1 ]
+
+   echo -n " $POS"
+
+   if [ "$NEXT_IMAGE" = "index" ] ; then
+      R_NEXT_HTML="../index.html"
+      R_NEXT_HTML_INFO="../index.html"
+      R_NEXT_HTML_SLIDE="../index.html"
+   else
+      R_NEXT_HTML="$NEXT_IMAGE.html"
+      R_NEXT_HTML_INFO="$NEXT_IMAGE.info.html"
+      R_NEXT_HTML_SLIDE="$NEXT_IMAGE.slide.html"
+   fi
+
+   if [ "$PREV_IMAGE" = "index" ] ; then
+      R_PREV_HTML="../index.html"
+      R_PREV_HTML_INFO="../index.html"
+      R_PREV_HTML_SLIDE="../index.html"
+   else
+      R_PREV_HTML="$PREV_IMAGE.html"
+      R_PREV_HTML_INFO="$PREV_IMAGE.info.html"
+      R_PREV_HTML_SLIDE="$PREV_IMAGE.slide.html"
+   fi
+
+   R_THIS_HTML="$THIS_IMAGE.html"
+   THIS_HTML="$DATADIR/$THIS_IMAGE.html"
+   THIS_HTML_INFO="$DATADIR/$THIS_IMAGE.info.html"
+   THIS_HTML_SLIDE="$DATADIR/$THIS_IMAGE.slide.html"
+
+   if [ "$FIRST_HTML" = "" ] ; then
+      FIRST_HTML="$THIS_HTML";
+   fi
+
+   echo -n " H"
+   { . $HTML_TEMPLATE ;} > "$THIS_HTML"
+
+   echo -n "+"
+   { . $HTML_INFO_TEMPLATE ;} > "$THIS_HTML_INFO"
+
+   echo -n "*"
+   { . $HTML_SLIDE_TEMPLATE ;} > "$THIS_HTML_SLIDE"
+
+}
+
+function default_handler_prepare() {
+   build_thumbnail "$1"
+   echo "$1" >> $DATADIR/slideable
+}
+
+
+##############################################################
+##############################################################
+##############################################################
+##############################################################
+# load config
+if [ -f  /etc/iimage.conf ] ; then . /etc/iimage.conf; fi
+if [ -f  ~/.iimage ] ; then . ~/.iimage; fi
+if [ -f  ~/.iimage/config ] ; then . ~/.iimage/config; fi
+
+dcount=1;
+for dir in `pwd | tr '/' ' '` ; do
+   dfile=`pwd | cut -d"/" -f-$dcount`/description
+   dcount=$[ $dcount + 1 ]
+   if [ -f $dfile ] ; then 
+      . $dfile 2>/dev/null
+   fi
+done
+unset order title description 
+
+if [ -f  ./description ] ; then . ./description 2>/dev/null ; fi
+
+
+##############################################################
+# definitions
+
+VERSION="r`echo $SVN_ID| cut -d " " -f 3`"
+
+HTML_TEMPLATE="$DATADIR/html_template.html"
+HTML_INFO_TEMPLATE="$DATADIR/html_info_template.html"
+HTML_SLIDE_TEMPLATE="$DATADIR/html_slide_template.html"
+
+if [ "$TEMPLATEDIR" = "" ] ; then
+   TEMPLATEDIR="~/.iimage"
+fi
+
+FOOTER_TEMPLATE="$DATADIR/footer_template.html"
+HEAD_TEMPLATE_START="$DATADIR/head_template_start.html"
+HEAD_TEMPLATE_END="$DATADIR/head_template_end.html"
+INDEX_HEAD_TEMPLATE="$DATADIR/index_head_template.html"
+INDEX_ITEM_TEMPLATE="$DATADIR/index_item_template.html"
+INDEX_ICON_TEMPLATE="$DATADIR/index_icon_template.html"
+INDEX_FOOT_TEMPLATE="$DATADIR/index_foot_template.html"
+INDEX_DIR_TEMPLATE="$DATADIR/index_dir_template.html"
+CSS_TEMPLATE="$DATADIR/css_template.css"
+INFO_AWK_TEMPLATE="$DATADIR/display_info_template.awk"
+TRANSP_PIXEL="$DATADIR/transp.gif"
+DIR_ICON="$DATADIR/dir.gif"
+AVI_ICON="$DATADIR/avi.jpg"
+MOV_ICON="$DATADIR/mov.jpg"
+SND_ICON="$DATADIR/snd.png"
+COUNTFILE_CURENT="$DATADIR/count.current"
+COUNTFILE_SUB="$DATADIR/count.sub"
+COUNTFILE_SUM="$DATADIR/count.summ"
+INDEX_HTML="index.html"
+
+DATA_FILES="DIR_ICON \
+TRANSP_PIXEL INFO_AWK_TEMPLATE CSS_TEMPLATE INDEX_DIR_TEMPLATE \
+INDEX_FOOT_TEMPLATE INDEX_ITEM_TEMPLATE INDEX_HEAD_TEMPLATE \
+HTML_INFO_TEMPLATE HTML_TEMPLATE \
+HTML_SLIDE_TEMPLATE AVI_ICON MOV_ICON INDEX_ICON_TEMPLATE \
+SND_ICON HEAD_TEMPLATE_START HEAD_TEMPLATE_END \
+FOOTER_TEMPLATE"
+
+######################################################################
+######################################################################
+######################################################################
+# funktions
+
+function upper() { echo $* | tr "[a-z]" "[A-Z]" ; }
+function lowerr() { echo $* | tr "[A-Z]" "[a-z]" ; }
+
+function load_image_infos() {
+
+   THIS_IMAGE=$1
+
+   TN_IMAGE=$DATADIR/$THUMBNAIL_GEOMETRY/$THIS_IMAGE
+   TN_IMAGE_SIZE=`cat $DATADIR/$THUMBNAIL_GEOMETRY/$THIS_IMAGE.size`
+
+   THIS_IMAGE_GEOMETRY=`cat $DATADIR/$THIS_IMAGE.geometry`
+   if [ "$METACAM" ]; then
+      THIS_IMAGE_DATE="`metainfo $DATADIR/$THIS_IMAGE.metacam \
+         'Image Creation Date'`"
+   elif [ "$JHEAD" ]; then
+      THIS_IMAGE_DATE="`metainfo $DATADIR/$THIS_IMAGE.metacam \
+         'Date/Time'`"
+   fi
+
+   R_IMAGE=../$THIS_IMAGE
+   R_DISPLAY_IMAGE=$DISPLAY_GEOMETRY/$THIS_IMAGE
+   TN_IMAGE=$DATADIR/$THUMBNAIL_GEOMETRY/$THIS_IMAGE
+
+   TN_IMAGE_SIZE=`cat $DATADIR/$THUMBNAIL_GEOMETRY/$THIS_IMAGE.size`
+   R_DISPLAY_IMAGE_SIZE=`cat $DATADIR/$DISPLAY_GEOMETRY/$THIS_IMAGE.size`
+
+   THIS_IMAGE_GEOMETRY=`cat $DATADIR/$THIS_IMAGE.geometry`
+   if [ "$METACAM" ]; then
+      THIS_IMAGE_DATE="`metainfo $DATADIR/$THIS_IMAGE.metacam \
+         'Image Creation Date'`"
+   elif [ "$JHEAD" ]; then
+      THIS_IMAGE_DATE="`metainfo $DATADIR/$THIS_IMAGE.metacam \
+         'Date/Time'`"
+   fi
+
+   EXTENSION=`echo $THIS_IMAGE  | awk -F"." '{print $NF}'`
+   WAV_FILE_BASE=`basename $THIS_IMAGE .$EXTENSION`
+   if [ "$AUDIODIR" != "" ] ; then AUDIODIREXT="$AUDIODIR/"; fi
+   WAV_FILE=`eval \ls "$AUDIODIREXT$WAV_FILE_BASE.[wW][aA][vV]" 2>/dev/null | head -n 1`
+
+   if [ -f "$WAV_FILE" ] ; then
+      EXTRA_SMALL_ICON="<a href=$WAV_FILE><img alt=\"Sound-Logo\" src=\"$DATADIR/snd.png\" align=\"right\" border=\"0\"></a>";
+      EXTRA_SMALL_ICON2="<a href=../$WAV_FILE><img alt=\"Sound-Logo\" src=\"snd.png\" border=\"0\"></a>";
+   else
+      EXTRA_SMALL_ICON=""
+      EXTRA_SMALL_ICON2=""
+   fi
+}
+
+# --------------------------------------------------------------------
+function require() {
+   which $1 2>/dev/null >> $DATADIR/log
+   if which $1 2>/dev/null >/dev/null ; then
+      true
+   else
+      echo "ERROR: $1 not found!"
+      exit;
+   fi
+}
+
+# --------------------------------------------------------------------
+# get filesize
+function filesize() {
+   echo -ne "`ls -L -l -d -G \"$1\" | awk '{print $4}'`"
+}
+
+# --------------------------------------------------------------------
+# read key:val from description-file
+function description() {
+
+   file="description"
+   if [ "$2" != "" ] ; then file="$2"; fi
+
+   if [ -f "$file" ] ; then
+      grep "^$1" "$file" \
+      | awk -F"=" '{for (a=2;a<=NF;a++) {if (b!="") b=b "=" ; \
+                   b=b $a}}END{printf b}' | cut -d"\"" -f 2
+   fi
+}
+
+function wrap_table() {
+   T_COUNT=$[ $T_COUNT + 1 ]
+
+   if [ $T_COUNT -gt $COLUMNS ] ; then
+      echo "</tr><tr>";
+      T_COUNT=1;
+   fi;
+
+   export T_COUNT
+
+   # alte templates meeren dadrin rum
+   [ -f .count ] && echo 0 >.count
+}
+
+# --------------------------------------------------------------------
+function metainfo() {
+   file=$1;
+   tag=$2;
+   cat "$file" | grep "$tag" \
+   | awk -F": " '{ a=$2; while (substr(a,1,1)==" ") \
+                 { a=substr(a,2);} print a}'
+}
+
+# --------------------------------------------------------------------
+function generate_info_table() {
+
+   if [ -f "$DATADIR/$THIS_IMAGE.metacam" ] ; then
+      cat "$DATADIR/$THIS_IMAGE.metacam" | awk -F": " -f "$INFO_AWK_TEMPLATE"
+   fi
+   if [ -f "$DATADIR/$THIS_IMAGE.identify" ] ; then
+      cat "$DATADIR/$THIS_IMAGE.identify" | awk -F": " -f "$INFO_AWK_TEMPLATE"
+   fi
+}
+
+# --------------------------------------------------------------------
+function rotate_image() {
+   FILE="$1"
+   if [ $METACAM ]; then
+     ORIENTATION=`metacam -v "$FILE" 2>/dev/null \
+                | grep Orientation | cut -d":" -f 2  | cut -d"," -f 1 `
+   elif [ $JHEAD ]; then
+     ORIENTATION=`jhead -v "$FILE" 2>/dev/null \
+                | grep "Orientation =" | cut -d '=' -f 2 | cut -c 2 `
+   fi
+   ORIENTATION=`echo $ORIENTATION`
+
+   if [ "$ORIENTATION" -a "$ORIENTATION" != "1" ] ; then
+      SIZE=`identify "$FILE"| cut -d" " -f 3`
+      WIDTH=`echo $SIZE | cut -d"x" -f 1 | cut -d"+" -f 1`
+      HEIGHT=`echo $SIZE | cut -d"x" -f 2 | cut -d"+" -f 1`
+
+      if [ "$HEIGHT" -lt "$WIDTH" ] ; then
+
+         mkdir -p .backup
+         if [ ! -f .backup/$FILE ] ; then
+            echo -n " B"
+            cp $FILE .backup/$FILE
+         fi
+
+         if [ "$ORIENTATION" = "6" ] ; then
+            echo -n " /"
+            jpegtran -rotate 90 -copy all "$FILE" >"$FILE""_"
+         else
+            echo -en " \\"
+            jpegtran -rotate 270 -copy all "$FILE" >"$FILE""_"
+         fi
+         mv -f "$FILE""_" "$FILE"
+      fi
+   fi
+}
+
+##############################################################
+# generate thumbnails
+function build_thumbnail() {
+
+   IMAGE="$1"
+
+   if [ "$METACAM" ] || [ "$JHEAD" ]; then
+      if [ -a "$JPEGTRAN" ] ; then
+         rotate_image "$IMAGE"
+      fi
+   fi
+
+   if [ ! -f "$DATADIR/$IMAGE.size" -o \
+        "$DATADIR/$IMAGE.size" -ot "$IMAGE" ] ; then
+      # identify -format "%wx%h" "$IMAGE" > "$DATADIR/$IMAGE.geometry"
+
+      if [ "$IDENTIFY2" ] ; then
+         echo -n " I"
+         identify \
+            -format "  Geometry: %wx%h\n  Format: %m\n  Filesize: %b" \
+            "$IMAGE" > "$DATADIR/$IMAGE.identify"
+      else
+         echo -n " i"
+         identify -verbose "$IMAGE" > "$DATADIR/$IMAGE.identify"
+      fi
+
+      echo -n "S"
+      cat "$DATADIR/$IMAGE.identify" \
+           | grep "^ *.eometry:" \
+           | awk -F': ' '{print $2}' > "$DATADIR/$IMAGE.geometry"
+      cat "$DATADIR/$IMAGE.geometry" \
+           | awk -F"x" '{print "WIDTH=\""$1"\" HEIGHT=\""$2"\""}' > $DATADIR/$IMAGE.size
+   fi
+
+   if [ "$METACAM" ] ; then
+      if [ ! -f "$DATADIR/$IMAGE.metacam" -o \
+             "$DATADIR/$IMAGE.metacam" -ot "$IMAGE" ] ; then
+         echo -n " M"
+         metacam "$IMAGE" >"$DATADIR/$IMAGE.metacam" 2>/dev/null
+      fi
+   elif [ "$JHEAD" ] ; then
+      if [ ! -f "$DATADIR/$IMAGE.metacam" -o \
+             "$DATADIR/$IMAGE.metacam" -ot "$IMAGE" ] ; then
+         echo -n " J"
+         jhead "$IMAGE" >"$DATADIR/$IMAGE.metacam" 2>/dev/null
+      fi
+   fi
+
+   echo -n " "
+
+   LASTIMAGE="";
+
+   for GEOMETRY in $THUMBNAILS; do
+
+      mkdir -p "$DATADIR/$GEOMETRY" || exit
+
+      echo -ne "($GEOMETRY"
+      DST="$DATADIR/$GEOMETRY/$IMAGE"
+
+      if [ ! \( -L "$DST" -a -L "$IMAGE" \) ] ; then
+      if [ ! -s "$DST" -o "$DST" -ot "$IMAGE" -o "$FORCE_TN" = "true" ] ; then
+
+         if [ "$LASTIMAGE" = "" ] ; then
+            LASTIMAGE="$IMAGE";
+         fi
+
+         echo -n " T"
+         convert  -quality $THUMBNAIL_QUALITY \
+                  -geometry "$GEOMETRY+0+0>" "$LASTIMAGE" \
+                  "$DST"
+#                  +profile "$LASTIMAGE" \
+
+         LASTIMAGE="$DST"
+
+         # optimize with jpegtran
+
+         JPEG=""
+
+         echo $DST | grep .jpg >/dev/null && JPEG=true
+         echo $DST | grep .JPG >/dev/null && JPEG=true
+         echo $DST | grep .jpeg >/dev/null && JPEG=true
+         echo $DST | grep .JPEG >/dev/null && JPEG=true
+
+         if [ "$JPEGTRAN" -a "$JPEG" ] ; then
+            echo -n " O"
+            jpegtran -copy all -optimize -progressive "$DST" > "$DST.tmp"
+            mv -f "$DST.tmp" "$DST"
+         fi
+
+      fi
+      fi
+
+      if [ ! -f "$DST.size" -o "$DST.size" -ot "$DST" ] ; then
+
+         # imagesite WIDTHxHEIGH
+         # identify -format "%wx%h" "$DST" > "$DST.geometry"
+
+         if [ "$IDENTIFY2" ] ; then
+            echo -n " I"
+            identify \
+               -format "  Geometry: %wx%h\n  Format: %m\n  Filesize: %b" \
+               "$DST" \
+               | grep "^ *.eometry:" \
+               | awk -F': ' '{print $2}' > "$DST.geometry"
+         else
+            echo -n " I"
+            identify -verbose "$DST" | grep "^ *.eometry:" \
+               | awk -F': ' '{print $2}' > "$DST.geometry"
+         fi
+
+         echo -n "S"
+
+         # cache image-geometry
+         cat "$DST.geometry" | awk -F"x" '{print "WIDTH=\""$1"\" HEIGHT=\""$2"\""}' \
+            > "$DST.size"
+
+         if [ "$GEOMETRY" != "$THUMBNAIL_GEOMETRY" -a "$CTAG" ] ; then
+            Y=`cat "$DST.geometry" | cut -d"x" -f2 `
+            echo -n " TG"
+            convert "$DST" -pointsize $FONTSIZE \
+               -font "$FONT" -stroke black -fill black \
+               -draw 'text 10, '"$[ $Y - 10 ]"' "'"$CTAG"'"' "$DST"_
+            mv -f "$DST"_ "$DST"
+            convert "$DST" -pointsize $FONTSIZE \
+               -font "$FONT" -stroke $COLOR -fill $COLOR \
+               -draw 'text 9, '"$[ $Y - 9 ]"' "'"$CTAG"'"' "$DST"_
+            mv -f "$DST"_ "$DST"
+         fi
+
+      fi
+
+      echo -n ") "
+
+   done
+}
+
+##############################################################
+function search_subdirs() {
+
+   ORDER=`description order`
+
+   if [ "$ORDER" = "" ] ; then ORDER="alphabetically"; fi
+
+   if [ "$ORDER" = "accesstime" ] ; then
+      RAWDIRS=`eval "find * -maxdepth 0 -type d $IIMAGE_EXCLUDE"`
+      if [ "$RAWDIRS" != "" ] ; then
+         DIRS=`ls -dt $RAWDIRS`
+      else
+         DIRS=""
+      fi
+   elif [ "$ORDER" = "alphabetically" ] ; then
+      DIRS=`eval "find * -maxdepth 0 -type d $IIMAGE_EXCLUDE"`
+   elif [ "$ORDER" = "dec" ] ; then
+      DIRS=`eval "find * -maxdepth 0 -type d $IIMAGE_EXCLUDE"`
+   else
+      DIRS=$ORDER
+   fi
+
+   COUNT_SUBDIRS=0;
+
+   for DIR in $DIRS ; do
+
+      if [ "$DIR" = "---" ] ; then
+         echo "<tr><td colspan=\"3\"><hr noshade size=\"1\"></td></tr>";
+      else
+
+         FOLDER_DESCRIPTION="";
+         SUB_IMAGE=""
+         SUB_IMAGE_size="";
+         SUB_TITLE="";
+         SUB_COUNT=0;
+
+         if [ -f "$DIR/$COUNTFILE_SUM" ] ; then
+            SUB_COUNT=`cat $DIR/$COUNTFILE_SUM`
+            if [ "$SUB_COUNT" = "" ] ; then SUB_COUNT=0; fi
+         else
+            SUB_COUNT=0;
+         fi
+
+         if [ "$SUB_COUNT" -gt 0 ] ; then
+            SUB_COUNT_STR="$SUB_COUNT";
+         else
+            SUB_COUNT_STR="";
+         fi
+
+
+         COUNT_SUBDIRS=$[ $COUNT_SUBDIRS + $SUB_COUNT ]
+
+         if [ -f "$DIR/description" ]; then
+
+            title="`description title $DIR/description`"
+            date="`description date $DIR/description`"
+            FOLDER_DESCRIPTION="`description description $DIR/description`"
+
+            if [ "$title" = "" ] ; then title=$DIR ; fi
+
+            eval `grep mainimage= $DIR/description`
+
+            SUB_IMAGE=$DIR/$DATADIR/$THUMBNAIL_GEOMETRY/$mainimage
+            SUB_IMAGE_size=$DIR/$DATADIR/$THUMBNAIL_GEOMETRY/$mainimage.size
+
+            SUB_TITLE="$title"
+            if [ "$date" != "none" ] ; then SUB_DATE="$date"; fi
+
+         else
+            SUB_TITLE=$DIR
+         fi
+
+         SUB_DST=$DIR/index.html
+
+         { . $INDEX_DIR_TEMPLATE ;}
+      fi
+
+   done
+
+   echo $COUNT_SUBDIRS > $COUNTFILE_SUB
+
+}
+
+##############################################################
+# create picture index
+
+function check_iimage() {
+   info
+
+   require convert
+   require find
+   require awk
+   require identify
+   require grep
+
+   {
+      uname
+      identify  | grep Version
+      convert  | grep Version
+   } >> $DATADIR/log
+
+   JPEGTRAN="`which jpegtran 2>/dev/null`"
+   MPLAYER="`which mplayer 2>/dev/null`"
+   METACAM="`which metacam 2>/dev/null`"
+   JHEAD="`which jhead 2>/dev/null`"
+   IDENTIFY2=`identify  | grep -- -format 2>/dev/null`
+   IIMAGE_FOLLOW_LINKS="`which iimage_follow_links 2>/dev/null`"
+
+   HOSTNAME=`hostname --fqdn 2>/dev/null || hostname`
+
+   echo -n "features: "
+
+   [ "$JPEGTRAN" ] && echo -n "jpegtran "
+   [ "$MPLAYER" ] && echo -n "mplayer "
+   [ "$METACAM"  ] && echo -n "metacam "
+   [ "$JHEAD"  ] && echo -n "jhead "
+   [ "$IDENTIFY2" ] && echo -n "identify>5.x "
+   [ "$IIMAGE_FOLLOW_LINKS" ] && echo -n "follow_links "
+
+   echo ""
+   echo "legend:   I..identify S..size M..metacam J..jhead T..thumb O..optimize"
+   echo "-----------------------------------------------------------------------------"
+
+   IIMAGE_CHECK="ok"
+   export IIMAGE_CHECK METACAM JPEGTRAN IDENTIFY2 IIMAGE_FOLLOW_LINKS
+
+   IIMAGE_TOPLEVEL=true;
+}
+
+function store_templates() {
+
+   TMPLATES=""
+
+   for file in $DATA_FILES ; do
+
+      base_file=`eval 'echo -e $'$file`
+
+      if [ ! -f $base_file -o "$FORCE_TEMPLATES" = "true" ] ; then
+
+         src_file=`basename $base_file`
+
+         if [ "$TMPLATES" = "" ] ; then
+            echo -en "TEMPLATE:\t"
+            TMPLATES=false;
+         fi
+
+         #"$FORCE_TEMPLATES" = "" -a
+         if [ "(" -f $TEMPLATEDIR/$src_file -o -L $TEMPLATEDIR/$src_file ")" ] ; then
+            cp $TEMPLATEDIR/$src_file $base_file
+            echo -n "~"
+         else
+            eval "put_$file >$base_file"
+            echo -n "o"
+         fi
+      fi
+
+   done
+
+   [ "$TMPLATES" != "" ] && echo # OK
+}
+
+function init_iimage() {
+
+   mkdir -p $DATADIR; ls -l >$DATADIR/ls-l.new; touch $DATADIR/ls-l.old
+
+   date > $DATADIR/log
+   rm -f $DATADIR/errors
+
+   [ "$IIMAGE_CHECK" = "" ] && check_iimage;
+
+
+   # -- einige Dinge ignorieren --
+   IIMAGE_EXCLUDE=""
+   IGNORE=`description ignore`
+
+   IGNORE="$IGNORE $AUDIODIR"
+
+   for file in $IGNORE ; do
+       IIMAGE_EXCLUDE="$IIMAGE_EXCLUDE ! -name \"$file\" "
+   done
+   IIMAGE_EXCLUDE="$IIMAGE_EXCLUDE ! -name $DATADIR"
+   
+   export IIMAGE_EXCLUDE
+
+}
+
+function find_all_images() {
+
+
+
+
+   FILE_EXTENSIONS_UPPER=`upper $FILE_EXTENSIONS`
+
+   ALL_IMAGES=
+   for ext in $FILE_EXTENSIONS $FILE_EXTENSIONS_UPPER ; do
+      ALL_IMAGES="$ALL_IMAGES `eval \"find *.$ext -type f -maxdepth 0 $IIMAGE_EXCLUDE 2>/dev/null \"`"
+   done
+
+   # Bilder sortieren
+
+   IORDER=`description iorder`
+
+   if [ "$IORDER" = "" ] ; then IORDER="alphabetically"; fi
+
+   if [ "$IORDER" = "digicam" ] ; then
+      ALL_IMAGES=`ls $ALL_IMAGES | sort -n -k 2 -t "_"`
+      true
+   elif [ "$IORDER" = "alphabetically" ] ; then
+      # bleibt beim alten
+      true
+   elif [ "$IORDER" = "accesstime" -o "$IORDER" = "accesstime_asc" -o "$IORDER" = "accesstime_ascending" ] ; then
+      ALL_IMAGES=`ls -dtr $ALL_IMAGES`
+      true
+   elif [ "$IORDER" = "accesstime_desc" -o "$IORDER" = "accesstime_descending" -o "$IORDER" = "dec" ] ; then
+      ALL_IMAGES=`ls -dt $ALL_IMAGES`
+      true
+   elif [ "$IORDER" = "description" ] ; then                 # 5.1.2005 hfst
+      # in der Reihenfolge wie die Beschreibungen
+      ALL_IMAGES=`for file in $ALL_IMAGES; do
+         grep -n "^$file" description | awk -F"=" '{print $1}' 
+      done | sort -nt":" | awk -F":" '{print $2}'`            # 5.1.2005 hfst ende
+   else
+      ALL_IMAGES=$IORDER
+   fi
+
+}
+
+
+function prepare_dir () {
+
+   store_templates
+
+   find_all_images
+
+#   mkdir -p $DATADIR
+#   ls -l >$DATADIR/ls-l.new
+#   touch $DATADIR/ls-l.old
+
+   GI_COUNT="`echo $ALL_IMAGES | wc -w`"
+   echo $GI_COUNT > $COUNTFILE_CURENT
+
+   TITLE="`description title`"
+   FOLDER_DESCRIPTION="`description description`"
+
+   if [ "$TITLE" = "" ] ; then
+      TITLE="`basename $PWD`"
+   fi
+
+}
+
+function iimage_recursive() {
+
+   if [ "$RECURSIVE" = "true" ] ; then
+      eval "find * -maxdepth 0 -type d $IIMAGE_EXCLUDE " | while read dir ; do
+         ( cd $dir && $0 $*; )
+      done
+   fi
+}
+
+function prepare_images() {
+
+   # evtl noch modularisieren und erweiterbar machen
+   [ $IIMAGE_FOLLOW_LINKS ] && iimage_follow_links;
+
+   rm -f $DATADIR/slideable
+
+   echo "prepare images ..."
+
+   if [ "$GI_COUNT" -gt "0" ] ; then
+      for image in $ALL_IMAGES ; do
+
+         echo -ne "$image:\t"
+
+         EXTENSION=`echo $image  | awk -F"." '{print $NF}'`
+         EXTENSION=`upper $EXTENSION`
+
+         if declare -f $EXTENSION"_handler_prepare" >/dev/null ; then
+            eval $EXTENSION"_handler_prepare $image"
+         else
+            eval default_handler_prepare $image
+         fi
+         echo #" OK"
+      done
+   fi
+}
+
+
+function build_html() {
+
+   echo "generate html ..."
+
+   T_COUNT=0;
+   export T_COUNT;
+
+   # begin index
+   { . $INDEX_HEAD_TEMPLATE ;} > $INDEX_HTML
+
+   if [ "$GI_COUNT" -gt "0" ] ; then
+
+      COUNT=`cat $DATADIR/slideable | wc -l`
+      POS=0
+
+      for THIS_IMAGE in $ALL_IMAGES ; do
+         echo -en "$THIS_IMAGE:\t"
+
+         DESCRIPTION=`description "$THIS_IMAGE"`
+         THIS_IMAGE_BYTE="$[ `filesize $THIS_IMAGE` / 1024 ]"
+
+         EXTENSION=`echo $THIS_IMAGE  | awk -F"." '{print $NF}'`
+         EXTENSION=`upper $EXTENSION`
+
+         # generate html
+         if declare -f $EXTENSION"_handler_html" >/dev/null ; then
+            eval $EXTENSION"_handler_html $THIS_IMAGE"
+         else
+            eval default_handler_html $THIS_IMAGE
+         fi
+
+         wrap_table >> $INDEX_HTML ;
+
+         # generate index
+         if declare -f $EXTENSION"_handler_html" >/dev/null ; then
+            eval $EXTENSION"_handler_index $THIS_IMAGE "
+         else
+            eval "default_handler_index $THIS_IMAGE "
+         fi
+
+         echo #" OK"
+
+      done
+   fi
+
+   echo -e "\n\n\n\
+<!--\n\
+created with iimage $VERSION \n\
+(c) Ronald Schmidt http://www.ronsc.de \n\n\
+download http://www.ronsc.de/iimage/iimage\n\n\
+$SVN_ID\n\
+-->\
+\n\n\n" >> $INDEX_HTML ;
+
+
+   { . $INDEX_FOOT_TEMPLATE ;} >> $INDEX_HTML
+
+
+   if [ -f "$COUNTFILE_CURENT" ] ; then
+      COUNT_CURRENT=`cat $COUNTFILE_CURENT`;
+      if [ "$COUNT_CURRENT" = "" ] ; then COUNT_CURRENT=0; fi
+   else
+      COUNT_CURRENT=0;
+   fi
+
+   if [ -f "$COUNTFILE_SUB" ] ; then
+      COUNT_DIR=`cat $COUNTFILE_SUB`;
+      if [ "$COUNT_DIR" = "" ] ; then COUNT_DIR=0; fi
+   else
+      COUNT_DIR=0;
+   fi
+
+   echo $[ $COUNT_CURRENT + $COUNT_DIR ] > $COUNTFILE_SUM;
+
+}
+
+
+# by Chris Huebsch
+#    www.huebsch-gemacht.de
+function cleanup() {
+
+   ALL_IMAGES=`if [ -d $DATADIR ]; then ( cd $DATADIR; set -C;find  *.geometry -maxdepth 0 2>/dev/null ;) ; fi`
+
+   for file in $ALL_IMAGES; do
+      base=`basename $file .geometry`
+      if [ ! -f $base ]; then
+         echo -n "cleanup $base:";
+
+         for tn in $THUMBNAILS ; do
+            echo -n " $tn";
+            rm -f $DATADIR/$tn/$base $DATADIR/$tn/$base.*
+         done
+         echo -n " M";
+         rm -f $DATADIR/$base.*
+         echo
+      fi;
+   done
+
+#   ls -l>$DATADIR/ls-l.old
+
+
+}
+
+
+function finish_iimage() {
+   ls -l>$DATADIR/ls-l.old
+   if [ "$IIMAGE_TOPLEVEL" ] ; then
+      echo
+      echo -e "finished!\7"
+   fi
+}
+
+function update_description_names() {
+   find_all_images
+   for i in $ALL_IMAGES ; do
+
+      if ! egrep "$i=" ./description >/dev/null ; then
+         echo "$i=`description $i`" >> ./description
+      fi
+
+   done
+}
+
+function create_description_template() {
+
+   DST="./description"
+   if [ -f description ] ; then
+      EXITS=true
+      echo "Error: descriptions-file exists, output on stdout !"
+      DST=/dev/stdout
+      echo ""
+   fi
+
+   for i in $VARIABLES ; do
+      VAL=`description $i`
+      if [ "$VAL" = "" ]; then eval "VAL=\$$i";  fi
+      echo "$i=$VAL" >> $DST
+   done
+   echo "" >> $DST
+
+
+   if [ "$DST" = "./description" ] ; then
+      echo "description generated"
+   fi
+
+}
+
+function generate_header() {
+   if [ "$2" != "" ] ; then
+      export BGCOLOR="$2"
+   else
+      export BGCOLOR="#ffffff"
+   fi
+   if [ "$3" != "" ] ; then
+      export PREFIX="$3"
+   else
+      export PREFIX="."
+   fi
+
+   case $1 in
+      "start") 
+         . $HEAD_TEMPLATE_START 
+         ;;
+      "end") 
+         . $HEAD_TEMPLATE_END 
+         ;;
+      *)
+         . $HEAD_TEMPLATE_START
+         . $HEAD_TEMPLATE_END
+         ;;
+   esac
+}
+
+
+
+######################################################################
+######################################################################
+######################################################################
+
+# --------------------------------------------------------------------
+# FOOTER_TEMPLATE
+function put_FOOTER_TEMPLATE() {
+echo '
+cat << EOF
+   <br/><br/><br/><br/>
+   
+   <span style="font-size: 8pt">
+      download iimage: <a style="font-size: 8pt" href="http://www.ronsc.de/iimage/iimage">www.ronsc.de</a>
+      | (c) by <a style="font-size: 8pt" href="http://www.ronsc.de">Ronald Schmidt</a>
+      <br/>
+      <font color="#cccccc" style="font-size: 8pt">
+         this site is generated at `date` by $USER@$HOSTNAME <br>
+         with iimage version $VERSION, template version '$VERSION' 
+      </font> 
+   </span>
+   </center>
+
+</body>
+</html>
+EOF'
+}
+
+# --------------------------------------------------------------------
+# HEAD_TEMPLATE
+function put_HEAD_TEMPLATE_START() {
+echo '
+cat << EOF
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+   "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+   <head>
+      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15">
+      <link rel="stylesheet" type="text/css" href="$PREFIX/css_template.css">
+      <title>$TITLE</title>
+   </head>
+   
+<body bgcolor="$BGCOLOR">
+
+<div style="
+   border-left:1pt #ffffff solid;
+   border-top:1pt #ffffff solid;
+   border-bottom:1pt #000000 solid;
+   margin:0pt;
+   padding:0pt;
+   "><div style="
+      border-right:1pt #000000 solid;
+      border-bottom:1pt #8c8ea5 solid;
+      background: #d6d3de;
+      margin:0pt;
+      padding:0pt;
+      ">
+<table cellspacing="0" cellpadding="1" width="100%" border="0">
+   <tr valign="middle" bgcolor="#d6d3de">
+
+      <td align="left" width="10%"> 
+         <a href="http://www.ronsc.de/iimage/iimage">iimage</a> $VERSION
+      </td>
+      <td width="40%">
+         <b>$TITLE </b> $THIS_IMAGE
+      </td>
+      <td align=right>
+EOF
+'
+}
+
+
+# --------------------------------------------------------------------
+# HEAD_TEMPLATE
+function put_HEAD_TEMPLATE_END() {
+echo '
+cat << EOF
+    &nbsp;
+    </td>
+
+  </tr>
+</table>
+
+</div>
+</div>
+
+<!--
+<table cellspacing="0" cellpadding="0" width="100%" border="0">
+<tr valign="middle" bgcolor="#6f6f6f">
+<td><img src="$DATADIR/transp.gif" width="1" height="1" alt=""></td>
+</tr> <tr bgcolor="#e7e7e7"> <td>
+<img src="$DATADIR/transp.gif" width="1" height="1" alt=""></td> </tr> </table>
+-->
+
+EOF
+'
+}
+
+
+# --------------------------------------------------------------------
+# HTML_TEMPLATE
+function put_HTML_TEMPLATE() {
+echo '
+cat << EOF
+`generate_header start`
+<a href="../$THIS_HTML_SLIDE">Slideshow</a> &nbsp;&nbsp;&nbsp;&nbsp;
+<a href="../index.html">Index</a> &nbsp;&nbsp;&nbsp;&nbsp;
+<a href="$R_PREV_HTML"><b>&lt;&lt;&lt;</b></a>
+$POS/$COUNT
+<a href="$R_NEXT_HTML"><b>&gt;&gt;&gt;</b></a>
+`generate_header end`
+
+   <br>
+   <center>
+   <font size="-1">&nbsp;$DESCRIPTION&nbsp;</font>
+
+   <table cellspacing="0" cellpadding="0" border="0">
+   <tr>
+
+      <td width="640" height="480" valign="bottom" align="center" >
+`
+if [ "$EXCLUDE_ORGINAL" = "true" ] ; then
+   echo -e "<img alt=\"$R_DISPLAY_IMAGE\" src=\"$R_DISPLAY_IMAGE\" $R_DISPLAY_IMAGE_SIZE border="1">"
+else
+   echo -e "<a href=\"$R_IMAGE\"><img alt=\"$R_DISPLAY_IMAGE\" src=\"$R_DISPLAY_IMAGE\" $R_DISPLAY_IMAGE_SIZE ></a>"
+fi
+`
+      </td>
+   </tr>
+   <tr>
+   <td align="center"><font color="#999999" size="-2">
+   ($THIS_IMAGE_DATE $THIS_IMAGE_GEOMETRY $THIS_IMAGE_BYTE kb )
+
+`
+if [ "$IIMAGE_SPECIAL" = "true" ] ; then
+   echo -e "<?  if (IIMAGE_WRAPPER==1) isort_wrapper_ref(\"$THIS_IMAGE\"); ?>"
+fi
+`
+
+   <a href="../$THIS_HTML_INFO"><font color="#999999">more ...</font></a>
+   $EXTRA_SMALL_ICON2
+   </font></td>
+   </tr>
+   </table>
+
+
+`. $FOOTER_TEMPLATE`
+EOF
+'
+
+}
+
+
+# --------------------------------------------------------------------
+# HTML_SLIDE_TEMPLATE
+function put_HTML_SLIDE_TEMPLATE() {
+echo '
+cat << EOF
+`generate_header start "#888888"`
+
+<meta http-equiv="refresh" content="$SLIDE_DELAY; URL=` if [ \"$SLIDE_LOOP\" = \"true\" ] ; then echo $FIRST_HTML ; else echo $R_NEXT_HTML_SLIDE; fi` ">
+      <font color="#888888">Slideshow</font>
+      <a href="../$THIS_HTML">Stop</a> &nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="../index.html">Index</a> &nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="$R_PREV_HTML_SLIDE"><b>&lt;&lt;&lt;</b></a>
+      $POS/$COUNT
+      <a href="$R_NEXT_HTML_SLIDE"><b>&gt;&gt;&gt;</b></a>
+`generate_header end`
+
+   <br>
+   <center>
+
+   <table border="0" cellpadding="5" width="100%">
+
+   <tr><td width="100%" align="center" valign="top">
+
+      <font size="-1" color="#777777">&nbsp;$DESCRIPTION&nbsp;</font>
+
+      <table width="640" cellspacing="0" cellpadding="0" border="0">
+      <tr>
+
+         <td width="640" height="640" valign="middle" align="center" >
+         <img alt="$R_DISPLAY_IMAGE" src="$R_DISPLAY_IMAGE" $R_DISPLAY_IMAGE_SIZE border="1">
+         </td>
+      </tr>
+      </table>
+
+   </td></tr></table>
+
+`. $FOOTER_TEMPLATE`
+EOF
+'
+}
+
+
+
+# --------------------------------------------------------------------
+# HTML_INFO_TEMPLATE
+function put_HTML_INFO_TEMPLATE() {
+echo '
+cat << EOF
+`generate_header start`
+          <a href="../$THIS_HTML_SLIDE">Slideshow</a> &nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="../index.html">Index</a> &nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="$R_PREV_HTML_INFO"><b>&lt;&lt;&lt;</b></a>
+      $POS/$COUNT
+      <a href="$R_NEXT_HTML_INFO"><b>&gt;&gt;&gt;</b></a>
+`generate_header end`
+
+
+   <br>
+
+   <center>
+
+   <table border="0" cellpadding="5">
+
+   <tr><td width="640" valign="top">
+
+      <font size="-1">&nbsp;$DESCRIPTION&nbsp;</font>
+
+      <table width="640" cellspacing="0" cellpadding="0" border="0">
+      <tr>
+
+         <td width="640" height="480" valign="top" align="center" >
+
+`
+if [ "$EXCLUDE_ORGINAL" = "true" ] ; then
+   echo -e "<img src=\"$R_DISPLAY_IMAGE\" alt=\"$R_DISPLAY_IMAGE\" $R_DISPLAY_IMAGE_SIZE border=\"1\">"
+else
+   echo -e "<a href=\"$R_IMAGE\"><img src=\"$R_DISPLAY_IMAGE\" alt=\"$R_DISPLAY_IMAGE\" $R_DISPLAY_IMAGE_SIZE ></a>"
+fi
+`
+         <br>
+         ($THIS_IMAGE_DATE $THIS_IMAGE_GEOMETRY
+         $THIS_IMAGE_BYTE kb )
+`
+if [ "$IIMAGE_SPECIAL" = "true" ] ; then
+   echo -e "<?  if (IIMAGE_WRAPPER==1) isort_wrapper_ref(\"$THIS_IMAGE\"); ?>"
+fi
+`
+
+   $EXTRA_SMALL_ICON2
+         </td>
+      </tr>
+      </table>
+   </td><td valign="top">
+
+   `generate_info_table`
+   <a href="../$THIS_HTML"><font color="#999999">close ...</font></a>
+
+   </td></tr></table>
+
+`. $FOOTER_TEMPLATE`
+EOF
+'
+}
+
+# --------------------------------------------------------------------
+# INDEX_HEAD_TEMPLATE
+function put_INDEX_HEAD_TEMPLATE() {
+echo '
+cat << EOF
+`generate_header start "" "$DATADIR"`
+<a href="../index.html">zur&uuml;ck</a>
+`generate_header end`
+
+<p>
+
+<center>
+<table width="80%" border="0"  cellspacing="20" ><tr>
+<td width="50%" valign="top" align="center">
+<h1>$TITLE</h1>
+
+`
+if [ "$IIMAGE_SPECIAL" = "true" ] ; then
+   echo -e "<? if (IIMAGE_WRAPPER==1) { iimage_description(\"$DIR\",\"$SUB_DST\",\"$SUB_TITLE\",2); } else { ?> $FOLDER_DESCRIPTION <? } ?>"
+else
+   echo -e "$FOLDER_DESCRIPTION "
+fi
+`
+
+
+</td>
+
+
+<td width="50%" valign="top">
+
+<table border="0" >
+<tr>
+<td align="center" valign="top">
+<img src="$DIR_ICON" alt="Directory icon">
+</td>
+<td  valign="top">
+<!-- index.html ist wichtig, da es sonst nicht ohne browser geht -->
+<b><a href="../index.html">..</a></b>
+</td>
+</tr>
+`search_subdirs`
+</table>
+
+
+</td></tr></table>
+</center>
+
+<p>
+
+<center>
+<table border="0"><tr>
+
+EOF
+'
+}
+
+# --------------------------------------------------------------------
+# INDEX_ITEM_TEMPLATE
+function put_INDEX_ITEM_TEMPLATE() {
+echo '
+cat << EOF
+
+<td align="center" valign="bottom" width="200" height="220" >
+<br>
+<span class="small">
+   $DESCRIPTION
+</span>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr>
+   <td width="170" height="170" bgcolor="#dddddd" align="center" valign="middle">
+   <a href="$THIS_HTML"><img alt="Thumbnail" src="$TN_IMAGE" $TN_IMAGE_SIZE ></a>
+   </td>
+</tr>
+<tr>
+   <td bgcolor="#dddddd" align="center" valign="middle">
+   $EXTRA_SMALL_ICON
+   <font size="-2" color="#bbbbbb">$THIS_IMAGE_DATE</font></td>
+</tr>
+<tr>
+   <td align="center" bgcolor="#F7F7F7" class="smallgray">
+   $THIS_IMAGE<br>
+   <a href="$THIS_HTML_INFO">($THIS_IMAGE_GEOMETRY $THIS_IMAGE_BYTE kb)</a>
+`
+if [ "$IIMAGE_SPECIAL" = "true" ] ; then
+   echo -e "<?  if (IIMAGE_WRAPPER==1) isort_wrapper_ref(\"$THIS_IMAGE\"); ?>"
+fi
+`
+   </td>
+</tr></table>
+
+
+</td>
+
+EOF
+'
+}
+
+# --------------------------------------------------------------------
+# INDEX_ICON_TEMPLATE
+function put_INDEX_ICON_TEMPLATE() {
+echo '
+cat << EOF
+
+<td valign="bottom" align="center" width="200" height="220">
+
+<br>
+<span class="small">$DESCRIPTION</font>
+
+<table border="0" cellpadding="0" cellspacing="0">
+<tr>
+   <td width="170" height="170" bgcolor="#dddddd" align="center" valign="middle">
+   <a href="$THIS_IMAGE"><img alt="Icon" src="$DATADIR/$ITEM_ICON" ></a>
+   </td>
+</tr>
+<tr>
+   <td bgcolor="#dddddd" align="center" valign="middle">
+   $EXTRA_SMALL_ICON
+   <font size="-2" color="#bbbbbb">$THIS_IMAGE_DATE</font></td>
+</tr>
+<tr>
+   <td align="center" bgcolor="#F7F7F7" class="smallgray">
+   $THIS_IMAGE<br>
+   ($THIS_IMAGE_BYTE kb)
+
+`
+if [ "$IIMAGE_SPECIAL" = "true" ] ; then
+   echo -e "<?  if (IIMAGE_WRAPPER==1) isort_wrapper_ref(\"$THIS_IMAGE\"); ?>"
+fi
+`
+
+   </td>
+</tr></table>
+
+</td>
+
+EOF
+'
+}
+
+# --------------------------------------------------------------------
+# INDEX_FOOT_TEMPLATE
+function put_INDEX_FOOT_TEMPLATE() {
+echo '
+cat << EOF
+</table>
+
+`. $FOOTER_TEMPLATE`
+EOF
+'
+}
+
+# --------------------------------------------------------------------
+# INDEX_DIR_TEMPLATE
+function put_INDEX_DIR_TEMPLATE() {
+echo '
+cat << EOF
+
+<tr>
+<td align="center" valign="top">
+   <img src="$DIR_ICON" alt="Directory icon">
+</td>
+
+`
+if [ "$IIMAGE_SPECIAL" = "true" ] ; then
+   echo -e " <? if (IIMAGE_WRAPPER==1) { iimage_description(\"$DIR\",\"$SUB_DST\",\"$SUB_TITLE\"); } else { ?>"
+fi
+`
+
+
+<td  valign="top">
+   <b><a href="$SUB_DST">$SUB_TITLE</a></b>
+   <br> <font size="-2"><em>$SUB_DATE</em></font>
+</td></tr><tr>
+<td></td>
+<td><font size="-1">$FOLDER_DESCRIPTION</font>
+</td>
+
+`
+if [ "$IIMAGE_SPECIAL" = "true" ] ; then
+   echo "<? } ?>"
+fi
+`
+
+</tr>
+
+EOF
+'
+}
+
+# --------------------------------------------------------------------
+# INFO_AWK_TEMPLATE
+function put_INFO_AWK_TEMPLATE() {
+echo '
+BEGIN{
+   print "<br><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
+   a=1;
+}
+(!/---------------/){
+
+   if (a==1) bgcolor="#eeeeee"
+   else bgcolor="#cccccc"
+
+   a=1-a;
+   print "<tr>"
+   print "<td bgcolor=\""bgcolor"\"><font size=\"-2\" >" $1 "</font></td>"
+   print "<td bgcolor=\""bgcolor"\"><font size=\"-2\" >" $2 "</font></td>"
+
+   print "</tr>"
+}
+END{
+   print "</table>"
+}
+'
+}
+
+# --------------------------------------------------------------------
+# CSS_TEMPLATE
+function put_CSS_TEMPLATE() {
+echo '
+body {
+   margin:0pt;
+   padding:0pt;
+}
+* {
+   font-family: verdana,helvetica,sans-serif;
+   font-size: 10pt;
+}
+tt,pre { 
+   font-family:monospace;
+}
+a {
+   text-decoration: none;
+}
+.small, .small * {
+   font-size: 8pt;
+}
+.smallgray, .smallgray * {
+   color: #999999;
+   font-size: 8pt;
+}
+'
+}
+
+# --------------------------------------------------------------------
+function put_TRANSP_PIXEL () {
+echo -ne \
+"\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\xff\xff\
+\xff\xff\xff\xff\x21\xf9\x04\x01\x0a\x00\x01\x00\x2c\x00\x00\
+\x00\x00\x01\x00\x01\x00\x00\x02\x02\x4c\x01\x00\x3b"
+}
+
+# --------------------------------------------------------------------
+function put_DIR_ICON() {
+echo -ne \
+"\x47\x49\x46\x38\x39\x61\x14\x00\x16\x00\xc2\x00\x00\xff\xff\
+\xff\xff\xcc\x99\xcc\xff\xff\x99\x66\x33\x33\x33\x33\x00\x00\
+\x00\x00\x00\x00\x00\x00\x00\x21\xfe\x4e\x54\x68\x69\x73\x20\
+\x61\x72\x74\x20\x69\x73\x20\x69\x6e\x20\x74\x68\x65\x20\x70\
+\x75\x62\x6c\x69\x63\x20\x64\x6f\x6d\x61\x69\x6e\x2e\x20\x4b\
+\x65\x76\x69\x6e\x20\x48\x75\x67\x68\x65\x73\x2c\x20\x6b\x65\
+\x76\x69\x6e\x68\x40\x65\x69\x74\x2e\x63\x6f\x6d\x2c\x20\x53\
+\x65\x70\x74\x65\x6d\x62\x65\x72\x20\x31\x39\x39\x35\x00\x21\
+\xf9\x04\x01\x00\x00\x02\x00\x2c\x00\x00\x00\x00\x14\x00\x16\
+\x00\x00\x03\x54\x28\xba\xdc\xfe\x30\xca\x49\x59\xb9\xf8\xce\
+\x12\xba\xef\x45\xc4\x7d\x64\xa6\x29\xc5\x40\x7a\x6a\x89\x06\
+\x43\x2c\xc7\x2b\x1c\x8e\xf5\x1a\x13\x57\x9e\x0f\x3c\x9c\x8f\
+\x05\xec\x0d\x49\x45\xe1\x71\x67\x3c\xb2\x82\x4e\x22\x34\xda\
+\x49\x52\x61\x56\x98\x56\xc5\xdd\xc2\x78\x82\xd4\x6c\x3c\x26\
+\x80\xc3\xe6\xb4\x7a\xcd\x23\x2c\x4c\xf0\x8c\x3b\x01\x00\x3b\
+"
+}
+
+# --------------------------------------------------------------------
+function put_AVI_ICON() {
+echo -ne \
+"\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x01\x00\
+\x48\x00\x48\x00\x00\xff\xfe\x00\x17\x43\x72\x65\x61\x74\x65\
+\x64\x20\x77\x69\x74\x68\x20\x54\x68\x65\x20\x47\x49\x4d\x50\
+\xff\xdb\x00\x43\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x07\
+\x09\x09\x08\x0a\x0c\x14\x0d\x0c\x0b\x0b\x0c\x19\x12\x13\x0f\
+\x14\x1d\x1a\x1f\x1e\x1d\x1a\x1c\x1c\x20\x24\x2e\x27\x20\x22\
+\x2c\x23\x1c\x1c\x28\x37\x29\x2c\x30\x31\x34\x34\x34\x1f\x27\
+\x39\x3d\x38\x32\x3c\x2e\x33\x34\x32\xff\xdb\x00\x43\x01\x09\
+\x09\x09\x0c\x0b\x0c\x18\x0d\x0d\x18\x32\x21\x1c\x21\x32\x32\
+\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\
+\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\
+\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\
+\x32\x32\x32\xff\xc0\x00\x11\x08\x00\x3b\x00\x3a\x03\x01\x22\
+\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00\x1b\x00\x00\x02\x03\
+\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x07\
+\x00\x03\x05\x04\x02\x01\xff\xc4\x00\x43\x10\x00\x01\x03\x02\
+\x04\x02\x05\x04\x0d\x0d\x01\x00\x00\x00\x00\x00\x01\x02\x03\
+\x04\x05\x11\x00\x06\x12\x21\x31\x41\x13\x22\x32\x51\x61\x14\
+\x35\x75\xb4\x07\x15\x16\x23\x36\x56\x71\x81\x95\xb1\xb3\xd3\
+\xd4\x24\x33\x42\x43\x53\x55\x63\x72\x82\x91\x93\xa1\xc1\xf0\
+\xff\xc4\x00\x19\x01\x01\x01\x00\x03\x01\x00\x00\x00\x00\x00\
+\x00\x00\x00\x00\x00\x00\x01\x00\x02\x03\x04\x05\xff\xc4\x00\
+\x20\x11\x00\x02\x02\x02\x01\x05\x01\x00\x00\x00\x00\x00\x00\
+\x00\x00\x00\x00\x01\x02\x11\x03\x31\x13\x14\x15\x21\x51\x91\
+\x52\xff\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\x00\x3f\x00\
+\x77\xd5\xea\x8d\x51\xa9\xab\x9a\xf3\x4f\x3c\x02\xdb\x69\x0d\
+\x32\x01\x5b\x8b\x5a\xd2\x84\x24\x5c\x81\x72\xa5\x24\x6e\x40\
+\xdf\x72\x31\x9a\x73\x1d\x49\x36\xbe\x4e\xad\x8b\xf0\xf7\xe8\
+\x5f\x88\xc7\xdc\xe3\xe6\x48\xde\x95\xa7\x7a\xeb\x38\xec\xac\
+\xd4\x1a\xa6\xc7\x4c\x87\x96\x50\x84\xf7\x0b\x92\x6e\x2c\x00\
+\xe6\x7c\x37\xc0\x07\x12\xb3\x1d\x49\x20\x95\x64\xea\xe0\x03\
+\xf8\xd0\xbf\x11\x88\x9c\xc7\x52\x50\xba\x72\x75\x6c\x8e\xf0\
+\xf4\x2f\xc4\x60\x7e\x97\x5f\x6f\x34\xb5\x51\x91\x22\xb2\xf4\
+\x68\xb0\x81\x5b\x8c\x45\x46\x92\x10\x2f\x7d\x4e\xd8\xea\x3b\
+\x6e\x11\xb0\x3b\x5c\xe3\x8e\x8d\x5b\xf2\xea\x94\x98\xb9\x76\
+\xa5\x39\x52\xa3\x30\x64\xf9\x3c\xe7\x56\xfb\x2e\xa7\x55\xb4\
+\xa9\x6a\xb9\x49\x24\xec\x41\xdb\xb8\x8d\x8a\x21\x6f\xba\x1a\
+\x9f\xc4\xda\xe7\xf9\xa1\x7e\x23\x17\xc6\xcc\x4c\x39\x35\x88\
+\x53\x62\x4b\xa6\xcb\x7c\x12\xd3\x52\xd2\x9f\x7c\x20\x5c\x80\
+\xb4\x29\x48\x2a\xb5\xce\x9d\x57\xb0\x26\xd6\x06\xd6\x50\x6b\
+\x8c\x57\xe9\x2d\x4e\x61\x2a\x46\xae\xab\x8d\x2b\xb4\xda\xc6\
+\xc5\x27\xe4\x3c\xf9\x8d\xf8\x11\x8c\x1c\xd7\x28\x88\xd2\xa1\
+\x49\xa1\x4f\x9b\x1d\xd5\x25\xc6\xdf\x8c\x52\x3a\x35\x0d\x3a\
+\x4a\x4e\xa0\xa0\xa0\xa4\xdc\x11\x62\x0d\xac\x7b\xa2\x0c\xb1\
+\x30\x29\x91\x73\x1b\x95\xd8\x12\xe3\xc9\x53\x8e\x49\x80\xff\
+\x00\x93\xad\xd7\x1b\x0d\xa9\xce\xaa\x54\x0a\x92\x36\x0a\xb2\
+\xc0\x36\xd8\x90\x48\x00\x10\x01\x5e\x00\x30\x33\x8f\x99\x23\
+\x7a\x56\x9d\xeb\xac\xe2\xaa\xc2\xa2\xbf\x5b\x48\x9c\x7f\x24\
+\x85\x11\x4f\x29\x22\xfd\x65\x38\x74\x27\xe5\x3d\x55\x5b\xc4\
+\x8c\x5b\x9c\x7c\xc9\x1b\xd2\xb4\xef\x5d\x67\x18\xf9\xc1\xc6\
+\x63\xce\x8c\xfb\xa9\x71\x4c\xba\xd2\x98\x7f\xa2\x3d\x70\x35\
+\x0d\x2a\x48\x3c\x4a\x4a\x8e\xdd\xc4\xe1\x13\x9e\x85\x2f\x2c\
+\x52\x72\x9c\xe9\xd4\xfa\x7b\xc9\x8d\xac\xc7\x71\xb7\xc0\x2a\
+\x72\xc0\x59\x1c\x48\xd3\x65\x7d\x78\xab\x2d\x66\x7a\x60\x87\
+\x51\xe8\xe9\xcc\xc0\x4c\x44\x09\x0e\x06\x40\xb2\x93\xc0\x6a\
+\x36\xb9\x56\xdb\x5f\x8f\x2e\x18\xaa\x34\xbc\xa9\x13\x2b\xb5\
+\x4c\x8c\xea\xe5\x42\x48\xd4\x7b\x4b\x75\x4a\xe6\xa5\x90\x2f\
+\xab\x6f\x0e\x18\x09\xab\xd5\xcc\xa8\xa8\x8d\x44\x8e\xd4\x4a\
+\x7a\x1c\xd6\x5b\x01\x4a\x53\x8e\x0e\x0b\x75\x43\x57\x0d\xac\
+\x9f\x0e\x23\x11\x07\xbe\xc6\xcf\x07\x1a\xac\x14\x24\x25\x02\
+\x43\x41\x40\x0f\xd6\x74\x28\xd7\xff\x00\x07\xcd\x83\x75\x2f\
+\x0b\x4c\xb7\x5a\x95\x43\xcb\x8c\x47\x8b\x0e\x9a\xfa\x13\x75\
+\x29\x4b\xa9\xe8\x5b\x8a\x26\xe5\x56\x2d\xf3\x37\x3c\x79\xe0\
+\xaa\x85\x99\xe2\xd7\x52\xe2\x12\xdb\x91\xe5\x35\x62\xe3\x0e\
+\x10\x48\x07\x82\x81\x17\x04\x1e\xf1\xf3\xdb\x11\x1c\xb9\x2b\
+\xe1\x46\x70\xb7\xef\x21\xf6\x0c\xe0\xdb\x01\x39\x27\xe1\x3e\
+\x6f\xf4\x8a\x7e\xc1\x9c\x1b\x60\x03\x03\x38\xf9\x92\x37\xa5\
+\x69\xde\xba\xce\x38\x33\x14\x53\x25\xf8\xa1\x0b\xd0\xa5\x12\
+\x02\xbb\xba\xc8\xe5\x71\x7f\xf7\xff\x00\x47\x7e\x71\xf3\x24\
+\x6f\x4a\xd3\xbd\x75\x9c\x55\x51\xd4\xb7\xe3\x84\xab\x4a\xaf\
+\x60\x7b\xba\xc9\xf1\xdf\x87\xfe\xe4\x88\x1f\x55\xc9\x4d\x3e\
+\x97\x1f\x96\xa6\xde\x50\x1c\x14\xc8\xeb\x5b\x96\x34\xa9\x94\
+\x54\x45\xa6\x21\x0c\xb6\x86\xda\x41\x5d\x92\x81\x60\x06\xa3\
+\xc8\x5f\x1b\x12\xe2\xbe\xa6\x54\xa7\x65\xea\x01\x27\x6e\x8c\
+\x0b\xf8\x62\xf6\x36\x80\xa1\xfc\xff\x00\x59\xf1\x38\x24\xe9\
+\x59\x2d\x8b\x1a\x34\xba\xcd\x39\x72\xfc\x9e\x81\x3d\xf4\xba\
+\xf2\xd4\x92\xb1\xd1\x58\x74\x8b\x3f\xa5\x6e\x4a\xc5\xf1\x24\
+\xd7\xdb\xce\x14\xc9\xce\xd0\x9f\x8a\x85\xac\xb0\xfa\xc2\x83\
+\x83\x42\x87\x3d\x37\xd2\x01\x4a\x4d\xcf\x76\x09\x61\x53\x29\
+\x86\x84\x8a\x73\xcb\x8c\x2a\x72\xda\x53\xe8\x52\xbb\x68\x3c\
+\x52\x9d\x56\xb0\x04\x03\x7b\x91\xc7\x86\x3c\x16\xe0\x0c\xaf\
+\xed\xb1\x8f\x1c\x3e\x23\xf9\x17\x47\xd1\x8f\xce\xea\xed\xda\
+\xdd\xad\x3b\xdf\x1e\x57\x70\x9d\x5b\x8a\xd5\xef\xea\xd6\xf4\
+\x76\x74\xd1\xba\xb7\xba\xd1\xa5\x93\x52\xa6\x33\x1e\x66\x53\
+\xe9\x2d\x09\x33\xd2\xa6\x35\x8d\x3d\x28\x0c\x35\x72\x9b\xf6\
+\xbb\x2a\xe1\xdc\x7b\xb0\x6d\x85\xf2\xa3\xa9\x8c\xe9\x94\x2f\
+\x11\x0c\x74\x8c\xa9\x6b\xd0\xc2\x5b\xd4\xe9\x8e\xee\xbb\xd8\
+\x0d\xf8\x6d\xca\xfc\xaf\x86\x0e\x3b\xb0\x65\x79\x53\x6d\x55\
+\x33\x9b\x2c\x14\x1a\xa6\x61\xe6\xd8\xb2\xe5\x65\xf5\x08\x4c\
+\x17\xe4\x31\x2a\x2c\xa0\xd0\x50\x05\x61\xa7\xdb\x75\x49\x04\
+\x90\x2e\x42\x08\x17\x20\x5e\xdb\x8c\x0b\x3d\x98\xea\xee\x14\
+\x9f\x71\xb5\x90\x53\xc3\xdf\x23\x9e\x60\xfe\xd7\xc3\x0c\x5c\
+\x4c\x6f\x35\x8b\x75\xe6\x1a\xca\xfb\x59\x42\xb4\x7f\xae\x37\
+\xde\xe3\xd9\xcc\x75\x55\x32\xa6\x95\x93\x2b\x5a\x54\x08\x36\
+\x79\x80\x77\xf1\xe9\x6e\x30\xc5\xc4\xc4\x36\x25\x3d\xa7\x4f\
+\xc5\x0c\xd3\xf4\x83\x5f\x7d\x89\xed\x3a\x7e\x28\xe6\x9f\xa4\
+\x5a\xfb\xdc\x3a\xf1\x31\xab\x83\x17\xe5\x7c\x33\xe4\x9f\xb6\
+\x2d\x7d\x8f\x72\xb3\x8d\x54\xe5\x55\xea\x50\xa6\xc6\x71\xb7\
+\xc9\x82\xcc\x99\x25\x65\xa4\x16\xc2\x4d\xec\xa2\x92\x6e\x5c\
+\xef\xd9\x5f\xd9\x95\x89\x89\x8c\xe3\x08\xc5\x54\x55\x18\x39\
+\x39\x79\x67\xff\xd9"
+}
+
+# --------------------------------------------------------------------
+function put_MOV_ICON() {
+echo -ne \
+"\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x01\x00\
+\x48\x00\x48\x00\x00\xff\xfe\x00\x17\x43\x72\x65\x61\x74\x65\
+\x64\x20\x77\x69\x74\x68\x20\x54\x68\x65\x20\x47\x49\x4d\x50\
+\xff\xdb\x00\x43\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x07\
+\x09\x09\x08\x0a\x0c\x14\x0d\x0c\x0b\x0b\x0c\x19\x12\x13\x0f\
+\x14\x1d\x1a\x1f\x1e\x1d\x1a\x1c\x1c\x20\x24\x2e\x27\x20\x22\
+\x2c\x23\x1c\x1c\x28\x37\x29\x2c\x30\x31\x34\x34\x34\x1f\x27\
+\x39\x3d\x38\x32\x3c\x2e\x33\x34\x32\xff\xdb\x00\x43\x01\x09\
+\x09\x09\x0c\x0b\x0c\x18\x0d\x0d\x18\x32\x21\x1c\x21\x32\x32\
+\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\
+\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\
+\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\x32\
+\x32\x32\x32\xff\xc0\x00\x11\x08\x00\x3b\x00\x3a\x03\x01\x22\
+\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00\x1b\x00\x00\x02\x03\
+\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x07\
+\x00\x04\x05\x03\x01\x02\xff\xc4\x00\x3e\x10\x00\x01\x03\x03\
+\x03\x01\x03\x07\x0a\x03\x09\x00\x00\x00\x00\x00\x01\x02\x03\
+\x04\x00\x05\x11\x06\x12\x21\x41\x13\x31\x51\x22\x32\x35\x61\
+\x75\x81\xb4\x07\x14\x15\x16\x23\x52\x56\xc1\xd3\xd4\x82\x95\
+\xa1\x36\x53\x55\x63\x73\x91\x93\xb1\xb3\xff\xc4\x00\x18\x01\
+\x01\x00\x03\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
+\x00\x00\x02\x03\x04\x01\xff\xc4\x00\x24\x11\x00\x02\x02\x01\
+\x03\x02\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\
+\x11\x03\x04\x14\x21\x13\x61\x12\x41\x51\x52\x71\x81\x91\xff\
+\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\x00\x3f\x00\x78\xde\
+\x2e\xad\x59\xad\xab\x9a\xf3\x4f\x3c\x02\xdb\x69\x0d\x32\x01\
+\x5b\x8b\x71\x69\x42\x12\x32\x40\xc9\x52\x92\x39\x20\x73\xc9\
+\x15\x98\x75\x25\xc8\x10\x0e\x8d\xbe\x0c\xf7\x7d\xb4\x2f\xdc\
+\x57\xba\xcb\xd0\x71\xbd\xab\x6d\xf8\xd6\x6b\xae\xa3\xbc\x33\
+\x65\x88\x99\x2e\x95\x13\xce\xd4\x23\x1b\x94\x41\x1d\xd9\x20\
+\x7a\xc9\x3c\x00\x09\x38\x1c\x80\x38\xab\x52\x5c\x92\x32\xad\
+\x1b\x7c\x03\xfd\x68\x5f\xb8\xa8\x9d\x49\x72\x50\xca\x74\x75\
+\xf0\x8f\x1e\xda\x17\xee\x28\x72\x1d\xed\x8b\xee\x9e\x95\x7a\
+\xb8\x5f\x24\xfc\xd5\x95\x6d\x53\x10\x42\x98\x48\xce\x36\x80\
+\xbc\x05\xaf\xbf\xce\x1b\x41\xf0\xc5\x56\xb3\x6a\x17\x55\x1e\
+\xe5\x32\xc7\x2e\x64\xc6\xad\x85\x3f\x39\x87\x31\xc5\x38\x1c\
+\x49\x04\x9e\xcd\xd5\x79\x5b\xc0\x04\xf2\x48\x3d\xc7\x19\xc8\
+\x00\xb7\xeb\x15\xcf\xf0\x6d\xf3\xfe\x68\x5f\xb8\xae\xf1\xb5\
+\x1b\x0e\x4d\x62\x14\xd8\x92\xed\xb2\xdf\x04\xb4\xd4\xb4\xa7\
+\x0b\x20\x64\xa4\x2d\x0a\x52\x0a\xb1\x93\xb7\x76\x70\x09\xc6\
+\x01\xc5\xcb\x75\xc6\x3d\xd6\xdc\xc4\xe8\x8b\xdc\xc3\xe8\x0b\
+\x41\x23\x07\x07\xa1\x1d\x0f\xab\xa5\x0c\x6a\xb9\x44\x46\x95\
+\x0a\x55\x8a\x7c\xd8\xee\xa8\x38\x87\xe3\x14\x8e\xcd\x40\x27\
+\x69\x49\xdc\x14\x14\x14\x9c\x82\x30\x47\x04\x1f\x00\x0d\x2a\
+\x50\x96\x84\xd4\x8e\xdf\x60\x4b\x8f\x25\x4e\x39\x26\xde\xff\
+\x00\xcd\xd6\xeb\x8d\x76\x6a\x73\xc9\x4a\x81\x52\x47\x01\x58\
+\x58\x07\x1c\x12\x09\x00\x02\x05\x16\xd0\x03\xfa\xcb\xd0\x71\
+\xbd\xab\x6d\xf8\xd6\x6b\x3a\xfa\xab\x6c\xb7\xaf\x0b\xbc\x36\
+\xb7\x62\x46\x64\x45\x4b\x48\xf3\x94\x56\x90\xb5\xe3\xd7\x8d\
+\xbe\xe0\x6b\x47\x59\x7a\x0e\x37\xb5\x6d\xbf\x1a\xcd\x0e\x6b\
+\x26\xa0\x37\x29\xd1\x70\x72\x43\x70\x6e\x0d\x6c\x79\xd8\xea\
+\xc2\xd9\x52\x40\x4e\xe1\xc1\xef\x04\x03\x8c\xe3\x03\x8e\xfa\
+\x03\xec\x5c\x74\xf5\xab\x42\xb6\xec\x5b\x6a\x9c\x8b\x35\x44\
+\x25\x87\xf1\xb9\xc5\x02\x46\x54\x79\xee\xdb\xff\x00\x55\x56\
+\x2e\xa4\x84\xf6\x8a\xb8\x98\xf0\x9a\x87\xd9\x6e\x8d\xd8\xb2\
+\x90\x10\xa7\x1c\x4f\x18\xe3\xbf\x91\x9e\xf3\xd7\xad\x4b\x8d\
+\xcb\x4b\x7d\x06\xc4\x54\xa0\xc9\x87\x1d\x19\x69\x2c\x6e\x24\
+\x7f\x10\xea\x7a\xe4\xf5\xa0\x1b\xcd\xce\x45\xd0\x32\xd5\xbc\
+\x31\x0a\xdc\x80\xa4\xc7\x6d\xad\xdb\x1a\xcf\x0a\x5a\x94\x01\
+\x05\x67\x9e\x7a\x67\xbc\xd0\x0d\x3f\x93\xe7\x90\xe6\x9a\x75\
+\x6c\x80\x23\xaa\x6c\x92\xce\x3e\xef\x6a\xaf\xcf\x26\x8a\x0a\
+\xe9\x7d\x6f\xd4\xb2\xac\xf6\x68\xac\x47\xb6\x5b\x95\x19\x96\
+\xd2\x94\xa1\x17\x30\x1c\x09\xc7\xdd\x52\x07\x3e\xfa\x27\xb2\
+\xdf\xe2\x5f\x62\x29\xf8\xdb\xd0\xb4\x1d\xae\xb2\xe0\xc2\xdb\
+\x57\x7e\x0e\x38\xf7\x8c\x8a\xe0\x33\xb4\x4e\x3e\xb4\xeb\x0c\
+\x7f\x89\x0f\xfc\x19\xa3\x8a\x06\xd1\x1f\xda\x8d\x5f\xed\x24\
+\xfc\x3b\x34\x73\x5d\x00\xfe\xb2\xf4\x1c\x6f\x6a\xdb\x7e\x35\
+\x9a\xcf\xd4\x71\x0c\xa7\xe2\xa5\x2b\xda\xa5\x12\x01\xf5\xee\
+\x47\x4c\xf3\xfd\x7f\x31\xa1\xac\xbd\x07\x1b\xda\xb6\xdf\x8d\
+\x66\xb8\xdc\x42\x96\xf4\x70\x95\x6d\x56\x70\x0f\x87\x94\x9e\
+\x99\xe7\xfa\xfe\x74\x00\x6d\xcf\x43\x47\x71\x2e\x3f\x24\x32\
+\xf1\xc1\x38\x53\x03\x93\x57\xd9\xb7\x26\x2d\x95\x44\x23\xc9\
+\x42\x5c\x29\x6d\xb1\x92\x46\x4f\x00\x0c\xe7\xdd\x9a\xde\x97\
+\x11\xe5\x32\xa5\x3b\x2f\x78\x00\xf1\xd9\x81\x9a\xce\x98\xa8\
+\x6d\x28\x3b\x3a\x3a\x64\x30\x88\xce\x6e\x49\x19\x23\x73\xcd\
+\xa4\xa8\x1e\x79\x01\x47\x9c\xfb\xea\x8d\x46\x5e\x94\x1c\xc9\
+\xe3\x87\x8e\x54\x04\x69\xf9\xb7\xdb\x75\xa1\xb8\xad\x69\xd9\
+\xaf\x79\x29\xf2\x9d\x50\x6b\x1e\x48\x18\xc2\xb9\xe9\x57\xb4\
+\xdc\x8b\xd4\x7d\x69\xda\x4a\xb3\xbf\x0e\x3c\xb6\x14\x1e\x51\
+\x21\x68\xdc\x93\x94\x92\xa4\xf0\x3b\xd5\xc1\xef\xcd\x14\x5b\
+\x21\xd8\xe4\x42\x84\x1b\x61\x0b\x8e\x9b\x89\x68\xbe\xf2\x40\
+\x5b\xbf\x64\xa5\x00\x7d\x5b\x88\x18\xf5\x0a\xaa\xd2\x58\x89\
+\x12\x0c\x9b\xb5\xbe\x33\x6f\x99\xe5\xb5\x36\xa8\xe9\x46\xe6\
+\x4a\x70\x49\x4e\x06\x70\x4f\x06\xb1\x6f\xe7\x49\xb4\xab\xe7\
+\x8f\x2e\xdd\xfe\xcd\x1b\x75\x75\x65\xfd\x18\x95\x31\xa9\x35\
+\x32\x9f\x49\x68\x49\xb8\x05\x30\x56\x36\xf6\xa0\x30\xd6\x4a\
+\x73\xe7\x79\xaa\xee\xf0\x3e\x14\x71\x4b\x91\x16\x35\xb3\x5d\
+\xe9\xab\x5b\x08\x6c\xad\x87\x1e\x53\xae\x84\x8d\xca\x2a\x65\
+\xd2\x01\x3d\xe7\x03\x1f\xef\x4c\x6a\xd9\xa7\xcc\xf2\xc5\xb9\
+\x2a\x69\xd1\x46\x48\x28\x3e\x0c\x3d\x5d\x16\x5c\xad\x3c\xa1\
+\x05\x83\x22\x43\x12\xa2\xca\x4b\x21\x40\x17\x03\x32\x1b\x75\
+\x49\x04\x90\x32\x42\x08\x19\x20\x67\x1c\x8a\x14\x7b\x51\xde\
+\x1c\x52\x48\xd1\xb7\x94\x94\xff\x00\x99\x1c\xf5\x07\xfb\xdf\
+\x55\x31\xea\x60\x78\x56\x82\xb1\x68\xbd\x43\x7a\x5f\x9f\xa4\
+\x2f\x47\xf8\xe3\x7e\xad\x67\x5d\x57\x26\xf2\xa6\x95\x2f\x47\
+\x6a\x20\xa6\x81\x09\xec\x66\x32\xd8\xe4\xe7\x90\x1e\xa6\xe6\
+\x07\x85\x4c\x0f\x0a\x8c\xa1\x19\x2a\x92\xb4\x75\x36\x9d\xa1\
+\x25\xf4\x3a\x7f\x07\xea\x9f\xe6\x2d\x7e\xb5\x4f\xa1\xd3\xf8\
+\x43\x54\xff\x00\x31\x6b\xf5\xa9\xdb\x81\xe1\x53\x03\xc2\xab\
+\xdb\xe1\xf6\x2f\xc4\x4b\xa9\x3f\x56\x2c\xfe\x4f\x34\xaa\xd9\
+\xba\x4a\xbb\xdc\x60\xcd\x8c\xe3\x6f\x93\x05\x99\x32\x4a\xcb\
+\x48\x2d\x84\x9c\xe1\x45\x24\xe4\xb9\xd4\xf0\xae\x9d\x19\x95\
+\x2a\x55\x91\x84\x60\xaa\x2a\x88\xb9\x37\xcb\x3f\xff\xd9"
+}
+
+# --------------------------------------------------------------------
+function put_SND_ICON() {
+echo -ne \
+"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\
+\x52\x00\x00\x00\x0b\x00\x00\x00\x0b\x08\x06\x00\x00\x00\xa9\
+\xac\x77\x26\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\
+\x00\xff\xa0\xbd\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\
+\x00\x0b\x11\x00\x00\x0b\x11\x01\x7f\x64\x5f\x91\x00\x00\x00\
+\x07\x74\x49\x4d\x45\x07\xd3\x04\x19\x0b\x3a\x3b\x18\x18\xa2\
+\x48\x00\x00\x01\x86\x49\x44\x41\x54\x78\x9c\x63\x36\x36\x37\
+\x62\x10\x11\xe4\x63\x60\xf8\xf7\x9f\xe1\xeb\xb7\xef\x0c\xe8\
+\x20\x35\xda\x2b\xd2\xd1\x58\x5d\xf4\xf8\x85\x5b\x0f\x18\x67\
+\xe7\x87\x70\x32\x32\xfc\xff\xfe\x9f\x81\x81\xe1\x3f\x23\x03\
+\x53\xda\x84\xb5\xff\x60\x0a\x5b\x92\xbd\x95\x8f\xbc\xfc\x7e\
+\x8a\x9b\x83\xf5\xad\x87\x0c\x8f\x36\x23\x86\x51\x50\x30\x21\
+\x2b\x80\x67\xe7\xd3\xcf\x97\x7f\xfd\xff\x27\xc3\xf9\xff\xdf\
+\x77\x2d\x0e\x26\x1f\x26\x6c\x0a\x67\xe7\x07\x33\xed\x7e\xfe\
+\xa5\x8b\x4b\x86\x5b\xfa\xfb\xdf\x5f\x8c\xff\x38\x38\x78\x6f\
+\x73\xb0\x6f\x62\x42\x52\xc0\xc8\xc0\xc0\xc0\x30\x27\x3f\x84\
+\x69\xdb\xc3\x8f\x26\x3c\xb2\xbc\x19\x0f\xef\xdc\x7b\xab\xc8\
+\xce\xcd\x76\x64\xe7\xf1\x33\x7b\x37\x1e\x3b\xca\x38\x3d\x27\
+\x48\x70\xdf\xab\xaf\xdd\xbf\xfe\x33\xea\x2b\x73\x30\xc5\xab\
+\x0b\x72\x3e\x5a\xf5\xf0\xdd\x53\x76\x09\x66\x9e\x63\x2b\x4e\
+\x5b\x7c\xf8\xf8\xf1\x34\x1f\x1f\x9f\x16\x03\x03\x43\x33\x83\
+\xb7\xaf\x73\xcf\xb1\x53\xc7\xfe\xf5\x4d\xef\xfb\xe7\x12\xe8\
+\xf6\xc3\xc6\xc3\x3e\x2e\xb6\x24\xe2\xbf\x84\xa6\xe8\xa3\x39\
+\x50\xdb\x60\x80\xe5\xf3\xdf\xff\x5e\xaf\xde\xbf\x64\xbc\x7a\
+\xeb\x0a\xc3\xbf\x7f\x7f\xd9\xa5\xe5\xc5\xe6\xde\x7d\x74\x8f\
+\x41\xf8\x27\x47\x65\xca\xc4\xb5\xff\x91\x15\x33\x31\xb3\x30\
+\xcc\x6a\x6c\x6c\xfe\x77\xe9\xf4\x65\x86\x67\x0f\x9f\x30\xfc\
+\xfa\xf1\x93\xe5\xf3\xb3\x9f\x5f\x3c\x1d\x0d\x0f\xa2\x7b\x9c\
+\xf9\xc1\xcd\xfb\x27\x84\x05\xf8\xcf\x72\xf2\x70\x8a\xf3\xf3\
+\x70\xff\xfe\xf7\xe9\xeb\x5a\x27\x79\xb1\x72\x55\x7e\xf6\x6b\
+\x9b\x4e\x5e\x47\x31\x19\x12\x02\x05\x21\x1c\x0c\x0c\x0c\x9c\
+\x0c\xff\x19\x58\x18\x18\xfe\x7f\x61\x60\x60\xf8\x81\xee\x04\
+\x06\x06\x06\x06\x00\xb1\xb5\x9b\x5c\xc8\xf8\x64\x33\x00\x00\
+\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82"
+}
+
+
+######################################################################
+######################################################################
+######################################################################
+
+# --------------------------------------------------------------------
+# print program info
+function info() {
+   echo "_____________________________________________________________________________"
+   echo "IIMAGE $VERSION (c) Ronald Schmidt http://www.ronsc.de"
+   echo ""
+}
+
+# --------------------------------------------------------------------
+# print out version
+function version() {
+   echo "Version$SVN_ID"
+}
+
+# Help by Holm Sieber
+#         sieber@prudsys.com
+# --------------------------------------------------------------------
+# syntax help
+function help() {
+cat << EOF
+SYNTAX:
+   iimage [options]
+
+OPTIONS:
+   -v/-V print CVS version
+   -h    print this syntax help
+   -H    print variables description of description file
+   -R    go recursively through subdirectories
+   -U    get current version of iimage from iimage WWW server
+   -D    get developer version of iimage from iimage WWW server
+   -f    force creation of HTML-Files
+   -T    use new templates from iimage (impl. -f)
+   -F    force rebuild of thumbnails (impl. -f)
+   -d    generate sample desciption-file (impl. -u)
+   -u    update image-names in description-file
+   -a    create AUTORUN.INF
+   -s    include iimage-special-php-tags
+
+DESCRIPTION:
+   IImage generates a set of HTML files as index of all images
+   at current directory. The following image types are recognized:
+EOF
+echo "      $FILE_EXTENSIONS"
+cat << EOF
+   IImage creates a directory ".tmp" in which tumbnails and a lot
+   of html files will be created. At current directory index.html
+   will be a start point for viewing the images.
+      IImage uses a file named "description" which contains some
+   options about the images in the same directory. Use "iimage -H"
+   to get a description of the syntax of this file.
+EOF
+}
+
+# --------------------------------------------------------------------
+# syntax description file
+function help_description() {
+cat << EOF
+VARIABLES in FILE "description"
+   order=       order of appearance of subfolders, "accesstime", 
+                "alphabetically" (default) or "dec" or explicit 
+                order, e.g. "folder1 folderb folder7"
+   iorder=      order of appearance of images, "alphabetically" (default), 
+                "accesstime" (oldest picture first), 
+                "dec" (accesstime, newest picture first), 
+                "digicam" (sorts alphabetically but ignores leading 
+                characters), "description" (order as descriptions)" 
+                or explicit order, e.g. "dscn0002.jpg dscn0232.jpg"
+   title=       title of folder (default: dir-name)
+   date=        folder date
+   description= folder description
+   <filename>=  image "filename" title
+   ignore=      files and directories to ignore
+   AUDIODIR=    optional dir for wav-files
+   EXCLUDE_ORGINAL=
+   DISABLED=
+EOF
+}
+
+######################################################################
+######################################################################
+######################################################################
+
+# parse arguments ####################################################
+
+while getopts ":hHvVRUDTfFduas" OPT ; do
+
+   case $OPT in
+      v|V)  # print version
+         version
+         exit
+         ;;
+      f)
+         FORCE=true
+         ;;
+      a)
+         echo -e "[autorun]\nshellexecute=index.html\n" >AUTORUN.INF
+         ;;
+      F)
+         FORCE_TN=true
+         ;;
+      h)    # print syntax help
+         info
+         help
+         exit
+         ;;
+      H)    # print syntax description file
+         info
+         help_description
+         exit
+         ;;
+      R)    # run recursively
+         RECURSIVE=true
+         ;;
+      U)    # update iimage
+         echo "update $0 from http://www.ronsc.de/iimage/iimage"
+         echo OLD `$0 -v`
+         wget http://www.ronsc.de/iimage/iimage -q --cache=off -O $0
+         echo NEW `$0 -v`
+         exit
+         ;;
+      D)    # update iimage
+         echo "update $0 from http://www.ronsc.de/iimage/devel/iimage"
+         echo OLD `$0 -v`
+         wget http://www.ronsc.de/iimage/devel/iimage.gz -q --cache=off -O $0.gz
+         gunzip -f $0.gz
+         chmod 755 $0
+         echo NEW `$0 -v`
+         exit
+         ;;
+      T)
+         FORCE_TEMPLATES=true
+         ;;
+      d)
+         create_description_template
+         update_description_names
+         exit
+         ;;
+      u)
+         update_description_names
+         exit
+         ;;
+      s)
+         IIMAGE_SPECIAL=true
+         ;;
+      ":")    # wrong argument
+         echo -n "ERROR: Missing argument for option \"$OPTARG\". "
+         echo "Use \"iimage -h\" to get more help."
+         exit 1
+         ;;
+      "*")    # wrong option
+         echo -n "ERROR: Unknown option \"$OPTARG\". "
+         echo "Use \"iimage -h\" to get more help."
+         exit 1
+         ;;
+   esac
+
+done
+
+##############################################################
+
+if [ "$DISABLED" != "" ] ; then
+   echo "directory disabled -> exit"
+   exit
+fi
+
+# check for programms ################################################
+
+init_iimage
+
+[ "$RECURSIVE" = "true" ] && iimage_recursive $*
+
+pwd
+
+NEED_UPDATE=false
+diff --brief $DATADIR/ls-l.new $DATADIR/ls-l.old >/dev/null || NEED_UPDATE=true
+[ "$FORCE" = "true" -o \
+  "$FORCE_TN" = "true" -o \
+  "$FORCE_TEMPLATES" = "true" ] && NEED_UPDATE=true
+
+if [ "$NEED_UPDATE" = "true" ] ; then
+   {
+      prepare_dir;
+
+      prepare_images;
+      build_html;
+
+      cleanup;
+
+   } 2>>$DATADIR/errors | tee -a $DATADIR/log
+fi
+
+finish_iimage;
+
+[ -s $DATADIR/errors ] && echo -e "\nWARNING: there were errors. see $DATADIR/errors"
+
+# vim:ai:expandtab:sw=3:ts=3:tw=200
diff --git a/usr_bin/irclog2html-2.1.pl b/usr_bin/irclog2html-2.1.pl
new file mode 100755 (executable)
index 0000000..a1ca85e
--- /dev/null
@@ -0,0 +1,354 @@
+#!/usr/bin/perl
+
+# irclog2html.pl Version 2.1 - 27th July, 2001
+# Copyright (C) 2000, Jeffrey W. Waugh
+
+# Author:
+#   Jeff Waugh <jdub@perkypants.org>
+
+# Contributors:
+#   Rick Welykochy <rick@praxis.com.au>
+#   Alexander Else <aelse@uu.net>
+
+# Released under the terms of the GNU GPL
+# http://www.gnu.org/copyleft/gpl.html
+
+# Usage: irclog2html filename
+
+# irclog2html will write out a colourised irc log, appending a .html
+# extension to the output file.
+
+
+####################################################################################
+# Perl Configuration
+
+use strict;
+#$^W = 1;      #RW# turn on warnings
+
+my $VERSION = "2.1";
+my $RELEASE = "27th July, 2001";
+
+
+# Colouring stuff
+my $a = 0.95;                  # tune these for the starting and ending concentrations of R,G,B
+my $b = 0.5;
+my $rgb = [ [$a,$b,$b], [$b,$a,$b], [$b,$b,$a], [$a,$a,$b], [$a,$b,$a], [$b,$a,$a] ];
+
+my $rgbmax = 125;              # tune these two for the outmost ranges of colour depth
+my $rgbmin = 240;
+
+
+####################################################################################
+# Preferences
+
+# Comment out the "table" assignment to use the plain version
+
+my %prefs_colours = (
+       "part"                  =>      "#000099",
+       "join"                  =>      "#009900",
+       "server"                =>      "#009900",
+       "nickchange"    =>      "#009900",
+       "action"                =>      "#CC00CC",
+);
+
+my %prefs_colour_nick = (
+       "jdub"                  =>      "#993333",
+       "cantanker"             =>      "#006600",
+       "chuckd"                =>      "#339999",
+);
+
+my %prefs_styles = (
+       "simplett"              =>      "Text style with little use of colour",
+       "tt"                    =>      "Text style using colours for each nick",
+       "simpletable"   =>      "Table style, without heavy use of colour",
+       "table"                 =>      "Default style, using a table with bold colours",
+);
+
+my $STYLE = "table";
+
+
+####################################################################################
+# Utility Functions & Variables
+
+sub output_nicktext {
+       my ($nick, $text, $htmlcolour) = @_;
+
+       if ($STYLE eq "table") {
+               print OUTPUT "<tr><th bgcolor=\"$htmlcolour\"><font color=\"#ffffff\"><tt>$nick</tt></font></th>";
+               print OUTPUT "<td width=\"100%\" bgcolor=\"#eeeeee\"><tt><font color=\"$htmlcolour\">$text<\/font></tt></td></tr>\n";
+       } elsif ($STYLE eq "simpletable") {
+               print OUTPUT "<tr bgcolor=\"#eeeeee\"><th><font color=\"$htmlcolour\"><tt>$nick</tt></font></th>";
+               print OUTPUT "<td width=\"100%\"><tt>$text</tt></td></tr>\n";
+       } elsif ($STYLE eq "simplett") {
+               print OUTPUT "&lt\;$nick&gt\; $text<br>\n";
+       } else {
+               print OUTPUT "<font color=\"$htmlcolour\">&lt\;$nick&gt\;<\/font> <font color=\"#000000\">$text<\/font><br>\n";
+       }
+}
+
+sub output_servermsg {
+       my ($line) = @_;
+
+       if ($STYLE =~ /table/) {
+               print OUTPUT "<tr><td colspan=2><tt>$line</tt></td></tr>\n";
+       } else {
+               print OUTPUT "$line<br>\n";
+       }
+}
+
+sub html_rgb
+{
+       my ($i,$ncolours) = @_;
+       $ncolours = 1 if $ncolours == 0;
+
+       my $n = $i % @$rgb;
+       my $m = $rgbmin + ($rgbmax - $rgbmin) * ($ncolours - $i) / $ncolours;
+
+       my $r = $rgb->[$n][0] * $m;
+       my $g = $rgb->[$n][1] * $m;
+       my $b = $rgb->[$n][2] * $m;
+       sprintf("#%02x%02x%02x",$r,$g,$b);
+}
+
+my $msg_usage = "Usage: irclog2html.pl [OPTION]... [FILE]
+Colourises and converts IRC logs to HTML format for easy web reading.
+
+  -s, --style=[STYLE]     format log according to specific style. style formats
+                          described using irclog2html [-s|--style]
+                                                 
+  --colour-<attribute>=[COLOUR]     format output colour scheme. attributes
+                                    described using irclog2html [--colour]
+
+Report bugs to Jeff Waugh <jdub\@perkypants.org>.
+";
+
+my $msg_styles = "The following styles are available for use with irclog2html.pl:
+
+  simplett
+    Text style with little use of colour
+
+  tt
+    Text style using colours for each nick
+
+  simpletable
+    Table style, without heavy use of colour
+
+  table
+    Default style, using a table with bold colours
+";
+
+my $msg_colours = "The following attributes may be customized using the --colour
+parameter:
+
+  join, part, action, server, nickchange
+";
+
+
+################################################################################
+# Main
+
+sub main {
+
+       my $inputfile;
+
+       my $nick;
+       my $time;
+       my $line;
+       my $text;
+
+       my $htmlcolour;
+       my $nickcount = 0;
+       my $NICKMAX = 30;
+
+       my %colours = %prefs_colours;
+       my %colour_nick = %prefs_colour_nick;
+       my %styles = %prefs_styles;
+
+
+       # Quit if there is no filename specified on the command line #
+       if ($#ARGV == -1) {
+               die "Required parameter missing\n\n$msg_usage";
+       }
+
+
+       # Loop through parameters, bringing filenames into $files #
+       my $count = 0;
+       
+       while ($ARGV[$count]) {
+       
+               if ($ARGV[$count] =~ /-s|--style.*/) {
+                       $STYLE = $ARGV[$count];
+                       
+                       if ($STYLE =~ /--style=.*/) {
+                               $STYLE =~ s/--style=(.*)/$1/;
+                               
+                       } else {
+                               $count++;
+                               $STYLE = $ARGV[$count];
+                       }
+                       
+                       if ($STYLE eq "") {
+                               print $msg_styles;
+                               return 0;
+                               
+                       } elsif (!defined($styles{$STYLE})) {
+                               die "irclog2html.pl: invalid style: `$STYLE'\n\n$msg_styles";
+                       }
+                       
+               } elsif ($ARGV[$count] =~ /--colou?r.*/) {
+                       my $colour_pref = $ARGV[$count];
+                       my $colour = $colour_pref;
+
+                       if ($colour_pref =~ /--colou?r$/) {
+                               print $msg_colours;
+                               return 0;
+                       
+                       } else {
+                               $colour_pref =~ s/--colou?r-(.*)?=.*/$1/;
+                               $colour =~ s/--colou?r-.*?=(.*)/$1/;
+
+                               $colours{$colour_pref} = $colour;
+                       }
+                       
+               } else {
+                       $inputfile = $ARGV[$count];
+               }
+               $count++;
+       }
+
+       # Open input and output files #
+       if (!$inputfile) {
+               # no file to open, print appropriate usage information
+               die "\n$msg_usage";
+       
+       } elsif (!open(INPUT, $inputfile)) {
+               # not a vaild file to open, spew error and usage information
+               die "irclog2html.pl: cannot open $inputfile for reading\n\n$msg_usage";
+       }
+       if (!open(OUTPUT, ">$inputfile.html")) {
+               # can't open file for output, spew error
+               die "irclog2html.pl: cannot open $inputfile.html for writing\n";
+       }
+
+
+       # Begin output #
+       print OUTPUT qq{<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+       <title>$inputfile</title>
+       <meta name="generator" content="irclog2html.pl $VERSION by Jeff Waugh">
+       <meta name="version" content="$VERSION - $RELEASE">
+       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+<body text="#000000" bgcolor="#ffffff"><tt>
+};
+
+       if ($STYLE =~ /table/) {
+               print OUTPUT "<table cellspacing=3 cellpadding=2 border=0>\n";
+       }
+
+       while ($line = <INPUT>) {
+
+               chomp $line;
+
+               if ($line ne "") {
+
+                       # Replace ampersands, pointies, control characters #
+                       $line =~ s/&/&amp\;/g;
+                       $line =~ s/</&lt\;/g;
+                       $line =~ s/>/&gt\;/g;
+                       $line =~ s/[\x00-\x1f]+//g;
+
+                       # Replace possible URLs with links #
+                       $line =~ s/((http|https|ftp|gopher|news):\/\/\S*)/<a href="$1">$1<\/a>/g;
+
+                       # Rip out the time #
+                       if ($line =~ /^\[?\d\d:\d\d(:\d\d)?\]? .*$/) {
+                               $time = $line;
+                               $time =~ s/^\[?(\d\d:\d\d(:\d\d)?)\]? .*$/$1/;
+                               $line =~ s/^\[?\d\d:\d\d(:\d\d)?\]? (.*)$/$2/;
+                               print $time;
+                       }
+
+                       # Colourise the comments
+                       if ($line =~ /^&lt\;.*?&gt\;\s.*/) {
+
+                               # Split $nick and $line
+                               $nick = $line;
+                               $nick =~ s/^&lt\;(.*?)&gt\;\s.*$/$1/;
+
+                               # $nick =~ tr/[A-Z]/[a-z]/;
+                               # <======= move this into another function when getting nick colour
+
+                               $text = $line;
+                               $text =~ s/^&lt\;.*?&gt\;\s(.*)$/$1/;
+                               $text =~ s/  /&nbsp\;&nbsp\;/g;
+
+                               $htmlcolour = $colour_nick{$nick};
+                               if (!defined($htmlcolour)) {
+                                       # new nick
+                                       $nickcount++;
+
+                                       # if we've exceeded our estimate of the number of nicks, double it
+                                       $NICKMAX *= 2 if $nickcount >= $NICKMAX;
+
+                                       $htmlcolour = $colour_nick{$nick} = html_rgb($nickcount, $NICKMAX);
+                               }
+                               output_nicktext($nick, $text, $htmlcolour);
+                               
+                       } else {
+                               # Colourise the /me's #
+                               if ($line =~ /^\* .*$/) {
+                                       $line =~ s/^(\*.*)$/<font color=\"$colours{"action"}\">$1<\/font>/;
+                               }
+
+                               # Colourise joined/left messages #
+                               elsif ($line =~ /^(\*\*\*|--&gt;) .*joined/) {
+                                       $line =~ s/(^(\*\*\*|--&gt;) .*)/<font color=\"$colours{"join"}\">$1<\/font>/;
+                               }
+                               elsif ($line =~ /^(\*\*\*|&lt;--) .*left|quit/) {
+                                       $line =~ s/(^(\*\*\*|&lt;--) .*)/<font color=\"$colours{"part"}\">$1<\/font>/;
+                               }
+                               
+                               # Process changed nick results, and remember colours accordingly #
+                               elsif ($line =~ /^(\*\*\*|---) (.*?) are|is now known as (.*)/) {
+                                       my $nick_old;
+                                       my $nick_new;
+                                       
+                                       $nick_old = $line;
+                                       $nick_old =~ s/^(\*\*\*|---) (.*?) (are|is) now known as .*/$1/;
+
+                                       $nick_new = $line;
+                                       $nick_new =~ s/^(\*\*\*|---) .*? (are|is) now known as (.*)/$2/;
+
+                                       $colour_nick{$nick_new} = $colour_nick{$nick_old};
+                                       $colour_nick{$nick_old} = undef;
+
+                                       $line =~ s/^((\*\*\*|---) .*)/<font color=\"$colours{"nickchange"}\">$1<\/font>/
+                               }
+                               # server messages
+                               elsif ($line =~ /^(\*\*\*|---) /) {
+                                       $line =~ s/^((\*\*\*|---) .*)$/<font color=\"$colours{"server"}\">$1<\/font>/;
+                               }
+
+                               output_servermsg($line);
+                       }
+               }
+       }
+
+       if ($STYLE =~ /table/) {
+               print OUTPUT "</table>\n";
+       }
+
+       print OUTPUT qq{
+<br>Generated by irclog2html.pl $VERSION by <a href="mailto:jdub\@NOSPAMperkypants.org">Jeff Waugh</a>
+ - find it at <a href="http://freshmeat.net/projects/irclog2html.pl/">freshmeat.net</a>!
+</tt></body></html>};
+
+       close INPUT;
+       close OUTPUT;
+
+       return 0;
+}
+
+exit main;
diff --git a/usr_bin/lesspipe.sh b/usr_bin/lesspipe.sh
new file mode 100755 (executable)
index 0000000..b41cc4c
--- /dev/null
@@ -0,0 +1,510 @@
+#!/bin/bash
+# lesspipe.sh, a preprocessor for less (version 1.53)
+#===============================================================================
+### THIS FILE IS GENERATED FROM lesspipe.sh.in, PLEASE GET THE TAR FILE
+### ftp://ftp.ifh.de/pub/unix/utility/lesspipe.tar.gz
+### AND RUN configure TO GENERATE A lesspipe.sh THAT WORKS IN YOUR ENVIRONMENT
+#===============================================================================
+#
+# Usage:   lesspipe.sh is called when the environment variable LESSOPEN is set:
+#         LESSOPEN="|lesspipe.sh %s"; export LESSOPEN  (sh like shells)
+#         setenv LESSOPEN "|lesspipe.sh %s"            (csh, tcsh)
+#         Use the fully qualified path if lesspipe.sh is not in the search path
+#         View files in multifile archives:
+#                      less archive_file:contained_file
+#         This can be used to extract ASCII files from a multifile archive:
+#                      less archive_file:contained_file>extracted_file
+#          As less is not good for extracting binary data use instead:
+#                      lesspipe.sh archive_file:contained_file>extracted_file
+#          Even a file in a multifile archive that itself is contained in yet
+#          another archive can be viewed this way:
+#                      less super_archive:archive_file:contained_file
+#         Display the last file in the file1:..:fileN chain in raw format:
+#         Suppress input filtering:    less file1:..:fileN:   (append a colon)
+#         Suppress decompression:      less file1:..:fileN::  (append 2 colons)
+# Required programs:
+#         see the separate file README
+# Supported formats:
+#         gzip, compress, bzip2, zip, rar, tar, nroff, ar archive, pdf, ps,
+#         dvi, shared library, executable, directory, RPM, Microsoft Word,
+#         Openoffice 1.x and OASIS (Opendocument) formats, Debian, mp3 files,
+#         image formats (png, gif, jpeg, tiff, ...), utf-16 text,
+#         iso images and filesystems on removable media via /dev/xxx
+#
+# License: GPL (see file LICENSE)
+#
+# History: see separate file ChangeLog or
+#         http://www.desy.de/zeuthen/~friebel/unix/lesspipe.html
+#
+# Author:  Wolfgang Friebel DESY Zeuthen (Wolfgang.Friebel AT desy.de)
+#
+#===============================================================================
+#setopt KSH_ARRAYS SH_WORD_SPLIT
+tarcmd=gtar
+if [[ `tar --version 2>&1` = *GNU* ]]; then
+  tarcmd=tar
+fi
+filecmd='file -L -s';
+sep=:                                          # file name separator
+altsep==                                       # alternate separator character
+if [[ -f "$1" && "$1" = *$sep* || "$1" = *$altsep ]]; then
+  sep=$altsep
+fi
+tmp=/tmp/.lesspipe.$$                          # temp file name
+trap 'rm -f $tmp $tmp.dvi $tmp. $tmp.. $tmp... $tmp.1' 0
+trap - PIPE
+
+show () {
+#  if [[ "$1" = *.pod || "$1" = *.pm ]]; then
+#    pod=1
+#  fi
+  file1="${1%%$sep*}"
+  rest1="${1#$file1}"
+  while [[ "$rest1" = ::* ]]; do
+    if [[ "$rest1" = "::" ]]; then
+      break
+    else
+      rest1="${rest1#$sep$sep}"
+      file1="${rest1%%$sep*}"
+      rest1="${rest1#$file1}"
+      file1="${1%$rest1}"
+    fi
+  done
+  rest11="${rest1#$sep}"
+  file2="${rest11%%$sep*}"
+  rest2="${rest11#$file2}"
+  while [[ "$rest2" = ::* ]]; do
+    if [[ "$rest2" = "::" ]]; then
+      break
+    else
+      rest2="${rest2#$sep$sep}"
+      file2="${rest2%%$sep*}"
+      rest2="${rest2#$file2}"
+      file2="${rest11%$rest2}"
+    fi
+  done
+  if [[ "$file2" != "" ]]; then
+    in_file="-i$file2"
+  fi
+  rest2="${rest11#$file2}"
+  rest11="$rest1"
+  if [[ "$cmd" = "" ]]; then
+    type=`$filecmd "$file1" | cut -d : -f 2-`
+    if [[ ! -f "$file1" ]]; then
+      if [[ "$type" = *directory* ]]; then
+       if [[ "$file1" = *.pkg ]]; then
+         if [[ -f "$file1/Contents/Archive.bom" ]]; then
+           type="bill of materials"
+           file1="$file1/Contents/Archive.bom"
+           echo "==> This is a Mac OS X archive directory, showing its contents (bom file)"
+         fi
+       fi
+      fi
+    fi
+    get_cmd "$type" "$file1" "$rest1"
+    if [[ "$cmd" != "" ]]; then
+      show "-$rest1"
+    else
+      isfinal "$type" "$file1" "$rest11"
+    fi
+  elif [[ "$c1" = "" ]]; then
+    c1[0]=${cmd[0]};c1[1]=${cmd[1]};c1[2]=${cmd[2]}
+    if [[ "${cmd[3]}" != "" ]]; then
+      c1[3]=${cmd[3]};
+    fi
+    type=`"${c1[@]}" | dd bs=40000 count=1 2>/dev/null | filepipe | cut -d : -f 2-`
+    get_cmd "$type" "$file1" "$rest1"
+    if [[ "$cmd" != "" ]]; then
+      show "-$rest1"
+    else
+      "${c1[@]}" | isfinal "$type" - "$rest11"
+    fi
+  elif [[ "$c2" = "" ]]; then
+    c2[0]=${cmd[0]};c2[1]=${cmd[1]};c2[2]=${cmd[2]}
+    if [[ "${cmd[3]}" != "" ]]; then
+      c2[3]=${cmd[3]};
+    fi
+    type=`"${c1[@]}" | "${c2[@]}" | dd bs=40000 count=1 2>/dev/null | filepipe | cut -d : -f 2-`
+    get_cmd "$type" "$file1" "$rest1"
+    if [[ "$cmd" != "" ]]; then
+      show "-$rest1"
+    else
+      "${c1[@]}" | "${c2[@]}" | isfinal "$type" - "$rest11"
+    fi
+  elif [[ "$c3" = "" ]]; then
+    c3[0]=${cmd[0]};c3[1]=${cmd[1]};c3[2]=${cmd[2]}
+    if [[ "${cmd[3]}" != "" ]]; then
+      c3[3]=${cmd[3]};
+    fi
+    type=`"${c1[@]}" | "${c2[@]}" | "${c3[@]}" | dd bs=40000 count=1 2>/dev/null | filepipe | cut -d : -f 2-`
+    get_cmd "$type" "$file1" "$rest1"
+    if [[ "$cmd" != "" ]]; then
+      show "-$rest1"
+    else
+      "${c1[@]}" | "${c2[@]}" | "${c3[@]}" | isfinal "$type" - "$rest11"
+    fi
+  elif [[ "$c4" = "" ]]; then
+    c4[0]=${cmd[0]};c4[1]=${cmd[1]};c4[2]=${cmd[2]}
+    if [[ "${cmd[3]}" != "" ]]; then
+      c4[3]=${cmd[3]};
+    fi
+    type=`"${c1[@]}" | "${c2[@]}" | "${c3[@]}" | "${c4[@]}" | dd bs=40000 count=1 2>/dev/null | filepipe | cut -d : -f 2-`
+    get_cmd "$type" "$file1" "$rest1"
+    if [[ "$cmd" != "" ]]; then
+      show "-$rest1"
+    else
+      "${c1[@]}" | "${c2[@]}" | "${c3[@]}" | "${c4[@]}" | isfinal "$type" - "$rest11"
+    fi
+  elif [[ "$c5" = "" ]]; then
+    c5[0]=${cmd[0]};c5[1]=${cmd[1]};c5[2]=${cmd[2]}
+    if [[ "${cmd[3]}" != "" ]]; then
+      c5[3]=${cmd[3]};
+    fi
+    type=`"${c1[@]}" | "${c2[@]}" | "${c3[@]}" | "${c4[@]}" | "${c5[@]}" | dd bs=40000 count=1 2>/dev/null | filepipe | cut -d : -f 2-`
+    get_cmd "$type" "$file1" "$rest1"
+    if [[ "$cmd" != "" ]]; then
+      echo "$0: Too many levels of encapsulation"
+    else
+      "${c1[@]}" | "${c2[@]}" | "${c3[@]}" | "${c4[@]}" | "${c5[@]}" | isfinal "$type" - "$rest11"
+    fi
+  fi
+}
+
+get_cmd () {
+  cmd=
+  if [[ "$2" = /*\ * ]]; then
+    ln -s "$2" $tmp..
+    set "$1" $tmp..
+  elif [[ "$2" = *\ * ]]; then
+    ln -s "$PWD"/"$2" $tmp..
+    set "$1" $tmp..
+  fi
+
+  if [[ "$1" = *bzip*compress* || "$1" = *compress[\'e]d\ * || "$1" = *packed\ data* ]]; then
+    if [[ "$3" = $sep$sep ]]; then
+      return
+    elif [[ "$1" = *bzip*compress* ]]; then
+      cmd=(bzip2 -cd "$2")
+    else
+      cmd=(gzip -cd "$2")
+    fi
+    return
+  fi
+    
+  rest1="$rest2"
+  if [[ "$file2" != "" ]]; then
+    if [[ "$1" = *\ tar* ]]; then
+      cmd=($tarcmd Oxf "$2" "$file2")
+    elif [[ "$1" = *Debian* ]]; then
+      istemp "ar p" "$2" data.tar.gz | gzip -dc - > $tmp.
+      cmd=($tarcmd Oxf $tmp. "$file2")
+    elif [[ "$1" = *RPM* ]]; then
+      cmd=(isrpm "$2" "$file2")
+    elif [[ "$1" = *Zip* ]]; then
+      cmd=(istemp "unzip -avp" "$2" "$file2")
+    elif [[ "$1" = *\ RAR\ archive* ]]; then
+      cmd=(istemp "unrar p -inul" "$2" "$file2")
+    elif [[ "$1" = *\ 7-zip\ archive* ]]; then
+      if [[ "$2" = - ]]; then
+        cmd=(iscmd2 "7za e -so" - "$file2")
+      else
+        cmd=(iscmd "7za e -so" "$2" "$file2")
+      fi
+    elif [[ "$1" = *[Cc]abinet* ]]; then
+      cmd=(iscab "$2" "$file2")
+    elif [[ "$1" = *\ ar\ archive* ]]; then
+      cmd=(istemp "ar p" "$2" "$file2")
+    elif [[ "$1" = *x86\ boot\ sector* ]]; then
+      cmd=(isfloppy "$2" "$file2")
+    elif [[ "$1" = *ISO\ 9660* ]]; then
+      cmd=(isoinfo "-i$2" "-x$file2")
+    fi
+  else
+    if [[ "$1" = *\ 7-zip\ archive* ]]; then
+      if [[ "$2" != - ]]; then
+        if [[ `7za l "$2" | tail -1` = *\ 1\ file ]]; then
+          cmd=("7za e -so" "$2")
+        fi
+      fi
+    fi
+  fi
+}
+
+filepipe () {
+  rm -f $tmp...
+  cat > $tmp...
+  $filecmd $tmp...
+}
+
+iscab () {
+  if [[ "$1" = - ]]; then
+    rm -f $tmp
+    cat > $tmp
+    set $tmp "$2"
+  fi
+  cabextract -pF "$2" "$1"
+}
+
+isdvi () {
+  if [[ "$1" = - ]]; then
+    set $1 ""
+  fi
+  if [[ "$1" != *.dvi ]]; then
+    rm -f $tmp.dvi
+    cat $1 > $tmp.dvi
+    set $tmp.dvi "$1"
+  fi
+  dvi2tty "$1"
+}
+
+iscmd () {
+  $1 "$2" "$3" 2>/dev/null
+}
+
+iscmd2 () {
+  cat > $tmp.
+  $1 $tmp. "$3" 2>/dev/null
+}
+
+istemp () {
+  if [[ "$2" = - ]]; then
+    rm -f $tmp
+    cat > $tmp
+    set $1 $tmp "$3"
+  fi
+  $1 "$2" "$3"
+}
+
+isrpm () {
+  if [[ "$1" = - ]]; then
+    rm -f $tmp
+    cat > $tmp
+    set $tmp "$2"
+  fi
+  echo $tmp.1 > $tmp.
+# GNU cpio has an undocumented but most useful --rename-batch-file switch
+  rm -f $tmp.1
+  rpm2cpio "$1"|cpio -i --quiet --rename-batch-file $tmp. "${2##/}"
+  cat $tmp.1
+}
+
+
+isfloppy () {
+# get the device to drive mapping
+  mtoolstest |
+  while read i1 i2
+  do
+    if [[ "$i1" = *$1* ]]; then
+      if [[ "$2" = "" ]]; then
+       mdir $drive
+      else
+       mtype $drive"$2"
+      fi
+      return
+    elif [[ "$i1" = drive ]]; then
+      drive=$i2
+    fi
+  done
+}
+
+
+isfinal() {
+
+  if [[ "$3" = $sep$sep ]]; then
+    cat "$2"
+    return
+  elif [[ "$3" = $sep* ]]; then
+    if [[ "$3" = $sep ]]; then
+      echo "==> append :. or :<filetype> to activate syntax highlighting"
+    else
+      lang=${3#$sep}
+      lang="-l ${lang#.}"
+      lang=${lang%%-l }
+      dir=${LESSOPEN#\|}
+      dir=${dir%%lesspipe.sh*\%s}
+      ${dir}code2color $PPID ${in_file:+"$in_file"} $lang "$2"
+      if [[ $? = 0 ]]; then
+        return
+      fi
+    fi
+    cat "$2"
+    return
+  elif [[ "$2" = - ]]; then
+    case "$1" in 
+    *RPM*|*\ ar\ archive*|*shared*|*Zip*|*\ RAR\ archive*)
+      cat > $tmp.dvi
+      set "$1" $tmp.dvi
+    esac
+  fi
+  if [[ "$1" = *No\ such* ]]; then
+    return
+  elif [[ "$1" = *directory* ]]; then
+    echo "==> This is a directory, showing the output of ls -lAL"
+    ls -lAL "$2"
+  elif [[ "$1" = *\ tar* ]]; then
+    echo "==> use tar_file${sep}contained_file to view a file in the archive"
+    $tarcmd tvf "$2"
+  elif [[ "$1" = *RPM* ]]; then
+    echo "==> use RPM_file${sep}contained_file to view a file in the RPM"
+    rpm -qivp "$2"
+    echo "================================= Content ======================================"
+    rpm2cpio "$2"|cpio -i -tv --quiet
+  elif [[ "$1" = *roff* ]]; then
+    DEV=latin1
+    if [[ "$LANG" = ja* ]]; then
+      DEV=nippon
+    fi
+    MACRO=andoc
+    if [[ "$2" = *.me ]]; then
+      MACRO=e
+    elif [[ "$2" = *.ms ]]; then
+      MACRO=s
+    fi
+    echo "==> append $sep to filename to view the nroff source"
+    groff -s -p -t -e -T$DEV -m$MACRO "$2"
+  elif [[ "$1" = *Debian* ]]; then
+    echo "==> use Deb_file${sep}contained_file to view a file in the Deb"
+    dpkg -I "${2#-}"
+    istemp "ar p" "$2" data.tar.gz | gzip -dc - | $tarcmd tvf -
+#  elif [[ "$1" = *perl\ *script\ text* || "$pod" = 1 ]]; then
+#      pod2text "$2" > $tmp.dvi
+#      if [[ -s $tmp.dvi ]]; then
+#      echo "==> append $sep to filename to view the Perl source"
+#      cat $tmp.dvi
+#      fi
+  elif [[ "$1" = *\ script* ]]; then
+    set "plain text" "$2"
+  elif [[ "$1" = *text\ executable* ]]; then
+    set "plain text" "$2"
+  elif [[ "$1" = *PostScript* ]]; then
+    echo "==> append $sep to filename to view the postscript file"
+    which pstotext >/dev/null 2>&1
+    if [[ $? = 0 ]]; then
+      pstotext "${2#-}"
+    else
+      ps2ascii "$2"
+    fi
+  elif [[ "$1" = *executable* ]]; then
+    echo "==> append $sep to filename to view the binary file"
+    if [[ "$2" = "-" ]]; then
+      strings
+    else
+      strings "$2"
+    fi
+  elif [[ "$1" = *\ ar\ archive* ]]; then
+    echo "==> use library${sep}contained_file to view a file in the archive"
+    ar vt "$2"
+  elif [[ "$1" = *shared* ]]; then
+    echo "==> This is a dynamic library, showing the output of nm"
+    nm "$2"
+  elif [[ "$1" = *Zip* ]]; then
+    echo "==> use zip_file${sep}contained_file to view a file in the archive"
+    unzip -lv "$2"
+  elif [[ "$1" = *\ RAR\ archive* ]]; then
+    echo "==> use rar_file${sep}contained_file to view a file in the archive"
+    unrar v "$2"
+  elif [[ "$1" = *\ 7-zip\ archive* ]]; then
+    echo "==> use 7-zip_file${sep}contained_file to view a file in the archive"
+    if [[ "$2" = - ]]; then
+      istemp "7za l" -
+    else
+      7za l "$2"
+    fi
+  elif [[ "$1" = *[Cc]abinet* ]]; then
+    echo "==> use cab_file${sep}contained_file to view a file in the cabinet"
+    cabextract -l "$2"
+  elif [[ "$1" = *x86\ boot\ sector* ]]; then
+    echo "==> use $2${sep}contained_file to view a file on the floppy"
+    isfloppy "$2"
+  elif [[ "$1" = *\ DVI* ]]; then
+    echo "==> append $sep to filename to view the binary DVI file"
+    isdvi "$2"
+  elif [[ "$1" = *HTML* ]]; then
+    echo "==> append $sep to filename to view the HTML source"
+    html2text -style pretty "$2"
+  elif [[ "$1" = *PDF* ]]; then
+    echo "==> append $sep to filename to view the PDF source"
+    istemp pdftotext "$2" -
+  elif [[ "$1" = *Microsoft\ Word* || "$1" = *Microsoft\ Office* ]]; then
+    antiword "$2"
+  elif [[ "$1" = *Rich\ Text\ Format* ]]; then
+    echo "==> append $sep to filename to view the RTF source"
+    unrtf --html "$2" 2>/dev/null | html2text -style pretty
+  elif [[ "$1" = *OpenDocument\ [CHMPST]* || "$1" = *OpenOffice\.org\ 1\.x\ [CIWdgpst]* ]]; then
+    conv="utf8tolatin1"
+    if [[ "$LANG" = *UTF-8 ]]; then
+      conv="cat"
+    fi
+    echo "==> append $sep to filename to view the OpenOffice or OpenDocument source"
+    istemp "unzip -avp" "$2" content.xml | o3tohtml | $conv | html2text -style pretty
+  elif [[ "$1" = *ISO\ 9660* ]]; then
+    if [[ "$2" != - ]]; then
+      isoinfo -d -i "$2"
+      joliet=`isoinfo -d -i "$2" | egrep '^Joliet'|cut -c1`
+      echo "================================= Content ======================================"
+      isoinfo -lR$joliet -i "$2"
+    fi
+  elif [[ "$1" = *image\ data*  || "$1" = *image\ text* || "$1" = *JPEG\ file* || "$1" = *JPG\ file* ]]; then
+    identify -verbose "$2"
+##ifdef jpeg2ascii,convert
+## get jpeg2ascii (CVS) from http://dyne.org/cgi-bin/cvsweb.cgi/jpeg2ascii/
+# very experimental attempt to display images using ASCII art (do not use)
+#  elif [[ "$1" = *image\ data*  || "$1" = *image\ text* || "$1" = *JPEG\ file* || "$1" = *JPG\ file* ]]; then
+#    convert -colorspace gray -geometry 100%x50% -contrast -geometry 320x1024 "$2" /tmp/.lesspipe1$$.jpg
+#    jpeg2ascii < /tmp/.lesspipe$$.jpg 2> /dev/null
+#    rm  /tmp/.lesspipe$$.jpg /tmp/.lesspipe1$$.jpg
+##elif pbmtoascii,convert
+# ASCII Art conversion using netbpm
+# elif [[ "$1" = *image\ data*  || "$1" = *image\ text* || "$1" = *JPEG\ file*  || "$1" = *JPG\ file* ]]; then
+#    convert -contrast -geometry 80x2048 "$2" /tmp/.lesspipe$$.pbm
+#    pbmtoascii  /tmp/.lesspipe$$.pbm 2> /dev/null
+#    rm  /tmp/.lesspipe$$.pbm
+##endif
+##ifdef mplayer
+#  elif [[ "$1" = *MPEG\ system\ stream*  || "$1" = *RIFF* || "$1" = *AVI* ]]; then
+#    mplayer -vo aa -aadriver slang -aanodim -aanobold -aacontrast 50 -aabright 1  "$2" 2> /dev/null
+##endif
+  elif [[ "$1" = *MPEG\ *layer\ 3\ audio* || "$1" = *mp3\ file* || "$1" = *MP3* ]]; then
+    mp3info "$2"
+  elif [[ "$1" = *bill\ of\ materials* ]]; then
+    lsbom -p MUGsf "$2"
+  elif [[ "$1" = *perl\ Storable* ]]; then
+    perl -MStorable=retrieve -MData::Dumper -e '$Data::Dumper::Indent=1;print Dumper retrieve shift' "$2"
+  elif [[ "$1" = *UTF-16* ]]; then
+      iconv -f utf-16 "$2"
+  elif [[ "$1" = *data* ]]; then
+    echo "==> append $sep to filename to view the $1 source"
+    if [[ "$2" = "-" ]]; then
+      strings
+    else
+      strings "$2"
+    fi
+  else
+    set "plain text" "$2"
+  fi
+  if [[ "$1" = *plain\ text* ]]; then
+    dir=${LESSOPEN#\|}
+    dir=${dir%%lesspipe.sh*\%s}
+    ${dir}code2color $PPID ${in_file:+"$in_file"} "$2"
+    if [[ $? = 0 ]]; then
+      return
+    fi
+  fi
+  if [[ "$2" = - ]]; then
+    cat
+  fi  
+}
+
+# calling show with arg1 arg2 ... is equivalent to calling with arg1:arg2:...
+IFS=$sep a="$@"
+IFS=' '
+if [[ "$a" = "" ]]; then
+  if [[ "$SHELL" = *csh ]]; then
+    echo "setenv LESSOPEN \"|$0 %s\""
+  else
+    echo "LESSOPEN=\"|$0 %s\""
+    echo "export LESSOPEN"
+  fi
+else
+  show "$a"
+fi
diff --git a/usr_bin/logview b/usr_bin/logview
new file mode 100755 (executable)
index 0000000..0914ca1
--- /dev/null
@@ -0,0 +1,36 @@
+#!/usr/bin/perl
+# Filename:      logview
+# Purpose:       Log viewer program. Pass it parameters of the logs to view, or it will automatically view some.
+# Authors:       Joey Hess <joey@kitenet.net>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       Unknown (origin: see http://svn.kitenet.net/trunk/bin/logview)
+# Latest change: Fri Sep 16 18:19:05 CEST 2005 [mika]
+################################################################################
+
+$|=1;
+
+$logdir='/var/log';
+@logfiles=@ARGV;
+
+# If I am root, look at all logs, otherwise only those that are
+# world-readable.
+my $perm='';
+$perm='-perm +6' if $? != 0;
+if (! @logfiles) {
+       @logfiles=split /\n/, `find $logdir -type f -regex '.*.log' ! -name faillog ! -name lastlog $perm`;
+       push @logfiles, "$logdir/mail.err", "$logdir/mail.warn";
+}
+
+if (-e $ENV{HOME}."/.xsession-errors") {
+       push @logfiles, $ENV{HOME}."/.xsession-errors";
+}
+
+# Tail without wasting the last line of the screen.
+open(TAIL, "tail -q --follow=name --retry -n 2 @logfiles|");
+while (<TAIL>) {
+       print "\n";
+       chomp;
+       print $_;
+}
+
+## END OF FILE #################################################################
diff --git a/usr_bin/mailhops b/usr_bin/mailhops
new file mode 100755 (executable)
index 0000000..dede6ea
--- /dev/null
@@ -0,0 +1,96 @@
+#!/usr/bin/perl -w
+# Copyright (c) 1999 Marius Gedminas <mgedmin@takas.lt>
+# Shows the route of an Internet mail message
+# Version 0.0.1pre-alpha
+#
+# Patched by Roland Rosenfeld <roland@spinnaker.de>
+# $ Id: mailhops,v 1.3 2000/01/25 20:18:24 roland Exp roland $
+
+use strict;
+use POSIX qw(mktime);
+use Date::Parse;
+
+my $verbose = 0;
+
+# Setup
+my %Months = (
+    Jan => 1,
+    Feb => 2,
+    Mar => 3,
+    Apr => 4,
+    May => 5,
+    Jun => 6,
+    Jul => 7,
+    Aug => 8,
+    Sep => 9,
+    Oct => 10,
+    Nov => 11,
+    Dec => 12,
+    );
+
+# Read headers
+$/ = '';
+my $head = <>;
+$head =~ s/\n\s+/ /g;
+my @headers = split("\n", $head);
+
+# Parse headers
+my @hops;
+for (@headers) {
+  next unless /^(>?Received|Date):/;
+  my $time;
+  my $host;
+  my $from;
+  if (/^Date:\s+(.*)/) {
+    $host = "Date:";
+    $time = $1;
+    $from = "";
+  } else {
+    $host = "(unknown)";
+    $host = $1 if /\sby\s+([a-z0-9\-_+.]+)\s/ && $1 ne "uid";
+    $from = "(unknown)";
+    $from = $1 if /\sfrom\s+([a-z0-9\-_+.]+(?:\s+[(].+?[)]))\s/;
+    $time = "(unknown)";
+    $time = $1 if /;\s+(.+)$/;
+    $time =~ s/using.*//;
+  }
+
+  my $epoch = str2time ($time);
+
+  unshift @hops, { HOST => $host, FROM => $from, TIME => $epoch};
+}
+
+# Print output
+print "    Host                            Date received (local)   Lag       Total lag\n";
+my $nr = 0;
+my ($first, $prev);
+for (@hops) {
+  my $host = $_->{HOST};
+  my $from = $_->{FROM};
+  my $time = $_->{TIME};
+  $first = $prev = $time unless defined $first;
+  printf "%2d. %-31.31s", ++$nr, $host;
+  do { print "\n"; next } unless defined $time;
+
+  my $delta = $time - $prev;
+  my $neg = $delta < 0; $delta = abs($delta);
+  my $delta_h = int($delta / 3600);
+  my $delta_m = int(($delta - $delta_h * 3600) / 60);
+  my $delta_s = ($delta - $delta_h * 3600 - $delta_m * 60);
+
+  my ($sec,$min,$hour,$day,$mon,$year,undef,undef,$dst) = localtime($time);
+
+  printf "  %4d-%02d-%02d  %02d:%02d:%02d  %s%02d:%02d:%02d",
+         1900+$year, $mon+1, $day, $hour, $min, $sec,
+        $neg ? '-' : ' ', $delta_h, $delta_m, $delta_s;
+
+  $delta = $time - $first;
+  $neg = $delta < 0; $delta = abs($delta);
+  $delta_h = int($delta / 3600);
+  $delta_m = int(($delta - $delta_h * 3600) / 60);
+  $delta_s = ($delta - $delta_h * 3600 - $delta_m * 60);
+  printf "  %s%02d:%02d:%02d\n",
+        $neg ? '-' : ' ', $delta_h, $delta_m, $delta_s;
+  print  "     from $from\n" if $verbose;
+  $prev = $time;
+}
diff --git a/usr_bin/myip b/usr_bin/myip
new file mode 100755 (executable)
index 0000000..0f77d5a
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/zsh
+# Filename:      myip
+# Purpose:       return IP address of running system on stdout (requires network access)
+# Authors:       grml-team (grml.org), (c) Alexander Wirt <formorer@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mon Aug 07 23:39:32 CEST 2006 [mika]
+################################################################################
+
+# little helper functions that skips the httpheader of a site
+function skip_httpheader {
+  for i in {1..6} ; do read -u $REPLY LINE; done
+}
+
+zmodload zsh/net/tcp
+HOST=showip.spamt.net
+ztcp $HOST 80
+print -u $REPLY "GET / HTTP/1.1\r\nHost: $HOST\r\n\r\n"
+skip_httpheader
+read -u $REPLY LINE
+echo "$LINE"
+ztcp -c $REPLY
+
+## END OF FILE #################################################################
diff --git a/usr_bin/osd_server.py b/usr_bin/osd_server.py
new file mode 100755 (executable)
index 0000000..1914346
--- /dev/null
@@ -0,0 +1,126 @@
+#!/usr/bin/python
+# -*- coding: iso-8859-15 -*-
+# Copyright (C) 2005 2006 Alexander Bernauer <alex@copton.net>
+# Copyright (C) 2005 2006 Rico Schiekel <fire@donwgra.de>
+# Copyright (C) 2005 2006 Ulrich Dangel <uli@spamt.net>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation version 2
+# of the License.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA.
+#
+
+import sys, getopt, logging
+from socket import *
+from os import popen
+from select import select
+
+host='localhost'
+port=1234
+osdcmd = "/usr/bin/osd_cat"
+
+def syntax():
+    print "osd_server.py [options]"
+    print "   options:"
+    print "     -h --help       print this message"
+    print "     -H --host       host of the osd server (def: " + host + ")"
+    print "     -P --port       port of the osd server (def: " + str(port) + ")"
+    print "     -o --osd        set new osd parameter string"
+    print "     -l --log        log file ('-' logs to stdout)"
+
+def get_osd_paramstr(def_params, user_params):
+    ret = user_params
+    if user_params == '':
+        for n, v in def_params.iteritems():
+            if v != '':
+                ret += n + "=" + v + " "
+    return ret
+
+
+
+osd_params={ '--pos': 'middle',
+             '--offset': '100',
+             '--align': 'center',
+             '--indent': '100',
+             '--font':
+             '\-\*\-helvetica\-\*\-r\-\*\-\*\-34\-\*\-\*\-\*\-\*\-\*\-iso8859\-15',
+             '--colour': 'green',
+             '--shadow': '0',
+             '--shadowcolour': '',
+             '--outline': '1',
+             '--outlinecolour': 'black',
+             '--age': '4',
+             '--lines': '5',
+             '--delay': '4' }
+
+logfile_name = ''
+user_osd_params = ''
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:], "hH:P:o:l:", ["help", "host=", "port=", "osd=", "log="])
+except getopt.GetoptError:
+    syntax()
+    sys.exit(2)
+
+for opt, arg in opts:
+    if opt in ("-h", "--help"):
+        syntax()
+        sys.exit(3)
+    elif opt in ("-H", "--host"):
+        host = arg
+    elif opt in ("-P", "--port"):
+        port = int(arg)
+    elif opt in ("-o", "--osd"):
+        user_osd_params = arg
+    elif opt in ("-l", "--log"):
+        logfile_name = arg
+
+l = socket(AF_INET, SOCK_STREAM)
+l.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
+l.bind((host, port))
+l.listen(5)
+
+logger = logging.getLogger('osd_server')
+lformatter = logging.Formatter('%(asctime)s %(message)s')
+if logfile_name not in ('', '-'):
+    lfh = logging.FileHandler(logfile_name)
+    lfh.setFormatter(lformatter)
+    logger.addHandler(lfh)
+else:
+    lout = logging.StreamHandler(sys.stdout)
+    lout.setFormatter(lformatter)
+    logger.addHandler(lout)
+logger.setLevel(logging.INFO)
+
+logger.info("osd_server running on [%s] port [%d]" % (host, port))
+osdpipe = popen("%s %s" % (osdcmd, get_osd_paramstr(osd_params, user_osd_params)), 'w')
+
+r = range(32,127)
+r.extend([ord(umlaut) for umlaut in "äöüßÄÖܤ" ])
+
+while 1:
+    (con, addr) = l.accept()
+    message = con.recv(60).strip()
+    con.close()
+
+    message = message.replace("\n", "")
+    message = ''.join(map(lambda a: not a in r \
+                        and '[%.2d]' % a \
+                        or chr(a), \
+                        [ord(c) for c in message]))[:60]
+
+    logger.info(message)
+    osdpipe.write(message)
+    osdpipe.write("\n")
+    osdpipe.flush()
+
+osdpipe.close()
diff --git a/usr_bin/random-hostname b/usr_bin/random-hostname
new file mode 100755 (executable)
index 0000000..019c1e1
--- /dev/null
@@ -0,0 +1,404 @@
+#!/bin/sh
+# Filename:      random-hostname
+# Purpose:       print random hostname to stdout
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Sep 30 11:42:30 CEST 2006 [mika]
+################################################################################
+num=$(wc -l $0)
+num=${num%% $0}
+num=$(( $num - 16 ))
+randline=$(($(date +%Y%M%S) * $$ % $num))
+hostname=$(tail -n $randline "$0" | head -1 | grep -v "'" | grep -v '^#' | grep -v '^$')
+[ -n "$hostname" ] && echo "$hostname" || echo "grml"
+# EOF - line 15; now the hostnames:
+hostnames='
+23
+42
+ackbar
+agamemnon
+alderaan
+alphacentauri
+anakin
+antares
+apfel
+aphrodite
+archill
+argl
+argon
+auge
+avoision
+a-wizard-did-it
+awk
+baby
+bane
+banjologist
+bar
+barnards
+barteldan
+bartesque
+bartwisch
+basegame
+bbbq
+beginulate
+beheadbumped
+bespin
+beta
+beteigeuze
+bethselamin
+bielefeld
+billiboy
+binkel
+bitch
+blackbush
+blingwad
+boba
+bonus-eruptus
+boo-urns
+bottom
+bovine-university
+brain-medicine
+brassafrax
+brett
+bsdkiller
+bughunter
+butler
+c-3po
+calisto
+capdabbler
+car-hole
+celibacy
+charm
+chazzwozzers
+chestal
+chewbacca
+chocotastic
+cholera
+clouseauesque
+cody
+commie-nazis
+connemara
+corellia
+coruscant
+cragganmore
+crantastic
+crap-factory
+craptacular
+cray
+crisitunity
+cromulent
+crotch-dot
+dagobah
+dalwhinnie
+damogran
+dantooine
+darth
+darthsidious
+darthvader
+dash-hole
+debilian
+debsauber
+deceleratrix
+dickety
+diddly
+diefront
+dingens
+dings
+dingsbums
+doctorb
+dodge
+dodgerock
+doesntexist
+dogma
+doh
+dooku
+down
+drunkening
+dumbening
+duro
+eadrax
+electromicide
+embiggen
+eprouvette
+erde
+erotikon
+error
+fantastipotamus
+farkbot
+faxtrola
+fehlstart
+find
+fischvergiftung
+flanswered
+flauschig
+floor-pie
+flunjer
+foo
+foodbag
+foodrinkery
+forfty
+frinkahedron
+frogurt
+froschstern
+fscking
+fuchsiatard
+fudrucker
+fuss
+g3nt00
+gamblor
+garbagewater
+gegruemmelt
+gelbescheibe
+geonosis
+gewusel
+gibby-gabby
+glaven
+golatsche
+golgafrincham
+greedo
+grievous
+grmled
+grmlegg
+grmlei
+guglhupf
+ham-in-a-can
+hansolo
+harem
+hedge
+hektor
+helium
+hera
+herakles
+herpes
+herz
+homersexual
+hoth
+hoyvin-mayvin
+hypohemia
+ilum
+introubulate
+jabba
+jacen
+jaina
+jango
+jebeditis
+jebus
+jiminy-jillikers
+jumping-box
+jupiter
+kamino
+kashyyyk
+kidnappophilie
+kilbeggan
+killbot-factory
+knifey-spooney
+knowitallism
+knowledgeum
+kollateralschaden
+korriban
+krautundrueben
+krikkit
+krypton
+kukuruz
+kwyjibo
+lagavulin
+lamuella
+land-cow
+lart
+lasagne
+liberty-log
+lima
+localhorst
+lochnagar
+lunge
+lupper
+macallan
+magno
+magrathea
+malak
+malparkage
+manaan
+master
+maximegalon
+mazuma
+megacide
+mehlmuehle
+melange
+menapplause
+milliways
+minor
+minuteman
+money-fight
+monster
+mund
+musikapparat
+mustafar
+mygeeto
+naboo
+nase
+neglecterino
+neighborino
+neon
+niere
+nucleon
+nuisancefon
+nulecule
+nutty-fudgekins
+oban
+obiwankenobi
+odysseus
+oglarun
+ohr
+okely-dokely
+omega
+omfg
+onderon
+onetuplet
+oops
+ossus
+ovulicious
+palpatine
+panaka
+panchito
+panic
+paradigma
+paranoia
+paris
+persephone
+phonon
+photon
+pizza
+plagueis
+plasmon
+pointy-kitty
+popocatepetl
+porridge
+postefix
+posturologists
+praesitlyn
+preliumtarn
+presbylutheran
+pricetaggery
+pull-a-homer
+pusteblume
+pustefix
+quantum-tunnel
+quetzlzacatenango
+quinlan
+r2-d2
+radon
+rageohol
+rastafy
+raunzer
+raytheist
+rear-admiral
+rechengnom
+re-dorkulated
+retirony
+revan
+reverse-vampires
+reversifying-glass
+rhadamanthys
+rinderwahnsinn
+ronzer
+rotate-the-shield-harmonics
+rtfm
+rupert
+sacrilicious
+saturn
+saubaua
+saxamaphone
+schwipps
+science-pole
+scientician
+scp
+scponly
+scrod-basket
+sebulba
+sed
+shanagary
+shinning
+shirkaday
+shirt-wiener
+shiva-h.-vishnu
+sisterectomy
+skywalker
+smashy-smashy
+smeckler
+smendler
+smokesperson
+snacktacular
+solo
+sonne
+sophistimacated-doowhackey
+soulianis
+spaghettimonster
+spambox
+speedholes-or-speed-holes
+spokesrebel
+ssh
+stabby
+steamed-hams
+sterz
+stillroot
+successmanship
+supercalifragilistics
+superliminal
+swedish-lunchbox
+swishifying
+sync
+syphilis
+talisker
+talon
+taris
+tasty-fake
+tatooine
+telepanhandling
+telos
+thinkgeek
+thrawn
+throughhole
+thule
+tomacco
+tomorry
+top
+traumedy
+trebor
+tromboner
+tsykolon
+ulic
+unblowuppable
+unfaceuptoable
+unpossible
+up
+uppity-box
+ursa
+utapau
+velocitator
+vi
+viltvodl
+vim
+vista
+vogsphere
+volleybrick
+walking-bird
+wassissn
+watto
+wiggle-puppy
+wildwuchs
+woozle-wuzzle
+word-hole
+wurmloch
+xenon
+yaddle
+yellodisk
+yellow-fatty-beans
+yoda
+yoink
+ysolldins
+zazz
+zeus
+zicke
+zuh
+'
diff --git a/usr_bin/runit b/usr_bin/runit
new file mode 100755 (executable)
index 0000000..d1837cc
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Filename:      runit
+# Purpose:       prompt for command via Xdialog and execute it afterwards
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Fre Jän 07 11:46:02 CET 2005 [mika]
+################################################################################
+
+tempfile=$(mktemp)
+trap "rm -f $tempfile" 0 1 2 5 15
+
+Xdialog --cr-wrap \
+        --title "INPUT BOX" --clear \
+        --inputbox \
+"run command:" 0 0 2> $tempfile
+
+retval=$?
+
+COMMAND=$(cat "$tempfile")
+
+case $retval in
+  0)
+    echo "Trying to run: $COMMAND"
+    exec "$COMMAND" & ;;
+  1)
+    echo "Cancel pressed.";;
+esac
+
+## END OF FILE #################################################################
diff --git a/usr_bin/say b/usr_bin/say
new file mode 100755 (executable)
index 0000000..4985ce6
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Filename:      say
+# Purpose:       output text via flite or festival (general multi-lingual speech synthesis system)
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Son Jän 30 14:38:30 CET 2005 [mika]
+################################################################################
+
+if [[ "$#" -eq '0' ]] ; then
+  echo "Usage: $0 <text_to_say>"
+  exit -1
+fi
+
+if [ -x /usr/bin/flite ] ; then
+  flite -o play -t "$*"
+elif [ -x /usr/bin/festival ] ; then
+  echo $* | festival --tts
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/search b/usr_bin/search
new file mode 100755 (executable)
index 0000000..dac3445
--- /dev/null
@@ -0,0 +1,2084 @@
+#!/usr/bin/perl -w
+'di
+.ig 00
+';
+
+##############################################################################
+##
+## search
+##
+## Jeffrey Friedl (jfriedl@omron.co.jp), Dec 1994.
+## Copyright 19.... ah hell, just take it.
+## Ported to Win95 by Dan Schmidt (dfan@alum.mit.edu)
+##
+## BLURB:
+## A combo of find and grep -- more or less do a 'grep' on a whole
+## directory tree. Fast, with lots of options. Much more powerful than
+## the simple "find ... | xargs grep ....". Has a full man page.
+## Powerfully customizable. Emacs interface included.
+##
+## This file is big, but mostly comments and man page.
+##
+## See man page for usage info.
+## Return value: 2=error, 1=nothing found, 0=something found.
+##
+
+$version = "960908.11";
+## "960908.11"
+##      Added -depth=0, 'cause I needed it.
+##
+## "960506.10"
+##      Added -F/-R, and made it a bit more smart about $ and @ in arguments.
+##
+## "960426.9"
+##      Sigh -- fixed a perl4 backward-compatabilty problem.
+## "960330.8"
+##      Made $&-clean!
+## "960325.7"
+##     Added the "filter" directive to the startup file so I could have
+##     search automatically look inside compressed files.
+##
+##      Implementation: slightly changed semantics with how EVALs are
+##     removed from the inlined program.
+## "960227.6"
+##   From Lionel Cons a few bug fixes and cool emacs interface:
+##
+##    ``Also, I integrated search in Emacs so that I can use "M-x search"
+##      and then "C-x `" to browse through the occurences (like grep).
+##      Here is the code that I use:
+## 
+##        (defun search (dir what) "Run search with all grep goodies."
+##          (interactive "DSearch under: \nsSearch for: ")
+##           (setq default-directory
+##                (if (string-match "/$" dir) dir (concat dir "/")))
+##            (compile-internal (concat "search -n " what)
+##                 "No more search hits" "grep" nil grep-regexp-alist))
+## "951019.5"
+##     Add color stuff (-bold, -red, etc...)
+##     Fix up nroff stuff to work with groff
+## "950918.4 1/2";
+##    Changed all 'sysread' to 'read' because Linux perl's don't seem
+##    to like sysread()
+## "941227.4"
+##     Added -n, -u
+## "941222.3"
+##      Added -nice (due to Lionel Cons <Lionel.Cons@cern.ch>)
+##     Removed any leading "./" from name.
+##      Added default flags for ~/.search, including TTY, -nice, -list, etc.
+##     Program name now has path removed when printed in diagnostics.
+##     Added simple tilde-expansion to -dir arg.
+##     Added -dskip, etc. Fixed -iregex bug.
+##     Changed -dir to be additive, adding -ddir.
+##     Now screen out devices, pipes, and sockets.
+##     More tidying and lots of expanding of the man page
+## "941217.2";
+##     initial release.
+
+$stripped=0;
+
+&init;
+$rc_file = join('/', $ENV{'HOME'}, ".search");
+
+&check_args;
+
+## Make sure we've got a regex.
+## Don't need one if -find or -showrc was specified.
+$!=2, die "expecting regex arguments.\n"
+       if $FIND_ONLY == 0 && $showrc == 0 && @ARGV == 0;
+
+&prepare_to_search($rc_file);
+
+&import_program if !defined &dodir; ## BIG key to speed.
+
+## do search while there are directories to be done.
+&dodir(shift(@todo)) while @todo;
+
+&clear_message if $VERBOSE && $STDERR_IS_TTY;
+exit($retval);
+###############################################################################
+
+sub init
+{
+  ## initialize variables that might be reset by command-line args
+  $DOREP=0;            ## set true by -dorep (redo multi-hardlink files)
+  $DO_SORT=0;           ## set by -sort (sort files in a dir before checking)
+  $FIND_ONLY=0;         ## set by -find (don't search files)
+  $LIST_ONLY=0;                ## set true by -l (list filenames only)
+  $NEWER=0;             ## set by -newer, "-mtime -###"
+  $NICE=0;              ## set by -nice (print human-readable output)
+  $NOLINKS=0;          ## set true by -nolinks (don't follow symlinks)
+  $OLDER=0;             ## set by -older, "-mtime  ###"
+  $PREPEND_FILENAME=1;  ## set false by -h (don't prefix lines with filename)
+  $REPORT_LINENUM=0;    ## set true by -n (show line numbers)
+  $VERBOSE=0;          ## set to a value by -v, -vv, etc. (verbose messages)
+  $WHY=0;              ## set true by -why, -vvv+ (report why skipped)
+  $XDEV=0;             ## set true by -xdev (stay on one filesystem)
+  $all=0;              ## set true by -all (don't skip many kinds of files)
+  $iflag = '';         ## set to 'i' by -i (ignore case);
+  $norc=0;              ## set by -norc (don't load rc file)
+  $showrc=0;            ## set by -showrc (show what happens with rc file)
+  $underlineOK=0;       ## set true by -u (watch for underline stuff)
+  $words=0;             ## set true by -w (match whole-words only)
+  $MARK='';             ## set by -bold (-red, etc.). Does ANSI markup.
+  $literal=0;           ## set by -F -- "regex" args taken as literal strings
+  $retval=1;            ## will set to 0 if we find anything.
+  $DESCEND_SUBDIRECTORIES=1;## set to false by -depth=0
+
+  $WINDOWS=0;           ## under windows?
+  $USE_INODES=1;        ## are inodes valid?
+
+  ## various elements of stat() that we might access
+  $STAT_DEV   = 1;
+  $STAT_INODE = 2;
+  $STAT_MTIME = 9;
+
+  $VV_PRINT_COUNT = 50;  ## with -vv, print every VV_PRINT_COUNT files, or...
+  $VV_SIZE = 1024*1024;  ## ...every VV_SIZE bytes searched
+  $vv_print = $vv_size = 0; ## running totals.
+
+  ## set default options, in case the rc file wants them
+  $opt{'TTY'}= 1 if -t STDOUT;
+  
+  ## want to know this for debugging message stuff
+  $STDERR_IS_TTY = -t STDERR ? 1 : 0;
+  $STDERR_SCREWS_STDOUT = ($STDERR_IS_TTY && -t STDOUT) ? 1 : 0;
+
+  $0 =~ s,.*/,,;  ## clean up $0 for any diagnostics we'll be printing.
+}
+
+##
+## Check arguments.
+##
+sub check_args
+{
+  while (@ARGV && $ARGV[0] =~ m/^-/)
+  {
+      $arg = shift(@ARGV);
+
+      if ($arg eq '-version' || ($VERBOSE && $arg eq '-help')) {
+         print qq/Jeffrey\'s file search, version "$version".\n/;
+         exit(0) unless $arg eq '-help';
+      }
+      if ($arg eq '-help') {
+         print <<INLINE_LITERAL_TEXT;
+usage: $0 [options] [-e] [PerlRegex ....]
+OPTIONS TELLING *WHERE* TO SEARCH:
+  -dir DIR       start search at the named directory (default is current dir).
+  -xdev          stay on starting file system.
+  -sort          sort the files in each directory before processing.
+  -nolinks       don\'t follow symbolic links.
+  -depth=0       don\'t descend into subdirectories
+OPTIONS TELLING WHICH FILES TO EVEN CONSIDER:
+  -mtime #       consider files modified > # days ago (-# for < # days old)
+  -newer FILE    consider files modified more recently than FILE (also -older)
+  -name GLOB     consider files whose name matches pattern (also -regex).
+  -skip GLOB     opposite of -name: identifies files to not consider.
+  -path GLOB     like -name, but for files whose whole path is described.
+  -dpath/-dregex/-dskip versions for selecting or pruning directories.
+  -all           don\'t skip any files marked to be skipped by the startup file.
+  -x<SPECIAL>    (see manual, and/or try -showrc).
+  -why           report why a file isn\'t checked (also implied by -vvvv).
+OPTIONS TELLING WHAT TO DO WITH FILES THAT WILL BE CONSIDERED:
+  -f  | -find    just list files (PerlRegex ignored). Default is to grep them.
+  -ff | -ffind   Does a faster -find (implies -find -all -dorep)
+OPTIONS CONTROLLING HOW THE SEARCH IS DONE (AND WHAT IS PRINTED):
+  -F | -lit      "regex" args taken as literal strings (like fgrep)
+  -R | -regex    undoes -F -- regex ares really are perl regexes
+  -l | -list     only list files with matches, not the lines themselves.
+  -nice | -nnice print more "human readable" output.
+  -bold | -red   mark found items (various colors supported)
+  -n             prefix each output line with its line number in the file.
+  -h             don\'t prefix output lines with file name.
+  -u             also look "inside" manpage-style underlined text
+  -i             do case-insensitive searching.
+  -w             match words only (as defined by perl\'s \\b).
+OTHER OPTIONS:
+  -v, -vv, -vvv  various levels of message verbosity.
+  -e             end of options (in case a regex looks like an option).
+  -showrc        show what the rc file sets, then exit.
+  -norc          don\'t load the rc file.
+  -dorep         check files with multiple hard links multiple times.
+  -win           necessary if running under Windows 95.
+INLINE_LITERAL_TEXT
+       print "Use -v -help for more verbose help.\n" unless $VERBOSE;
+       print "This script file is also a man page.\n" unless $stripped;
+       print <<INLINE_LITERAL_TEXT if $VERBOSE;
+
+If -f (or -find) given, PerlRegex is optional and ignored.
+Otherwise, will search for files with lines matching any of the given regexes.
+
+Combining things like -name and -mtime implies boolean AND.
+However, duplicating things (such as -name '*.c' -name '*.txt') implies OR.
+
+-mtime may be given floating point (i.e. 1.5 is a day and a half).
+-iskip/-idskip/-ipath/... etc are case-insensitive versions.
+
+If any letter in -newer/-older is upper case, "or equal" is
+inserted into the test.
+
+You can always find the latest version on the World Wide Web in
+   http://www.wg.omron.co.jp/~jfriedl/perl/
+INLINE_LITERAL_TEXT
+         exit(0);
+      }
+      $DOREP=1,             next if $arg eq '-dorep';   ## do repeats
+      $DO_SORT=1,           next if $arg eq '-sort';    ## sort files
+      $NOLINKS=1,           next if $arg eq '-nolinks'; ## no sym. links
+      $PREPEND_FILENAME=0,  next if $arg eq '-h';       ## no filename prefix
+      $REPORT_LINENUM=1,    next if $arg eq '-n';       ## show line numbers
+      $WHY=1,               next if $arg eq '-why';     ## tell why skipped
+      $XDEV=1,              next if $arg eq '-xdev';    ## don't leave F.S.
+      $all=1,$opt{'-all'}=1,next if $arg eq '-all';     ## don't skip *.Z, etc
+      $iflag='i',           next if $arg eq '-i';       ## ignore case
+      $iflag='',            next if $arg eq '-noi';     ## don't ignore case
+      $norc=1,              next if $arg eq '-norc';    ## don't load rc file
+      $showrc=1,            next if $arg eq '-showrc';  ## show rc file
+      $underlineOK=1,       next if $arg eq '-u';       ## look throuh underln.
+      $words=1,             next if $arg eq '-w';       ## match "words" only
+      $literal=1,           next if $arg eq '-F';       ## args are literal
+      $literal=1,           next if $arg eq '-lit';     ## args are literal
+      $literal=0,           next if $arg eq '-R';       ## args are regexes
+      $literal=0,           next if $arg eq '-regex';   ## args are regexes
+      &strip                     if $arg eq '-strip';   ## dump this program
+      last                       if $arg eq '-e';
+
+      $mark = '\e[7m',     next if $arg eq '-bold';    ## embold found items]
+      $mark = '\e[30m',    next if $arg eq '-black';   ## embold found items]
+      $mark = '\e[31m',    next if $arg eq '-red';     ## embold found items]
+      $mark = '\e[32m',    next if $arg eq '-green';   ## embold found items]
+      $mark = '\e[33m',    next if $arg eq '-yellow';  ## embold found items]
+      $mark = '\e[34m',    next if $arg eq '-blue';    ## embold found items]
+      $mark = '\e[36m',    next if $arg eq '-cyan';    ## embold found items]
+      $mark = '\e[37m',    next if $arg eq '-white';   ## embold found items]
+
+      $FIND_ONLY=1,         next if $arg =~/^-f(ind)?$/;## do "find" only
+
+      $FIND_ONLY=1, $DOREP=1, $all=1,
+                            next if $arg =~/^-ff(ind)?$/;## fast -find
+      $LIST_ONLY=1,$opt{'-list'}=1,
+                           next if $arg =~/^-l(ist)?$/;## only list files
+
+      $WINDOWS=1, $USE_INODES=0, $DOREP=1,
+                           next if $arg eq '-win';     ## running under Windows
+                                
+
+      if ($arg =~ m/^-depth=(\d+)$/) {
+         die qq/$0: only -depth of 0 currently supported\n/ if $1 != 0;
+         $DESCEND_SUBDIRECTORIES=0;
+         next;
+      }
+
+      if ($arg =~ m/^-(v+)$/) { ## verbosity
+       $VERBOSE =length($1);
+       foreach $len (1..$VERBOSE) { $opt{'-'.('v' x $len)}=1 }
+       next;
+      }
+      if ($arg =~ m/^-(n+)ice$/) { ## "nice" output
+        $NICE =length($1);
+       foreach $len (1..$NICE) { $opt{'-'.('n' x $len).'ice'}=1 }
+       next;
+      }
+
+      if ($arg =~ m/^-(i?)(d?)skip$/) {
+         local($i) = $1 eq 'i';
+         local($d) = $2 eq 'd';
+         $! = 2, die qq/$0: expecting glob arg to -$arg\n/ unless @ARGV;
+         foreach (split(/\s+/, shift @ARGV)) {
+             if ($d) {
+                 $idskip{$_}=1 if $i;
+                  $dskip{$_}=1;
+             } else {
+                 $iskip{$_}=1 if $i;
+                  $skip{$_}=1;
+             }
+         }
+         next;
+      }
+
+
+      if ($arg =~ m/^-(i?)(d?)(regex|path|name)$/) {
+         local($i) = $1 eq 'i';
+         $! = 2, die qq/$0: expecting arg to -$arg\n/ unless @ARGV;
+         foreach (split(/\s+/, shift @ARGV)) {
+             $iname{join(',', $arg, $_)}=1 if $i;
+              $name{join(',', $arg, $_)}=1;
+         }
+         next;
+      }
+
+      if ($arg =~ m/^-d?dir$/) {
+         $opt{'-dir'}=1;
+         $! = 2, die qq/$0: expecting filename arg to -$arg\n/ unless @ARGV;
+         $start = shift(@ARGV);
+         $start =~ s#^~(/+|$)#$ENV{'HOME'}$1# if defined $ENV{'HOME'};
+         $! = 2, die qq/$0: can\'t find ${arg}\'s "$start"\n/ unless -e $start;
+         $! = 2, die qq/$0: ${arg}\'s "$start" not a directory.\n/ unless -d _;
+         undef(@todo), $opt{'-ddir'}=1 if $arg eq '-ddir';
+         push(@todo, $start);
+         next;
+      }
+
+      if ($arg =~ m/^-(new|old)er$/i) {
+         $! = 2, die "$0: expecting filename arg to -$arg\n" unless @ARGV;
+         local($file, $time) = shift(@ARGV);
+         $! = 2, die qq/$0: can\'t stat -${arg}\'s "$file"./
+                 unless $time = (stat($file))[$STAT_MTIME];
+         local($upper) = $arg =~ tr/A-Z//;
+         if ($arg =~ m/new/i) {
+            $time++ unless $upper;
+            $NEWER = $time if $NEWER < $time;
+         } else {
+            $time-- unless $upper;
+            $OLDER = $time if $OLDER == 0 || $OLDER > $time;
+         }
+         next;
+      }
+
+      if ($arg =~ m/-mtime/) {
+         $! = 2, die "$0: expecting numerical arg to -$arg\n" unless @ARGV;
+         local($days) = shift(@ARGV);
+         $! = 2, die qq/$0: inappropriate arg ($days) to $arg\n/ if $days==0;
+         $days *= 3600 * 24;
+         if ($days < 0) {
+             local($time) = $^T + $days;
+             $NEWER = $time if $NEWER < $time;
+         } else {
+             local($time) = $^T - $days;
+             $OLDER = $time if $OLDER == 0 || $OLDER > $time;
+         }
+         next;
+      }
+
+      ## special user options
+      if ($arg =~ m/^-x(.+)/) {
+         foreach (split(/[\s,]+/, $1)) {  $user_opt{$_} = $opt{$_}= 1;  }
+         next;
+      }
+
+      $! = 2, die "$0: unknown arg [$arg]\n";
+  }
+  $DOMARK = defined($mark) ? 1 : 0;
+}
+
+##
+## Given a filename glob, return a regex.
+## If the glob has no globbing chars (no * ? or [..]), then
+## prepend an effective '*' to it.
+##
+sub glob_to_regex
+{
+    local($glob) = @_;
+    local(@parts) = $glob =~ m/\\.|[*?]|\[]?[^]]*]|[^[\\*?]+/g;
+    local($trueglob)=0;
+    foreach (@parts) {
+       if ($_ eq '*' || $_ eq '?') {
+           $_ = ".$_";
+           $trueglob=1;  ## * and ? are a real glob
+       } elsif (substr($_, 0, 1) eq '[') {
+           $trueglob=1;  ## [..] is a real glob
+       } else {
+           s/^\\//;     ## remove any leading backslash;
+           s/(\W)/\\$1/g; ## now quote anything dangerous;
+       }
+    }
+    unshift(@parts, '.*') unless $trueglob;
+    join('', '^', @parts, q/$/);
+}
+
+sub prepare_to_search
+{
+  local($rc_file) = @_;
+
+  $HEADER_BYTES=0;          ## Might be set nonzero in &read_rc;
+  $last_message_length = 0; ## For &message and &clear_message.
+
+  &read_rc($rc_file, $showrc) unless $norc;
+  exit(0) if $showrc;
+
+  $NEXT_DIR_ENTRY = $DO_SORT ? 'shift @files' : 'readdir(DIR)';
+  $WHY = 1 if $VERBOSE > 3; ## Arg -vvvv or above implies  -why.
+  @todo = ('.') if @todo == 0; ## Where we'll start looking
+
+  ## see if any user options were specified that weren't accounted for
+  foreach $opt (keys %user_opt) {
+      next if defined $seen_opt{$opt};
+      warn "warning: -x$opt never considered.\n";
+  }
+
+  die "$0: multiple time constraints exclude all possible files.\n"
+      if ($NEWER && $OLDER) && ($NEWER > $OLDER);
+
+  ##
+  ## Process any -skip/-iskip args that had been given
+  ##
+  local(@skip_test);
+  foreach $glob (keys %skip) {
+      $i = defined($iskip{$glob}) ? 'i': '';
+      push(@skip_test, '$name =~ m/'. &glob_to_regex($glob). "/$i");
+  }
+  if (@skip_test) {
+      $SKIP_TEST = join('||',@skip_test);
+      $DO_SKIP_TEST = 1;
+  } else {
+      $DO_SKIP_TEST = $SKIP_TEST = 0;
+  }
+
+  ##
+  ## Process any -dskip/-idskip args that had been given
+  ##
+  local(@dskip_test);
+  foreach $glob (keys %dskip) {
+      $i = defined($idskip{$glob}) ? 'i': '';
+      push(@dskip_test, '$name =~ m/'. &glob_to_regex($glob). "/$i");
+  }
+  if (@dskip_test) {
+      $DSKIP_TEST = join('||',@dskip_test);
+      $DO_DSKIP_TEST = 1;
+  } else {
+      $DO_DSKIP_TEST = $DSKIP_TEST = 0;
+  }
+
+
+  ##
+  ## Process any -name, -path, -regex, etc. args that had been given.
+  ##
+  undef @name_test;
+  undef @dname_test;
+  foreach $key (keys %name) {
+      local($type, $pat) = split(/,/, $key, 2);
+      local($i) = defined($iname{$key}) ? 'i' : '';
+      if ($type =~ /regex/) {
+         $pat =~ s/!/\\!/g;
+         $test = "\$name =~ m!^$pat\$!$i";
+      } else {
+         local($var) = $type eq 'name' ? '$name' : '$file';
+         $test = "$var =~ m/". &glob_to_regex($pat). "/$i";
+      }
+      if ($type =~ m/^-i?d/) {
+         push(@dname_test, $test);
+      } else {
+         push(@name_test, $test);
+      }
+  }
+  if (@name_test) {
+      $GLOB_TESTS = join('||', @name_test);
+
+      $DO_GLOB_TESTS = 1;
+  } else {
+      $GLOB_TESTS = $DO_GLOB_TESTS = 0;
+  }
+  if (@dname_test) {
+      $DGLOB_TESTS = join('||', @dname_test);
+      $DO_DGLOB_TESTS = 1;
+  } else {
+      $DGLOB_TESTS = $DO_DGLOB_TESTS = 0;
+  }
+
+  ##
+  ## Process any 'magic' things from the startup file.
+  ##
+  if (@magic_tests && $HEADER_BYTES) {
+      ## the $magic' one is for when &dodir is not inlined
+      $tests = join('||',@magic_tests);
+      $MAGIC_TESTS = "{ package magic; \$val = ($tests) }";
+      $DO_MAGIC_TESTS = 1;
+  } else {
+      $MAGIC_TESTS = 1;
+      $DO_MAGIC_TESTS = 0;
+  }
+
+  ##
+  ## Prepare regular expressions.
+  ##
+  {
+      local(@regex_tests);
+      local(@mark_commands);
+
+      if ($LIST_ONLY) {
+        $mflag = '';
+        ## need to have $* set, but perl5 just won't shut up about it.
+        if ($] >= 5) {
+             $mflag = 'm';
+        } else {
+             eval ' $* = 1 ';
+        }
+      }
+
+      ##
+      ## Until I figure out a better way to deal with it,
+      ## We have to worry about a regex like [^xyz] when doing $LIST_ONLY.
+      ## Such a regex *will* match \n, and if I'm pulling in multiple
+      ## lines, it can allow lines to match that would otherwise not match.
+      ##
+      ## Therefore, if there is a '[^' in a regex, we can NOT take a chance
+      ## and use the fast listonly.
+      ##
+      $CAN_USE_FAST_LISTONLY = $LIST_ONLY;
+
+      local(@extra, $orig);
+      local($underline_glue) = ($] >= 5) ? '(:?_\cH)?' : '(_\cH)?';
+      while (@ARGV) {
+          $regex = shift(@ARGV);
+
+         if ($literal) {
+             $orig = $regex if $literal;
+             $regex =~ s/(\W)/\\$1/g;  ## quote everything
+         } else {
+             ## try to be smart about a $ in the regex. If it looks
+             ## like an end-of-line metacharacter, we'll leave it.
+             ## Otherwise, escape it so that it has no variable
+             ## substutition
+             $regex =~ s/(.?)\$([^)|])/
+               $1 eq '\\' ? $& : "$1\\\$$2"/eg;  ## quote some $
+             if ($] >= 5) {
+                 $regex =~ s/\@/\\@/g;  ## quote @
+             }
+         }
+         if ($DOMARK) {
+             local($tmp) = $regex;
+             $tmp =~ s,/,\/,g;
+             $tmp = join($tmp, '\b(', ')\b') if $words;
+             push(@mark_commands, "s/($tmp)/$mark\$1\e[m/g$iflag");
+         }
+
+         ##
+         ## If watching for underlined things too, add another regex.
+         ##
+         if ($underlineOK) {
+            if ($regex =~ m/[?*+{}()\\.|^\$[]/) {
+               warn "$0: warning, can't underline-safe ``$regex''.\n";
+            } else {
+               $regex = join($underline_glue, split(//, $regex));
+            }
+         }
+
+         ## If nothing special in the regex, just use index...
+         ## is quite a bit faster.
+         if (($iflag eq '') && ($words == 0) &&
+            ($literal || $regex !~ m/[?*+{}()\\.|^\$[]/))
+         {
+             $regex = $orig if $literal;
+             push(@regex_tests, "(index(\$_, q\001$regex\001)>=0)");
+
+         } else {
+             #$regex =~ s!([\$\@\/]\w)!\\$1!g;
+             if ($words) {
+                 if ($regex =~ m/\|/) {
+                     ## could be dangerous -- see if we can wrap in parens.
+                     if ($regex =~ m/\\\d/) {
+                         warn "warning: -w and a | in a regex is dangerous.\n"
+                     } else {
+                         $regex = join($regex, '(', ')');
+                     }
+                 }
+                 $regex = join($regex, '\b', '\b');
+             }
+             $CAN_USE_FAST_LISTONLY = 0 if substr($regex, "[^") >= 0;
+             push(@regex_tests, "m'$regex'$iflag$mflag");
+         }
+
+         ## If we're done, but still have @extra to do, get set for that.
+         if (@ARGV == 0 && @extra) {
+             @ARGV = @extra;   ## now deal with the extra stuff.
+             $underlineOK = 0; ## but no more of this.
+             undef @extra;     ## or this.
+         }
+      }
+      if (@regex_tests) {
+         $REGEX_TEST = join('||', @regex_tests);
+         ## print STDERR $REGEX_TEST, "\n"; exit;
+      } else {
+         ## must be doing -find -- just give something syntactically correct.
+         $REGEX_TEST = 1;
+      }
+
+      if ($DOMARK) {
+         $MARK = join(';', @mark_commands);
+      }
+  }
+
+  ##
+  ## Make sure we can read the first item(s).
+  ##
+  foreach $start (@todo) {
+      $! = 2, die qq/$0: can\'t stat "$start"\n/
+         unless ($dev,$inode) = (stat($start))[$STAT_DEV,$STAT_INODE];
+
+      if (defined $dir_done{"$dev,$inode"}) {
+         ## ignore the repeat.
+         warn(qq/ignoring "$start" (same as "$dir_done{"$dev,$inode"}").\n/)
+               if $VERBOSE;
+         next;
+      }
+
+      ## if -xdev was given, remember the device.
+      $xdev{$dev} = 1 if $XDEV;
+
+      ## Note that we won't want to do it again
+      $dir_done{"$dev,$inode"} = $start;
+  }
+}
+
+
+##
+## See the comment above the __END__ above the 'sub dodir' below.
+##
+sub import_program
+{
+    sub bad {
+       print STDERR "$0: internal error (@_)\n";
+       exit 2;
+    }
+
+    ## Read from data, up to next __END__. This will be &dodir.
+    local($/) = "\n__END__";
+    $prog = <DATA>;
+    close(DATA);
+
+    ## Inline uppercase $-variables by their current values, removing
+    ## any preceeding eval if applicable
+    if ($] >= 5) {
+        eval '
+           $prog =~ s/(?:\beval\s*)?\$([A-Z][A-Z0-9_]{2,}\b)/
+             &bad($1) if !defined ${$main::{$1}}; ${$main::{$1}};/eg;
+        ';
+    } else {
+       $prog =~ s/(\beval\s*)?\$([A-Z][A-Z0-9_]{2,}\b)/local(*VAR) = $_main{$2};
+                   &bad($2) if !defined $VAR; $VAR;/eg;
+    }
+
+    eval $prog;  ## now do it. This will define &dodir;
+    $!=2, die "$0 internal error: $@\n" if $@;
+}
+
+###########################################################################
+
+##
+## Read the .search file:
+##    Blank lines and lines that are only #-comments ignored.
+##    Newlines may be escaped to create long lines
+##    Other lines are directives.
+##
+##    A directive may begin with an optional tag in the form <...>
+##    Things inside the <...> are evaluated as with:
+##        <(this || that) && must>
+##    will be true if
+##       -xmust -xthis   or   -xmust -xthat
+##    were specified on the command line (order doesn't matter, though)
+##    A directive is not done if there is a tag and it's false.
+##    Any characters but whitespace and &|()>,! may appear after an -x
+##    (although "-xdev" is special).  -xmust,this is the same as -xmust -xthis.
+##    Something like -x~ would make <~> true, and <!~> false.
+##
+##    Directives are in the form:
+##      filter: EXPR : "command"
+##      option: STRING
+##     magic : NUMBYTES : EXPR
+##
+##    With option:
+##      The STRING is parsed like a Bourne shell command line, and the
+##      options are used as if given on the command line.
+##      No comments are allowed on 'option' lines.
+##     Examples:
+##         # skip objects and libraries
+##         option: -skip '.o .a'
+##         # skip emacs *~ and *# files, unless -x~ given:
+##         <!~> option: -skip '~ #'
+##
+##    With magic:
+##     EXPR can be pretty much any perl (comments allowed!).
+##      If it evaluates to true for any particular file, it is skipped.
+##      The only info you'll have about a file is the variable $H, which
+##      will have at least the first NUMBYTES of the file (less if the file
+##      is shorter than that, of course, and maybe more). You'll also have
+##      any variables you set in previous 'magic' lines.
+##     Examples:
+##         magic: 6 : ($x6 = substr($H, 0, 6)) eq 'GIF87a'
+##         magic: 6 :  $x6                     eq 'GIF89a'
+##
+##          magic: 6 : (($x6 = substr($H, 0, 6)) eq 'GIF87a' ## old gif \
+##                                      || $x6  eq 'GIF89a' ## new gif
+##     (the above two sets are the same)
+##         ## Check the first 32 bytes for "binarish" looking bytes.
+##         ## Don't blindly dump on any high-bit set, as non-ASCII text
+##         ## often has them set. \x80 and \xff seem to be special, though.
+##         ## Require two in a row to not get things like perl's $^T.
+##         ## This is known to get *.Z, *.gz, pkzip, *.elc and about any
+##         ## executable you'll find.
+##         magic: 32 : $H =~ m/[\x00-\x06\x10-\x1a\x1c-\x1f\x80\xff]{2}/
+##
+sub read_rc
+{
+    local($file, $show) = @_;
+    local($line_num, $ln, $tag) = 0;
+    local($use_default, @default) = 0;
+
+    { package magic; $\17 = 0; } ## turn off warnings for when we run EXPR's
+
+    unless (open(RC, "$file")) {
+       $use_default=1;
+       $file = "<internal default startup file>";
+       ## no RC file -- use this default.
+       @default = split(/\n/,<<'--------INLINE_LITERAL_TEXT');
+            magic: 32 : $H =~ m/[\x00-\x06\x10-\x1a\x1c-\x1f\x80\xff]{2}/
+            filter: $N =~ m/\.(gz|Z)$/ : "zcat %"
+           option: -skip '.a .COM .elc .EXE .o .pbm .xbm .dvi'
+           option: -iskip '.tarz .zip .lzh .jpg .jpeg .gif .uu'
+           <!~> option: -skip '~ #'
+--------INLINE_LITERAL_TEXT
+    }
+
+    ##
+    ## Make an eval error pretty.
+    ##
+    sub clean_eval_error {
+       local($_) = @_;
+       s/ in file \(eval\) at line \d+,//g; ## perl4-style error
+       s/ at \(eval \d+\) line \d+,//g;     ## perl5-style error
+       s/\n[\x00-\xff]*//;                  ## remove all but first line
+       "$_\n";
+    }
+
+    print "reading RC file: $file\n" if $show;
+
+    while ($_ = ($use_default ? shift(@default) : <RC>)) {
+       $ln = ++$line_num;                           ## note starting line num.
+        $_ .= <RC>, $line_num++ while s/\\\n?$/\n/;  ## allow continuations
+       next if /^\s*(#.*)?$/;          ## skip blank or comment-only lines.
+        $do = '';
+       
+       ## look for an initial <...> tag.
+       if (s/^\s*<([^>]*)>//) {
+           ## This simple s// will make the tag ready to eval.
+           ($tag = $msg = $1) =~
+               s/([^\s&|(!)]+)/
+                       $seen_opt{$1}=1;         ## note seen option
+                       "defined(\$opt{q>$1>})"  ## (q>> is safe quoting here)
+               /eg;
+           
+           ## see if the tag is true or not, abort this line if not.
+           $dothis = (eval $tag);
+           $!=2, die "$file $ln <$msg>: $_".&clean_eval_error($@) if $@;
+
+           if ($show) {
+               $msg =~ s/([^\s&|(!)]+)/-x$1/;
+               $msg =~ s/\s*!\s*/ no /g;
+               $msg =~ s/\s*&&\s*/ and /g;
+               $msg =~ s/\s*\|\|\s*/ or /g;
+               $msg =~ s/^\s+//; $msg =~ s/\s+$//;
+               $do = $dothis ? "(doing because $msg)" :
+                               "(do if $msg)";
+           } elsif (!$dothis) {
+               next;
+           }
+       }
+
+       if (m/^\s*filter\s*:(.*):\s*"(.*)\s*"\s*$/) {
+           local($expr, $cmd) = ($1, $2);
+           eval "local(\$^W) = 0; $expr; 1";
+           die "$file $ln: ".&clean_eval_error($@) if $@;
+           $filter_cmd{$expr} = $cmd;
+           next;
+       }
+
+       if (m/^\s*option\s*:\s*(.*)/) {
+           next if $all && !$show; ## -all turns off these checks;
+           local($_) = $1;
+            s/\n$//;
+           local($orig) = $_;
+           print " $do option: $_\n" if $show;
+           local($0) = "$0 ($file)"; ## for any error message.
+           local(@ARGV);
+           local($this);
+           ##
+           ## Parse $_ as a Bourne shell line -- fill @ARGV
+           ##
+           while (length) {
+               if (s/^\s+//) {
+                   push(@ARGV, $this) if defined $this;
+                   undef $this;
+                   next;
+               }
+               $this = '' if !defined $this;
+               $this .= $1 while s/^\'([^\']*)\'// ||
+                                 s/^\"([^\"]*)\"// ||
+                                 s/^([^\'\"\s\\]+)//||
+                                 s/^(\\[\D\d])//;
+               die "$file $ln: error parsing $orig at $_\n" if m/^\S/;
+           }
+           push(@ARGV, $this) if defined $this;
+           &check_args;
+           die qq/$file $ln: unused arg "@ARGV".\n/ if @ARGV;
+           next;
+       }
+
+       if (m/^\s*magic\s*:\s*(\d+)\s*:\s*(.*)/) {
+           next if $all && !$show; ## -all turns off these checks;
+           local($bytes, $check) = ($1, $2);
+
+           if ($show) {
+               $check =~ s/\n?$/\n/;
+               print " $do contents: $check";
+           }
+           ## Check to make sure the thing at least compiles.
+           eval  "package magic; (\$H = '1'x \$main'bytes) && (\n$check\n)\n";
+           $! = 2, die "$file $ln: ".&clean_eval_error($@) if $@;
+
+           $HEADER_BYTES = $bytes if $bytes > $HEADER_BYTES;
+           push(@magic_tests, "(\n$check\n)");
+           next;
+       }
+       $! = 2, die "$file $ln: unknown command\n";
+    }
+    close(RC);
+}
+
+sub message
+{
+    if (!$STDERR_IS_TTY) {
+       print STDERR $_[0], "\n";
+    } else {
+       local($text) = @_;
+       $thislength = length($text);
+       if ($thislength >= $last_message_length) {
+           print STDERR $text, "\r";
+       } else {
+           print STDERR $text, ' 'x ($last_message_length-$thislength),"\r";
+       }       
+       $last_message_length = $thislength;
+    }
+}
+
+sub clear_message
+{
+    print STDERR ' ' x $last_message_length, "\r" if $last_message_length;
+    $vv_print = $vv_size = $last_message_length = 0;
+}
+
+##
+## Output a copy of this program with comments, extra whitespace, and
+## the trailing man page removed. On an ultra slow machine, such a copy
+## might load faster (but I can't tell any difference on my machine).
+##
+sub strip {
+    seek(DATA, 0, 0) || die "$0: can't reset internal pointer.\n";
+    while(<DATA>) {
+      print, next if /INLINE_LITERAL_TEXT/.../INLINE_LITERAL_TEXT/;
+      ## must mention INLINE_LITERAL_TEXT on this line!
+      s/\#\#.*|^\s+|\s+$//; ## remove cruft
+      last if $_ eq '.00';
+      next if ($_ eq '') || ($_ eq "'di'") || ($_ eq "'ig00'");
+      s/\$stripped=0;/\$stripped=1;/;
+      s/\s\s+/ /;  ## squish multiple whitespaces down to one.
+      print $_, "\n";
+    }
+    exit(0);
+}
+
+##
+## Just to shut up -w. Never executed.
+##
+sub dummy {
+
+    1 || &dummy || &dir_done || &bad || &message || $NEXT_DIR_ENTRY ||
+    $VV_SIZE || $VV_PRINT_COUNT || $STDERR_SCREWS_STDOUT || @files ||
+    @files || $magic'H || $magic'H || $magic'val || $magic'val ||
+    $filter_cmd{1} || $xdev{''} || $MARK;
+
+}
+
+##
+## If the following __END__ is in place, what follows will be
+## inlined when the program first starts up. Any $ variable name
+## all in upper case, specifically, any string matching
+##     \$([A-Z][A-Z0-9_]{2,}\b
+## will have the true value for that variable inlined. Also, any 'eval'
+## immediately preceeding one of the inlined variables is removed.
+## 
+##
+## The idea is that when the whole thing is then eval'ed to define &dodir,
+## the perl optimizer will make all the decisions that are based upon
+## command-line options (such as $VERBOSE), since they'll be inlined as
+## constants
+##
+## Also, and here's the big win, the tests for matching the regex, and a
+## few others, are all inlined. Should be blinding speed here.
+##
+## See the read from <DATA> above for where all this takes place.
+## But all-in-all, you *want* the __END__ here. Comment it out only for
+## debugging....
+##
+
+__END__
+
+##
+## Given a directory, check all "appropriate" files in it.
+## Shove any subdirectories into the global @todo, so they'll be done
+## later.
+##
+## Be careful about adding any upper-case variables, as they are subject
+## to being inlined. See comments above the __END__ above.
+##
+sub dodir
+{
+  local($dir) = @_;
+  $dir =~ s,/+$,,; ## remove any trailing slash.
+  unless (opendir(DIR, "$dir/.")) {
+      &clear_message if $VERBOSE && $STDERR_SCREWS_STDOUT;
+      warn qq($0: can\'t opendir "$dir/".\n);
+      return;
+  }
+
+  if ($VERBOSE) {
+      &message($dir);
+      $vv_print = $vv_size = 0;
+  }
+
+  @files = sort readdir(DIR) if $DO_SORT;
+
+  while (defined($name = eval $NEXT_DIR_ENTRY))
+  {
+    next if $name eq '.' || $name eq '..'; ## never follow these.
+
+    ## create full relative pathname.
+    $file = $dir eq '.' ? $name : "$dir/$name";
+
+    ## if link and skipping them, do so.
+    if ($NOLINKS && -l $file) {
+       warn qq/skip (symlink): $file\n/ if $WHY;
+       next;
+    }
+
+    ## skip things unless files or directories
+    unless (-f $file || -d _) {
+       if ($WHY) {
+           $why = (-S _ && "socket")       ||
+                  (-p _ && "pipe")         ||
+                  (-b _ && "block special")||
+                  (-c _ && "char special") || "somekinda special";
+           warn qq/skip ($why): $file\n/;
+       }
+       next;
+    }
+
+    ## skip things we can't read
+    unless (-r _) {
+       if ($WHY) {
+           $why = (-l $file) ? "follow" : "read";
+           warn qq/skip (can\'t $why): $file\n/;
+       }
+       next;
+    }
+
+    ## skip things that are empty
+    if (!$WINDOWS) {            # -s fails for all dirs under Windows
+                                # or should we just put the -d test before this?
+        unless (-s _) {
+            warn qq/skip (empty): $file\n/ if $WHY;
+            next;
+        }
+    }
+
+    ## Note file device & inode. If -xdev, skip if appropriate.
+    ($dev, $inode) = (stat(_))[$STAT_DEV, $STAT_INODE];
+    if ($XDEV && defined $xdev{$dev}) {
+       warn qq/skip (other device): $file\n/ if $WHY;
+       next;
+    }
+    $id = "$dev,$inode" if $USE_INODES;
+
+    ## special work for a directory
+    if (-d _) {
+       if ($DESCEND_SUBDIRECTORIES == 0) {
+           warn qq/skip (-depth): $file\n/ if $WHY;
+           next;
+       }
+
+       ## Do checks for directory file endings.
+       if ($DO_DSKIP_TEST && (eval $DSKIP_TEST)) {
+           warn qq/skip (-dskip): $file\n/ if $WHY;
+           next;
+       }
+       ## do checks for -name/-regex/-path tests
+       if ($DO_DGLOB_TESTS && !(eval $DGLOB_TESTS)) {
+           warn qq/skip (dirname): $file\n/ if $WHY;
+           next;
+       }
+
+        if ($USE_INODES)
+        {
+            ## _never_ redo a directory
+            if (defined $dir_done{$id}) {
+                warn qq/skip (did as "$dir_done{$id}"): $file\n/ if $WHY;
+                next;
+            }
+            $dir_done{$id} = $file;     ## mark it done.
+        }
+       unshift(@todo, $file);      ## add to the list to do.
+       next;
+    }
+    if ($WHY == 0  && $VERBOSE > 1) {
+      if ($VERBOSE>2||$vv_print++>$VV_PRINT_COUNT||($vv_size+=-s _)>$VV_SIZE){
+         &message($file);
+         $vv_print = $vv_size = 0;
+      }
+    }
+
+    ## do time-related tests
+    if ($NEWER || $OLDER) {
+       $_ = (stat(_))[$STAT_MTIME];
+       if ($NEWER && $_ < $NEWER) {
+           warn qq/skip (too old): $file\n/ if $WHY;
+           next;
+       }
+       if ($OLDER && $_ > $OLDER) {
+           warn qq/skip (too new): $file\n/ if $WHY;
+           next;
+       }
+    }
+
+    ## do checks for file endings
+    if ($DO_SKIP_TEST && (eval $SKIP_TEST)) {
+       warn qq/skip (-skip): $file\n/ if $WHY;
+       next;
+    }
+
+    ## do checks for -name/-regex/-path tests
+    if ($DO_GLOB_TESTS && !(eval $GLOB_TESTS)) {
+       warn qq/skip (filename): $file\n/ if $WHY;
+       next;
+    }
+
+
+    ## If we're not repeating files,
+    ## skip this one if we've done it, or note we're doing it.
+    unless ($DOREP) {
+       if (defined $file_done{$id}) {
+           warn qq/skip (did as "$file_done{$id}"): $file\n/ if $WHY;
+           next;
+       }
+       $file_done{$id} = $file;
+    }
+
+    undef $filter;
+    foreach $expr (keys %filter_cmd) {
+       next unless eval "{ package filter; \$N = \$main'file; { $expr }}";
+       $filter = $filter_cmd{$expr};
+       $filter .= " $file" unless $filter =~ s/%/$file/g;
+       last;
+    }
+
+    if ($DO_MAGIC_TESTS && !$filter) {
+       if (!open(FILE_IN, $file)) {
+           &clear_message if $VERBOSE && $STDERR_SCREWS_STDOUT;
+           warn qq/$0: can\'t open: $file\n/;
+           next;
+       }
+       unless (read(FILE_IN, $magic'H, $HEADER_BYTES)) {#'
+           &clear_message if $VERBOSE && $STDERR_SCREWS_STDOUT;
+           warn qq/$0: can\'t read from "$file"\n/;
+           close(FILE_IN);
+           next;
+       }
+
+       eval $MAGIC_TESTS;
+       if ($magic'val) {#'
+           close(FILE_IN);
+           warn qq/skip (magic): $file\n/ if $WHY;
+           next;
+       }
+       seek(FILE_IN, 0, 0);  ## reset for later <FILE_IN>
+    }
+
+    if ($WHY != 0  && $VERBOSE > 1) {
+      if ($VERBOSE>2||$vv_print++>$VV_PRINT_COUNT||($vv_size+=-s _)>$VV_SIZE){
+         &message($file);
+         $vv_print = $vv_size = 0;
+      }
+    }
+
+
+    if ($FIND_ONLY) {
+       &clear_message if $VERBOSE && $STDERR_SCREWS_STDOUT;
+       print $file, "\n";
+       $retval=0; ## we've found something
+       close(FILE_IN) if $DO_MAGIC_TESTS;
+       next;
+    } else {
+       ## if we weren't doing magic tests, file won't be open yet...
+       if ($filter) {
+           if (!open(FILE_IN, "$filter|")) {
+               &clear_message if $VERBOSE && $STDERR_SCREWS_STDOUT;
+               warn qq/$0: can\'t open filter: $filter\n/;
+               next;
+           }
+       }elsif (!$DO_MAGIC_TESTS && !open(FILE_IN, $file)) {
+           &clear_message if $VERBOSE && $STDERR_SCREWS_STDOUT;
+           warn qq/$0: can\'t open: $file\n/;
+           next;
+       }
+       if ($LIST_ONLY && $CAN_USE_FAST_LISTONLY) {
+           ##
+           ## This is rather complex, but buys us a LOT when we're just
+           ## listing files and not the individual internal lines.
+           ##
+           local($size) = 4096;  ## block-size in which to do reads
+           local($nl);           ## will point to $_'s ending newline.
+           local($read);         ## will be how many bytes read.
+           local($_) = '';       ## Starts out empty
+           local($hold);         ## (see below)
+
+           while (($read = read(FILE_IN,$_,$size,length($_)))||length($_))
+           {
+               undef @parts;
+               ## if read a full block, but no newline, need to read more.
+               while ($read == $size && ($nl = rindex($_, "\n")) < 0) {
+                   push(@parts, $_);                    ## save that part
+                   $read = read(FILE_IN, $_, $size); ## keep trying
+               }
+
+               ##
+               ## If we had to save parts, must now combine them together.
+               ## adjusting $nl to reflect the now-larger $_. This should
+               ## be a lot more efficient than using any kind of .= in the
+               ## loop above.
+               ##
+               if (@parts) {
+                   local($lastlen) = length($_); #only need if $nl >= 0
+                   $_ = join('', @parts, $_);
+                   $nl = length($_) - ($lastlen - $nl) if $nl >= 0;
+               }
+
+               ##
+               ## If we're at the end of the file, then we can use $_ as
+               ## is.  Otherwise, we need to remove the final partial-line
+               ## and save it so that it'll be at the beginning of the
+               ## next read (where the rest of the line will be layed in
+               ## right after it).  $hold will be what we should save
+               ## until next time.
+               ##
+               if ($read != $size || $nl < 0) {
+                   $hold = '';
+               } else {
+                   $hold = substr($_, $nl + 1);
+                   substr($_, $nl + 1) = '';
+               }
+
+               ##
+               ## Now have a bunch of full lines in $_. Use it.
+               ##
+               if (eval $REGEX_TEST) {
+                   &clear_message if $VERBOSE && $STDERR_SCREWS_STDOUT;
+                   print $file, "\n";
+                   $retval=0; ## we've found something
+
+                   last;
+               }
+
+               ## Prepare for next read....
+               $_ = $hold;
+           }
+
+       } else {  ## else not using faster block scanning.....
+
+            $lines_printed = 0 if $NICE;
+           while (<FILE_IN>) {
+               study;
+               next unless (eval $REGEX_TEST);
+
+               ##
+               ## We found a matching line.
+               ##
+               $retval=0;
+               &clear_message if $VERBOSE && $STDERR_SCREWS_STDOUT;
+               if ($LIST_ONLY) {
+                   print $file, "\n";
+                   last;
+               } else {
+                   ## prepare to print line.
+                   if ($NICE && $lines_printed++ == 0) {
+                       print '-' x 70, "\n" if $NICE > 1;
+                       print $file, ":\n";
+                   }
+
+                   ##
+                   ## Print all the prelim stuff. This looks less efficient
+                   ## than it needs to be, but that's so that when the eval
+                   ## is compiled (and the tests are optimized away), the
+                   ## result will be less actual PRINTs than the more natural
+                   ## way of doing these tests....
+                   ##
+                   if ($NICE) {
+                       if ($REPORT_LINENUM) {
+                           print " line $.:  ";
+                       } else {
+                           print "  ";
+                       }
+                   } elsif ($REPORT_LINENUM && $PREPEND_FILENAME) {
+                       print "$file:$.: ";
+                   } elsif ($PREPEND_FILENAME) {
+                       print "$file: ";
+                   } elsif ($REPORT_LINENUM) {
+                       print "$.: ";
+                   }
+                   if ($DOMARK) { eval $MARK; }
+                   print $_;
+                   print "\n" unless m/\n$/;
+               }
+           }
+           print "\n" if ($NICE > 1) && $lines_printed;
+       }
+       close(FILE_IN);
+    }
+  }
+  closedir(DIR);
+}
+
+__END__
+.00
+
+'di
+.nr nl 0-1             \" fake up transition to first page again
+.nr % 0                        \" start at page 1
+.\"__________________NORMAL_MAN_PAGE_BELOW_________________
+.ll +10n
+.TH search 1 "Dec 17, 1994"
+.SH SEARCH
+search \- search files (a'la grep) in a whole directory tree.
+.SH SYNOPSIS
+search [ grep-like and find-like options] [regex ....]
+.SH DESCRIPTION
+.I Search
+is more or less a combo of 'find' and 'grep' (although the regular
+expression flavor is that of the perl being used, which is closer to
+egrep's than grep's).
+
+.I Search
+does generally the same kind of thing that
+.nf
+   find <blah blah> | xargs egrep <blah blah>
+.fi
+does, but is
+.I much
+more powerful and efficient (and intuitive, I think).
+
+This manual describes
+.I search
+as of version "960325.7".
+You can always find the latest version at
+.nf
+   http://www.wg.omron.co.jp/~jfriedl/perl/index.html
+.fi
+
+.SH "QUICK EXAMPLE"
+Basic use is simple:
+.nf
+    % search jeff
+.fi
+will search files in the current directory, and all sub directories, for
+files that have "jeff" in them. The lines will be listed with the
+containing file's name prepended.
+.PP
+If you list more than one regex, such as with
+.nf
+    % search jeff Larry Randal+ 'Stoc?k' 'C.*son'
+.fi
+then a line containing any of the regexes will be listed.
+This makes it effectively the same as
+.nf
+    % search 'jeff|Larry|Randal+|Stoc?k|C.*son'
+.fi
+However, listing them separately is much more efficient (and is easier
+to type).
+.PP
+Note that in the case of these examples, the
+.B \-w
+(list whole-words only) option would be useful.
+And if your terminal supports ANSI escape sequences, you can use
+.B \-bold
+to higlight the items found. Furthermore, if your display supports
+color as well, you can use
+.BR \-red ,
+.BR \-green ,
+.BR \-yellow ,
+etc. instead to have the searched items marked with the given color.
+.PP
+Normally, various kinds of files are automatically removed from consideration.
+If it has has a certain ending (such as ".tar", ".Z", ".o", .etc), or if
+the beginning of the file looks like a binary, it'll be excluded.
+You can control exactly how this works -- see below. One quick way to
+override this is to use the
+.B \-all
+option, which means to consider all the files that would normally be
+automatically excluded.
+Or, if you're curious, you can use
+.B \-why
+to have notes about what files are skipped (and why) printed to stderr.
+
+.SH "BASIC OVERVIEW"
+Normally, the search starts in the current directory, considering files in
+all subdirectories.
+
+You can use the
+.I ~/.search
+file to control ways to automatically exclude files.
+If you don't have this file, a default one will kick in, which automatically
+add
+.nf
+    -skip .o .Z .gif
+.fi
+(among others) to exclude those kinds of files (which you probably want to
+skip when searching for text, as is normal).
+Files that look to be be binary will also be excluded.
+
+Files ending with "#" and "~" will also be excluded unless the
+.B -x~
+option is given. 
+
+You can use
+.B -showrc
+to show what kinds of files will normally be skipped.
+See the section on the startup file
+for more info.
+
+You can use the
+.B -all
+option to indicate you want to consider all files that would otherwise be
+skipped by the startup file.
+
+Based upon various other flags (see "WHICH FILES TO CONSIDER" below),
+more files might be removed from consideration. For example
+.nf
+    -mtime 3
+.fi
+will exclude files that aren't at least three days old (change the 3 to -3
+to exclude files that are more than three days old), while
+.nf
+    -skip .*
+.fi
+would exclude any file beginning with a dot (of course, '.' and '..'  are
+special and always excluded).
+
+If you'd like to see what files are being excluded, and why, you can get the
+list via the
+.B \-why
+option.
+
+If a file makes it past all the checks, it is then "considered".
+This usually means it is greped for the regular expressions you gave
+on the command line.
+
+If any of the regexes match a line, the line is printed.
+However, if
+.B -list
+is given, just the filename is printed. Or, if
+.B -nice
+is given, a somewhat more (human-)readable output is generated.
+
+If you're searching a huge tree and want to keep informed about how
+the search is progressing,
+.B -v
+will print (to stderr) the current directory being searched.
+Using
+.B -vv
+will also print the current file "every so often", which could be useful
+if a directory is huge. Using
+.B -vvv
+will print the update with every file.
+
+Below is the full listing of options.
+
+.SH "OPTIONS TELLING *WHERE* TO SEARCH"
+.TP
+.BI -dir " DIR"
+Start searching at the named directory instead of the current directory.
+If multiple
+.B -dir
+arguments are given, multiple trees will be searched.
+.TP
+.BI -ddir " DIR"
+Like
+.B -dir
+except it flushes any previous
+.B -dir
+directories (i.e. "-dir A -dir B -dir C" will search A, B, and C, while
+"-dir A -ddir B -dir C" will search only B and C. This might be of use
+in the startup file (see that section below).
+.TP
+.B -xdev
+Stay on the same filesystem as the starting directory/directories.
+.TP
+.B -sort
+Sort the items in a directory before processing them.
+Normally they are processed in whatever order they happen to be read from
+the directory.
+.TP
+.B -nolinks
+Don't follow symbolic links. Normally they're followed.
+.TP
+.B -depth=0
+Don't descend into subdirectories. Only a depth of 0 currently supported.
+.SH "OPTIONS CONTROLLING WHICH FILES TO CONSIDER AND EXCLUDE"
+.TP
+.BI -mtime " NUM"
+Only consider files that were last changed more than
+.I NUM
+days ago
+(less than
+.I NUM
+days if
+.I NUM
+has '-' prepended, i.e. "-mtime -2.5" means to consider files that
+have been changed in the last two and a half days).
+.TP
+.B -older FILE
+Only consider files that have not changed since
+.I FILE
+was last changed.
+If there is any upper case in the "-older", "or equal" is added to the sense
+of the test.  Therefore, "search -older ./file regex" will never consider
+"./file", while "search -Older ./file regex" will.
+
+If a file is a symbolic link, the time used is that of the file and not the
+link.
+.TP
+.BI -newer " FILE"
+Opposite of
+.BR -older .
+.TP
+.BI -name " GLOB"
+Only consider files that match the shell filename pattern
+.IR GLOB .
+The check is only done on a file's name (use
+.B -path
+to check the whole path, and use
+.B -dname
+to check directory names).
+
+Multiple specifications can be given by separating them with spaces, a'la
+.nf
+    -name '*.c *.h'
+.fi
+to consider C source and header files.
+If
+.I GLOB
+doesn't contain any special pattern characters, a '*' is prepended.
+This last example could have been given as
+.nf
+   -name '.c .h'
+.fi
+It could also be given as
+.nf
+    -name .c -name .h
+.fi
+or
+.nf
+    -name '*.c' -name '*.h'
+.fi
+or
+.nf
+    -name '*.[ch]'
+.fi
+(among others)
+but in this last case, you have to be sure to supply the leading '*'.
+.TP
+.BI -path " GLOB"
+Like
+.B -name
+except the entire path is checked against the pattern.
+.TP
+.B -regex " REGEX"
+Considers files whose names (not paths) match the given perl regex
+exactly.
+.TP
+.BI -iname " GLOB"
+Case-insensitive version of
+.BR -name .
+.TP
+.BI -ipath " GLOB"
+Case-insensitive version of
+.BR -path .
+.TP
+.BI -iregex " REGEX"
+Case-insensitive version of
+.BR -regex .
+
+.TP
+.BI -dpath " GLOB"
+Only search down directories whose path matches the given pattern (this
+doesn't apply to the initial directory given by
+.BI -dir ,
+of course).
+Something like
+.nf
+    -dir /usr/man -dpath /usr/man/man*
+.fi
+would completely skip
+"/usr/man/cat1", "/usr/man/cat2", etc.
+.TP
+.BI -dskip " GLOB"
+Skips directories whose name (not path) matches the given pattern.
+Something like
+.nf
+    -dir /usr/man -dskip cat*
+.fi
+would completely skip any directory in the tree whose name begins with "cat"
+(including "/usr/man/cat1", "/usr/man/cat2", etc.).
+.TP
+.BI -dregex " REGEX"
+Like
+.BI -dpath ,
+but the pattern is a full perl regex. Note that this quite different
+from
+.B -regex
+which considers only file names (not paths). This option considers
+full directory paths (not just names). It's much more useful this way.
+Sorry if it's confusing.
+.TP
+.BI -dpath " GLOB"
+This option exists, but is probably not very useful. It probably wants to
+be like the '-below' or something I mention in the "TODO" section.
+.TP
+.BI -idpath " GLOB"
+Case-insensitive version of
+.BR -dpath .
+.TP
+.BI -idskip " GLOB"
+Case-insensitive version of
+.BR -dskip .
+.TP
+.BI -idregex " REGEX"
+Case-insensitive version of
+.BR -dregex .
+.TP
+.B -all
+Ignore any 'magic' or 'option' lines in the startup file.
+The effect is that all files that would otherwise be automatically
+excluded are considered.
+.TP
+.BI -x SPECIAL
+Arguments starting with
+.B -x
+(except
+.BR -xdev ,
+explained elsewhere) do special interaction with the
+.I ~/.search
+startup file. Something like
+.nf
+       -xflag1 -xflag2
+.fi
+will turn on "flag1" and "flag2" in the startup file (and is
+the same as "-xflag1,flag2"). You can use this to write your own
+rules for what kinds of files are to be considered.
+
+For example, the internal-default startup file contains the line
+.nf
+       <!~> option: -skip '~ #'
+.fi
+This means that if the
+.B -x~
+flag is
+.I not
+seen, the option
+.nf
+    -skip '~ #'
+.fi
+should be done.
+The effect is that emacs temp and backup files are not normally
+considered, but you can included them with the -x~ flag.
+
+You can write your own rules to customize
+.I search
+in powerful ways. See the STARTUP FILE section below.
+.TP
+.B -why
+Print a message (to stderr) when and why a file is not considered.
+
+.SH "OPTIONS TELLING WHAT TO DO WITH FILES THAT WILL BE CONSIDERED"
+.TP
+\fB-find\fP or \fB-b\fP
+This option changes the basic action of
+.IR search .
+
+Normally, if a file is considered, it is searched
+for the regular expressions as described earlier. However, if this option
+is given, the filename is printed and no searching takes place. This turns
+.I search
+into a 'find' of some sorts.
+
+In this case, no regular expressions are needed on the command line
+(any that are there are silently ignored).
+
+This is not intended to be a replacement for the 'find' program,
+but to aid
+you in understanding just what files are getting past the exclusion checks.
+If you really want to use it as a sort of replacement for the 'find' program,
+you might want to use
+.B -all
+so that it doesn't waste time checking to see if the file is binary, etc
+(unless you really want that, of course).
+
+If you use
+.BR -find ,
+none of the "GREP-LIKE OPTIONS" (below) matter.
+
+As a replacement for 'find',
+.I search
+is probably a bit slower (or in the case of GNU find, a lot slower --
+GNU find is
+.I unbelievably
+fast).
+However, "search -ffind"
+might be more useful than 'find' when options such as
+.B -skip
+are used (at least until 'find' gets such functionality).
+.TP
+\fB-ffind\fP or \fB-ff\fP
+A faster more 'find'-like find. Does
+.nf
+    -find  -all -dorep
+.fi
+.SH "GREP-LIKE OPTIONS"
+These options control how a searched file is accessed,
+and how things are printed.
+.TP
+\fB-F\fP or \fB-lit\fP
+Causes arguments to be taken as literal text rather than as perl regular
+expressions.
+.TP
+\fB-R\fP or \fB-regex\fP
+Undoes
+.BR -T .
+Regex arguments are indeed taken as perl regular expressions.
+.TP
+.B -i
+Ignore letter case when matching.
+.TP
+.B -noi
+Don't ignore letter case when matching (useful for overriding a
+.B -i
+in the startup file)
+.TP
+.B -w
+Consider only whole-word matches ("whole word" as defined by perl's "\\b"
+regex).
+.TP
+.B -u
+If the regex(es) is/are simple, try to modify them so that they'll work
+in manpage-like underlined text (i.e. like _^Ht_^Hh_^Hi_^Hs).
+This is very rudimentary at the moment.
+.TP
+\fB-list\fP or \fB-l\fP
+.B -list
+Don't print matching lines, but the names of files that contain matching
+lines. This will likely be *much* faster, as special optimizations are
+made -- particularly with large files.
+.TP
+.B -n
+Pepfix each line by its line number.
+.TP
+.B -nice
+Not a grep-like option, but similar to
+.BR -list ,
+so included here.
+.B -nice
+will have the output be a bit more human-readable, with matching lines printed
+slightly indented after the filename, a'la
+.nf
+
+   % search foo
+   somedir/somefile: line with foo in it
+   somedir/somefile: some food for thought
+   anotherdir/x: don't be a buffoon!
+   %
+
+.fi
+will become
+.nf
+
+   % search -nice foo
+   somedir/somefile:
+     line with foo in it
+     some food for thought
+   anotherdir/x:
+     don't be a buffoon!
+   %
+
+.fi
+This option due to Lionel Cons.
+.TP
+.B -nnice
+Be a bit nicer than
+.BR -nice .
+Prefix each file's output by a rule line, and follow with an extra blank line.
+.TP
+.B -h
+Don't prepend each output line with the name of the file
+(meaningless when
+.B -find
+or
+.B -l
+are given).
+
+.SH "OPTIONS WHICH INDICATE HOW TO DISPLAY"
+In addition to the
+.B \-nice
+and
+.B \-nnice
+from just above, you can use the following if your display supports
+ANSI escape sequences (most systems seem to).
+.TP
+.B \-bold
+Show the found items in reverse video.
+.TP
+.B \-red
+Show the found items in red.
+.TP
+.B \-green
+Show the found items in green.
+.TP
+.B \-yellow
+Show the found items in yellow.
+.TP
+.B \-blue
+Show the found items in blue.
+.TP
+.B \-cyan
+Show the found items in cyan.
+.TP
+.B \-white
+Show the found items in white.
+.TP
+.B \-black
+Show the found items in black.
+
+.SH "OTHER OPTIONS"
+.TP
+.B -help
+Print the usage information.
+.TP
+.B -version
+Print the version information and quit.
+.TP
+.B -v
+Set the level of message verbosity.
+.B -v
+will print a note whenever a new directory is entered.
+.B -vv
+will also print a note "every so often". This can be useful to see
+what's happening when searching huge directories.
+.B -vvv
+will print a new with every file.
+.B -vvvv
+is
+-vvv
+plus
+.BR -why .
+.TP
+.B -e
+This ends the options, and can be useful if the regex begins with '-'.
+.TP
+.B -showrc
+Shows what is being considered in the startup file, then exits.
+.TP
+.B -dorep
+Normally, an identical file won't be checked twice (even with multiple
+hard or symbolic links). If you're just trying to do a fast
+.BR -find ,
+the bookkeeping to remember which files have been seen is not desirable,
+so you can eliminate the bookkeeping with this flag.
+
+.SH "STARTUP FILE"
+When
+.I search
+starts up, it processes the directives in
+.IR ~/.search .
+If no such file exists, a default
+internal version is used.
+
+The internal version looks like:
+.nf
+
+   magic: 32 : $H =~ m/[\ex00-\ex06\ex10-\ex1a\ex1c-\ex1f\ex80\exff]{2}/
+   filter: $N =~ m/\.(gz|Z)$/ : "zcat %"
+   option: -skip '.a .COM .elc .EXE .o .pbm .xbm .dvi'
+   option: -iskip '.tarz .zip .lzh .jpg .jpeg .gif .uu'
+   <!~> option: -skip '~ #'
+
+.fi
+If you wish to create your own "~/.search",
+you might consider copying the above, and then working from there.
+
+There are three kinds of directives in a startup file: "filter", "magic"
+and "option".
+
+.RS 0n
+.TP
+OPTION
+Option lines will automatically do the command-line options given.
+For example, the line
+.nf
+    option: -v
+.fi
+in you startup file will turn on -v every time, without needing to type it
+on the command line.
+
+The text on the line after the "option:" directive is processed
+like the Bourne shell, so make sure to pay attention to quoting.
+.nf
+    option: -skip .exe .com
+.fi
+will give an error (".com" by itself isn't a valid option), while
+.nf
+    option: -skip ".exe .com"
+.fi
+will properly include it as part of -skip's argument.
+
+.TP
+MAGIC
+Magic lines are used to determine if a file should be considered a binary
+or not (the term "magic" refers to checking a file's magic number).  These
+are described in more detail below.
+
+.TP
+FILTER
+Filter lines are used to apply a command to a file to get the text to search.
+The format of a
+.B FILTER
+line is:
+.nf
+    filter : EXPRESSION: "command...."
+.fi
+where
+.I EXPRESSION
+is a perl expression used to determine if the filter should be applied to a
+given file (the file's name will be in the variable $N, but remember that
+files excluded via
+.BR -skip ,
+etc., won't even be considered for a filter). If true, the
+.I COMMAND
+will be executed and its standard-output will be checked. ``\fB%\fP'' in the
+command string will be replace by the filename.
+
+The most common example would be to uncompress a file on the fly, i.e.
+.nf
+   filter: $N =~ m/\.(gz|Z)$/ : "zcat %"
+.fi
+Note that had the ``\fBzcat\fP'' been ``\fBgunzip\fP'' instead, you'd
+uncompress your files in place instead of searching them, so take care when
+specifying a filter! If you're worried about mixing up GNU'z zcat with
+an old one, you might use seperate ones as with:
+.nf
+   filter: $N =~ m/\.gz$/ : "/my/GNU/binaries/zcat %"
+   filter: $N =~ m/\.Z$/ : "/the/non-GNU/binaries/zcat %"
+.fi 
+
+Also note that when a filter is applied, the
+.B MAGIC
+section is ignored for the file (this can be considered a bug, so it might
+change in the future).
+
+.RE
+
+Blank lines and comments (lines beginning with '#') are allowed.
+
+If a line begins with  <...>, then it's a check to see if the
+directive on the line should be done or not. The stuff inside the <...>
+can contain perl's && (and), || (or), ! (not), and parens for grouping,
+along with "flags" that might be indicated by the user with
+.BI -x flag
+options.
+
+For example, using "-xfoo" will cause "foo" to be true inside the <...>
+blocks. Therefore, a line beginning with "<foo>" would be done only when
+"-xfoo" had been specified, while a line beginning with "<!foo>" would be
+done only when "-xfoo" is not specified (of course, a line without any <...>
+is done in either case).
+
+A realistic example might be
+.nf
+       <!v> -vv
+.fi
+This will cause -vv messages to be the default, but allow "-xv" to override.
+
+There are a few flags that are set automatically:
+.RS
+.TP
+.B TTY
+true if the output is to the screen (as opposed to being redirected to a file).
+You can force this (as with all the other automatic flags) with -xTTY.
+.TP
+.B -v
+True if -v was specified. If -vv was specified, both 
+.B -v
+and
+.B -vv
+flags are true (and so on).
+.TP
+.B -nice
+True if -nice was specified. Same thing about -nnice as for -vv.
+.PP
+.TP
+.B -list
+true if -list (or -l) was given.
+.TP
+.B -dir
+true if -dir was given.
+.RE
+
+Using this info, you might change the last example to
+.nf
+
+    <!v && !-v> option: -vv
+
+.fi
+The added "&& !-v" means "and if the '-v' option not given".
+This will allow you to use "-v" alone on the command line, and not
+have this directive add the more verbose "-vv" automatically.
+
+.RS 0
+Some other examples:
+.TP
+<!-dir && !here> option: -dir ~/
+Effectively make the default directory your home directory (instead of the
+current directory). Using -dir or -xhere will undo this.
+.TP
+<tex> option: -name .tex -dir ~/pub
+Create '-xtex' to search only "*.tex" files in your ~/pub directory tree.
+Actually, this could be made a bit better. If you combine '-xtex' and '-dir'
+on the command line, this directive will add ~/pub to the list, when you
+probably want to use the -dir directory only. You could do
+.nf
+
+   <tex> option: -name .tex
+   <tex && !-dir> option: -dir ~/pub
+.fi
+
+to will allow '-xtex' to work as before, but allow a command-line "-dir"
+to take precedence with respect to ~/pub.
+.TP
+<fluff> option: -nnice -sort -i -vvv
+Combine a few user-friendly options into one '-xfluff' option.
+.TP
+<man> option: -ddir /usr/man -v -w
+When the '-xman' option is given, search "/usr/man" for whole-words
+(of whatever regex or regexes are given on the command line), with -v.
+.RE
+
+The lines in the startup file are executed from top to bottom, so something
+like
+.nf
+
+   <both> option: -xflag1 -xflag2
+   <flag1> option: ...whatever...
+   <flag2> option: ...whatever...
+
+.fi
+will allow '-xboth' to be the same as '-xflag1 -xflag2' (or '-xflag1,flag2'
+for that matter). However, if you put the "<both>" line below the others,
+they will not be true when encountered, so the result would be different
+(and probably undesired).
+
+The "magic" directives are used to determine if a file looks to be binary
+or not. The form of a magic line is
+.nf
+    magic: \fISIZE\fP : \fIPERLCODE\fP
+.fi
+where
+.I SIZE
+is the number of bytes of the file you need to check, and
+.I PERLCODE
+is the code to do the check. Within
+.IR PERLCODE ,
+the variable $H will hold at least the first
+.I SIZE
+bytes of the file (unless the file is shorter than that, of course).
+It might hold more bytes. The perl should evaluate to true if the file
+should be considered a binary.
+
+An example might be
+.nf
+    magic: 6 : substr($H, 0, 6) eq 'GIF87a'
+.fi
+to test for a GIF ("-iskip .gif" is better, but this might be useful
+if you have images in files without the ".gif" extension).
+
+Since the startup file is checked from top to bottom, you can be a bit
+efficient:
+.nf
+    magic: 6 : ($x6 = substr($H, 0, 6)) eq 'GIF87a'
+    magic: 6 :  $x6                     eq 'GIF89a'
+.fi
+You could also write the same thing as
+.nf
+  magic: 6 : (($x6 = substr($H, 0, 6)) eq 'GIF87a') || ## an old gif, or.. \e
+              $x6                     eq 'GIF89a'     ## .. a new one.
+.fi
+since newlines may be escaped.
+
+The default internal startup file includes
+.nf
+   magic: 32 : $H =~ m/[\ex00-\ex06\ex10-\ex1a\ex1c-\ex1f\ex80\exff]{2}/
+.fi
+which checks for certain non-printable characters, and catches a large
+number of binary files, including most system's executables, linkable
+objects, compressed, tarred, and otherwise folded, spindled, and mutilated
+files.
+
+Another example might be
+.nf
+    ## an archive library
+    magic: 17 : substr($H, 0, 17) eq "!<arch>\en__.SYMDEF"
+.fi
+
+.SH "RETURN VALUE"
+.I Search
+returns zero if lines (or files, if appropriate) were found,
+or if no work was requested (such as with
+.BR -help ).
+Returns 1 if no lines (or files) were found.
+Returns 2 on error.
+
+.SH TODO
+Things I'd like to add some day:
+.nf
+  + show surrounding lines (context).
+  + highlight matched portions of lines.
+  + add '-and', which can go between regexes to override
+    the default logical or of the regexes.
+  + add something like
+      -below GLOB
+    which will examine a tree and only consider files that
+    lie in a directory deeper than one named by the pattern.
+  + add 'warning' and 'error' directives.
+  + add 'help' directive.
+.fi
+.SH BUGS
+If -xdev and multiple -dir arguments are given, any file in any of the
+target filesystems are allowed. It would be better to allow each filesystem
+for each separate tree.
+
+Multiple -dir args might also cause some confusing effects. Doing
+.nf
+   -dir some/dir -dir other
+.fi
+will search "some/dir" completely, then search "other" completely. This
+is good. However, something like
+.nf
+   -dir some/dir -dir some/dir/more/specific
+.fi
+will search "some/dir" completely *except for* "some/dir/more/specific",
+after which it will return and be searched. Not really a bug, but just sort
+of odd.
+
+File times (for -newer, etc.) of symbolic links are for the file, not the
+link. This could cause some misunderstandings.
+
+Probably more. Please let me know.
+.SH AUTHOR
+Jeffrey Friedl, Omron Corp (jfriedl@omron.co.jp)
+.br
+http://www.wg.omron.co.jp/cgi-bin/j-e/jfriedl.html
+
+.SH "LATEST SOURCE"
+See http://www.wg.omron.co.jp/~jfriedl/perl/index.html
diff --git a/usr_bin/sepdate.pl b/usr_bin/sepdate.pl
new file mode 100755 (executable)
index 0000000..7b853a5
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+# sepdate utility
+# usage: sepdate [month date year]
+# where day month year are date of interest -- default is today
+
+# Adapted and updated from a version attributed to Rich Holmes
+
+use Time::Local;
+use POSIX qw(strftime);
+
+if ($#ARGV == 2) {
+         $todmon = $ARGV[0]-1;
+         $todday = $ARGV[1];
+         $todyr = $ARGV[2];
+         $todti = timelocal(0, 0, 0, $todday, $todmon, $todyr);
+} elsif ($#ARGV == -1) {      $todti = time;
+} else {      die;
+}
+
+$septime = timelocal(0, 0, 0, 31, 7, 93);
+
+$tdiff = $todti - $septime;
+$days = int ($tdiff / (60 * 60 * 24));
+
+($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+
+# this seems like overkill
+$tzstr = strftime("%Z", $sec, $min, $hour, $mday, $mon, $year);
+printf ("%3s Sep %2d %2.2d:%2.2d:%2.2d %3s 1993\n",
+                (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday],
+                $days,$hour,$min,$sec,$tzstr);
diff --git a/usr_bin/sepdate.rb b/usr_bin/sepdate.rb
new file mode 100755 (executable)
index 0000000..54da23b
--- /dev/null
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require 'date'
+print Time.now.strftime("%a Sep #{Date.today-Date.new(1993,8,31)} %H:%M:%S %Z 1993\n")
diff --git a/usr_bin/sepdate.sh b/usr_bin/sepdate.sh
new file mode 100755 (executable)
index 0000000..c936163
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+# echo "Endless September"
+echo $(((`date +%s` - 746748000) / 86400)). September 1993
diff --git a/usr_bin/soundtest b/usr_bin/soundtest
new file mode 100755 (executable)
index 0000000..b3b3395
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Filename:      soundtest
+# Purpose:       test sound on your grml system
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sun Jan 15 22:46:13 CET 2006 [mika]
+################################################################################
+
+PN=`basename "$0"`
+[ -z "$PLAYER" ] && PLAYER="ogg123"
+if [ -z "$1" ] ; then
+  FILE="/usr/share/grml/effect.ogg"
+else
+  FILE="$*"
+fi
+
+echo "$PN - trying to play $FILE with $PLAYER
+
+You do not hear anything? Make sure volume is not turned off.
+Adjust mixer settings via aumix or alsamixer.
+
+Tip: $PN supports some options.
+Just provide the files you want to play as arguments,
+adjust player which should be used for playing the files
+via environment variable PLAYER. Usage example:
+
+  PLAYER=mp3blaster $PN /usr/share/grml/effect.ogg /another/file/to/play.mp3
+"
+
+$PLAYER $FILE && echo "It looks like sound works for you. :-)" || echo "problems with sound? :-("
+
+## END OF FILE #################################################################
diff --git a/usr_bin/tinyp2p.py b/usr_bin/tinyp2p.py
new file mode 100755 (executable)
index 0000000..17449d7
--- /dev/null
@@ -0,0 +1,16 @@
+# tinyp2p.py 1.0 (documentation at http://freedom-to-tinker.com/tinyp2p.html)
+import sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac # (C) 2004, E.W. Felten
+ar,pw,res = (sys.argv,lambda u:hmac.new(sys.argv[1],u).hexdigest(),re.search)
+pxy,xs = (xmlrpclib.ServerProxy,SimpleXMLRPCServer.SimpleXMLRPCServer)
+def ls(p=""):return filter(lambda n:(p=="")or res(p,n),os.listdir(os.getcwd()))
+if ar[2]!="client": # license: http://creativecommons.org/licenses/by-nc-sa/2.0
+  myU,prs,srv = ("http://"+ar[3]+":"+ar[4], ar[5:],lambda x:x.serve_forever())
+  def pr(x=[]): return ([(y in prs) or prs.append(y) for y in x] or 1) and prs
+  def c(n): return ((lambda f: (f.read(), f.close()))(file(n)))[0]
+  f=lambda p,n,a:(p==pw(myU))and(((n==0)and pr(a))or((n==1)and [ls(a)])or c(a))
+  def aug(u): return ((u==myU) and pr()) or pr(pxy(u).f(pw(u),0,pr([myU])))
+  pr() and [aug(s) for s in aug(pr()[0])]
+  (lambda sv:sv.register_function(f,"f") or srv(sv))(xs((ar[3],int(ar[4]))))
+for url in pxy(ar[3]).f(pw(ar[3]),0,[]):
+  for fn in filter(lambda n:not n in ls(), (pxy(url).f(pw(url),1,ar[4]))[0]):
+    (lambda fi:fi.write(pxy(url).f(pw(url),2,fn)) or fi.close())(file(fn,"wc"))
\ No newline at end of file
diff --git a/usr_bin/twebgal b/usr_bin/twebgal
new file mode 100755 (executable)
index 0000000..2ba28b5
--- /dev/null
@@ -0,0 +1,440 @@
+#!/bin/bash
+# Filename:      twebgal
+# Purpose:       create a tiny webgallery using CSS-features
+# Authors:       Wolfgang Scheicher <worf@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mon Apr 25 10:38:00 CEST 2005 [worf]
+################################################################################
+
+# Defaults
+DISPLAY_GEOMETRY=640x480
+THUMBNAIL_GEOMETRY=150x150
+PREVIEW_GEOMETRY=250x250
+THUMBNAIL_QUALITY=75
+
+PARENT_DIR="Ãœbergeordnetes Verzeichnis"
+
+PATH=$PATH:/usr/X11R6/bin:/usr/bin
+DATADIR=".tmp"
+LOG=".tmp/log"
+VERBOSE="/dev/null"
+OPTS=$*
+OLDIFS=$IFS
+IFS="
+"
+
+THUMBNAILS=("$DISPLAY_GEOMETRY" "$THUMBNAIL_GEOMETRY")
+FILE_EXTENSIONS=("jpg" "png" "gif")
+REQUIRED=("jpegtran" "convert" "identify" "find" "tr" "sed" "awk" "grep")
+
+##############################################################
+
+create_sample_config () {
+# sample config with some default values
+#
+if [ -f description ] ; then
+  DST=/dev/stdout
+  echo "description file allready exists!"
+else
+  echo "creating example description file"
+  DST="./description"
+fi
+echo -e "# Gallery Config File\n#
+# Title for this Directory
+TITLE=\"${PWD##*/}\"\n
+# Optional Comment
+COMMENT=\"\"\n
+# this parameters affect the dir list in the parent directory:
+# thumbnail to show
+THUMB=\"$(find_all_images | head -n 1 )\"\n
+# Index to sort dirs by.
+# You might want to use some date for chronological order
+INDEX=\"$(date +%F)\"\n" > $DST
+if [[ -z $STYLESHEET ]] ; then
+echo -e "# Stylesheet
+# This will be used for all subdirs as well
+STYLESHEET=\"stylesheet.css\"" >> $DST
+fi
+}
+
+##############################################################
+
+init_gallery () {
+# create datadir and check for required apps
+#
+  mkdir -p ${DATADIR}
+  echo -n "" > ${LOG}
+  for app in "${REQUIRED[@]}" ; do
+    if which $app 2>/dev/null >/dev/null ; then
+      true
+    else
+      echo "ERROR: $app not found!"
+      exit;
+    fi
+  done
+  if [[ -f description ]] ; then source "description"; fi
+  STYLESHEET=$( find_stylesheet )
+}
+
+parent_dir () {
+# adds a "../ if it is not a absolute path or a url"
+# otherwise returns the same string again
+  if [[ "${1::1}" == "/" ]] ; then
+    echo "$1"
+  elif [[ "${1::7}" == "http://" ]] ; then
+    echo "$1"
+  elif [[ ! -z $1 ]] ; then
+    echo "../${1}"
+  fi
+}
+
+find_stylesheet () {
+# searches parent dirs recursively for a stylesheet
+# until it reaches the root dir
+  if [[ -f description ]] ; then source "description"; fi
+  if [[ -z $STYLESHEET ]] ; then
+    if [[ ! "$PWD" == "/" ]] ; then
+      cd ..
+      parent_dir $( find_stylesheet )
+    fi
+  else
+    echo $STYLESHEET
+  fi
+}
+
+##############################################################
+
+find_all_images() {
+# returns a list of all (supported) Images in the current dir
+#
+  for ext in "${FILE_EXTENSIONS[@]}" ; do
+    find *.${ext} -maxdepth 0 2> /dev/null
+  done
+}
+
+find_all_dirs() {
+# Searches all dirs and lists them,
+# sorted by the INDEX field in the description file
+#
+  DIRS="$(find * -maxdepth 0 -type d)"
+  for DIR in $DIRS ; do
+    ( INDEX="_"
+    if [[ -f ${DIR}/description ]] ; then source "${DIR}/description"; fi
+    echo "${INDEX} ${DIR}" )
+  done | sort | sed -e "s/^\S*\s//"
+}
+
+##############################################################
+
+prune() {
+# deletes old thumbnails and html files
+# temporarily creates a filelist
+#
+  if [[ "$RECURSIVE" == "true" ]] ; then
+    ALL_DIRS=( $(find_all_dirs) )
+    for DIR in "${ALL_DIRS[@]}"; do
+      ( IFS=$OLDIFS && cd "$DIR" && $0 $OPTS ; )
+    done
+  fi
+  echo "->  ${PWD}"
+  if [[ -d "${DATADIR}" ]] ; then
+    find_all_images > "${DATADIR}/filelist"
+    for GEOMETRY in "${THUMBNAILS[@]}"; do
+      (
+      [[ -d "${DATADIR}/${GEOMETRY}" ]] &&
+      cd "${DATADIR}/${GEOMETRY}" &&
+      find_all_images |
+      awk 'NR==FNR {a[$0];next}
+           !($0 in a)' ../filelist - |
+      while read line ; do
+        echo "rm ${DATADIR}/${GEOMETRY}/${line}"
+        rm "${line}"
+      done
+      )
+    done
+    (
+    cd "${DATADIR}/" &&
+    find *.html -maxdepth 0 2> /dev/null |
+    awk 'NR==FNR {a[$0];next}
+         {sub(/\.html$/,"",$0)}
+         !($0 in a)' filelist - |
+    while read line ; do
+      echo "rm ${DATADIR}/${line}.html"
+      rm "${line}.html"
+    done
+    )
+    rm "${DATADIR}/filelist"
+  fi
+}
+
+##############################################################
+
+build_thumbnail() {
+# generates thumbnails
+# time of modification is set to that of the original and used
+# to check if existing thumbs need updating
+# orientation in the exif-header is used to rotate generated images
+#
+  for GEOMETRY in "${THUMBNAILS[@]}"; do
+    mkdir -p "$DATADIR/$GEOMETRY" || exit
+    echo -ne "($GEOMETRY"
+    DST="$DATADIR/$GEOMETRY/$FILE"
+    SKIP=false
+     if [[ -e $DST ]]; then
+      if [[ $(stat -c "%Y" $FILE) == $(stat -c "%Y" $DST) ]]; then
+        SKIP=true
+        echo -n " skip"
+      else
+        echo -n " D"
+        rm $DST
+      fi
+    else
+      echo -n "  "
+    fi
+
+    if [[ $SKIP == "false" ]]; then
+      ORIENTATION=""
+      ORIENTATION=$(identify -format "%[EXIF:Orientation]" "$FILE")
+      if [[ "$ORIENTATION" == "6" ]]; then
+        echo -n "TR"
+        convert -quality $THUMBNAIL_QUALITY -rotate 90 -geometry "$GEOMETRY+0+0>" "$FILE" "$DST"
+      elif [[ "$ORIENTATION" == "8" ]]; then
+        echo -n "TL"
+        convert -quality $THUMBNAIL_QUALITY -rotate 270 -geometry "$GEOMETRY+0+0>" "$FILE" "$DST"
+      else
+        echo -n "T "
+        convert -quality $THUMBNAIL_QUALITY -geometry "$GEOMETRY+0+0>" "$FILE" "$DST"
+      fi
+      if [[ "${FILE##*.}" == "jpg" ]]; then
+        echo -n "O"
+        jpegtran -copy none -optimize -progressive "$DST" > "$DST.tmp"
+        mv -f "$DST.tmp" "$DST"
+      else
+        echo -n " "
+      fi
+      touch -m --reference=$FILE $DST
+    fi
+    echo -n ") "
+  done
+}
+
+build_html() {
+# generates the HTML
+
+  echo -n "(html"
+
+  THUMBGEOMETRY=$(identify -format "%wx%h" "$DATADIR/$THUMBNAIL_GEOMETRY/${FILE}")
+  THUMBWIDTH=${THUMBGEOMETRY%x*}
+  THUMBHEIGHT=${THUMBGEOMETRY#*x}
+
+  THUMBT=$(((156 - $THUMBHEIGHT )/2 ))
+  THUMBB=$(((157 - $THUMBHEIGHT )/2 ))
+  THUMBL=$(((156 - $THUMBWIDTH  )/2 ))
+  THUMBR=$(((157 - $THUMBWIDTH  )/2 ))
+
+  TITLE=$FILE
+  COMMENT=$(identify -format "%c" "${FILE}" | tr '\n' ' ')
+  THUMBNAIL=$DATADIR/$THUMBNAIL_GEOMETRY/${FILE}
+  THIS_HTML=$DATADIR/${FILE}.html
+
+  html_header > ${THIS_HTML}
+
+echo "<div class=\"gallerynav\">
+${FILE}&nbsp;&nbsp;&nbsp;&nbsp;
+<a href=\"../index.html\">Index</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"${LAST}.html\">&lt;&lt;&lt;</a>&nbsp;${CURRENT}/${IMAGE_COUNT}&nbsp;<a href=\"${NEXT}.html\">&gt;&gt;&gt;</a>
+</div>
+
+<div class=\"cont\">
+<center>
+<a href=\"../${FILE}\"><img alt=\"${DISPLAY_GEOMETRY}/${FILE}\" src=\"${DISPLAY_GEOMETRY}/${FILE}\" /></a>
+</center><br />
+" >> $THIS_HTML
+
+identify -format "<table>
+<tr><td>Auflösung:</td><td>%wx%h</td></tr>
+<tr><td>Dateigröße:</td><td>%b</td></tr>
+<tr><td>Camera:</td><td>%[EXIF:Model]</td></tr>
+<tr><td>Datum/Zeit:</td><td>%[EXIF:DateTime]</td></tr>
+<tr><td>Kommentar:</td><td>%c</td></tr>
+</table>" ${FILE} >> $THIS_HTML
+
+echo "</div>" >> $THIS_HTML
+html_foot >> $THIS_HTML
+
+echo "<a href=\"$THIS_HTML\"><img alt=\"Thumbnail\" src=\"$THUMBNAIL\" style=\"width:${THUMBWIDTH}px; height:${THUMBHEIGHT}px; margin: ${THUMBT}px ${THUMBR}px ${THUMBB}px ${THUMBL}px;\" title=\"${COMMENT}\" /><br />$FILE</a>" >> index.html
+
+echo -en ")"
+}
+
+##############################################################
+
+start_index () {
+# generates the upper part of the index page
+# containing the list of subdirs
+# which are recursively processed from here too
+#
+  TITLE="${TITLE=${PWD##*/}}"
+  html_header > index.html
+  echo "<div class=\"cont\">" >> index.html
+  echo "<h1>${TITLE}</h1>" >> index.html
+  echo "<ul>" >> index.html
+  echo "<li class=\"back\"><b><a href=\"../index.html\">${PARENT_DIR}</a></b></li>" >> index.html
+  ALL_DIRS=( $(find_all_dirs) )
+  for DIR in "${ALL_DIRS[@]}"; do
+  ( TITLE="${DIR}"; THUMB=""; INDEX=""; COMMENT=""
+    if [[ -f ${DIR}/description ]] ; then source "${DIR}/description"; fi
+    echo "<li class=\"dir\"><a class=\"tooltip\" href=\"${DIR}/index.html\"><b>${TITLE}</b>" >> index.html
+
+    if [[ ! "${THUMB}${COMMENT}" == "" ]]; then
+      if [[ "${COMMENT}" == "" ]]; then
+        echo "<span><table><tr><td><img alt=\"Thumbnail\" src=\"${DIR}/${DATADIR}/thumb.${THUMB##*.}\" /></tr></table></span>" >> index.html
+      elif [[ "${THUMB}" == "" ]]; then
+        echo "<span><table><tr><td>${COMMENT}</td></tr></table></span>" >> index.html
+      else
+        echo "<span><table><tr><td><img alt=\"Thumbnail\" src=\"${DIR}/${DATADIR}/thumb.${THUMB##*.}\" /></td><td></td><td></td><td>${COMMENT}</td></tr></table></span>" >> index.html
+      fi
+    fi
+    echo "</a></li>" >> index.html
+    if [[ "$RECURSIVE" == "true" ]] ; then
+      ( STYLESHEET="$(parent_dir ${STYLESHEET})"
+        IFS=$OLDIFS && cd "$DIR" && $0 $OPTS ; )
+    fi
+  )
+  done
+echo "
+</ul>
+${COMMENT}
+<div class=\"gallery\">
+<div class=\"spacer\"></div>
+" >> index.html
+}
+
+finish_index () {
+echo "
+<div class=\"spacer\"></div>
+</div>
+</div>
+" >> index.html
+html_foot >> index.html
+}
+
+##############################################################
+
+create_sample_stylesheet () {
+if [ -f stylesheet.css ] ; then
+  echo "stylesheet.css allready exists!"
+  exit 1
+fi
+cat << EOF > stylesheet.css
+a {text-decoration:none;}
+
+div.gallery img {border: 2px inset #aaa; margin:3px;}
+div.gallery a {color:#000; border: 2px outset #aaa; text-decoration:none; text-align:center; float:left; padding:3px; margin:4px; background-color:#ddd;}
+div.gallery a:hover {color:#333; border: 2px outset #ccc; background-color:#eee;}
+div.spacer {clear: both;}
+div.gallerynav {text-align: center; margin: 0px; padding:0em 0.3em 0em 0.3em;}
+
+a.tooltip, a.tooltip:link, a.tooltip:visited, a.tooltip:active  { position: relative; }
+a.tooltip span {display: none}
+a:hover.tooltip span {display: block; position: absolute; top: 2.5em; left: 1.5em; z-index: 100; color: #000; padding: 3px; border:1px solid #000; background: #ffc; }
+EOF
+}
+
+##############################################################
+
+html_header () {
+echo "<html>
+<head>
+<title>${TITLE}</title>
+<link rel=\"stylesheet\" type=\"text/css\" href=\"${STYLESHEET}\" />
+</head>
+<body>
+"
+}
+
+html_foot () {
+echo "</body>
+</html>
+"
+}
+
+
+##############################################################
+
+build_gallery() {
+# generates the whole thing, puts everything together
+# 
+  ALL_IMAGES=( $(find_all_images) )
+  IMAGE_COUNT=${#ALL_IMAGES[@]}
+  start_index
+  (
+  STYLESHEET="$(parent_dir ${STYLESHEET})"
+  echo "-> ${TITLE}"
+  CURRENT="0"
+  FILE="../index"
+  for file in "${ALL_IMAGES[@]}" "../index" ; do
+    NEXT="$file"
+    if [[ "$FILE" != "../index" ]]; then
+      echo -ne "$FILE\t"
+      build_thumbnail
+      build_html
+      echo ""
+    fi
+    CURRENT="$(( ${CURRENT} + 1 ))"
+    LAST="$FILE"
+    FILE="$file"
+  done
+  if [[ ! -z "${THUMB}" ]] ; then
+    echo -ne "preview thumbnail from ${THUMB}\t"
+    THUMBNAILS=("$PREVIEW_GEOMETRY")
+    FILE="${THUMB}"
+    [ -e "${DATADIR}/thumb.${THUMB##*.}" ] && mv "${DATADIR}/thumb.${THUMB##*.}" "${DATADIR}/${PREVIEW_GEOMETRY}/${THUMB}"
+    build_thumbnail &&
+    mv "${DATADIR}/${PREVIEW_GEOMETRY}/${THUMB}" "${DATADIR}/thumb.${THUMB##*.}"
+    echo
+  fi
+  ) | tee -a $LOG >> $VERBOSE
+  finish_index
+  echo " $IMAGE_COUNT Image(s) in ${TITLE}"
+}
+
+##############################################################
+
+init_gallery
+
+while getopts "vdsrp-:" OPT ; do
+  case $OPT in
+    v) VERBOSE=/dev/stdout
+       ;;
+    d) create_sample_config
+       exit 0
+       ;;
+    s) create_sample_stylesheet
+       exit 0
+       ;;
+    r) RECURSIVE="true"
+       ;;
+    p) prune
+       exit 0
+       ;;
+    ?) # wrong argument
+       echo -n "ERROR: Missing argument for option \"$OPTARG\". "
+       exit 1
+       ;;
+    *) # wrong option
+       echo -n "ERROR: Unknown option \"$OPTARG\". "
+       exit 1
+       ;;
+  esac
+done
+shift $(($OPTIND -1))
+
+build_gallery 2>${DATADIR}/errors
+if [ -s ${DATADIR}/errors ]; then
+  echo -e "\nWARNING: there were errors. see .tmp/errors"
+else
+  rm .tmp/errors
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/unbleach.pl b/usr_bin/unbleach.pl
new file mode 100755 (executable)
index 0000000..93332f2
--- /dev/null
@@ -0,0 +1,75 @@
+#!/usr/bin/perl
+# Filename:      unbleach.pl
+# Purpose:       for really dirty perl programs
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Feb 26 2005 [mika]
+################################################################################
+
+# This script will replace all the unsighted unprintable characters bleached out of your source file by a:
+#   use Acme::Bleach;
+# directive with elegant (perhaps) ASCII perl code. 
+
+use strict;
+my $washing = pop or carp("Usage: unbleach.pl [file]\n");
+open white,"<$washing" or carp("Can't get $washing");
+local $/; $_=<white>;
+s/(.*)^\s*use\s+Acme::Bleach\s*;\n(?: \t){8}/$1/
+or carp("$washing is not bleached!");
+open line,">$washing" or carp("Can't dry $washing");
+print line out($_);
+sub out {s/\n//g;tr/ \t/01/;pack "b*",$_;}
+sub carp {print shift and exit}
+
+=head1 NAME
+
+unbleach.pl - For I<really> unclean programs
+
+=head1 SYNOPSIS
+
+unbleach.pl [file]
+
+=head1 DESCRIPTION
+
+This script will replace all the unsighted unprintable
+characters bleached out of your source file by a:
+
+    use Acme::Bleach;
+
+directive with elegant (perhaps) ASCII perl code.
+
+It also removes the use bleach line when it rewrites
+the source code. The code continues to work exactly
+as it did before, but now looks like normal!
+
+=head1 DIAGNOSTICS
+
+=item C<Can't get '%s'>
+
+unbleach.pl could not read the source file.
+
+=item C<'%s' is not bleached!>
+
+unbleach.pl will only process files that have been
+previously bleached and have the expected format.
+
+=item C<Can't dry '%s'>
+
+unbleach.pl could not open the source file to modify it.
+
+=head1 SEE ALSO
+
+http://www.cpan.org/authors/id/DCONWAY/Acme-Bleach-1.12.tar.gz
+http://www.perlmonks.com
+
+=head1 AUTHOR
+
+not Damian Conway (as if you couldn't guess)
+
+=head1 COPYRIGHT
+
+Copyright (c) 2001, tachyon. All Rights Reserved.
+This script is free software. It may be used, redistributed
+and/or modified under the terms of the Perl Artistic License
+(see http://www.perl.com/perl/misc/Artistic.html)
diff --git a/usr_bin/urlgrep.awk b/usr_bin/urlgrep.awk
new file mode 100755 (executable)
index 0000000..32e3188
--- /dev/null
@@ -0,0 +1,163 @@
+#!/usr/bin/awk -f
+
+# /* 24.12.2004
+# urlgrep[.awk] v1 - print http|ftp|rstp|mms:// text entries in text
+# urlgrep [-v dup=[01]] [[+] regex] [! regex] [file|-] [files..]
+# no files specified = read from stdin
+# w/o files, read stdin
+
+# todo: doing hpfetch with v2 of this
+# todo: v2: multiple positive/negative regex support
+# todo: v2: recognition: http://blah.com/path) text
+
+# by xmb<xmb@skilled.ch> - localhack
+
+# 24.12.2004, 26.12.2004, 02.01.2005, 26.01.2005(rstp support)
+# 28.01.2005(grep like syntax and ! <notmatch>)
+# 09.02.2005(fixed args, others, renamed from httpgrep to urlgrep)
+# 12.02.2005(mms support), 28.02.2005(robustness update)
+# 07.03.2005(conf enhansements)
+# 24.03.2005(regex/gsub enh's, more cmd examples)
+# 01.05.2005(-- stop arg)
+# */
+
+# $ cp urlgrep.awk /usr/local/bin/urlgrep
+
+# $ urlgrep regex ! regex files
+# $ urlgrep '' file
+# $ urlgrep . file
+# $ curl -s www.blah.ch | urlgrep
+# $ wget -qO- www.microsoft.com | urlgrep [| xargs curl -sD-]
+# $ curl -s www.apple.com | urlgrep ! 200[25] +[^m]/$
+
+# $ curl -s http://e2e.serveftp.net/wee/ | urlgrep wmv$ | xargs -n1 mplayer
+# $ 
+
+## MMMM! example site aightgenossen.ch, play media files with max 3 mplayers@1p
+# $ wget xmb.ath.cx/threads.sh
+# $ . threads.sh ; threads_max=3
+# $ getwhile() { [[ ! $1 ]] && echo $last && return 1; last=$( curl -s $@ |
+# > urlgrep ) match=$( grep -E '(wm[av]|rm|mov|avi)$|^rtsp' ) && getwhile }
+# # v2 signal todo
+# curl -s aightgenossen.ch/index.php/m=multimedia
+# .. unfinished
+
+BEGIN {
+       if (! dup && dup != "0") dup = 1 # filter duplicates, by default on
+       if (! dup_domain && dup_domain != "0") dup_domain = 0 # filter duplicates
+       #     ^ by domain but show whole url matching first
+       if (! show_dom_only && show_dom_only != "0") show_dom_only = 0 # show only
+       #     ^ the domain/host of the url
+
+       # map env variables, accessable with URLGREP_ prefix
+       # eg, NODUP is the env variable URLGREP_NODUP
+       narg = split("\
+               NODUP dup 0 \
+               GREP grep . \
+               NOGREP nogrep . \
+               URL url . \
+               DEBUG DEBUG .\
+               DUP_DOMAIN dup_domain . \
+               DOMAIN_ONLY domain_only .\
+       ", Args)
+       
+       for (arg = 1; arg <= narg; arg++)
+               if (ENVIRON[ Args[i] ]) {
+                       if (Args[i+2] == ".") CONF[ Args[i+1] ] = ENVIRON[ Args[i] ]
+                       else CONF[ Args[i+1] ] = Args[i+2]
+                       
+                       i += 2
+               }
+       
+       # argument parsing, this uses quite some CPU, gah, fixed
+       while (ARGV[++i]) {
+               #if (i == 1 || ARGV[i] ~ /^\+/) grep = get_arg(i)
+               #if (ARGV[i] ~ /^!/) nogrep = get_arg(i)
+               
+               if (ARGV[i] ~ /^!/) CONF["nogrep"] = get_arg(i)
+               else CONF["grep"] = get_arg(i)
+               
+               if (skip) { skip = 0; delete ARGV[i]; delete ARGV[++i] }
+               else delete ARGV[i]
+
+               if (ARGV[i + 1] !~ /^[+!-]/) break # stop after having enough regexes
+       }
+       
+       if (CONF["grep"])       grep = CONF["grep"]
+       if (CONF["nogrep"])     nogrep = CONF["grep"]
+       if (CONF["url"])        url = CONF["url"]
+       if (CONF["DEBUG"])      DEBUG = CONF["DEBUG"]
+       
+       #if (ENVIRON["URLGREP_NODUP"]) dup = 0
+       #if (ENVIRON["URLGREP_GREP"]) grep = ENVIRON["URLGREP_GREP"]
+       #if (ENVIRON["URLGREP_NOGREP"]) nogrep = ENVIRON["URLGREP_NOGREP"]
+       #if (ENVIRON["URLGREP_URL"]) url = ENVIRON["URLGREP_URL"]
+       #if (ENVIRON["URLGREP_DEBUG"]) DEBUG = ENVIRON["URLGREP_DEBUG"]
+       #if (ENVIRON["URLGREP_QUOT"]) quote = ENVIRON["URLGREP_QUOT"]
+       #if (ENVIRON["URLGREP_DUP_DOMAIN]) dup_domain = ENVIRON["URLGREP_DUP_DOMAIN"]
+
+       err = "/dev/stderr"
+       r_h = "(https?|ftp|rtsp|mms)://" # head(er)
+       #r_h = "[a-zA-Z]+://"
+       #r_m = r_h " ?['\"]?[^ \t'\"<>]+"
+       r_m = r_h " *['\"]?[^ \t'\"<>]+\\.[^ \t'\"<>]+" # match
+       
+       if (DEBUG) printf "url = %s, match '%s', dont match '%s'\n",
+               (url) ? url : "none", grep, nogrep >err
+}
+
+#DEBUG > 2 # small slowdown
+
+$0 ~ r_h {
+       if (DEBUG > 1) print "LINE:", $0
+       #while ($0 ~ r_h "[^\"'\t<][ \t]*[^ \t]+\\.") { # original way uses r_h
+       while ($0 ~ r_m) {
+               s = substr($0, match($0, r_m), RLENGTH)
+               total++
+               if (dup && ! Seen[s]++)
+                       _p(s)
+               else if (! dup)
+                       _p(s)
+               else
+                       found_dup++
+               sub(r_m, "")
+       }
+}
+
+END {
+       fflush()
+       if (! count) exit 3
+       printf "urlgrep: %d total", total >err
+       if (found_dup)
+               printf ", %d printed, %d duplicates", count, found_dup >err
+       if (found_dup + count < total)
+               printf ", %d not matched", total - (found_dup + count) >err
+       printf "\n" >err
+       fflush()
+}
+
+# get either current or next arg
+function get_arg(p     ,tmp) {
+       if (ARGV[p] ~ /^[+!-]/) {
+               if (length(ARGV[p]) > 1) {
+                       tmp = substr(ARGV[p], 2)
+                       sub(/^ */, "", tmp)
+                       return tmp
+               } else {
+                       skip = 1
+                       return ARGV[p + 1]
+               }
+       } else
+               return ARGV[p]
+}
+
+# main match/nomatch check & print function
+function _p(s) {
+       if ((grep && s !~ grep) || nogrep && s ~ nogrep) return 1
+       
+       gsub(/[ \t'"]*/, "", s) # :;, are newly added # ;,
+       if (quote) print "'" s "'" # small slowdown
+       else
+               print s
+       count++
+}
diff --git a/usr_bin/usbtree b/usr_bin/usbtree
new file mode 100755 (executable)
index 0000000..c29eb00
--- /dev/null
@@ -0,0 +1,177 @@
+#!/usr/bin/perl
+#
+# Reads /proc/bus/usb/devices and selectively lists and/or
+# interprets it.
+#
+# Originally written by Randy Dunlap. 
+#
+
+$DEVFILENAME = "/proc/bus/usb/devices";
+$PROGNAME = $0;
+
+if (! open (DEVNUM, "<$DEVFILENAME"))
+{
+       print "$PROGNAME: cannot open '$DEVFILENAME'\n";
+       exit 1;
+}
+
+$showconfig = "yes";
+
+while ($line = <DEVNUM>)       # read a text line from DEVNUM
+{
+       # skip all lines except those we recognize:
+       if (($line !~ "^C:")            # Configuration: one is active
+                   && ($line !~ "^D:") # Device:
+                   && ($line !~ "^I:") # Interface: protocol group
+                   && ($line !~ "^S:") # String: used with root hub
+                   && ($line !~ "^T:") # Topology: starts each device
+                   )
+       {
+               next;   # to the next line
+       }
+
+       chomp $line;            # remove line endings
+
+       # First convert '=' signs to spaces.
+       $line =~ tr/=/ /;
+
+       # and convert all '(' and ')' to spaces.
+       $line =~ tr/(/ /;
+       $line =~ tr/)/ /;
+
+       # split the line at spaces.
+       @fields = split / +/, $line;
+
+       # T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  3 Spd=1.5 MxCh= 0
+       if ($line =~ "^T:")
+       {
+               # split yields: $bus, $level, $parent, $port, $count, $devnum, $speed, $maxchild.
+
+               $bus    = @fields [2];
+               $level  = @fields [4];
+               $parent = @fields [6];          # parent devnum
+               $port   = @fields [8] + 1;      # make $port 1-based
+               $count  = @fields [10];
+               $devnum = @fields [12];
+               $speed  = @fields [14];
+               $maxchild = @fields [16];
+               $devclass = "?";
+               $intclass = "?";
+               $driver   = "?";
+               $ifnum    = "?";
+               $showclass = "?";       # derived from $devclass or $intclass
+               $lastif = "?";                  # show only first altsetting
+               $HCtype = "?";
+               $showconfig = "no";
+               $nconfig = "0";
+               next;
+       } # end T: line
+
+       # only show the _active_ configuration
+       # C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
+       elsif ( $line =~ "^C:" ) {
+           if ( $line =~ "^C:\\*" ) {
+               $showconfig = @fields[4];
+           } else {
+               $showconfig = "no";
+           }
+           next;
+       }
+
+       # D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
+       elsif ($line =~ "^D:")
+       { # for D: line
+               $devclass = @fields [5];
+               $nconfig = @fields [13];
+               next;
+       }
+
+       # in case this is a root hub, look at the device strings.
+       #  - S:  Manufacturer:Linux 2.6.5 ehci_hcd      [all 2.6]
+       #  - S:  Product=USB UHCI Root Hub              [all 2.4, 2.2]
+       #  - S:  Product=OPTi Inc 82C861                [2.6/PCI_NAMES]
+       elsif ( $line =~ "^S:" )
+       { # for S: line
+               if ( $level == 00 && $line =~ "hcd" )
+               {
+                   $HCtype = @fields [4];
+               }
+               elsif ( $level == 00 && $line =~ "HCI" && $HCtype eq "?")
+               {
+                   $HCtype = @fields [3];
+               }
+               next;
+       }
+
+       # the rest of this code:
+       #  - only shows interface descriptors
+       #  - for the active configuration
+       #  - for the first (prefer: active!) altsetting
+       elsif ( ! ( $line =~ "^I:" )
+               || "$showconfig" eq "no") {
+           next;
+       }
+
+       
+       # I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=hid
+       $intclass = @fields [9];
+       $ifnum    = @fields [2];
+       $driver   = @fields [15];
+
+       if (($devclass eq ">ifc") || ($devclass eq "unk."))
+       {       # then use InterfaceClass, not DeviceClass
+               $showclass = $intclass;
+       }
+       else
+       {       # use DeviceClass
+               $showclass = $devclass;
+       }
+
+       if ($level == 0)
+       {
+           # substitute real driver name
+           if ( $HCtype =~ "UHCI-alt" )
+           {
+               $HC = "uhci";
+           }
+           elsif ( $HCtype =~ "UHCI" )
+           {
+               $HC = "usb-uhci";
+           }
+           elsif ( $HCtype =~ "OHCI" )
+           {
+               $HC = "usb-ohci";
+           }
+           else
+           {
+               $HC = $HCtype;
+           }
+
+               print sprintf ("/:  Bus $bus.Port $port: Dev $devnum, Class=root_hub, Driver=%s/%sp, %sM\n",
+                        $HC, $maxchild, $speed );
+       }
+       elsif ($lastif ne $ifnum)
+       {
+               $temp = $level;
+               while ($temp >= 1)
+               {
+                       print "    ";
+                       $temp--;
+               }
+
+               if ($nconfig ne "1") {
+                   $temp = " Cfg $showconfig/$nconfig";
+               } else {
+                   $temp = "";
+               }
+
+               print sprintf ("|__ Port $port: Dev $devnum$temp, If $ifnum, Class=$showclass, Driver=$driver%s, %sM\n",
+                       ($maxchild == 0) ? "" : ("/" . $maxchild . "p"),
+                       $speed);
+               $lastif = $ifnum;
+       }
+} # end while DEVNUM
+
+close (DEVNUM);
+
+# END.
diff --git a/usr_bin/wm-ng b/usr_bin/wm-ng
new file mode 100755 (executable)
index 0000000..ef17089
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Filename:      wm-ng
+# Purpose:       a wrapper script to call fluxbox with some additional features activated
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Thu Nov 03 15:32:49 CET 2005 [mika]
+################################################################################
+
+/usr/bin/gkrellm   &   # -w
+
+(sleep 2; idesk &) &
+
+/usr/bin/fluxbox
+
+exit $?
+
+## END OF FILE #################################################################
diff --git a/usr_bin/wwwis b/usr_bin/wwwis
new file mode 100755 (executable)
index 0000000..20607c4
--- /dev/null
@@ -0,0 +1,1180 @@
+# use perl -*- Perl -*- This line used to have a : at the start
+  eval 'exec perl -w -S $0 ${1+"$@"}'
+  if 0;
+# clever way of calling perl on this script : stolen from weblint
+#!/usr/bin/perl -w
+#
+# wwwis: adds HEIGHT= and WIDTH= to images referenced in specified HTML file.
+#
+# for documentation - changelog and latest version
+# see http://www.bloodyeck.com/wwwis/
+#
+# this program by (and copyright)    Alex Knowles, Alex@bloodyEck.com
+# based on original code and idea by Andrew Tong,  werdna@ugcs.caltech.edu
+#
+# You may distribute this code under the GNU public license
+#
+# THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT WARRANTY OF ANY KIND.
+#
+# RCS $Id: wwwis,v 2.43 2004/12/02 18:32:13 ark Exp $
+
+use strict;
+use File::Copy;
+use Socket;
+# if you do not have these system libraries make sure you comment them out
+# and have the options UsePerlCp, searchURLS, TryServer ALL SET TO NO
+
+if( ! $\ ){
+  # this stops the error Use of uninitialized value at .../File/Copy.pm line 84
+  # print "Out rec sep not defined?? someone help me with this\n";
+  $\='';
+}
+
+# this array specifies what options are available what the default
+# value is and also what type it is, files are checked to see if they
+# exist and the only possible values for choice are given.
+# you should only need to change the third column
+my(@options)=
+  ('searchURLS',      'bool',    'Yes',
+   'DocumentRoot',    'file',    '/usr/local/etc/httpd/htdocs',
+   'UserDir',         'string',  'html',
+   'MakeBackup',      'bool',   'Yes',
+   'BackupExtension', 'string',  '~',
+   'OverwriteBackup', 'choice',  'Yes', 3, 'Yes','No','Ask',
+   'ChangeIfThere',   'choice',  'Yes', 4, 'Yes','No','Ask','Clever',
+   'Skip1x1',        'bool',    'Yes',
+   'SkipThreshold',   'integer', '0', # 0 disables this option
+   'DoChmodChown',    'bool',    'No',
+   'UpcaseTags',      'choice',  'No',  4, 'Yes','No','Upper','Lower',
+   'UpcaseNewTags',   'bool',    'No',
+   'TryServer',       'bool',    'Yes',
+   'QuoteNums',       'choice',  'No',  4, 'Yes','No','Single','Double',
+   'Munge%',         'bool',    'Yes',
+   'NeedAlt',        'bool',    'Yes',
+   'SkipCGI',        'bool',    'Yes',
+   'UseNewGifsize',   'bool',    'No',
+   'UseHash',        'bool',    'Yes',
+   'Base',           'string',  '',
+   'InFilter',       'string',  '',
+   'OutFilter',              'string',  '',
+   'Quiet',          'bool',    'No',
+   'Script',         'string',  '',
+   'Proxy',          'string',  '',
+   'SkipFilter',      'string',  '',
+   'IgnoreLinks',     'bool',    'Yes',
+   'UsePerlCp',       'bool',    'Yes',
+   );
+
+#####################################################################
+######### YOU SHOULD NOT HAVE TO CHANGE ANYTHING BELOW HERE #########
+#####################################################################
+
+
+my($Base,   $SkipCGI,  $InFilter, $MakeBackup,   $SearchURLS, $OverwriteBackup,
+   $Proxy,  $UseHash,  $OutFilter, $UpcaseTags,  $UpcaseNewTags,  
+   $UseNewGifsize, $debug,
+   $Script, $UserDir,  $TryServer, $DoChmodChown,$ChangeIfThere, $IgnoreLinks,
+   $NeedAlt,$MungePer, $QuoteNums, $DocumentRoot,$BackupExtension, $Quiet,
+   $UsePerlCp, $Skip1x1, $SkipThreshold, $SkipFilter );
+
+my( %hashx, %hashy );
+
+# O.K. now we have defined the options go and get them and set the global vars
+my(@optionval)=&GetConfigFile(@options);
+&SetGlobals();
+
+$|=1;  # make it so that I can fit lots of info on one line...
+
+############################################################################
+# Main routine.  processes all files specified on command line, skipping
+# any file for which a .bak file exists.
+############################################################################
+while (@ARGV) {
+  my($FILE)=shift;
+  if( $FILE =~ /^-/ ){
+    &proc_arg($FILE);
+    next;
+  }
+
+  print "$FILE -- ";
+
+  if( -s $FILE && -T $FILE ){
+    if ( -e "$FILE$BackupExtension"){
+      if( &isfalse($OverwriteBackup) ){
+       print "Skipping -- found $FILE$BackupExtension\n";
+       next;
+      } elsif ( $OverwriteBackup =~ /ASK/i ){
+       print "overwite $FILE$BackupExtension [Yn]\n";
+       $_=<STDIN>;
+       if( /n/i ){
+         print " - Skipping\n";
+         next;
+       }
+      }
+    }
+    if ( -l $FILE and &istrue($IgnoreLinks) ){
+      print "Skipping -- this file is a symbolic link\n";
+      next;
+    }
+    print "Processing...\n";
+    &convert($FILE);
+  } else {
+    print "Skipping -- Doesn't look like a text file to me!\n";
+    next;
+  }
+}
+
+# SetGlobals:
+# This converts the optionval array into global variables
+# this is cos I don't know how to store pointers to variables in arrys (sorry)
+sub SetGlobals
+{
+  my($i)=0;
+
+  $SearchURLS =                $optionval[$i++];
+  $DocumentRoot =      $optionval[$i++];
+  $UserDir =           $optionval[$i++];
+  $MakeBackup =                $optionval[$i++];
+  $BackupExtension =   $optionval[$i++];
+  $OverwriteBackup =   $optionval[$i++];
+  $ChangeIfThere =     $optionval[$i++];
+  $Skip1x1 =           $optionval[$i++];
+  $SkipThreshold =     $optionval[$i++];
+  $DoChmodChown =      $optionval[$i++];
+  $UpcaseTags =                $optionval[$i++];
+  $UpcaseNewTags =     $optionval[$i++];
+  $TryServer =         $optionval[$i++];
+  $QuoteNums =         $optionval[$i++];
+  $MungePer =          $optionval[$i++];
+  $NeedAlt =           $optionval[$i++];
+  $SkipCGI =           $optionval[$i++];
+  $UseNewGifsize =     $optionval[$i++];
+  $UseHash =           $optionval[$i++];
+  $Base =              $optionval[$i++];
+  $InFilter =          $optionval[$i++];
+  $OutFilter =         $optionval[$i++];
+  $Quiet =             $optionval[$i++];
+  $Script =            $optionval[$i++];
+  $Proxy =             $optionval[$i++];
+  $SkipFilter =                $optionval[$i++];
+  $IgnoreLinks =       $optionval[$i++];
+  $UsePerlCp   =        $optionval[$i++];
+
+  # do a quick check just to see we got everything
+  $i--;
+  if( $i!=$#optionval ){
+    print "Internal Error: number of options is not equal to globals!\n";
+    print "Please Email alex\@ed.ac.uk for help\n";
+    exit;
+  }
+}
+
+###########################################################################
+# Subroutine does all the actual HTML parsing --- grabs image URLs and tells
+# other routines to open the images and get their size
+###########################################################################
+sub convert {
+  my($file) = @_;
+  my($ox,$oy,$nx,$ny);
+  my($changed,$type,$tag,$five,$user,$original,@original);
+  my($widthtag,$heighttag);
+  my($HTMLbase,$i);
+  my(@PATH,$REL,$rel);
+
+  my($ino, $mode, $uid, $gid, $ngid, $nuid );
+
+  $changed=0;  # did we change this file
+  $original="";        # the string containing the whole file
+
+  $widthtag=&istrue($UpcaseNewTags)?"WIDTH":"width";
+  $heighttag=&istrue($UpcaseNewTags)?"HEIGHT":"height";
+
+
+  if( !open(ORIGINAL, $InFilter =~ /\S+/ ? "$InFilter $file|" : "<$file") ){
+    print "Couldn't open $file\n";
+    return;
+  }
+  while (<ORIGINAL>) {
+    $original .= $_;
+  }
+  close (ORIGINAL);
+  @PATH = split(/[\\\/]/, $file); # \\ for NT (brian_helterline@om.cv.hp.com)
+  pop(@PATH);
+  $REL = join("/", @PATH);
+
+  # print out the header to the columns
+  printf(" %s %-34s %-9s %-9s\n",'Type','File','   Old','   New') if (isfalse($Quiet));
+
+  @original=split(/</, $original);
+  for ($i=0; $i <= $#original; $i++) {
+    # make the tags upper case if that's is what the user wants
+    if( &istrue( $UpcaseTags) && $original[$i] !~ /^!--/ ){
+      $original[$i]=&changecase($original[$i]);
+    }
+
+    if ($original[$i] =~ /^BASE\s+HREF\s*=\s*(\"[^\"]+\"|\'[^\']+\'|\S+)/i){ #"
+      # we found a BASE tag this is quite important to us!
+      $HTMLbase=&strip_quotes($1);
+      print " BASE $HTMLbase\n" if (isfalse($Quiet));
+    } elsif ($original[$i] =~
+            /^((IMG|FIGURE|INPUT)\s+([^\000]*\s+)?SRC\s*=\s*(\"[^\"]+\"|\'[^\']+\'|\S+)[^\000]*)>/i){       #"
+      # we found an IMG or FIGURE tag! this is really important
+
+      # initialise some of my flags
+      if( !defined($1) || !defined($2) || !defined($4) ){
+       print "  Couldn't find tagtype or images source for tag number $i!\n";
+       return;
+      }
+      $tag=$1;  # The whole HTML tag (with attributes)
+      $type=$2; # this is either IMG or FIGURE
+      $five=$4; # we put the SRC in a variable called five for historic reasons
+      $five=&strip_quotes($five);
+      $ox=0; $oy=0; # old X & Y values (Was Width & Height)
+      $nx=0; $ny=0; # the new values
+
+      printf("  %3s %-34s ",substr($type,0,3),$five) if (isfalse($Quiet));
+
+      if(&istrue($SkipCGI) &&
+        $five =~ /(\.(cgi|pl)$|\/cgi-bin\/|\/cgi\/)/ ){
+       print "\"$file\": Skipping CGI program\n" if (isfalse($Quiet));
+       next;
+      }
+      if( $SkipFilter && $five =~/$SkipFilter/i ){
+       print "\"$file\": SkipFilter matched\n" if (isfalse($Quiet));
+       next;
+      }
+
+      if( $tag =~ /(width|height)\s*=\s*[\"\']?\d+%/i ){ #"
+       # we found a % sign near width or height
+       if( ! &istrue($MungePer) ){
+         print "\"$file\": Found % Skipping\n";
+         next;
+       }
+      } else {
+       $ox=$2 if( $tag =~ /\s*width\s*=\s*(\"|\')?(\d+)\s*/i );  #"
+       $oy=$2 if( $tag =~ /\s*height\s*=\s*(\"|\')?(\d+)\s*/i ); #"
+      }
+
+      printf("(%3d,%3d) ",$ox,$oy) if (isfalse($Quiet));
+
+      if( $ox && $oy && &isfalse($ChangeIfThere) ){
+       print "Already There\n";
+       next;
+      }
+
+      if( defined($HTMLbase) && $HTMLbase =~ /\S+/ ){
+       print "\nUsing HTMLbase to turn:$five\n" if $debug;
+       $five=&ARKjoinURL($HTMLbase,$five);
+       print "Into                :$five\n"     if $debug;
+      }
+
+      if ($five =~ /^http:\/\/.*/) {
+       if (&istrue($SearchURLS)) {
+         ($nx,$ny) = &URLsize($five);
+       }
+      } elsif ($five =~ /^\/\~.*/) {
+       @PATH = split(/\//, $five);
+       shift(@PATH); $user = shift(@PATH) ; $rel = join ("/", @PATH);
+       $user =~ s/^\~//;
+       $user=(getpwnam( $user ))[7];
+       print "User dir is $user/$UserDir/$rel\n" if $debug;
+       ($nx,$ny) = &imgsize("$user/$UserDir/$rel",$five);
+      } elsif ($five =~ /^\/.*/) {
+       ($nx,$ny) = &imgsize("$DocumentRoot$five",$five);
+      } else {
+       if ($REL eq '') {
+         ($nx,$ny) = &imgsize("$five",$five);
+       } else {
+         ($nx,$ny) = &imgsize("$REL/$five",$five);
+       }
+      }
+
+      if( $nx==0 && $ny==0 ){
+       print "\"$file\": No Values : $!\n";
+       next;
+      }
+
+      printf( "(%3d,%3d) ", $nx,$ny) if (isfalse($Quiet));
+
+      if(&istrue($Skip1x1) &&
+        $nx==1 && $ny==1){
+       print "Skipping 1x1 image\n" if (isfalse($Quiet));
+       next;
+      }
+
+      if (&istrue($SkipThreshold) && $nx<=$SkipThreshold &&
+          $ny<=$SkipThreshold){
+        print "Skipping $nx"."x$ny image (\$SkipThreshold=$SkipThreshold)\n" if
+          (isfalse($Quiet));
+        next;
+      }
+
+      if( $nx && $ny && &do_change($ox,$oy,$nx,$ny)){
+       $changed=1;             # mark the page as changed
+       $original[$i]=&replce_attrib($original[$i],$heighttag,$ny);
+       $original[$i]=&replce_attrib($original[$i],$widthtag,$nx);
+       if( $ox==0 && $oy==0 ){
+         print "Added tags " if (isfalse($Quiet));
+       } else {
+         print "Updated " if (isfalse($Quiet));
+       }
+      }
+
+      print "Needs Alt" if(&istrue($NeedAlt) && $tag !~ /ALT\s*=\s*\S+/i );
+
+      print "\n" if (isfalse($Quiet));
+    }
+  }
+
+  if( !($changed)) {
+    print " No need to write \"$file\": nothing changed\n";
+    return;
+  }
+
+  if( ! &isfalse($MakeBackup) ){
+    # maybe I should move the rest of this stuff into a separate function?
+    if( &istrue($DoChmodChown) ){
+      # find out about this file
+      ($ino,$mode,$uid,$gid) = (stat($file))[1,2,4,5];
+      if ($ino == 0 || !rename($file, "$file$BackupExtension")) {
+       if( $ino == 0 ){
+         print "Couldn't stat \"$file\" for permissions & ownership: $!\n";
+       } else {
+         print "couldn't rename \"$file\" for backup: $!\n";
+       }
+       return;
+      }
+    } else {
+      if( &istrue( $UsePerlCp ) ){
+       copy( $file, "$file$BackupExtension" );
+      } else {
+       # system( "cp $file $file$BackupExtension" );
+       # we could have added the -p flag e.g. cp -p ....
+       # use copy cos this keeps the permissions the same!
+       system( "cp -p $file $file$BackupExtension" );
+      }
+    }
+  }
+
+  $file="output.html" if $debug;
+
+  if(open(CONVERTED, $OutFilter =~ /\S+/ ? "|$OutFilter $file" : ">$file") ){
+    print CONVERTED join("<", @original);
+    close(CONVERTED);
+
+    if( &istrue($DoChmodChown) ){
+      # now change the ownership & permissions
+      chmod $mode, $file || print "Warning: Couldn't chmod $file\n";
+      # It seems that chown doesn't necessarily indicate any errors
+      chown $uid, $gid, $file || print "Warning: Couldn't chown $file\n";
+
+      ($nuid,$ngid) = (stat($file))[4,5];
+      if ($nuid != $uid ||
+         $ngid != $gid   ){
+       print "Warning: $file now has different group or owner\n";
+      }
+    }
+    # if we defined a script to run the make it so....
+    system("$Script $file")     if( $Script =~ /\S+/ );
+  } else {
+    print "Either: could not backup or could not write to $file!\n";
+  }
+}
+
+# replaces the $attrib's value to $val in $line
+# if $attrib is not present it is inserted at the start of the tag
+sub replce_attrib
+{
+  my($line,$attrib,$val)=@_;
+  my( $start, $oldval );
+
+  # argument checking
+  if(!defined($line ) ||
+     !defined($attrib) ||
+     !defined($val)){
+    print "Error: dodgy arguments to replace_attrib!\n";
+    return $line if(defined($line)); # have no effect if we can
+    exit;
+  }
+
+  $attrib =~ tr/[A-Z]/[a-z]/ if($UpcaseTags=~/lower/i);
+
+  if( !(&isfalse($QuoteNums)) ){
+    if( $QuoteNums =~ /single/i ){
+      $val = "\'" . $val . "\'";
+    } else {
+      $val = "\"" . $val . "\"";
+    }
+  }
+
+  if( $line =~ /(\s+$attrib\s*=\s*)([\'\"]?\d+%?[\'\"]?)[^\000]*>/i ){ #"
+    $start=$1;
+    $oldval=$2;
+    $line =~ s/$start$oldval/$start$val/;
+  } else {
+    $line =~ s/(\S+\s+)/$1$attrib=$val /;
+  }
+  return $line;
+}
+
+sub ask_for_change{
+  my($ret)=1;
+  print "Change [Yn]?";
+  $_=<STDIN>;
+  if( /n/i ){
+    $ret=0;
+  }
+  return $ret;
+}
+
+sub do_change{
+  my($oldwidth, $oldheight, $newwidth, $newheight) = @_;
+  my($wrat);
+  my($hrat);
+
+  return 0 if (!defined($oldwidth)     ||
+              !defined($oldheight)     ||
+              !defined($newwidth)      ||
+              !defined($newheight)     ||
+              !($newwidth)             ||
+              !($newheight)              ||
+              ($oldwidth ==$newwidth &&
+               $newheight==$oldheight));
+
+  return 1 if(!($oldwidth) && !($oldheight) );
+
+  if( &isfalse($ChangeIfThere) ){
+    return 0;
+  } elsif( $ChangeIfThere =~ /clever/i ){
+    if( $oldwidth ){
+      eval { $wrat= $newwidth  / $oldwidth  }; warn $@ if $@;
+      if( $wrat < 1.0 ){
+       eval {$wrat = 1/ $wrat }; warn $@ if $@;
+      }
+    } else {
+      $wrat=1.5;
+    }
+    if( $oldheight ){
+      eval { $hrat= $newheight / $oldheight }; warn $@ if $@;
+      if( $hrat < 1.0 ){
+       eval {$hrat = 1/ $hrat }; warn $@ if $@;
+      }
+    } else {
+      $hrat=1.5;
+    }
+    if((int($wrat) == $wrat) &&
+       (int($hrat) == $hrat) ){
+      return 0;
+    } else {
+      return &ask_for_change();
+    }
+  } elsif($ChangeIfThere =~ /ask/i){
+    return &ask_for_change();
+  }
+  return 1;
+}
+
+# looking at the filename really sucks I should be using the first 4 bytes
+# of the image. If I ever do it these are the numbers.... (from chris@w3.org)
+#  PNG 89 50 4e 47
+#  MNG 8a 4d 4e 47
+#  GIF 47 49 46 38
+#  JPG ff d8 ff e0
+#  XBM 23 64 65 66
+sub imgsize {
+  my($file)= shift @_;
+  my($ref)=@_ ? shift @_ : "";
+  my($x,$y)=(0,0);
+
+  # first check the hash table (if we use one)
+  # then try and open the file
+  # then try the server if we know of one
+  if(&istrue($UseHash) &&
+     $hashx{$file}     &&
+     $hashy{$file}     ){
+    print "Hash " if $debug;
+    $x=$hashx{$file};
+    $y=$hashy{$file};
+  } elsif( defined($file) && open(STRM, "<$file") ){
+    binmode( STRM ); # for crappy MS OSes - Win/Dos/NT use is NOT SUPPORTED
+    if ($file =~ /\.jpg$/i || $file =~ /\.jpeg$/i) {
+      ($x,$y) = &jpegsize(\*STRM);
+    } elsif($file =~ /\.gif$/i) {
+      ($x,$y) = &gifsize(\*STRM);
+    } elsif($file =~ /\.xbm$/i) {
+      ($x,$y) = &xbmsize(\*STRM);
+    } elsif($file =~ /\.[pm]ng$/i) {
+      ($x,$y) = &pngsize(\*STRM);
+    } else {
+      print "$file is not gif, xbm, jpeg, png or mng (or has stupid name)";
+    }
+    close(STRM);
+
+    if(&istrue($UseHash) && $x && $y){
+      $hashx{$file}=$x;
+      $hashy{$file}=$y;
+    }
+
+  } else {
+    # we couldn't open the file maybe we want to try the server?
+
+    if(&istrue($TryServer) &&
+       defined($ref) &&
+       $ref =~ /\S+/ &&
+       $Base =~ /\S+/ ){
+      $ref= &ARKjoinURL( $Base, $ref );
+      print "Trying server for $ref\n" if $debug;
+
+      ($x,$y)=&URLsize($ref);
+    }
+  }
+
+  return ($x,$y);
+}
+
+###########################################################################
+# Subroutine gets the size of the specified GIF
+###########################################################################
+sub gifsize
+{
+  my($GIF) = @_;
+  if( &istrue($UseNewGifsize) ){
+    return &NEWgifsize($GIF);
+  } else {
+    return &OLDgifsize($GIF);
+  }
+}
+
+
+sub OLDgifsize {
+  my($GIF) = @_;
+  my($type,$a,$b,$c,$d,$s)=(0,0,0,0,0,0);
+
+  if(defined( $GIF )           &&
+     read($GIF, $type, 6)      &&
+     $type =~ /GIF8[7,9]a/     &&
+     read($GIF, $s, 4) == 4    ){
+    ($a,$b,$c,$d)=unpack("C"x4,$s);
+    return ($b<<8|$a,$d<<8|$c);
+  }
+  return (0,0);
+}
+
+# part of NEWgifsize
+sub gif_blockskip {
+  my ($GIF, $skip, $type) = @_;
+  my ($s)=0;
+  my ($dummy)='';
+
+  read ($GIF, $dummy, $skip);  # Skip header (if any)
+  while (1) {
+    if (eof ($GIF)) {
+      warn "Invalid/Corrupted GIF (at EOF in GIF $type)\n";
+      return "";
+    }
+    read($GIF, $s, 1);         # Block size
+    last if ord($s) == 0;      # Block terminator
+    read ($GIF, $dummy, ord($s));      # Skip data
+  }
+}
+
+# this code by "Daniel V. Klein" <dvk@lonewolf.com>
+sub NEWgifsize {
+  my($GIF) = @_;
+  my($cmapsize, $a, $b, $c, $d, $e)=0;
+  my($type,$s)=(0,0);
+  my($x,$y)=(0,0);
+  my($dummy)='';
+
+  return($x,$y) if(!defined $GIF);
+
+  read($GIF, $type, 6);
+  if($type !~ /GIF8[7,9]a/ || read($GIF, $s, 7) != 7 ){
+    warn "Invalid/Corrupted GIF (bad header)\n";
+    return($x,$y);
+  }
+  ($e)=unpack("x4 C",$s);
+  if ($e & 0x80) {
+    $cmapsize = 3 * 2**(($e & 0x07) + 1);
+    if (!read($GIF, $dummy, $cmapsize)) {
+      warn "Invalid/Corrupted GIF (global color map too small?)\n";
+      return($x,$y);
+    }
+  }
+ FINDIMAGE:
+  while (1) {
+    if (eof ($GIF)) {
+      warn "Invalid/Corrupted GIF (at EOF w/o Image Descriptors)\n";
+      return($x,$y);
+    }
+    read($GIF, $s, 1);
+    ($e) = unpack("C", $s);
+    if ($e == 0x2c) {          # Image Descriptor (GIF87a, GIF89a 20.c.i)
+      if (read($GIF, $s, 8) != 8) {
+       warn "Invalid/Corrupted GIF (missing image header?)\n";
+       return($x,$y);
+      }
+      ($a,$b,$c,$d)=unpack("x4 C4",$s);
+      $x=$b<<8|$a;
+      $y=$d<<8|$c;
+      return($x,$y);
+    }
+    if ($type eq "GIF89a") {
+      if ($e == 0x21) {                # Extension Introducer (GIF89a 23.c.i)
+       read($GIF, $s, 1);
+       ($e) = unpack("C", $s);
+       if ($e == 0xF9) {       # Graphic Control Extension (GIF89a 23.c.ii)
+         read($GIF, $dummy, 6);        # Skip it
+         next FINDIMAGE;       # Look again for Image Descriptor
+       } elsif ($e == 0xFE) {  # Comment Extension (GIF89a 24.c.ii)
+         &gif_blockskip ($GIF, 0, "Comment");
+         next FINDIMAGE;       # Look again for Image Descriptor
+       } elsif ($e == 0x01) {  # Plain Text Label (GIF89a 25.c.ii)
+         &gif_blockskip ($GIF, 12, "text data");
+         next FINDIMAGE;       # Look again for Image Descriptor
+       } elsif ($e == 0xFF) {  # Application Extension Label (GIF89a 26.c.ii)
+         &gif_blockskip ($GIF, 11, "application data");
+         next FINDIMAGE;       # Look again for Image Descriptor
+       } else {
+         printf STDERR "Invalid/Corrupted GIF (Unknown extension %#x)\n", $e;
+         return($x,$y);
+       }
+      }
+      else {
+       printf STDERR "Invalid/Corrupted GIF (Unknown code %#x)\n", $e;
+       return($x,$y);
+      }
+    }
+    else {
+      warn "Invalid/Corrupted GIF (missing GIF87a Image Descriptor)\n";
+      return($x,$y);
+    }
+  }
+}
+
+sub xbmsize {
+  my($XBM) = @_;
+  my($input)="";
+
+  if( defined( $XBM ) ){
+    $input .= <$XBM>;
+    $input .= <$XBM>;
+    $input .= <$XBM>;
+    $_ = $input;
+    if( /.define\s+\S+\s+(\d+)\s*\n.define\s+\S+\s+(\d+)\s*\n/i ){
+      return ($1,$2);
+    }
+  }
+  return (0,0);
+}
+
+#  pngsize : gets the width & height (in pixels) of a png file
+# cor this program is on the cutting edge of technology! (pity it's blunt!)
+#  GRR 970619:  fixed bytesex assumption
+sub pngsize {
+  my($PNG) = @_;
+  my($head) = "";
+# my($x,$y);
+  my($a, $b, $c, $d, $e, $f, $g, $h)=0;
+
+  if(defined($PNG)                             &&
+     read( $PNG, $head, 8 ) == 8               &&
+     ( $head eq "\x8a\x4d\x4e\x47\x0d\x0a\x1a\x0a" ||
+       $head eq "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a" )  &&
+     read($PNG, $head, 4) == 4                 &&
+     read($PNG, $head, 4) == 4                 &&
+     ($head eq "MHDR" ||
+      $head eq "IHDR")                          &&
+     read($PNG, $head, 8) == 8                         ){
+#   ($x,$y)=unpack("I"x2,$head);   # doesn't work on little-endian machines
+#   return ($x,$y);
+    ($a,$b,$c,$d,$e,$f,$g,$h)=unpack("C"x8,$head);
+    return ($a<<24|$b<<16|$c<<8|$d, $e<<24|$f<<16|$g<<8|$h);
+  }
+  return (0,0);
+}
+
+# jpegsize : gets the width and height (in pixels) of a jpeg file
+# Andrew Tong, werdna@ugcs.caltech.edu           February 14, 1995
+# modified slightly by alex@ed.ac.uk
+sub jpegsize {
+  my($JPEG) = @_;
+  my($done)=0;
+  my($c1,$c2,$ch,$s,$length, $dummy)=(0,0,0,0,0,0);
+  my($a,$b,$c,$d);
+
+  if(defined($JPEG)            &&
+     read($JPEG, $c1, 1)       &&
+     read($JPEG, $c2, 1)       &&
+     ord($c1) == 0xFF          &&
+     ord($c2) == 0xD8          ){
+    while (ord($ch) != 0xDA && !$done) {
+      # Find next marker (JPEG markers begin with 0xFF)
+      # This can hang the program!!
+      while (ord($ch) != 0xFF) { return(0,0) unless read($JPEG, $ch, 1); }
+      # JPEG markers can be padded with unlimited 0xFF's
+      while (ord($ch) == 0xFF) { return(0,0) unless read($JPEG, $ch, 1); }
+      # Now, $ch contains the value of the marker.
+      if ((ord($ch) >= 0xC0) && (ord($ch) <= 0xC3)) {
+       return(0,0) unless read ($JPEG, $dummy, 3);
+       return(0,0) unless read($JPEG, $s, 4);
+       ($a,$b,$c,$d)=unpack("C"x4,$s);
+       return ($c<<8|$d, $a<<8|$b );
+      } else {
+       # We **MUST** skip variables, since FF's within variable names are
+       # NOT valid JPEG markers
+       return(0,0) unless read ($JPEG, $s, 2);
+       ($c1, $c2) = unpack("C"x2,$s);
+       $length = $c1<<8|$c2;
+       last if (!defined($length) || $length < 2);
+       read($JPEG, $dummy, $length-2);
+      }
+    }
+  }
+  return (0,0);
+}
+
+# this is untested contributed code From: Jan Paul Schmidt <jps@fundament.org>
+# if you have problems with the jpegsize above - try this one!
+sub jpegsize2
+{
+  my($JPEG) = @_;
+  my( $i, $w, $y, $h, $j, $b ) = (0,0,0,0,0,0);
+
+  read $JPEG, $b, 4;
+  $j = unpack "N", $b;
+  
+  if ($j == 0xffd8ffe0) {
+    do {
+      read $JPEG, $b, 2;
+      seek $JPEG, unpack("n", $b) - 2, 1;
+      read $JPEG, $b, 2;
+      $j = unpack "n", $b;
+      if ($j >= 0xffc0 and $j <= 0xffc3) { 
+       seek $JPEG, 3, 1;
+       
+       read $JPEG, $b, 2;
+       $h = unpack "n", $b;
+       
+       read $JPEG, $b, 2;
+       $w = unpack "n", $b;
+       goto done; # last;
+      }
+    } while not eof($JPEG);
+  done:
+  }
+  return ($w, $h );
+}
+
+###########################################################################
+# Subroutine grabs a gif from another server, and gets its size
+###########################################################################
+
+
+sub URLsize {
+  my($five) = @_;
+  my($dummy, $server, $url);
+  my($c1, $c2, $c3, $c4)=(0,0,0,0);
+
+  my( $x,$y) = (0,0);
+
+  print "URLsize: $five\n" if $debug;
+
+  # first check the hash table (if we're using one)
+  if(&istrue($UseHash) &&
+     $hashx{$five}     &&
+     $hashy{$five}     ){
+    print "Hash " if $debug;
+
+    $x=$hashx{$five};
+    $y=$hashy{$five};
+    return($x,$y);
+  }
+
+  if( $Proxy =~ /\S+/ ){
+    ($dummy, $dummy, $server, $url)     = split(/\//, $Proxy, 4);
+    $url=$five;
+  } else {
+    ($dummy, $dummy, $server, $url) = split(/\//, $five, 4);
+    $url= '/' . $url;
+  }
+
+  my($them,$port) = split(/:/, $server);
+  my( $iaddr, $paddr, $proto );
+
+  $port = 80 unless $port;
+  $them = 'localhost' unless $them;
+
+  print "\nThey are $them on port $port\n" if $debug;# && $Proxy;
+  print "url is $url\n"                   if $debug;
+
+  $_=$url;
+  if( /gif/i || /jpeg/i || /jpg/i || /xbm/i || /png/i ){
+
+    $iaddr= inet_aton( $them );
+    $paddr= sockaddr_in( $port, $iaddr );
+    $proto=getprotobyname('tcp');
+
+    # Make the socket filehandle.
+
+    if(socket(STRM, PF_INET, SOCK_STREAM, $proto) &&
+       connect(STRM,$paddr) ){
+      # Set socket to be command buffered.
+      select(STRM); $| = 1; select(STDOUT);
+
+      print "Getting $url\n" if $debug;
+
+      my $str=("GET $url HTTP/1.1\n".
+              #"User-Agent: Mozilla/4.08 [en] (WWWIS)\n".
+              #"Accept: */*\n".
+              "Connection: close\n".
+              "Host: $them\n\n");
+
+      print "$str" if $debug;
+
+      print STRM $str;
+
+      # we're looking for \n\r\n\r
+      while ((ord($c1) != 10) || (ord($c2) != 13) || (ord ($c3) != 10) ||
+            (ord($c4) != 13)) {
+       $c4 = $c3;
+       $c3 = $c2;
+       $c2 = $c1;
+       read(STRM, $c1, 1);
+       print "$c1" if $debug;
+      }
+      print "\n" if $debug;
+
+      if ($url =~ /\.jpg$/i || $url =~ /\.jpeg$/i) {
+       ($x,$y) = &jpegsize(\*STRM);
+      } elsif($url =~ /\.gif$/i) {
+       ($x,$y) = &gifsize(\*STRM);
+      } elsif($url =~ /\.xbm$/i) {
+       ($x,$y) = &xbmsize(\*STRM);
+      } elsif($url =~ /\.png$/i) {
+       ($x,$y) = &pngsize(\*STRM);
+      } else {
+       print "$url is not gif, jpeg, xbm or png (or has stupid name)";
+      }
+
+      close ( STRM );
+    } else {
+      # there was a problem
+      print "ERROR: $!";
+    }
+  } else {
+    print "$url is not gif, xbm or jpeg (or has stupid name)";
+  }
+  if(&istrue($UseHash) && $x && $y){
+    $hashx{$five}=$x;
+    $hashy{$five}=$y;
+  }
+  return ($x,$y);
+}
+
+sub istrue
+{
+  my( $val)=@_;
+  return (defined($val) && ($val =~ /^y(es)?/i || $val =~ /true/i ));
+}
+
+sub isfalse
+{
+  my( $val)=@_;
+  return (defined($val) && ($val =~ /^no?/i || $val =~ /false/i ));
+}
+
+sub strip_quotes{
+  my($name)=@_;
+
+  $_=$name; # now to gte rid of quotes if they were there
+     if(  /\"([^\"]*)\"/ ){ return $1; } #"
+  elsif(  /\'([^\']*)\'/ ){ return $1; }
+  return $name;
+}
+
+# this doesn't cope with \-ed " which it should!!!
+# I also didn't cope with javascript stuff like onChange (whoops)
+# this is why it is unsupported.
+sub changecase{
+  my($text)=@_;
+  my( @line )=();
+  my( $ostr, $str, $j )=("","",0);
+
+  $text=~/^([^>]*)>/;
+  return $text if( !defined($1));
+  $ostr=$str=$1;
+
+  @line=split(/\"/, $str); #"
+
+  for( $j=0 ; $j <= $#line ; $j+=2 ){
+    if( $UpcaseTags =~ /lower/i ){
+      $line[$j] =~ tr/[A-Z]/[a-z]/;
+    } else {
+      $line[$j] =~ tr/[a-z]/[A-Z]/;
+    }
+  }
+  if( $str =~ /\"$/ ){ #"
+    $str=join( "\"", @line , "");
+  } else {
+    $str=join( "\"", @line );
+  }
+  $text=~ s/^$ostr/$str/;
+
+  return $text;
+}
+
+# joins together two URLS to make one url
+# e.g. http://www/             +  fish.html = http://www/fish.html
+# e.g. http://www/index.html   +  fish.html = http://www/fish.html
+# e.g. http://www/s/index.html + /fish.html = http://www/fish.html
+sub ARKjoinURL
+{
+  my($base,$url)=@_;
+
+  # if url has a double // in it then it is fine thank you!
+  return $url if( $url =~ /\/\// );
+
+  # strip down base url to make sure that it doesn't have a .html at the end
+  $base=~s/[^\/]*$//;
+
+  if( $url =~ /^\// ){
+    # strip off leading directories
+    $base =~ s/(\/\/[^\/]*)\/.*$/$1/;
+  }
+
+  return ($base . $url);
+}
+
+# File: wwwis-options.pl               -*- Perl -*-
+# Created by: Alex Knowles (alex@ed.ac.uk) Sat Nov  2 16:41:12 1996
+# Last Modified: Time-stamp: <03 Nov 96 1549 Alex Knowles>
+# RCS $Id: wwwis,v 2.43 2004/12/02 18:32:13 ark Exp $
+############################################################################
+# There now follows some routines to get the configuration file
+############################################################################
+
+# NextOption:
+# give me the start of the next option (as options can take up a
+# different number of array elements)
+sub NextOption
+{
+  my($i) = @_;
+
+  $_=$options[$i+1];
+  if( /string/i || /integer/i || /file/i || /bool/i ){
+    $i+=3;
+  } elsif( /choice/i ){
+    $i+=4+$options[$i+3];
+  }else {
+    print "unknown option type! $_\n";
+    exit 2;
+  }
+  return $i;
+}
+
+# ShowOptions: now I use -usage it's much better
+
+# CheckOption:
+# Check if $val (arg2) is valid for option which starts at options[$i (arg1)]
+# returns either 0 (failure) or 1 (success)
+sub CheckOption
+{
+  my($i,$val) = @_;
+  my($k);
+
+  return 0 unless $i && $val;
+
+  $_=$options[$i+1];
+  if( /string/i ){
+    # can't think of a check for this
+  }elsif( /integer/i ){
+    if( $val !~ /^\d+$/ ){
+      print "$val is not an integer!\n";
+      return 0;
+    }
+  } elsif( /file/i ){
+    if( ! (-e ($val) ) ){
+      print "can't find file $val for $options[$i]\n";
+      return 0;
+    }
+  }elsif( /bool/i ){
+    if( $val !~ /^(y(es)?|no?)$/i ){
+      print "$val is neither Yes nor No\n";
+      return 0;
+    }
+  }elsif( /choice/i ){
+    for( $k=0 ; $k < $options[$i+3] ; $k++ ){
+      if( $val =~ /^$options[$i+4+$k]$/i ){
+       return 1;
+      }
+    }
+    print "$val is not a valid value for $options[$i]\n";
+    return 0;
+  }else {
+    print "unknown option type! $_\n";
+    exit 2;
+  }
+  return 1;
+}
+
+# GetConfigFile:
+# Read user's configuration file, if such exists.  If WWWIMAGESIZERC is
+# set in user's environment, then read the file referenced, otherwise
+# try for $HOME/.wwwimagesizerc
+sub GetConfigFile
+{
+  my( @options )= @_;
+  my( @optionval )=();
+  # my(*CONFIG);
+  my($filename)="";
+  my(@files)=();
+  my($i,$j,$line);
+
+  #first go through options array and puyt the default values into optionval
+  $i=0;
+  $j=0;
+  while( $i < $#options ){
+    $optionval[$j]=$options[$i+2];
+    $i=&NextOption($i);
+    $j++;
+  }
+
+  push(@files,$ENV{'WWWISRC'}) if $ENV{'WWWISRC'};
+  push(@files,$ENV{'WWWIMAGESIZERC'}) if $ENV{'WWWIMAGESIZERC'};
+  push(@files,("$ENV{'HOME'}/.wwwisrc",
+             "$ENV{'HOME'}/.wwwimagesizerc",)) if $ENV{'HOME'};
+
+  foreach $i (@files){
+    if( defined($i) && -f $i ){
+      $filename=$i;
+      last;
+    }
+  }
+
+  if(defined($filename)        &&
+     -f $filename              &&
+     open(CONFIG,"< $filename") ){
+    while (<CONFIG>){
+      # skip lines with a hash on them
+      s/#.*$//;
+      next if /^\s*$/;
+
+      $line=$_;
+      if( $line =~ /^(\S+)(\s+|\s*:\s*)(.+)$/ ){
+       if( !(&proc_option($1,$3)) ){
+         print "Invalid .wwwisrc line: $line";
+       }
+      }
+    }
+    close CONFIG;
+  } else {
+    if( -f $filename ){
+      print "Unable to read config file `$filename': $!\n";
+    }
+  }
+  return @optionval;
+}
+
+sub proc_option
+{
+  my($opt,$value)=@_;
+  my($i,$j,$proced)=(0,0,0);
+
+  return 0 unless $opt && $value;
+
+  while( !$proced && $i < $#options ){
+    if( $options[$i] =~ /$opt/i ){
+      $proced=1;
+      if( &CheckOption($i,$value) ){
+       $optionval[$j]=$value;
+      } else {
+       printf("Invalid .wwwisrc value \"%s\" for option \"%s\"\n",
+              $value,$options[$i]);
+      }
+    }
+
+    $i=&NextOption($i);        # move onto the next option
+    $j++;
+  }
+  return $proced;
+}
+
+sub proc_arg
+{
+  my($arg)= @_;
+
+  return if !defined($arg);
+
+  if( $arg =~ /^-+v(ersion)?$/i ){
+    my($version)='$Revision: 2.43 $ ';
+    my($progname)=$0;
+    $progname =~ s/.*\///;     # we only want the name
+    $version =~ s/[^\d\.]//g;  # we only care about numbers and full stops
+    print "$progname: $version\n";
+  } elsif( $arg =~ /^-+u(sage)?$/i ||
+          $arg =~ /^-+h(elp)?$/i  ){
+    &usage();
+  } elsif( $arg =~ /^-+d(ebug)$/i ){
+    $debug=1;
+  } elsif( $arg =~ /-+im(a)?g(e)?size/i ){
+    my($x,$y)=&imgsize(shift @ARGV);
+    print "WIDTH=$x HEIGHT=$y\n";
+  } else {
+    $arg=~s/^-+//;
+    if( &proc_option( $arg, shift @ARGV)){
+      &SetGlobals();
+    } else {
+      print "Unrecognized option $arg\n";
+      &usage();
+      exit;
+    }
+  }
+
+}
+
+sub get_values
+{
+  my($i)=@_;
+  return "" if !defined $i;
+
+  if( $options[$i+1] =~ /file/i ){
+    return ();
+  } elsif($options[$i+1] =~ /string|integer/i ){
+    return ();
+  } elsif($options[$i+1] =~ /bool/i ){
+    return ('Yes','No');
+  } elsif($options[$i+1] =~ /choice/i ){
+    my($start,$end)=(($i+4),($options[$i+3]));
+    return (@options[$start .. $start+$end-1]);
+  } else {
+    print "Unrecognized option type\n";
+    exit 0;
+  }
+}
+
+sub usage
+{
+  my($progname)=$0;
+  $progname =~ s/.*\///;       # we only want the name
+  my($vals)="";
+
+  print "$progname: [-version] [-usage] [-option optionval] file.html ... \n";
+
+  my($fmt)="  %15s %6s %-10s %s\n";
+
+  printf($fmt,"Option Name","Type","Default","Values");
+  printf($fmt,"-----------","----","-------","------");
+
+  my($i,$j)=(0,0);
+
+  while( $i < $#options ){
+    $vals=join(',', &get_values($i));
+    printf($fmt,$options[$i],$options[$i+1],$optionval[$j],$vals);
+
+    $i=&NextOption($i);
+    $j++;
+  }
+}
+
+1;
diff --git a/usr_bin/xsay b/usr_bin/xsay
new file mode 100755 (executable)
index 0000000..11242cb
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Filename:      xsay
+# Purpose:       output X clipboard text via flite
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Fre Jul 14 01:29:42 CEST 2006 [mika]
+################################################################################
+
+if [ -x /usr/bin/wmiipsel ] ; then
+  flite -o play -t "$(wmiipsel)"
+else
+  if [ -x /usr/bin/wmiiplumb ] ; then
+    flite -o play -t "$(wmiiplumb)"
+  else
+    flite -o play -t "$(wmiplumb)"
+  fi
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_bin/zsh-login b/usr_bin/zsh-login
new file mode 100755 (executable)
index 0000000..c9d4e2e
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Filename:      zsh-login
+# Purpose:       run zsh with login option
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Son Mai 28 14:20:08 CEST 2006 [mika]
+################################################################################
+
+[ -r /etc/grml_version ] && GRMLVERSION=$(cat /etc/grml_version) || GRMLVERSION='(no version information available)'
+
+echo "
+
+Welcome to grml ${GRMLVERSION}!
+
+New to grml? Want to read some documentation?
+Start via running 'grml-info'.
+Get tips and hints via 'grml-tips \$KEYWORD'.
+New to zsh? Run 'zsh-help'.
+
+Switch to other consoles via alt-F<number> keys.
+
+Happy hacking!               http://grml.org/
+"
+
+[ -r /etc/release_info ] && cat /etc/release_info
+
+if [ -x /usr/bin/flite ] ; then
+ CMDLINE=$(cat /proc/cmdline)
+ case "$CMDLINE" in
+   *swspeak*|*blind*|*brltty*|*speakup*) flite -o play -t "Finished booting" ;;
+ esac
+fi
+
+exec /bin/zsh -l
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/PrintAnalyzer b/usr_sbin/PrintAnalyzer
new file mode 100755 (executable)
index 0000000..d31dfce
--- /dev/null
@@ -0,0 +1,613 @@
+#!/usr/bin/perl -w
+#***************************************************************************
+#    PrintAnalyzer
+#    Generate some stats from cups page_log file
+#    copyright            : (C) 1999 - 2003 by Thies Moeller                         
+#    email                : moeller@tu-harburg.de 
+#***************************************************************************
+
+#***************************************************************************
+#*                                                                         *
+#*   This program is free software; you can redistribute it and/or modify  *
+#*   it under the terms of the GNU General Public License as published by  *
+#*   the Free Software Foundation; either version 2 of the License, or     *
+#*   (at your option) any later version.                                   * 
+#*                                                                         *
+#***************************************************************************
+use strict;
+use warnings;
+use POSIX qw(strftime);
+use Time::Local;
+use Getopt::Std;
+
+
+
+##############
+# edit place of your page_log file or give it as option "-f filename"
+##############
+my %opt;
+my $PAGE_LOG_FILE;
+
+getopt("f:q",\%opt);
+
+if (exists $opt{"f"}) { $PAGE_LOG_FILE = $opt{f};}
+else {$PAGE_LOG_FILE = "/var/log/cups/page_log";}
+
+##############
+# edit start and end of normal work time
+# activity outside this interval will be marked with an "!" 
+# to disable set WorkStart to 0 and WorkEnd to 24
+##############
+my $WorkStart = 07;
+my $WorkEnd   = 22;
+
+
+############################ nothing to modify below this line ##############
+
+my %userRequests  = ();
+my %userPages     = ();
+my %hourRequests  = ();
+my %dateRequests  = ();
+my %datePages     = ();
+my %pageRequests  = ();
+my %queueRequests = ();
+my %queuePages    = ();
+my %pageHeu       = ();
+my %copyRequests  = ();
+my %logline       = ();
+my %lastlogline   = ();
+my %billingStats  = ();
+my %queueUserStats  = ();
+my $totalReq      = 0;
+my $totalPages    = 0;
+
+sub DateCompare
+{
+           my $date1 = substr($a, 6, 2) * 1024;  # Years
+            my $date2 = substr($b, 6, 2) * 1024;
+
+           $date1 += substr($a,3,2) * 64;       # Months
+           $date2 += substr($b,3,2) * 64;
+
+           $date1 += substr($a, 0, 2);          # Days
+           $date2 += substr($b, 0, 2);
+            return ($date1 <=> $date2);
+}
+
+
+sub tzdiff2sec
+{
+## this method is copied from LogReport Time.pm
+## Copyright (C) 2000-2002 Stichting LogReport Foundation LogReport@LogReport.org
+
+    die "tzdiff2sec needs 1 arg\n"
+         unless @_ == 1;
+
+    # e.g. +0100 or -0900 ; +hh:mm, +hhmm, or +hh
+    my ( $sign, $hour, $min ) = $_[0] =~ /^([+-])?(\d\d):?(\d\d)?$/
+           or die "invalid tzdiff format: $_[0]. It must looks like +0100 or -01:00\n";
+    $sign ||= "+";
+    $hour ||= 0;
+    $min  ||= 0;
+    my $sec = $hour * 60 * 60 + $min * 60;
+    $sec *= -1 if $sign eq '-';
+    return $sec;
+}
+
+sub getMonth
+{
+        my $AllMonths= 'JanFebMarAprMayJunJulAugSepOctNovDec';
+       my $month = shift(@_);
+       return index($AllMonths, $month)/3;
+}
+
+
+
+sub DateTime2Epoch
+{
+    my ($day,$month,$year,$hour,$min,$sec,$tz)=
+           unpack'@1 A2 @4 A3 @8 A4 @13 A2 @16 A2 @19 A2 @22 A5', shift();
+
+    my $epoch=timegm  $sec , 
+                     $min , 
+                     $hour, 
+                     $day,  
+                     getMonth($month),       
+                     $year;  
+    return $epoch - tzdiff2sec($tz);
+}
+
+sub PrintDayLog
+{
+       my $dateReq;
+
+############# Output Form ################
+format DAYLOG_TOP =
+
+Daily Usage
+Date               %Requests        Pages
+-----------------------------------------
+.
+
+format DAYLOG =
+@<<<<<<<<<<<<<     @>>>>>>>     @>>>>>>>   
+$dateReq,$dateRequests{$dateReq},$datePages{$dateReq}
+.
+############# Output Form ################
+
+
+        $-=0;
+        $~="DAYLOG";
+        $^="DAYLOG_TOP";
+        foreach $dateReq (sort DateCompare keys %dateRequests)
+            {
+            #printf("Monat %d\n",getMonth($dateReq));
+            write;
+            }
+}
+
+sub PrintUserLog
+{
+       my $userReq;
+       my $pageperjob;
+
+############# Output Form ################
+format USERLOG_TOP =
+PrinterAccounting
+Username            Requests      Pages   Pages/Request
+--------------------------------------------------------
+.
+
+format USERLOG =
+@<<<<<<<<<<<<<<<<<< @>>>>>>>   @>>>>>>>   @>>>>>>>>
+$userReq,           $userRequests{$userReq}, $userPages{$userReq}, $pageperjob
+.
+############# Output Form ################
+
+        $-=0;
+        $~="USERLOG";
+        $^="USERLOG_TOP";
+        foreach $userReq (sort { $userPages{$b} <=> $userPages{$a}} keys %userRequests)
+            {
+            $pageperjob = sprintf("%5d", POSIX::ceil($userPages{$userReq} / $userRequests{$userReq}));
+            write ;
+            }
+}
+
+sub PrintHourLog
+{
+       my $hourReq;
+       my $outOfWorkingTime;
+
+############# Output Form ################
+format HOURLOG_TOP =
+Hour Usage
+Hour        Requests     
+---------------------
+.
+
+format HOURLOG =
+@<@<<<<<     @>>>>>>>  
+$outOfWorkingTime,$hourReq,$hourRequests{$hourReq}
+.
+############# Output Form ################
+
+
+       $-=0;
+        $~="HOURLOG";
+        $^="HOURLOG_TOP";
+
+         foreach $hourReq (sort {$a <=> $b} keys %hourRequests)
+            {
+           if($hourReq <$WorkStart  || $hourReq > $WorkEnd)
+           {
+                   if($hourRequests{$hourReq} == 0)
+                   {
+                           next;
+                   }
+                   else
+                   {
+                           $outOfWorkingTime = "!";
+                   }
+           }
+           else
+           {
+                  $outOfWorkingTime = " ";
+           }
+            write;
+            }
+
+}
+
+sub PrintRequestSize
+{
+       my $pageReq;
+       my %pageHeu;
+       my $pageHeuK;
+        my $pageperHeu; 
+############# Output Form ################
+
+format REQUESTLOG_TOP =
+Heuristic
+JobSize         %Requests
+---------------------------
+.
+
+format REQUESTLOG =
+@|||||||||||    @>>>>>>>>
+$pageHeuK,$pageperHeu
+.
+############# Output Form ################
+
+        # sammeln der Daten
+        foreach $pageReq (sort {$a <=> $b}  keys %pageRequests)
+            {
+            if($pageReq >0 && $pageReq <=10)
+                   {$pageHeu{"1.    0-10"}+=$pageRequests{$pageReq}};
+            if ($pageReq >10 && $pageReq <=20)
+                   {$pageHeu{ "2.   20-30"}+=$pageRequests{$pageReq}};
+            if ($pageReq >20 && $pageReq <=30)
+                   {$pageHeu{ "3.   30-40"}+=$pageRequests{$pageReq}};
+            if ($pageReq >40 && $pageReq <=50)
+                   {$pageHeu{ "4.   40-50"}+=$pageRequests{$pageReq}};
+            if ($pageReq >50 && $pageReq <=100)
+                   {$pageHeu{ "5.  50-100"}+=$pageRequests{$pageReq}};
+            if ($pageReq >100 && $pageReq <=200)
+                   {$pageHeu{ "6. 100-200"}+=$pageRequests{$pageReq}};
+            if ($pageReq >200 )
+                   {$pageHeu{ "7. 200-   "}+=$pageRequests{$pageReq}};
+        }
+        $-=0;
+        $~="REQUESTLOG";
+        $^="REQUESTLOG_TOP";
+
+        foreach $pageHeuK (sort keys %pageHeu)
+            {
+            $pageperHeu = sprintf("%5.2f", 100*$pageHeu{$pageHeuK}/$totalReq);
+             write;
+        }
+}
+
+sub PrintCopySize
+{
+       my $copyReq;
+       my %copyHeu;
+        my $copyHeuK;
+       my $copyperheu;
+############# Output Form ################
+format COPY_TOP =
+Heuristic
+Copies           %Requests
+---------------------------
+.
+format COPYLOG =
+@|||||||||||||    @>>>>>>>>
+$copyHeuK,$copyperheu
+.
+############# Output Form ################
+
+        
+        foreach $copyReq (sort {$a <=> $b}  keys %copyRequests)
+            {
+            if($copyReq == 1 )
+                   {$copyHeu{" 1.    single"}+=$copyRequests{$copyReq}};
+           if($copyReq == 2)
+                   {$copyHeu{" 2.    2     "}+=$copyRequests{$copyReq}};                   
+           if($copyReq == 3)
+                   {$copyHeu{" 3.    3     "}+=$copyRequests{$copyReq}};                                   
+           if($copyReq == 4)
+                   {$copyHeu{" 4.    4     "}+=$copyRequests{$copyReq}};                                                   
+           if($copyReq >=5 && $copyReq <=10)
+                   {$copyHeu{" 5.    5-10  "}+=$copyRequests{$copyReq}};                   
+            if ($copyReq >10 && $copyReq <=20)
+                   {$copyHeu{ " 6.   20-30  "}+=$copyRequests{$copyReq}};
+            if ($copyReq >20 && $copyReq <=30)
+                   {$copyHeu{ " 7.   30-40  "}+=$copyRequests{$copyReq}};
+            if ($copyReq >40 && $copyReq <=50)
+                   {$copyHeu{ " 8.   40-50  "}+=$copyRequests{$copyReq}};
+            if ($copyReq >50 && $copyReq <=100)
+                   {$copyHeu{ " 9.  50-100  "}+=$copyRequests{$copyReq}};
+            if ($copyReq >100 && $copyReq <=200)
+                   {$copyHeu{ "10. 100-200  "}+=$copyRequests{$copyReq}};
+            if ($copyReq >200 )
+                   {$copyHeu{ "11. 200-   "}+=$copyRequests{$copyReq}};
+        }
+        $-=0;
+        $~="COPYLOG";
+        $^="COPY_TOP";
+        foreach $copyHeuK (sort keys %copyHeu)
+            {
+             $copyperheu = sprintf("%5.2f", 100*$copyHeu{$copyHeuK}/$totalReq);
+             write;
+        }
+}
+
+sub PrintQueueLog
+{
+       my $queueReq;
+       my $reqperqueue;
+       my $pagepermin;
+       my $pageperqueue ;
+############# Output Form ################
+format QUEUELOG_TOP =
+Queue Heuristic
+Queue                      %Requests        %Pages     Pages
+--------------------------------------------------------------
+.
+
+format QUEUELOG =
+@>>>>>>>>>>>>>>>>>>>>>     @>>>>>>>     @>>>>>>>      @>>>>>>>>
+$queueReq,$reqperqueue,$pageperqueue,$queuePages{$queueReq}
+.
+############# Output Form ################
+
+
+       $-=0;
+        $~="QUEUELOG";
+        $^="QUEUELOG_TOP";
+    foreach $queueReq (sort { $queuePages{$b} <=> $queuePages{$a} } keys %queuePages)
+     {
+        $reqperqueue  = sprintf("%5.2f", 100*$queueRequests{$queueReq}/$totalReq);
+       $pageperqueue = sprintf("%5.2f", 100*$queuePages{$queueReq}/$totalPages);
+        write;
+    }
+
+}
+
+sub PrintBillingLog
+{
+       my $billing;
+       my $pageperbilling ;
+       my $billinguser;
+
+############# Output Form ################
+format BILLINGLOG_TOP =
+Billing Heuristic
+Billing                           Pages
+--------------------------------------------------------------
+.
+
+format BILLINGLOG =
+@<<<<<<<<<<<<<<<<<<<<<<<<        @>>>>>>>>
+$billing,$pageperbilling
+.
+
+format BILLINGUSERLOG =
+|- @>>>>>>>>>>>>>>>>>>>>>        @>>>>>>>>
+$billinguser,$pageperbilling
+.
+############# Output Form ################
+
+
+       $-=0;
+        $~="BILLINGLOG";
+        $^="BILLINGLOG_TOP";
+    foreach $billing (sort keys %billingStats)
+     {
+       $pageperbilling = $billingStats{$billing}{"total_pages"};
+        $~="BILLINGLOG";
+        write;
+        $~="BILLINGUSERLOG";
+        foreach $billinguser ( sort {$billingStats{$billing}{"user"}{$b} <=> $billingStats{$billing}{"user"}{$a}} keys %{$billingStats{$billing}{"user"}})
+       {
+         $pageperbilling = $billingStats{$billing}{"user"}{$billinguser};
+          write;               
+       }
+    }
+
+}
+
+sub PrintQueueUserLog
+{
+       my $queue;
+       my $pageperqueue;
+       my $queueuser;
+
+############# Output Form ################
+format QUEUEUSER_TOP =
+Queue-User
+Queue                            Pages
+--------------------------------------------------------------
+.
+
+format QUEUENAME =
+@<<<<<<<<<<<<<<<<<<<<<<<<        
+$queue
+.
+
+format QUEUEUSERLOG =
+|- @>>>>>>>>>>>>>>>>>>>>>        @>>>>>>>>
+$queueuser,$pageperqueue
+.
+############# Output Form ################
+
+
+       $-=0;
+        $~="QUEUENAME";
+        $^="QUEUEUSER_TOP";
+    foreach $queue (sort keys %queueUserStats)
+     {
+        $~="QUEUENAME";
+        write;
+        $~="QUEUEUSERLOG";
+        foreach $queueuser ( sort {$queueUserStats{$queue}{$b} <=> $queueUserStats{$queue}{$a}} keys %{$queueUserStats{$queue}})
+       {
+         $pageperqueue = $queueUserStats{$queue}{$queueuser};
+          write;               
+       }
+    }
+
+}
+
+sub HandleNewJob
+{
+ my $realpages  = $lastlogline{num_pages}*$lastlogline{copies};        
+ my $hourstring = POSIX::strftime "%H", localtime($lastlogline{time}) ;
+ my $daystring  = POSIX::strftime "%d/%m/%y", localtime($lastlogline{time}) ;
+ $userRequests{$lastlogline{user}}++;
+ $userPages{$lastlogline{user}}+=$realpages;
+ $dateRequests{$daystring}++;
+ $datePages{$daystring}+=$realpages;
+ $pageRequests{$realpages}++;
+ $queueRequests{$lastlogline{printer}}++;
+ $queuePages{$lastlogline{printer}}+=$realpages;
+ $hourRequests{$hourstring}++;         
+ $copyRequests{$lastlogline{copies}}++;
+ $billingStats{$lastlogline{billing}}{"user"}{$lastlogline{user}}     += $realpages;
+ $billingStats{$lastlogline{billing}}{"printer"}{$lastlogline{printer}}  += $realpages;
+ $billingStats{$lastlogline{billing}}{"total_pages"}      += $realpages;
+ $queueUserStats{$lastlogline{printer}}{$lastlogline{user}} += $realpages;
+
+ $totalReq++;
+ $totalPages+=$realpages;
+}
+
+sub InitHourHistogram
+{
+ my $i;
+ for ($i = 0 ; $i <=24 ; $i++)
+ {
+        my $hourstring = sprintf("%02d", $i);
+        $hourRequests{$hourstring}=0;
+ }
+}
+
+# main
+open(PAGELOG,"$PAGE_LOG_FILE") || die "Can't open pagelog file $PAGE_LOG_FILE";
+
+
+#initialize the hourhistogram
+InitHourHistogram;
+
+while(<PAGELOG>)
+{
+     my $time;
+     my $pagenum;
+     %logline = ();
+     chomp();
+    ($logline{printer},
+     $logline{user},
+     $logline{jobid},
+     $time,
+     $pagenum,
+     $logline{copies},
+     $logline{billing}) =
+        ($_ =~ /^(.*)\s(.*)\s(\d+)\s(\[.*\])\s(\d+)\s(\d+)\s(.*)$/)
+        or do {
+       if(! exists $opt{"q"}) {print STDERR "Cannot convert $_ \n";}
+       next;
+       };
+    # downcase username because of samba
+    $logline{user}=~ tr/A-Z/a-z/;
+    # handle empty user
+    if ($logline{user} eq "") {
+           $logline{user}="TestPages";
+    }
+    # handle empty billing code
+    if ($logline{billing} eq "") {
+           $logline{billing}="-none-";
+    }
+    my $endtime = DateTime2Epoch( $time );
+
+    if ( ! defined $lastlogline{jobid} ||  $lastlogline{jobid} ne $logline{jobid} )
+       {
+            # new job;
+            $logline{num_pages} = 1;
+            $logline{time} = $endtime;
+            if ( defined $lastlogline{jobid} ) {
+                HandleNewJob;
+                };
+        } else {
+            # same job; update info
+            $logline{num_pages} = $lastlogline{num_pages} + 1;
+            $logline{time} = $lastlogline{time};
+        }
+       %lastlogline= %logline;
+
+}
+close(PAGELOG);
+
+# handle last job
+if ( defined $lastlogline{jobid} ) {
+     HandleNewJob;
+     }
+
+
+
+PrintQueueLog;
+PrintQueueUserLog;
+PrintRequestSize;
+PrintCopySize;
+PrintBillingLog;
+PrintUserLog;
+PrintHourLog;
+PrintDayLog;
+
+__END__
+
+=head1 NAME
+
+PrintAnalyzer - create statistics from CUPS page_log file
+
+=head1 SYNOPSIS
+
+ PrintAnalyzer [-f filename][-q] 
+
+=head1 DESCRIPTION
+
+This Tool generates statistics from the CUPS page_log file.
+
+Features:
+
+=over 8
+
+=item Queue usage
+
+=item Pages per user per queue (Accounting)
+
+=item Jobsize histogram (all queues in one)
+
+=item Number of copies histogram (all queues in one)
+
+=item Jobs/Pages per hour (all queues in one)
+
+=item Jobs/Pages per day (all queues in one)
+
+=item Jobs/Pages per user (all queues in one)
+
+=item Pages per Billingcode (all queues in one)
+
+=item Pages per User per Billingcode (all queues in one)
+
+=back  
+
+=head1 OPTIONS AND ARGUMENTS
+
+=over 8
+
+=item B<-f> filename
+
+Location of the page_log file
+
+=item B<-q>
+
+Quiet operation
+
+=back
+
+=head1 SEE ALSO
+
+ http://www.cups.org
+
+=head1 AUTHOR
+
+ Thies Moeller
+
+=cut
+
+
+
+
+
+
diff --git a/usr_sbin/apt-check-sigs b/usr_sbin/apt-check-sigs
new file mode 100755 (executable)
index 0000000..f94f97a
--- /dev/null
@@ -0,0 +1,241 @@
+#!/bin/bash
+
+# Copyright (c) 2001 Anthony Towns <ajt@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+rm -rf /tmp/apt-release-check
+mkdir /tmp/apt-release-check || exit 1
+cd /tmp/apt-release-check
+
+>OK
+>MISSING
+>NOCHECK
+>BAD
+
+arch=`dpkg --print-installation-architecture`
+
+am_root () {
+       [ `id -u` -eq 0 ]
+}
+
+get_md5sumsize () {
+       cat "$1" | awk '/^MD5Sum:/,/^SHA1:/' | 
+         MYARG="$2" perl -ne '@f = split /\s+/; if ($f[3] eq $ENV{"MYARG"}) { print "$f[1] $f[2]\n"; exit(0); }'
+}
+
+checkit () {
+       local FILE="$1"
+       local LOOKUP="$2"
+
+       Y="`get_md5sumsize Release "$LOOKUP"`"
+       Y="`echo "$Y" | sed 's/^ *//;s/  */ /g'`"
+
+       if [ ! -e "/var/lib/apt/lists/$FILE" ]; then
+               if [ "$Y" = "" ]; then
+                       # No file, but not needed anyway
+                       echo "OK"
+                       return
+               fi
+               echo "$FILE" >>MISSING
+               echo "MISSING $Y"
+               return
+       fi
+       if [ "$Y" = "" ]; then
+               echo "$FILE" >>NOCHECK
+               echo "NOCHECK"
+               return
+       fi
+       X="`md5sum < /var/lib/apt/lists/$FILE | cut -d\  -f1` `wc -c < /var/lib/apt/lists/$FILE`"
+       X="`echo "$X" | sed 's/^ *//;s/  */ /g'`"
+       if [ "$X" != "$Y" ]; then
+               echo "$FILE" >>BAD
+               echo "BAD"
+               return
+       fi
+       echo "$FILE" >>OK
+       echo "OK"
+}
+
+echo
+echo "Checking sources in /etc/apt/sources.list:"
+echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+echo
+(echo "You should take care to ensure that the distributions you're downloading"
+echo "are the ones you think you are downloading, and that they are as up to"
+echo "date as you would expect (testing and unstable should be no more than"
+echo "two or three days out of date, stable-updates no more than a few weeks"
+echo "or a month)."
+) | fmt
+echo
+
+cat /etc/apt/sources.list | 
+  sed 's/^ *//' | grep '^[^#]' |
+  while read ty url dist comps; do
+       if [ "${url%%:*}" = "http" -o "${url%%:*}" = "ftp" ]; then
+               baseurl="${url#*://}"
+       else
+               continue
+       fi
+
+       echo "Source: ${ty} ${url} ${dist} ${comps}"
+       
+       rm -f Release Release.gpg
+       lynx -reload -dump "${url}/dists/${dist}/Release" >/dev/null 2>&1
+       wget -q -O Release "${url}/dists/${dist}/Release"
+
+       if ! grep -q '^' Release; then
+               echo "  * NO TOP-LEVEL Release FILE"
+               >Release
+       else
+               origline=`sed -n 's/^Origin: *//p' Release | head -1`
+               lablline=`sed -n 's/^Label: *//p' Release | head -1`
+               suitline=`sed -n 's/^Suite: *//p' Release | head -1`
+               codeline=`sed -n 's/^Codename: *//p' Release | head -1`
+               dateline=`grep "^Date:" Release | head -1`
+               dscrline=`grep "^Description:" Release | head -1`
+               echo "  o Origin: $origline/$lablline"
+               echo "  o Suite: $suitline/$codeline"
+               echo "  o $dateline"
+               echo "  o $dscrline"
+
+               if [ "${dist%%/*}" != "$suitline" -a "${dist%%/*}" != "$codeline" ]; then
+                       echo "  * WARNING: asked for $dist, got $suitline/$codeline"
+               fi
+
+               lynx -reload -dump "${url}/dists/${dist}/Release.gpg" >/dev/null 2>&1
+               wget -q -O Release.gpg "${url}/dists/${dist}/Release.gpg"
+               
+               gpgv --status-fd 3 Release.gpg Release 3>&1 >/dev/null 2>&1 | sed -n "s/^\[GNUPG:\] //p" | (okay=0; err=""; while read gpgcode rest; do
+                       if [ "$gpgcode" = "GOODSIG" ]; then
+                           if [ "$err" != "" ]; then
+                               echo "  * Signed by ${err# } key: ${rest#* }"
+                           else
+                               echo "  o Signed by: ${rest#* }"
+                               okay=1
+                           fi
+                           err=""
+                       elif [ "$gpgcode" = "BADSIG" ]; then
+                           echo "  * BAD SIGNATURE BY: ${rest#* }"
+                           err=""
+                       elif [ "$gpgcode" = "ERRSIG" ]; then
+                           echo "  * COULDN'T CHECK SIGNATURE BY KEYID: ${rest%% *}"
+                           err=""
+                       elif [ "$gpgcode" = "SIGREVOKED" ]; then
+                           err="$err REVOKED"
+                       elif [ "$gpgcode" = "SIGEXPIRED" ]; then
+                           err="$err EXPIRED"
+                       fi
+                   done
+                   if [ "$okay" != 1 ]; then
+                       echo "  * NO VALID SIGNATURE"
+                       >Release
+                   fi)
+       fi
+       okaycomps=""
+       for comp in $comps; do
+               if [ "$ty" = "deb" ]; then
+                       X=$(checkit "`echo "${baseurl}/dists/${dist}/${comp}/binary-${arch}/Release" | sed 's,//*,_,g'`" "${comp}/binary-${arch}/Release")
+                       Y=$(checkit "`echo "${baseurl}/dists/${dist}/${comp}/binary-${arch}/Packages" | sed 's,//*,_,g'`" "${comp}/binary-${arch}/Packages")
+                       if [ "$X $Y" = "OK OK" ]; then
+                               okaycomps="$okaycomps $comp"
+                       else
+                               echo "  * PROBLEMS WITH $comp ($X, $Y)"
+                       fi
+               elif [ "$ty" = "deb-src" ]; then
+                       X=$(checkit "`echo "${baseurl}/dists/${dist}/${comp}/source/Release" | sed 's,//*,_,g'`" "${comp}/source/Release")
+                       Y=$(checkit "`echo "${baseurl}/dists/${dist}/${comp}/source/Sources" | sed 's,//*,_,g'`" "${comp}/source/Sources")
+                       if [ "$X $Y" = "OK OK" ]; then
+                               okaycomps="$okaycomps $comp"
+                       else
+                               echo "  * PROBLEMS WITH component $comp ($X, $Y)"
+                       fi
+               fi
+       done
+       [ "$okaycomps" = "" ] || echo "  o Okay:$okaycomps"
+       echo
+  done
+
+echo "Results"
+echo "~~~~~~~"
+echo
+
+allokay=true
+
+cd /tmp/apt-release-check
+diff <(cat BAD MISSING NOCHECK OK | sort) <(cd /var/lib/apt/lists && find . -type f -maxdepth 1 | sed 's,^\./,,g' | grep '_' | sort) | sed -n 's/^> //p' >UNVALIDATED
+
+cd /tmp/apt-release-check
+if grep -q ^ UNVALIDATED; then
+    allokay=false
+    (echo "The following files in /var/lib/apt/lists have not been validated."
+    echo "This could turn out to be a harmless indication that this script"
+    echo "is buggy or out of date, or it could let trojaned packages get onto"
+    echo "your system."
+    ) | fmt
+    echo
+    sed 's/^/    /' < UNVALIDATED
+    echo
+fi
+
+if grep -q ^ BAD; then
+    allokay=false
+    (echo "The contents of the following files in /var/lib/apt/lists does not"
+    echo "match what was expected. This may mean these sources are out of date,"
+    echo "that the archive is having problems, or that someone is actively"
+    echo "using your mirror to distribute trojans."
+    if am_root; then 
+        echo "The files have been renamed to have the extension .FAILED and"
+        echo "will be ignored by apt."
+        cat BAD | while read a; do
+            mv /var/lib/apt/lists/$a /var/lib/apt/lists/${a}.FAILED
+        done
+    fi) | fmt
+    echo
+    sed 's/^/    /' < BAD
+    echo
+fi
+
+if grep -q ^ MISSING; then
+    allokay=false
+    (echo "The following files from /var/lib/apt/lists were missing. This"
+    echo "may cause you to miss out on updates to some vulnerable packages."
+    ) | fmt
+    echo
+    sed 's/^/    /' < MISSING
+    echo
+fi
+
+if grep -q ^ NOCHECK; then
+    allokay=false
+    (echo "The contents of the following files in /var/lib/apt/lists could not"
+    echo "be validated due to the lack of a signed Release file, or the lack"
+    echo "of an appropriate entry in a signed Release file. This probably"
+    echo "means that the maintainers of these sources are slack, but may mean"
+    echo "these sources are being actively used to distribute trojans."
+    if am_root; then 
+        echo "The files have been renamed to have the extension .FAILED and"
+        echo "will be ignored by apt."
+        cat NOCHECK | while read a; do
+            mv /var/lib/apt/lists/$a /var/lib/apt/lists/${a}.FAILED
+        done
+    fi) | fmt
+    echo
+    sed 's/^/    /' < NOCHECK
+    echo
+fi
+
+if $allokay; then
+    echo 'Everything seems okay!'
+    echo
+fi
+
+rm -rf /tmp/apt-release-check
diff --git a/usr_sbin/blacklist b/usr_sbin/blacklist
new file mode 100755 (executable)
index 0000000..f17447f
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+# Filename:      blacklist / unblacklist
+# Purpose:       blacklist module via module-init-tools
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Fre Aug 04 11:41:22 CEST 2006 [mika]
+################################################################################
+
+PN="$(basename $0)"
+[ -n "$MODPROBEFILE" ] || MODPROBEFILE=/etc/modprobe.d/grml
+[ -r /etc/grml/lsb-functions ] && . /etc/grml/lsb-functions
+
+if [ -z "$1" ] ; then
+  echo "Usage: $PN <module>"
+  echo "$PN (un)blacklists module via $MODPROBEFILE"
+  exit 1
+fi
+
+if [ $UID != 0 ] ; then
+   echo Error: become root before starting $0 >& 2
+   exit 100
+fi
+
+[ -f "$MODPROBEFILE" ] || touch "$MODPROBEFILE"
+
+if [ "$PN" = 'blacklist' ] ; then
+  if grep -q "^blacklist $1" $MODPROBEFILE ; then
+     eerror "Module $1 already on blacklist in $MODPROBEFILE" ; eend 1
+  else
+    einfo "Adding module $1 to blacklist $MODPROBEFILE"
+    echo "blacklist $1" >> $MODPROBEFILE
+    echo "alias $1 off" >> $MODPROBEFILE ; eend $?
+    modprobe -l | grep -q "${1}.ko" || ( ewarn "Notice: module $1 does not seem to exist. Adding anyway." ; eend 0 )
+  fi
+fi
+
+if [ "$PN" = 'unblacklist' ] ; then
+  if grep -q "^blacklist $1" $MODPROBEFILE ; then
+    einfo "Removing module $1 from blacklist $MODPROBEFILE"
+    sed -i "s/^blacklist.*$1$/# &/" $MODPROBEFILE
+    sed -i "s/^alias.*$1 off$/# &/" $MODPROBEFILE ; eend $?
+  else
+    eerror "Module $1 not blacklisted in $MODPROBEFILE" ; eend 1
+  fi
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/bt-audio b/usr_sbin/bt-audio
new file mode 100755 (executable)
index 0000000..a467179
--- /dev/null
@@ -0,0 +1,190 @@
+#!/bin/sh
+# Filename:      bt-audio
+# Purpose:       connect bluetooth audio device (e.g. headset) to local system
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Son Aug 06 20:30:34 CEST 2006 [mika]
+################################################################################
+
+. /etc/grml/lsb-functions
+
+if [ $UID != 0 ] ; then
+   eerror "Need root privileges. Please run $0 as user root." ; eend 1
+   exit 1
+fi
+
+HCID_CONF='/etc/bluetooth/bt_headset.conf'
+[ -n "$PIN" ] || PIN='0000'
+
+case "$1" in
+  start)
+   einfo "Starting bluetooth support."
+    eindent
+
+    if ! [ -r $HCID_CONF ] ; then
+      ewarn "$HCID_CONF does not exist. Setting it up."
+      cat > $HCID_CONF <<EOF
+# Bluetooth headset configuration file created by bt-audio.
+
+# HCId options
+options {
+       # Automatically initialize new devices
+       autoinit yes;
+
+       # Security Manager mode
+       #   none - Security manager disabled
+       #   auto - Use local PIN for incoming connections
+       #   user - Always ask user for a PIN
+       #
+       security auto;
+
+       # Pairing mode
+       #   none  - Pairing disabled
+       #   multi - Allow pairing with already paired devices
+       #   once  - Pair once and deny successive attempts
+       pairing multi;
+
+       # Default PIN code for incoming connections
+       passkey "0000";
+}
+
+# Default settings for HCI devices
+device {
+       # Local device name
+       #   %d - device id
+       #   %h - host name
+       name "%h-%d";
+
+       # Local device class
+       class 0x3e0100;
+
+       # Default packet type
+       #pkt_type DH1,DM1,HV1;
+
+       # Inquiry and Page scan
+       iscan enable; pscan enable;
+
+       # Default link mode
+       #   none   - no specific policy
+       #   accept - always accept incoming connections
+       #   master - become master on incoming connections,
+       #            deny role switch on outgoing connections
+       lm accept;
+
+       # Default link policy
+       #   none    - no specific policy
+       #   rswitch - allow role switch
+       #   hold    - allow hold mode
+       #   sniff   - allow sniff mode
+       #   park    - allow park mode
+       lp rswitch,hold,sniff,park;
+}
+EOF
+    fi
+
+    if pgrep dbus-daemon 1>/dev/null; then
+      einfo "dbus already running." ; eend 0
+    else
+      einfo "Starting dbus."
+      /etc/init.d/dbus start 1>/dev/null ; eend $?
+    fi
+
+    if pgrep hcid 1>/dev/null; then
+      einfo "hicd already running." ; eend 0
+    else
+      einfo "Starting hcid."
+       HCIINFO=$(mktemp)
+       if /usr/sbin/hcid -f $HCID_CONF 1>$HCIINFO 2>&1 ; then
+         rm -f $HCIINFO
+         eend 0
+       else
+         eerror "hcid could not be started: `cat $HCIINFO`. Exiting."
+         rm -f $HCIINFO
+         eend 1
+         exit 1
+       fi
+    fi
+
+    einfo "Loading bluetooth modules:"
+    for module in bluetooth ohci1394 hci_usb snd-bt-sco ; do
+      eindent
+      einfo "$module" ; modprobe $module ; eend $?
+      eoutdent
+    done
+
+    einfo "Scanning for bluetooth audio device. Press the 'connect' button on the device!"
+    einfo "Scanning might take a while. Searching..."
+    SUCCESS=$(mktemp)
+    ERROR=$(mktemp)
+
+    if hcitool scan 1>${SUCCESS} 2>${ERROR} ; then
+     if ! grep -q ':' $SUCCESS ; then
+        eerror "Could not find any devices. Exiting." ; eend 1
+        exit 1
+     else
+     ID=$(grep '[[:alnum:]][[:alnum:]]:' $SUCCESS | awk '{print $1}')
+      if [ -n "$ID" ] ; then
+       einfo "Success: connected device ${ID}." ; eend 0
+       logger -t "bluez-connect" "connected human input device ${ID}"
+       btsco -v $ID 1>/dev/null &
+       # hcitool cc $ID
+      else
+       ewarn "Warning: searching for device succeded but no connection could be established."
+      fi
+     fi
+    else
+      eerror "Error: `cat $ERROR`" ; eend 1
+    fi
+
+    rm -f $SUCCESS $ERROR
+    ;;
+  stop)
+    einfo "Stopping hcid."
+    killall hcid ; eend $? # workaround because start-stop-daemon does not work :-/
+    ewarn "Will not stop dbus as it might be used by other services." ; eend 0
+    einfo "Disconnecting all human input devices."
+    logger -t "bluez-connect" "disconnected all human input devices"
+    hidd --killall ; eend $?
+    ;;
+  restart|force-reload)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  test)
+    if [ -r /usr/share/centericq/sms.wav ] ; then
+      einfo "Trying to play /usr/share/centericq/sms.wav on headset:"
+      echo -n "   "
+      aplay -B 1000000 -D plughw:Headset  /usr/share/centericq/sms.wav 1>/dev/null ; eend $?
+    else
+      eerror "/usr/share/centericq/sms.wav does not exist. Can not test sound." ; eend 1
+    fi
+    ;;
+  status)
+    einfo "$0 - checking status:"
+    eindent
+    if pgrep hcid 1>/dev/null ; then
+      einfo "hcid running." ; eend 0
+      if [ -d /proc/asound/Headset ] ; then
+        einfo "cat /proc/asound/Headset/*/info:"
+        cat /proc/asound/Headset/*/info ; eend $?
+      else
+        eerror "Directory /proc/asound/Headset does not exist." ; eend 1
+      fi
+    else
+      eerror "hcid not running." ; eend 1
+    fi
+    eoutdent
+    ;;
+  *)
+    echo "Usage: $0 {start|stop|status|restart|force-reload|test}"
+    exit 1
+    ;;
+esac
+
+eoutdent
+
+exit 0
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/bt-hid b/usr_sbin/bt-hid
new file mode 100755 (executable)
index 0000000..47e3a86
--- /dev/null
@@ -0,0 +1,118 @@
+#!/bin/sh
+# Filename:      bt-hid
+# Purpose:       connect human input device via bluetooth to local system
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Die Aug 08 19:58:41 CEST 2006 [mika]
+################################################################################
+
+. /etc/grml/lsb-functions
+
+if [ $UID != 0 ] ; then
+   eerror "Need root privileges. Please run $0 as user root." ; eend 1
+   exit 1
+fi
+
+case "$1" in
+  start)
+   einfo "Starting bluetooth support."
+    eindent
+
+    if pgrep dbus-daemon 1>/dev/null; then
+      einfo "dbus already running." ; eend 0
+    else
+      einfo "Starting dbus."
+      /etc/init.d/dbus start 1>/dev/null ; eend $?
+    fi
+
+    if pgrep sdpd 1>/dev/null; then
+      einfo "Main bluetooth daemons seem to be already running." ; eend 0
+    else
+      einfo "Starting main bluetooth support."
+      /etc/init.d/bluetooth start 1>/dev/null ; eend $?
+    fi
+
+    if pgrep hcid 1>/dev/null; then
+      einfo "hcid already running."
+    else
+      einfo "Starting hcid."
+       HCIINFO=$(mktemp)
+       if start-stop-daemon --start --exec /usr/sbin/hcid 1>$HCIINFO 2>&1 ; then
+         rm -f $HCIINFO
+         eend 0
+       else
+         eerror "hcid could not be started: `cat $HCIINFO`. Exiting."
+         rm -f $HCIINFO
+         eend 1
+         exit 1
+       fi
+    fi
+     einfo "Loading bluetooth modules:"
+     for module in bluetooth ohci1394 hci_usb ; do
+       eindent
+       einfo "$module" ; modprobe $module ; eend $?
+       eoutdent
+     done
+
+     einfo "Scanning for human input device(s). Press the 'connect' button on the device!"
+     einfo "Scanning might take a while. Searching..."
+     SUCCESS=$(mktemp)
+     ERROR=$(mktemp)
+     if hidd --search 1>${SUCCESS} 2>${ERROR} ; then
+      if ! grep -q 'Connecting to device' $SUCCESS ; then
+         eerror "Could not find any devices. Exiting." ; eend 1
+         exit 1
+      else
+       ID=$(awk '/Connecting to device/ {print $4}' $SUCCESS)
+       if [ -n "$ID" ] ; then
+        einfo "Success: connected device ${ID}." ; eend 0
+        logger -t "bluez-connect" "connected human input device ${ID}"
+       else
+        ewarn "Warning: searching for device succeded but no connection could be established."
+       fi
+      fi
+     else
+       eerror "Error: `cat $ERROR`" ; eend 1
+     fi
+     rm -f $SUCCESS $ERROR
+    ;;
+  stop)
+    einfo "Stopping hcid."
+    killall hcid ; eend $? # workaround because start-stop-daemon does not work :-/
+    einfo "Disconnecting all human input devices."
+    logger -t "bluez-connect" "disconnected all human input devices"
+    hidd --killall ; eend $?
+    ;;
+  restart|force-reload)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  status)
+    local INFO="$(hidd --show)"
+    einfo "$0 - checking status:"
+    eindent
+    if pgrep hcid 1>/dev/null ; then
+      einfo "hcid running." ; eend 0
+    else
+      eerror "hcid not running." ; eend 1
+    fi
+    if [ -n "$INFO" ] ; then
+      einfo "$INFO" ; eend 0
+    else
+      eerror "No devices connected." ; eend 1
+    fi
+    eoutdent
+    ;;
+  *)
+    echo "Usage: $0 {start|stop|status|restart|force-reload}"
+    exit 1
+    ;;
+esac
+
+eoutdent
+
+exit 0
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/dpkg-rebuild b/usr_sbin/dpkg-rebuild
new file mode 100755 (executable)
index 0000000..ad95b6d
--- /dev/null
@@ -0,0 +1,92 @@
+#!/usr/bin/perl
+
+# Rebuild the Debian '/var/lib/dpkg/status' file from information in
+# '/var/lib/dpkg/available' and '/var/lib/dpkg/info/*.list'.  This is
+# useful if your 'status' file got corrupted if the system crashed during
+# package maintenance, for example.
+#
+# Copyright 2002 by Patrick Reynolds <reynolds@cs.duke.edu>
+# Distributed under the terms of the GNU General Public License (GPL).
+#
+# Usage:
+#   dpkg-rebuild
+# It takes no arguments and generates output in /tmp/status.
+# Move /tmp/status to /var/lib/dpkg if it looks acceptable.
+#
+# Limitations:
+#   1) Packages that are no longer available will not show up in the
+#   rebuilt 'status' file.  This means installed-but-obsolete packages
+#   can't be managed after a rebuild.
+#
+#   2) The 'Conffiles:' keys in the 'status' file are not rebuilt.
+#   Configuration files may not be completely removed when you purge
+#   packages, and package upgrades may clobber existing configuration
+#   files without asking.
+#
+#   3) The 'Essential:' keys in the 'status' file now appear after, not
+#   before, the 'Status:' keys.  I believe this is harmless.
+#
+#   4) Packages in the 'deinstall' state will appear to be in the 'purge'
+#   state.  Their configuration files will remain, but dpkg won't know
+#   about them.
+#
+#   5) Packages in transitional or error states will be misreported.
+
+$available = "/var/lib/dpkg/available";
+$status = "/tmp/status";
+$info_dir = "/var/lib/dpkg/info";
+
+foreach (<$info_dir/*.list>) {
+       s#.*/([^/]+)\.list$#$1#;
+       $installed{$_} = 1;
+}
+
+$state = 0;   # 0=between, 1=copying-installed, 2=copying-not-installed
+open(AVAILABLE, "<$available") || die "no $available";
+open(STATUS, ">$status") || die "no $status";
+while (<AVAILABLE>) {
+       chomp;
+       if ($state == 0) {
+               if (/^Package: (\S+)$/) {
+                       print STATUS "$_\n";
+                       if ($installed{$1}) {
+                               $state = 1;
+                               print STATUS "Status: install ok installed\n";
+                               delete $installed{$1};
+                       }
+                       else {
+                               $state = 2;
+                               print STATUS "Status: purge ok not-installed\n";
+                       }
+               }
+               else {
+                       die "Expected 'Package:' at $.";
+               }
+       }
+       elsif ($state == 1) {
+               if ($_ eq "") {
+                       print STATUS "\n";
+                       $state = 0;
+               }
+               elsif (!/^Architecture: / && !/^Filename: / && !/^Size: / && !/^MD5sum: /) {
+                       print STATUS "$_\n";
+               }
+       }
+       elsif ($state == 2) {
+               if ($_ eq "") {
+                       print STATUS "\n";
+                       $state = 0;
+               }
+               elsif (/^Priority: / || /^Section: /) {
+                       print STATUS "$_\n";
+               }
+       }
+       else {
+               die "Invalid state $state";
+       }
+}
+
+printf "Installed packages not found in $available:\n";
+foreach (sort keys %installed) {
+       print "  $_\n";
+}
diff --git a/usr_sbin/grml-ap b/usr_sbin/grml-ap
new file mode 100755 (executable)
index 0000000..4b1b51e
--- /dev/null
@@ -0,0 +1,215 @@
+#!/bin/sh
+# Filename:      grml-ap
+# Purpose:       set up access point on your box
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mit Okt 11 23:00:43 CEST 2006 [moemoe]
+################################################################################
+
+# exit on any error
+set -e
+
+CONFIG_FILE=/etc/grml/routersetup
+. /etc/grml/lsb-functions
+. /etc/grml/net-functions
+. /etc/grml/script-functions
+
+check4root
+
+if ! [ -r "$CONFIG_FILE" ] ; then
+        eerror "$CONFIG_FILE could not be read."
+        exit 1
+fi
+
+. "$CONFIG_FILE"
+
+[ -n "$AP_ESSID" ] || AP_ESSID=grml-ap
+[ -n "$AP_ENC" ]   || AP_ENC=off
+
+info_message() {
+        DEV="$1"
+        echo $1 | grep -q wlan && DEV=$(echo $1 | sed 's/wlan/wifi/')
+        einfo "Finished setting up access point. Make sure your device $DEV is configured:"
+        einfo "For example put the following into /etc/network/interfaces and run \"ifup $DEV=ap\""
+        echo "
+iface ap inet static
+      address 192.168.10.1
+      netmask 255.255.255.0
+      network 192.168.10.0
+      broadcast 192.168.10.255
+"
+        einfo "On the client side put the following into /etc/network/interfaces and run \"ifup \$DEV=ap\""
+        echo "
+iface ap inet static
+      address 192.168.10.2
+      netmask 255.255.255.0
+      network 192.168.10.0
+      broadcast 192.168.10.255
+      gateway 192.168.10.1
+      wireless_essid $AP_ESSID
+"
+}
+
+set_ath_mode() {
+        eindent
+          einfo "Setting $1 to mode $2"
+          iwpriv $1 mode $2 ; eend $?
+        eoutdent
+}
+
+setupWifiDevice() {
+        DEV=$1
+        einfo "Setting wireless modes on $DEV"
+        
+          eindent
+          einfo "Setting sid to: $AP_ESSID"
+          iwconfig $DEV essid $AP_ESSID ; eend $?
+
+          [ "$AP_ENC" = off ] && ENC_INFO='off' || ENC_INFO='******'
+          einfo "Settinc encrypton to: $ENC_INFO "
+          iwconfig $DEV enc $AP_ENC ; eend $?
+
+          einfo "Setting device up"
+          ifconfig $DEV up ; eend $?
+
+        eoutdent
+}
+
+setup_atheros() {
+        einfo "Atheros setup: creating new WLAN AP device"
+
+        # ugly but don't know of another workaround
+        if iwconfig 2>/dev/null | grep -A1 ath0 | grep -q 'Access Point: Not-Associated' ; then
+          einfo "Destroying old ath device"
+          wlanconfig ath0 destroy ; eend $?
+        fi
+
+        device=$(wlanconfig ath create wlandev $1 wlanmode ap)
+        eend $?
+        
+        setupWifiDevice $device
+        [ -n "$ATH_MODE" ] && set_ath_mode "$device" "$ATH_MODE"
+
+        info_message $device
+        exit 0
+}
+
+setup_hostap() {
+        einfo "Hostap setup: creating new WLAN AP device"
+        eindent
+
+          # einfo "Changing mode of $1 to AP"
+          # ifconfig $1 down ; eend $?
+  
+          # dunno if the card is pci or pcmcia, just try to unload and
+          # load both versions,
+          [ -n $(lsmod | grep ^orinoco_pci) ] && HAPT="pci"
+          [ -n $(lsmod | grep ^orinoco_cs) ]  && HAPT="cs"
+          [ -n $(lsmod | grep ^orinoco_plx) ] && HAPT="plx"
+
+          einfo "Unloading old modules"
+          modprobe -r orinoco orinoco_$HAPT
+          eend $?
+
+          einfo "Loading new modules"
+          modprobe hostap_$HAPT
+          eend $? && setupWifiDevice $1
+
+        eoutdent
+
+        info_message $1
+        exit 0
+}
+
+setup_iwconfig() {
+        einfo "Trying to set $1 into mode master"
+        ifconfig $1 down
+        iwconfig $1 mode master
+        eend $? && setupWifiDevice $1
+        exit 0
+}
+
+setup_generic() {
+        einfo "Generic setup (no hostap / atheros capable device found): creating new WLAN AP device"
+        echo "TODO! iwconfig $1 mode Ad-Hoc"
+        exit 0
+}
+
+detect_wl_cards() {
+        # If you want to extend this with a specific funtion for a
+        # special driver, please have a look at /etc/grml/net-functions
+        for i in $AP_DEVICE $(getWlanDevices) ; do
+                DRIVER=$(getLanDriver $i)
+                case $DRIVER in
+                  ath_pci)
+                       echo $i | grep -q ath && i=$(echo $i | sed 's/ath/wifi/')
+                       setup_atheros $i
+                       ;;
+                  orinoco|hostap)
+                       setup_hostap $i
+                       ;;
+                  ipw2100|prism54)
+                       setup_iwconfig $i
+                       ;;
+                  *)
+                       setup_generic $i
+                       ;;
+                esac
+        done
+}
+
+stop_devices() {
+  einfo "Searching for WLAN device with ESSID $AP_ESSID"
+  DEVICE=$(iwconfig 2>/dev/null| grep "ESSID:\"$AP_ESSID\"" | awk '{print $1}')
+  eindent
+  if [ -n "$DEVICE" ] ; then
+     for i in $DEVICE ; do
+       einfo "Found device $i" ; eend 0
+     done
+  else
+     eerror "No device(s) with ESSID $AP_ESSID found"
+     exit 1
+  fi
+  case $DEVICE in
+      ath*)
+        einfo "Shutting down $DEVICE"
+        ifdown $DEVICE
+        wlanconfig $DEVICE destroy ; eend $?
+        exit 0
+        ;;
+      *)
+        for i in $DEVICE ; do
+          einfo "Shutting down $i"
+          ifdown $i ; eend $?
+        done
+        exit 0
+        ;;
+  esac
+  eoutdent
+}
+
+case "$1" in
+    start)
+       detect_wl_cards
+       ;;
+    stop)
+       einfo "Trying to stop all present grml-ap setups"
+       stop_devices
+       ;;
+    restart)
+       $0 stop
+       sleep 1:
+       $0 start
+       ;;
+    *)
+    echo "Usage: $0 {start|stop|restart}"
+    exit 1
+    ;;
+esac
+
+eerror "Your wlan card is not supported at the moment. Sorry" ; eend 1
+exit 1
+
+## END OF FILE #################################################################
+# vim: ft=sh expandtab ai
diff --git a/usr_sbin/grml-bridge b/usr_sbin/grml-bridge
new file mode 100755 (executable)
index 0000000..1a4b9c8
--- /dev/null
@@ -0,0 +1,146 @@
+#!/bin/sh
+# Filename:      grml-bridge
+# Purpose:       set up your box as bridge
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mit Okt 11 23:02:51 CEST 2006 [moemoe]
+################################################################################
+
+# exit on any error
+set -e
+
+CONFIG_FILE=/etc/grml/routersetup
+. /etc/grml/lsb-functions
+. /etc/grml/script-functions
+
+check4root
+
+if ! [ -r "$CONFIG_FILE" ] ; then
+  eerror "$CONFIG_FILE could not be read."
+  exit 1
+fi
+
+. "$CONFIG_FILE"
+
+if [ -z "$BRIDGE_DEVICES" ] ; then
+   eerror "Bridge devices (\$BRIDGE_DEVICES) not set in $CONFIG_FILE"
+   exit 1
+fi
+
+[ -n "$BRCTL" ] || BRCTL=brctl
+[ -n "$STP"   ] || STP=on
+[ -n "$BRIDGE_NAME" ] || BRIDGE_NAME=br0
+
+check4progs $BRCTL || exit 1
+
+case "$1" in
+    start)
+        einfo "Starting bridge"
+        eindent
+            einfo "Creating bridge device"
+            brctl addbr "$BRIDGE_NAME"
+            eend $?
+            case "$BRIDGE_STP" in
+                no|false)
+                    ;;
+                *)
+                    einfo "Setting Spanning-Tree Protocol (STP) to status"
+                    brctl stp "$BRIDGE_NAME" $STP
+                    eend $?
+                    ;;
+            esac
+
+            einfo "Enabling promiscous mode on: "
+            eindent
+               for i in $BRIDGE_DEVICES ; do
+                   einfo "$i"
+                   ip link set "$i" promisc on ; eend $?
+               done
+            eoutdent
+
+            einfo "Adding network devices to $BRIDGE_NAME: "
+            eindent
+            for i in $BRIDGE_DEVICES ; do
+                einfo "$i"
+                brctl addif "$BRIDGE_NAME" $i  ; eend $?
+            done
+            eoutdent
+
+            einfo "Bringing bridge $BRIDGE_NAME up"
+            ip link set "$BRIDGE_NAME" up ; eend $?
+            eindent
+               case $BRIDGE_CONFIG in
+                       DHCP)
+                         einfo "starting dhclient for $BRIDGE_NAME"
+                         dhclient -e -pf /var/run/dhclient.$BRIDGE_NAME.pid -lf /var/run/dhclient.$BRIDGE_NAME.leases $BRIDGE_NAME
+                       ;;
+                       FIXED)
+                         einfo "Setting IP for $BRIDGE_NAME to $BRIDGE_IP"
+                         ip a a $BRIDGE_IP dev $BRIDGE_NAME
+                       ;;
+                       NONE)
+                         einfo "Leaving $BRIDGE_NAME uconfigured"
+                       ;;
+               esac
+            eoutdent
+        eoutdent
+   ;;
+
+   stop)
+        einfo "Stopping bridge"
+        eindent
+            if [ $BRIDGE_CONFIG = DHCP ]; then
+               einfo "Terminating dhclient for $BRIDGE_NAME"
+               kill $(cat /var/run/dhclient.$BRIDGE_NAME.pid);
+            fi
+            einfo "Removing network devices from $BRIDGE_NAME: "
+
+            eindent
+               for i in $BRIDGE_DEVICES ; do
+                   einfo "$i "
+                   brctl delif "$BRIDGE_NAME" $i  ; eend $?
+               done
+            eoutdent
+
+            einfo "Disabling promiscous mode on: "
+            eindent
+               for i in $BRIDGE_DEVICES ; do
+                   einfo "$i "
+                   ip link set "$i" promisc off ; eend $?
+               done
+            eoutdent
+
+            einfo "Bringing bridge: $BRIDGE_NAME down"
+            ip link set "$BRIDGE_NAME" down; eend $?
+
+            einfo "Removing bridge device"
+            brctl delbr "$BRIDGE_NAME"
+            eend $?
+        eoutdent
+   ;;
+
+   restart)
+        $0 stop
+        sleep 1
+        $0 start
+   ;;
+
+   info)
+        einfo "$0 - script which turns on basic bridging capabilities"
+        einfo "Configure via $CONFIG_FILE" ; eend 0
+   ;;
+
+   status)
+        einfo "$0 - status:"
+        $BRCTL show ; eend $?
+   ;;
+
+   *)
+        echo "Usage: $0 {start|stop|restart|status|info}"
+        exit 1
+   ;;
+esac
+
+## END OF FILE #################################################################
+# vim: ft=sh expandtab ai
diff --git a/usr_sbin/grml-config b/usr_sbin/grml-config
new file mode 100755 (executable)
index 0000000..208beb8
--- /dev/null
@@ -0,0 +1,57 @@
+#!/bin/sh
+# Filename:      grml-config
+# Purpose:       main configuration interface for running configure scripts on grml system
+# Authors:       grml-team (grml.org), (c) Nico Golde <nico@grml.org>, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mon Dec 05 11:12:59 CET 2005 [mika]
+################################################################################
+
+PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}
+
+# set up some variables
+DIALOG=$(which dialog)
+PN=$(basename $0)
+
+if [ $UID != 0 ] ; then
+   DEFAULTITEM=user
+else
+   DEFAULTITEM=root
+fi
+
+function allover() {
+MENU=$($DIALOG --stdout --clear --title "$PN" --default-item $DEFAULTITEM --menu \
+"Please select the scripts you would like to run.
+
+Report bugs, send whishes and feedback to the grml team:
+http://www.grml.org/ - contact (at) grml.org
+
+" 13 65 3 \
+"root" "Admin scripts (needs root permissions)" \
+"user" "User scripts" \
+"exit" "Exit this program")
+
+retval=$?
+
+case $retval in
+  0)
+        if [ $MENU == root ]; then
+          exec grml-config-root
+        fi
+        if [ $MENU == user ]; then
+          exec grml-config-user
+        fi
+        if [ $MENU == exit ]; then
+          exit
+        fi
+        ;;
+  1)
+        echo "Cancel pressed.";;
+  255)
+        echo "ESC pressed.";;
+esac
+}
+
+allover
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-config-root b/usr_sbin/grml-config-root
new file mode 100755 (executable)
index 0000000..55a5287
--- /dev/null
@@ -0,0 +1,78 @@
+#!/bin/sh
+# Filename:      grml-config-root
+# Purpose:       interface for configuring your grml system
+# Authors:       grml-team (grml.org), (c) Nico Golde <nico@grml.org>, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mit Jul 26 19:18:09 CEST 2006 [mika]
+################################################################################
+
+PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}
+
+# set up some variables
+DIALOG=`which dialog`
+PN=$(basename $0)
+
+if [ $UID != 0 ]
+then
+        $DIALOG --msgbox "Error: $0 requires root permissions. Exiting." 0 0
+        exit 100
+fi
+
+function allover() {
+MENU=$($DIALOG --stdout --clear --title "$PN" --menu \
+"Configure your grml system.
+
+" 0 0 0 \
+"grml-hostname" "Set hostname" \
+"grml-setlang" "Configure system wide language settings" \
+"grml-setkeyboard" "Configure system wide keyboard settings" \
+"grml-nessus" "Prepare nessus for use on grml" \
+"grml-network" "Configure network settings/setup" \
+"grml-postfix" "Configure some basic settings of the postfix MTA" \
+"grml-terminalserver" "Configure and start terminalserver for booting via network" \
+"suspenduser" "Suspend a user account for indefinite time" \
+"exit" "Exit this program")
+
+retval=$?
+
+case $retval in
+  0)
+        if [ $MENU == grml-hostname ]; then
+          exec grml-hostname
+        fi
+        if [ $MENU == grml-setlang ]; then
+          exec grml-setlang
+        fi
+        if [ $MENU == grml-setkeyboard ]; then
+          exec grml-setkeyboard
+        fi
+        if [ $MENU == grml-nessus ]; then
+          exec grml-nessus
+        fi
+        if [ $MENU == grml-network ]; then
+          exec grml-network
+        fi
+        if [ $MENU == grml-postfix ]; then
+          exec grml-postfix
+        fi
+        if [ $MENU == grml-terminalserver ]; then
+          exec grml-terminalserver
+        fi
+        if [ $MENU == suspenduser ]; then
+          exec suspenduser_gui.sh
+        fi
+        if [ $MENU == exit ]; then
+          exit
+        fi
+        ;;
+  1)
+        echo "Cancel pressed.";;
+  255)
+        echo "ESC pressed.";;
+esac
+}
+
+allover
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-hostname b/usr_sbin/grml-hostname
new file mode 100755 (executable)
index 0000000..6e0c840
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/sh
+# Filename:      grml-hostname
+# Purpose:       simple frontend to set hostname
+# Authors:       (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Sep 30 12:36:24 CEST 2006 [mika]
+################################################################################
+
+if [ $UID != 0 ] ; then
+   echo Error: become root before starting $0 >& 2
+   exit 100
+fi
+
+PN='grml-hostname'
+TMP=$(mktemp)
+OLDHOSTNAME="$(hostname)"
+
+if [ -x /usr/bin/random-hostname ] ; then
+   HOSTNAME="$(/usr/bin/random-hostname)"
+else
+   HOSTNAME="$(hostname)"
+fi
+
+bailout() {
+  rm -f $TMP
+  exit 1
+}
+trap bailout 1 2 3 15
+
+# running inside grml2hd? Don't warn because of hostname + X
+[ -n "$GRML2HD" ] || MSG='\n\nNotice: setting a different hostname while running X is *not* recommend!'
+
+HOSTNAME="$(dialog --stdout --title "${PN}" --extra-button --extra-label "Propose hostname" \
+--inputbox "Set hostname (/etc/hostname, /etc/hosts and /etc/postfix/main.cf will be adjusted)\
+\n\nTip: press 'Propose hostname' for another proposal${MSG}" 14 70 $HOSTNAME)"
+retval=$?
+
+case $retval in
+  0)
+     if hostname "$HOSTNAME" 1>/dev/null 2>${TMP} ; then
+       echo "$HOSTNAME" > /etc/hostname
+       sed -i "s/^127.0.0.1[ \t]*$OLDHOSTNAME[ \t]*localhost/127.0.0.1       $HOSTNAME localhost/" /etc/hosts
+       sed -i "s/^::1[ \t]*ip6-localhost ip6-loopback[ \t]*$OLDHOSTNAME/::1     ip6-localhost ip6-loopback $HOSTNAME/" /etc/hosts
+       POSTFIX=''
+       if [ -r /etc/postfix/main.cf ] ; then
+         sed -i "s/^myhostname = .*/myhostname = $HOSTNAME/" /etc/postfix/main.cf && POSTFIX='
+Configuration of myhostname in /etc/postfix/main.cf has been adjusted as well. Do not forget to restart postfix if necessary.'
+       fi
+       dialog --stdout --title "${PN}" --msgbox "Setting hostname to $HOSTNAME was successful.$POSTFIX" 0 0
+     else
+       dialog --stdout --title "${PN}" --msgbox "Error when setting hostname to $HOSTNAME: `cat $TMP`" 0 0
+     fi
+     ;;
+  1)
+     echo "Cancel pressed."
+     ;;
+  3)
+     $0 ;;
+  255)
+     echo "ESC pressed."
+     ;;
+esac
+
+rm -f $TMP 2>/dev/null
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-iptstate b/usr_sbin/grml-iptstate
new file mode 100755 (executable)
index 0000000..df254b1
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Filename:      grml-iptstate
+# Purpose:       wrapper around iptstate (top-like display of IP Tables state table entries)
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Don Okt 12 17:20:59 CEST 2006 [mika]
+################################################################################
+
+. /etc/grml/script-functions
+check4progs iptstate || exit 1
+
+if grep -q ip_conntrack /proc/modules ; then
+   iptstate
+else
+   echo "Module ip_conntrack is not present. Can not start iptstate therefore."
+   echo -n "Do you want to load it and invoke iptstate afterwards? [YES|no] "
+   read a
+   if [ "$a" = YES -o "$a" = yes -o "$a" = '' -o "$a" = y -o "$a" = Y ] ; then
+      modprobe ip_conntrack && exec iptstate
+   else
+      echo "Aborting as requested."
+      exit 1
+   fi
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-nessus b/usr_sbin/grml-nessus
new file mode 100755 (executable)
index 0000000..87d698b
--- /dev/null
@@ -0,0 +1,102 @@
+#!/bin/sh
+# Filename:      grml-nessus
+# Purpose:       prepare nessus for use on grml system
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mon Sep 11 17:31:07 CEST 2006 [mika]
+################################################################################
+
+PATH=${PATH:-'/bin/:/sbin/:/usr/local/bin:/usr/bin:/usr/sbin'}
+PN=`basename "$0"`
+
+[ "`id -u`" != "0" ] && exec sudo "$0" "$@"
+. /etc/grml/lsb-functions
+
+# welcome screen
+dialog --stdout --title "$PN" --msgbox "Welcome to $PN!
+
+This script will prepare your grml system
+for use with nessus[d].
+
+Report bugs, send wishes and feedback to the grml team:
+http://www.grml.org/ - contact (at) grml.org
+" 12 65
+
+# add user
+dialog --stdout --title "$PN" --yesno "Run nessus-adduser for adding user?" 0 0
+retval=$?
+case $retval in
+  0)
+     einfo "Adding user for nessusd."
+     nessus-adduser ; eend $?
+     ;;
+  1)
+     ewarn "Cancel pressed."
+     ;;
+  255)
+     ewarn "ESC pressed."
+     ;;
+esac
+
+# create certificate
+dialog --stdout --title "$PN" --yesno "Run nessus-mkcert?" 0 0
+retval=$?
+case $retval in
+  0)
+     einfo "Running nessus-mkcert."
+     nessus-mkcert ; eend $?
+     ;;
+esac
+
+# run nessusd
+dialog --stdout --title "$PN" --yesno "Start nessus daemon now?" 0 0
+retval=$?
+case $retval in
+  0)
+     einfo "Starting nessus daemon. This might take some time [for initializing plugins]."
+     if [ -r /etc/nessus/nessus-services ] ; then
+        [ -L /var/lib/nessus/nessus-services ] || ln -s /etc/nessus/nessus-services /var/lib/nessus/nessus-services
+     else
+        [ -d /var/lib/nessus/nessus-services ] || mkdir /var/lib/nessus/nessus-services
+     fi
+     nessusd -D ; eend $?
+     ;;
+  1)
+     ewarn "Cancel pressed."
+     ;;
+  255)
+     ewarn "ESC pressed."
+     ;;
+esac
+
+infoscreen() {
+dialog --stdout --title "$PN" --msgbox "Thanks for using $PN!
+
+For more information on nessus take a look at the manpage
+(man 1 nessus) and the nessus webpage at www.nessus.org
+
+#######################################################
+
+Report bugs, send wishes and feedback to the grml team:
+http://www.grml.org/ - contact (at) grml.org
+" 13 65
+}
+
+# run nessusd
+dialog --stdout --title "$PN" --yesno "Run nessus client (requires X window system) now?" 0 0
+retval=$?
+case $retval in
+  0)
+   infoscreen
+   nessus
+     ;;
+  1)
+     ewarn "Cancel pressed."
+     ;;
+  255)
+     ewarn "ESC pressed."
+     ;;
+esac
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-network b/usr_sbin/grml-network
new file mode 100755 (executable)
index 0000000..4ba90d9
--- /dev/null
@@ -0,0 +1,181 @@
+#!/bin/bash
+# Filename:      grml-network
+# Purpose:       simple frontend to varous connection tools
+# Authors:       (c) Klaus Knopper Mar 2004, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mit Okt 04 11:52:41 CEST 2006 [mika]
+################################################################################
+
+PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin"
+export PATH
+
+if [ $UID != 0 ] ; then
+   echo Error: become root before starting $0 >& 2
+   exit 100
+fi
+
+# XDIALOG_HIGH_DIALOG_COMPAT=1
+# export XDIALOG_HIGH_DIALOG_COMPAT
+
+CHECK=""
+[ "$1" = "check" ] && CHECK="yes"
+
+TMP=$(mktemp)
+
+bailout(){
+  rm -f "$TMP"
+  exit $1
+}
+
+DIALOG="dialog"
+# [ -n "$DISPLAY" ] && [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog"
+
+trap bailout 1 2 3 15
+
+# LANGUAGE etc.
+[ -r /etc/default/locale ] && . /etc/default/locale
+
+gauge(){
+  rm -f "$TMP.done"
+  status=0
+  while [ ! -e "$TMP.done" ]; do
+    echo "$status"
+    status="`expr \( 100 - $status \) / 4 + $status`"
+    sleep 1
+  done | $DIALOG --title "$0" --gauge "$1" 8 75 0
+}
+
+# Stop status bar
+killgauge(){
+  touch "$TMP.done" ; wait ; rm -f "$TMP.done"
+}
+
+# Provider specific setup - menu
+provider () {
+  MENUINTERNET=$($DIALOG --stdout --clear --title "$PN" --menu \
+  "This script is a submenu of grml-network to set up an internet connection" 14 65 7 \
+  "TUG"      "Connect via vpnc to TU Graz" \
+  "VCGraz"   "Connect via pptp to VC-Graz" \
+  "Inode"    "Connect via pptp to Inode" \
+  "Students" "Connect via pptp to Inode-Students" \
+  "Exit" "Exit this program")
+
+  retval=$?
+  case $retval in
+      (0)
+        if [ $MENUINTERNET == TUG ] ; then
+                exec grml-vpnc-tugraz
+        fi
+        if [ $MENUINTERNET == VCGraz ] ; then
+                exec grml-pptp-vcgraz
+        fi
+        if [ $MENUINTERNET == Inode ] ; then
+                exec grml-pptp-inode
+        fi
+        if [ $MENUINTERNET == Students ] ; then
+                exec grml-pptp-xdsl-students
+        fi ;;
+      (1)   echo "Cancel pressed." ;;
+      (255) echo "ESC pressed."    ;;
+  esac
+}
+
+main(){
+  if [ -z "$NOCHECK" -a -x /usr/bin/nmap ] ; then
+  gauge "Checking network status..." &
+    STATUS=""
+    GW="`echo $(route -n | awk '/^0\.0\.0\.0/{print $2}')`"
+    GWDEV="`echo $(route -n | awk '/^0\.0\.0\.0/{print $NF}')`"
+    NMAP="$(nmap -sP --host_timeout 4000 --max_rtt_timeout 4000 $GW 2>/dev/null)"
+
+    if [ "$?" = 0 ]; then
+      echo "$NMAP" | grep -q "down" >/dev/null 2>&1 || STATUS="online"
+    fi
+
+    killgauge
+
+    if [ -n "$STATUS" ]; then
+       [ -n "$CHECK" ] && exit 0 # exit if we are already connected
+       STATUS="Online ($GWDEV)"
+    else
+       STATUS="Offline"
+    fi
+  else
+    STATUS="Unknown"
+  fi
+
+# Language-dependent Messages
+case "$LANGUAGE" in
+  de*|at*|ch*)
+    TITLE1="Netzwerk-Setup"
+    STATUS="Status: $STATUS"
+    MESSAGE1="Bitte auswählen:"
+    MODEMSETUP="/dev/modem-Schnittstelle (neu) konfigurieren"
+    NETCARD="Netzwerkkarten (LAN/WLAN) Konfiguration"
+    WIRELESS="Wireless Zugang"
+    GPRS="Einwahl per Handy/GPRS"
+    DSL="Einwahl per DSL-Modem"
+    ISDN="Einwahl per ISDN"
+    MODEM="Einwahl per Analogmodem"
+    PROVIDER="Provider spezifische Einstellungen"
+    EXIT="Beenden"
+    ;;
+  *)
+    TITLE1="Network Setup"
+    STATUS="Current state: $STATUS"
+    MESSAGE1="Please select:"
+    MODEMSETUP="(re)configure /dev/modem device"
+    NETCARD="Configure network card (LAN/WLAN)"
+    WIRELESS="Wireless access"
+    GPRS="Dial via cellphone/GPRS"
+    DSL="Dial via DSL-adapter"
+    ISDN="Dial via ISDN"
+    MODEM="Dial via analog modem"
+    PROVIDER="Provider specific setup"
+    EXIT="Quit"
+   ;;
+esac
+
+# Shortcut description selected
+TYPES=(netcardconfig "$NETCARD" \
+provider "$PROVIDER" \
+modemlink "$MODEMSETUP" \
+gprsconnect "$GPRS" \
+pppoeconf "$DSL" \
+isdnconfig "$ISDN" \
+wvdial "$MODEM")
+
+type wvdial      >/dev/null 2>&1 || { unset TYPES[13]; unset TYPES[12]; }
+type isdnconfig  >/dev/null 2>&1 || { unset TYPES[11]; unset TYPES[10];  }
+type pppoeconf   >/dev/null 2>&1 || { unset TYPES[9];  unset TYPES[8];  }
+type gprsconnect >/dev/null 2>&1 || { unset TYPES[7];  unset TYPES[6];  }
+type modemlink   >/dev/null 2>&1 || { unset TYPES[5];  unset TYPES[4];  }
+
+rm -f "$TMP"
+
+$DIALOG --clear --cancel-label "$EXIT" --title "$TITLE1" --menu "$STATUS
+
+$MESSAGE1" 18 75 10 "${TYPES[@]}" 2>"$TMP" || bailout 1
+
+read TYPE <"$TMP"
+TYPE="${TYPE#\"}"; TYPE="${TYPE%\"}"
+rm -f "$TMP"
+
+case "$TYPE" in
+  wvdial) [ -e /etc/wvdial.conf ] || wvdialconf /etc/wvdial.conf ;;
+esac
+
+eval $TYPE
+return "$?"
+}
+
+if [ -z "$NOCHECK" ] ; then
+  while true; do
+    main
+  done
+else
+  main
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-postfix b/usr_sbin/grml-postfix
new file mode 100755 (executable)
index 0000000..2ce6170
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Filename:      grml-postfix
+# Purpose:       wrapper script to configure postfix
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Thu Apr 27 18:26:46 CEST 2006 [mika]
+################################################################################
+
+PATH="/bin:/usr/bin:/sbin:/usr/sbin"
+LANG=C
+LC_ALL=C
+
+if [ $UID != 0 ] ; then
+   echo Error: become root before starting $0 >& 2
+   exit 100
+fi
+
+dpkg-reconfigure postfix
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-pptp-inode b/usr_sbin/grml-pptp-inode
new file mode 100755 (executable)
index 0000000..91c3dcb
--- /dev/null
@@ -0,0 +1,117 @@
+#!/bin/sh
+# Filename:      grml-pptp-inode
+# Purpose:       connect via pptp to inode (www.inode.at)
+# Authors:       grml-team (grml.org), (c) Andreas Gredler <jimmy@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Fre Aug 11 11:41:22 CEST 2006 [mika]
+################################################################################
+
+################################################################################
+# Notes:
+# This script is based on 'knoppix-pptp' (version 0.3.1)
+# by Wolfgang Scheicher.
+################################################################################
+
+LANG=C
+
+if [ "$UID" != 0 ]; then
+#  sudo $0
+#  exit
+echo foo
+fi
+
+if [ -z "$FORCE_OLD" ] ; then
+  dialog --title "Inode XDSL Graz" --msgbox "Please notice that grml-pptp-inode is considered as deprecated. We recommend to use PPPOE for Inode XDSL.
+
+So please configure your system running pppoeconf
+
+If you really want to use the old grml-pptp-inode script execute
+
+  FORCE_OLD=1 grml-pptp-inode
+" 0 0
+else
+
+runit(){
+echo "name ${VPNUSERNAME}" > /etc/ppp/peers/inode
+cat >> /etc/ppp/peers/inode << "EOF"
+remotename XDSL
+defaultroute
+noipdefault
+noauth
+noproxyarp
+persist
+logfile /var/log/pptp.log
+
+EOF
+
+echo "${VPNUSERNAME} XDSL ${VPNPASSWORD} *" >> /etc/ppp/pap-secrets
+chmod 0600 /etc/ppp/pap-secrets
+
+echo -e "#!/bin/sh\nLANG=C\nVPNSERVER=\"${VPNSERVER}\"\n" > /etc/init.d/pptp
+
+cat >> /etc/init.d/pptp << "EOF"
+
+GATEWAY=`ifconfig | awk -v RS="" '/addr:172./{print substr($7,6,11)1}'`
+PPTP="/usr/sbin/pptp $VPNSERVER call inode"
+
+case "$1" in
+  start)
+      echo "Starting up XDSL: pptp"
+      /sbin/route del default &>/dev/null
+      /sbin/route add -host $VPNSERVER gw $GATEWAY &>/dev/null
+      start-stop-daemon --start --exec $PPTP
+    ;;
+  stop)
+      echo "Shutting down XDSL: pptp"
+      killall pppd &>/dev/null
+      if [ $? == 0 ]; then
+        /sbin/route del -host $VPNSERVER gw $GATEWAY &>/dev/null
+        /sbin/route add default gw $GATEWAY &>/dev/null
+        echo "."
+      fi
+    ;;
+  reconnect)
+    echo -n "Reconnecting XDSL: pptd"
+    start-stop-daemon --start --exec $PPTP
+    echo "."
+    ;;
+  *)
+      echo "Usage: /etc/init.d/pptp {start|stop|reconnect}"
+      exit 1
+    ;;
+esac
+
+exit 0
+EOF
+
+chmod +x /etc/init.d/pptp
+touch /var/log/pptp.log
+/etc/init.d/pptp start
+dialog --title "PPTP Log" --no-cancel --tailbox /var/log/pptp.log 0 0
+}
+
+[ -n "${VPNSERVER}"   ] || VPNSERVER="10.0.0.138"
+[ -n "${VPNUSERNAME}" ] || VPNUSERNAME=$(cat /etc/ppp/pap-secrets | grep XDSL | cut -d " " -f1)
+[ -n "${VPNPASSWORD}" ] || VPNPASSWORD=$(cat /etc/ppp/pap-secrets | grep XDSL | cut -d " " -f3)
+
+if [ -z "$VPNUSERNAME" ] || [ -z "$VPNPASSWORD" ] ; then
+  COMMAND1=$(dialog --stdout --title "Inode XDSL Graz" --inputbox \
+  "Account name(e.g. xdsl.<id>@home):" 0 0) || exit 0
+  COMMAND2=$(dialog --stdout --title "Inode XDSL Graz" --passwordbox "Account password (hidden typing)" 0 40) || exit 0
+
+  VPNUSERNAME=${COMMAND1%/*}
+  VPNPASSWORD=${COMMAND2#*/}
+  [ ! -z "$VPNUSERNAME" ] || exit 1
+  [ ! -z "$VPNPASSWORD" ] || exit 1
+  runit
+else
+  dialog --title "Inode XDSL Graz" --msgbox "Found already configured
+  account.\nIf the settings are wrong, delete the entries in
+  /etc/ppp/pap-secrets" 10 45
+  runit
+fi
+
+fi # $FORCE_OLD
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-pptp-vcgraz b/usr_sbin/grml-pptp-vcgraz
new file mode 100755 (executable)
index 0000000..902a2ab
--- /dev/null
@@ -0,0 +1,150 @@
+#!/bin/zsh
+# Filename:      grml-pptp-vcgraz
+# Purpose:       connect via pptp in vc-graz (www.vc-graz.ac.at)
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Mai 27 15:12:52 CEST 2006 [mika]
+################################################################################
+
+################################################################################
+# Notes:
+# This script is based on 'knoppix-pptp' (versions 0.3.1 and 0.4.0-test2)
+# by Wolfgang Scheicher.
+################################################################################
+
+LANG=C
+LC_ALL=C
+
+if [ "$UID" != 0 ];  then
+  sudo $0
+  exit
+fi
+
+runit(){
+echo "name ${VPNUSERNAME}" > /etc/ppp/peers/vc-graz
+cat >> /etc/ppp/peers/vc-graz << "EOF"
+
+remotename PPTP
+ipparam tunl
+lock
+noauth
+nobsdcomp
+nodeflate
+refuse-pap
+refuse-eap
+noccp
+mtu 1460
+mru 1500
+lcp-echo-failure 10
+lcp-echo-interval 10
+logfile /var/log/pptp.log
+persist
+maxfail 3
+holdoff 15
+noipdefault
+defaultroute
+EOF
+
+# make sure it is not readable by any non-root users:
+touch     /etc/ppp/chap-secrets
+chmod 600 /etc/ppp/chap-secrets
+# don't overwrite existing files - so just append:
+echo "${VPNUSERNAME} PPTP ${VPNPASSWORD} *" >> /etc/ppp/chap-secrets
+
+echo -e "#!/bin/sh\nLANG=C\nVPNSERVER=\"${VPNSERVER}\"\nDORMITORY=\"${DORMITORY}\"" > /etc/init.d/pptp-vcgraz
+cat >> /etc/init.d/pptp-vcgraz << "EOF"
+# connect to vc-graz via pptp
+case "$1" in
+  start)
+    ifconfig | grep $VPNSERVER > /dev/null && echo "PPTP already started"
+    ifconfig | grep $VPNSERVER > /dev/null && exit 0
+    echo "Starting PPTP Tunnel"
+    route del default
+    route add -host $VPNSERVER gw 10.${DORMITORY}.0.1
+    route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.${DORMITORY}.0.1
+    pppd pty "pptp $VPNSERVER --nolaunchpppd" call vc-graz updetach || exit 1
+    ;;
+
+  stop)
+    ifconfig | grep $VPNSERVER > /dev/null || echo "PPTP already stopped"
+    ifconfig | grep $VPNSERVER > /dev/null || exit 0
+    echo  "Stopping PPTP Tunnel"
+    killall -HUP pppd
+    killall -HUP pptp
+    sleep 1
+    killall pppd
+    killall pptp
+    route del -host $VPNSERVER gw 10.${DORMITORY}.0.1
+    route del -net 10.0.0.0 netmask 255.0.0.0 gw 10.${DORMITORY}.0.1
+    route add default gateway 10.${DORMITORY}.0.1
+    ;;
+
+  restart)
+    /etc/init.d/pptp-vcgraz stop
+    sleep 1
+    /etc/init.d/pptp-vcgraz start
+    ;;
+
+  status)
+    dialog --title "Status of /etc/init.d/pptp-vcgraz - PPTP Log" --no-cancel --tailbox /var/log/pptp.log 0 0
+    ;;
+
+  *)
+    echo 'Usage: /etc/init.d/pptp-vcgraz {start|stop|restart}' >&2
+    exit 1
+    ;;
+esac
+
+exit 0
+EOF
+
+chmod +x /etc/init.d/pptp-vcgraz
+touch /var/log/pptp.log
+/etc/init.d/pptp-vcgraz start
+dialog --title "PPTP Log" --no-cancel --tailbox /var/log/pptp.log 0 0
+}
+
+[ -n "$VPNSERVER" ] || VPNSERVER="10.0.0.3"
+[ -n "$DORMITORY" ] || DORMITORY="$(ifconfig | grep "addr:10" | cut -d. -f2)"
+
+if [ -z "$DORMITORY" ]; then
+  dialog --stdout --title "VC-Graz"  --msgbox "No 10.x.x.x ip address found, sorry. grml-pptp-vcgraz does work only for VC-Graz in 10.x.x.x network. Make sure you requested an ip address via DHCP. Try running pump/dhclient otherwise." 0 0 || \
+  echo "No 10.x.x.x ip address found, sorry. grml-pptp-vcgraz does work only for VC-Graz in 10.x.x.x network. Make sure you requested an ip address via DHCP. Try running pump/dhclient otherwise."
+  exit 1
+fi
+
+if [ ! -x /usr/sbin/pppd ]; then
+  dialog --stdout --title "VC-Graz"  --msgbox "/usr/sbin/pppd not found. Huh?!" 0 0 ||
+  echo "Error: /usr/sbin/pppd not found. Huh?!"
+  exit 1
+fi
+
+if [ ! -x /usr/sbin/pptp ]; then
+  dialog --stdout --title "VC-Graz"  --msgbox "/usr/sbin/pptp not found. Huh?!" 0 0 ||
+  echo "Error: /usr/sbin/pptp not found. Huh?!"
+  exit 1
+fi
+
+#[ -n "$VPNUSERNAME" ] || VPNUSERNAME=$(cat /etc/ppp/chap-secrets | grep PPTP | head -1 | cut -d " " -f1)
+#[ -n "$VPNPASSWORD" ] || VPNPASSWORD=$(cat /etc/ppp/chap-secrets | grep PPTP | head -1 | cut -d " " -f3)
+
+if [ -z "$VPNUSERNAME" ] || [ -z "$VPNPASSWORD" ] ; then
+  COMMAND1=$(dialog --stdout --title "Virtual Campus Graz" --inputbox    "Account number:" 0 0) || exit 0
+  VPNUSERNAME=${COMMAND1%/*}
+  if [ -z "$VPNUSERNAME" ] ; then
+     dialog --stdout --title "Virtual Campus Graz" --msgbox "Sorry, please provide a valid username. Exiting." 0 0
+     exit 1
+  fi
+  COMMAND2=$(dialog --stdout --title "Virtual Campus Graz" --passwordbox "Account password (hidden typing)" 0 40) || exit 0
+  VPNPASSWORD=${COMMAND2#*/}
+  if [ -z "$VPNPASSWORD" ] ; then
+     dialog --stdout --title "Virtual Campus Graz" --msgbox "Sorry, please provide a valid password. Exiting." 0 0
+     exit 1
+  fi
+  runit
+else
+  runit
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-pptp-xdsl-students b/usr_sbin/grml-pptp-xdsl-students
new file mode 100755 (executable)
index 0000000..5b84bec
--- /dev/null
@@ -0,0 +1,172 @@
+#!/bin/sh
+# Filename:      grml-pptp-xdsl-students
+# Purpose:       connect via pptp to inode ["students-setup"] (www.inode.at)
+# Authors:       grml-team (grml.org), (c) Martin Hecher <hecka@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sun Jan 15 16:19:24 CET 2006 [mika]
+################################################################################
+
+################################################################################
+# Notes:
+# This script is based on 'knoppix-pptp' (version 0.3.1)
+# by Wolfgang Scheicher
+# and based on grml-pptp-inode
+# by Andreas 'Jimmy' Gredler
+################################################################################
+
+LANG=C
+DIALOG="dialog"
+
+if [ "$UID" != 0 ];  then
+  sudo $0
+  exit
+fi
+
+setroute()
+{
+set $(grep "option routers" /var/lib/dhcp3/dhclient.leases | tail -1 | cut -f5 -d' ' | tr -d ";")
+
+ROUTER="$1"
+ANT="10.0.0.138"
+
+if route -n | grep $ANT >>/dev/null
+  then
+    /sbin/route del $ANT
+  fi
+
+/sbin/route add $ANT gw $ROUTER
+
+if ifconfig | grep ppp0 >>/dev/null
+   then
+      set $(ifconfig ppp0 | grep P-t-P | tr -s [:blank:] | cut -f4 -d' ' | cut -b7-)
+      GATEWAY="$1"
+      /sbin/route del default
+      /sbin/route add default gw $GATEWAY
+      exit 0
+   fi
+}
+
+runit(){
+
+/sbin/dhclient ${NET_DEVICE}
+
+echo "name ${VPNUSERNAME}" > /etc/ppp/peers/inode
+cat >> /etc/ppp/peers/inode << "EOF"
+remotename XDSL
+defaultroute
+noipdefault
+noauth
+persist
+logfile /var/log/pptp.log
+
+EOF
+
+echo "${VPNUSERNAME} XDSL ${VPNPASSWORD} *" >> /etc/ppp/pap-secrets
+chmod 0600 /etc/ppp/pap-secrets
+
+echo -e "#!/bin/sh\nLANG=C\nVPNSERVER=\"${VPNSERVER}\"\n" > /etc/init.d/pptp
+
+cat >> /etc/init.d/pptp << "EOF"
+
+PPTP="/usr/sbin/pptp $VPNSERVER call inode"
+
+case "$1" in
+  start)
+      echo "Starting up XDSL: pptp"
+      start-stop-daemon --start --exec $PPTP
+      if [ $? == 0 ]; then
+       echo "."
+      fi
+    ;;
+  stop)
+      echo "Shutting down XDSL: pptp"
+      start-stop-daemon --stop --exec $PPTP
+      if [ $? == 0 ]; then
+        /sbin/route del -host $VPNSERVER
+        /sbin/route add default gw $GATEWAY
+        echo "."
+      fi
+    ;;
+  reconnect)
+    echo -n "Reconnecting XDSL: pptd"
+    start-stop-daemon --start --exec $PPTP
+    echo "."
+    ;;
+  *)
+      echo "Usage: /etc/init.d/pptp {start|stop|reconnect}"
+      exit 1
+    ;;
+esac
+
+exit 0
+EOF
+
+chmod +x /etc/init.d/pptp
+touch /var/log/pptp.log
+/etc/init.d/pptp start
+$DIALOG --title "Information" --no-cancel --msgbox "Please click OK and wait until remote IP is assigned." 0 0
+$DIALOG --title "PPTP Log" --no-cancel --tailbox /var/log/pptp.log 0 0
+}
+
+[ -n "$VPNSERVER"   ] || VPNSERVER="10.0.0.138"
+[ -n "$VPNUSERNAME" ] || VPNUSERNAME="$(cat /etc/ppp/pap-secrets | grep XDSL | cut -d " " -f1)"
+[ -n "$VPNPASSWORD" ] || VPNPASSWORD="$(cat /etc/ppp/pap-secrets | grep XDSL | cut -d " " -f3)"
+
+if [ -z "$VPNUSERNAME" ] || [ -z "$VPNPASSWORD" ] ; then
+
+  COMMAND1=$($DIALOG --stdout --title "Inode XDSL Graz" --inputbox \
+  "Account name (e.g. grml@tug):" 0 35) || exit 0
+  COMMAND2=$($DIALOG --stdout --title "Inode XDSL Graz" --passwordbox "Account password (hidden typing):" 0 40) || exit 0
+
+  TMP=$(mktemp)
+
+  bailout(){
+  rm -f "$TMP"
+  exit $1
+  }
+
+  NETDEVICES="$(cat /proc/net/dev | awk -F: '/[0-9]:/{print $1}')"
+
+  wireless(){
+   case "$(cat /proc/net/wireless 2>/dev/null)" in *$1*) return 0;; esac
+   # Card exists but is not configured yet
+   [ -n "$(iwconfig $1 2>/dev/null | head -1)" ] && return 0
+   return 1
+  }
+
+  if [ -z "$NETDEVICES" ]; then
+    $DIALOG --msgbox "No network devices found." 15 45
+    bailout
+  fi
+
+  count="$(echo "$NETDEVICES" | wc -w)"
+
+  if [ "$count" -gt 1 ]; then
+    DEVICELIST=""
+    for DEVICE in $NETDEVICES; do
+      wireless "$DEVICE" && DEVICELIST="$DEVICELIST ${DEVICE} Wireless" || DEVICELIST="$DEVICELIST ${DEVICE} LAN"
+    done
+    rm -f "$TMP"
+    $DIALOG --menu "Network device to connect from:" 18 45 12 $DEVICELIST 2>"$TMP" || bailout
+    read NET_DEVICE <"$TMP" ; rm -f "$TMP"
+    else
+    # Remove additional spaces
+    NET_DEVICE="$(echo $NETDEVICES)"
+  fi
+
+  VPNUSERNAME=${COMMAND1%/*}
+  VPNPASSWORD=${COMMAND2#*/}
+  [ ! -z "$VPNUSERNAME" ] || exit 1
+  [ ! -z "$VPNPASSWORD" ] || exit 1
+  [ ! -z "$NET_DEVICE" ] || exit 1
+  runit
+  setroute
+else
+  $DIALOG --title "Inode XDSL Graz" --msgbox "Found already configured
+  account.\nIf the settings are wrong, delete the entries in
+  /etc/ppp/pap-secrets" 10 45
+  runit
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-router b/usr_sbin/grml-router
new file mode 100755 (executable)
index 0000000..c7c0e16
--- /dev/null
@@ -0,0 +1,90 @@
+#!/bin/sh
+# Filename:      grml-router
+# Purpose:       set up your box as NAT-router
+# Authors:       grml-team (grml.org), Ulrich Dangel <schula@grml.org>, Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Okt 07 23:18:38 CEST 2006 [mika]
+################################################################################
+
+# exit on any error
+set -e
+
+CONFIG_FILE=/etc/grml/routersetup
+. /etc/grml/lsb-functions
+. /etc/grml/net-functions
+. /etc/grml/script-functions
+
+if [ $UID != 0 ]; then
+   eerror "Error: become root before starting $0"
+   exit 100
+fi
+
+if ! [ -r $CONFIG_FILE ] ; then
+  eerror "$CONFIG_FILE could not be read."
+  exit 1
+fi
+
+. $CONFIG_FILE
+
+if [ -z "$OUTDEV" ] ; then
+    eerror "Outgouing device is not set in $CONFIG_FILE"
+    exit 1
+fi
+
+case "$OUTDEV" in
+    auto|default)
+    OUTDEV=$(defaultGWDev)
+    ;;
+esac
+
+[ -n "$IPTABLES" ] || IPTABLES=/sbin/iptables
+
+check4progs $IPTABLES || exit 1
+
+case "$1" in
+    start)
+        einfo "Adjusting kernel variables (net.ipv4.*)"
+          sysctl -w net.ipv4.conf.all.rp_filter=1    1>/dev/null && \
+          sysctl -w net.ipv4.conf.all.log_martians=1 1>/dev/null && \
+          sysctl -w net.ipv4.ip_forward=1            1>/dev/null
+        eend $?
+        einfo "Setting up iptables rule"
+          eindent
+
+            einfo "Adding masquarade rule"
+            $IPTABLES -t nat -A POSTROUTING -o $OUTDEV -j MASQUERADE
+            eend $?
+          eoutdent
+   ;;
+
+   stop)
+       einfo "Resetting kernel variables"
+         sysctl -w net.ipv4.ip_forward=0            1>/dev/null && \
+         sysctl -w net.ipv4.conf.all.log_martians=0 1>/dev/null
+       eend $?
+
+       einfo "Removing iptables rule"
+         $IPTABLES -t nat -D POSTROUTING -o $OUTDEV -j MASQUERADE
+       eend $?
+   ;;
+
+   restart)
+        $0 stop
+        sleep 1
+        $0 start
+   ;;
+
+   info)
+    einfo "$0 - script which turns on router capabilities (NAT)"
+    einfo "Configure it via $CONFIG_FILE" ; eend 0
+   ;;
+
+   *)
+    echo "Usage: $0 {start|stop|restart|info}"
+    exit 1
+   ;;
+esac
+
+## END OF FILE #################################################################
+# vim: ft=sh expandtab ai
diff --git a/usr_sbin/grml-setkeyboard b/usr_sbin/grml-setkeyboard
new file mode 100755 (executable)
index 0000000..f644e41
--- /dev/null
@@ -0,0 +1,128 @@
+#!/bin/sh
+# Filename:      grml-setkeyboard
+# Purpose:       set keyboard layout system-wide on grml system
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Aug 05 11:40:27 CEST 2006 [mika]
+################################################################################
+
+PN="$(basename $0)"
+DIALOG=dialog
+CMDLINE=/proc/cmdline
+
+if [ $UID != 0 ] ; then
+   echo Error: become root before starting $PN >& 2
+   exit 100
+fi
+
+setvalue(){
+  [ -n "$2" ] || return 1
+  # already present in conffile?
+  if grep -q ${1} $CONFFILE ; then
+     sed -i "s#^${1}.*#${1}=${2}#"   $CONFFILE
+  else
+     echo "$1=${2}" >> $CONFFILE
+  fi
+}
+
+# grml-small does not provide any further locales
+# if grep -q small /etc/grml_version ; then
+#    $DIALOG --stdout --msgbox "Notice: grml-small
+# does not provide a full language setup." 0 0
+# fi
+
+# same for strings
+stringinstring(){
+  case "$2" in *$1*) return 0;; esac
+  return 1
+}
+
+# Reread boot command line; echo last parameter's argument or return false.
+getbootparam(){
+  stringinstring " $1=" "$CMDLINE" || return 1
+  result="${CMDLINE##*$1=}"
+  result="${result%%[  ]*}"
+  echo "$result"
+  return 0
+}
+
+[ -r /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
+
+[ -n "$KEYTABLE" ] && DEFAULT_KEYBOARD="$KEYTABLE"
+if [ -z "$DEFAULT_KEYBOARD" ] ; then
+  DEFAULT_KEYBOARD="$(getbootparam lang 2>/dev/null)"
+  if [ -z "$DEFAULT_KEYBOARD" ] ; then
+    DEFAULT_KEYBOARD=en
+  fi
+fi
+
+LANGUAGE=$($DIALOG --stdout --title "$PN" --default-item $DEFAULT_KEYBOARD --radiolist \
+"Which keyboard layout do you want to use?
+
+Please notice that this will not really affect your currently running system.
+If you want to change keyboard settings temporarly please use grml-lang instead.
+
+Configuration will be written to /etc/sysconfig/keyboard" 0 0 0 \
+ at  austrian off \
+ de  german   off \
+ be  belgian off \
+ bg  bulgarian off \
+ cf  "french canadian" off \
+ ch  swiss off \
+ cn  chinese off \
+ cs  czech off \
+ cz  czech off \
+ dk  dansk off \
+ da  da off \
+ en  "english [us] (default)" on \
+ es  spanish off \
+ fi  finnish off \
+ fr  french off \
+ he  hebrew off \
+ il  hebrew off \
+ ie  irish off \
+ it  italian off \
+ ja  japanese off \
+ nl  dutch off \
+ pl  polish off \
+ ru  russian off \
+ sk  slovak off \
+ sl  slovenian off \
+ tr  turkish off \
+ tw  "chinese (traditional)" off \
+ uk  british off \
+)
+
+retval=$?
+case $retval in
+    (0)
+          # everything ok
+          ;;
+    (1)   echo "Cancel pressed." ; exit 1 ;;
+    (255) echo "ESC pressed."    ; exit 1 ;;
+esac
+
+# read in the file where all the $LANGUAGE stuff is defined
+  source /etc/grml/language-functions
+
+cat > /etc/sysconfig/keyboard <<EOF
+# File generated by $PN on $(date)
+KEYTABLE="$KEYTABLE"
+XKEYBOARD="$XKEYBOARD"
+KDEKEYBOARD="$KDEKEYBOARD"
+KDEKEYBOARDS="$KDEKEYBOARD"
+EOF
+
+retval=$?
+case $retval in
+    (0)
+          # everything ok
+          $DIALOG --stdout --msgbox "Writing keyboard settings ($KEYTABLE) to /etc/sysconfig/keyboard was successful." 0 0
+          ;;
+    *)
+          $DIALOG --stdout --msgbox "Error writing settings for $KEYTABLE to /etc/sysconfig/keyboard." 0 0
+          ;;
+esac
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-setlang b/usr_sbin/grml-setlang
new file mode 100755 (executable)
index 0000000..c74447b
--- /dev/null
@@ -0,0 +1,210 @@
+#!/bin/sh
+# Filename:      grml-setlang
+# Purpose:       set language system-wide on grml system
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mit Okt 04 11:54:45 CEST 2006 [mika]
+################################################################################
+
+PN="$(basename $0)"
+DIALOG=dialog
+CMDLINE=/proc/cmdline
+LANGFUNC=/etc/grml/language-functions
+
+# notice: Debian's locales.postinst has been modified to write
+# locale variables into /etc/default/locale instead of
+# /etc/environment; the latter file is a PAM configuration file,
+# so modifying it was a policy violation.
+CONFFILE=/etc/default/locale
+
+. /etc/grml/script-functions
+. /etc/grml/lsb-functions
+
+check4root || exit 100
+
+eindent # as we are running inside grml boot sequence as well make sure we integrate fine
+
+# allow writing $CONFFILE non-interactive via "grml-setlang $LANGUAGE"
+if [ -n "$1" ] ; then
+   NONINTERACTIVE=1
+else
+   NONINTERACTIVE=''
+fi
+
+if ! [ -r "$LANGFUNC" ] ; then
+   echo "$LANGFUNC could not be read. Make sure you have package grml-autoconfig installed." >&2
+   exit 1
+fi
+
+setvalue(){
+  [ -n "$2" ] || return 1
+  # already present in conffile?
+  if grep -q ${1} $CONFFILE ; then
+     sed -i "s#^${1}.*#${1}${2}#"   $CONFFILE
+  else
+     echo "$1${2}" >> $CONFFILE
+  fi
+}
+
+# grml-small does not provide any further locales
+if grep -q small /etc/grml_version 2>/dev/null ; then
+   if [ -z "$NONINTERACTIVE" ] ; then
+      $DIALOG --stdout --msgbox "Notice: grml-small does not provide a full language setup.
+
+You have to make sure the appropriate packages are installed." 0 0
+      exit 1
+   else
+      esyslog user.notice "$PN" 'grml-small does not provide a full language setup.'
+   fi
+fi
+
+[ -r /etc/environment ]    && . /etc/environment
+[ -r /etc/default/locale ] && . /etc/default/locale
+[ -n "$LANGUAGE" ] && DEFAULT_LANGUAGE="$LANGUAGE"
+
+if [ -z "$DEFAULT_LANGUAGE" ] ; then
+   DEFAULT_LANGUAGE=en
+fi
+
+if [ -z "$NONINTERACTIVE" ] ; then
+   LANGUAGE=$($DIALOG --stdout --title "$PN" --default-item $DEFAULT_LANGUAGE --radiolist \
+"Which language do you want to use?
+
+This will affect \$LANG, \$LANGUAGE, \$LC_MESSAGES and \$TZ.
+
+Notice: if you want to adjust /etc/locale.gen (defines
+which locales should be generated by locale-gen)
+please run 'dpkg-reconfigure locale' manually.
+
+Configuration will be written to $CONFFILE" 0 0 0 \
+ at austrian off \
+ at-utf8 'austria (unicode version)' off \
+ au australian off \
+ au-utf8 'austrial (unicode version)' off \
+ be belgian off \
+ be-utf8 'belgian (unicode version)' off \
+ bg bulgarian off \
+ bg-utf8 'bulgarian (unicode version)' off \
+ br brazilian off \
+ br-utf8 'brazilian (unicode version)' off \
+ ch swiss off \
+ ch-utf8 'swiss (unicode version)' off \
+ cf 'french canadian' off \
+ cn chinese off \
+ cn-utf8 'chinese (unicode version)' off \
+ cs czech off \
+ cs-utf8 'czech (unicode version)' off \
+ cz czech off \
+ cz-utf8 'czech (unicode version)' off \
+ de german off \
+ de-utf8 'german (unicode version)' off \
+ dk dansk off \
+ dk-utf8 'dansk (unicode version)' off \
+ da dansk off \
+ da-utf8 'dansk (unicode version)' off \
+ el greek off \
+ el-utf8 'greek (unicode version)' off \
+ en 'english [us] (default)' on \
+ es spanish off \
+ es-utf8 'spanish (unicode version)' off \
+ fi finnish off \
+ fi-utf8 'finnish (unicode version)' off \
+ fr frensh off \
+ fr-utf8 'frensh (unicode version)' off \
+ ga 'irish gaeilge' off \
+ ga-utf8 'irish gaeilge (unicode version)' off \
+ he hebrew off \
+ he-utf8 'hebrew (unicode version)' off \
+ il hebrew off \
+ il-utf8 'hebrew (unicode version)' off \
+ ie irish off \
+ ie-utf8 'irish (unicode version)' off \
+ it italian off \
+ it-utf8 'italian (unicode version)' off \
+ ja japanese off \
+ ja-utf8 'japanese (unicode version)' off \
+ nl dutch off \
+ nl-utf8 'dutch (unicode version)' off \
+ pl off polish \
+ pl-utf8 'polish (unicode version)' off \
+ pt portuguese off \
+ pt-utf8 'portuguese (unicode version)' off \
+ ru russian off \
+ ru-utf8 'russian (unicode version)' off \
+ sk slovak off \
+ sk-utf8 'slovak (unicode version)' off \
+ sl slovenian off \
+ sl-utf8 'slovenian (unicode version)' off \
+ tr turkish off \
+ tr-utf8 'turkish (unicode version)' off \
+ tw 'chinese (traditional)' off \
+ tw-utf8 'chinese (traditional) (unicode version)' off \
+ uk british off \
+ uk-utf8 'british (unicode version)' off \
+ us-utf8 'american (unicode version)' off \
+)
+
+  retval=$?
+  case $retval in
+      (0)   # everything ok
+            ;;
+      (1)   echo "Cancel pressed." ; exit 1 ;;
+      (255) echo "ESC pressed."    ; exit 1 ;;
+  esac
+
+else # non-interactive
+  LANGUAGE="$1"
+fi
+
+if ! grep -q "${LANGUAGE})" $LANGFUNC ; then
+   ewarn "Language ${LANGUAGE} not supported, using default." ; eend 0
+fi
+
+# read in the file where all the $LANGUAGE stuff is defined
+  source $LANGFUNC
+
+# make sure the file exists
+if ! [ -r $CONFFILE ] ; then
+cat > $CONFFILE <<EOF
+# File generated by $PN on $(date)
+LANGUAGE=$LANGUAGE
+LANG=$LANG
+LC_MESSAGES=$LANG
+TZ=$TZ
+# other environment variables you might want to set:
+# LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY
+# LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE
+# LC_MEASUREMENT LC_IDENTIFICATION
+# Notice: set LC_ALL to overwrite all LC_* variables
+EOF
+fi
+
+setvalue 'LANGUAGE='    $LANGUAGE
+setvalue 'LANG='        $LANG
+setvalue 'LC_MESSAGES=' $LANG
+setvalue 'TZ='          $TZ
+
+retval=$?
+case $retval in
+    (0)
+          if [ -z "$NONINTERACTIVE" ] ; then
+             $DIALOG --stdout --msgbox "Writing language settings ($LANGUAGE) to $CONFFILE was successful." 0 0
+          else
+             einfo "Writing language settings ($LANGUAGE) to $CONFFILE was successful."
+             esyslog user.notice "$PN" "Writing language settings ($LANGUAGE) to $CONFFILE was successful." ; eend 0
+          fi
+          ;;
+    *)
+          if [ -z "$NONINTERACTIVE" ] ; then
+             $DIALOG --stdout --msgbox "Error writing settings for $LANGUAGE to $CONFFILE." 0 0
+          else
+             eerror "Error writing settings for $LANGUAGE to $CONFFILE." ; eend 1
+             esyslog user.notice "$PN" "Error writing settings for $LANGUAGE to $CONFFILE."
+          fi
+          ;;
+esac
+
+eoutdent
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-tpm b/usr_sbin/grml-tpm
new file mode 100755 (executable)
index 0000000..5d05f2d
--- /dev/null
@@ -0,0 +1,114 @@
+#!/bin/zsh
+# Filename:      grml-tpm
+# Purpose:       set up a system for use with TPM technology
+# Authors:       (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mit Jul 26 02:26:06 CEST 2006 [mika]
+################################################################################
+
+. /etc/grml/lsb-functions
+
+if [ $UID != 0 ] ; then
+   eerror Error: become root before starting $0 >& 2 ; eend 1
+   exit 100
+fi
+
+PN=$(basename "$0")
+TPM_MODULES=$(awk '/tpm/ {print $1}' /proc/modules | xargs echo -n)
+
+case "$1" in
+   start)
+      # tpm_emulator registers as /sys/class/misc/tpm while
+      # real tpm modules should provide /sys/class/misc/tpm0
+      if [ -d /sys/class/misc/tpm0 ] ; then
+        ewarn "TPM kernel modules $TPM_MODULES seem to be loaded already." ; eend 0
+      else
+        if ! modinfo tpm_emulator &>/dev/null ; then
+          eerror "Error: kernel module tpm_emulator not found." >& 2
+          eerror "Check for an existing debian package or get it from http://tpm-emulator.berlios.de/" >& 2
+          exit 1
+        fi
+
+        if grep -q tpm_emulator /proc/modules ; then
+          ewarn "Kernel driver tpm_emulator already loaded." ; eend 0
+        else
+          einfo "Loading kernel driver tpm_emulator."
+          modprobe tpm_emulator startup=clear ; eend $?
+        fi
+      fi
+
+      if [ -x /usr/sbin/tcsd ] ; then
+        if pidof tcsd &>/dev/null ; then
+          ewarn "trousers daemon already running." ; eend 0
+        else
+          einfo "Starting trousers daemon."
+          /usr/sbin/tcsd ; eend $?
+          [ $? != 0 ] && exit 1
+        fi
+      else
+        eerror "trousers daemon not available. Exiting." ; eend 1
+        exit 1
+      fi
+
+      einfo "Startup of $PN finished." ; eend 0
+     ;;
+  stop)
+      if pidof tcsd &>/dev/null ; then
+        einfo "Stopping trousers daemon."
+        kill `pidof tcsd` ; eend $?
+      else
+        ewarn "No running trousers daemon found. Nothing to be done." ; eend 0
+      fi
+
+      if grep -q tpm_emulator /proc/modules ; then
+        einfo "Unloading kernel driver tpm_emulator."
+        rmmod tpm_emulator ; eend $?
+      elif grep -q tpm /proc/modules ; then
+          einfo "Unloading TPM kernel drivers $(awk '/tpm/ {print $1}' /proc/modules | xargs echo -n)."
+          while grep -q tpm /proc/modules ; do
+            for module in $(cd /lib/modules/$(uname -r)/kernel/drivers/char/tpm/ ; ls *.ko) ; do
+              rmmod ${module%%.ko} &>/dev/null
+            done
+            eend 0
+          done
+      else
+        ewarn "No TPM kernel driver found. Nothing to be done." ; eend 0
+      fi
+     ;;
+  status)
+      if [ -r /sys/class/misc/tpm ] ; then
+        einfo "Seems to be running with tpm_emulator." ; eend 0
+      fi
+
+      if [ -r /sys/class/misc/tpm0 ] ; then
+        einfo "Seems to be running with real TPM hardware." ; eend 0
+      fi
+
+      if pidof tcsd &>/dev/null ; then
+        einfo "trousers daemon running." ; eend 0
+        if [ -x /usr/sbin/tpm_version ] ; then
+          einfo "tpm-version: "
+          tpm_version ; eend $?
+        else
+          eerror "tpm_version not found." ; eend 1
+        fi
+      else
+        ewarn "trousers daemon not running." ; eend 0
+      fi
+
+      if [ -r /sys/class/misc/tpm0/device/pcrs ] ; then
+        einfo "Dumping PCRS..."
+        cat /sys/class/misc/tpm0/device/pcrs ; RC=$?
+        einfo "... finished dumping of PCRS." ; eend $RC
+      fi
+     ;;
+  restart)
+     $0 stop ; sleep 1 ; $0 start
+     ;;
+  *)
+     eerror "Usage: $PN [start|stop|restart|status]"
+     ;;
+esac
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/grml-vpnc-tugraz b/usr_sbin/grml-vpnc-tugraz
new file mode 100755 (executable)
index 0000000..3e15901
--- /dev/null
@@ -0,0 +1,118 @@
+#!/bin/sh
+# Filename:      grml-vpnc-tugraz
+# Purpose:       connect via vpnc in VC-Graz/TU Graz (www.vc-graz.ac.at / www.tugraz.at)
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Tue Mar 28 10:02:46 CEST 2006 [mika]
+################################################################################
+
+# Documentation:
+# http://www.zid.tugraz.at/ki/netz/extern/vpn/
+
+LANG=C
+LC_ALL=C
+
+if [ "$UID" != 0 ];  then
+  sudo $0
+  exit
+fi
+
+function typeofservice() {
+NETWORK=$(dialog --stdout --clear --title "foobar" --menu \
+"This script is a submenu of grml-network to set up an internet connection
+
+Notice if you want to connect to WLAN at TU Graz:
+Make sure you have a connection to the access point and an ip-address.
+Run 'iwconfig \$DEVICE essid tug ; dhclient \$DEVICE'." 0 0 0 \
+"WLAN"   "Connect via WLAN to TU Graz network" \
+"VCGraz" "Connect to VC-Graz (not yet tested - use grml-pptp-vcgraz!)" \
+"External" "External connection (not yet tested!)" \
+"Exit"   "Exit this program")
+
+retval=$?
+
+case $retval in
+  0)
+        if [ $NETWORK == WLAN ]; then
+         GATEWAY=129.27.200.1
+         # GATEWAY=172.27.12.2
+         ACCOUNT='Account information - your TUGOnline username'
+        fi
+
+        if [ $NETWORK == VCGraz ]; then
+         GATEWAY=10.0.0.1
+         ACCOUNT='Account information - your account number'
+        fi
+
+        if [ $NETWORK == External ]; then
+         GATEWAY=129.27.200.1
+         ACCOUNT='Account information - account number'
+        fi
+        ;;
+  1)
+        echo "Cancel pressed." ; exit
+        ;;
+  255)
+        echo "ESC pressed." ; exit
+        ;;
+esac
+}
+
+runit(){
+echo "# vpnc at $NETWORK" > /etc/vpnc/vpnctugraz.conf
+echo "
+Debug 0
+IKE DH Group dh2
+Perfect Forward Secrecy dh2
+IPSec gateway $GATEWAY
+IPSec ID default
+IPSec secret default
+Xauth username $ACCOUNTNAME
+Xauth password $PASSWORD
+
+" >> /etc/vpnc/vpnctugraz.conf
+
+echo -e "#!/bin/sh\nLANG=C\n" > /etc/init.d/vpnctug
+cat >> /etc/init.d/vpnctug << "EOF"
+case "$1" in
+  start)
+    echo "Starting vpnc"
+#    route del default
+#    vpnc /etc/vpnc/vpnctugraz.conf
+    vpnc-connect /etc/vpnc/vpnctugraz.conf
+#    route add default dev tun0
+    ;;
+
+  stop)
+    echo "Stopping vpnc"
+    /usr/sbin/vpnc-disconnect
+    killall -HUP vpnc
+    ;;
+
+  *)
+    echo "Usage: /etc/init.d/vpnctug {start|stop}" >&2
+    ;;
+
+esac
+
+exit 0
+EOF
+
+chmod 600 /etc/vpnc/vpnctugraz.conf
+chmod +x /etc/init.d/vpnctug
+/etc/init.d/vpnctug start
+}
+
+typeofservice
+if [ -z "$ACCOUNTNAME" ] || [ -z "$PASSWORD" ] ; then
+  ACCOUNTNAME=$(dialog --stdout --title "vpnc in $NETWORK" --inputbox "${ACCOUNT}:" 0 0) || exit 0
+  PASSWORD=$(dialog --stdout --title "vpnc in $NETWORK" --passwordbox "Account password (hidden typing)" 0 40) || exit 0
+  [ -z "$ACCOUNTNAME" ] && exit 1
+  [ -z "$PASSWORD" ] && exit 1
+  runit
+else
+  runit
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/make_chroot_jail b/usr_sbin/make_chroot_jail
new file mode 100755 (executable)
index 0000000..75cf12c
--- /dev/null
@@ -0,0 +1,357 @@
+#!/bin/sh
+#
+# (c) Copyright by Wolfgang Fuschlberger
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#    ( http://www.fsf.org/licenses/gpl.txt )
+
+# first Release: 2004-07-30
+# latest update: 2006-07-17
+#
+# The latest version of the script is available at
+#   http://www.fuschlberger.net/programs/ssh-scp-chroot-jail/
+#
+# Feedback is welcome!
+#
+# Thanks for Bugfixes / Enhancements to 
+# Michael Prokop <http://www.michael-prokop.at/chroot/>,
+# Randy K., Randy D. and Jonathan Hunter.
+
+#
+# Features:
+# - enable scp and sftp in the chroot-jail
+# - use one directory (default /home/jail/) as chroot for all users
+################################################################################
+
+# Check if we are called with username or update
+if [ -z "$1" ] ; then
+  echo
+  echo "Error: Parameter missing. Did you forget the username?"
+  echo "-------------------------------------------------------------"
+  echo "Creating new chrooted account:"
+  echo "Usage: $0 username"
+  echo
+  echo "or specify \$SHELL and path where the jail should be located:"
+  echo "Usage: $0 username [/path/to/chroot-shell [/path/to/jail]]"
+  echo "Default shell       = /bin/chroot-shell"
+  echo "Default chroot-path = /home/jail"
+  echo "-------------------------------------------------------------"
+  echo "Updating files in the chroot-jail:"
+  echo "Usage: $0 update [/path/to/chroot-shell [/path/to/jail]]"
+  echo "-------------------------------------------------------------"
+  echo "To uninstall: # userdel \$USER"
+  echo "              # rm -rf /home/jail"
+  echo "              # rm -f /bin/chroot-shell"
+  echo "              delete the User's line from /etc/sudoers"
+  exit
+fi
+
+echo "Am I root?  "
+if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ] ; then
+  echo "  NO!
+
+Error: You must be root to run this script."
+  exit 1
+fi
+echo "  OK";
+
+# Check existence of necessary files
+echo "Checking distribution... "
+if [ -f /etc/debian_version ];
+  then echo "  Supported Distribution found"
+       echo -e "  System is running Debian Linux\n"
+       DISTRO=DEBIAN;
+elif [ -f /etc/SuSE-release ];
+  then echo "  Supported Distribution found"
+       echo -e "  System is running SuSE Linux\n"
+       DISTRO=SUSE;
+elif [ -f /etc/fedora-release ];
+  then echo "  Supported Distribution found"
+       echo -e "  System is running Fedora Linux\n"
+       DISTRO=FEDORA;
+elif [ -f /etc/redhat-release ];
+  then echo "  Supported Distribution found"
+       echo -e "  System is running Red Hat Linux\n"
+       DISTRO=REDHAT;
+else echo -e "  failed...........\nThis script works best on Debian, Red Hat and SuSE Linux!\nLet's try it nevertheless....\n"
+#exit 1
+fi
+
+# Specify the apps you want to copy to the jail
+if [ "$DISTRO" = SUSE ]; then
+  APPS="/bin/bash /bin/cp /usr/bin/dircolors /bin/ls /bin/mkdir /bin/mv /bin/rm /bin/rmdir /bin/sh /bin/su /usr/bin/groups /usr/bin/id /usr/bin/netcat /usr/bin/rsync /usr/bin/ssh /usr/bin/scp /sbin/unix_chkpwd /usr/lib/ssh/sftp-server"
+elif [ "$DISTRO" = FEDORA ]; then
+  APPS="/bin/bash /bin/cp /usr/bin/dircolors /bin/ls /bin/mkdir /bin/mv /bin/rm /bin/rmdir /bin/sh /bin/su /usr/bin/groups /usr/bin/id /usr/bin/nc /usr/bin/rsync /usr/bin/ssh /usr/bin/scp /sbin/unix_chkpwd /usr/libexec/openssh/sftp-server"
+elif [ "$DISTRO" = REDHAT ]; then
+  APPS="/bin/bash /bin/cp /usr/bin/dircolors /bin/ls /bin/mkdir /bin/mv /bin/rm /bin/rmdir /bin/sh /bin/su /usr/bin/groups /usr/bin/id /usr/bin/nc /usr/bin/rsync /usr/bin/ssh /usr/bin/scp /sbin/unix_chkpwd /usr/libexec/openssh/sftp-server"
+elif [ "$DISTRO" = DEBIAN ]; then
+  APPS="/bin/bash /bin/cp /usr/bin/dircolors /bin/ls /bin/mkdir /bin/mv /bin/rm /bin/rmdir /bin/sh /bin/su /usr/bin/groups /usr/bin/id /usr/bin/rsync /usr/bin/ssh /usr/bin/scp /sbin/unix_chkpwd /usr/lib/sftp-server"
+else
+  APPS="/bin/bash /bin/cp /usr/bin/dircolors /bin/ls /bin/mkdir /bin/mv /bin/rm /bin/rmdir /bin/sh /bin/su /usr/bin/groups /usr/bin/id /usr/bin/rsync /usr/bin/ssh /usr/bin/scp /usr/sbin/unix_chkpwd /usr/lib/misc/sftp-server"
+fi
+
+# Check existence of necessary files
+echo "Checking for chroot..." 
+if [ `which chroot` ];
+  then echo "  OK";
+  else echo "  failed
+
+Please install chroot-package/binary!
+"
+exit 1
+fi
+
+echo "Checking for sudo..." 
+if [ `which sudo` ]; then
+  echo "  OK
+";
+else 
+  echo "  failed
+
+Please install sudo-package/binary!
+"
+exit 1
+fi
+
+# Get accountname to create
+CHROOT_USERNAME=$1
+
+if ! [ -z "$2" ] ; then
+  SHELL=$2
+else
+  SHELL=/bin/chroot-shell
+fi
+
+if ! [ -z "$3" ] ; then
+  JAILPATH=$3
+else
+  JAILPATH=/home/jail
+fi
+
+# Exit if user already exists
+id $CHROOT_USERNAME > /dev/null 2>&1 && { echo "User exists."; echo "Exiting."; exit 1; }
+
+# Create $SHELL (shell for jailed accounts)
+if [ -f ${SHELL} ] ; then
+  echo "$SHELL exists. Don't want to overwrite it.
+Please delete it before running the script."
+  exit 1
+else
+  echo "Creating $SHELL"
+  echo '#!/bin/sh' > $SHELL
+  echo "`which sudo` `which chroot` $JAILPATH /bin/su - \$USER" \"\$@\" >> $SHELL
+  chmod 755 $SHELL
+fi
+
+# make common jail for everybody if inexistent
+if [ ! -d $JAILPATH ] ; then
+  mkdir -p $JAILPATH
+  echo "Creating $JAILPATH"
+fi
+cd $JAILPATH
+
+# Create directories in jail that do not exist yet
+JAILDIRS="dev etc etc/pam.d bin home sbin usr usr/bin"
+for directory in $JAILDIRS ; do
+  if [ ! -d "$JAILPATH/$directory" ] ; then
+    mkdir $JAILPATH/"$directory"
+    echo "Creating $JAILPATH/$directory"
+  fi
+done
+echo
+
+# Comment in the following lines if your apache can't read the directories and
+# uses the security contexts
+# Fix security contexts so Apache can read files
+#CHCON=$(`which chcon`)
+#if [ -n "$CHCON" ] && [ -x $CHCON ]; then
+#    $CHCON -t home_root_t $JAILPATH/home
+#    $CHCON -t user_home_dir_t $JAILPATH/home/$CHROOT_USERNAME
+#fi
+
+# Creating necessary devices
+[ -r $JAILPATH/dev/urandom ] || mknod $JAILPATH/dev/urandom c 1 9
+[ -r $JAILPATH/dev/null ]    || mknod -m 666 $JAILPATH/dev/null    c 1 3
+[ -r $JAILPATH/dev/zero ]    || mknod -m 666 $JAILPATH/dev/zero    c 1 5
+[ -r $JAILPATH/dev/tty ]     || mknod -m 666 $JAILPATH/dev/tty     c 5 0 
+
+# if we only want to update the files in the jail
+# skip the creation of the new account
+if [ "$1" != "update" ]; then
+
+# Modifiy /etc/sudoers to enable chroot-ing for users
+# must be removed by hand if account is deleted
+echo "Modifying /etc/sudoers"
+echo "$CHROOT_USERNAME       ALL=NOPASSWD: `which chroot`, /bin/su - $CHROOT_USERNAME" >> /etc/sudoers
+
+# Define HomeDir for simple referencing
+HOMEDIR="$JAILPATH/home/$CHROOT_USERNAME"
+
+# Create new account, setting $SHELL to the above created script and
+# $HOME to $JAILPATH/home/*
+echo "Adding User \"$CHROOT_USERNAME\" to system"
+useradd -m -d "$HOMEDIR" -s "$SHELL" $CHROOT_USERNAME && chmod 700 "$HOMEDIR"
+# Enter password for new account
+passwd $CHROOT_USERNAME
+echo
+
+# Create /usr/bin/groups in the jail
+echo "#!/bin/bash" > usr/bin/groups
+echo "id -Gn" >> usr/bin/groups
+chmod 755 usr/bin/groups
+
+# Add users to etc/passwd
+#
+# check if file exists (ie we are not called for the first time)
+# if yes skip root's entry and do not overwrite the file
+if [ ! -f etc/passwd ] ; then
+ grep /etc/passwd -e "^root" > etc/passwd
+fi
+if [ ! -f etc/group ] ; then
+ grep /etc/group -e "^root" > etc/group
+# add the group for all users to etc/group (otherwise there is a nasty error
+# message and probably because of that changing directories doesn't work with
+# winSCP)
+ grep /etc/group -e "^users" >> etc/group
+fi
+
+# grep the username which was given to us from /etc/passwd and add it
+# to ./etc/passwd replacing the $HOME with the directory as it will then 
+# appear in the jail
+echo "Adding User $CHROOT_USERNAME to jail"
+grep -e "^$CHROOT_USERNAME:" /etc/passwd | \
+ sed -e "s#$JAILPATH##"      \
+     -e "s#$SHELL#/bin/bash#"  >> etc/passwd
+
+# if the system uses one account/one group we write the
+# account's group to etc/group
+grep -e "^$CHROOT_USERNAME:" /etc/group >> etc/group
+
+# write the user's line from /etc/shadow to /home/jail/etc/shadow
+grep -e "^$CHROOT_USERNAME:" /etc/shadow >> etc/shadow
+
+# endif for =! update
+fi
+
+# Copy the apps and the related libs
+echo "Copying necessary library-files to jail (may take some time)"
+
+# The original code worked fine on RedHat 7.3, but did not on FC3.
+# On FC3, when the 'ldd' is done, there is a 'linux-gate.so.1' that 
+# points to nothing (or a 90xb.....), and it also does not pick up
+# some files that start with a '/'. To fix this, I am doing the ldd
+# to a file called ldlist, then going back into the file and pulling
+# out the libs that start with '/'
+# 
+# Randy K.
+#
+# The original code worked fine on 2.4 kernel systems. Kernel 2.6
+# introduced an internal library called 'linux-gate.so.1'. This 
+# 'phantom' library caused non-critical errors to display during the 
+# copy since the file does not actually exist on the file system. 
+# To fix re-direct output of ldd to a file, parse the file and get 
+# library files that start with /
+#
+if [ -x ${HOME}/ldlist ]; then 
+   mv ${HOME}/ldlist ${HOME}/ldlist.bak
+fi
+if [ -x ${HOME}/lddlist2 ]; then 
+   mv ${HOME}/lddlist2 ${HOME}/lddlist2.bak
+fi
+
+for app in $APPS;  do
+
+    # First of all, check that this application exists
+    if [ -x $app ]; then
+        # Check that the directory exists; create it if not.
+        app_path=`echo $app | sed -e 's#\(.\+\)/[^/]\+#\1#'`
+        if ! [ -d .$app_path ]; then
+            mkdir -p .$app_path
+        fi
+
+               # If the files in the chroot are on the same file system as the
+               # original files you should be able to use hard links instead of
+               # copying the files, too. Symbolic links cannot be used, because the
+               # original files are outside the chroot.
+               cp -p $app .$app
+
+        # get list of necessary libraries
+        ldd $app >> ${HOME}/ldlist
+    fi
+done
+
+# Clear out any old temporary file before we start
+if [ -e ${HOME}/ldlist2 ]; then
+    rm ${HOME}/ldlist2
+fi
+for libs in `cat /root/ldlist`; do
+   frst_char="`echo $libs | cut -c1`"
+   if [ "$frst_char" = "/" ]; then
+     echo "$libs" >> /root/ldlist2
+   fi
+done
+for lib in `cat /root/ldlist2`; do
+    mkdir -p .`dirname $lib` > /dev/null 2>&1
+
+       # If the files in the chroot are on the same file system as the original
+       # files you should be able to use hard links instead of copying the files,
+       # too. Symbolic links cannot be used, because the original files are
+       # outside the chroot.
+    cp $lib .$lib
+done
+
+#
+# Now, cleanup the 2 files we created for the library list
+#
+/bin/rm -f ${HOME}/ldlist
+/bin/rm -f ${HOME}/ldlist2
+
+# Necessary files that are not listed by ldd
+if [ "$DISTRO" = SUSE ]; then
+  cp /lib/libnss_compat.so.2 /lib/libnss_files.so.2 /lib/libnss_dns.so.2 /lib/libxcrypt.so.1 ${JAILPATH}/lib/
+elif [ "$DISTRO" = FEDORA ]; then
+  cp /lib/libnss_compat.so.2 /lib/libnsl.so.1 /lib/libnss_files.so.2 /lib/ld-linux.so.2 /lib/ld-ldb.so.3 /lib/libnss_dns.so.2 /lib/libxcrypt.so.1 ${JAILPATH}/lib/
+  cp /lib/*.* ${JAILPATH}/lib/
+elif [ "$DISTRO" = REDHAT ]; then
+  cp /lib/libnss_compat.so.2 /lib/libnsl.so.1 /lib/libnss_files.so.2 /lib/ld-linux.so.2 /lib/ld-lsb.so.1 /lib/libnss_dns.so.2 /lib/libxcrypt.so.1 ${JAILPATH}/lib/
+  # needed for scp on RHEL
+  echo "export LD_LIBRARY_PATH=/usr/kerberos/lib" >> ${JAILPATH}/etc/profile
+elif [ "$DISTRO" = DEBIAN ]; then
+  cp /lib/libnss_compat.so.2 /lib/libnsl.so.1 /lib/libnss_files.so.2 /lib/libcap.so.1 /lib/libnss_dns.so.2 ${JAILPATH}/lib/
+else
+  cp /lib/libnss_compat.so.2 /lib/libnsl.so.1 /lib/libnss_files.so.2 /lib/libcap.so.1 /lib/libnss_dns.so.2 ${JAILPATH}/lib/
+fi
+
+# if you are using a 64 bit system and have strange problems with login comment
+# the following lines in, perhaps it works then (motto: if you can't find the
+# needed library just copy all of them)
+#
+#cp /lib/*.* ${JAILPATH}/lib/
+#cp /lib/lib64/*.* ${JAILPATH}/lib/lib64/ 
+
+# if you are using PAM you need stuff from /etc/pam.d/ in the jail,
+echo "Copying files from /etc/pam.d/ to jail"
+cp /etc/pam.d/* ${JAILPATH}/etc/pam.d/
+
+# ...and of course the PAM-modules...
+echo "Copying PAM-Modules to jail"
+cp -r /lib/security ${JAILPATH}/lib/
+
+# ...and something else useful for PAM
+cp -r /etc/security ${JAILPATH}/etc/
+cp /etc/login.defs ${JAILPATH}/etc/
+
+if [ -f /etc/DIR_COLORS ] ; then
+  cp /etc/DIR_COLORS ${JAILPATH}/etc/
+fi 
+
+exit
+
diff --git a/usr_sbin/mkdosswapfile b/usr_sbin/mkdosswapfile
new file mode 100755 (executable)
index 0000000..c962509
--- /dev/null
@@ -0,0 +1,131 @@
+#!/bin/sh
+# Filename:      mkdosswapfile
+# Purpose:       create GRML swapfile on an existing DOS partition
+# Authors:       (c) Klaus Knopper Mar 2001, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mit Okt 04 11:52:06 CEST 2006 [mika]
+################################################################################
+
+PATH="/bin:/sbin:/usr/bin:/usr/sbin"
+export PATH
+
+# XDIALOG_HIGH_DIALOG_COMPAT=1
+# export XDIALOG_HIGH_DIALOG_COMPAT
+
+[ "`id -u`" != "0" ] && exec sudo "$0" "$@"
+
+#TMP="/tmp/mkdosswapfile.tmp$$"
+TMP=$(mktemp)
+
+bailout(){
+  rm -f "$TMP"
+  exit 0
+}
+
+DIALOG="dialog"
+# [ -n "$DISPLAY" ] && [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog"
+
+trap bailout 1 2 3 15
+
+# LANGUAGE etc.
+[ -r /etc/default/locale ] && . /etc/default/locale
+
+DOSPARTITIONS=""
+
+# Find all DOS partitions
+if [ -f /proc/partitions ]
+then
+partitions=""
+for p in $(awk 'BEGIN{old="__start"}{if($0==old){exit}else{old=$0;if($4&&$4!="name"){print $4}}}' /proc/partitions); do
+case $p in
+ hd?|sd?) partitions="$partitions /dev/$p"; ;;
+ *) ;;
+esac
+done
+if [ -n "$partitions" ]
+then
+foundp="$(LANG=C LC_ALL=C fdisk -l $partitions 2>/dev/null)"
+for p in `echo "$foundp" | awk '/^\/dev\//{if(/FAT/){print $1}}'`
+do
+d="/mnt/${p##*/}"
+if mount -o ro -t vfat $p $d 2>/dev/null; then
+[ ! -f $d/grml.swp ] && DOSPARTITIONS="$DOSPARTITIONS $p"
+umount $d
+fi
+done
+fi
+fi
+
+if [ -n "$DOSPARTITIONS" ]; then
+echo -n "\ec"
+for p in $DOSPARTITIONS; do
+# Language-dependent Messages
+case "$LANGUAGE" in
+de|at|ch)
+MESSAGE1="Möchten Sie eine SWAP-Datei 'grml.swp' für GRML auf Ihrer bestehenden DOS-Partition $p anlegen? Eine solche SWAP-Datei ermöglicht es Ihnen, trotz geringem Hauptspeicher Programmpakete wie KDE zu benutzen. Sie können diese Datei nach Beendigung Ihrer GRML-Session gefahrlos wieder löschen."
+MESSAGE2="Bitte geben Sie an, wieviel MB Sie als SWAP verwenden wollen. Empfohlen: 60 - 128. Frei: "
+MESSAGE3="Erzeuge swapfile 'grml.swp' auf $p..."
+ERROR1="Leider ist nicht genug Platz auf dieser Partition ($p), es sollten mindestens 60 MB frei sein."
+SUCCESS="Das Einrichten des Swapfiles 'grml.swp' auf $p war erfolgreich."
+;;
+es)
+MESSAGE1="¿Quiere crear un fichero de memoria virtual (swap) 'grml.swp' en su partición DOS existente $p? Un fichero swap le permite utilizar grandes aplicaciones como KDE incluso si su ordenador tiene poca memoria. Puede borrar tranquilamente el fichero swap una vez haya finalizado su sesión con GRML."
+MESSAGE2="Por favor, especifique la cantidad de espacio en disco que quiere utilizar como SWAP. Recomendado: 60 - 128. Libre: "
+MESSAGE3="Creando archivo de memoria virtual 'grml.swp' en $p..."
+ERROR1="Lo siento, no hay suficiente espacio libre en $p. Son necesarios al menos 60 MB."
+SUCCESS="Archivo swap 'grml.swp' en $p creado satisfactoriamente."
+;;
+*)
+MESSAGE1="Do you want to create a swapfile 'grml.swp' on your existing DOS partition $p? A swapfile allows you to use huge application packages like KDE even if your computer is low on memory. You can safely delete the swapfile after finishing your GRML session."
+MESSAGE2="Please specify the amount of diskspace that you want to use as SWAP. Recommended: 60 - 128. Free: "
+MESSAGE3="Creating swapfile 'grml.swp' on $p..."
+ERROR1="Sorry, not enough free space on $p. At least 60 MB required."
+SUCCESS="Swapfile 'grml.swp' on $p successfully created."
+;;
+esac
+
+d="/mnt/${p##*/}"
+f="$d/grml.swp"
+if mount -o umask=000,rw -t vfat $p $d; then
+if $DIALOG --yesno "$MESSAGE1" 11 62; then
+AVAIL=$(df -m $d | awk '/^\/dev\//{print $4}')
+if [ "$AVAIL" -lt 60 ]; then
+$DIALOG --msgbox "$ERROR1" 10 45
+umount $d
+else
+rm -f "$TMP"
+$DIALOG --inputbox "$MESSAGE2 $AVAIL" 8 62 "60" 2>"$TMP" || { umount "$d" ; bailout; }
+IN="`cat $TMP`" 
+[ "$IN" -ge 60 -a "$IN" -le "$AVAIL" ] 2>/dev/null || IN="60"
+echo "$MESSAGE3"
+dd if=/dev/zero of="$f" bs=1000k count="$IN" && \
+mkswap -v1 "$f" && swapon -v "$f" 2>/dev/null && \
+echo "$f swap swap defaults 0 0" >>/etc/fstab
+[ "$?" = "0" ] && { sleep 2 ; $DIALOG --msgbox "$SUCCESS" 10 45; } || umount "$d" 2>/dev/null
+mount -o remount,ro $d
+fi
+else
+umount "$d"
+fi
+fi
+done
+else
+case "$LANGUAGE" in
+de|at|ch)
+ERROR2="Leider sind auf Ihrem System keine geeigneten DOS-Partitionen zum Einrichten eines Swapfile vorhanden."
+;;
+es)
+ERROR2="Lo siento, no se han encontrado particiones disponibles de tipo DOS para el fichero swap de memoria virtual."
+;;
+*)
+ERROR2="Sorry, no DOS partitions available for swapfile."
+;;
+esac
+
+$DIALOG --msgbox "$ERROR2" 10 45
+fi
+
+bailout
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/modemlink b/usr_sbin/modemlink
new file mode 100755 (executable)
index 0000000..1362bad
--- /dev/null
@@ -0,0 +1,330 @@
+#!/bin/bash +x
+# Filename:      modemlink
+# Purpose:       start device drivers and set /dev/modem link in GRML
+# Authors:       (c) Klaus Knopper Mar 2004, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mit Okt 04 11:51:09 CEST 2006 [mika]
+################################################################################
+
+PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin"
+export PATH
+
+# XDIALOG_HIGH_DIALOG_COMPAT=1
+# export XDIALOG_HIGH_DIALOG_COMPAT
+
+if [ $UID != 0 ] ; then
+   echo Error: become root before starting $0 >& 2
+   exit 100
+fi
+
+TMP=$(mktemp)
+
+bailout(){
+  rm -f "$TMP"
+  exit $1
+}
+
+DIALOG="dialog"
+# [ -n "$DISPLAY" ] && [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog"
+
+trap bailout 1 2 3 15
+
+# LANGUAGE
+[ -r /etc/default/locale ] && . /etc/default/locale
+
+# Language-dependent Messages
+case "$LANGUAGE" in
+de*|at*|ch*)
+TITLE1="Art der Verbindung"
+MESSAGE1="Bitte die gewünschten Verbindungsart auswählen:"
+SERIAL="Serielle Schnittstelle (z.B. Modem)"
+WINMODEM="Nach nicht-unterstützten \"WinModems\" suchen"
+SIR="Standard SIR (oder USB)"
+USB="USB Schnittstelle (z.B. Modem)"
+IRDA="Infrarot Schnittstelle (z.B. für Handy/PDA)"
+BLUETOOTH="Bluetooth Funkadapter (z.B. für Handy/PDA)"
+TITLE_DONGLES="IRDA Adapter-Typ"
+MESSAGE_DONGLES="Bitte den verwendeten IRDA-Adaptertyp auswählen:"
+TITLE_TEST="Adaptertest - Strg-C zum Beenden des Tests"
+TITLE_SRVFAIL="FEHLER"
+MESSAGE_SRVFAIL="Konnte Daemon für Gerät nicht starten. Wahrscheinlich wurde die falsche Schnittstelle ausgewählt." 
+AUTOSEARCH="ALLE Schnittstellen scannen"
+TITLE_BLUES="Bluetooth-Geräte"
+MESSAGE_BLUES="Folgende Bluetooth-Geräte befinden sich in der Umgebung. Bitte eins auswählen:"
+TITLE_PIN="PIN"
+MESSAGE_PIN="Bitte geben Sie eine 4-stellige PIN zur Authentfizierung der Bluetooth-Geräte ein:"
+TITLE_GAUGE="Device-Scan..."
+TITLE_LINK="/dev/modem Link erzeugen..."
+MESSAGE_LINK="Möchten Sie den Symlink /dev/modem auf das neu konfigurierte Gerät setzen? Dies ist notwendig, wenn Sie das Gerät z.B. als Modem für kppp oder GPRS benutzen möchten).
+
+Verlinken von /dev/modem -> "
+TITLE_RETRY="FEHLER"
+MESSAGE_RETRY="Das scheint nicht geklappt zu haben. Noch einmal versuchen?"
+TITLE_BTID="Keine Bluetooth Geräte in Reichweite"
+MESSAGE_BTID="Auf die Sendeanfrage hat kein Bluetooth-Gerät geantwortet. Bitte geben Sie die Adresse eines entfernten Bluetooth-Gerätes ein."
+;;
+*)
+TITLE1="Connection Type"
+MESSAGE1="Please select type of connection:"
+WINMODEM="Scan for unsupported \"WinModems\""
+SERIAL="Serial connector (i.e. Modem)"
+SIR="Standard SIR (or USB)"
+USB="USB connector (i.e. Modem)"
+IRDA="Infrared wireless device (i.e. cellphone/PDA)"
+BLUETOOTH="Bluetooth wireless device (i.e. cellphone/PDA)"
+TITLE_DONGLES="IRDA Adapter type"
+MESSAGE_DONGLES="Please select type of IRDA adapter:"
+TITLE_TEST="Testing adapter - Hit Ctrl-C to end test."
+TITLE_SRVFAIL="ERROR"
+MESSAGE_SRVFAIL="Failed to start device daemon. Probably the selected port is wrong."
+AUTOSEARCH="scan ALL devices"
+TITLE_BLUES="Bluetooth Devices"
+MESSAGE_BLUES="These bluetooth devices exist nearby. Please select:"
+TITLE_PIN="PIN"
+MESSAGE_PIN="Please chose a 4-digit PIN number for authention of bluetooth devices:"
+TITLE_GAUGE="Scanning devices..."
+TITLE_LINK="Create /dev/modem link..."
+MESSAGE_LINK="Do you want to set the symlink /dev/modem to point to the newly configured device? This is necessary if you want o use the device as modem for kppp, as an example, or for using GPRS).
+
+Create link /dev/modem -> "
+TITLE_RETRY="ERROR"
+MESSAGE_RETRY="This seems to have failed. Do you want to try again?"
+TITLE_BTID="No bluetooth devices in range"
+MESSAGE_BTID="No bluetooth devices responded to our scan. Please enter the address of a remote bluetooth device."
+;;
+esac
+
+# Shortcut description selected
+TYPES=(serial "$SERIAL" on \
+usb "$USB" off \
+irda "$IRDA" off \
+bluetooth "$BLUETOOTH" off \
+winmodem "$WINMODEM" off)
+
+type scanmodem >/dev/null 2>&1 || { unset TYPES[14]; unset TYPES[13]; unset TYPES[12]; }
+type rfcomm >/dev/null 2>&1 || { unset TYPES[11]; unset TYPES[10]; unset TYPES[9]; }
+type irdadump >/dev/null 2>&1 || { unset TYPES[8]; unset TYPES[7]; unset TYPES[6]; }
+
+# man irattach
+DONGLES=(auto "$SIR" on \
+act200l "ACTiSYS Ir-200L dongles" off \
+actisys "ACTiSYS IR-220L dongle" off \
+actisys+ "ACTiSYS IR-220L+ dongle" off \
+airport "Airport dongle" off \
+ep7211 "IR port driver for the Cirrus Logic EP7211 processor (ARM based)" off \
+esi "Extended Systems JetEye PC ESI-9680" off \
+girbil "Greenwich GIrBIL dongle" off \
+litelink "Parallax LiteLink dongle & Extended Systems JetEye PC ESI-9680B" off \
+old_belkin "Belkin (old) SmartBeam dongle or any dongle only capable of 9600 bauds" off \
+ma600 "Mobile Action ma600 dongles" off \
+mcp2120 "Dongles based on the MCP2120 (Microchip)" off \
+tekram "Tekram IrMate IR-210B dongle" off)
+
+AUTODEVICE=(auto "$AUTOSEARCH" off)
+
+SERIALDEVICES=(ttyS0 "(COM1:)" off \
+ttyS1 "(COM2:)" off \
+ttyS2 "(COM3:)" off \
+ttyS3 "(COM4:)" off \
+ttyS4 "(COM5:)" off \
+ttyS5 "(COM6:)" off \
+ttyS6 "(COM7:)" off \
+ttyS7 "(COM8:)" off \
+ttyS8 "(COM9:)" off \
+ttyS9 "(COM10:)" off \
+ttyS10 "(COM11:)" off \
+ttyS11 "(COM12:)" off \
+ttyS12 "(COM13:)" off \
+ttyS13 "(COM14:)" off \
+ttyS14 "(COM15:)" off \
+ttyS15 "(COM16:)" off)
+
+USBDEVICES=(ttyACM0 "USB Modem 1" off \
+ttyACM1 "USB Modem 2" off \
+ttyACM2 "USB Modem 3" off \
+ttyACM3 "USB Modem 4" off \
+ttyUSB0 "USB Serial 0" off \
+ttyUSB1 "USB Serial 1" off \
+ttyUSB2 "USB Serial 2" off \
+ttyUSB3 "USB Serial 3" off)
+
+num=${#COMMANDS[@]}
+
+#for ((i=0; i<$num; i++)); do
+## Remove non-existing desktops/descriptions from list
+#d0="$(($i * 3))"
+#d1="$(($i * 3 + 1))"
+#d2="$(($i * 3 + 2))"
+#if type "${COMMANDS[$i]}" >/dev/null 2>&1; then
+#[ "$DESKTOP" = "${DESKTOPS[$(($i * 3))]}" ] && DESKTOPS[$(($i * 3 + 2))]="on" || DESKTOPS[$(($i * 3 + 2))]="off"
+#else
+#unset DESKTOPS[$d0]
+#unset DESKTOPS[$d1]
+#unset DESKTOPS[$d2]
+#unset COMMANDS[$i]
+#fi
+#done
+
+gauge(){
+rm -f "$TMP.done"
+status=0
+while [ ! -e "$TMP.done" ]; do echo "$status" ; status="`expr \( 100 - $status \) / 4 + $status`"; sleep 2; done | $DIALOG --title "$TITLE_GAUGE" --gauge "$1" 8 75 0
+}
+
+# Stop status bar
+killgauge(){
+touch "$TMP.done" ; wait ; rm -f "$TMP.done"
+}
+
+conntype(){
+rm -f "$TMP"
+$DIALOG --clear --title "$TITLE1" --radiolist "$MESSAGE1" 18 75 9 "${TYPES[@]}" 2>"$TMP" || bailout 1
+read TYPE <"$TMP"
+TYPE="${TYPE#\"}"; TYPE="${TYPE%\"}"
+rm -f "$TMP"
+return 0
+}
+
+startservice(){
+case "$TYPE" in
+serial)
+rm -f "$TMP"
+$DIALOG --clear --title "$TITLE_RAWDEVICE" --radiolist "$MESSAGE_RAWDEVICE" 18 75 9 "${SERIALDEVICES[@]}" 2>"$TMP" || bailout 1
+read DEVICE <"$TMP"
+DEVICE="${DEVICE#\"}"; DEVICE="${DEVICE%\"}"
+rm -f "$TMP"
+;;
+winmodem)
+[ -n "$DISPLAY" ] && xterm -e bash -c "scanmodem; read -p 'Enter to quit.'" || { scanmodem; read -p 'Enter to quit.'; }
+return 1
+;;
+usb)
+rm -f "$TMP"
+$DIALOG --clear --title "$TITLE_RAWDEVICE" --radiolist "$MESSAGE_RAWDEVICE" 18 75 9 "${USBDEVICES[@]}" 2>"$TMP" || bailout 1
+read DEVICE <"$TMP"
+DEVICE="${DEVICE#\"}"; DEVICE="${DEVICE%\"}"
+rm -f "$TMP"
+;;
+irda)
+killall irattach 2>/dev/null
+modprobe irda 2>/dev/null
+modprobe ircomm-tty 2>/dev/null
+rm -f "$TMP"
+$DIALOG --clear --title "$TITLE_RAWDEVICE" --radiolist "$MESSAGE_RAWDEVICE" 18 75 9 "${AUTODEVICE[@]}" "${SERIALDEVICES[@]}" "${USBDEVICES[@]}" 2>"$TMP" || bailout 1
+read RAWDEVICE <"$TMP"
+RAWDEVICE="${RAWDEVICE#\"}"; RAWDEVICE="${RAWDEVICE%\"}"
+rm -f "$TMP"
+$DIALOG --clear --title "$TITLE_DONGLES" --radiolist "$MESSAGE_DONGLES" 18 75 9 "${DONGLES[@]}" 2>"$TMP" || bailout 1
+read DONGLE <"$TMP"
+DONGLE="${DONGLE#\"}"; DONGLE="${DONGLE%\"}"
+rm -f "$TMP"
+case "$DONGLE" in auto) DONGLE="" ;; *) DONGLE="-d $DONGLE" ;; esac
+if [ "$RAWDEVICE" = "auto" ]; then
+gauge "Device-Scan..." &
+for i in /dev/ttyUSB* /dev/ttyS*; do
+RAWDEVICE="${i##/dev/}"
+irattach "/dev/$RAWDEVICE" $DONGLE -s
+usleep 125000
+done
+killgauge
+sleep 2
+RAWDEVICE="$(ps auxw | awk '/irattach/{print $12}' | head -1)"
+RAWDEVICE="${RAWDEVICE##/dev/}"
+else
+irattach "/dev/$RAWDEVICE" $DONGLE -s
+sleep 2
+fi
+if ifconfig irda0 >/dev/null 2>&1; then
+true
+else
+$DIALOG --clear --title "$TITLE_SRVFAIL" --msgbox "$MESSAGE_SRVFAIL" 18 75
+DEVICE=""
+return 1
+fi
+DEVICE="ircomm0"
+rm -f /etc/irda.conf
+echo "#irda.conf Version: 1.0
+IRDADEV=/dev/$RAWDEVICE" >/etc/irda.conf
+[ -n "$DONGLE" ] && echo "DONGLE=\"${DONGLE##-d }\"" >>/etc/irda.conf
+echo "DISCOVERY=-s
+ENABLE=yes" >>/etc/irda.conf
+[ -x /etc/init.d/irda ] && for i in 2 3 5; do ln -sf /etc/init.d/irda /etc/rc$i.d/S99irda; done
+;;
+bluetooth)
+killall hcid 2>/dev/null
+killall rfcomm 2>/dev/null
+hcid || return 1
+count=0
+gauge "Device-Scan..." &
+while read HW NAME; do
+d0="$(($count * 3))"
+d1="$(($count * 3 + 1))"
+d2="$(($count * 3 + 2))"
+BLUES[$d0]="$HW"; BLUES[$d1]="$NAME"; BLUES[$d2]="off"
+count=$(($count + 1))
+done <<EOT
+$(hcitool scan 2>/dev/null | awk '/[0-9]:[0-9]/{print $0}')
+EOT
+killgauge
+if [ -n "${BLUES[0]}" ]; then
+$DIALOG --clear --title "$TITLE_BLUES" --radiolist "$MESSAGE_BLUES" 18 75 9 "${BLUES[@]}" 2>"$TMP" || bailout 1
+else
+$DIALOG --title "$TITLE_BTID" --inputbox "$MESSAGE_BTID" 15 60 "00:00:00:00:00:00" 2>"$TMP" || bailout 1
+fi
+read RAWDEVICE <"$TMP"
+RAWDEVICE="${RAWDEVICE#\"}"; RAWDEVICE="${RAWDEVICE%\"}"
+rm -f "$TMP"
+read PIN < /etc/bluetooth/pin  2>/dev/null
+rm -f "$TMP"
+if [ -n "$DISPLAY" ]; then
+$DIALOG --title "$TITLE_PIN" --inputbox "$MESSAGE_PIN" 8 65 "$PIN" 2>"$TMP" || bailout 1
+fi
+read PIN <"$TMP" 2>/dev/null
+rm -f "$TMP"
+rm -f /etc/bluetooth/pin
+echo "$PIN" >/etc/bluetooth/pin
+rm -f /etc/bluetooth/rfcomm.conf
+cat >/etc/bluetooth/rfcomm.conf <<EOT
+#
+# RFCOMM configuration file.
+#
+# Created by modemlink-grml on $(date)
+#
+
+rfcomm0 {
+ bind yes;
+# Bluetooth address of the device
+ device $RAWDEVICE;
+# RFCOMM channel for the connection
+#      channel 1;
+# Description of the connection
+ comment "Selected Bluetooth device";
+}
+EOT
+rfcomm bind all
+[ -x /etc/init.d/bluez-utils ] && for i in 2 3 5; do ln -sf /etc/init.d/bluez-utils /etc/rc$i.d/S99bluez-utils; done
+DEVICE=rfcomm0
+;;
+esac
+return 0
+}
+
+# MAIN
+
+while true; do
+conntype
+startservice
+if [ "$?" = "0" -a -n "$DEVICE" ]; then
+$DIALOG --title "$TITLE_LINK" --yesno "$MESSAGE_LINK $DEVICE ?" 15 65 || bailout 1
+rm -f /dev/modem
+ln -sf /dev/"$DEVICE" /dev/modem
+break
+else
+$DIALOG --clear --title "$TITLE_RETRY" --yesno "$MESSAGE_RETRY" 18 75 || bailout 1
+fi
+done
+
+bailout 0
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/ndiswrapper.sh b/usr_sbin/ndiswrapper.sh
new file mode 100755 (executable)
index 0000000..7112b29
--- /dev/null
@@ -0,0 +1,99 @@
+#!/bin/bash
+# Filename:      ndiswrapper.sh
+# Purpose:       NdisWrapper configuration script
+# Authors:       (c) Martin Oehler 2004, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Fri Apr 21 22:22:12 CEST 2006 [mika]
+################################################################################
+
+PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin"
+export PATH
+
+# Get root
+if [ $UID != 0 ] ; then
+   echo Error: become root before starting $0 >& 2
+   exit 100
+fi
+unset SUDO_COMMAND
+
+# XDIALOG_HIGH_DIALOG_COMPAT=1
+# export XDIALOG_HIGH_DIALOG_COMPAT
+# XDIALOG_FORCE_AUTOSIZE=1
+# export XDIALOG_FORCE_AUTOSIZE
+
+TMP=$(mktemp)
+
+DIALOG="dialog"
+# [ -n "$DISPLAY" ] && [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog"
+
+BACKTITLE="GRML NDISWRAPPER TOOL"
+
+# this error is displayed when something is wrong eith the
+# inf file
+inf_error() {
+  $DIALOG --title "$BACKTITLE" --backtitle "ERROR" --msgbox "The selected file is no *.inf file or the *.inf file is invalid, exiting." 12 75;
+}
+
+
+# at first we show the usual disclaimer that the usage of this
+# script could simply destroy everything
+
+# dialog doesn't knows --center
+if [ "$DIALOG" = "dialog" ]; then
+  $DIALOG --title "$BACKTITLE" --backtitle "DISCLAIMER" --msgbox "This is the configuration tool for the ndiswrapper utilities. \n
+Be aware that loading a windows driver file for your wlan \n
+card using this tool could freeze your system. \n
+\n
+You need matching driver.inf and driver.sys files residing on \n
+a mounted data medium. After the windows drivers have been \n
+successfully loaded via the ndiswrapper, you have to configure \n
+your wlan settings via iwconfig. Future releases of this script \n
+will include this. \n
+\n
+Please send your feedback to <oehler@knopper.net>" 16 75;
+else
+  $DIALOG --center --title "$BACKTITLE" --backtitle "DISCLAIMER" --msgbox "This is the configuration tool for the ndiswrapper utilities. \n
+Be aware that loading a windows driver file for your \n
+wlan card using this tool could freeze your system. \n
+\n
+You need matching driver.inf and driver.sys files residing on \n
+a mounted data medium. After the windows drivers have been \n
+successfully loaded via the ndiswrapper, you have to configure \n
+your wlan settings via iwconfig. Future releases of this script \n
+will include this. \n
+\n
+Please send your feedback to \n
+<oehler@knopper.net>" 12 75;
+fi
+
+$DIALOG --title "$BACKTITLE" --backtitle "SELECT <DRIVER>.INF FILE" --fselect "/home/grml" 12 75 2>"$TMP"; read DRIVER_PATH <"$TMP"; rm -f "$TMP";
+
+test -x "/usr/sbin/ndiswrapper" || { echo "NdisWrapper not found, exiting." >&2; exit 1; }
+test -x "/sbin/modprobe" || { echo "modprobe not found, exiting." >&2; exit 1; }
+test -e $DRIVER_PATH || { echo "$DRIVER_PATH does not exist, exiting." >&2; exit 1; }
+case "$DRIVER_PATH" in
+  *\.inf*) NUM=`grep -c "sys" "$DRIVER_PATH"`
+           if [ "$NUM" -lt 1 ]; then
+            inf_error; exit 1;
+          fi;;
+  *) inf_error; exit 1;
+esac
+
+# how much lines are in /proc/net/wireless
+LINES1=`cat /proc/net/wireless | wc -l`
+
+ndiswrapper -i $DRIVER_PATH
+modprobe ndiswrapper
+ndiswrapper -m
+
+# have we got a new device?
+LINES2=`cat /proc/net/wireless | wc -l`
+
+if [ "$LINES2" -gt "$LINES1" ]; then
+  $DIALOG --title "$BACKTITLE" --backtitle "RESULT" --msgbox "The ndiswrapper module has been loaded. You may configure your wlan card with iwconfig now." 12 75 2>"$TMP"; [ "$?" != "0" ] && return 1; rm -f "$TMP";
+else
+  $DIALOG --title "$BACKTITLE" --backtitle "RESULT" --msgbox "The ndiswrapper module has been loaded but there is no new device. Perhaps NdisWrapper is not working with your driver file." 12 75 2>"$TMP"; [ "$?" != "0" ] && return 1; rm -f "$TMP";
+fi
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/netcardconfig b/usr_sbin/netcardconfig
new file mode 100755 (executable)
index 0000000..23f7242
--- /dev/null
@@ -0,0 +1,754 @@
+#!/bin/bash
+# Filename:      grml-network
+# Purpose:       configuration script for network
+# Authors:       Klaus Knopper 2002, Niall Walsh + Stefan Lippers-Hollmann 2005, Michael Prokop <mika@grml.org>, Marcel Wichern <marcel@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Mit Okt 04 11:52:26 CEST 2006 [mika]
+################################################################################
+# Changes have been merged from Kanotix's netcardconfig taken from
+# http://kanotix.com/files/debian/pool/main/n/netcardconfig-kanotix/
+################################################################################
+
+PATH="/bin:/sbin:/usr/bin:/usr/sbin"
+export PATH
+
+# get root
+if [ $UID != 0 ]; then
+ echo Error: become root before starting $0 >&2
+ exit 100
+fi
+
+TMP=$(mktemp)
+WPATMP=$(mktemp)
+
+bailout() {
+  rm -f "$TMP"
+  rm -f "$WPATMP"
+  exit $1
+}
+
+# This function produces the IWOURLINE for interfaces
+writeiwline() {
+  IWOURLINE=""
+  if [ -n "$NWID" ]; then
+    IWOURLINE="$IWOURLINE wireless-nwid $NWID\n"
+  fi
+
+  if [ -n "$MODE" ]; then
+    IWOURLINE="$IWOURLINE wireless-mode $MODE\n"
+  fi
+
+  if [ -n "$CHANNEL" ]; then
+    IWOURLINE="$IWOURLINE wireless-channel $CHANNEL\n"
+  fi
+
+  if [ -n "$FREQ" ]; then
+    IWOURLINE="$IWOURLINE wireless-freq $FREQ\n"
+  fi
+
+  if [ -n "$KEY" ]; then
+    if [ "$PUBKEY" -eq 1 ]; then
+      # Store the key in interfaces in wireless-key
+      IWOURLINE="$IWOURLINE wireless-key $KEY\n"
+    else
+      # Store the key in /etc/network/wep.$DV which is root readable only
+      # Use pre-up in interfaces to read and set it
+      echo "$KEY" > /etc/network/wep.$DV && chmod 600 /etc/network/wep.$DV && IWOURLINE="$IWOURLINE pre-up KEY=\$(cat /etc/network/wep.$DV) && iwconfig $DV key \$KEY\n"
+    fi
+  fi
+
+  [ -d /sys/module/rt2??0/ ] && IWPREUPLINE="$IWPREUPLINE pre-up /sbin/ifconfig $DV up\n"
+
+  if [ -n "$IWCONFIG" ]; then
+    IWPREUPLINE="$IWPREUPLINE iwconfig $IWCONFIG\n"
+  fi
+
+  if [ -n "$IWSPY" ]; then
+    IWPREUPLINE="$IWPREUPLINE iwspy $IWSPY\n"
+  fi
+
+  if [ -n "$IWPRIV" ]; then
+    IWPREUPLINE="$IWPREUPLINE iwpriv $IWPRIV\n"
+  fi
+
+  # execute ESSID last, but make sure that it is written as first option
+  if [ -n "$ESSID" ]; then
+    IWOURLINE="$IWOURLINE wireless-essid $ESSID\n"
+  fi
+
+  if [ $WPAON -gt 0 ]; then
+    # Using wpa requires a wpa_supplicant entry
+    IWPREUPLINE="${IWPREUPLINE}pre-up wpa_supplicant -D$WPA_DEV -i$WLDEVICE -c/etc/wpa_supplicant.conf -B\n"
+    touch /etc/wpa_supplicant.conf
+    awk '/^network={/{if(found){found=0}else{found=1;hold=$0}}/ssid={/{if(/ssid='"$ESSID"'/){found=1}else{found=0;print hold}}{if(!found){print}}' /etc/wpa_supplicant.conf >> "$TMP"
+    wpa_passphrase "$ESSID" "$WPASECRET" 2>/dev/null >> "$TMP"
+    mv -f /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.$(date +%Y%m%d_%H%M)
+    if ! grep -q "For more information take a look at" /etc/wpa_supplicant.conf ; then
+      cat >$WPATMP <<EOF
+# /etc/wpa_supplicant.conf
+# For more information take a look at /usr/share/doc/wpasupplicant/
+#
+# Other WPA options:
+#  scan_ssid [0]|1
+#  bssid 00:11:22:33:44:55
+#  priority [0]|Integer
+#  proto [WPA RSN] WPA|RSN
+#  key_mgmt [WPA-PSK WPA-EAP]|NONE|WPA-PSK|WPA-EAP|IEEE8021X
+#  pairwise [CCMP TKIP]|CCMP|TKIP|NONE
+#  group [CCMP TKIP WEP105 WEP40]|CCMP|TKIP|WEP105|WEP40
+#  eapol_flags [3]|1|2
+
+EOF
+    fi
+    [ -n "$APSCAN" ] && echo "$APSCAN" >> "$WPATMP"
+    cat "$WPATMP" "$TMP" > /etc/wpa_supplicant.conf
+    rm -f $WPATMP 2>/dev/null
+    IWDOWNLINE="${IWDOWNLINE}down killall wpa_supplicant\n"
+  fi
+
+  IWOURLINE="$IWOURLINE $IWPREUPLINE $IWDOWNLINE"
+  #echo "DEBUG: for interfaces $IWOURLINE"
+}
+
+device2props() {
+  PARTCOUNT=0
+  isauto=0
+  isfirewire=0
+  iswireless=0
+  driver=""
+  mac=""
+  for PART in $DEVICE; do
+    if [ $PARTCOUNT -eq 0 ]; then
+      DEVICENAME=$PART
+    else
+      echo $PART | grep -q A::1 && isauto=1
+      echo $PART | grep -q F::1 && isfirewire=1
+      echo $PART | grep -q W::1 && iswireless=1
+      [ -z "$driver" ] && driver=$(echo $PART|awk 'BEGIN {FS="::"} /^D:/{print $2}')
+      [ -z "$mac" ] && mac=$(echo $PART|awk 'BEGIN {FS="::"} /^M:/{print $2}')
+    fi
+    ((PARTCOUNT++))
+  done
+}
+
+props2string() {
+  MY_DEVICE_NAME=""
+  [ $isfirewire -gt 0 ] && MY_DEVICE_NAME="$NET_DEVICE_NAME_FW"
+  [ -z "$MY_DEVICE_NAME" -a $iswireless -gt 0 ] && MY_DEVICE_NAME="$NET_DEVICE_NAME_W"
+  [ -z "$MY_DEVICE_NAME" ] && MY_DEVICE_NAME="$NET_DEVICE_NAME"
+  MY_DEVICE_NAME="$DEVICENAME $MY_DEVICE_NAME $mac $driver"
+  [ $isauto -gt 0 ] && MY_DEVICE_NAME="$MY_DEVICE_NAME $NET_DEVICE_NAME_AUTO"
+  MY_DEVICE_NAME=$(echo $MY_DEVICE_NAME | sed 's/\ /__/g')
+}
+
+addauto() {
+  if ! egrep -e "^auto[  ]+.*$DV" /etc/network/interfaces >/dev/null; then
+    awk '{if(/^auto/){if(done==0){print $0 " '"$DV"'";done=1}else{print}}else{print}}END{if(done==0){print "auto '$DV'"}}' "/etc/network/interfaces" > "$TMP"
+    cat "$TMP" > /etc/network/interfaces
+  fi
+}
+
+remauto(){
+  if egrep -e "^auto[  ]+.*$DV" /etc/network/interfaces >/dev/null; then
+    perl -pi -e 's/^(auto.*)'$DV'(.*)$/$1$2/;' /etc/network/interfaces
+  fi
+}
+
+configiface() {
+  [ ! -r /etc/network/interfaces ] && touch /etc/network/interfaces
+  DEVICE=${NETDEVICES[$DV]}
+  device2props
+  DV=$DEVICENAME
+  # wireless config
+  WLDEVICE="$(LANG=C LC_MESSAGEWS=C iwconfig $DV 2>/dev/null | awk '/802\.11|READY|ESSID/{print $1}')"
+  WLDEVICECOUNT="$(LANG=C LC_MESSAGEWS=C iwconfig $DV 2>/dev/null | wc -l)"
+  if [ $iswireless -gt 0 ] && $DIALOG --yesno "$MESSAGE13" 8 45; then
+    ESSID=""
+    NWID=""
+    MODE=""
+    CHANNEL=""
+    FREQ=""
+    SENS=""
+    RATE=""
+    KEY=""
+    RTS=""
+    FRAG=""
+    IWCONFIG=""
+    IWSPY=""
+    IWPRIV=""
+
+    if [ -f /etc/network/interfaces ]; then
+      awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
+        /essid/{if(found){for(i=NF;i>=2;i--)essid=$i "~" essid}}
+        /nwid/{if(found){nwid=$NF}}
+        /mode/{if(found){mode=$NF}}
+        /channel/{if(found){channel=$NF}}
+        /freq/{if(found){freq=$NF}}
+        /sens/{if(found){sens=$NF}}
+        /rate/{if(found){rate=$NF}}
+        /rts/{if(found){rts=$NF}}
+        /frag/{if(found){frag=$NF}}
+        /iwconfig/{if(!/KEY/){if(found){iwconfig=$NF}}}
+        /iwspy/{if(found){iwspy=$NF}}
+        /iwpriv/{if(found){iwpriv=$NF}}
+        /wireless[-_]key/{if(found){gsub(/^\W*wireless[-_]key\W*/,"");key=$0}}
+        END{
+          if (!(length(essid))){essid="~~~"}
+          if (!(length(nwid))){nwid="~~~"}
+          if (!(length(mode))){mode="~~~"}
+          if (!(length(channel))){channel="~~~"}
+          if (!(length(freq))){freq="~~~"}
+          if (!(length(sens))){sens="~~~"}
+          if (!(length(rate))){rate="~~~"}
+          if (!(length(rts))){rts="~~~"}
+          if (!(length(frag))){frag="~~~"}
+          if (!(length(iwconfig))){iwconfig="~~~"}
+          if (!(length(iwspy))){iwspy="~~~"}
+          if (!(length(iwpriv))){iwpriv="~~~"}
+          if (!(length(key))){key="~~~"}
+          print essid" "nwid" "mode" "channel" "freq" "sens" "rate" "rts" "frag" "iwconfig" "iwspy" "iwpriv" "key
+        }' /etc/network/interfaces >"$TMP"
+
+      read ESSID NWID MODE CHANNEL FREQ SENS RATE RTS FRAG IWCONFIG IWSPY IWPRIV KEY<"$TMP"
+
+      if [ "$ESSID" = "~~~" ]; then  ESSID=""; fi
+      if [ "$NWID" = "~~~" ]; then  NWID=""; fi
+      if [ "$MODE" = "~~~" ]; then  MODE=""; fi
+      if [ "$CHANNEL" = "~~~" ]; then  CHANNEL=""; fi
+      if [ "$FREQ" = "~~~" ]; then  FREQ=""; fi
+      if [ "$SENS" = "~~~" ]; then  SENS=""; fi
+      if [ "$RATE" = "~~~" ]; then  RATE=""; fi
+      if [ "$RTS" = "~~~" ]; then  RTS=""; fi
+      if [ "$FRAG" = "~~~" ]; then  FRAG=""; fi
+      if [ "$IWCONFIG" = "~~~" ]; then IWCONFIG=""; fi
+      if [ "$IWSPY" = "~~~" ]; then  IWSPY=""; fi
+      if [ "$IWPRIV" = "~~~" ]; then  IWPRIV=""; fi
+      if [ "$KEY" = "~~~" ]; then  KEY=""; fi
+
+      ESSID=$(echo $ESSID | tr "~" " " | sed 's/ *$//')
+
+      if [ -z "$KEY" ]; then
+        KEY=$(cat /etc/network/wep.$DV 2>/dev/null)
+
+        if [ -z "$KEY" ]; then
+          PUBKEY=0
+        else
+          PUBKEY=-1
+        fi
+      else
+        PUBKEY=1
+      fi
+
+      #echo "DEBUG:E:$ESSID N:$NWID M:$MODE C:$CHANNEL F:$FREQ S:$SENS R:$RATE K:$KEY R:$RTS F:$FRAG I:$IWCONFIG I:$IWSPY I:$IWPRIV"
+      rm -f "$TMP"
+    fi
+
+    $DIALOG --inputbox "$MESSAGEW4 $DEVICENAME $MESSAGEW5" 15 50 "$ESSID" 2>"$TMP" || bailout 1
+    read ESSID <"$TMP" ; rm -f "$TMP"
+    [ -z "$ESSID" ] && ESSID="any"
+
+    $DIALOG --inputbox "$MESSAGEW6 $DEVICENAME $MESSAGEW7" 15 50 "$NWID" 2>"$TMP" || bailout 1
+    read NWID <"$TMP" ; rm -f "$TMP"
+
+    $DIALOG --inputbox "$MESSAGEW8 $DEVICENAME $MESSAGEW9" 15 50 "$MODE" 2>"$TMP" || bailout 1
+    read MODE <"$TMP" ; rm -f "$TMP"
+    [ -z "$MODE" ] && MODE="Managed"
+
+    $DIALOG --inputbox "$MESSAGEW10 $DEVICENAME $MESSAGEW11" 15 50 "$CHANNEL" 2>"$TMP" || bailout 1
+    read CHANNEL <"$TMP" ; rm -f "$TMP"
+
+    if [ -z "$CHANNEL" ]; then
+      $DIALOG --inputbox "$MESSAGEW12 $DEVICENAME $MESSAGEW13" 15 50 "$FREQ" 2>"$TMP" || bailout 1
+      read FREQ <"$TMP" ; rm -f "$TMP"
+    fi
+
+    WPAON=0
+    IWDRIVER=$driver
+
+    case $IWDRIVER in
+      ath_pci)
+        WPA_DEV="madwifi"
+        ;;
+      ipw2200|ipw2100)
+        WPA_DEV="wext"
+        ;;
+      hostap)
+        WPA_DEV="hostap"
+        ;;
+    esac
+
+    if [ -z "$WPA_DEV" ]; then
+      if [ -d /proc/net/ndiswrapper/$DV ]; then
+        WPA_DEV=ndiswrapper
+      elif [ -d /proc/net/hostap/$DV ]; then
+        WPA_DEV=hostap
+      elif [ $WLDEVICECOUNT -eq 1 ]; then
+        if [ -e /proc/driver/atmel ]; then
+          WPA_DEV=atmel
+        fi
+      fi
+    fi
+
+    WPAON=-1
+
+    if [ -n "$WPA_DEV" ]; then
+      if $DIALOG --yesno "$MESSAGEW22" 15 50; then
+        # Other wpa options
+        # scan_ssid [0]|1
+        # bssid 00:11:22:33:44:55
+        # priority [0]|Integer
+        # proto [WPA RSN] WPA|RSN
+        # key_mgmt [WPA-PSK WPA-EAP]|NONE|WPA-PSK|WPA-EAP|IEEE8021X
+        # pairwise [CCMP TKIP]|CCMP|TKIP|NONE
+        # group [CCMP TKIP WEP105 WEP40]|CCMP|TKIP|WEP105|WEP40
+        # eapol_flags [3]|1|2
+
+      if ! $DIALOG --yesno "Is SSID broadcast enabled?" 15 50; then
+        APSCAN="ap_scan=2"
+      fi
+        WPAON=1
+        KEY=""
+        WPASECRET=$(awk        '/network/{if(found){found=0}else{found=1}}/ssid/{if(/ssid="'"$ESSID"'"/){found=1}else{found=0}}/#scan_ssid=1/#psk=/{if(found){gsub(/^\W*#psk="/,"");gsub(/"\W*$/,"");print}}' /etc/wpa_supplicant.conf)
+
+        $DIALOG --inputbox "$MESSAGEW23 $ESSID" 15 50 "$WPASECRET" 2>"$TMP" || bailout 1
+        WPASECRET=$(sed -e 's/\\/\\/g' "$TMP") && rm -r "$TMP"
+
+        case $WPA_DEV in
+          hostap)
+            MODE="Managed"
+            ;;
+        esac
+      else
+        WPASECRET=""
+      fi
+    else
+      WPASECRET=""
+    fi
+
+    # No need for a wep key if we are using wpa
+    if [ ! $WPAON -eq 1 ]; then
+      $DIALOG --inputbox "$MESSAGEW14 $DEVICENAME $MESSAGEW15" 15 50 "$KEY" 2>"$TMP" || bailout 1
+      read KEY <"$TMP" ; rm -f "$TMP"
+
+      if [ -n "$KEY" -a "$PUBKEY" -eq 0 ]; then
+        if ! $DIALOG --yesno "$MESSAGEW25 $DEVICENAME $MESSAGEW26" 15 50; then
+          PUBKEY=1
+        fi
+      fi
+    fi
+
+    $DIALOG --inputbox "$MESSAGEW16 $DEVICENAME $MESSAGEW17" 15 50 "$IWCONFIG" 2>"$TMP" || bailout 1
+    read IWCONFIG <"$TMP" ; rm -f "$TMP"
+
+    $DIALOG --inputbox "$MESSAGEW18 $DEVICENAME $MESSAGEW19" 15 50 "$IWSPY" 2>"$TMP" || bailout 1
+    read IWSPY <"$TMP" ; rm -f "$TMP"
+
+    $DIALOG --inputbox "$MESSAGEW20 $DEVICENAME $MESSAGEW21" 15 50 "$IWPRIV" 2>"$TMP" || bailout 1
+    read IWPRIV <"$TMP" ; rm -f "$TMP"
+
+    writeiwline
+  fi
+
+  if $DIALOG --yesno "$MESSAGE2" 8 45; then
+    if [ -w /etc/network/interfaces ]; then
+      rm -f "$TMP"
+      awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
+        /^\W$/{if(blank==0){lastblank=1}else{lastblank=0}{blank=1}}
+        /\w/{blank=0;lastblank=0}
+        {if(!(found+lastblank)){print}}
+        END{print "iface '"$DV"' inet dhcp"}' \
+        /etc/network/interfaces >"$TMP"
+      echo -e "$IWOURLINE" >> $TMP
+      #echo -e "\n\n" >> $TMP
+      cat "$TMP" >/etc/network/interfaces
+      rm -f "$TMP"
+      # Add an "auto" entry
+      #addauto
+    fi
+  else
+    if [ -f /etc/network/interfaces ]; then
+      awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
+        /address/{if(found){address=$NF}}
+        /netmask/{if(found){netmask=$NF}}
+        /broadcast/{if(found){broadcast=$NF}}
+        /gateway/{if(found){gateway=$NF}}
+        END{print address" "netmask" "broadcast" "gateway}' /etc/network/interfaces >"$TMP"
+      read IP NM BC DG <"$TMP"
+      rm -f "$TMP"
+    fi
+
+    $DIALOG --inputbox "$MESSAGE6 $DV" 10 45 "${IP:-192.168.0.1}" 2>"$TMP" || bailout 1
+    read IP <"$TMP" ; rm -f "$TMP"
+
+    $DIALOG --inputbox "$MESSAGE7 $DV" 10 45 "${NM:-255.255.255.0}" 2>"$TMP" || bailout 1
+    read NM <"$TMP" ; rm -f "$TMP"
+
+    $DIALOG --inputbox "$MESSAGE8 $DV" 10 45 "${BC:-${IP%.*}.255}" 2>"$TMP" || bailout 1
+    read BC <"$TMP" ; rm -f "$TMP"
+
+    $DIALOG --inputbox "$MESSAGE9" 10 45 "${DG:-${IP%.*}.254}" 2>"$TMP"
+    read DG <"$TMP" ; rm -f "$TMP"
+
+    if [ -f "/etc/resolv.conf" ]; then
+      NS="$(awk '/^nameserver/{printf "%s ",$2}' /etc/resolv.conf)"
+    fi
+
+    $DIALOG --inputbox "$MESSAGE10" 10 45 "${NS:-${IP%.*}.254}" 2>"$TMP"
+    read NS <"$TMP" ; rm -f "$TMP"
+
+    if [ -w /etc/network/interfaces ]; then
+      awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
+        {if(!found){print}}
+        END{print "\niface '"$DV"' inet static\n\taddress '"$IP"'\n\tnetmask '"$NM"'\n\tnetwork '"${IP%.*}.0"'";if("'"$BC"'"!=""){print "\tbroadcast '"$BC"'"};if("'"$DG"'"!=""){print "\tgateway '"$DG"'"};if("'"$IWOURLINE"'"!=""){print "'"$IWOURLINE"'"};print "\n"}' \
+        /etc/network/interfaces >"$TMP"
+
+      cat "$TMP" >/etc/network/interfaces
+      rm -f "$TMP"
+
+      # Add an "auto" entry
+      #addauto
+    fi
+
+    if [ -n "$NS" ]; then
+      more=""
+
+      for i in $NS; do
+        if [ -z "$more" ]; then
+          more=yes
+          echo "$MESSAGE11 $i"
+          echo "nameserver $i" >/etc/resolv.conf
+        else
+          echo "$MESSAGE12 $i"
+          echo "nameserver $i" >>/etc/resolv.conf
+        fi
+      done
+    fi
+  fi
+  echo "Done."
+}
+
+DIALOG="dialog"
+# export XDIALOG_HIGH_DIALOG_COMPAT=1
+# [ -n "$DISPLAY" ] && [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog"
+
+# LANGUAGE etc.
+[ -r /etc/default/locale ] && . /etc/default/locale
+
+# Default all strings to English
+NET_DEVICE_NAME="Network_device"
+NET_DEVICE_NAME_W="Wireless_device"
+NET_DEVICE_NAME_FW="Firewire_device"
+NET_DEVICE_NAME_AUTO="Auto"
+MESSAGE0="No supported network cards found."
+MESSAGE1="Please select network device"
+MESSAGE2="Use DHCP broadcast?"
+MESSAGE3="Sending DHCP broadcast from device"
+MESSAGE4="Failed."
+MESSAGE5="Hit return to exit."
+MESSAGE6="Please enter IP Address for "
+MESSAGE7="Please enter Network Mask for "
+MESSAGE8="Please enter Broadcast Address for "
+MESSAGE9="Please enter Default Gateway"
+MESSAGE10="Please enter Nameserver(s)"
+MESSAGE11="Setting Nameserver in /etc/resolv.conf to"
+MESSAGE12="Adding Nameserver to /etc/resolv.conf:"
+MESSAGE13="Setup wireless options?"
+MESSAGE14="Failed to bring up the interface, would you like to reconfigure it?"
+MESSAGE15="Interface enabled, do you want it auto enabled at boot?"
+MESSAGEW0="No wireless network card found."
+MESSAGEW1="Configuration of wireless parameters for"
+MESSAGEW3="Please configure IP parameters of the interface first"
+MESSAGEW4="Enter the ESSID for"
+MESSAGEW5="\n\n\n(empty for 'any', not recommended !)\n"
+MESSAGEW6="Enter the NWID (cell identifier)\nfor"
+MESSAGEW7=", if needed\n\n\n"
+MESSAGEW8="Enter the mode for"
+MESSAGEW9="\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
+MESSAGEW10="Enter channel number for"
+MESSAGEW11="\n\n(0 bis 16, empty for auto or if you want to\n enter the frequency next)\n"
+MESSAGEW12="Enter the frequency for"
+MESSAGEW13="\n\n(e.g 2.412G, empty for auto)"
+MESSAGEW14="Enter the encryption key\nfor"
+MESSAGEW15="\n\n(empty for cleartext, not recommended !!)"
+MESSAGEW16="Enter additional parameters for\n'iwconfig"
+MESSAGEW17="' if needed, e.g.\n\n\nsens -80  rts 512  frag 512  rate 5.5M"
+MESSAGEW18="Enter additional parameters for\n'iwspy"
+MESSAGEW19="' if needed\n\n\n"
+MESSAGEW20="Enter additional parameters for\n'iwpriv"
+MESSAGEW21="' if needed\n\n\n"
+MESSAGEW22="Enable WPA support?"
+MESSAGEW23="Enter the WPA passphrase (passphrase must be 8..63 characters) for"
+MESSAGEW25="Would you like to store your wep key in it's own private file ("
+MESSAGEW26=")?   If you say no, your wep key will be stored in /etc/network/interfaces and will be readable by any account on your system.  You may want to 'chmod 600 /etc/network/interfaces' if you answer no to this question"
+MESSAGEW27="Is SSID broadcast enabled?"
+
+case "$LANGUAGE" in
+  de|at|ch)
+    NET_DEVICE_NAME="Netzwerkkarte"
+    MESSAGE0="Keine unterstützten Netzwerkkarte(n) gefunden."
+    MESSAGE1="Bitte Netzwerkkarte auswählen"
+    MESSAGE2="DHCP Broadcast zur Konfiguration benutzen? (Nein=manuell)"
+    MESSAGE3="Sende DHCP Broadcast von Netzwerkkarte"
+    MESSAGE4="Fehlgeschlagen."
+    MESSAGE5="Eingabetaste zum Beenden."
+    MESSAGE6="Bitte geben Sie die IP-Adresse ein für "
+    MESSAGE7="Bitte geben Sie die Netzwerk-Maske ein für "
+    MESSAGE8="Bitte geben Sie die Broadcast-Adresse ein für "
+    MESSAGE9="Bitte geben Sie das Default-Gateway ein"
+    MESSAGE10="Bitte geben Sie den/die Nameserver ein"
+    MESSAGE11="Setze Nameserver in /etc/resolv.conf auf "
+    MESSAGE12="Füge Nameserver in /etc/resolv.conf hinzu:"
+    MESSAGE13="WLAN-Einstellungen konfigurieren?"
+    MESSAGE14="Fehler beim Aktivieren des Interface, wollen Sie es neu konfigurieren?"
+    MESSAGE15="Interface aktiviert, beim Systemstart automatisch aktivieren?"
+    MESSAGEW0="Keine Wireless-Netzwerkkarte gefunden."
+    MESSAGEW1="Konfiguration der Wireless-Parameter von"
+    MESSAGEW2="Bitte Wireless-Netzwerkkarte auswählen"
+    MESSAGEW3="Bitte konfigurieren Sie vorher die IP-Parameter der Karte !"
+    MESSAGEW4="Geben Sie die ESSID für"
+    MESSAGEW5="ein\n\n\n(leer für 'any', nicht zu empfehlen !!)\n"
+    MESSAGEW6="Geben Sie ggf. die NWID (Cell Identifier)\nfür"
+    MESSAGEW7="ein, falls es eine gibt\n\n\n"
+    MESSAGEW8="Geben Sie den Modus für"
+    MESSAGEW9="ein\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
+    MESSAGEW10="Geben Sie den Kanal für"
+    MESSAGEW11="ein\n\n(0 bis 16, leer für auto oder Frequenz-\neingabe im nächsten Fenster)\n"
+    MESSAGEW12="Geben Sie die Frequenz für"
+    MESSAGEW13="ein\n\n(z.B. 2.412G, leer für auto)"
+    MESSAGEW14="Geben Sie den Verschlüsselungs-Key\nfür"
+    MESSAGEW15="ein\n\n(leer für Klartext, nicht zu empfehlen !!)"
+    MESSAGEW16="Geben Sie ggf. zusätzliche Parameter für\n'iwconfig"
+    MESSAGEW17="' ein, z.B.\n\n\nsens -80  rts 512  frag 512  rate 5.5M"
+    MESSAGEW18="Geben Sie ggf. zusätzliche Parameter für\n'iwspy"
+    MESSAGEW19="' ein\n\n\n"
+    MESSAGEW20="Geben Sie ggf. zusätzliche Parameter für\n'iwpriv"
+    MESSAGEW21="' ein\n\n\n"
+    MESSAGEW22="WPA-Unterstützung aktivieren?"
+    MESSAGEW23="WPA-Passwort eingeben für"
+    MESSAGEW25="WEP-Schlüssel in privater Datei abspeichern ("
+    MESSAGEW26="? Wenn Sie hier Nein sagen, wird der WEP-Schlüssel in /etc/network/interfaces abgespeichert und kann von allen Accounts auf dem System gelesen werden. Wenn Sie mit Nein antworten, sollten Sie vielleicht 'chmod 600 /etc/network/interfaces' ausführen."
+    MESSAGEW27="Ist SSID Broadcast aktiviert?"
+    ;;
+  es)
+    NET_DEVICE_NAME="Dispositivo_de_la_red"
+    MESSAGE0="Se han encontrado tarjetas de red no soportadas."
+    MESSAGE1="Por favor, seleccione el dispositivo fisico  de red"
+    MESSAGE2="¿Utilizar broadcast DHCP?"
+    MESSAGE3="Enviando broadcast DHCP desde el dispositivo"
+    MESSAGE4="Fallado."
+    MESSAGE5="Pulse enter para salir."
+    MESSAGE6="Por favor, inserte la dirección IP para "
+    MESSAGE7="Por favor, inserte la máscara de red para "
+    MESSAGE8="Por favor, inserte la dirección de Broadcast para "
+    MESSAGE9="Por favor, inserte la puerta de enlace por defecto"
+    MESSAGE10="Por favor, inserte los servidores DNS"
+    MESSAGE11="Poniendo los servidores de nombres de /etc/resolv.conf a "
+    MESSAGE12="Adicionando servidor DNS a /etc/resolv.conf:"
+    MESSAGEW0="No se ha encontrado una tarjeta inalámbrica."
+    MESSAGEW1="Configuración de los parámetros inalámbricos para"
+    MESSAGEW2="Por favor, seleccione un dispositivo de red inalámbrico"
+    MESSAGEW3="Por favor, configure primero los parámetros de la IP para la interfaz"
+    MESSAGEW4="Teclee el ESSID para"
+    MESSAGEW5="\n\n\n(vacío para 'cualquiera', Â¡no recomendado!)\n"
+    MESSAGEW6="Teclee el NWID (identificador de celda)\npara"
+    MESSAGEW7=", si es necesario\n\n\n"
+    MESSAGEW8="Teclee el modo para"
+    MESSAGEW9="\n\n(Managed(=por_defecto), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
+    MESSAGEW10="Teclee el número del canal para"
+    MESSAGEW11="\n\n(0 bis 16, vacío para auto o si lo prefiere\n teclee la frecuencia seguidamente)\n"
+    MESSAGEW12="Teclee la frecuencia para"
+    MESSAGEW13="\n\n(ej. 2.412G, vacío para auto)"
+    MESSAGEW14="Teclee la clave de encriptación\npara"
+    MESSAGEW15="\n\n(vacío para texto plano, Â¡Â¡no recomendado!!)"
+    MESSAGEW16="Teclee los parámetros adicionales para\n'iwconfig"
+    MESSAGEW17="' Si es necesario, ej.\n\n\nsens -80  rts 512  frag 512  rate 5.5M"
+    MESSAGEW18="Teclee los parámetros adicionales para\n'iwspy"
+    MESSAGEW19="' si es necesario\n\n\n"
+    MESSAGEW20="Teclee los parámetros adicionales para\n'iwpriv"
+    MESSAGEW21="' si es necesario\n\n\n"
+    ;;
+  it)
+    NET_DEVICE_NAME="Periferica_di_rete"
+    NET_DEVICE_NAME_W="Periferica_Wireless"
+    NET_DEVICE_NAME_FW="Periferica_Firewire"
+    NET_DEVICE_NAME_AUTO="Automatico"
+    MESSAGE0="Non ho trovato schede di rete supportate."
+    MESSAGE1="Per favore seleziona la periferica di rete"
+    MESSAGE2="Devo utilizzare il broadcast DHCP?"
+    MESSAGE3="Sto inviando il broadcast DHCP dalla periferica"
+    MESSAGE4="Fallito."
+    MESSAGE5="Premi invio per uscire."
+    MESSAGE6="Inserisci l'indirizzo IP per "
+    MESSAGE7="Inserisci la maschera di rete per "
+    MESSAGE8="Inserisci l'indirizzo di broadcast per "
+    MESSAGE9="Inserisci il Gateway di default"
+    MESSAGE10="Inserisci i Nameserver"
+    MESSAGE11="Sto settando i Nameserver in /etc/resolv.conf a"
+    MESSAGE12="Aggiungo i Nameserver in /etc/resolv.conf:"
+    MESSAGE13="Configuro le opzioni del wireless?"
+    MESSAGE14="Non riesco ad attivare l'interfaccia, vuoi riconfigurarla?"
+    MESSAGE15="Interfaccia attiva, vuoi abilitarla automaticamente all'avvio?"
+    MESSAGEW0="Nessuna scheda di rete wireless trovata."
+    MESSAGEW1="Configurazione dei parametri wireless per"
+    MESSAGEW3="Configura i parametri IP dell'interfaccia per prima cosa!"
+    MESSAGEW4="Inserisci l'ESSID per"
+    MESSAGEW5="\n\n\n(vuoto per 'tutti', non raccomandato!)\n"
+    MESSAGEW6="Inserisci il NWID (cell identifier)\nper"
+    MESSAGEW7=", se necessario\n\n\n"
+    MESSAGEW8="Inserisci la modalità per"
+    MESSAGEW9="\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
+    MESSAGEW10="Inserisci il numero di canale per"
+    MESSAGEW11="\n\n(da 0 a 16, vuoto per automatico o se vuoi\n inserire la frequnza dopo)\n"
+    MESSAGEW12="Inserisci la frequenza per"
+    MESSAGEW13="\n\n(es. 2.412G, vuoto per automatico)"
+    MESSAGEW14="Inserisci la chiave crittografica\nper"
+    MESSAGEW15="\n\n(vuoto per trasmissione in chiaro, non raccomandato!)"
+    MESSAGEW16="Inserisci i parametri aggiuntivi per\n'iwconfig"
+    MESSAGEW17="' se necessario, es.\n\n\nsens -80  rts 512  frag 512  rate 5.5M"
+    MESSAGEW18="Inserisci parametri aggiuntivi per\n'iwspy"
+    MESSAGEW19="' se necessario\n\n\n"
+    MESSAGEW20="Inserisci parametri aggiuntivi per\n'iwpriv"
+    MESSAGEW21="' se necessario\n\n\n"
+    MESSAGEW22="Abilito il supporto WPA?"
+    MESSAGEW23="Inserisci la Passphrase di WPA\nper"
+    MESSAGEW25="Vuoi memorizzare la tua chiave WEP nel suo file riservato ("
+    MESSAGEW26=")?   Se dici no, la tua chiave WEP sarà memorizzata nel file /etc/network/interfaces e sarà leggibile da tutti gli account del tuo sistema. Dovresti fare 'chmod 600 /etc/network/interfaces' se rispondi no a questa domanda"
+    MESSAGEW27="Is SSID broadcast enabled?"
+    ;;
+fr)
+    NET_DEVICE_NAME="Carte_réseau"
+    MESSAGE0="Aucune carte réseau supportée trouvée."
+    MESSAGE1="Sélectionnez la carte réseau, svp"
+    MESSAGE2="Voulez-vous utiliser DHCP?"
+    MESSAGE3="Envoi de broadcast DHCP par la carte"
+    MESSAGE4="Echec."
+    MESSAGE5="Appuyez sur Entrée pour quitter."
+    MESSAGE6="Entrez une adresse IP pour "
+    MESSAGE7="Entrez le Masque de Sous-réseau pour "
+    MESSAGE8="Entrez l'adresse Broadcast pour "
+    MESSAGE9="Entrez l'IP de la Passerelle par Défaut"
+    MESSAGE10="Entrez Les DNS de votre FAI"
+    MESSAGE11="Réglage des DNS dans /etc/resolv.conf"
+    MESSAGE12="Ajoût des DNS dans /etc/resolv.conf:"
+    MESSAGEW0="Aucune carte Wifi trouvée."
+    MESSAGEW1="Configuration des paramètres de réseau sans fil pour "
+    MESSAGEW3="SVP, Commencez par configurer les paramètres d'IP de l'interface!"
+    MESSAGEW4="Entrez l'ESSID pour"
+    MESSAGEW5="\n\n\n(ne rien mettre pour 'peu importe' n'est pas recommandé !)\n"
+    MESSAGEW6="Entrez le NWID (cell identifier)\npour"
+    MESSAGEW7=", si nécessaire\n\n\n"
+    MESSAGEW8="Entrez le mode pour "
+    MESSAGEW9="\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
+    MESSAGEW10="Entrez numéro de canal pour"
+    MESSAGEW11="\n\n(0 Ã  16, vide pour auto ou si vous voulez\n entrer la fréquence ensuite)\n"
+    MESSAGEW12="Entrez la fréquence pour"
+    MESSAGEW13="\n\n(ex: 2.412G, vide pour auto)"
+    MESSAGEW14="Entrez la clé de cryptage\npour"
+    MESSAGEW15="\n\n(vide pour texte en clair, non recommandé !!)"
+    MESSAGEW16="Entrez des paramètres additionnels pour\n'iwconfig"
+    MESSAGEW17="' si nécessaire, comme \n\n\nsens -80  rts 512  frag 512  rate 5.5M"
+    MESSAGEW18="Entrer des paramètres additionnels pour\n'iwspy"
+    MESSAGEW19="' si nécessaire\n\n\n"
+    MESSAGEW20="Entrer des paramètres additionnels pour\n'iwpriv"
+    MESSAGEW21="' si nécessaire\n\n\n"
+    MESSAGEW22="Activer la protection WPA?"
+    MESSAGEW23="Entrez le mot-de-passe WPA pour"
+    MESSAGEW25="Clé WEP sauvée dans un fichier privé ("
+    MESSAGEW26="? Si vous répondez non ici, la clé WEP sera stockée dans /etc/network/interfaces et pourra Ãªtre accessible Ã  tous les utilisateurs de la machine. Peut-être serait-il alors judicieux de fixer ainsi les droits de 'interfaces': 'chmod 600 /etc/network/interfaces'"
+    MESSAGEW27="Is SSID broadcast enabled?"
+    ;;
+esac
+
+NETDEVICESCOUNT=0
+LAN=$(tail -n +3 /proc/net/dev|awk -F: '{print $1}'|sed "s/\s*//"|grep -v -e ^lo -e ^vmnet|sort)
+[ -n "$WLAN" ] || WLAN=$(tail -n +3 /proc/net/wireless 2>/dev/null|awk -F: '{print $1}'|sort)
+unset LAN_DEVICES WLAN_DEVICES FIREWIRE_DEVICES NETDEVICES
+while read dev mac; do
+#echo "Making NETDEVICES $NETDEVICESCOUNT $dev"
+  iswlan=$(echo $dev $WLAN|tr ' ' '\n'|sort|uniq -d)
+  isauto="0"
+  grep auto /etc/network/interfaces | grep -q $dev && isauto="1"
+  driver=$(ethtool -i $dev 2>/dev/null|awk '/^driver:/{print $2}')
+  if [ "$driver" ]; then
+    if [ "$iswlan" ]; then
+      NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac D::$driver W::1 F::0"
+    else
+      NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac D::$driver W::0 F::0"
+    fi
+  else
+    if [ "$iswlan" ]; then
+      NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac W::1 F::0"
+    else
+      NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac W::0 F::0"
+    fi
+  fi
+#echo "Made to ${NETDEVICES[$NETDEVICESCOUNT]}"
+  ((NETDEVICESCOUNT++))
+done < <(ifconfig -a|grep Ethernet|grep -v ^vmnet|awk '! /^\s/{print $1" "$5}')
+for dev in $LAN; do
+  if [ "$(ethtool -i $dev 2>/dev/null|awk '/^bus-info:/{print $2}')" == "ieee1394" ]; then
+    isauto="0"
+    grep auto /etc/network/interfaces | grep -q $dev && isauto="1"
+    NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto D::$(ethtool -i $dev 2>/dev/null|awk '/^driver:/{print $2}') W::0 F::1"
+    ((NETDEVICESCOUNT++))
+  fi
+done
+
+#NETDEVICES="$(cat /proc/net/dev | awk -F: '/eth.:|lan.:|tr.:|wlan.:|ath.:|ra.:/{print $1}')"
+
+if [ -z "$NETDEVICES" ]; then
+  $DIALOG --msgbox "$MESSAGE0" 15 45
+  bailout
+fi
+
+count="$NETDEVICESCOUNT"
+
+if [ "$count" -gt 1 ]; then
+  DEVICELIST=""
+  mycount=0
+  while [ $mycount -lt $count ]; do
+    DEVICE=${NETDEVICES[$mycount]}
+#echo "$mycount is $DEVICE"
+    device2props
+#echo "name: $DEVICENAME auto: $isauto fw: $isfirewire mac: $mac driver: $driver"
+    props2string
+    DEVICELIST="$DEVICELIST $mycount $MY_DEVICE_NAME"
+    ((mycount++))
+  done
+fi
+
+# To translate
+EXITKEY="E"
+EXITMENU="$EXITKEY Exit"
+
+# main program loop until they bailout
+while (true); do
+  # first get the device
+  if [ "$count" -gt 1 ]; then
+    rm -f "$TMP"
+    $DIALOG --menu "$MESSAGE1" 18 60 12 $DEVICELIST $EXITMENU 2>"$TMP" || bailout
+    read DV <"$TMP" ; rm -f "$TMP"
+    [ "$DV" = "$EXITKEY" ] && bailout
+  else
+    # Only one device
+    DV=0
+    # they have asked to stop configuring the interface so exit
+    [ -z "$IFACEDONE" ] || bailout
+  fi
+  # device config loop
+  IFACEDONE=""
+  while [ -n "$DV" -a -z "$IFACEDONE" ]; do
+    configiface
+    ifdown $DV
+    sleep 3
+    if ! ifup $DV; then
+      $DIALOG --yesno "$MESSAGE14" 15 50 || IFACEDONE="DONE"
+    else
+      $DIALOG --yesno "$MESSAGE15" 15 50 && addauto || remauto
+      IFACEDONE="DONE"
+    fi
+  done
+done
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/noeject b/usr_sbin/noeject
new file mode 100755 (executable)
index 0000000..a08a373
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+# Filename:      noeject
+# Purpose:       wrapper script to avoid ejecting of CD-ROM when rebooting/halt grml system
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Thu Nov 10 23:18:35 CET 2005 [mika]
+################################################################################
+
+touch /etc/noeject
+exec $*
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/noprompt b/usr_sbin/noprompt
new file mode 100755 (executable)
index 0000000..caa2944
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+# Filename:      noprompt
+# Purpose:       wrapper script to avoid prompting when rebooting/halt grml system
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Thu Nov 10 23:17:55 CET 2005 [mika]
+################################################################################
+
+touch /etc/noprompt
+exec $*
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/prepare_ramdisk.sh b/usr_sbin/prepare_ramdisk.sh
new file mode 100755 (executable)
index 0000000..092c87b
--- /dev/null
@@ -0,0 +1,98 @@
+#!/bin/zsh
+# Filename:      prepare_ramdisk.sh
+# Purpose:       setup a ramdisk
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Mai 27 15:12:55 CEST 2006 [mika]
+################################################################################
+
+if [ $UID != 0 ]; then
+  echo "Error: $0 requires root permissions. Exiting."
+  exit 1
+fi
+
+setopt nonomatch
+
+usage(){
+  echo "Usage: $0 <directory> <start|stop>"
+}
+
+if ! [ -n "$1" -a -n "$2" ] ; then
+  usage
+  exit 1
+fi
+
+[ -d /UNIONFS ] && UNIONFS="/UNIONFS" # running from live-CD?
+
+DIRECTORY="$1"
+FILENAME=$(echo $DIRECTORY | sed 's#/#_#g')
+CACHE_FILE="/ramdisk_cache/$FILENAME"
+CACHE_FILE_SIZE=64
+
+prepare_start () {
+  if ! mount | grep -q "tmpfs on /ramdisk_cache" ; then
+    echo -n "Setting up ramdisk /ramdisk_cache: "
+    [ -d /ramdisk_cache ] || mkdir /ramdisk_cache
+    mount -t tmpfs tmpfs /ramdisk_cache && echo "done"
+  fi
+
+  if ! mount | grep -q "${DIRECTORY}.*loop" ; then
+   if [ -d $DIRECTORY ] ; then
+    if ! mount | grep -q "loop.*${DIRECTORY}" ; then
+      mv $DIRECTORY/ $DIRECTORY.tmpfile && \
+      mkdir $DIRECTORY
+
+      echo -n "Setting up cachefile $CACHE_FILE for $DIRECTORY: "
+      dd if=/dev/zero of=${CACHE_FILE} bs=1M count=${CACHE_FILE_SIZE} \
+      seek=${CACHE_FILE_SIZE} &>/dev/null && \
+      mkfs.ext2 -F ${CACHE_FILE} &>/dev/null && \
+      mount -o loop ${CACHE_FILE} $DIRECTORY && \
+      cp -a $DIRECTORY.tmpfile/*  $DIRECTORY  &>/dev/null
+      cp -a $DIRECTORY.tmpfile/.* $DIRECTORY  &>/dev/null
+      echo "done" || echo "failed."
+    else
+      echo "Error: $DIRECTORY already mounted as loopback device. Exiting."
+    fi
+   else
+    echo "Error: $DIRECTORY does not exist. Exiting."
+    exit 1
+   fi
+  else
+   echo "Error: $DIRECTORY already mounted loop back."
+  fi
+}
+
+prepare_stop () {
+  if mount | grep -q $DIRECTORY ; then
+    echo -n "Unmounting cachefile ${CACHE_FILE}: "
+    cp -a $DIRECTORY/*  $DIRECTORY.tmpfile/  &>/dev/null
+    cp -a $DIRECTORY/.* $DIRECTORY.tmpfile/  &>/dev/null
+    if umount $DIRECTORY ; then
+      rmdir $DIRECTORY
+#      LOOPDEVICE=$(losetup -a | grep $CACHE_FILE | awk -F: '{print $1}')
+#      losetup -d $LOOPDEVICE && echo "done" || echo "failed"
+      mv $DIRECTORY.tmpfile/ $DIRECTORY
+    else
+      echo "Error when unmounting $DIRECTORY."
+    fi
+  else
+    echo "Error: $DIRECTORY not mounted."
+  fi
+}
+
+case "$2" in
+  start)
+     prepare_start || exit 1
+     ;;
+  stop)
+     prepare_stop || exit 1
+     ;;
+  *)
+     usage
+     exit 1
+esac
+
+exit 0
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/prepare_tmpfs.sh b/usr_sbin/prepare_tmpfs.sh
new file mode 100755 (executable)
index 0000000..4b393f2
--- /dev/null
@@ -0,0 +1,84 @@
+#!/bin/zsh
+# Filename:      prepare_tmpfs.sh
+# Purpose:       setup a tmpfs
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Sam Mai 27 15:13:03 CEST 2006 [mika]
+################################################################################
+
+if [ $UID != 0 ]; then
+  echo "Error: $0 requires root permissions. Exiting."
+  exit 1
+fi
+
+setopt nonomatch
+
+usage(){
+  echo "Usage: $0 <directory> <start|stop>"
+}
+
+if ! [ -n "$1" -a -n "$2" ] ; then
+  usage
+  exit 1
+fi
+
+[ -d /UNIONFS ] && UNIONFS="/UNIONFS" # running from live-CD?
+
+DIRECTORY="$1"
+
+prepare_start () {
+  if ! mount | grep -q "tmpfs on ${UNIONFS}${DIRECTORY}" ; then
+   if [ -d $DIRECTORY ] ; then
+    if ! [ -d $DIRECTORY.tmpfile ] ; then
+     echo -n "Setting up tmpfs ${DIRECTORY}: "
+     mv $DIRECTORY/ $DIRECTORY.tmpfile && \
+     mkdir $DIRECTORY && \
+     if mount $TMPFS -t tmpfs tmpfs $DIRECTORY ; then
+       cp -a $DIRECTORY.tmpfile/*  $DIRECTORY  &>/dev/null
+       cp -a $DIRECTORY.tmpfile/.* $DIRECTORY  &>/dev/null
+       echo done
+     else
+       echo failed
+     fi
+    else
+     echo "Erorr: tmpdir $DIRECTORY.tmpfile exists already. Exiting."
+     exit 1
+    fi
+   else
+    echo "Error: $DIRECTORY does not exist. Exiting."
+    exit 1
+   fi
+  else
+    echo "Error: $DIRECTORY already mounted. Exiting."
+    exit 1
+  fi
+}
+
+prepare_stop () {
+  if mount | grep -q $DIRECTORY ; then
+    echo -n "Unmounting tmpfs ${DIRECTORY}: "
+    umount ${UNIONFS}${DIRECTORY} && \
+    rmdir $DIRECTORY && \
+    mv $DIRECTORY.tmpfile $DIRECTORY && echo done || echo failed
+  else
+    echo "Error: ${DIRECTORY} not mounted."
+    exit 1
+  fi
+}
+
+case "$2" in
+  start)
+     prepare_start || exit 1
+     ;;
+  stop)
+     prepare_stop || exit 1
+     ;;
+  *)
+     usage
+     exit 1
+esac
+
+exit 0
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/scanmodem b/usr_sbin/scanmodem
new file mode 100755 (executable)
index 0000000..8ca1128
--- /dev/null
@@ -0,0 +1,4766 @@
+#!/bin/bash
+echo
+NOTE="  ONLY use scanModem downloaded as: http://linmodems.technion.ac.il/packages/scanModem.gz"
+UPDATE="2005_June_02"
+cat<<END>/dev/null
+
+ Browse http://linmodems.technion.ac.il   and 
+ download scanModem.gz . Within a Linux partition only:
+    gunzip scanModem.gz
+ To make it executable:
+    chmod +x scanModem
+ Run diagnositics with:
+    ./scanModem
+
+This following is admittedly a hodge podge of historically entered code bits and diverse contributions.
+The maintainers weekly updates are based on User's problems and Other's expert advice. 
+These are in the  Archives at http://www.linmodems.org with 
+a searchable copy at http://linmodems.technion.ac.il/
+Maintainer Marvin Stodolsk y  (MarvS) does occassionally simplify this informal code heap.
+
+Outputs are written to a newly created folder Modem/  
+The ModemData.txt therein has the major diagnostic output.  
+It is overly VERBOSE by design, so that all information Potentially Usefull is presented.  
+This enables more experienced discuss@linmodems.org Volunteers
+to pick out the bits cogent to a Novices query, without having to search elsewhere.
+Thus help queries from Novices can be quickly returned with minimal effort. 
+
+scanPCI written by Chris Hebeisen is the predecessor of scanModem.  It was written to serve
+within the ltmodem software support packages at http://ltmodem.heby.de .  The role is now
+fullfilled  by this this script, but called by name "scanmodem", to limit non-relevant output in 
+the ltmodem package environment.
+
+END
+
+echo UPDATE=$UPDATE
+# BaseName can be inherited from the ltmodem script ./build_module or Installers or checkout
+if test -z "$BN" ; then  BN=`basename $0` ; fi
+if [ "$BN" = "scanModem" ] ; then  echo $NOTE ; fi
+
+# for script testing, with $2 and $3 format  VendorID:DeviceID
+if [ "$1" = "test" ] ; then
+  TST=1
+  PCIDEV="$2"
+  SUBSYS="$3"
+  DISTR="$4"
+  SYS="$5"
+  GCCmajor="$6"
+  CPU="$7"
+fi
+
+# Short term files have names 0tmpfile.1 2 3 etc.
+if test -z "$TMPM" ; then
+  if test -d /dev/shm ; then
+    # use /dev/shm RAM space if possible for transient writes
+    SHM=`ls -dl /dev/shm | cut -d' ' -f1`
+    if [ "$SHM" = "drwxrwxrwt" ] ; then 
+      TMPM=/dev/shm/0tmpfile
+    else
+      TMPM=0tmpfile
+    fi  
+  fi
+else
+  TMPM=0tmpfile
+fi
+echo > $TMPM
+echo 
+# conditional when scanmodem is used in ltmodem.deb or .rpm installation
+#  with stops disabled
+mkdir -p Modem
+if ! [ "$BN" = "scanModem" ] ; then
+  FAST=yes
+  RECORD2=/dev/null
+else
+  RECORD2=Modem/YourModem.txt
+  echo  $0 should ONLY be run within a Linux/UNIX partition.
+  echo  If within a MicroSoft/DOS partition, abort with Ctrl-C now !!!
+  echo  Copy scanModem.gz to your Linux partition and restart.
+  echo
+fi
+if [ "`pwd`" = "/" ] && ! [ "$ENVIR" = "rpm" ] ; then
+  cat<<END
+
+ $0 should NOT be run in the / directory!!
+ Copy scanModem to /root/ or /tmp/ of some /home/User/ folder.
+ Exiting now
+
+END
+  exit
+fi
+
+if test -z "$RECORD" ; then
+  mkdir -p Modem
+  RECORD=Modem/ModemData.txt
+  echo > $RECORD
+else
+  echo ------------ beginning SCANMODEM section ------ >>$RECORD
+fi
+echo > $RECORD2
+
+# Defining other needed variables, there may be testing inputs
+if test -z "$SYS" ; then
+  SYS=`uname -r`
+fi
+FILTER="$SYS"_
+# FILTER needed for Debian style distros
+
+# SYS=2.6.8.1-3-686
+MAJOR=`echo $SYS | cut -d. -f1-2`
+Ktest1=`echo $SYS | cut -d- -f1`
+Ktest2=`echo $Ktest1 | cut -d. -f4`
+KERNEL_RELEASE=`echo $SYS | cut -d. -f3-`
+KERNEL_RELEASE_NUM=`echo $KERNEL_RELEASE | sed 's/^\([0-9][0-9]*\).*/\1/'`
+if test -n "$Ktest2" ; then
+  KVER=`echo $SYS | cut -d. -f1-3`
+  KEXT=.$Ktest2
+  BASE=`echo $SYS | cut -d- -f1`
+  LOCAL=`echo $SYS | cut -d- -f2-`
+  PVER="$BASE"_"$LOCAL"
+else
+  KVER=`echo  $SYS | cut -d- -f1`
+  KEXT=`echo  $SYS | cut -d- -f2-`
+  PVER="$KVER"_"$KEXT"
+fi
+# PVER needed for rpm underscore syntax
+
+if test -z "$CPU" ; then
+  CPU=`uname -m`
+fi
+# CPU=i686
+# Define version, currently 8.26a9, within ltmodem CVS maintained by Mark Spieth
+LT_VERSION=8.31a10
+
+if test -z "$DISTR" ; then
+  STEM=`cat /etc/issue | cut -c 2- | cut -d' ' -f1`
+  distro=`ls /etc/* | grep $STEM | grep version | cut -d_ -f1 | cut -d- -f1 | cut -d/ -f3`
+ # Acquire distribution data
+  DISTRO_FILES="redhat-release SuSE-release mandrake-release conectiva-release  \
+   bluepoint-release  slackware-version  gentoo-release debian_version knoppix-version \
+   fedora-release xandros-desktop-version "
+   # redhat MUST proceed mandrake in this listing as Mandrake has an /etc/redhat-release
+ for i in $DISTRO_FILES
+ do
+  if [ -a /etc/$i ] ; then
+    DISTRO=$i
+    # generating short name
+    if [ -n "$DISTRO" ] && [ "$DISTRO" = "fedora-release" ] ; then
+      FEDORA=1
+    else
+      DISTR=`ls /etc/$i | cut -d/ -f3 | cut -d"-" -f1`
+    fi
+    if [ "$DISTR" = "debian_version" ] ; then
+       DISTR=debian
+    fi
+    DVERSION=`cat /etc/$i`
+  fi
+  done
+fi
+
+if [ -z "$DISTRO" ] && [ -z "$DISTR" ]  ; then
+  DISTR="Not_identified"
+fi # DISTR
+if [ -f /etc/issue ] ; then 
+  ISSUE=`cat /etc/issue | cut -d' ' -f1-2`
+fi
+if [ "$BN" = "scanModem" ] ; then
+  cat<<END>Modem/UNSUBSCRIBE.txt
+   For instructions to UNSUBSCRIBE from discuss@linmodems.org,
+   send an email to:   discuss-help@linmodems.org
+END
+  cat<<END>>$RECORD
+
+ DO use the following line as the email Subject Line, to alert cogent experts:
+      $BN, $ISSUE kernel $SYS
+ Occassionally reponses are blocked by an Internet Providers mail filters.
+ So do in a day also check the Archived responses at DISCUSS@linmodems.org
+Code updated on:  $UPDATE
+------------ --------------  System information ------------------------
+`cat /etc/issue | cut -d'\' -f1`
+ distro=$distro
+ on System with processor: $CPU
+ currently under kernel:   $SYS
+END
+fi
+if [ "$DISTR" = "slackware" ] ; then
+    echo "  m.mohr@laposte.net will help with Slackware problems" >>$RECORD
+fi 
+if [ "$CPU" = "x86_64" ] || [ "$CPU" = "x86_64-smp" ] ; then
+  cat<<END>>$RECORD
+  
+ See success reports on a softmodem installation on AMD Athlon 64 system
+ http://linmodems.technion.ac.il/archive-fourth/msg02592.html -  slmodem compatible
+ http://linmodems.technion.ac.il/archive-fourth/msg03581.html -   Conexant hsfmodem
+
+END
+fi
+if [ "$MAJOR" == "2.6" -a $KERNEL_RELEASE_NUM -ge 10 ]; then
+  cat<<END>>$RECORD
+
+There are emerging complications under 2.6.10 and later kernels.  Concerning code for:
+Smartlink slmodem :
+   slmodem-2.9.9d.tar.gz at http://linmodems.technion.ac.il/packages/smartlink/
+      has the current fixes.  Related messages are:
+   http://www.datiku.com/documents/2610_migration.php
+   http://www.ussg.iu.edu/hypermail/linux/kernel/0409.3/0345.html 
+   http://linmodems.technion.ac.il/archive-fourth/msg03736.html .
+   http://linmodems.technion.ac.il/packages/smartlink/  has an upgrab-winmodem.tar.gz,
+       providing a driver to alleviate inappropriate capture of a winmodem by a serial port driver. 
+Lucent/Agere DSP/ltmodem:
+  http://linmodems.technion.ac.il/archive-fourth/msg03733.html 
+Concerning Intel-536ep and 537
+   http://www.ubuntulinux.org/wiki/IntelFiveThreeSixEPModemHowto/ 
+   http://linmodems.technion.ac.il/archive-fifth/msg00280.html
+   http://linmodems.technion.ac.il/archive-fifth/msg00881.html
+   
+END
+fi
+
+ls /boot/config* &> $TMPM
+if grep config $TMPM >/dev/null ; then
+  if grep "CONFIG_REGPARM=y" /boot/config*>/dev/null ; then
+    cat<<END>>$RECORD
+
+ The kernel-$SYS was compiled with CONFIG_REGPARM, providing more compact and faster code.
+
+END
+  fi
+fi
+if [ "$SYS" = "2.4.25-1-multimedia-686" ] ; then
+   cat<<END>>$RECORD
+   
+ For the Debian derived DeMudi multimedia distribution, the kernel-headers do Not faithfully
+ represent the installation kernel  version 2.4.25-1-multimedia-686.  This may block compilation
+ of certain drivers.  To compile auxiliary drivers,
+ update to a more recent Debian kernel and matching kernel-headers. Subsequently compile
+ modem drivers under the new kernel.  For the Lucent/AgereSystems DSP modem, a driver pair
+ and instructions are included in  ltmodem-2.4.25-1-multimedia-686.tar.gz
+ at http://linmodems.technion.ac.il/packages/ltmodem/Demudi/
+END
+fi
+
+GCC_INPUT=`cat /proc/version |  sed -e 's/)/ /g' | sed -e 's/(/ /g'`
+# sed to remove (  and  )
+GCC_PC=`for i in $GCC_INPUT ; do echo $i ; done | grep -A2 gcc | grep -A1 ersion | grep -v  ersion` 
+# Picks our version following gcc
+echo " The kernel was assembled with compiler:  $GCC_PC">> $RECORD
+GCC_TEST=`echo $GCC_PC | cut -d. -f1`
+echo $GCC_TEST > $TMPM
+if grep "-" $TMPM >/dev/null ; then
+  GCCmajor=`echo $GCC_TEST | cut -d- -f2`
+else
+  GCCmajor=$GCC_TEST
+fi
+
+if test -z "$GCC" ; then
+  # could be test input
+  GCC=`gcc -dumpversion`
+  GCCs=`echo $GCC | cut -d. -f 1-2`
+fi
+if test -z "$GCC" ; then
+  echo " a $GCCmajor package must be installed to support driver compiling">>$RECORD
+  GCC=none
+else
+  echo " with current System compiler GCC=$GCC">>$RECORD
+  GCCsys=`echo $GCC  | cut -d. -f1-`
+  if [ -L /usr/bin/gcc ] ; then
+    echo "    /`ls -l /usr/bin/gcc | cut -d/ -f2-`" >>$RECORD
+  fi
+fi
+echo >>$RECORD
+echo "Checking for kernel-headers needed for compiling.">>$RECORD
+SRCS=`ls -d /usr/src/lin* /usr/src/ker*  /lib/modules/$SYS/build  2>/dev/null`
+if test -n "$SRCS" ; then
+  for d in $SRCS
+  do
+    if test -f $d/include/linux/version.h ; then
+      if grep $SYS $d/include/linux/version.h >/dev/null ; then
+        echo " kernel-headers have base folder $d">>$RECORD
+      fi
+    fi
+  done
+else
+  cat<<END>>$RECORD
+Kernel-header resources are not evident.
+Within your Linux distributions' installation CD or online resource (and mirrows), search for :
+  Distribution  PackageName                    OnLine
+  ----------------------------------------------------------------------
+ Debian                kernel-headers-$SYS     http://www.debian.org/distrib/packages or install CD
+ Ubuntu                linux-headers-$SYS              http://http://packages.ubuntu.com/ or install CD
+    Debian & Ubuntu will also require installation of kernel-kbuild package 
+ Mandrake      kernel-source-$SYS         If not present on install CDs search
+       http://mirror.switch.ch/ftp/mirror/mandrake/official/10.0/i586/Mandrake/RPMS/ 
+       http://rpms.mandrakeclub.com/rpms/mandrake/official/LByName.html, or other mirrors.
+  SuSE         kernel-source-$SYS               , kernels are named k_deflt
+One of which must be installed if compiling drivers to match kernel $SYS proves necessary.
+Within the output Modem/ folder, read CompilingDrivers.txt for details.
+  
+END
+fi
+echo >>$RECORD
+
+# Check for /dev/modem link
+if [ -L /dev/modem ] ; then
+  echo " Modem symbolic link is:  /`ls -l /dev/modem | cut -d/ -f2-`" >>$RECORD
+else
+  echo " A /dev/modem symbolic link is not set.">>$RECORD
+fi
+
+if test -d /dev/tts ; then
+   echo " Checking for /dev/tts/  devices" >> $RECORD
+   ls -l /dev/tts/ >> $RECORD
+   echo >> $RECORD
+fi
+if test -f  /proc/bus/usb/devices ; then
+   if grep odem /proc/bus/usb/devices>/dev/null ; then
+       grep odem /proc/bus/usb/devices  >> $RECORD
+       # S:  Product=U.S. Robotics 56K Faxmodem USB
+       if grep "USB  HSF Modem" /proc/bus/usb/devices>/dev/null ; then
+          echo "  Download the hsfmodem package from http://www.linuxant.com/drivers">> $RECORD 
+       fi
+   else
+      echo " USB modem not detected.">> $RECORD 
+   fi
+else
+   echo "   /proc/bus/usb/devices file not present, barring USB modem query.  ">> $RECORD 
+fi
+echo >> $RECORD
+
+PNP=`dmesg | grep "IRQ XX" `
+if test -n "$PNP"  ;  then
+  cat<<END>> $RECORD
+
+  If after boot up
+# dmesg  | grep "IRQ XX" 
+displays:
+    IRQ XX nobody cared
+ a change in the bootup BIOS may be necessary to a non-PNP choice is likely necessary.
+END
+fi
+
+if [ "$DISTR" = "mandrake"  ] ; then
+   cat<<END |  tee -a $RECORD
+   
+   For Mandrake 9.1 later, installation of the pciutils.rpm  package providing  lspci is necessary.
+   The installed utility   lspcidrake  is NOT an adequate alternate for scanModem support.
+
+END
+fi
+
+LSPCI_PATH="/bin /usr/bin /sbin"
+for i in $LSPCI_PATH
+do
+  if test -x $i/lspci
+  then
+    LSPCI=$i/lspci
+  fi
+done
+if test -z $LSPCI
+then
+  echo "+----------------------------------------------+"
+  echo "|    WARNING: lspci not found  - exiting       |"
+  echo "|    Please install the package:  pciutils     |"
+  echo "+----------------------------------------------+"
+  echo
+  exit 1
+  echo
+else
+  if ! $LSPCI &>/dev/null
+  then
+    echo "WARNING: $LSPCI returned error - not checking for modem"
+    echo
+    echo Exiting
+    echo
+    exit 1
+  fi
+fi
+# ending lspci test section
+
+# Acquire PCI bus slots.
+echo Modem > $TMPM
+echo modem >> $TMPM
+echo "erial controller" >> $TMPM
+# filering for modem
+PCIBUS=`$LSPCI 2>/dev/null  | grep -f $TMPM | cut -d' ' -f1`
+BUS2=`$LSPCI -n 2>/dev/null | grep " 07..: " | cut -d' ' -f1`
+# add CLass 07 devices if not already recognized
+echo "$PCIBUS" > $TMPM.1
+if ! [ "$BUS2" = "" ]  ; then
+  for i in $BUS2
+  do
+  if ! $LSPCI 2>/dev/null  | grep $i | grep "FIR Port" >/dev/null ; then
+    # exclude Infrared controllers
+    if ! grep $i $TMPM.1 >/dev/null ; then
+      # exclude already captured PCIBUS
+      PCIBUS="$PCIBUS $i"
+    fi
+  fi
+  done
+fi
+if test -n "$TST" ; then
+  PCIBUS=`echo $PCIBUS | cut -d' ' -f1`
+fi
+
+if test -z "$PCIBUS" && [ -z "$PCIDEV" ] ; then
+  # Display all PCI devices only if no candidates.
+  echo --------- lspci scan ---------------- >>$RECORD
+  echo " PCI_bus">>$RECORD
+  $LSPCI 2>/dev/null >>$RECORD
+  echo ------------------------------------- >>$RECORD
+
+# if no modem candidates AND not PCIDEV input test
+  if  $LSPCI 2>/dev/null  | grep "udio controller" | grep M5451 >/dev/null ; then
+    AUDIO=`$LSPCI 2>/dev/null  | grep "udio controller" | cut -d' ' -f2-`
+    cat<<END>>$RECORD
+
+ Though not displayed, an embedded soft modem may reside in this Audio card:
+    $AUDIO
+ which sadly is not yet supported under Linux.  However a low level driver may 
+ in the future become available, which provide access to the higher level COMM
+ functions already avialable in the SmartLink slmodemd. 
+ Browse the Modem/Slmodem.txt for some details. 
+
+END
+  fi
+  
+  cat<<END>>$RECORD
+
+ A modem was not detected among the above PCI devices.
+ This indicates that the modem, if present has a non-standard or ISA bridge.
+ Please follow the directions in Modem/SoftModem.txt  for identifying the modem properties
+ when booting under Microsoft Windows. Also access any documentation sources
+ on yourchipset.  Guidance can only be provided AFTER
+ the chipset and/or its drivers have been identified.
+ The IBM mwave modem does have a driver within 2.6.n kernel+module releases.  If is at:
+        /lib/modules/$AYA/kernel/drivers/char/mwave/mwave.ko
+and can be loaded only if Mwave hardware is present  Test with:        
+ #  su - root
+ followed by
+ # modprobe wmave
+ If successful see: 
+       http://tedfelix.com/Mwave/
+       http://www.linuxdocs.org/HOWTOs/mini/ACP-Modem/   , section 2.4 and later.
+       http://www.freenetpages.co.uk/hp/mjbou/dwtpul.html
+       http://tedfelix.com/Mwave/
+       
+ A failure response has output like:
+       FATAL: Error inserting mwave (/lib/modules/2.6.10-1-686/kernel/drivers/char/mwave/mwave.ko): Input/output error
+indicating absence of an Mwave modem
+
+END
+else
+
+$LSPCI | grep audio >>$RECORD
+echo >>$RECORD
+# The 2nd Table in Modem/SoftModem.txt is parsed if a soft modem controller is resident
+cat<<END>Modem/SoftModem.txt
+    
+                  Soft Modem Information
+
+The earlier generations of modems had chips with digital signal processing (DSP) capability in which
+most of the total modem effort proceeded.  The "soft modem" is a generic name for modems 
+which lack DSP.  Rather, the CPU does almost all the signal processing as directed by software code. 
+There are a few soft modems which are fully identified by the primary PCI ID of the modem card, 
+such as the Agere Systems 11c1:048(a,b,c,d) series.
+
+The larger family is more troublesome, for identification of supporting software. 
+They are comprised of a primary modem controller which can host a variety of Subsystems. 
+Both the primary PCI ID and "mc97 codec"  written in a Subsystem firmware chip are required,
+for assessing support under Linux.  Only subsequently is the Subsystem PCI ID useful, for record keeping.  
+
+The scanModem script contains five routines for acquiring  the critical mc97 codec identification:
+1) a modem driver independent test, only usefull for some of the earliest soft modems,
+   described at the end of this file;
+2) a test using modem drivers already on your System,  as part of  the ALSA (Advanced Linux Sound
+ Architecture) software package ; See Slmodem-ALSA.txt for details.
+3) a test requiring the SmartLink slamr.ko driver:  see Slmodem.txt ;
+4) comparison with PCI IDs with codecs historically gathered and stored within scanModem;
+5) In case 1-4 are not adequate, there are the following instructions for running ATI queries under Microsoft windows.
+Chipset information may be obtained under Microsoft Windows through:
+ 1) Start > Settings > Control Panel > Classical View (for WinXP) > Modem  , or alternatively,
+   Start > Settings > Control Panel > Classical View (for WinXP) > System > Devices > Modem
+   Do the modem diagnostics test, if available, looking for manufacturer chipset,
+   It is within information output in lines:  ATI - specifications
+      Try to identify the modem setup file, with name perhaps MODEM.INF
+ 2) Open a COMM console, and send ATI commands to the modem (ATI, ATI1, ATI2, etc)
+   which may elicit chipset and driver information. Here is an example
+       ATI3 - Agere SoftModem Version 2.1.22
+       ATI5 - 2.1.22, AMR Intel MB, AC97 ID:SIL REV:0x27
+   successfully identifying an Agere SoftModem chipset, both by name and through
+   the:softmodem SIL ID:              AC97 ID:SIL REV:0x27
+ The IBM mwave modem cannot be detected by scanModem.  
+ But the mwave driver is included in 2.6.n kernel releases.  So try
+ # modprobe mwave
+ Either the module will load, or the absence of the modem will be indicated by:
+FATAL: Error inserting mwave (/lib/modules/2.6.10-1-686/kernel/drivers/char/mwave/mwave.ko): Input/output error
+See http://www.linuxdocs.org/HOWTOs/mini/ACP-Modem/  for details on this modem.
+
+Subsystems for softmodems are primarily made by Silicon Labs (SIL), 
+under contract to companies like Intel, Agere Systems, Motorola  etc.
+In the Table below,
+The ChipMadeBy does NOT imply software support directly from that manufacturer.
+
+The chart of information below is largely harvested from messages to discuss@linmodems.org.
+ A codec_indent  like REV:0x27 is reported by diagnostics under Microsoft, as illustrated above. 
+The matching designation like SIL27 are translations under Linux, 
+    output by a diagnostic of the slamr.ko driver, from the SmartLink slmodem software. 
+The SIL is an abbreviation for  Silicon Laboratorys Inc., which provides Subsystems for many total modem assemblies. 
+SML is used below as abbreviation for SmartLink Inc.,  with official driver resources at
+       http://www.smlink.com/main/index1.php?ln=en&main_id=40  and recent patches provided at:
+       http://linmodems.technion.ac.il/packages/smartlink/ 
+
+   codec_ident    ID translation     driver sources 
+---------------------  ------------------      -------------------------       
+ 0x21      SIL21   PCTel     for 2.4.n kernels, pctel-2.7.9 at http://linmodems.technion.ac.il/pctel-linux,
+                                             and SML for  2.4.n or 2.6.n kernels
+ 0x23      SIL23   PCtel      same as SIL21               
+ 0x22      SIL22   SML              
+ 0x24      SIL24   Broadcom, use   SML drivers
+ ????      BCM64  Broadcom, use   SML in ALSA mode,  but only under the Intel ICH modem controllers.
+0x25      SIL25   Intel 537AA          "  or SML
+????        INT65   Intel 537EA        http://linmodems.technion.ac.il/packages/Intel/537/ or SML
+0x26      SIL26    Silicon Integrated Systems (SiS), use SML drivers
+0x27      SIL27   AgereSystems(AS), use  SML  needed under 2.6.n kernels,
+                             but for  2.4.n, there are also AS drivers through  http://www-3.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-52698  
+ ????       CXT(21,22,23,29,41  and others)   Conexant -       http://www.linuxant.com/drivers, the hsfmodem package      
+ -------------------------------------------------------------------------------- 
+  If a novel identifier is displayed during diagnostics, please report to discuss@linmodems.org
+A rough/practical guide is first given, with some qualifications and exceptions to follow:
+     SILnm  (n,m digits) are SML supportable;
+     CXTnm are ONLY supported by the  http://www.linuxant.com/drivers, the hsfmodem package ;
+     INTnm  are supported by Intel drivers and perhaps slmodemd with ALSA support;
+     BCMnm, INT65  (and similar name styles) have had successes with SmartLink slmodem in ALSA mode.
+     See the companion Slmodem-ALSA.txt for details.
+Qualifications  to the Table below relate to Linux software support for soft modem controllers.
+In particular,  no software package provides support for all soft modem controllers.
+            
+Primary              
+PCI_IDs           Name                    Possible support by:
+---------------  -----------------------------  -------------------------
+8086:1080 ac97 controller                              i . 
+8086:2416 82801AA ICHAA >              + A a  p c .
+8086:2426 82801AB ICHAB >              + A a .
+8086:7186 >                                                            c .
+8086:7196 82440 Banister  >            + A a      c .
+8086:2446 82801BA ICH2  >              + A a p c .
+8086:2486 82801CA/CAM ICH3 >   + A a p c i .
+8086:24c6 82801DB ICH4 >               + A a   c i b .
+8086:24d6 82801EB ICH5 >               + A     c i .
+8086:266d 82801EB ICH6>                +       c .
+8086:xxxx types above are from Intel   
+
+1039:7013  SIS 630 >                           + a p c i .
+1039:7018  SIS 960 >                           +       i .
+10de:01c1  Nvidia Corp >                       +       i .
+10de:00d9  Nvidia Corp >                           A      c   .
+1106:3068  VIA >                       + a p c i .
+1022:7446  AMD AC_LINK >               + .
+10b9:5450  ALI 5450 >                     
+10b9:5451  ALI 5451 >                     
+10b9:5453  ALI 5453 AC-Link  >         p c .
+1025:5453  ALI 5453 AC-Link  >                     c .
+10b9:5457  ALI 5457 AC-Link >  +    p   c i .
+1025:5457  ALI 5457 AC-Link  >              c .                   .
+e159:0001  TigerJet >                                          i .
+1002:434d  ATI >                                         T  a    c i .
+1543:3052  SI3052 >                                            i .
+10ec:8197  RealTek >                            + .
+  --------------------------------------------------------
+The following letters indicate compatibility for the modem controller,
+BUT do NOT gaurantee support by the software. 
+Support MUST be ascertained by identifing the soft modem codec.
+
+  +   SmartLink (SML) - http://www.smlink.com,  the slmodem-2.9.9 series
+  A   SML slmodem-2.9.9d-alsa software supporting the ALSA intel8x0m-modem driver
+      Soft modems with the Broadcom codec BCM64 should thus be served. 
+  T   SML slmodem-2.9.9d-alsa software supporting the ALSA snd-atiixp-modem driver
+With the above SML software, port creation is controlled by a daemon, slmodemd,
+rather than being a static feature of the /dev/ files.
+  a   AgereSystems only under 2.4.n
+  p   PCtel support at http://pctelcompdb.sourceforge.net/
+  c   Conexant/Rockwell - http://www.linuxant.com
+  i   Intel - http://www.intel.com
+  b   Broadcom, under 2.4.n kernels, with ALSA code under 2.6.n
+  for details on A and T slmodem implementations, see Modem/ALSA.txt
+ ===========================================================
+
+To achieve codec readouts for SmartLink (SML) compatible modem controllers listed above,
+follow the directions in Slmodem.txt.
+
+The 1) driver independent test, some details
+During bootup, kernel diagnostics on the System are stored for later display by:
+       dmesg
+This information may include a SIL_id of modems under AC97/MC97 Controllers,
+depending upon the type of bridging of the modem card to the motherboard.
+The scanModem script processes dmesg output to capture AC97 modem information,
+parses it into a SIL_id if possible, and then displays of modem chipset information.
+Guidance to sources of modem supporting software may thus be obtained.
+
+The transfer of the AC97 information to the dmesg buffer requires that modules supporting
+both the digital audio card and the ac97_codec be loaded during bootup:
+   modprobe ac97_codec
+   modprobe audio_drivers  (such as i810_audio)
+This can be checked after bootup with:
+   lsmod
+
+This script can also be used by entering a test block with nomenclature:
+        $0 SILtest
+with SILtest a text file in This Folder
+containing a section of a dmesg output or /var/log/messages like:
+
+  i810: Intel ICH 82801AA found at IO 0xdc00 and 0xd800, IRQ 11
+  i810_audio: Audio Controller supports 2 channels.
+  ac97_codec: AC97 Audio codec, id: 0x4144:0x5340 (Analog Devices AD1881)
+  i810_audio: AC97 codec 0 Unable to map surround DAC's (or DAC's not present), total channels = 2
+  ac97_codec: AC97 Modem codec, id: 0x5349:0x4c22 (Silicon Laboratory Si3036)
+
+which does include a line beginning with:   ac97_codec: AC97 Modem codec, id:
+END
+  # detected modem devices
+
+   echo "Modem candidates are at PCI_buses:  $PCIBUS">>$RECORD
+   echo PCIBUS=$PCIBUS
+fi 
+#  Start modem displays
+for i in $PCIBUS
+do
+  if $LSPCI -n 2>/dev/null  | grep $i | grep Class >/dev/null ; then
+    CLASS0=`$LSPCI -n 2>/dev/null  | grep $i | cut -d' ' -f3-4`
+  else
+    CLASS0=`$LSPCI -n 2>/dev/null  | grep $i | cut -d' ' -f2-3`
+  fi 
+  # $LSPCI -n 2>/dev/null  | grep $i | cut -d' ' -f2-4 > $TMPM
+  # echo "0000:00:02.6 0703: 1039:7013 (rev a0)" > $TMPM
+  CLASS="Class $CLASS0"
+  NAME=`$LSPCI -v 2>/dev/null | grep $i | cut -d' ' -f2-`
+  if test -n "$TST" ; then
+    echo Using the test inputs.
+    cat<<END | tee -a $RECORD
+
+    Substituted test inputs:
+ PCIDEV=$PCIDEV
+ SUBSYS=$SUBSYS
+
+END
+  else     
+    PCIDEV=`echo $CLASS | cut -d' ' -f3`
+    cat<<END | tee -a $RECORD 
+    
+Providing detail for device at  $i
+  with vendor-ID:device-ID
+           ----:----
+$CLASS   $NAME
+END
+  fi
+  Vendor=`echo $PCIDEV | cut -d: -f1`
+  Device=`echo $PCIDEV | cut -d: -f2`
+  # Now Subsystem info
+  # It would be more elegant in the above queries to select  -s PCI_bus.
+  # But for older lspci versions, there is failure of    lspci -s PCI_bus
+  # when the PCIBUS has an "f" as on some Acer motherboards with a PCI slot   00:1f.6
+  SUBNAME=`$LSPCI -v 2>/dev/null  | grep -A1 $i | grep Subsystem | cut -d: -f2-`
+  if test -n "$TST" ; then
+    echo "Using test  $SUBSYS   Subsystem"
+    # skip if test SUBSYS was input
+  else
+    SUBSYS=`$LSPCI -nv  2>/dev/null  | grep -A1 $i | grep Subsystem: | cut -d' ' -f2`
+    echo "  SubSystem $SUBSYS  $SUBNAME" | tee -a $RECORD
+    $LSPCI -nv 2>/dev/null | grep -A2 $i | grep -v Class | grep -v Subsystem: | tee -a $RECORD
+    IRQ0=`$LSPCI -v 2>/dev/null  | grep -A2 $i | grep IRQ | grep "IRQ 0"`
+    if test -n "$IRQ0" ; then
+      cat<<END>>$RECORD
+
+ The modem will NOT function because of interrupt assignment: IRQ 0
+ Possible corrections are:
+   1) to access the  the boot up BIOS change to a non-PNP mode.
+   Instructions for accessing BIOS are at:
+      http://linmodems.technion.ac.il/resources.html within:  Additional Resourcces.
+   2) Within some BIOS setups, IRQ assignments can be changed.
+   3) On non-laptop systems moving the modem card to another slot has helped.
+   4) Sometimes upgrading the kernel changes IRQ assignment.
+
+END
+    fi
+  fi
+  if test -n "$SUBSYS" ; then
+    SUBven=`echo $SUBSYS | cut -d: -f1`
+    SUBdev=`echo $SUBSYS | cut -d: -f2`
+  fi
+  cat<<END | tee -a $RECORD
+  
+                  -----PCI_IDs-------                    --CompilerVer- 
+    Feature List:  Primary  Subsystem Distr  KernelVer   kernel default  CPU
+ ./scanModem test $PCIDEV $SUBSYS $DISTR $SYS  $GCC_PC $GCC    $CPU
+
+END
+    ## Checking for major chipset types
+  if grep  $PCIDEV Modem/SoftModem.txt >/dev/null ; then
+    # Check for support under the Controller of the unknown Subsystem chip
+    CNTRL=`grep $PCIDEV Modem/SoftModem.txt | cut -d">" -f1`
+    cat<<END | tee -a $RECORD
+       
+ The soft modem Subsystem operates under a controller
+   $CNTRL
+ capable of supporting under Linux AT LEAST modem Subsystem chips from manufacturers:
+END
+echo >>$RECORD
+    if grep $PCIDEV Modem/SoftModem.txt | grep "p " >/dev/null ; then
+       echo "  Pctel"  | tee -a $RECORD
+       SOFT=PCTEL
+    fi
+    if grep $PCIDEV Modem/SoftModem.txt | grep "b " >/dev/null ; then
+       echo "  Broadcom"  | tee -a $RECORD
+       SOFT=$SOFT" BRD"
+    fi
+    if grep $PCIDEV Modem/SoftModem.txt | grep "a " >/dev/null ; then
+       echo "  AgereSystems"  | tee -a $RECORD
+       SOFT=$SOFT" AGR"
+       AGR=1
+    fi
+    if grep $PCIDEV Modem/SoftModem.txt | grep "c " >/dev/null ; then
+       echo "  Conexant" | tee -a $RECORD
+       SOFT=$SOFT" CNX"
+       CNX=1
+    fi 
+    if grep $PCIDEV Modem/SoftModem.txt | grep "i " >/dev/null ; then
+       echo "  Intel"  | tee -a $RECORD
+       SOFT=$SOFT" INTEL537"
+       AAEA=1
+       INTEL537=1
+    fi
+    echo $SOFT>$TMPM.soft
+    if grep $PCIDEV Modem/SoftModem.txt | grep "+ " >/dev/null ; then
+       echo "  Smartlink"  | tee -a $RECORD
+        SMLok=" Driver slamr from the SmartLink slmodem package can identify the soft modem codec."
+    smart=may
+    fi
+    if grep $PCIDEV Modem/SoftModem.txt | grep "A " >/dev/null ; then
+       echo >> $RECORD
+       echo "  Smartlink software in ALSA mode may support this modem "  >> $RECORD
+       Smart=ALSA
+    fi
+     # finished softmodem chip candidates  
+    if grep $PCIDEV Modem/SoftModem.txt>/dev/null ; then
+       SOFT=1
+    fi    
+    # Decisive Subsystem IDENTS
+    echo >$TMPM.3 
+    if [ "$SUBven" = "134d" ]  ||  [ "$SUBven" = "14e4" ] ; then
+       echo Use the SmartLink slmodem software for support. |  tee -a $RECORD
+       IDENT=PCTEL
+       if [ "$SUBven" = "14e4" ] ; then
+          IDENT=BCM64
+         echo For this Broadcom subsystem modem,  the slmodemd daemon must be used in ALSA mode |  tee -a $RECORD 
+         echo  "       slmodemd --alsa --country=YOURS modem:1"  |  tee -a $RECORD
+       fi      
+    elif [ "$SUBven" = "14f1" ] ; then
+       # Conexant HSF
+        echo ONLY the hsfmodem software from http://www.linuxant.com/drivers  can support this Conexant subsystem soft modem |  tee -a $RECORD
+        IDENT=CXT
+     else
+        echo " The Subsystem PCI id does not itself identify the modem Codec.">>$RECORD
+     fi
+     
+     # Choose driver for codec test
+     if [ "$PCIDEV"  = "1002:434d" ]  ; then
+        MODULE=snd-atiixp-modem 
+       MCONFIG=ATIIXP_MODEM
+     elif [ "$PCIDEV"  = "1106:3068" ]  ; then
+        MODULE=snd-via82xx-modem 
+       MCONFIG=VIA82XX_MODEM
+     else
+        MODULE=snd-intel8x0m 
+       MCONFIG=INTEL8X0M
+     fi 
+     MOD_=`echo $MODULE | sed -e 's/-/_/g'`
+     MPLACE=`find /lib/modules/$SYS/ -name $MODULE.ko`
+     #  Rhywek <rhywek@o2.pl>
+     
+#     case $PCIDEV in
+#      "1002:434d") MODULE=snd-atiixp-modem ;;
+#      "1106:3068") MODULE=snd-via82xx-modem ;;
+#      *) MODULE=snd-intel8x0m ;;
+#    esac
+
+    # Check for driver in kernel or modules    
+    echo  >>$RECORD
+    if grep $MCONFIG /boot/config-$SYS | grep "=y" > /dev/null ; then
+       echo  "  Driver $MODULE is included in the kernel. "  >>$RECORD
+       ASOUND=1
+    elif   test -n "$MPLACE" ; then
+       echo  "  Driver $MODULE  may enable codec acquisition "  >>$RECORD
+       if grep $MOD_  /proc/modules >/dev/null ; then
+         ASOUND=1  
+      elif [ "$UID" = "0" ]  ;  then
+        /sbin/modprobe $MODULE
+        ASOUND=1
+      else   
+         echo This line is strangely necessary >/dev/null 
+          cat<<END
+           
+ To enable capture of codec information, please briefly login as Root:
+        su - root
+  Load $MODULE with:
+        modprobe $MODULE
+  Exit Root status
+        exit
+  and rerun
+       ./scanModem
+       
+END
+         exit
+      fi
+    else
+       echo  "  $MODULE  support not included in $SYS  kernel+modules " >>$RECORD
+    fi
+   
+# I guess you mean '/proc/asound/cardN/codec97#0/mc97*'.
+# If it does not exist after intel8x0m loading this may indicate that device
+# was not initialized, for instance because it is in use by other driver,
+# like hsf*, slamr or even serial - device has 0703 pci class - COMMUNICATION_MODEM.
+    if test -n "$ASOUND" ; then 
+       MC97=`find /proc/asound -name "mc97*" | grep -v regs`
+       #  MC97=`find /proc/asound -name 'mc97#[0-3]-[0-3]'`    # Sasha's alternate
+       if !  test -n "$MC97" ; then
+          echo "  /proc/asound lacks an mc97 codec file.">>$RECORD       
+       else      
+          echo "  === Begin mc97 codec query  ===">>$RECORD
+       for codec in $MC97     
+#Also note there are new modems in the wild equipped by SiLabs 3054/5 codec,
+#it works with ALSA drivers, but many of such codecs encode codec vendorid1,
+# vendorid2 registers not with "traditional" "SILXX", but with other values
+#(few "AGRXX" was reported already, and "BCM64" is from this group too)     
+       do
+       if grep  0x42434d64  $codec >/dev/null ; then
+         echo  " $SUBSYS has a Broadcom BCM64 codec" >>$RECORD
+        IDENT1=BCM64
+        elif  grep   Conexant  $codec >/dev/null ; then
+        NM=`grep Conexant  $codec | cut -d' ' -f2-`  
+        grep  Si3036 $codec >>$RECORD
+        echo  " $SUBSYS has a $NM" >>$RECORD     
+        IDENT1=CXT
+        elif  grep   "Si3036/8 rev "  $codec >/dev/null ; then
+          grep  Si3036 $codec >>$RECORD
+          revision=`for i in $INPUT ; do echo $i ; done | grep  -A1 rev`
+          REV=`echo $revision | cut -d" " -f2`
+          echo  " Subsystem $SUBSYS has a SIL2$REV codec"  >>$RECORD   
+          IDENT1=SIL2$REV
+          elif  grep   "Motorola (rev 4 IIRC)"  $codec >/dev/null ; then  
+          echo  " $SUBSYS has a Motorola codec " >>$RECORD     
+          IDENT1=ALSA       
+          cat<<END>/dev/null
+
+> RE:new modems in the wild equipped by SiLabs 3054/5
+> Should slmodem in ALSA mode should be recommended for these cases uniformly?
+
+Yes, but note that vendor's drivers (if exist) may work too, at least I think
+that Agere driver supports 'AGRxx' codecs.  
+END
+       else
+         echo File $codec >>$RECORD
+         echo " --------" >>$RECORD
+         cat $codec >>$RECORD
+         echo " --------" >>$RECORD    
+         if grep 3054/5 $codec >/dev/null && grep snd_intel8x0m >/dev/null ; then
+           # for non SILnm codecs such as AGRnm and INT65
+           echo " Try using slmodemd in ALSA mode with driver snd-intel8x0m"  >>$RECORD
+         fi
+       fi
+       codec=
+      done
+      echo "  === End mc97 codec query  ===">>$RECORD
+      fi  # codec aquisition 
+    fi  # module loaded
+   
+echo >$TMPM
+echo >$TMPM.1
+echo >> $RECORD
+echo " Beginning check for older ac97_codec modems." >> $RECORD
+echo audio > $TMPM
+echo ac97 >> $TMPM
+# for grep filter
+dmesg | grep -f $TMPM > $TMPM.3
+# first check for audio_codec, needed later
+if grep "AC97 Modem codec" $TMPM.3 > /dev/null ; then
+    ac97_codec=1
+    echo " ----- Raw output ------" >> $RECORD 
+    # unusual case:   ac97_codec: AC97 Modem codec, id: CXT41 (Unknown)
+    grep "AC97 Modem codec" $TMPM.3  | tee -a  $RECORD
+fi
+# manual test
+if [ "$1" = "SILtest" ] ; then
+  cp SILtest  $TMPM.3
+fi
+codec_id=`cat $TMPM.3 | sed -n -e '/^ac97_codec: AC97 Modem codec, id: /s/^ac97_codec: AC97 Modem codec, id: \(.*\)(.*)$/\1/p'`
+# codec_id=0x5349:0x4c22  # for testing
+if test -n "$codec_id" ; then
+for codec_id in $codec_id ; do
+  echo $codec_id | grep -e '^SIL[0-9].*$' > /dev/null
+  if [ $? -ne 0 ] ; then
+    # < linux-2.4.20
+    codec_cid=`echo $codec_id | sed -n -e '/0x5349:0x4c/s/^0x5349:0x4c\(2[1-7]\)$/\1/p'`
+    # echo codec_cid=$codec_cid
+    if [ -n "$codec_cid" ] ; then
+      codec_id=`printf "SIL%d" 0x$codec_cid`
+      CODEC=$codec_id
+    else
+      SIL_id=$codec_id not processed
+    fi
+  else
+    SIL_id=$codec_id
+  fi
+  if test -f $TMPM.3 ; then
+    cat<<END  >>$RECORD
+
+--- processed from dmesg -----
+`cat  $TMPM.3`
+------------------------------
+ SIL_id=$SIL_id
+
+END
+  fi # TMPM.3
+done  # end of for
+fi # codec_id
+if test -z "$SIL_id" ; then
+  echo " An older ac97_modem codec was not detected.">>$RECORD
+  echo >>$RECORD
+else
+  echo " An ac97_modem codec was detected.">>$RECORD
+fi # SIL_id
+
+# slamr.ko test
+if [ -x /bin/dmesg ] ; then
+  DMESG=/bin/dmesg
+  SLAMR=`find /lib/modules/ -name slamr.* -mindepth 3 -maxdepth 5 | grep $SYS` 
+fi
+
+if test -n "$DMESG" -a -n "$SLAMR" -a -n "$smart" ; then
+   echo > $TMPM
+  $DMESG | grep -v "SmartLink AMRMO modem" | grep slamr > $TMPM
+  ###  typical output
+# slamr: SmartLink AMRMO modem.
+# slamr: probe 8086:24c6 ICH4 card...
+# slamr: mc97 codec is SIL27
+# slamr: slamr0 is ICH4 card.
+  if grep slamr $TMPM >/dev/null ; then
+     SLAMRout=1
+  elif [ "$UID"  = "0" ] ; then
+     /sbin/modprobe -r slamr
+     /sbin/modprobe slamr
+     $DMESG | grep -v "SmartLink AMRMO modem" | grep slamr > $TMPM   
+     if grep slamr $TMPM >/dev/null ; then
+        SLAMRout=1
+     fi 
+  else
+     cat<<END  | tee -a $RECORD
+     
+ Please rerun scanModem after login as 
+ #  su - root
+ WithIn Modem/Slmodem.txt, see the slamr test for an explanation.
+END
+  sleep 3
+  fi   
+  if test -n "$SLAMRout" ; then  
+    echo " ------ dmesg slamr filtered -------">>$RECORD
+    cat $TMPM >>$RECORD     
+    CODEC=`$DMESG | grep slamr | grep codec | cut -d' ' -f5`
+    if test -n "$CODEC" ; then
+    COD=`echo $CODEC | cut -b-3`
+    echo " The softmodem Codec is:  $CODEC">>$RECORD
+    fi
+  fi  
+  $DMESG | grep HSF: > $TMPM
+  if grep HSF: $TMPM>/dev/null ; then
+    $DMESG | grep HSF: >>$RECORD
+  fi
+fi 
+    ##ARCHIVEbegin
+    # Used as backup to a CODEC acquisition
+    rm $TMPM.2 &>/dev/null
+    echo " Checking through information gathered from LinModem ARCHIVES">>$RECORD
+    if  [ "$PCIDEV"  =  "8086:1080" ] ; then
+        cat<<EOF>$TMPM.2
+INTEL537EP 8086:1000 8086:1007 8086:1008 8086:100A 1028:1000
+EOF
+    elif [ "$PCIDEV" = "8086:2416" ] ; then
+    # 8086:2416 82801AA ICHAA 
+      cat<<EOF>$TMPM.2
+CXT 107b:0012
+SIL22 14c0:0012 COMPAL Electronics Inc Smartlink
+EOF
+# cat $TMPM.2
+    elif [ "$PCIDEV" = "8086:2426" ] ; then
+    # 8086:2426 82801AB ICHAB
+      cat<<END>TMPM.2
+SIL21 134d:4c21
+Unknown 107b:9019 Gateway
+END
+    elif [ "$PCIDEV" = "8086:7196" ] ; then
+    # 8086:7196 82440 Banister ICH1
+      cat<<EOF>$TMPM.2
+Unknown 10cf:10d2 Fujitsu Limited
+EOF
+    elif [ "$PCIDEV" = "8086:2446" ] ; then
+    # 8086:2446 82801BA ICH2
+      cat<<EOF>$TMPM.2
+CXT 104d:80df 
+SIL21 10cf:10d2 CitiCorp
+Unknown 1025:1027 Acer 
+EOF
+    elif [ "$PCIDEV" = "8086:2486" ] ; then
+    # 8086:2486 82801CA/CAM AC97 CAM AC'97 ICH3
+      cat<<END>$TMPM.2
+CXT   1668:5421 CXT21, 14f1:5421 MD56ORD V.92 MDC Modem
+SIL27 103b:0757 Tatung Co , 1014:0223 IBM , 1179:0001 , 144d:2115   Samsung, 1014:0227 
+BCM64 14e4:4d64 
+SIL22 14c0:0012 COMPAL Electronics Inc
+Unknown 1558:1800 CLEVO/KAPOK Computer , 104d:813c Sony, CMedia CXT?, 1014:0503
+END
+    elif [ "$PCIDEV" = "8086:24c6" ] ; then
+    # 8086:24c6 82801DB ICH4 AC'97 Modem Controller
+    cat<<END>$TMPM.2
+SIL27 152d:0706 QUANTA Computer, 144d:2115 Samsung , 1019:d551 1179:0001 1734:1033  1854:0005 1014:0227 0e11:0860  1014:0524 1014:0525 mc97 , 1025:0061 Acer, 1025:003d  107b:0200 1025:0071  1014:0544  10cf:10d1
+SIL21 1071:8050  134d:4c21 4c21:5349 1071:8160  1734:1055  
+SIL22 1734:102a  
+CXT 104d:8129 Sony , 104d:818c CXT23 , 104d:816a , 1014:055a , 104d:80fa , 14f1:5422 , 1043:1826  , 103c:3084  1025:0064  CXT30,  1014:0559  CXT23
+BCM64 14e4:4d64  
+SIL24 144f:1050 Askey Comp. with BroadCom, 
+Unknown 104d:816a 1509:2970 
+END
+    elif [ "$PCIDEV" = "8086:24d6" ] ; then
+    # 8086:24d6 82801EB ICH5
+      cat<<END>$TMPM.2
+SIL27 1179:0001  104d:8128
+BCM64 14e4:4d64 
+CXT   103c:006a
+END
+    elif [ "$PCIDEV" = "8086:266d" ] ; then
+      echo " The 8086:266d modems may be supported by hsfmodem OR slmodem-2.9.9c ,but not both" >>$RECORD
+      cat<<END>$TMPM.2
+SIL27 1509:3670
+CXT 14f1:5423 CXT23 no /proc/asound/mc97* ,
+END
+    elif [ "$PCIDEV" = "1039:7013" ] ; then
+    # 1039:7013  SIS 630 
+      cat<<EOF>$TMPM.2  
+SIL27 1043:1736 , 104d:8129 17c0:1059 , 1033:8216 1028:0195
+SIL23 1039:7013
+CXT 104d:814e Sony CXT23, 1043:1816 CXT22
+SIL22 1631:3003  NorthBridge , 1584:4003 ,  1734:105f ,1558:2202 CLEVO/KAPOK Computer: HAMR,http://linmodems.technion.ac.il/archive-fourth/msg01957.html
+SIL21 Pctel 1039:7013 1849:9739  13bd:102f
+Unknown 1019:0a01  1558:4201 , 1509:2470 First Int. Comp. ,  1734:105f with AMD64 processor, 1509:2470 , 1043:1456  Asustek
+EOF
+    elif [ "$PCIDEV" = "1039:7018" ] ; then  
+    # 1039:7018  SIS 960
+      cat<<EOF>$TMPM.2
+none
+EOF
+    elif [ "$PCIDEV" = "10de:01c1" ] ; then
+    # 10de:01c1  Nvidia Corp 
+      cat<<EOF>$TMPM.2
+none
+EOF
+    elif [ "$PCIDEV" = "10de:00d9" ] ; then
+    # 10de:01d9  Nvidia Corp
+     Smart=ALSA
+      cat<<EOF>$TMPM.2
+CXT 1043:1856 Asustek
+SIL27 103c:006d HP ,  
+EOF
+    elif [ "$PCIDEV" = "1106:3068" ] ; then 
+    # 1106:3068  VIA
+      cat<<EOF>$TMPM.2
+SIL27 1102:0033 CreativeLabs , 1025:0046 Acer , 1025:0033 , 1734:1078 
+SIL22 1743:1032 , 10cf:118e , 1734:1054 , 1462:309e , 1631:e004 , 1543:4c22 , 161f:2032 1584:4005 
+SIL21 10cf:118e , 13bd:1022 , 1543:4c21 1071:8375
+CXT 104d:8143 104d:80f6 , 1025:0030 CXT41 ,
+Unknown 1584:4005 Uniwell, 1025:0030 Acer 104d:80f6CXT?
+EOF
+    elif [ "$PCIDEV" = "1022:7446" ] ; then
+    # 1022:7446  AMD AC_LINK
+      cat<<EOF>$TMPM.2
+none
+EOF
+    elif [ "$PCIDEV" = "10b9:5453" ] ; then
+    # 10b9:5453  ALI 5453
+      cat<<EOF>$TMPM.2
+none
+EOF
+    elif [ "$PCIDEV" = "1543:3053" ] ; then
+    # Silicon Inst
+      cat<<EOF>$TMPM.2
+Unknown 1543:3052
+EOF
+    elif [ "$PCIDEV" = "e159:0001" ] ; then
+    # Tiger Jet
+      cat<<EOF>$TMPM.2
+INTEL537 8086:0003
+EOF
+    elif [ "$PCIDEV" = "1543:3052" ] ; then
+    # SILabs  SI3052 
+      cat<<END>$TMPM.2
+none
+END
+    elif [ "$PCIDEV" = "10b9:5457" ] ; then 
+    # 10b9:5457  ALI 5457
+      cat<<EOF>$TMPM.2
+SIL27 1179:0001 , 1033:81f3
+CXT 103c:002a CXT21, 103c:0024 CXT41 ,  103c:0029
+Unknown 0e11:005a 5457 Compaq
+EOF
+    elif [ "$PCIDEV" = "10b9:5459" ] ; then 
+    # 10b9:5457  ALI 5457
+      cat<<EOF>$TMPM.2
+SIL26 10a5:5459   Smart Link Ltd.
+EOF
+    elif [ "$PCIDEV" = "1002:434d" ] ; then
+      # 1002:434d  ATI Technologies Inc:
+      IDENT=ATI
+      Smart=ALSA 
+      ALSA=1002:434d
+      cat<<EOF>$TMPM.2 
+SIL27 103c:006b HP, 1179:0001 Toshiba ,  1025:0052 Acer
+EOF
+    ##ARCHIVEend
+    else
+      cat<<EOF | tee -a $RECORD
+ This combination of softmodem controller and Subsystem:
+       Primary   $PCIDEV
+       SubSystem $SUBSYS
+ has not been previously reported.
+
+EOF
+    fi
+    # Analysis of Archival info 
+    if test -f $TMPM.2 ; then
+      CODECp=`grep $SUBSYS $TMPM.2 | cut -d' ' -f1`
+      if test -z "$CODECp" ; then
+        echo " Modem codec information on Subsystem $SUBSYS is not in the records.">>$RECORD      
+      elif [ "$CODECp" = "Unknown" ] ; then
+          echo " A codec for this Subsystem record under controller $PCIDEV was not been reported".>>$RECORD        
+        if [ -n "$CODEC" ] ; then 
+         echo " Please report this New assignment to Discuss@linmodems.org : $PCIDEV $SUBSYS  $CODEC" | tee -a $RECORD
+        fi
+      else
+        echo " From prior reports, the modem codec type of the Subsystem is: $CODECp">>$RECORD
+      fi
+    fi 
+
+    # This section compares diagnostis from slamr test and Archival records:
+    if [ -z "$CODEC" ] ; then
+        # echo " Using archived information for soft modem codecs.">>$RECORD   
+        CODEC=$CODECp
+        CODECnone=1
+         COD=`echo $CODEC | cut -b-3`
+    elif [ "$CODEC" = "$ ALG10" ] ; then
+        echo " ALG10 is an audio codec, the modem hardware has not been properly accessed.">>$RECORD
+    elif [ "$COD" = "CXT" ] && [ "$CODECp" = "CXT" ] ; then
+        CODEC=$COD
+        echo " Agreement between slamr diagostic and Archive.">>$RECORD
+    elif [ "$CODECp" = "$CODEC" ] ; then
+        echo " Agreement between slamr diagostic and Archive.">>$RECORD
+    elif ! [ "$CODECp" = "$CODEC" ] ; then 
+         echo " DisAgreement between slamr diagostic and Archive.  Using slamr diagnostic: CODEC=$CODEC">>$RECORD  
+        CODECp=$CODEC
+    else
+        echo "All cases should be covered">/dev/null
+    fi
+
+    # Case by case of CODEC
+    if test -n "$CODEC" && ! [ "$CODEC" = "Unknown" ] ; then 
+      if   [ "$CODECp" = "INTEL537" ] ; then
+         echo   " The modem has an Intel 537 chipset"  | tee -a $RECORD
+        echo  "  Use driver resource Intel-537-MostRecentVersion.tgz" >>$RECORD
+        IDENT=INTEL537
+      elif   [ "$CODECp" = "INTEL537EP" ] ; then
+         echo   " The modem has an Intel 537EP chipset"  | tee -a $RECORD
+        echo  "  Use driver resource Intel-537EP-MostRecentVersion.tgz" >>$RECORD
+        IDENT=INTEL537EP
+      elif [ "$COD" = "CXT" ] ; then
+        CXT=yes
+        Smart=
+       smart=
+       echo " The modem has a Conexant codec: $CODEC" | tee -a $RECORD
+       if test -z "$CNX" ; then
+          echo "   BUT $CNTRL is not yet supported by Linuxant code." | tee -a $RECORD
+       else
+         IDENT=CXT
+          cat<<END | tee -a $RECORD
+ and there is support for the modem controller: $CNTRL
+ Some Linux Distributions include the hsfmodem driver.
+ Search your packages information for "hsfmodem" and "Conexant".
+ If not found there, download a hsfmodem package from http://www.linuxant.com .
+ For 2.4.n kernels, If there is not an exact match your kernel version: `uname -r`
+ then kernel-sources must be prepared as described in Modem/DriverCompiling.txt
+ before the hsfmodem driver compiling can be successfull. 
+ For recent  kernel-source-2.4.6 ,configuration steps are not necessary.
+END
+         fi
+      elif [ "$CODEC" = "SIL22" ] ; then
+        echo " The Subsystem has the a SmartLink codec" | tee -a $RECORD
+        if [ "$smart" = "may" ] ; then
+          echo " with a supported $PCIDEV modem controller" | tee -a $RECORD
+         IDENT=SMART
+        else
+           echo " but sadly, support is lacking for the $PCIDEV modem controller." | tee -a $RECORD
+        fi
+      elif [ "$CODEC" = "BCM64" ] || [ "$CODEC" = "SIL24" ] ; then
+        IDENT=$CODEC
+        echo " The Subsystem has a Broadcom codec $CODEC" | tee -a $RECORD
+      elif [ "$CODEC" = "INT65" ] || [ "$CODECp" = "SIL25" ] ; then
+        IDENT=$CODEC
+        Smart=yes
+              cat<<END>>$RECORD
+              
+ The Subsystem has the INTEL codec $CODEC             
+ The Intel_secure-537AA driver and possibly the SmartLink driver support the modem.
+ Details below and read Modem/Slmodem.txt
+END
+      elif [ "$CODEC" = "SIL24" ] || [ "$CODEC" = "SIL26" ] ; then
+        echo " The Subsystem has a Broadcom codec $CODEC" | tee -a $RECORD
+       IDENT=SMART
+      elif [ "$CODEC" = "SIL21" ] ; then
+        IDENT=Smart
+        echo " The Subsystem has a PCTel codec $CODEC" | tee -a $RECORD        
+       if [ "$MAJOR" = "2.4" ] ; then
+         IDENT=PCTEL
+         echo "The pctel-0.97 drivers may support this modem.">>$RECORD
+       fi
+      elif [ "$CODEC" = "SIL23" ] ; then
+         IDENT=Smart
+         echo " The Subsystem has Silicon Integrated Systems (SiS) codec $CODEC" | tee -a $RECORD      
+      elif  [ "$CODEC" = "SIL27" ] ; then
+        echo " The Subsystem has an Agere Systems codec $CODEC" | tee -a $RECORD
+       if [ "$MAJOR" = "2.4" ]  && [ -n "$AGR" ] ; then
+         IDENT=AGR
+         echo " Under 2.4.n kernels, there are AgereSoftModem drivers">>$RECORD        
+       else
+         IDENT=Smart
+       fi
+      else
+         echo " Please report this new SIL type to Discuss@linmodems.org "
+      fi 
+      if [ "$smart" = "may" ] && ! [ "$COD" = "CXT" ] && ! [ "$IDENT" = "ATI" ] ; then
+        Smart=may
+        echo " SmartLink software should support this modem">>$RECORD
+       if [ "$CODEC" = "BCM64" ] ; then
+         Smart=ALSA
+         echo " Only the SmartLink slmodem-2.9.9d-alsa software supports this modem">>$RECORD
+       fi
+      fi      
+    else
+      echo " There are the following routes toward support:">>$RECORD
+      echo "   Follow instructions in Modem/SoftModem.txt for identifying the modem under a Microsoft boot.">>$RECORD
+      if [ "$smart" = "may" ] ; then
+       if [ "$DISTR" = "SuSE" ] && [ "$MAJOR" = "2.6" ] ; then
+         cat<<END | tee -a $RECORD
+         
+ SuSE has a slamr driver.  Please run the diagnostic:
+ # su - root
+ # modprobe slamr
+ # dmseg | grep slamr
+ and report the results to discuss@linmodems.org.  
+ Read Modem/Slmodem.txt for details.
+END
+        else
+          echo "       Read Modem/Slmodem.txt instruction for doing the slamr diagnostic.">>$RECORD
+       fi
+      fi
+      if test -n "$CNX" ; then
+         echo "  Test the effectiveness of the hsfmodem package from http://www.linuxant.com/drivers/hsf/index.php.">>$RECORD
+      fi
+    # Distro specific issues
+      if [ "$DISTR" = "debian" ]  ||   [ "$DISTR" = "Ubuntu" ]   ||  [ "$DISTR" = "knoppix" ] && ! [ "$IDENT" = "ATI" ] ; then
+       cat<<END>>$RECORD
+
+ The $DISTR Linux includes sl-modem packages with Smartlink drivers
+   Install the kernel-headers-$SYS.deb
+   If necessary, set a symbolic link needed for slmodem compiling:
+     # ln -s /usr/src/kernel-headers-$SYS /lib/modules/$SYS/build
+     as described in Modem/DriverCompiling.txt
+   Then install the two sl-modem/slmodem packages and follow their directions.
+   Thereafter the above slamr diagnositic can be run.
+
+END
+      elif [ "$DISTR" = "SuSE" ] && ! [ "$PCIDEV" = "1002:434d" ] && ! [ "$CODECp" = "CXT" ] && !  [ "$CODECp" = "BCM64" ] ; then
+           cat<<END>>$RECORD
+           
+ Install kernel-source package, the slmodem and km_slmodem packages.
+ If necessary, set a symbolic link needed for slmodem compiling:
+ # ln -s /usr/src/linux-$SYS /lib/modules/$SYS/build
+ Then install the packages and compile the drivers.
+ The compiling process is described in:
+   http://linmodems.technion.ac.il/archive-fourth/msg00176.html
+
+END
+      elif [ "$DISTR" = "Mandrake" ] && [ "$MAJOR" = "2.6" ] ; then
+       cat<<END>>$RECORD
+ Current Mandrake installations have slmodem packages.    
+ http://linmodems.technion.ac.il/packages/smartlink/
+
+END
+      else
+        echo  Leaving space for expansion >/dev/null
+      fi # Distros specific
+    fi # CODECnot 
+  fi # soft
+  echo >$TMPM.2
+  if test -z "$IDENT" ; then
+    cat<<END>$TMPM.2
+ 4005:0308  Avance ALS-300plus sound+softmodem combo PCI card (obsolete).
+ 1055:9178  STANDARD_MICROSYSTEM
+ 10b9:545a  ALI545A SL1801
+ 10b9:5459  ALI 5459 SmartPCI561
+ 10b9:5459  Subsystem: 10a5:5459  ALi Corporation SmartLink SmartPCI561 56K Modem (NetoDragon)
+ 10ec:8197  PCI SmartLAN56 (RealTek ether/modem combo)
+ 1131:3400  SmartPCI56 (Philips UCB1500)
+ 10a5:3052  Racal Interlan SL1900
+ 10a5:5459  Racal Interlan SmartPCI561 SL1900
+ 163c:5459  SmartLink SmartPCI561 SL1900
+ 2000:2800  Gateway SL2800
+ 2003:8800  SmartLink  SL2800
+END
+  fi
+  # marv
+  if grep $PCIDEV $TMPM.2>/dev/null  ; then
+    IDENT=SMART
+    SMT=`grep $PCIDEV $TMPM.2`
+    cat<<END | tee -a $RECORD
+
+ SmartLink drivers support this modem:
+   $SMT
+END
+    if [ "$PCIDEV" = "2003:8800" ] ; then
+      echo " But version slmodem-2.9.10 or later is necessary." | tee -a $RECORD
+    fi
+  elif [ "$Vendor"  = "11c1" ] ; then
+    IDENT=AGERE
+  elif [ "$Vendor" = "115d" ] ; then
+    IDENT=XIRCOM
+  elif [ "$v" = "127a" ] ||  [ "$v" = "14f1" ] ||  [ "$v" = "148d" ] || [ "$PCIDEV" = "158b:0001" ] || [ "$PCIDEV" = "158b:0005" ] || [ "$PCIDEV" = "158b:0015" ]  ; then 
+    IDENT=CXT
+    # Intel 536EP & 537 secton
+  elif [ "$PCIDEV" = "e159:0001" ] && [ "$SUBSYS" = "8086:0003" ] ; then
+    echo "     Use driver resource Intel-537-MostRecentVersion.tgz">>$RECORD
+    IDENT=INTEL537
+  elif [ "$PCIDEV" = "8086:1040" ] ; then
+    if [ "$SUBSYS" = "8086:1005" ] ; then
+      echo SUBSYS=$SUBSYS
+      echo "   Use driver resource Intel-537SP-MostRecentVersion.tgz">> $RECORD
+      IDENT=INTEL537SP
+    fi
+    if [ "$SUBSYS" = "8086:1000" ] ; then
+      IDENT=INTEL536ep
+      echo " Use driver resource Intel-536ep-MostRecentVersion.tgz ">>$RECORD
+      # no SMP      http://linmodems.technion.ac.il/archive-third/msg00855.html
+    fi
+  elif grep $PCIDEV Modem/SoftModem.txt >/dev/null && $LSPCI -v 2>/dev/null | grep "Intel 537" >/dev/null ; then
+   # 1st line, because of mistakes in the PCI id databset
+    echo "     Due to a PCI ID database error, the Intel 537 designation is commonly incorrect." | tee -a $RECORD
+    AMBIG=537
+  else
+    echo No definitive Intel 537 soft modem>/dev/null
+  fi
+  echo $IDENT >$TMPM
+
+  echo > $TMPM.soft
+  if test -z "$IDENT" ; then
+  # Special cases
+   if $LSPCI -v 2>/dev/null | grep CM8738 >/dev/null ; then
+     IDENT=CM8738
+   elif $LSPCI -v 2>/dev/null | grep "Intel 536"  >/dev/null ; then
+   # because Intel 536 may have PCI_IDs assigned by modem assemblers, not Intel
+     IDENT=INTEL536ep
+   elif $LSPCI -v 2>/dev/null | grep "Subsystem: Conexant" >/dev/null ; then
+   # because the PCI_IDs may be assigned by modem assemblers, not Conexant
+     IDENT=CXT
+   else
+     echo "probably not a Conexant modem" >/dev/null
+   fi
+   
+      if $LSPCI -v 2>/dev/null | grep "Smart Link HAMR5600"  >/dev/null ; then
+       # because the PCI_IDs may be assigned by modem assemblers, not SmartLink
+       #  and mistakes in the PCI ID database
+       AMBIG=$AMBIG" HAMR5600"
+       #XX some misidentified softmodem
+      fi
+    fi 
+  
+    if test -z "$IDENT" ; then
+      AMBIG=
+      cat<<END>>$RECORD
+      
+ Information on several modem chipset providers is provided below,
+ because ambiguities remain on the correct choice of supporting software.
+            
+END
+    fi
+    PRIMARY=
+    if test -n "$SOFT" ; then
+      VEND="$SUBven $Vendor"
+      if [ "$Vendor" = "$SUBven" ] ; then
+        VEND=$Vendor
+      fi
+    else
+      VEND="$Vendor"
+      # SUBven not important if not softmodem
+    fi
+    for v in $VEND
+    do
+      echo " == Checking PCI IDs through modem chip suppliers ==">>$RECORD 
+
+    if [ "$Vendor" = "1002" ] && ! [ "$ATI" = "done" ] ; then
+        ATI=done
+       smart=1
+      cat<<END>>$RECORD
+
+ Vendor 1002 is ATI Technolgies, http://www.ati.com, producing video cards, motherboard and
+ a 1002:434d  ATI soft modem controller with a variety of Subsystems.
+  There is a modem driver, snd-atiixp_modem.ko , becoming available through http://www.alsa-project.org ,
+ with complementary port creation through the SmartLink slmodem-2.9.9d-alsa
+ For history see:  http://website.lineone.net/~bryanrpoole/atiixp-modem.htm
+ For details on setup and testing, see Modem/ATI.txt
+END
+    fi
+    if [ "$Vendor"  = "151f" ] ; then
+      IDENT=Topic
+      cat<<END>>$RECORD
+      
+ Vendors $v is TOPIC SEMICONDUCTOR Corp.
+ Class 0780 151f:0000 is a controller chipset modem using the standard drivers.
+ See http://www.math.sunysb.edu/~comech/tools/PCImodems.html
+
+END
+    fi
+    if [ "$v" = "10de" ] ; then
+      cat<<EOF>>$RECORD
+      
+ Vendor 10de is Nvidia, producing the video cards and 
+ two softmodem controllers: 10de:01c1 and 10de:00d9
+ For subsystems with SILnm codecs,
+     slmodem-2.9.n software in ALSA mode provides support.
+      
+EOF
+    fi 
+    if [ "$PCIDEV" = "10de:00d9" ] ; then 
+       cat<<EOF>>$RECORD
+       
+ At least some of the 10de:00d9 chipset modems have a Conexnant codec, with support by the hsfmodem package from http://www.linuxant.com/drivers/hsf.   
+ After installation of the software, an edit may be necessary in the file:
+   /usr/lib/hsfmodem/mod_mc97ich.c
+ Search for "0x01C1" , which will reveal a line beginning:
+    { 0x10DE, 0x01C1, PCI_ANY_ID,  PCI_ANY_ID,   
+ and change to: 
+    { 0x10DE, 0x00D9, PCI_ANY_ID,  PCI_ANY_ID,    
+    
+EOF
+    fi    
+    if [ "$v" = "e159" ] ; then
+      cat<<END>>$RECORD
+
+ Vendor $v is Tiger Jet (TJ).
+  $v:0001  translates PCI commands to the serial link used by
+     the silabs DAA from the si3034, si3044 and si3056 family.
+  $v:0001  8086:0003  TJ320 v2.0 , with subsystem 8086:0003 is an Intel-537 soft modem
+     supported by:  Intel-537-MostRecentVersion.tgz
+  $v:0001  0359:0003  TJ320 v3.1
+
+END
+    fi
+    if [ "$v" = "1106" ]  ; then
+      VIA=1
+      cat<<END>>$RECORD
+
+ Vendor $v is VIA  Technologies Inc.,producing diverse bridges including devices:
+    1106:3068    VT82C686/686A/686B AC97 Modem Codec
+ Under the later, the  10cf:118e  the "Intel 537" is partially supported
+   by the SmartLink slmodem-2.7.10 software
+    Subsystem 1102:0033 has an AgereSystems soft modem chip
+
+END
+    fi
+    if [ "$v" = "13f6" ] ; then
+      PCTEL=13f6
+      cat<<END>>$RECORD
+
+ Vendor $v is C-Media Electronics, which produced modem:
+     13f6:0211  C-Media Electronics Inc CM8738,
+     13f6:0211  subsystem HSP56 Audiomodem Riser
+ supported under 2.4.n kernels by PCTEL software.
+ BUT there is no support under 2.6.n kernels.
+
+END
+    fi
+    if [ "$v" = "14e4" ] || [ -n "$BRD" ] ; then
+      cat<<END>>$RECORD
+
+ Vendor 14e4 is BroadCom 
+   14e4:4212   is a  BCM V.90 56k modem
+ There is a driver for 2.2.n kernels called  BCOM_WAN_V20.
+    Search for it at http://www.dell.com 
+ However the code has not been updated for some time.
+ For  2.4 kernels, fix by Giacomo Comes must be used. See :
+   http://linmodems.technion.ac.il/archive-third/msg01652.html
+ When serving under softmodem controllers like the Intel ICH series,
+ the Broadcom Subsystem 14e4:4d64 has mc97 codec BCM64.
+ For 2.6.n kernels, see success reports:
+   http://linmodems.technion.ac.il/archive-fourth/msg03690.html
+   http://oboc.ucdavis.edu/Marik/inspiron/ 
+   The support is achieved through a combination of:
+   1) the snd-intel8x0m.ko of 2.6.n kernel releases, which provides a low level interface with the modem;
+   2) an slmodemd daemon which creates ports and provides higher level functions.
+   Get the slmodem-2.9.9d-alsa.tar.gz from  http://linmodems.technion.ac.il/packages/smartlink/
+   To compile the slmodemd, it is first Necessary to install a libasound2-dev package, providing alsa headers.
+   3) After compilation and installation of slmodemd, initiate service with:
+   # modprobe  snd-intel8x0m
+   # slmodemd --alsa --country=YOURCOUNTRY hw:1
+   Read the slmodem documentation for details and Modem/Slmodem.txt
+
+END
+    fi
+    if [ "$v" = "104d" ]; then
+      cat<<END>>$RECORD
+
+ Vendor 104d is Sony. Subsystem 104d:8129 under a 8086:2486 Intel modem controller
+ has a Conexant chip in a Sony Vaio grx560 laptop. 
+ A bootup "acpi=on" was required for IRQ acquisition.
+END
+    fi
+    if [ "$v" = "1039" ] ; then
+      echo " Vendor $v is SiS, Silicon Integrated System, producing  soft modem controllers and subsystems.">>$RECORD
+    fi
+    if [ "$v" = "1014" ] ; then
+      echo Vendor=1014 is IBM.>>$RECORD
+      if test -n "$SOFT" ; then
+        cat<<END>>$RECORD
+
+ Some thinkPad laptops have soft modem Subsystems with AgereSystems codec: 1014:0227 and 1014:0524. 
+ Software access is through IBM:
+       http://www-3.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-52698
+END
+      fi
+    fi #beginESS
+    if [ "$v" = "125d" ] ; then
+      IDENT=ESS
+      cat<<END>>$RECORD
+
+ Vendor=$v is ESS Technologies, making devices:
+ There has been no formal support for Linux since kernels 2.2.2
+ Some kludges are of fading utility as the 2.4.n Linux kernels and hardware evolves:
+   http://linmodems.technion.ac.il/archive-fourth/msg00317.html   (2004Feb08)
+   http://andrew.cait.org/ess/
+   http://sidlo.penguin.cz/ES2838/index_en.html
+   http://tx.technion.ac.il/~raindel/
+   http://phep2.technion.ac.il/linmodems/archive/msg04424.html
+      
+ There is no hope for support under 2.6.n kernels.
+
+END
+    fi
+    if [ "$v" = "1025" ] ; then
+      cat<<END>>$RECORD
+
+ Vendor=$v is Acer, http://global.acer.com/ PC and latop manufacturer with devices including:
+  1025:5453   M5453 AC-Link Controller Modem Device
+  1025:0038   an AC97 link modem.
+
+END
+    fi
+    # beginMotorola
+    if [ "$v" = "1057" ] || [ "$v" = "11d4" ] ; then
+      IDENT=Motorola
+      cat<<END>>$RECORD
+
+ -----------------------------
+ Vendor=1057 is Motorola with service provided through vendor=11d4 Analog Devices Inc.
+ Installers are available at: http://www.motorola.com/softmodem/sm56_download.htm
+as RPM packages containing binary images of drivers 
+applicable for installation on the following systems:
+* RedHat 7.3 (kernel version 2.4.18-3, sm56-06.05.00-1.rh7.i386.rpm)
+* RedHat 8.0 (kernel version 2.4.18-14, sm56-06.05.00-1.rh8.i386.rpm)
+* RedHat 9.0 (kernel version 2.4.20-8, sm56-06.05.00-1.rh9.i386.rpm)
+* Mandrake Linux 9.2 (kernel version 2.4.22-10mdk, sm56-06.05.02-1.mdk.i586.rpm)
+* Mandrake Linux 10.0 (kernel version 2.6.3-7mdk, sm56-06.05.02-2.mdk10_263-7.i586.rpm)
+* Suse Linux 9.0 (kernel version 2.4.21, sm56-06.05.02-1.suse90-020421-99.athlon.rpm)
+* Suse Linux 9.0 (kernel version 2.4.21, sm56-06.05.02-1.suse90-020421-99.i586.rpm)
+ There is also available a Legacy driver - SM56_5.1_I386.rpm for 2.4.n kernels ONLY
+ for which the advice at http://www.sm56.tk/ may be effective.
+ Jan Ibanez  <jmibanez@gmail.com> is our expert on Motorola problems
+ Achieving function with these drivers is often difficult.
+ If you computer alternatively boots Linux and Microsoft OS,
+ do a complete PowerOff before starting Linux. 
+ Otherwise there may be an error during following Motorola usage:
+     SM_DisplayFatalError
+
+ Some guidance for particular cases is:
+   http://linmodems.technion.ac.il/archive-fourth/msg01751.html
+   http://linmodems.technion.ac.il/archive-fourth/msg01749.html
+   http://linmodems.technion.ac.il/archive-fourth/msg01750.html
+   http://linmodems.org/cgi-bin/ezmlm-cgi?1:mss:13952:200405:enbjmmngagmdejkemacc
+   http://users.volja.net/kutulu/sm56.tar.gz
+ There is a volunteer Motorola site: http://www.sm56.tk/
+ The installation creates a driver sm56.o , the character devices
+      /dev/motomem
+      /dev/sm56
+         with symbolic link  /dev/modem --> /dev/sm56
+  the /etc/modules.conf lines:
+      alias char-major-24 sm56
+      options sm56 country=1
+  and documentation in  usr/share/doc/HTML/en/sm56/  and "man sm56"
+  An additional line in /etc/modules.conf
+      alias /dev/modem /dev/sm56
+  would beneficially aid driver autoloading, without which there may be a failure of the wvdial functionality test:
+  # /etc/wvdialconf /etc/wvdial.conf
+ --------------------------------- End Motorola ------------------
+
+END
+    fi # begin3com
+    if [ "$v" = "10b7" ] || [ "$v" = "12b9" ] ; then
+      smart=
+      IDENT=3COM
+      cat<<END>>$RECORD
+
+ 10b7 is 3COM
+       :1006    0038TA <- AC101 - TF Mini-PCI 56K V.90 WinModem  no Linux support
+       :1007    3C556 V.90 Mini-PCI    WinModem  no Linux support
+ 12b9 is US Robotics. acquired by 3COM
+       :0062    erk41926a-0.6 usr 56k internal modem
+       ;1006    3cp803598  Voice          WinModem  no Linux support
+       :1007    ERL3263A-0 DF GWPCI PC99  WinModem  no Linux support
+       :1008    3cp803598  is Supported by the standard:  serial.o
+ The following may be supported  by Conexant drivers at   http://www.linuxant.com
+   14f1:2f12 (3COM/USR model 3094-3095)
+   14f1:2f13 (USR OEM)
+   14f1:2f14 3COM/USR
+ though they carry USR labels.
+
+END
+    fi
+    if [ "$v" = "1543" ] ; then
+echo >>$RECORD
+echo  "Vendor 1543 is Silicon Laboratories (SIL).  SIL produces "blanks" for soft modem Subsystems"  >>$RECORD
+echo  which subsequent acquire the Subsystem PCI ID from the final Subsystem assembler. >>$RECORD
+echo  Subsystems for soft modems are also produced. >>$RECORD
+echo >>$RECORD
+    fi    
+    if [ "$v" = "10b9" ] ; then
+          cat<<END>>$RECORD
+
+ Vendor 10b9 is Acer Labs, producing highly integrated motherboards and Ali components.
+ The tight integration unfortunately ofter blocks identification of the modem chipset.
+ Desired information may be gained by using a COMM console under MS Windows,
+   and using ATI commands to elicit chipset and driver information.
+ 10b9:5450  ALI 5450 and  10b9:5451  ALI 5451 are controllers for unsupported "sound  modems"
+END
+      if [ "$Device" = "545a" ] || [ "$Device" = "5459" ] ; then
+        cat<<END>>$RECORD
+ $PCIDEV ALI545A SL1801 and $PCIDEV  ALI 5459 SmartPCI561 have SmartLink chipsets.
+
+END
+      fi
+
+      if [ "$Device" = "5457" ] || [ "$Device" = "5459" ] ; then
+       cat<<END>>$RECORD
+
+ These messages may aid setup of soft modems under $v:M5457 controllers:
+   http://linmodems.technion.ac.il/archive-third/msg02518.html
+   http://linmodems.technion.ac.il/archive-third/msg02100.html
+ The slmodem-2.9.9 support was developed for $v:5459,
+   but there a range of reports the related $v:5457 modemd controllers:
+     fully functional;
+     functional only after a power on reboot from Microsoft windows;
+     hang/crash upon initiation of modem usage.
+ 10b9:5457   Modem: ALi Corporation [M5457 AC-Link Modem] 
+ SubSystem 1179:0001   Toshiba America Info Systems: Unknown device 0001
+ has an AgereSoftModem chip which may be supported by the Smartlink slmodem-2.9.9 driver 
+     
+END
+      fi
+    fi # beginPctel
+
+    if ! [ "$PCTEL" = "DONE" ] ; then
+      if [ -z "$IDENT" ] || [ "$IDENT" = "PCTEL" ] || [ "$IDENT" = "CM8738" ] ; then
+        if [ "$v" = "134d" ] || [ "$v" = "134c" ] || [ -n "$CM8738" ] || [ "$PCTEL" = "13f6" ] || [ "$CODECp" = "SIL21" ] ; then
+         if [ "$CODECp" = "SIL21" ] ; then
+            cat<<END>>$RECORD
+
+ For Pctel AMR under $CNTRL,
+ the SmartLink slmodem-2.9.n  software can serve.
+ The advantage is current updates, extending into the 2.6.n kernels.
+
+END
+              smart=1
+          fi
+         echo " Read ModemData.txt  and Pctel.txt in the new sub-folder Modem/" | tee -a $RECORD
+         if [ "$PCIDEV" = "134d:2189" ] ; then   
+            echo " The 134d:2189 is a PCTel 688T modem which is currently NOT supported see:" >>$RECORD
+            echo "     http://linmodems.technion.ac.il/archive-fifth/msg00057.html" >>$RECORD      
+         fi
+                  cat<<END> Modem/Pctel.txt
+
+ Vendor=134d is PCTel and Vendor=134c is Chori Joho System Co. Ltd, 
+ producing idenitcal devices including deviceIDs. For supported PCtel modems
+  The PCTel Inc., modem sector has been sold to Conexant. 
+  Thus official updates for Linux support are unlikely!!
+  
+  Through volunteer efforts, there are  code releases are at 
+      http://linmodems.technion.ac.il/pctel-linux .
+  Download the pctel-0.9.7-9.tar.gz
+  Do the following preliminary steps:
+         Unpack with command :       tar zxvf pctel-0.9.7-9.tar.gz
+       Change directory:                 cd pctel-0.9.7-9
+       Read README file                   less README   (space bar goes to next page)
+       Is a compiler installed?  Test with:           gcc 
+       If not found, install it from your Linux distribution.
+       Become root:               su  root
+       Seeing lspci?                    lspci    
+         If not, install the package   pciutils .
+       Now you can follow instructions in README
+      
+  For guidance on compiling and installing the pctel drivers, read the  PCTel minHOWTO: 
+      http://www.peacefulaction.org/sayamindu/docs.php
+  and the remainder of this file
+
+ The ISA card pct388p modem is not supported by the current driver series see:
+       http://linmodems.technion.ac.il/archive-fifth/msg00166.html
+ The PCI ID 134d:2189 modem is a PCTel 688T modem which is currently NOT supported see:
+     http://linmodems.technion.ac.il/archive-fifth/msg00057.html 
+ There are No success reports under current 2.6.nn kernels using PCTel code,
+   though volunteer efforts are in progress to achieve support under 2.6.n kernels.
+ The slmodem Smartlink code can however support the AMR PCtel modems under 2.4.n and 2.6.n kernels.
+ During PCtel code installations, the node made is character device /dev/ttyS15  c 62 69
+ Check with:
+     ls -l dev/ttyS15
+     
+ There is a pre-compiled binary component in the Pctel code which was assembled with a gcc 2.95 compiler
+ A consequence is the loading fails under kernels compiled with gcc 3.n , unless forcing (-f) is used:
+       # insmod -f pctel
+        # insmod ptserial
+This can be automated by adding the following lines to /etc/modules.conf
+####### for pctel modem ######
+alias char-major-62 pctel
+alias /dev/modem ptserial
+install pctel /sbin/insmod "-f" "pctel"
+post-install pctel /sbin/insmod ptserial
+
+# country code for pctel modem, for USA
+options ptserial country_code=1
+######## pctel end ####
+
+then run:
+# depmod -a
+to inform the System and thereafter
+# modprobe ptserial
+will load both drivers,
+
+ For some Systems, PCTel function requires disablement of apmd power monitoring function.
+
+ System problems of various severity have been reported after modem usage.
+ These may be alleviated by the following steps after a modem usage session.
+ Log into a console as:
+ # su - root
+ # lsmod 
+ to display loaded modules.
+ # modprobe -r ptserial
+ # lsmod
+
+ For a case of a 134d:7897 modem on a VIA686 motherboard PCTEL drivers compiled with
+     hal=via686
+  did NOT provide effective drivers while the drivers were effective when compiled with
+     hal=pct789 
+     
+ For pctel-0.9.7-9 with variant hal=via686a, a fix is needed:
+   # cd src
+   # make clean
+   # ./configure -auto
+Search the Makefile for a line containing DAUDIO.  Edit that line into:
+   AUDIOROUTING=-DVIA
+Then:  
+   # make
+   # make install
+    
+END
+        fi
+      PCTEL=DONE
+     fi
+    fi # IDENT
+    
+    if [ "$v" = "158b" ] ; then
+      cat<<END>>$RECORD
+
+ echo Vendor 158b is Allied Data Technologies, http://
+ 158b:0001 and 158b:0005 have Conexant HSF chipsets.
+ 158b:0015 has a Conexant HCF chipset.
+ There are 158b:xxxx modems with the Intel 536ep chipset.
+
+END
+    INTEL536ep=1
+    fi
+    if  [ "$v" = "1013" ] ; then
+      cat<<END>>$RECORD
+
+ There is no CURRENT SUPPORT for the Vendor=1013 chipsets of CML, Cirrus Logic Modems,
+  with modem business acquired by Intel, Inc.
+ See message: http://linmodems.org/cgi-bin/ezmlm-cgi?1:mss:9448:200210:fbhcoigfcimgkjdedjad
+
+END
+    fi
+    if [ "$v" = "1813" ] ; then
+      cat<<END>>$RECORD
+
+ Vendor=1813 Ambient Tech was acquired by Intel with its HaM (Host assisted Modem) chipsets.
+ Intel-v92ham-453.tgz ifor 2.4.n kernels is FINAL update for HaM modems, available at:
+    http://linmodems.technion.ac.il/packages/Intel/ham/ 
+    http://developer.intel.com/design/modems/support/drivers.htm
+    It is NOT functional when compiled under 2.6.n kernels and will NOT be updated to support
+    the 2.6.n kernels, Intel maintainer Dorian Araneda has reported.
+ But under the 2.4.nn kernels, all HaM chipsets are supported,
+     with a single EXCEPTION: the odd PCI_ID 1813:4100 modems.  For the explanation, see message:
+     http://linmodems.org/cgi-bin/ezmlm-cgi?1:mss:9448:200210:fbhcoigfcimgkjdedjad
+
+END
+    fi 
+    # beginCXT
+    if test -z "$Dcnx" ; then 
+      Dcnx=done
+      echo "148d 158b 141a 127a 14f1 1024" > $TMPM
+      # hcfpciconfig
+      if [ "$IDENT" = "CXT" ] || grep $v  $TMPM >/dev/null  ;  then
+         # Conexant HSF, adapted from www.linuxant.com   HSF page
+cat<<END>$TMPM
+
+   HSFi tyes
+ -----------
+ 14f1:2f00, Subsystem ID 2002:14f1
+ 14f1:2f00, Subsystem ID 2003:14f1
+ 14f1:2f00, Subsystem ID 2004:14f1
+ 14f1:2f01
+ 14f1:2f02
+ 14f1:2f03
+ 14f1:2f04
+  
+   HSF types
+ ----------
+ 14f1:2013
+ 14f1:2014
+ 14f1:2015
+ 14f1:2016
+ 14f1:2f10
+ 14f1:2f11
+ 14f1:2f12
+ 14f1:2f13
+ 14f1:2f14
+ 14f1:4311 (RIPTIDE - sound not supported)
+ 127a:2013
+ 127a:2014
+ 127a:2015
+ 127a:2016
+ 127a:4311 (RIPTIDE - sound not supported)
+ 127a:2114
+
+ Basic2 / SmartDAA types
+ --------------------------
+ 14f1:2043
+ 14f1:2044
+ 14f1:2045
+ 14f1:2046
+ 14f1:2443
+
+  Athens (Yukon)
+ -----------------
+ 14f1:1631
+ 14f1:1636
+ 14f1:1637
+
+ 8086:2486 104d:8129 SoftK56 CModem in a Sony Vaio grx560 laptop required a bootup "acpi=on" for IRQ acquisition.
+END
+
+if [ "$PCIDEV" = "14f1:2f00" ] ; then
+  echo $Vendor:2002 > $TMPM.0
+  echo $Vendor:2003 >> $TMPM.0
+  echo $Vendor:2004 >> $TMPM.0
+#  cat $TMPM.0
+  if grep 14f1:2f00 $TMPM | cut -dD -f2- | grep -f $TMPM.0 >/dev/null ; then
+    HSF=1
+  fi
+fi
+if grep $Vendor $TMPM >/dev/null ; then
+  grep $Vendor $TMPM > $TMPM.1
+  if grep $Vendor:$Device $TMPM.1 >/dev/null ; then
+    HSF=1
+  fi
+fi
+if test -n "$HSF" ; then
+   echo "  $PCIDEV is a Conexant HSF modem." | tee -a $RECORD
+fi
+# END Conexant HSF
+# the four set  127a,14f1:1025,2005 can be HCF and HSF and are included in the following HCF section
+
+# www.linuzant.com HCF page adaptation
+cat<<END>$TMPM
+# Vendor:-------devices-----  of HCF List
+ 127a:1002:1003:1004:1005:1006 (71DP v90)
+ 14f1:1002:1003:1004:1005:1006 (71DP v90)
+ 127a:1022:1023:1024:1026
+ 14f1:1022:1023:1024:1026
+ 127a:1025:1085:2005 (if it doesn't work: try HSF driver)
+ 14f1:1025:1085:2005 (if it doesn't work: try HSF driver)
+ 127a:2004:2006
+ 14f1:2004:2006
+ 127a:1032:1033:1034:1035:1036
+ 14f1:1032:1033:1034:1035:1036
+ 127a:14f1:4321 (RIPTIDE)
+ 14f1:10b3:10b4:10b5:10b6
+ 127a:1802:1804:1805 (LAN/Modem combo)
+ 14f1:1813:1815 (LAN/Modem combo)
+ 14f1:1f10:1f11:1f14:1f15
+ 14f1:1053:1054:1055:1056 (Smart HCF board rev 3)
+ 14f1:1052:1057:1059 (Smart HCF board rev 4)
+ 14f1:1063:1064:1065:1066 (Smart HCF US-only: Dell)
+ 14f1:1453:1454:1455:1456 (Smart HCF mini-PcI board rev 3)
+ 14f1:1452:1457:1459 (Smart HCF mini-PcI board rev 4)
+ 1024:1024 (Zenith Data Systems)
+ 148d:1003 (DIGICOM Systems)
+ 158b:0015 (Allied Data Technologies Tornado VfM56x-PRc)
+ 141a:1035 (Apache Micro)
+
+END
+if grep " $Vendor:" $TMPM >/dev/null ; then
+  grep " $Vendor:" $TMPM > $TMPM.1
+  if grep :$Device $TMPM.1>/dev/null ; then
+  #for the four set  127a,14f1:1025,2005
+    if grep $Vendor:1025:1085:2005 $TMPM.1 >/dev/null ; then
+       echo " $PCIDEV could be either an HSF or an HCF Conexant modem" | tee -a $RECORD
+    else
+       echo "  $PCIDEV is a Conexant HCF modem." | tee -a $RECORD 
+    fi 
+  fi 
+fi
+          cat<<END>>$RECORD
+
+ Vendors 127a and 14f1 are Conexant, inheritor of  Rockwell modem  technology. There are also Conexant chipsets
+ in some modems from vendors 158b - Allied Data Tech., 1024 - Zenith ,141a - Apache Micro and 148d Digicom Systems.
+ With respect to software support there are two main types, hcfpcimodem* and hsfmodem* .
+ Download drivers from http://www.Linuxant.com/drivers/
+ At   http://linmodems.technion.ac.il/resources.html#conexant  , there are scripts aiding installation:
+      For HSF modems.
+      For HCF modems.
+ There is additional Conexant information written to Modem/Conexant.txt 
+END
+   cat<<END> Modem/Conexant.txt 
+   
+  Linuxant Inc.  provides Linux drivers for Conexant chipset modems
+  Go to http://www.linuxant.com/drivers
+-Find the HCF or HSF menu in the left part of the screen.
+-Read README.
+-Read INSTALLATION.
+-Click DOWNLOAD.
+-Accept conditions.
+-Find text: "You can download HCF (or HSF) modem packages from the driver
+            download page." and click there.
+-Look for your distribution, your processor, and your kernel.
+-Download the matching file.
+-Read again and, if you do this under Windows, print the installation
+ instructions matching the kind of driver file which you downloaded.
+-Now just follow these instructions.
+
+http://www.linuxant.com/drivers/hsf/downloads-patches.php has patches
+    that may be necessary for recent kernels. 
+
+ A detailed software installation example is provided at:
+   http://linmodems.technion.ac.il/archive-fourth/msg00350.html
+   
+ The HCF (Host Controller Free) modems which have a digital signal processsing (DSP) chipset,
+ while the HSF in the soft modem family without a DSP.
+ HSF support is included with SuSE 9.0 and later releases
+ Modems with the following PCI_IDs also have Conexant HCF (Controller free) chipsets.
+  1024:1024 (Zenith Data Systems)
+  148D:1003 (DIGICOM Systems)
+  158B:0015 (Allied Data Technologies Tornado  VFM56x-PRC)
+  141A:1035 (Apache Micro)
+ The following six may be either HCF of HSF modems. Test the HSF package first
+  (127a,14f1):(1025,1085, 2005)
+  Should a HCF driver installation fail to serve among there,
+  then uninstall and instead try the HSF driver resource.
+ Subsystem HSF Conexant soft modems serve under AC97 or MC97 controllers. These include:
+  14f1:(5422 2002) , plus many others with vendors assigned PCI IDs.
+ After loading of HSF drivers, there will be displayed by command: /sbin/lsmod
+Module                  Size  Used by    Tainted: P
+hsfich                119116   0  (autoclean)
+hsfserial              26388   0  (autoclean)
+hsfengine            1126348   0  (autoclean) [hsfserial]
+hsfosspec              35328   0  (autoclean) [hsfich hsfserial hsfengine]
+     plus many others not modem related.
+ While drivers are pre-compiled for some Linux distributions,
+   the installation of the HCF/HSF packages DOES in general require kernel-source/ preparation,
+   as described in Modem/DriverCompiling.txt.
+   
+ There is a conflict between modules snd-intel8x0m and  hsfmc97ich.
+ The snd-intel8x0m Must be loaded first or the system may hang upon hsfmc97ich insertion.
+      http://linmodems.technion.ac.il/archive-fourth/msg03027.html
+      
+ A post install suggestion for adjusting PCI latency is:
+         http://phep2.technion.ac.il/linmodems/archive/msg05210.html
+
+END
+      fi 
+    fi # cnxt # beginIntel
+
+    echo $IDENT>$TMPM
+    if [ -z "$Dintel" ] ; then
+      if grep INTEL $TMPM >/dev/null || [ "$v" = "8086" ]  || [ "$v" = "1813" ] || [ "$AMBIG" = "INTEL537" ] || [ "$CODECp" = "INT" ]; then
+        Dintel=done
+        cat<<END>>$RECORD
+
+ Vendor=8086 is Intel, Inc. producing HaM and 536ep host controller free (HCF) modems, 537 soft modem
+ and AC97 and MC97 controllers managing a varierty of non-Intel soft modem Subsystems.
+ These subSystems often have PCI_IDs assigned by the modem assembler, rather than the chip provider.
+ Download available drivers through:  http://developer.intel.com/design/modems/support/drivers.htm  with Intel-537 types at:
+ http://downloadfinder.intel.com/scripts-df/Filter_Results.asp?selCat=all&strOSs=39&ProductID=1230&page_nbr=2
+ Also check at: http://linmodems.technion.ac.il/packages/Intel/537/  
+ for beta releases and perhaps Already compiled drivers for some Linux distributions
+ A very detailed installation report cogent to 537 type modems is at:
+                  http://linmodems.technion.ac.il/archive-fifth/msg00541.html
+ Setup call id with:
+       Type 1 : When the phone line is not in use                    at+vcid=1
+       Type 2 : When the phone line is already in use on a call      at+pcw=0
+ ---------------------
+END
+        if [ "$IDENT" = "INTEL536ep" ] ; then
+           cat<<END>>$RECORD
+:
+ The older 2.4.n driver pair have a dependency on one other.
+ with result that these messages may be seen upon driver loading:
+        depmod****Unable to resolve symbol in 536ep.o
+        depmod****Unable to resolve symbol in 536epcore.o
+ but function is NOT affected.
+ Bur when the message is any longer, the drivers probably have not been properly compiled.
+   In which case carefully read Modem/DriverCompiling.txt
+
+ A problem maintaining CONNECT under the version 4.62 drivers was resolved
+ by dropping back to the 4.60 version. See:
+    http://linmodems.technion.ac.il/archive-third/msg02127.html
+
+  The Intel-537SP-MostRecentVersion.tgz driver package may alternatively provide support.
+  
+  For Debian like distros, a modified install script is:  
+http://members.lycos.co.uk/persianlinux/downloads/intel536ep/Intel536_inst_debian
+
+END
+       fi # 536ep
+       if [ "$AMBIG" = "INTEL537" ] || [ "$CODECp" = "INT" ] ; then
+          echo "  Recent Intel-537 fixes are  related in http://linmodems.technion.ac.il/archive-fifth/msg00013.html ,   http://linmodems.technion.ac.il/archive-fifth/msg00166.html">>$RECORD
+         if [ "$DISTR" = "SuSE" ] ; then
+            cat<<END>>$RECORD
+
+  Within http://linmodems.technion.ac.il/packages/Intel
+  there are packages with compiled Intel 537 drivers for 2.4.nn kernels with name formats like:
+          intel-537EP_SuSE-9.0_2.4.21-99-default_ONLY.tgz
+
+END
+          fi
+         if [ "$AMBIG" = "INTEL537" ] ; then
+             cat<<END>>$RECORD
+ The installer code candidate is:
+       Intel_secure-537AA-MostRecentVersion.tgz 
+ But the Intel 537 readout needs confirmation !!
+ Sadly there are a few mis-designations in the pciids dataset, which $0 relies on
+ Too many modems are being labeled Intel537 types.
+   http://linmodems.technion.ac.il/archive-third/msg02463.html
+   http://linmodems.technion.ac.il/archive-third/msg02476.html
+ This includes the distinct Agere, Conexant and SmartLink chipsets types. Conseqeuntly
+ YOU must manually obtain further information under Microsoft Windows through modem ATI tests/queries
+ as instructed in $RECORD2  Please include this information in any report to discuss@linmodems.org
+
+END
+          fi
+        cat<<END>>/dev/null
+
+ There are Five types of Intel 537 chipsets sold to a variety of modem assemblers,
+    though they may are all called out as Intel 537  by the LSPCI tool used in $0.
+    Intel 537, a 8086:0003 subsystem PCI card  modem with TigerJet PCI Controller - e159:0001
+       The installer is:  Intel-537-MostRecentVersion.tgz 
+    Intel 537EP, an Intel PCI modem  si3052 chip(Intel 537EP(G)), si=Silicon Instruments
+       8086:1080 Intel AC97 controller with modem  subSystem 8086:100[7,8,A,0] with
+       with installer is intel-537EP_MostRecentVersion.tgz
+         at http://downloadfinder.intel.com/scripts-df/Product_Search.asp?Prod_nm=537ep
+    Intel 537SP (was known as MD5690) a PCI modem with dsp on board but disabled.
+       8086:1040 Intel AC97 controller, with modem subsyst 8086:1005
+       with installer intel-537SP-MostRecentVersion.tgz
+    There are ambiguities in identification of modems with two Intel537 AA and EA chipset types
+       http://linmodems.technion.ac.il/archive-third/msg02463.html
+       http://linmodems.technion.ac.il/archive-third/msg02476.html
+     Intel 537AA/EA, MDC/AC97 controller  with si3054 modem chip
+       currently supported AC97 controllers - Intel (ICH3,4,5), VIA, NVIDIA, SIS, Realtek, ALI, ATI
+       with installer  intel-537AA_secure-MostRecentVersion.tgz
+    serving also Intel 537EA, CNR controller with  si3038 modem chip
+
+END
+       fi # IDENT
+      fi # End Intel section
+    fi # DONE
+# EOF    
+    # Lucent or Xircom DSP
+    if [ "$IDENT" = "AGERE" ] || [ "$IDENT" = "XIRCOM" ] ; then
+     DEVICES="0x11c1:0x0440-0x045c"
+     DEVICES=$DEVICES" 0x115d:0x0000-0x000f"
+     DEVICES=$DEVICES" 0x115d:0x0440-0x045c"
+     DEVICES=$DEVICES" 0x115d:0x0010-0x03ff"
+     DEVVEN=$(( 0x`echo $PCIDEV | cut -d':' -f1` + 0 ))
+     DEVNUM=$(( 0x`echo $PCIDEV | cut -d':' -f2` + 0 ))
+     for DEV in $DEVICES
+     do
+      VENDOR=$(( `echo $DEV | cut -d':' -f1` + 0 ))
+      DEVMIN=$(( `echo $DEV | cut -d':' -f2 | cut -d'-' -f1` + 0 ))
+      DEVMAX=$(( `echo $DEV | cut -d':' -f2 | cut -d'-' -f2` + 0 ))
+      FOUND=
+      if test $DEVVEN -eq $VENDOR && test $DEVNUM -ge $DEVMIN && test $DEVNUM -le $DEVMAX
+      then
+        FOUND="yes"
+        PCI_ID="$PCIDEV"
+        MODEM_VENDOR=0x`echo $PCIDEV | cut -d':' -f1`
+        MODEM_DEVICE=0x`echo $PCIDEV | cut -d':' -f2`
+        if [ "$MODEM_VENDOR" = "0x11c1" ] ; then
+          VENDED=LUCENT
+        else
+          VENDED=XIRCOM
+        fi
+        if test -n "$PCI_ID" ; then
+          DSP=1
+          cat<<END  |  tee -a $RECORD
+
+ The modem has a supported Lucent/Agere DSP (digital signal processing) chipset
+  with primary PCI_ID:  $PCI_ID
+ DSP=1
+        
+ Agere Systems, Inc provides periodic software releases for there DSP modems,
+ which are made more Newbie friendly by volunteers.  There are some installer packages
+ and also resources for compiling drivers:
+ http://ltmodem.heby.de  is a repository for installers for later 2.4.2n and early 2.6.n  kernels.
+      Packages below are for compiling drivers:
+            ResourceName                Use for kernel ranges
+        --------------------------------------------------------------------------------------------------         
+        ltmodem-8.26a.tar.gz         kernels 2.4.21 and earlier
+        ltmodem-8.30a3.tar.gz       kernels 2.4.21 and subsequent 2.4.2n kernels
+        ltmodem-8.31a10.tar.gz     beginnig with 2.4.21 through and into 2.6.n  kernels 
+ http://linmodems.technion.ac.il/packages/ltmodem/
+        has installers for older 2.4.n kernels moved from http://ltmodem.heby.de 
+        and subfolder kernel-2.6/  for 2.6.n  kernel support.  The latest resouce is:
+       ltmodem-2.6-7-alk-7.tar.bz2  from Alex Kondratenko
+       ltmodem-2.6-7alk.src.rpm is a repackaging for by Stephan Puck.  After installation
+           of a kernel-source package (not necessary for fedora releases) use by:
+           rpmbuild --rebuild ltmodem-2.6-7alk.src.rpm  , which will deposit an installer at:
+               /usr/src/rpm/RPMS/i586/ltmodem-kv_YourVersion.rpm          Check with  
+            # ls -l   /usr/src/rpm/RPMS/i586/ltmodem*
+           Then install with:
+           # rpm -i /usr/src/rpm/RPMS/i586/ltmodem-kv_YourVersion.rpm
+
+Support is effective at least into  2.6.11-1.14_FC3.       
+PCMCIA ltmodem support is still being  ported from 2.4.n to 2.6.n, as of May 2005
+        
+ http://dag.wieers.com/packages/kernel-module-ltmodem/ for some 2.4.n installers     
+ SuSE/Novell has some ltmodem installers at their repositories and newer install CDs.
+ More related output is below.
+END
+
+          cat<<EOF>>$RECORD2
+
+    VENDOR $MODEM_VENDOR         DEVICE $MODEM_DEVICE
+   ------------------------------------------
+    LUCENT 0x11c1          0x0440-0x045c
+    XIRCOM 0x115d          0x0000-0x000F
+    XIRCOM 0x115d          0x0440-0x045c
+    XIRCOM 0x115d          0x0010-0x03ff
+  -------------------------------------------
+ Driver installer and and their predecessor driver compiler kits are available through:
+       http://ltmodem.heby.de/  and  http://linmodems.technion.ac.il/packages/ltmodem/
+
+EOF
+        else
+          cat<<END > $TMPM
+
+ While ISA and PCMCIA card modems would not be detected,
+ if the modem is a PCI type it will not be served by these
+ drivers for Lucent/Agere digital signal processor modems.
+
+END
+          PCI_ID=
+        cat $TMPM
+        cat $TMPM >>$RECORD
+        fi
+      fi
+     done
+    fi # end Lucent DSP section
+    ## begin LUCENT
+    if [ -z "$IDENT" ] || [ "$IDENT" = "AGR" ] || [ "$IDENT" = "AGERE" ] || [ -n "$DSP" ] && ! [ "$ALSA" = "snd-atiixp-modem" ] && [ -z "$ADONE" ] ; then
+      ADONE=1
+      if [ "$v" = "11c1" ] || [ "$CODEC" = "SIL27" ] || [ -n "$AGR" ] && ! [ "$SMART" = "only" ]  ; then
+         cat<<END>>$RECORD
+
+ Vendor 11c1 corresponds to Lucent Technologies or subsidiary Agere Systems, Inc.
+ Information is at:  http://www.agere.com/client/modem_dsp.html. Produced are both:
+   1) modems identifiable from their primary PCI IDs and 
+   2) soft modem Subystem chips requiring identification through codec readouts.
+END
+        fi
+       if  [ "$CODECp" = "SIL27" ] || [ -n "$AGR" ] ; then
+         Smart=AGR
+          cat<<END>>$RECORD
+ AgereSoftModem drivers only support AC97 or MC97 modem controllers with codecs charcterized by one of:
+   SIL_id = 39 
+   mc97 codec is SIL27 
+   0x27 , as output by modem diagnostics under Microsoft Windows
+ If uncertain, identity the softmodem codec through tests described in Modem/SoftModem.txt
+ Support is currently ONLY for 2.4.n kernels and the following modem controllers:
+   8086:(2416 2426 2446 7196 2486 24C6)  , with 8086 == Intel
+   1039:7013  SIS
+   1106:3068  VIA
+ Access the soft modem software through code sponsor IBM at:
+   http://www-3.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-52698
+ The SmartLink slmodem-2.9.9 may serve for modems not served by this AgereSystems software.
+ If may be necessary to add -DMODVERSIONS to the compile flags, 
+ depending on whether your kernel was thus compiled. See
+ http://linmodems.technion.ac.il/archive-fourth/msg01408.html
+
+END
+        elif [ "$Device" = "0462" ] ; then
+          cat<<END>>$RECORD
+
+ 56K.V90/ADSL Wildfire Modem with PCI_ID 11c1:0462
+   http://www.lucent.com/press/0598/980505.mea.html
+ currently lacks support under Linux.
+
+END
+        elif [ "$Device" = "048c" ] || [ "$Device" = "048e" ] || \
+        [ "$Device" = "048f" ] ||  [ "$Device" = "0600" ] ; then
+         smart=
+        SMART=
+         cat<<END>>$RECORD
+
+  Class 0703:  $v:$Device is still NOT supported under Linux, as of $UPDATE
+  It is a "software" modem without a digital signal processing (DSP) chipset.
+  The ltmodem drivers from http://ltmodem.heby.de resources for DSP modems do NOT provide support,
+    A dialout terminates with "No Carrier" or a Hang if usage of the ltmodem drivers is attempted.
+
+END
+        elif  [ "$Device" = "0480" ] ; then
+          echo " The Venus controller chipset 1673JV7 modems use the serial.o driver." >>$RECORD
+        elif test -n "$DSP" ; then
+          echo " Call waiting specified by, +pcw=1, is not implmented in the ltmodem drivers." >>$RECORD
+         echo  Configuration with forcing is described in:   http://linmodems.technion.ac.il/archive-fifth/msg00055.html >> $RECORD
+# Setting up board.info for grepping MODEL_DATA
+          cat<<END > $TMPM.2
+ 0x0440 -- Mars 2 - data/fax/voice
+ 0x0441 -- Mars 2 - data/fax only
+ 0x0442 -- Mars 2 - data/fax/tam only
+ 0x0448 -- Mars 2 Global Board - data/fax/voice
+ 0x0449 -- Mars 2 Global Board - data/fax only
+ 0x044a -- Mars 2 Global Board - data/fax/tam only
+ 0x0444 -- Apollo 2 data/fax only : Modem/LAN combo board Apollo behind an Intel 82559
+ 0x0445 -- Apollo 2 Global Board data/fax only : Modem/LAN combo board Apollo behind an Intel 82559
+ 0x0446 -- Apollo 2 data/fax/voice : Modem/LAN combo board Apollo behind an Intel 82559
+ 0x0447 -- Apollo 2 Global Board data/fax/voice : Modem/LAN combo board Apollo behind an Intel 82559
+ 0x044c -- Mars 3 Perseus data/fax only:North America and Global board
+ 0x044e -- Mars 3 Mercury data fax only
+ 0x0450 -- Mars 3 Mercury data fax Global board
+ 0x0451 -- Mars 3 Mercury data/fax/voice
+ 0x0452 -- Mars 3 Mercury data/fax/voice Global board
+ 0x0455 -- Mars 3 Perseus data/fax/voice: North America and Global board
+ 0x0458 -- Mars 3 Mercury data/fax/tam only.
+ 0x0459 -- Mars 3 Mercury data/fax/tam only. Global board.
+ 0x045a -- Mars 3 Perseus data/fax/tam only.: North America and Global board
+ 0x045b -- Apollo 3 Perseus data/fax only : Modem/LAN combo board Apollo behind an Intel 82559
+ 0x045c -- Apollo 3 Mercury data/fax only : Modem/LAN combo board Apollo behind an Intel 82559
+ 0x045d -- Mars 3 Mercury data/fax/tam only. Global board for Cardbus modem product.
+ 0x044c -- Mars 3.2 Mercury data fax only when no eeprom is present, North America DAA
+##############
+END
+          if grep $MODEM_DEVICE $TMPM.2 > /dev/null ; then
+            grep $MODEM_DEVICE $TMPM.2   >>$RECORD
+          fi
+         if [ "$MAJOR" = "2.6"  ] ; then
+            if [ "$SYS" = "2.6.3-4mdk" ] ; then
+              cat<<END>>$RECORD
+
+ There are ltmodem packages in Mandrake. Search for ltmodem in the package lists
+ and check for installation already with:
+       rpm -qa ltmodem
+ There is also a ltmodem-2.6.3-4mdk.tgz at
+    at http://linmodems.technion.ac.il/packages/ltmodem/kernel-2.6  
+
+END
+            fi
+           if [ "$KVER" = "2.6.8.1" ] ; then
+             cat<<END>>$RECORD
+
+ Drivers compiled with ltmodem-2.6-alk-6.tar.bz2 have been effective with Mandrake 10
+ kernel versions $KVER-* . See within http://linmodems.technion.ac.il/packages/ltmodem/
+ ltmodem-2.6.8.1-10mdk.tar.gz  
+  
+END
+           fi
+          fi
+          if [ "$DISTR" = "SuSE" ] ; then
+            cat<<END>>$RECORD
+
+  SuSE has a ltmodem packages for with pre-compiled drivers, beginning with the 8 releases 
+  For the SuSE 9.1 release, there is an update improving bootup automation. 
+  A failure had been reported for the 9.3 release ltmodem package, 
+  but the ltmodem-2.6-7-alk-7.tar.bz2  resource gave effective drivers.
+
+END
+          fi
+          if [ "$Device" = "0442" ] ; then
+    echo "The device=$Device  modems have an electro-optical coupling" >>$RECORD
+    echo "which in some hardware is Not adequately supported by these drivers." >>$RECORD
+    echo >>$RECORD
+          fi
+       fi #DSP  
+    fi # IDENT2
+      
+    if [ "$v" = "115d" ]  || [ "$PCIDEV" = "11c1:0420" ] ; then
+      cat<<END>>$RECORD
+
+ Vendor=115d corresponds to Xircom, now an Intel subsidiary.
+   http://www.intel.com/support/peripherals/xc/modems/index.htm
+   http://appsr.intel.com/scripts-df/support_intel2.asp
+   http://support.intel.com/
+                          Device ID Range
+                            -------------
+    XIRCOM 0x115d          0x0000-0x000F
+    XIRCOM 0x115d          0x0440-0x045c
+    XIRCOM 0x115d          0x0010-0x03ff
+   --------------------------------------
+ are supported by the resources at http://ltmodem.heby.de/
+
+ Some other Xircom modems and Lucent 11c1:0420 modems
+    MAY BE accessed by Insertion Options
+ Download from http://ltmodem.heby.de/  the:   ltmodem-$LT_VERSION.tar.gz
+ Open with:    tar zxvf  ltmodem-$LT_VERSION.tar.gz
+ Within the ltmodem/DOCs/  folder read the Insertion-param files
+ and for fun, the history:   andreas.txt
+
+ To get a recommendation for an Installer kit, run
+    $0  kit
+
+END
+      if test -z "$DSP" ; then
+        echo " The ltmodem drivers do NOT support this modem.">>$RECORD
+      fi
+    fi # Xircom
+
+    if [ -z "$ALT" ] ; then
+    # SmartLink section
+      ALT=1
+      
+       if [ "$Smart" = "ALSA" ] ; then
+                cat<<END>>$RECORD
+
+ Under the controller $CNTRL,
+ with modem subSystem $SUBSYS 
+ Only ALSA mode usage of slmodem-2.9.n  code may provide support.
+END
+       fi
+
+       if  [ -n "$Smart" ] && ! [ "$Vendor" = "163c" ] && [ -n "$CNTRL" ] && ! [ "$IDENT" = "ATI" ] && ! [ "$Smart" = "ALSA" ] ; then
+
+          cat<<END>>$RECORD
+
+ Under the controller $CNTRL,
+ with modem subSystem $SUBSYS     
+ Alternative supporting packages are the SmartLink slmodem-2.9.n using its proprietary slamr driver, 
+ or dependent on  $CNTRL, an  Open Source driver from the  ALSA package.
+ See Modem/Slmodem-ALSA.txt for details.
+  
+ For SuSE 9.2 users, there is an update  for driver slamr.ko loading during bootup. 
+ To find it easily, search for "slamr" within  http://www.novell.com/linux/download/updates/92_i386.html
+     
+END
+       fi
+    fi #ALT
+
+    if [ -z "$SMDONE"  ] && [ -z "$DSP" ] && ! [ "$PCIDEV" = "8086:1040" ] ; then
+      echo "163c 2000 2003 2004" > $TMPM
+      # make all KERNEL_VER=2.6.0-test7  , due to lack of  kernel-headers
+      if grep $v $TMPM>/dev/null || [ -n "$smart" ] || [ -n "$SMART" ] || [ "$IDENT" = "SMART" ] && [ -z "$CXT" ] && ! [ "$IDENT" = "ATI" ] ; then
+        cat<<END>>$RECORD
+
+ SmartLink at http://www.smlink.com/ owns vendor IDs 163c, 2000, 2003, and 2004
+ The official download site is:  http://www.smlink.com/main/index1.php?ln=en&main_id=40 ,
+  but http://linmodems.technion.ac.il/packages/smartlink/ has older packages and new fixes.
+      For the emerging 2.6.10 kernels, use the slmodem-2.9.9d.tar.gz  therefrom.
+      Also DO download the ungrab-winmodem.tar.gz
+ For details read Slmodem.txt,  Slmodem-ALSA.txt  and 
+    http://linmodems.technion.ac.il/slmodem-serial.html
+   
+END
+      # a HowTo http://www.raspberry.co.za/michael/slmodem.html
+        SMART=
+        smart=
+      fi
+      SMDONE=1
+    fi
+    done
+    # with Vendor and SUBven
+    echo  >>$RECORD  
+
+if [ -n "$DSP" ] ; then
+  # || [ "$1" = "kit" ] ||
+  if ! [ "$DISTR" = "Not_identified" ] ; then
+    # No use if the distribution is not known
+    if [ "$DISTR" = "slackware" ] ; then
+      echo Installers are not available for Slackware Linux  >>$RECORD
+    fi
+    if [ "$DISTR" = "gentoo" ] ; then
+      cat<<END>>$RECORD
+
+ LTmodem packages are within the Gentoo package system, so you can just run "emerge ltmodem".
+  This will download the source, configure, compile, and install the driver modules.
+
+END
+    fi
+    # DISTR=mandrake
+    # echo DISTR=$DISTR
+    # pick out the Distro section
+    echo >  $TMPM
+    if [ "$DISTR" = "conectiva" ] ; then
+      if ! [ "$GCCmajor" = "3" ] ; then
+        cat<<EOF>$TMPM
+
+ltmodem-kv_2.4.18_586-6.28a8-1.i386.rpm
+ltmodem-kv_2.4.19_1U80_13cl-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.19_1U80_2cl-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.19_1U80_5cl-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.19_1U80_8cl-8.26a9-1.i386.rpm
+
+EOF
+
+      else
+        cat<<EOF>$TMPM
+
+ltmodem-kv_2.4.21_28872cl-8.26a9-1.i386.rpm
+
+EOF
+      fi
+    fi
+    if [ "$DISTR" = "debian" ] ; then
+      cat<<END>>$RECORD
+
+ Add either of the following lines to the Debian  /etc/apt/sources.list
+ to enable automatic updates on installer availability:
+   deb http://www.physcip.uni-stuttgart.de/heby/ltmodem/dists/debian/ ./
+   deb http://www.sfu.ca/~cth/ltmodem/dists/debian/ ./
+
+END
+      if ! [ "$GCCmajor" = "3" ] ; then
+        cat<<EOF > $TMPM
+ltmodem-2.2.20-compact_6.00c2_i386.deb
+ltmodem-2.2.20-idepci_6.00c2_i386.deb
+ltmodem-2.2.20-reiserfs_6.00c_i386.deb
+ltmodem-2.2.20_6.00c2_i386.deb
+ltmodem-2.2.21-compact_6.00c2_i386.deb
+ltmodem-2.2.21-idepci_6.00c2_i386.deb
+ltmodem-2.2.22_6.00c_i386.deb
+ltmodem-2.2.22-compact_6.00c_i386.deb
+ltmodem-2.2.22-idepci_6.00c_i386.deb
+ltmodem-2.2.25_6.00c_i386.deb
+ltmodem-2.2.25-compact_6.00c_i386.deb
+ltmodem-2.2.25-idepci_6.00c_i386.deb
+
+ltmodem-2.4.17-386_8.00a3_i386.deb
+ltmodem-2.4.17-586tsc_8.00a3_i386.deb
+ltmodem-2.4.17-686-smp_8.00a3_i386.deb
+ltmodem-2.4.17-686_8.00a3_i386.deb
+ltmodem-2.4.17-bf2.4_8.00a3_i386.deb
+ltmodem-2.4.17-k6_8.00a3_i386.deb
+ltmodem-2.4.17-k7_8.00a3_i386.deb
+ltmodem-2.4.17_8.00a3_i386.deb
+ltmodem-2.4.18-386_8.00a3_i386.deb
+ltmodem-2.4.18-586tsc_8.00a3_i386.deb
+ltmodem-2.4.18-686-smp_8.00a3_i386.deb
+ltmodem-2.4.18-686_8.00a3_i386.deb
+ltmodem-2.4.18-bf2.4_8.00a3_i386.deb
+ltmodem-2.4.18-k6_8.00a3_i386.deb
+ltmodem-2.4.18-k7_8.00a3_i386.deb
+ltmodem-2.4.18_8.00a3_i386.deb
+
+ltmodem-2.4.19-386_8.26a9_i386.deb
+ltmodem-2.4.19-586tsc_8.26a9_i386.deb
+ltmodem-2.4.19-686-smp_8.26a9_i386.deb
+ltmodem-2.4.19-686_8.26a9_i386.deb
+ltmodem-2.4.19-k6_8.26a9_i386.deb
+ltmodem-2.4.19-k7_8.26a9_i386.deb
+ltmodem-2.4.19-k7-smp_8.26a9_i386.deb
+ltmodem-2.4.19_8.26a9_i386.deb
+
+ltmodem-2.4.20_8.26a9_i386.deb
+ltmodem-2.4.20-speakup_8.26a9_i386.deb
+ltmodem-2.4.20-1-386_8.26a9_i386.deb 
+ltmodem-2.4.20-1-586tsc_8.26a9_i386.deb
+ltmodem-2.4.20-1-686_8.26a9_i386.deb  
+ltmodem-2.4.20-1-k6_8.26a9_i386.deb
+ltmodem-2.4.20-1-k7_8.26a9_i386.deb 
+ltmodem-2.4.20-1-k7-smp_8.26a9_i386.deb
+
+ltmodem-2.4.18-k7_8.26a9_i386.deb
+
+EOF
+      else
+      cat<<EOF>$TMPM
+
+ltmodem-2.4.21-5-386_8.26a9_i386.deb
+ltmodem-2.4.21-5-586tsc_8.26a9_i386.deb
+ltmodem-2.4.21-5-686_8.26a9_i386.deb
+ltmodem-2.4.21-5-686-smp_8.26a9_i386.deb
+ltmodem-2.4.21-5-k6_8.26a9_i386.deb
+ltmodem-2.4.21-5-k7-smp_8.26a9_i386.deb
+ltmodem-2.4.21-5-k7_8.26a9_i386.deb
+ltmodem-2.4.21-5_8.26a9_i386.deb
+
+ltmodem-2.4.22-1-386_8.26a9_i386.deb
+ltmodem-2.4.22-1-586tsc_8.26a9_i386.deb
+ltmodem-2.4.22-1-686_8.26a9_i386.deb
+ltmodem-2.4.22-1-686-smp_8.26a9_i386.deb
+ltmodem-2.4.22-1-k6_8.26a9_i386.deb
+ltmodem-2.4.22-1-k7-smp_8.26a9_i386.deb
+ltmodem-2.4.22-1-k7_8.26a9_i386.deb
+ltmodem-2.4.22-speakup_8.26a9_i386.deb
+ltmodem-2.4.22-1-386_8.31a3_i386.deb
+ltmodem-2.4.22-1-586tsc_8.31a3_i386.deb
+ltmodem-2.4.22-1-686_8.31a3_i386.deb
+ltmodem-2.4.22-1-686-smp_8.31a3_i386.deb
+ltmodem-2.4.22-1-k6_8.31a3_i386.deb
+ltmodem-2.4.22-1-k7-smp_8.31a3_i386.deb
+ltmodem-2.4.22-1-k7_8.31a3_i386.deb
+ltmodem-2.4.22-speakup_8.31a3_i386.deb
+
+ltmodem-2.4.25-1-686_8.30a3_i386.deb
+ltmodem-2.4.25-586tsc_8.30a3_i386.deb
+ltmodem-2.4.25-686-smp_8.30a3_i386.deb
+ltmodem-2.4.25-k6_8.30a3_i386.deb
+ltmodem-2.4.25-k7-smp_8.30a3_i386.deb
+ltmodem-2.4.25-k7_8.30a3_i386.deb
+
+ltmodem-2.4.26-1_8.31a3_i386.deb
+ltmodem-2.4.26-1-386_8.31a3_i386.deb
+ltmodem-2.4.26-1-586tsc_8.31a3_i386.deb
+ltmodem-2.4.26-1-686-smp_8.31a3_i386.deb
+ltmodem-2.4.26-1-686_8.31a3_i386.deb
+ltmodem-2.4.26-1-k6_8.31a3_i386.deb
+ltmodem-2.4.26-1-k7-smp_8.31a3_i386.deb
+ltmodem-2.4.26-1-k7_8.31a3_i386.deb
+ltmodem-2.4.26-speakup_8.31a3_i386.deb
+
+ltmodem-2.6.8-1-686_8.31a8_1.i686.deb
+EOF
+      fi
+    fi
+    if [ "$DISTR" = "mandrake" ] ; then
+      if ! [ "$GCCmajor" = "3" ] ; then
+        cat<<EOF > $TMPM
+
+ Only installers compiled with gcc = 3.n are stored at http://ltmodem.heby.de
+ Older packages are at  http://linmodems.technion.ac.il/
+
+EOF
+      else
+        cat<<EOF> $TMPM
+
+ltmodem-kv_2.4.21_0.11mdk-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.21_0.13mdk-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.21_0.13mdk-8.30a3-1.i586.rpm
+ltmodem-kv_2.4.21_0.18mdk-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.21_0.25mdk-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.21_0.25mdk-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.21_0.26mdk-8.26a9-1.i586.rpm
+
+ltmodem-kv_2.4.22_10mdk-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.22_21mdk-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.22_26mdk-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.22_28mdk-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.22_29mdk-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.22_30mdk-8.26a9-1.i586.rpm
+
+ltmodem-kv_2.4.22_32mdk-8.30a3-1.i686.rpm
+ltmodem-kv_2.4.22_36mdk-8.30a3-1.i686.rpm
+ltmodem-kv_2.4.25_6mdk-8.30a3-1.i686.rpm
+ltmodem-kv_2.4.25_7mdk-8.30a3-1.i686.rpm
+
+EOF
+      fi
+    fi
+
+    if [ "$DISTR" = "redhat" ] ; then
+            echo " Many installers for RedHat are available at  http://dag.wieers.com/packages/kernel-module-ltmodem ">>$RECORD
+      if [ -n "$FEDORA" ] ; then
+        cat<<EOF>$TMPM
+
+ltmodem-kv_2.4.22_1.2115.nptl-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.22_1.2115.nptl-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.22_1.2129.nptl-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.22_1.2129.nptl-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.22_1.2135.nptl-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.22_1.2138.nptl-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.22_1.2138.nptl-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.22_1.2140.nptl-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.22_1.2140.nptl-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.22_1.2166.nptl-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.22_1.2174.nptl-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.22_1.2174.nptl-8.30a1-1.i686.rpm
+ltmodem-kv_2.4.22_1.2174.nptl-8.30a1-1.i686.rpm
+ltmodem-kv_2.4.22_1.2197.nptl-8.31a5-1.i686.rpm
+ltmodem-kv_2.6.6_1.427-8.31a7-1.i686.rpm
+ltmodem-kv_2.6.6_1.435-8.31a7-1.i686.rpm
+ltmodem-kv_2.6.7_1.494.2.2-8.31a8-1.i686.rpm
+ltmodem-kv_2.6.8_1.521-8.31a8-1.i686.rpm
+
+EOF
+      else
+        cat<<EOF>$TMPM
+
+ltmodem-kv_2.4.20_2.2-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.20_2.2-8.26a9-1.i486.rpm
+ltmodem-kv_2.4.20_2.2-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.20_2.2-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.20_6-8.26a9-1.athlon.rpm
+ltmodem-kv_2.4.20_8-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.20_8-8.26a9-1.i486.rpm
+ltmodem-kv_2.4.20_8-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.20_8-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.20_9-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.20_9-8.26a9-1.i486.rpm
+ltmodem-kv_2.4.20_9-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.20_9-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.20_13.8-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.20_13.9-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.20_13.9-8.26a9-1.i486.rpm
+ltmodem-kv_2.4.20_13.9-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.20_13.9-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.20_18.9-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.20_18.9-8.26a9-1.i486.rpm
+ltmodem-kv_2.4.20_18.9-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.20_18.9-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.20_19.9-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.20_19.9-8.26a9-1.i486.rpm
+ltmodem-kv_2.4.20_19.9-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.20_19.9-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.20_20.7-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.20_20.8-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.20_20.8-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.20_20.9-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.20_20.9-8.26a9-1.i486.rpm
+ltmodem-kv_2.4.20_20.9-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.20_20.9-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.20_24.7-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.20_24.8-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.20_24.9-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.20_24.9-8.26a9-1.i486.rpm
+ltmodem-kv_2.4.20_24.9-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.20_24.9-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.20_27.9-8.26a9-1.athlon.rpm
+ltmodem-kv_2.4.20_27.9-8.26a9-1.i386.rpm
+ltmodem-kv_2.4.20_27.9-8.26a9-1.i486.rpm
+ltmodem-kv_2.4.20_27.9-8.26a9-1.i586.rpm
+ltmodem-kv_2.4.20_27.9-8.26a9-1.i686.rpm
+ltmodem-kv_2.4.20_30.9-8.26a9-1.i686.rpm
+
+ltmodem-kv_2.4.21_4.EL-8.30a1-1.athlon.rpm
+ltmodem-kv_2.4.21_4.EL-8.30a1-1.i686.rpm
+
+EOF
+      fi
+    fi
+
+    if [ "$DISTR" = "SuSE" ] ; then
+      cat<<END>$TMPM
+ltmodem-kv_2.4.20_4GB-8.26a9-1.i386.rpm,  SuSE 8.2
+
+END
+
+    fi
+
+################### Listing from http://ltmodem.heby.de/ ends
+
+    fi #  Done choosing DISTR block
+    echo >>$RECORD
+    echo "  The desired installer name is like:" >>$RECORD
+    echo "========================================"  >>$RECORD
+    # echo Checking for suitable ltmodem Installers
+    if [ "$DISTR" = "debian" ] ; then
+      echo ltmodem-"$FILTER""8.nn"_i386.deb >>$RECORD
+      # FILTER=2.4.18-6_
+      if grep $FILTER $TMPM > /dev/null ; then
+        grep $FILTER $TMPM > $TMPM.1
+        BEST=$TMPM.1
+      fi
+    else
+      # conectiva mandrake redhat SuSE, fedora  all .rpm
+      if [ "$DISTR" = "mandrake" ] || [ "$DISTR" = "redhat" ] ; then
+        echo ltmodem-kv-$PVER-$LT_VERSION-1.$CPU.rpm >>$RECORD
+       # http://linmodems.technion.ac.il/archive-fourth/msg03230.html Marv
+      fi
+      if [ "$DISTR" = "conectiva" ] || [ "$DISTR" = "SuSE" ] ; then
+        echo "ltmodem-kv-$PVER-$LT_VERSION-i386.rpm" >>$RECORD
+      fi
+      grep $PVER $TMPM  > $TMPM.2
+      grep $CPU $TMPM.2 >  $TMPM.1
+      if grep "ltmodem-" $TMPM.1 >/dev/null ; then
+        BEST=$TMPM.1
+      elif grep "ltmodem-" $TMPM.2 >/dev/null ; then
+        BEST=$TMPM.2
+      else
+        BEST=
+      fi
+    fi
+    # AGERES=`echo $LT_VERSION | cut -da -f1`
+    AGERES=8.nn
+    cat<<END>>$RECORD
+----------------------------------------
+ ltmodem-kv-Kernel_FL-LTver--.CPU.rpm   explains the versioning.
+ For your System
+            `echo Kernel_FL is  $SYS , the full kernel version displayed by:  uname -r`
+                      `echo LTver is $LT_VERSION, the release of the compiler kit`
+                               `echo $AGERES is the Agere core code designation.`
+       The proccesor type or CPU is:  $CPU      dispayed by:  uname -m
+ used in compiling and assembling driver packages.
+
+END
+
+    # Results
+    if [ "$DISTR" = "redhat" ] && [ -n "$FEDORA" ] ; then
+      DISTR=fedora
+      echo " For usage with the udev file system of fedora core 3, see  http://linmodems.technion.ac.il/archive-fifth/msg01177.html">>$RECORD
+      # changed back to redhat after this message section
+    fi
+    if [ "$SYS" = "2.6.8.1-12mdk" ]  ||  [ "$SYS" = "2.6.8.1-10mdk" ]  &&  [ "$DISTR" = "mandrake" ]  ; then
+     cat<END >> $RECORD
+     
+ At  http://linmodems.technion.ac.li/packages/ltmodem/kernel-2.6/
+ there is an installer  ltmodem-"$SYS".tar.gz
+ Unpack under Linux with: 
+     tar zxvf ltmodem-2.6.8.1-12mdk.tar.gz
+
+END
+    elif [ "$BEST" = "$TMPM.1" ] ; then
+        cat<<END > $TMPM.3
+  A suitable Installer is at    http://ltmodem.heby.de/
+    in the section:    $DISTR
+       `cat $BEST`
+
+END
+    cat $TMPM.3 >>$RECORD
+    cat $TMPM.3
+    elif [ "$BEST" = "$TMPM.2" ] ; then
+        cat<<END > $TMPM.3
+ Installers that may suffice are at http://ltmodem.heby.de/
+ in the section:       $DISTR
+------------------------------------------------------
+ `cat $BEST`
+------------------------------------------------------
+ The closest match to your   $CPU=CPU   is recommended.
+ For example replacements in order of preference for an
+    i686 would be i586, i486 and i386
+ The Kernel_FLavor section MUST match.
+ If not the ltmodem-$LT_VERSION.tar.gz compiler MUST BE USED.
+
+END
+    cat $TMPM.3 >>$RECORD
+    cat $TMPM.3
+    else
+     echo >/dev/null
+      cat<<END>>$RECORD
+      
+ A suitable installer is not available as of this $UPDATE update.
+ Check in the section $DISTR at  http://ltmodem.heby.de/
+   for a subsequent Installer submission.
+ Older releases have been archived at:
+   http://linmodems.technion.ac.il/packages/ltmodem/archive/
+ Also there is a RPM search engine at:   http://rpm.pbone.net
+ The closest match to your   $CPU=CPU   is recommended.
+   The closest match to your   $CPU=CPU   is recommended.
+   For example replacements in order of preference for an
+     i686 would be i586, i486 and i386
+ If not present use the  ltmodem-$LT_VERSION.tar.gz compiler kit.
+
+ The list of available Installers for $DISTR as of this $UPDATE
+ is inserted into to $RECORD2
+END
+# RC2
+      cat<<END>>$RECORD2
+
+GCCmajor=$GCCmajor
+-----------Installer list for $DISTR --------
+`cat $TMPM`
+------- end Installer List ------------------
+END
+    fi
+  fi # DISTR not recognized
+  if [ "$DISTR" = "fedora" ] ; then
+    DISTR=redhat
+  # changed back to redhat after above message section
+  fi
+  if grep smp $TMPM >/dev/null ; then
+########### RC2
+cat<<END>/dev/null
+
+   Symmetric Multi Processors (SMP) issues
+----------------------------------------------------------------------------------
+  Beginning with the Agere version 8.00 core code, the ltmodem drivers are
+  functional on Systems with SMP kernels such as your kernel-$SYS ,
+  so far as supporting dialout and initiation of ppp.
+  However these dialout sessions  inevitable stall,
+  evidently because of inadequate interrupt handling by the core ltmodem code.
+  This problem can be bypassed with some loss of performance by
+  using the bootup option: noacpi
+
+  The November 2004  AgereSystems 8.30 release is SMP proficient.
+
+END
+############
+
+fi # DSP
+  done
+ #  TESTS
+echo "  ======= PCI_ID checking completed ====== ">>$RECORD
+## RC2
+cat<<END>>$RECORD2
+
+ If the Primary and Subsystem Vendor information was not adeqaute,
+ it may be useful to search at  http://www.pcidatabase.com/
+
+END
+
+# Just to be sure the Update is reported:
+echo " Update=$UPDATE">>$RECORD
+
+# echo Scanning for a PCI bridge to a CardBus with:  "$LSPCI 2>/dev/null  | grep CardBus"
+echo ---------------------------------------- > $TMPM
+$LSPCI 2>/dev/null  | grep -E CardBus | cut -d' ' -f1 >$TMPM.1
+if grep 0000: $TMPM.1 >/dev/null; then
+  CARDBUS=`cat $TMPM.1 | cut -d: -f2-`
+else
+  CARDBUS=`cat $TMPM.1`
+fi
+
+if test -z "$CARDBUS" ; then
+   echo A PCMCIA CardBus is not detected on this System. >> $RECORD
+else
+    port=0
+    for i in $CARDBUS ; do
+       echo  >> $RECORD
+        echo Analyzing information for PCMCIA device at PCI Bus $i >> $RECORD
+        $LSPCI -s $i -v 2>/dev/null >> $TMPM
+        echo "GREPping for an inserted PCMCIA modem with filter:        ommunication"  >> $RECORD
+        MODEM=`$LSPCI -v 2>/dev/null | grep ommunication`
+        if test -n "$MODEM" ; then
+            port=1
+        fi
+    done
+    if test $port -gt 0 ; then
+      echo " A PCMCIA modem is detected." | tee -a $RECORD
+      cat<<END>>$RECORD
+      
+ The stardard ltmodem resources should suffice for modem support:
+     http://ltmodem.heby.de/
+ if the modem has a Lucent/Agere digital processing chipset.
+END
+    else
+       cat<<END>>$RECORD
+ If a PCMCIA modem is currently inserted and the sockets activated by
+    /etc/init.d/pcmcia start
+ then the PCMCIA bridge is NOT transparent.
+
+ If the modem is known to have a Lucent digital signal processing chipset,
+ then PCMCIA.tar.gz variant assembled by Joern Wustenfeld is necessary,
+ rather than the standard ltmodem-$LT_VERSION.tar.gz at  http://ltmodem.heby.de/
+END
+     fi
+     echo
+fi
+
+# gcc problem
+if [ "$GCCmajor" = "3" ] ; then
+  echo GCCversion=$GCC >>$RECORD
+#########
+  cat<<END>>$RECORD2
+
+ ---------------------------------------------------------------------------------------------
+ The proprietary Binary component of the some current winmodem drivers were compiled with
+ version 2.9n gcc compiler.  Red Hat 8.0 and Mandrake 9.0 releases utilize
+ version 3.nn gcc compilers.  This currently is causing difficulties either
+ in compiling and/or insertion of updated winmodem drivers.
+
+ The gcc compiler version of this System is:   $GCC
+ It will likely be necessary to force (-f) insertion of winmodem drivers, with credit to
+ Jos Vos: http://phep2.technion.ac.il/linmodems/archive/msg04510.html
+
+ For the ltmodem drivers with proprietary binary provided by Agere Systems,
+ compiling with versions gcc=3.nn is successful.
+ A minor edit required to compile PCTEL drivers has also been reported:
+     http://phep2.technion.ac.il/linmodems/archive/msg04684.html
+
+  Simple driver insertion fails in these cases with a message like:
+----begin error----
+% insmod lt_modem
+Using /lib/modules/2.4.18-14/ltmodem/lt_modem.o
+/lib/modules/2.4.18-14/ltmodem/lt_modem.o: The module you are trying to
+load (/lib/modules/2.4.18-14/ltmodem/lt_modem.o) is compiled with a gcc
+version 2 compiler, while the kernel you are running is compiled with
+a gcc version 3 compiler. This is known to not work.
+-----end error-----
+
+ It is necessary as Root to force (-f) loading with commands like:
+     insmod -f pctel
+
+ respecting the dependency ordering of the drivers.
+ Then check for insertion with:
+    lsmod
+
+ If driver insertion is successful, the forcing can be automated
+ by putting the lines (credit to Bhaskaran Raman)  like the following,
+    install pctel  /sbin/insmod --force pctel
+
+ In order of preference depending on your particular Linux installation.
+ Put these lines into ONLY ONE of the following files,
+ within any modem loading subsection if present:
+    /etc/modutils/ltmodem
+    /etc/modutils/aliases
+    /etc/modules.conf
+
+ Then inform your System of the edit for Debian like Systems with
+    update-modules
+ which rewrites and reads /etc/modules.conf . For other System types
+    depmod -a
+ re-reads the edited      /etc/modules.conf .
+
+ Thereafter module loading should behave as previously.
+ For the ltmodem drivers loading,
+ it should suffice to either start a ppp session or
+    modprobe ptserial
+
+END
+###############
+fi
+
+if test -d /etc/udev ; then
+   cat<<END>>$RECORD
+   
+For information on modem port creation under the UDEV device file system see:
+   http://linmodems.technion.ac.il/archive-fourth/msg03299.html  for Conexnant modems
+   http://linmodems.technion.ac.il/archive-fifth/msg01177.html  for Lucent/Agere DSP modems
+   
+END
+
+fi
+
+# A general Advisory
+ETHER=`$LSPCI 2>/dev/null  | grep Ether | cut -d' ' -f1`
+if test -n "$ETHER" ; then
+  #RC2
+  cat<<END>>$RECORD2
+
+  -----------------------------------------------------
+  The System has Ethernet capability. If not expert, 
+  shut down ethernet before initiated modem usage with:
+  # ifconfig eth0 down
+
+END
+  #RC2
+  $LSPCI -s $ETHER -v 2>/dev/null >>$RECORD2
+  echo >>$RECORD2
+fi
+if [ "$MAJOR" = "2.6" ] ; then
+  MODCONF=/etc/modprobe.*
+else
+  MODCONF=/etc/modules.conf
+fi
+############
+
+  cat<<END >>$RECORD
+The following information blocks just query some ppp support items.
+
+====================================================
+   grep -rs ppp $MODCONF
+-------------------------------------
+`grep -rs ppp $MODCONF`
+-------------------------------------
+END
+# Check for unziped drivers
+if [ "$MAJOR" = "2.4" ] || [ "$MAJOR" = "2.2" ] ; then
+  SUF=o
+else
+  SUF=ko
+fi 
+Modules="bsd_comp. ppp_async. ppp_generic. slhc ppp_deflate. zlib_deflate."
+for i in $Modules
+do
+  find /lib/modules/ -name $i* 2>/dev/null  >> $TMPM
+  if ! grep $i $TMPM>/dev/null ; then
+    echo " PPP support module  $i$SUF  not found!">>$RECORD
+  fi
+done
+if grep "o.gz" $TMPM > /dev/null ; then
+  cat<<END>>$RECORD
+
+  The following ppp related modules should be unpacked by root with:
+# gunzip PathTo/ModuleName.$SUF.gz
+`cat $TMPM`
+
+ On most Systems, this will driven by installing the wvdial.rpm
+ and the package providing the KPPP graphical dialing interface.
+
+END
+else
+  echo " Resident PPP support modules are properly uncompressed .">>$RECORD
+fi
+if test -x /sbin/ifconfig ; then
+  if /sbin/ifconfig | grep Link | grep -v Loopback >/dev/null ; then
+    echo "----active COMM services are ------------">>$RECORD
+    /sbin/ifconfig | grep Link | grep -v Loopback >>$RECORD
+    echo "This COMM mode should be closed before using the modem, or DNS services may fail.">>$RECORD
+  else
+    echo " COMM services are not active">>$RECORD
+  fi
+fi
+
+if ! grep ppp $MODCONF >/dev/null ; then
+  echo
+  echo Be sure to read the section about ppp related modules and aliases in $RECORD2 >>$RECORD
+
+  cat<<END>>$RECORD2
+
+ Within /lib/modules/You_Kernel_Version/kernel/drivers/net/
+ at least the following modules needed for communication should be found
+   ppp_deflate.o
+   zlib_inflate.o 
+   zlib_deflate.o 
+   bsd_comp.o
+   ppp_async.o
+   ppp_generic.o
+   slhc.o
+ BUT they may be present instead as ModuleName.o.gz
+ If so unpack them with a commands like:
+   # gzip /lib/modules/You_Kernel_Version/kernel/drivers/net/ModuleName.o.gz
+ Alternatively, installing the dialer package KPPP may force their unpacking.
+ Following a dialout attempt, display loaded modules with:
+# /sbin/lsmod
+ If there are not displayed lines like:
+
+ppp_deflate             3512   1  (autoclean)
+zlib_inflate           18980   0  (autoclean) [ppp_deflate]
+zlib_deflate           18648   0  (autoclean) [ppp_deflate]
+bsd_comp                4440   0  (autoclean)
+ppp_async               7744   1  (autoclean)
+ppp_generic            16380   3  (autoclean) [ppp_deflate bsd_comp ppp_async]
+slhc                    5264   1  (autoclean) [ppp_generic
+
+addition of the following lines to $MODCONF or $MODCONF.d/ folders may be needed:
+
+### automate ppp modules loading ###
+alias /dev/ppp          ppp_generic
+alias char-major-108    ppp_generic
+alias tty-ldisc-3       ppp_async
+alias tty-ldisc-14      ppp_synctty
+alias ppp-compress-21   bsd_comp
+alias ppp-compress-24   ppp_deflate
+alias ppp-compress-26   ppp_deflate
+### end ppp block ####
+
+ After any edit of $MODCONF or $MODCONF.d/ folders ,
+ inform the System by logging into a console with
+ # su - root
+ and running the update command:
+ #  depmod -a
+ which re-reads /etc/modules.conf and parses all the modules dependencies.
+ Debian like Distros should instead use:
+   update-modules
+
+END
+fi
+# ethernet and isdn can hinder DNS acquisition
+if test -x /sbin/ifconfig ; then
+  /sbin/ifconfig | grep Link> $TMPM
+  #RC2
+    cat<<END>> $RECORD2
+
+  Attempted or effective networking links are displayed by command:
+  #  /sbin/ifconfig
+  A block with "lo" is an internal loopback test and harmless.
+  However, ethernet "eth0" can be problematic for PPP connections,
+  because of competition for DNS (domain name service).
+  The default is to use the DNS specified for etherenet and
+  without expert configuration, this will block browser naviagation through PPP.
+  ========== ifconfig test =============
+  `cat $TMPM`
+
+  If is wisest to disable bootup establishment of ethernet in your Control Center.
+  Depending on your Linux distribution,
+      one of the following Root commands way alternatively be effective:
+  # ifdown eth0
+  # ifconfig eth0 down
+  # /etc/init.d/network stop
+  # /etc/init.d/networking stop
+
+END
+  if  grep eth $TMPM>/dev/null ; then
+    echo " Be sure to read the Ethernet section of $RECORD2 " >>$RECORD
+  fi
+  if grep tap $TMPM>/dev/null ; then
+    echo ISDN function should be stopped before initiating modem usage>>$RECORD
+    echo >>$RECORD
+  fi   
+fi
+
+if test -e /dev/ppp ; then
+  DEVPPP=`ls -l /dev/ppp`
+  echo DEVPPP=$DEVPPP  >>$RECORD
+else
+  cat<<END>>$RECORD
+
+  A port needed for the PPP protocol is absent!!!
+  echo "  crw-------    1 root     root     108,   0 Dec 31  1969 /dev/ppp"
+
+END
+fi
+
+if test -e /dev/.devfsd ; then
+  DEVFS=active
+  echo DEVFS=$DEVFS >>$RECORD
+# Check for /dev/modem link
+elif [ -L /dev/modem ] ; then
+  MODEM=`ls -l /dev/modem | cut -d'>' -f2- | cut -d" " -f2-`
+  cat<<END>> $RECORD
+
+  The current modem symbolic link is: /dev/modem -> $MODEM
+  The ports /dev/ttyS0 or 1,2,3 are for standard Controller chip modems
+
+END
+else
+  echo A /dev/modem symbolic link is not present >>$RECORD
+fi
+
+if test -f /etc/devfsd.conf ; then
+  DEVFSD=/etc/devfsd.conf
+elif test -f /etc/devfs/devfsd.conf ; then
+  DEVFSD=/etc/devfs/devfsd.conf
+else
+  cat<<END>>$RECORD
+
+ No devfsd.conf file found, indicated absense of the devfsd daemon package
+ for device file system (devfs) symbolic link support.
+
+END
+fi
+echo DEVFSD=$DEVFSD>>$RECORD
+
+if ! [ "$DEVFSD" = "" ] ; then
+  DEVFSD_PPP=`grep PPP $DEVFSD` >>$RECORD
+  echo tts/0 > $TMPM
+  echo tts/1 >> $TMPM
+  echo tts/2 >> $TMPM
+  echo tts/3 >> $TMPM
+  echo
+  MODEM=`grep -f $TMPM $DEVFSD`
+  if test -z "$MODEM" ; then
+    if test -d /etc/devfs ; then
+      MODEM=`grep -rs modem /etc/devfs/ | grep -f $TMPM | grep :REGISTER`
+    fi
+  fi
+  if test -n "$MODEM" ; then
+    FILE=`grep -rs modem /etc/devfs/ | grep -f $TMPM | grep :REGISTER | cut -d: -f1`
+#    echo $FILE
+    cat<<EOF>>$RECORD
+
+ Supporting /dev/modem symbolic link:
+ $FILE
+------------------------------
+`cat $FILE`
+------------------------------
+
+EOF
+    cat<<END>>$RECORD2
+
+ Supporting /dev/modem symbolic link:
+ $FILE
+------------------------------
+`cat $FILE`
+------------------------------
+ is for device file system support of Controller chip modems
+ and will conflict with usages of any other modem requiring a
+ symbolic link:  /dev/modem --> /dev/SomeNode
+
+ It will for example conflict with support for the Lucent chip modems
+ with support file /etc/devfs/conf.d/ltmodem.conf
+---------------------------------
+### /dev/modem symbolic link to /dev/tts/LT0
+REGISTER        ^tts/LT0$       CFUNCTION GLOBAL symlink $devname modem
+UNREGISTER      ^tts/LT0$       CFUNCTION GLOBAL unlink modem
+---------------------------------
+ Thus unless use of a Controller chip modem is anticipated,
+ either comment out those lines with a leading #
+ or move $FILE somewhere else, say /root/
+ to avoid conflict with other modems!!
+
+ Inform the devfsd (device file system) daemon of the edit with
+ # killall -HUP devfsd
+ See http://linmodems.technion.ac.il/archive-third/msg00869.html
+
+END
+  fi
+fi
+echo acpi>$TMPM
+echo disabled>>$TMPM
+echo APM>>$TMPM
+echo apm>>$TMPM
+echo " ---- dmesg queries -------" >> $RECORD
+dmesg | grep -f $TMPM  >> $RECORD
+
+
+#   cat /etc/Redhat   displays:  Fedora Core release 1 (Yarrow)
+if  grep Fedora $RECORD >/dev/null || [ -n "$FEDORA" ] ; then
+  if [ "$MAJOR" = "2.4" ] ; then
+    cat<<END>>$RECORD
+
+ For usage of winmodems with the kernel-2.4.nn Fedora releases   a change in the serial-like driver code of WinModems  is necessary.
+ See for guidance:  http://hepunx.rl.ac.uk/~wmurray/pctel/pctel.html
+ Basically , the line:
+     if ((tty->count == 1) && (state->count != 1)) {
+  should be changed into:
+     if (atomic_read(&tty->count) == 1 && state->count != 1) {
+  This works in the ltmodem code too. See
+     http://linmodems.technion.ac.il/archive-third/msg02360.html
+  An error about "rs_close" during compiling is a signature that the fedora fix is needed
+
+END
+  fi
+  if [ "$MAJOR" = "2.6" ] ; then
+    cat<<END>>$RECORD
+
+  Beginning with Fedora 2  kernel-2.6.6-1.427, kernel-headers needed 
+  for compiling drivers are provide at: /lib/modules/kernel-version/build/
+  Thus upgrading above kernel 2.6.5-1.358 to 2.6.6-* is Stongly Recommended
+  
+  pppd version 2.4.2 may not be fully compatible with 2.6.8 kernel releases.
+  If an initial CONNECT is achieved without PPP being subsequently established,
+  drop back to a 2.4.1 version.  This has worked for PCTEL AMR modem users,
+  supported by the http://www.smlink.com  slmodem software.
+  Check pppd version with:
+    pppd --version
+  See  http://linmodems.technion.ac.il/archive-fourth/msg03167.html
+    
+END
+  fi
+fi
+### DISTR specific information.
+if [ "$DISTR" = "redhat" ] ; then
+  cat<<END>>$RECORD
+  
+ For kernel-version 2.4.20-8 , a failure in utomatic loading of PPP related modules 
+ has been reported. It was necessary to manually load with:
+  /sbin/modprobe /lib/modules/2.4.20-8/kernel/drivers/net ppp_generic 
+  /sbin/modprobe /lib/modules/2.4.20-8/kernel/drivers/net ppp_deflate 
+  /sbin/modprobe /lib/modules/2.4.20-8/kernel/drivers/net ppp_synctty 
+  /sbin/modprobe /lib/modules/2.4.20-8/kernel/drivers/net ppp_async 
+ or dialout efforts failed.
+  
+  The Internet Configuration Wizard writes a configuration file:
+    /etc/wvdial.conf
+  containing a line default line
+    Stupid Mode = yes
+  Better dialup performance may be achieved by commenting out this line as:
+    # Stupid Mode = yes
+  Also non-USA Users may need to add to the [Modem0] block:
+    Init2 = AT+GCI=hexadecimal_country_code
+  but test without it first.
+
+END
+fi
+if [ "$DISTR" = "SuSE" ] ; then
+  cat<<END>>$RECORD
+
+  SuSE 9.0 has pre-compiled drivers supporting the following modem chipsets:
+     Intel HaM and 536ep
+     Conexant HSF (but not the HCF)
+     Lucent/AgereSystems ltmodem (Digital Siggnal Processing type)
+     IBM wmave
+     Smart Link soft modems
+  Unfortunately only the  Intel HaM and 536ep are on the  3 CD Personal set, pending an update.
+  Locations on the 6 CD Professional set are:
+     CD4/suse/i586/smartlink-softmodem-2.7.9-89.i586.rpm  - the slmodemd daemon
+     CD3/suse/i586/km_smartlink-softmodem-2.7.9-89.i586.rpm - slmodem driver compiling
+     CD4/suse/i586/hsfmodem-5.03.27mbsibeta02122600-92.i586.rpm - softmodem configuration
+     CD4/suse/i586/km_hsfmodem-5.03.27mbsibeta02122600-92.i586.rpm -softmodem driver code
+        installation report -  http://linmodems.technion.ac.il/archive-fourth/msg00350.html
+     CD4/suse/i586/ltmodem-8.26a-54.i586.rpm - a patch from SuSE may be needed for function
+        installation report - http://linmodems.technion.ac.il/archive-fourth/msg00458.html
+     CD4/suse/i586/Intel-536ep-4.51-200.i586.rpm
+     CD4/suse/i586/Intel-v92ham-4.51-244.i586.rpm
+     CD4/suse/i586/mwavem-1.0.4-110.i586.rpm
+Some pre-compiled SuSE 9.0 packages for the 2.4.21-99-default kernel are available at:
+      http://linmodems.technion.ac.il/packages/SuSE-9.0/
+  including AgereSoftModem and the Intel537 modems
+
+  IMPORTANT - The kernel-source-144/README.SuSE informs that the pre-assembled kernel-headers installed
+  from the 9.0 kernel-source-99 have some flaws.  Upgrading to a later kernel, such as 2.4.21-144 with matching kernel-source is the simplest may of avoiding problems.
+  
+  SuSE 9.1 comes with a SmartLink slamr.ko driver installed,
+  aiding identification of softmodem codecs by:
+    dmesg | grep slamr
+  For the 9.1 Personal (single CD installation) winmodem packages
+  have be downloaded from the SuSE 9.1 repository
+  Should compiling drivers may be necessary,  the following additional packages
+  will have to be downloaded and installed:
+       make, glibc-devel, gcc-3.3.3 and kernel-source.
+  The kernel-headers are co-installed with the kernel-source.
+  Thus subsequent driver compiling does Not require additional preparations.
+    
+END
+  
+elif [ "$DISTR" = "debian" ] && [ "$Smart" = "may" ] ; then
+  cat<<END>>$RECORD
+
+  There are Debian packages with modem drivers from SmartLink:
+      sl-modem-daemon - SmartLink software modem daemon
+      sl-modem-source - SmartLink software modem driver - module building source
+  MANY modem subSystems serving under AC97/MC97 Controllers are also supported.
+
+END
+elif [ "$DISTR" = "knoppix" ] ; then
+  if [ -n "$DSP" ] || [ -n "$Smart" ] || [ -n "$SMART" ] ; then
+    cat<<END>>$RECORD
+  
+ Packages with precompiled drivers for Lucent/Agere DSP modems
+ and SmartLink supported soft modes are available in
+ http://linmodems.technion.ac.il/packages/Knoppix/
+
+END
+  fi
+  cat<<END>> $RECORD
+
+ The bootable CDs of Knoppix releases 3.4 and 3.6 have boot kernels 2.4.26 and 2.4.27
+ These CDs are currently Hostile to winmodem installations for at least 3 reasons.
+ 1) The kernels were compiled with gcc-2.95.  While there is provided a /usr/bin/gcc-2.95  
+ the default ggc found by compilers is set as:      
+    /usr/bin/gcc --> /usr/bin/gcc-3.3
+ Thus with casual usage of many winmodem driver packages,
+ the drivers will be compiled with gcc-3.3 . Such mismatches between
+ a kernel and driver can cause a system CRASH. 
+ Thus special effort is required to insure that driver compiles utilize the gcc-2.95
+ 2) Winmodem packages typically try to write drivers to /usr/lib/ 
+ and installation files to /usr/sbin/ folders.
+ But these folders are positioned on the ReadOnly CD, and the writes will fail;
+ 3) Since compiled drivers cannot be placed in /lib/modules/, 
+ they are not perceived by a dependencies reading:
+    depmod -a
+ which would enable simple driver loading on demand or with a single:
+    modprobe Last_Modem_Driver
+ A Bug Report/offer to help Knoppix with these problems has been filed.
+ For Knoppix 3.8.1 the kernel-headers for kernel-version 2.6.11 are defective.
+ A corrected package is available at
+     http://www.linuxant.com/driverloader/wlan/full/archive/scripts-knoppix-3.8.1.tar.gz
+  
+END
+elif [ "$DISTR" = "mandrake" ] ; then
+  cat<<END>>$RECORD
+
+In the Mandrake installation disks do not include the dialer utility wvdial.rpm,
+then get instructions from http://linmodems.technion.ac.il/archive-fifth/msg01480.html
+END
+else
+  echo "  $DISTR is not yet providing pre-compiled drivers for WinModems">>$RECORD
+  echo >>$RECORD
+fi
+
+if ! [ "$BN" = "scanModem" ] ; then
+  /bin/rm -r ./Modem
+  exit 0
+fi
+
+# Output text files
+  cat<<END>Modem/1stRead.txt
+   
+                The files in this Modem/ folder have the following roles:
+
+ModemData.txt - Diagnostics and accumulated information cogent to your modem.
+     If further help is needed, send a description of your problem to:
+           discuss@linmodems.org 
+    with ModemData.txt attached as a PLAIN TEXT file.  Do NOT send other files in this folder Modem/
+    Always send the ENTIRE ModemData.txt,  as It includes subtle diagnostic ouputs needed 
+    to best guide you. If your PC is a laptop, please provide Make and Model information.
+    
+    ModemData.txt with companion files on specific modems/situations may suffice to solve your problems.
+    It recommends sites for needed software, or additional tests You must perform.
+    Always use the most recent update of scanModem accessed ONLY at
+       http://linmodems.technion.ac.il/packages/scanModem.gz 
+    to produce ModemData.txt
+    URLs to cogent advice are regularly updated, so your problem may be solved therein.
+
+YourModem.txt has guidance about operating your particular System.
+It should NOT be sent to Discuss@linmodems.org
+
+Rational.txt - Motivations of this scanModem package.  
+
+DriverCompiling.txt -  Explains the roles of additional files which may have to be installed
+   to support compiling of modem drivers, and the steps to take.   
+             
+SoftModem.txt - Information and instructions about "soft modems".
+     For these modems, additional steps may be necessary for choice of supporting software.
+     The primary PCI ID is that of the "modem controller", which can support diverse Subsystems.
+     It is the "modem codec" of the Subsystem which determines the software needed.
+
+Slmodem.txt - The slmodem software from SmartLink supports a variety of soft modems.
+     However new Users need to be aware of its special port setup features.
+  
+Slmodem-ALSA.txt   About ALSA mode usage for slmodem.
+.
+ModemTesting.txt SHOULD be read, but  after drivers have been installed.
+
+InfoGeneral.txt has general information about the status of winmodem support under Linux,
+    Do read it if ModemData.txt  reports that your current modem is not supported under Linux. 
+  
+ If you are Linux newcomer, please do locate your local Linux group through:
+    http://www.linux.org/groups/index.html  .  If you are not comfortable with English,
+    a local Linux user can often be of substantial assistance in getting you on to the Internet.
+END
+
+  cat<<END>>Modem/Rational.txt
+
+ This script primarily utilizes the "lspci" utility from the package PCIUTILS.
+ Various component scriptlets interpret the information captured by lspci.
+ For many modems, directions to supporting software and/or more detailed information is enabled.
+ ISA bus modems, 16 bit PCMCIA card modems and USB modems will not be recognized.
+ See the output files for guidance on these cases.
+
+ The script originated as scanPCI written by Chris Hebeisen,
+ to recognize modems with DSP (digital signal processing) chipsets made by Lucent/AgereSystems.
+ It now aspires to provide useful information on other modems as well.
+ For the  Lucent/Agere DSP chip modems, System information is used to recommend Installers,
+ from the Installer list output from the repository:   http://ltmodem.heby.de/
+ For other modem chipsets fully identified, URLs to support sites are given.
+
+ Three types of information are acquired from your System:
+ 1) General system information necessary for your guidance;
+ 2) The PCI_ID of the modem card, or for the increasingly prevalent "soft modems",
+  the PCI_IDs of  its AC97/MC97 controller and its modem subsystem.
+ 3) For soft modems, a SIL_ID of the subsystem is either acquired
+ OR instructions provided for manual agetting it.
+
+ The remainder of $0 is a repository of "modem gossip" or URLs thereto.
+ Only information blocks most relevant to your System will be output into
+ files written to the Modem/ folder
+ Should you need assistance after FIRST following all the advice and/or URLs,
+ 1) Browse the general information at:  http://linmodems.technion.ac.il/ 
+ 2) ONLY thereafter send ModemData.txt to:   discuss@linmodems.org
+ Modem/General.txt  has common information the List need not be bothered with.
+ 3) Also the archive SEARCH ENGINE at  http://linmodems.technion.ac.il/
+ may be useful once PCI or SIL IDs are acquired.
+
+ The scanModem script can be read and word searched with a text browser.
+ Blocks of Information with little code begin and end with #####.
+
+ In case of a failure concerning "lspci", rerun $0 after login to a console with
+ # su - root
+ as Root permission may be necessary for access to lspci.
+
+ Updated on $UPDATE by  Marv Stodolsk for access through:
+     http://linmodems.technion.ac.il/packages/scanModem.gz
+ Please do NOT use a scanModem.gz from any other site!!
+
+END
+  cat<<END > Modem/InfoGeneral.txt
+
+ Do NOT send this  text  with common information to discuss@linmodems.org
+ There are instructions to UNSUBSCRIBE from discuss@linmodems.org at http://www.linmodems.org
+ ==============
+ RATIONAL
+ This $0 service is sadly  necessary because of the pre-compiled format
+ (binary, Closed Source)  of some modem supporting code. Intellectual property
+ is protected within the binary component.  But this prevents compatibility
+ assessments/debugging against Linux Open Source code. Skipping many details,
+ the consequence is that some Linux distributions do not deliver Closed Source code,
+ or tools adequate to fully identify the modem chipset.
+ This script tries to close  this information gap.
+
+  Several sections are included in this file:
+   The Summary of modem Support under Linux
+   description of the soft modem identity tests: SIL ids
+   some output from scanModem specific to your System
+   an explanation of the GCC 2.95 compiler warning
+   ethernet Interference with DNS (domain name service)
+   Please Linux Newbies read carefully, the companion
+   Modem/DriverCompiling.txt and its
+     Followup Modem/DriverTesting.txt section  with dialout examples.
+
+ USB modems will not be detected through the acm.o driver with port /dev/ttyACM0
+   UNTIL proper USB support is installed.
+   See http://www.linux-usb.org/USB-guide/x332.html,
+   Linux_kernel_source/Documentation/usb/acm.txt, and
+   http://www.usb.org/developers/devclass_docs/usbcdc11.pdf (page 15)
+ Among the USB modems with proprietary interfaces, there is support for
+    Conexant HSF modems are supported by the hsfmodem package at http://www.linuxant.com/drivers
+         HSF USB with Vendor:Product IDs -  0572:1300  0572:1301  0572:1302  0572:1303  08E3:0111
+           with updates at         http://www.linuxant.com/drivers/hsf/index.php
+         HCF Vendor ID: 0572 Product ID: 1290 (Cadmus2 HCF, Conexant) is supported,    
+             but NOT the Cadmus I types:  http://www.linuxant.com/drivers/hcf/faq.php#25
+         HCF USB Vendor ID: 05AC Product ID: 8202 (Cadmus2 HCF, for Apple/Mac and not PCs)
+  SmartUSB56 (ST7554) based modems with ID: 0483:7554  
+    The SWEEX USB modem has the ST7554 chipset
+    Drivers are at http://www.smlink.com/main/index1.php?ln=en&main_id=40
+    http://linmodems.technion.ac.il/archive-fourth/msg00176.html is an installation report.
+    To write out Smartlink information, use the proxy entry
+      ./scanModem test 1131:3400
+
+ PCMCIA card modems can serve if your laptops modem is not supported under Linux.
+   http://freewebhosting.hostdepartment.com/g/gromitkc/pcmcia_list.html
+ The 3COM,Inc 3CXM556 and AgereSystems FM560LK chip modems use the Open Source serial-cs.o driver.
+
+It is the CHIPSET, and Not the modem BrandName which is informative for Linux support.
+ For modems not recognized by $0, chipset information may be obtained under Microsoft Windows through:
+ 1) Start > Settings > Control Panel > Classical View (for WinXP) > Modem  
+ or alternatively under Linux
+# cat  /proc/asound/mc97*
+      Try to identify the modem setup file, with name perhaps MODEM.INF
+ 2) Open a COMM console, and send ATI commands to the modem (ATI, ATI1, ATI2, etc)
+   which may elicit chipset and driver information. Here is an example
+       ATI3 - Agere SoftModem Version 2.1.22
+       ATI5 - 2.1.22, AMR Intel MB, AC97 ID:SIL REV:0x27
+   successfully identifying an Agere SoftModem chipset, both by name and through
+   the:softmodem SIL ID:              AC97 ID:SIL REV:0x27
+
+ SUPPORT SUMMARY - as of $UPDATE
+ -------------------------------------
+ Controller chipsets are used in the most expensive modems and are supported.
+  They utilize the same driver, serial.o , and most commonly the ports /dev/ttyS0 thru 3.
+  Such chipsets are produced by 3Com, AgereSystems (the Venus chipset),
+  Topic Semiconductor Corp., and others. But the same companies may
+  produce unsupported WinModems. Do not depend on the Brand Name.
+  Look for an explicit statement of Linux support
+
+ AVOID the following modem chipsets:
+   ESS -       no formal support since 2.2.2 kernels, though there are kluges:
+      http://andywettstein.home.comcast.net/ess/
+      http://tx.technion.ac.il/~raindel/
+   3Com/US Robotics winmodems - never supported under Linux
+
+ SmartLink - newer chipsets are supported:   http://www.smlink.com
+   ftp://ftp.smlink.com/linux/unsupported/
+   Moreover, the slmodem-2.9.10  drivers will support Many but not all modem Ssubsystems
+   that serve under AC97/MC97 controllers.
+
+ Conexant -  all modems supported with drivers at:  http://www.linuxant.com
+   Testcode for slow 14,400 mH support is free, BUT
+   there is a one time charge for the full speed support.
+
+ Intel Inc. -  http://developer.intel.com/design/modems/support/drivers.htm
+   For early releases check at: http://linmodems.technion.ac.il/resources.html
+    The HaM modem is supported, but code is no longer being updated;
+      there will likely be failures under emerging 2.6 kernels.
+    The 536ep and five Intel537 modem chipset variants are actively supported.
+
+ Lucent /AgereSystems
+   The Venus chipset modem uses the serial.o driver and is thus supported.
+   Modems with digital signal processing (DSP) chipsets are supported:  http:/ltmodem.heby.de
+   For AC97/MC97 soft modems. Initiate software access through code sponsor IBM:
+       http://www-3.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-52698
+   Coding of support for has Not yet begun PCI soft modems with PCI_IDs 11c1:048?
+    and probably will first be available within 2004.
+
+ Motorola support is at: http://www.motorola.com/softmodem/sm56_download.htm
+   through 2.4.22 kernels.
+
+ PCTel modem business has been sold to Conexant
+   Driver compiler resources are at: http://pctelcompdb.sourceforge.net/
+  However, the pre-compiled binary component is yet to be assembled
+   with the gcc 3.nn used in newer Linux releases,
+   so forced (-f) insertions may be necessary:
+     insmod -f pctel
+   Some of the HSP soft modems are supported by the SmartLink slmodem-2.9.10 drivers.
+
+ Broadcom modems in Dell laptops and PCs - can be made to function under 2.4 kernels, but code has not been updated recently.
+
+ --------- end chipset section ----------------------
+
+  SUPPORT under the current 2.6.nn kernels.
+
+ The more expensive Controller chipset modems are functioning.
+ SmartLink slmodem-2.9.9 drivers are functioning.
+ Conexant has 2.6.n support
+ The Lucent/Agere digital signal processing (DSP) chipsets do have
+   informal service into 2.6.n kernels and an AgereSystems release is soon expected.
+ Intel, Agere Systems and Linuxant are firmly expected to continue support into 2.6.nn,
+   though the Intel HaM software will not be updated to 2.6.n service
+
+ ------------------------------------
+  Preparing winmodem drivers will generally require compiling.
+  If you are not familar with this process DEFINITELY read carefully
+  the Modem/DriverCompiling.txt
+  
+END
+
+cat<<END>Modem/DriverCompiling.txt
+
+ =======================================================
+          COMPILING DRIVERS, for Linux Newbies
+         
+Within the workshop there is an instruction set, the Makefile, and a few tools.   You command:
+       make clean
+An elf named "make" comes in, reads Makefile and then cleans up any debris of previous efforts.  
+Do ALWAYS command "make clean" as a first step before new driver compilations.
+The major work of compiling drivers and any associated tools is commanded with:
+       make  
+or perhaps  
+       make DriverName
+There only remains to command installation of the modem driver(s) and tools with:
+       make install
+Configuration of a dialout utility is done elsewhere, and you can access the Internet.
+
+It is really that simple, once the workshop with tools has been prepared.
+But new drivers have to be compiled with every operaing system update.
+The remainder of this text is thus aids you in the preparations, dealing with a variety of special cases.
+Most  points are covered in much more detail in the Linux Kernel-HOWTO, likely included among the
+HOWTO documentation set installed within /usr/share/doc/ folders.
+
+The core operating system of a PC is comprised of a motherboard, the software kernel, 
+and its auxilliary code modules.  The kernel is the file  /boot/vmlinuz-$SYS. 
+Modules located in subfolders of /lib/modules/$SYS/  .  They can be inserted into or removed 
+from the acting kernel upon demand. This provides adaptablity to the diverse 
+hardware components of PCs and changing requirments. 
+
+Modem drivers are one type of module.  As contrasted to most Linux software, modem driver codes have
+some non-public code components. That is the drivers are not fully Open Source, to protect 
+Intellectual Property of the providing companies.   This has a consequence that many Linux distributions
+will not or cannot legally  supply proprietary  modem drivers.  Rather the Users must get the 
+modem code package and direct  compiling of the code and driver installation.
+
+A complementary resource for compiling is a family of FileNames.h, collectively called kernel-headers.
+They are both code bits themselves and also call for other code bits their functioning depends on.
+Depending on the Linux distribution, kernel-headers may not be automatically installed.
+If not they will always be made available on installation media or some Linux repository.
+They can be searched for by package names including:  kernel-source, linux-source, kernel-headers and linux-headers
+There are always some kernel-headers in afolder /usr/include/.   But these are an INCOMPLETE, too small collection 
+and DO NOT suffice for compiling processes.
+
+In addition some software utilities may have to be installed.  The instructions for compiling are read by make.
+A set of compiler tools are installed as a  gcc-SomeVersion package.  After compiling, the various pieces 
+and linked dynamically together with "ld". Together wiith some simpler software tools, the ld will 
+already be installed on Linux systems.  Systems using the Debian style maintanence system
+additionally require a package "kernel-kbuild-3.n" to properly utilize kernel-headers or 2.6.n kernels.
+
+The  "kernel-headers" are matched with an installed kernel, or must be generated from a kernel-source package. 
+These are provided in different ways by the various Linux distributions, under 2.6.n kernels:
+     Redhat and Fedora - installation is coincident with kernel installation, 
+         with placement of the kernel-header base folder in /lib/modules/$SYS/build/
+    Mandrake and SuSE/Novell - installation as part of a kernel-source or linux-source  packages,
+         with location at /usr/src/kernel-headers-$SYS  or /usr/src/linux-$SYS 
+    Debian and distros using its Package.deb format have names:
+          kernel-headers-$SYS
+         linux-headers-$SYS  for Ubuntu
+         and installation is into  /usr/src/
+    Others - ???
+
+For  the prior generation of 2.4.n kernels, there are special cases.  Skip this if your kernel is a 2.6.n or a Debian type.
+For RPM using distros, the kernel-source-$SYS or linux-source-$SYS packages must be installed and configured as described below:
+ 1) SuSE with KernelVersion 2.4.21-144-* or later - install the matching kernel-source package, which does also contain the kernel-headers;
+2) for Fedora II or later, kernel-headers are/were coinstalled with the kernel package;
+3) for all other cases of 2.4.n kernels, the kernel-headers must be prepared from kernel-source.      
+  The preparation can be summarised in a few steps/actions:
+  Install a kernel-source package representing your kernel.
+  Change directory (cd) into its base folder. The kernel-source in general
+  will match only one of several kernels that could have been installed
+  and NOT necessarily yours. Thus clean out any remnants of earlier usages with:
+       make mrproper
+  Copy in your kernel configuration file and have it read with:
+       make oldconfig
+  If necessary edit ONLY the fourth line of the Makefile, which completes
+  the specification of where drivers will be installed to (details below).
+  The kernel-headers are then assembelled by either: 
+  a) for 2.4.nn kernels by
+       make dep
+  b) for 2.6.n kernels,
+        make bzImage
+which includes an integral "make dep" step. 
+
+Modem related resources may or may not have been installed during the primary Linux installation,
+as WinModem hardware is often NOT recognized.  Search your Distro's package
+descriptions for "modem" to reveal the status of related resources.  Read
+the package description to determine whether pre-compiled modem drivers were provided.
+RESOURCES of a few types are needed to get on line. Do PREFERABLE use your System's
+package maintenance system for the installation. This should guarantee that
+any DEPENDENT packages will be called into the installation process. As a preliminary
+1) Install your distributions package providing the KPPP, WVDIAL and MINICOM dialer utilities.
+Dependencies within such packages will also drive the unpacking of ppp related modules
+from compressed to a functional form :
+   module.o.gz --> modules.o
+or for 2.6.n kernels
+   module.ko.gz --> module.ko
+In addition these dialers will later aid testing and configuration,
+which is to be performed only AFTER, the modem's drivers are installed.
+
+2) Download if necessary and modem driver package specific to your modem hardware.
+3a) Install if necessary your distrbution's kernel-source package, necessary for preparing kernel-headers under 2.4.n kernels
+Or for Debian style distributions,
+3b) install the kernel-header-$SYS.deb package matching your kernel version $SYS.
+
+A KERNEL-SOURCE package must be installed, if a full kernel-header set
+is not otherwise provided. Kernel-source packages are now some 30-40 MB now even in compressed form.
+The package provided by your Linux Distro SHOULD preferentially be used.
+It will usually have some differences from that initially released at http://www.kernel.org .
+Typically the installation process will set two symbolic links:
+  /lib/modules/$SYS/build -->  PATH_to/kernel-source-version/
+  /usr/src/linux --> PATH_to/kernel-source-version/
+These later enable access to the kernel-headers needed during the modem driver compiling. Check with:
+  ls -l /lib/modules/$SYS/build
+  ls -l /usr/src/linux
+The former link is more usefull for Systems with alternative boot kernels,
+and is mandatory for some modem compiler packages.
+
+HIGHLY IMPORTANT: the kernel-source as installed in generally does NOT
+represent your current kernel version, EVEN if the kernel-version is the same.
+Only one of several possible kernels was installed on your System,
+and the unpacked kernel-source need NOT represent it exactly!!!
+For example, in the RedHat Distro there is a set of kernel-configuration files within
+   /usr/src/linux/configs/
+Each is specialized for a different CPU (i586, i686, K6, etc),
+Yet each will be represented by the VERY SAME version name: "uname -r" .
+!!!! Thus a PROPER CONFIGURATION MUST BE DONE by You, before compiling drivers !!!!
+
+Examples provided below are partially customized from your System settings.
+CONFIGURATION is started by moving into the kernel-source folder with one of:
+  cd  /lib/modules/$SYS/build
+  cd /usr/src/linux
+END
+if test -f /lib/modules/`uname -r`/build/Makefile ; then
+  MKFL=/lib/modules/`uname -r`/build/Makefile
+
+elif test -f /usr/src/linux/Makefile ; then
+  MKFL=/usr/src/linux/Makefile
+else
+ echo Makefile not found>/dev/null
+fi
+if test -n "$MKFL" ; then
+  cat<<END>>Modem/DriverCompiling.txt
+
+ There is a Makefile on your System at:  $MKFL
+ with first few lines:
+
+END
+  grep -A3 -m 2 VERSION $MKFL >>Modem/DriverCompiling.txt
+  echo>>Modem/DriverCompiling.txt
+else
+  echo " A kernel-source packages is not evident on your System">>Modem/DriverCompiling.txt
+fi
+cat<<END>>Modem/DriverCompiling.txt
+For your current kernel, the fourth line should be
+   EXTRAVERSION = -$KEXT
+where -$KEXT has been read from your current kernel version: $SYS.
+But it this does not match what is Actually in the Makefile,
+then it represents a Different kernel-header set then that of your kernel!!!
+
+For Mandrake Linux their will generally be an included "mdk", such as:
+ EXTRAVERSION = -3.1mdk
+SuSE 9.0 had:
+ EXTRAVERSION = -99-default
+The first four makefile lines specify that:
+a)  the compiled kernel modules/drivers will have encoded version labels such as:
+   2.4.21-3.1mkd  OR   2.4.21-99-default
+b)  such modules including modem drivers are installed into sub-folders of
+   /lib/modules/2.4.21-3.1mkd/
+   /lib/modules/2.4.21-99-default/
+The major points are that compiled drivers must be both
+kernel-release (the 2.4.21) AND EXTRAVERSION matched with the installed kernel.
+Otherwise they may be installed uselessly and not be detected by the kernel
+OR there will be a failure upon attempted insertion, with message including:
+  a list of "unresolved symbols ".
+
+Kernel-headers may be resident from a prior usage of the kernel-source/.
+Check with:
+  ls include/linux/
+which may display abundant FileNames.h
+The version of these headers will be in the UTS line displayed by
+  cat include/linux/version.h
+     #define UTS_RELEASE "2.4.21-3.1mdk" (as an example)
+
+Next, list completely the contents of the kernel-source  with:
+  ls -a
+Where the " -a " additionally reveals ".dot-prefixed-confguration-files" such as
+    .config  .hdepend .depends
+which may be left over from the prior usage of the kernel-source. Below is an example:
+ -------------------
+    .config  .hdepend .depends
+COPYING        Makefile        Rules.make    init    mm
+CREDITS        README          arch        drivers  ipc     net
+Documentation    conf.vars   fs       kernel  scripts
+MAINTAINERS    REPORTING-BUGS  crypto      include  lib
+
+Configuration of the kernel-source is where almost all the Mistakes occur!!!
+Here is a way to do it correctly (but read through EXCEPTIONAL CASES below).
+1)Within kernel-source/ folder, browse the README file for general guidance.
+It will relate that the command:
+#    make mrproper
+cleans up leftovers from any previous usage .dot-files and the include/linux/ folder.
+Additionally you may need to do an edit within Makefile, but ONLY that 4th line.
+2) If necessary to edit, FIRST make a backup:
+  cp Makefile Makefile.backup
+then edit ONLY the 4th line of Makefile to match the EXTRAVERSION of $SYS
+   EXTRAVERSION = -$EXT
+NEVER change anything else within the Makefile.
+
+3) Set the dependencies of the current kernel.
+For SuSE 9.0 and later, there is a command which does the following steps
+   #  make cloneconfig && make dep
+   Also browse the excellent README.SuSE in the kernel-source/ folder
+For other Distros, the following steps are necessary, within the kernel-source/ folder
+  copy the kernel-config file to  .config
+          and DO SPECIFY that " . "
+But where is it? For many Distros, it will be the file like
+   /boot/config-$SYS
+matching the output of:
+  uname -r
+Or it may be the target of a symbolic link:  /boot/config -->
+So
+  cp /boot/config-$SYS .config
+For SuSE 8.0 and earlier versions it is:
+  cp /boot/vmlinuz.config  .config
+PLEASE do not omit that "." in  .config as it is crucially necessary.
+View .config with a text browser.
+It is simply a listing of the code components used in the kernel and its modules:
+  #
+  # Automatically generated make config: don't edit
+  #
+  CONFIG_X86=y
+  # CONFIG_SBUS is not set
+  CONFIG_UID16=y
+etc.
+
+4) The  .config file will be read during
+#  make oldconfig
+which feeds its specifications through a process specifying
+the SAME inter-dependencies previously used in compiling your kernel,
+and may generate additional .dot-config files . They can be displayed with:
+#   ls -al
+
+5) Though it may be redundant after "make mrproper", it will do no harm to:
+   make clean
+5a) For the SuSe Linux versions 8.0 and previous , there will exist files:
+  /boot/vmlinuz.autoconf.h
+  /boot/vmlinuz.version.h
+They MUST be copied as:
+  cp /boot/vmlinuz.autoconf.h  /usr/src/linux/include/linux/autoconf.h
+  cp /boot/vmlinuz.version.h    /usr/src/linux/include/linux/version.h
+
+6) Now build kernel-headers with:
+       make dep
+for 2.4.n kernels or for 2.6.n kernels
+       make bzImage 
+during which you can walk your dog, take a shower, have tea, etc.
+7) Check for resultant FileNames.h with:
+       ls  include/linux/
+and
+       cat include/linux/version.h
+to verify the version.
+
+COMPILING the MODEM DRIVERS can now finally be done.
+Unpack the compiler kit for your modem drivers,
+cd into its folder, read any README or INSTALL files,
+   make clean
+FINALLY, your modem drivers will compiled by a command like
+   make OR  make ModuleName
+or perhaps
+   make all
+During this process, some of the kernel-header code with be joined
+with the supplied modem specific code, and ModemDrivers.o will be produced.
+Follow and further instructions in the modem code resource
+to install the drivers, often with:
+   make install
+
+               THEORETICAL ISSUES      
+
+WinModem driver packages commonly include:
+1) a readible Open Source component, which can be readily debugged by
+experts in code. This component provides "wrappers" to common
+kernel functions for an already complied, or BINARY format, component of the modem code.
+
+2) A Closed Source component compiled into the binary form, in which
+proprietary information is encrypted. This will include the copyrighted Vn.nn compression algorithms.
+In 2004, pre-compiled modem drivers are beginning to be included
+for a few winmodems by some Linux distributions.
+But the binary format precludes incorporation of the modem drivers in some Linux distributions
+for legal reasons, practical reasons, and/or reasons of principle.
+
+Since almost all the newer PCs are now equipped with WinModems,
+many users will have to compile their own linux modem drivers.
+Exceptions are the more expensive modems with Controller chipsets,
+characteristic of the earliest modems.
+They are supported by Open Source serial code included in Linux
+distributions (Distros hereafter).
+
+Winmodems are less expensive because of greatly reduced hardware costs.
+They lack Controller chips of the earliest modems, and may additionally lack Digital Signal Processor (DSP) chips of second generation modems.
+Functions of Controller based chipsets are replaced by a combination of 
+software code and/or other System hardware.
+
+Modems without a controller chip are referred to as "controllerless modems" and
+modems lacking both a DSP and controller chips are referred to as "soft modems".
+With faster central processor units (CPU), some processing tasks are performed
+by the CPU for the controllerless modems. The CPU does nearly all
+the signal processing for the "soft modems" lacking a DSP. 
+
+AC97 or MC97 soft modems conform to an ac97_codec, and can host a variety of Subsystems It is the CODEC of the Subsystem which determines which software should be utilized!! 
+and any modem controllers can host one of a variety of soft modem Subsystems.
+There are additionally soft PCI modems without such controllers, which still utilize
+the common ac97_modem.o driver. In general it will be YOUR task to identify
+the Subsystem codec and compile the needed driver.
+   
+## end Modem/DriverCompiling.txt
+
+END
+
+  cat<<END> Modem/Slmodem-ALSA.txt
+  
+  The ALSA ( Advanced Linux Sound Architecture)  package includes some modem
+   drivers which provide low level support  for a few soft modem controllers.
+   Pulse dialing (ATDP) is Not supported with these ALSA modem drivers however.
+   
+    As of this update $UPATE there is support for the following soft modem controller types:
+      PCI  ID                  controller name/source          low level Module
+    =======        ===============    ===============
+    8086:xxxx           several Intel ICH types         snd-intel8x0m
+    10de:00d9          Nvidia Corp                                        "
+    1002:434d          ATI                                           snd-atiixp-modem
+    1106:3068          VIA                                           snd-via82xxx-modem
+    10b9:5451          ALI 5451                                  snd-ali5451-modem.ko  (in progress)
+    
+  To use ALSA modem drivers,  the SmartLink slmodem package   must be compiled 
+  with an ALSA support option.    The resultant slmodemd daemon provides for 
+ creation of a port and /dev/pts/N  (N a number) and a symbolic link to it:
+        /dev/ttySL0 --> /dev/pts/N
+  The command seqeunce is:
+                  modprobe Module
+ with Module being one of the four above
+                  /usr/bin/slmodem --country=YourCountry  --alsa  hw:1   &
+  hw is short for hardware port.  hw:0 is typically reserved for the audio card.
+  The & merely puts the daemon function in the backgound, so that the command prompt is recovered.
+  The slmodemd shutdown can later be done by:
+                  fg slmodem
+                 Ctrl-C
+ This service has the additional requirements:
+ 1) The subsystem must be one of those compatible with slmodemd.
+ Excluded are Conexant Subsystems, which are alternatively supported by the  hsfmodem package from
+       http://www.linuxant.com/drivers/
+       
+  For many other Subsystems, the instructions below on using SmartLink slmodem software 
+  in ALSA mode is cogent.  Slmodem.txt and Testing.txt complement the information herein. 
+  
+2) The modules must be compiled form  ALSA release of at least 1.0.6a or later version. 
+Check your System with
+# alsactl --version
+     alsactl version 1.0.6
+on my Debian 2.6.10 System. So more current code would be necessary.  
+Should your System be less than 1.06a, follow the instructions here in.
+Should a message " error: mixer setup: Off-hook switch not found for card hw:1"
+be delivered while dialing, use at least version  1.0.9rc3 .
+If later, just skip to the next section.
+Download software from http://www.alsa-project.org, The release of May 2006 is 1.08. 
+Download both alsa-lib and alsa-driver packages. Make a folder:
+        mkdir newALSA
+Unpack both packages in the newALSA/
+ Follow the compilation and installation instructions therein, which will 
+install the ALSA modules and complementary software.
+3) Compilation of slmodemd with ALSA support requires prior installation of
+a package  libasound2-dev, which will be provided by your Linux distrbution.
+It has header files needed for the slmodemd compilation.  For for Mandrake/Mandriva,
+ the package name is  libalsa2-devel .  Use the slmodem-2.9.9d-alsa.tar.gz package
+ downloaded from  http://linmodems.technion.ac.il/packages/smartlink/
+ Also download the ungrab-winmodem.tar.gz which will be necessary for some Systems,
+ providing an upgrab-winmodem.ko modules.  See  http://linmodems.technion.ac.il/slmodem-serial.html
+
+4) Login to a console as;
+# su - root
+Shift into the slmodem-2.9.9d-alsa folder. Look at contents:
+# ls 
+         COPYING  Changes  Makefile  README  drivers  modem  patches  scripts
+Clean up any old remnants with:
+#  make clean
+The slmodemd will be compiled by make:
+# make
+and installed to   /usr/bin/slmodemd by:
+#  make install
+An initial check for functionality is:
+        modprobe Module
+with Module being the appropriate ALSA modem driver.
+Should there be a failure, with message "grabbed by serial driver", First
+       modprobe ungrab-winmodem
+before
+       modprobe Module
+       
+Start the daemon with one of:
+        slmodem --country=YourCountry --alsa  hw:1   &
+        slmodem --country=YourCountry --alsa  modem:0   &
+        slmodem --country=YourCountry --alsa  modem:1   &
+When Module is  snd-atiixp-modem  , instead use
+        slmodem --country=YourCountry --alsa  modem:0   &
+        
+ Subsequently follow the details in Slmodem.txt  and Testing.txt
+END
+
+cat<<END>Modem/Testing.txt
+                       MODEM TESTING
+                        
+This text is complemented by the Post-Install at http://linmodems.technion.ac.il
+Please so consult it if the following does not suffice.
+
+The wvdial package provides for an automated hardware+driver test.
+This utility searches through ports with syntax: /dev/ttyS*  (i.e. S0, S1, SL0 etc.)
+and also follows a symbolic link:
+       /dev/modem --> /dev/ModemPort
+If your modem port name does not satisfy these requirements already,
+do a console login as:
+       su - root
+Make the symbolic links as:    
+       ln -sf /dev/ModemPort /dev/modem
+       ln -sf /dev/ModemPort /dev/ttyS15
+wherein /dev/ttyS15 is reserved for experimental usage.
+ Should there be problems with wvdial version 1.54.1-1 , drop back to 1.54.0-1 
+
+For recent RedHat and Fedora releases, wvdialconf is used by the Internet Wizard.
+Within the pop-up menus find the Wizard. Its actions will write a configuration file:
+       /etc/wvdial.conf
+For other Linux distros, open a console and login with
+       su - root
+If necessary load the modem drivers:
+       modprobe DriverNames
+Then run the test:
+       wvdialconf /etc/wvdial.conf
+Checks /dev/modem and ports /dev/ttyS*, a success at port /dev/ttySLT0 would be:
+  ttySLT0<*1>: ATQ0 V1 E1 -- OK
+  ttySLT0<*1>: ATQ0 V1 E1 Z -- OK
+  ttySLT0<*1>: ATQ0 V1 E1 S0=0 -- OK
+  ttySLT0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
+  ttySLT0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
+  ttySLT0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK 
+    etc.
+The /etc/wvdial.conf written looks like:
+ [Dialer Defaults]
+Modem = /dev/ttySLT0
+Baud = 115200
+Init1 = ATZ
+Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
+ISDN = 0
+Modem Type = Analog Modem
+; Phone = <Target Phone Number>
+; Username = <Your Login Name>
+; Password = <Your Password>
+
+For systems using the SmartLink slmodem drivers,
+the following line should be added to its /etc/wvdial.conf
+  Carrier Check = no
+So after editing in your personal information a functional file is like:
+ [Dialer Defaults]
+Modem = /dev/ttySLT0
+Baud = 115200
+Init1 = ATZ
+Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
+# if there is problem with dial tone acquisition, add into the above line:
+#    X3
+#       meaning "dial without waiting"
+ISDN = 0
+Modem Type = Analog Modem
+Phone = DialupPhoneNumber
+Username = Your_Login_Name
+# for MSN.net, use instead
+#  Username = MSN/Your_Login_Name   
+Password = Your_Password
+# if usging the SmartLink slmodem drivers, uncomment:
+#  Carrier Check = no
+
+The lines above beginning with " # " are Comments not read as code.
+Remove the " # " to activate a line.  Then try getting on line with:
+# wvdial
+The /etc/wvdial.conf generated by the RedHat/Fedora Internet Wizard 
+has a different format, adapted to its own dialer.  This includes a line
+       Stupid Mode = yes
+More informative dialup feedback May be obtained if it is commented out:
+#      Stupid Mode = yes 
+
+ A dialout with wvdial will then display like:
+# wvdial &
+--> WvDial: Internet dialer version 1.53
+--> Initializing modem.
+--> Sending: ATZ
+ATZ
+OK
+--> Sending: ATQ0 V1 E1 M1 S0=0 &C1 &D2 +FCLASS=0
+ATQ0 V1 E1 M1 S0=0 &C1 &D2 +FCLASS=0
+OK
+--> Modem initialized.
+--> Sending: ATDT3019178111
+--> Waiting for carrier.
+ATDT3019178111
+CONNECT 53333 V42bis
+--> Carrier detected.  Waiting for prompt.
+** APX1.LNH.MD.RCN.NET Terminal Server **
+Login:
+--> Looks like a login prompt.
+--> Sending: LoginName
+LoginName
+Password:
+--> Looks like a password prompt.
+--> Sending: (password)
+    Entering PPP Session.
+    IP address is 66.44.1.6
+    MTU is 1006.
+--> Looks like a welcome message.
+--> Starting pppd at Sat Jul 26 13:59:03 2003
+--> pid of pppd: 2404
+: pppd 2.4.1 started by root, uid 0
+: Using interface ppp0
+: Connect: ppp0 <--> /dev/tts/LT0
+Jul 26 13:59:08 stodolsklap kernel: PPP BSD Compression module registered
+Jul 26 13:59:08 stodolsklap kernel: PPP Deflate Compression module registered
+: local  IP address 66.44.1.6
+: remote IP address 208.59.89.132
+: primary   DNS address 207.172.3.8
+
+The & in "wvdial &" puts the process into the background, 
+allowing further usage of the command prompt.  To stop a backgrounded process:
+# fg wvdial
+# Ctrl -C 
+
+TROUBLE SHOOTING
+
+Check for modem driver loading.
+Do FIRST read INSTRUCTIONS files provided with the modem driver resource.
+Some may have installed to /usr/share/doc/Modem_or_Driver_Name/
+For RPM using distros, documentation files will be listed through
+   rpm -q -d packageName (less the version part, sometimes)
+and all directly installed files can be listed by
+   rpm -q -l packageName
+Depending upon your installation, the modem drivers may/may_not be autoloaded.
+Login as Root in a console with:
+# su - root
+# lsmod
+If the modem drivers are not already loaded onto the kernel, insert them with command
+# modprobe ModuleDriver
+If there are multiple drivers such as the lt_modem.o and lt_serial.o pair,
+commanding the serial like driver:
+# modprobe lt_serial
+should autoload all modules it depends on.  Check with:
+# lsmod 
+This proceeds through a reading of dependency files
+written to /lib/modules/$SYS/ during boot up through the "depmod -a" command.
+In constrast
+# insmod lt_serial
+would only attempt loading of that single driver and will FAIL, if its dependency on
+lt_modem.o has been satisfied by prior lt_modem.o insertion.
+ Do read "man wvdial" and /usr/share/doc/vwdial  documentation
+sometime browse the documentation that is written to /usr/share/doc/wvdial/
+Therein are instructions for setting up alternative dialouts.
+
+%%% This wvdialconf action if successful generates the files:
+ /etc/ppp/peers/wvdial
+ /etc/ppp/peers/wvdial-pipe
+in addition to the /etc/wvdial.conf
+
+Many Users prefer to use the dialout utility KPPP. This is fine.
+But each User MUST run the configuration process separately.
+In principle, different Users on the same Linux System could
+have different Internet providers and/or use different modems.
+The configuration process generates a file:  /home/UserFolder/.kde/share/config/kppprc
+Therein, non-standard modem port names can be entered, such as:
+      [Modem]                 
+      Device=/dev/ttySHSF0
+ for the Conexant hsfmodem port.  
+
+Preparation for  dialout if other COMM modes are active.
+---------------------------------------------------------------------------
+Concurrent ethernet capability will compete for
+the Domain Name Service (DNS) needed for browser naviagation. So as root:
+# /sbin/ifconfig eth0 down
+before starting a dialout!
+With a Mandrake installation, it will be necessary to:
+# /etc/init.d/network stop
+
+Internet clients such as Netscape, Mozilla, Explorer etc.
+should be CLOSED during your first dial out trials.
+Should a URL on the Internet be specifed as the default URL/connect,
+then the Client may compete with ppp for connectivity functions.
+After PPP functionality has been verified, the effects of opened
+or launched browsers can be checked
+
+If you have installed the DIALD (dial on demand) package, stop it for initial tests:
+# /etc/init.d/diald stop
+Otherwise diald function will be initiated with modem usage,
+and could compilate issues. Test diald only after ppp by itself is fine.
+
+If your internet provider assigns DNS dynamically then add to /etc/ppp/options:
+ usepeerdns
+
+To analyze a dialout attempt, it is useful to display kernel messages with:
+# tail -f /var/log/messages &
+The & puts the commanded process in the "background" allowing recovery of the command prompt.
+
+Some dialer packages (kppp etc) may automate the above steps.
+
+
+Note that for some Linux distributions (Mandrake for one),
+maintain modules in compressed module.gz format, if modem service was not specified
+during the Linux installation. A subsequent installation of any dialer package:
+  wvdial - PPP dialer with built-in intelligence.
+  kppp - PPP dialer for KDE
+  dtmfdial - A DTMF Tone Dialer
+  gkdial - Gtk-based PPP dial-up configuration tool.
+  gkdial-gnome - GNOME-based PPP dial-up configuration tool.
+  masqdialer - daemon for remote control of masqueraded dialup links
+  pppconfig - Debian configuration toolset with command: pppconf
+will stimulate unpacking of ppp related modules during bootup.
+
+The cogent ppp related modules loaded during such a CONNECT are displayed within the output from:
+# lsmod
+ppp_deflate             3512   1  (autoclean)
+zlib_inflate           18980   0  (autoclean) [ppp_deflate]
+zlib_deflate           18648   0  (autoclean) [ppp_deflate]
+bsd_comp                4440   0  (autoclean)
+ppp_async               7744   1  (autoclean)
+ppp_generic            16380   3  (autoclean) [ppp_deflate bsd_comp ppp_async]
+slhc                    5264   1  (autoclean) [ppp_generic
+
+For ealier 2.4.nn kernels, loading of these modules may require the following lines within
+  /etc/module.conf :
+### automate ppp modules loading ###
+alias /dev/ppp          ppp_generic
+alias char-major-108    ppp_generic
+alias tty-ldisc-3       ppp_async
+alias tty-ldisc-14      ppp_synctty
+alias ppp-compress-21   bsd_comp
+alias ppp-compress-24   ppp_deflate
+alias ppp-compress-26   ppp_deflate
+### end ppp block ####
+For more recent kernels with their modutils,
+these lines are no longer needed.
+
+For  potential causes of a NO DIALTONE failure, read the Post-install.html
+at  http://linmodems.technion.ac.il/  Not setting the Country Code may be
+and additional problem.
+
+ COUNTRY CODE Issues
+ ====================
+ The modem which you purchase locally or abroad may not be preset
+ with the proper Country Code setting.  An incorrect setting can
+ hinder acquisition of dial tone.
+ Inclusion of an X3 (dial without wainting) in the modem Init string
+ of under wvdial, including in /etc/wvdial.conf a line
+   Stupid Mode = yes
+
+ Dialtone recognition depends on the setting of country
+ and/or local phone line equipment.
+
+ To properly get dialtone for your country phone experiment use
+ AT+GCI=xx  where xx is country code in hexidecimal format.
+ Theoretically there could be 256 different countries but
+ not all are valid. Tables in manuals are way off date,
+ you have to write a small script to try all combinations
+ for yourself if you can't guess by chance.
+
+ After country select you can check textual name of the country it represents.
+ For example:
+   at+gci=00
+   OK
+   ati9
+   Japan
+
+ If you can't find exact country, choose the nearest one available.
+ Nearby countries tend to have similar equipment and compatible dialtones.
+
+ These comments from:   Emard <emard@softhome.net>
+ =================
+
+8) After a successful CONNECT, the Domain Name Service (DNS) needed
+ for Browser navigation can be checked with:
+# ping corel.com
+PING corel.com (206.47.20.85): 56 data bytes
+64 bytes from 206.47.20.85: icmp_seq=0 ttl=52 time=209.1 ms
+64 bytes from 206.47.20.85: icmp_seq=1 ttl=52 time=189.9 ms
+64 bytes from 206.47.20.85: icmp_seq=2 ttl=52 time=180.0 ms
+64 bytes from 206.47.20.85: icmp_seq=3 ttl=52 time=179.9 ms
+# Ctrl-C
+     aborts ping
+--- corel.com ping statistics ---
+4 packets transmitted, 4 packets received, 0% packet loss
+round-trip min/avg/max = 179.9/189.7/209.1 ms
+
+# ping 206.47.20.85
+PING 206.47.20.85 (206.47.20.85): 56 data bytes
+64 bytes from 206.47.20.85: icmp_seq=0 ttl=52 time=179.8 ms
+64 bytes from 206.47.20.85: icmp_seq=1 ttl=52 time=190.0 ms
+64 bytes from 206.47.20.85: icmp_seq=2 ttl=52 time=170.0 ms
+# Ctrl-C
+     aborts ping
+
+Should there be a success with:
+# ping 206.47.20.85
+BUT a failure with the named address:
+ping corel.com
+Then DNS has not been acquired.
+Note that failure to stop ethernet service
+# /sbin/ifconfig eth0 down
+before starting a dialout, will commonly block DNS under ppp.
+
+To terminate the wvdial session, bring the action to the foreground (fg):
+# fg wvdial
+  Ctrl-C    to terminate:
+wvdial
+Caught signal #2!  Attempting to exit gracefully...
+: secondary DNS address 207.172.3.9
+: Terminating on signal 15.
+: Connection terminated.
+: Connect time 7.8 minutes.
+--> Disconnecting at Sat Jul 26 14:06:53 2003
+
+The Debian distribution provides a utility:
+# pppconfig
+for setting up a chatscript for ppp initiation.
+Most dialers do use chatscripts and will produce similar records.
+Below is the record of a dial out initiated by:
+
+# pon
+: pppd 2.4.1 started by marv, uid 1000
+: abort on (BUSY)
+: abort on (NO CARRIER)
+: abort on (VOICE)
+: abort on (NO DIALTONE)
+: abort on (NO DIAL TONE)
+: abort on (NO ANSWER)
+: abort on (DELAYED)
+: send (ATZ^M)
+: expect (OK)
+: ATZ^M^M
+: OK
+:  -- got it
+: send (ATQ0V1E1M0S0=0W2&C1&D2+FCLASS=0^M)
+: expect (OK)
+: ^M
+: ATQ0V1E1M0S0=0W2&C1&D2+FCLASS=0^M^M
+: OK
+:  -- got it
+: send (ATDT3019178111^M)
+: expect (CONNECT)
+: ^M
+: ATDT3019178111^M^M
+: CONNECT
+:  -- got it
+: send (\d)
+: Serial connection established.
+: Using interface ppp0
+: Connect: ppp0 <--> /dev/modem
+: kernel does not support PPP filtering
+Jul 26 14:08:39 stodolsklap kernel: PPP BSD Compression module registered
+Jul 26 14:08:39 stodolsklap kernel: PPP Deflate Compression module registered
+: local  IP address 66.44.1.195
+: remote IP address 208.59.89.132
+: primary   DNS address 207.172.3.8
+
+Once your first CONNECT has been established, than in the future if should suffice
+just to use your dialer of choice: wvdial , kppp  .gnomeppp or whatever.
+
+Good surfing to you.
+
+10) GENERAL ITEMS
+
+ If attemped insertion of a modem driver evokes a complaint like:
+         unresolved symbol do_SAK_R9a0bcb74
+ then the kernel-headers using in compiling the modem drivers
+ do not match those of your current kernel whose KernelVersion is displayed by:
+    uname -r
+ and whose kernel config file is often located at /boot/config-KernelVersion
+ The section above "COMPILING DRIVERS, for Newbies" relates how to make corrections.
+
+ There are definitely IPs whose login protocols are Linux hostile.
+ If you cannot achieve a login, try another Internet Provider (IP).
+ or ask for someone on discuss@linmodems.org to test your IP.
+
+ Many driver packages provide for loading modem drivers on bootup.
+ Here is a description on how to set it up, if necessary:
+   http://linmodems.technion.ac.il/archive-fourth/msg00451.html
+
+ PLEASE include the diagnostic output of the following Root command in any problem reports:
+ # setserial -agv /dev/ttyS*
+
+ For instructions on having modem drivers loaded on bootup,
+   particularly the SmartLink slmodem drivers see:
+   http://linmodems.technion.ac.il/archive-fourth/msg00451.html
+ For automated removel of drivers after a PPP session see:
+   http://linmodems.technion.ac.il/archive-fourth/msg00145.html
+
+  For general upto date advice:
+    http://linmodems.technion.ac.il/
+    http://linmodems.technion.ac.il/resources.html
+    available in Russian at  http://linmodems.nm.ru
+ for a general PCI_ID database
+    http://www.pcidatabase.com/
+ the original Linux winmodems URL is:
+    http://linmodems.org
+ with a mailing list on Winmodems:
+    discuss@linmodems.org
+ whose archives can be searched at:
+    http://linmodems.technion.ac.il/ (near bottom of the page)
+ There is an extensive modem database at:
+    http://start.at/modem/
+ Locate your local Linux groups through:
+    http://www.linux.org/groups/index.html
+ USB modem information:  http://www.linux-usb.org/USB-guide/x332.html
+ Laptop users should browse http://tuxmobil.org/modem_linux_add1.html
+ For debugging ppp:
+   http://www.cisco.com/warp/public/471/debug_ppp_negotiation.html
+
+---------- end FOLLOW UP STEPS ---------------
+
+END
+
+       cat<<END>Modem/Slmodem.txt
+               SLMODEM PACKAGE USAGES and TESTING
+
+Summary
+-----------------             
+SmartLink (SML hereafter, http://www.smlink.com) produces chipsets for PCI card and USB modems
+which are incorporated into a variety of BrandName modems.  The complementary  slmodem software supports these modems, and Very Beneficially, a variety of soft modems with Subsystems 
+from other chipset manufacturers.  The installed software has components:
+       /usr/bin/slmodemd  - a daemon that  provides most services, including dynamic port creation.
+       /dev/slamrN  and /dev/slusbN  (N = 0,1,2 or 3) are proxy devices used by 
+               slmodemd in port creation  for PCI and USB modems respectively.  The true port is of type 
+               /dev/pts/N  , N a number,  with a symbolic link to it also created:
+                     /dev/ttySL0 --> /dev/pts/N
+       slusb.ko - driver for the USB modems
+       slamr.ko -  a low level driver which accesses the port, 
+              There are subsititutes for slamr.ko within the Open Source ALSA package
+               (snd-intel8x0m.ko , snd-via82xx-modem.ko  or   snd-atiixp-modem.ko ) working with most
+              modem hardware, and provided that slmodemd was compiled with ALSA (Advanced
+              Linux Sound Architecture) support. (See the companion Slmodem-ALSA.txt)
+       the code folder  slmodem-2.9.n/scripts/  contains scripts which can provide  bootup automation
+Details follow.
+
+  Slmodem support
+   -------------------------------
+ The software features support for :
+      FAXing, though not the AT&F command; 
+      SMP (Symmetric MultiProcessor) mother boards;
+      64 bit AMD x86_64 processor mother boards, see
+        http://linmodems.technion.ac.il/archive-fourth/msg02594.html;
+      the SmartUSB56 (ST7554) chipset with vendor/product usb ids  0483:7554, 
+          see report at  http://linmodems.technion.ac.il/archive-fourth/msg03609.htm
+ A few modem hardware types are supported:
+      the USB modems ;
+      several BrandName modems, for which the primary PCI suffices for chipset identification; 
+      many soft modems, for which a "mc97 codec" as well as PCI ID must be acquired, 
+          as described in the companion SoftModem.txt and below.
+Software download sites are:
+    SML -  http://www.smlink.com for slmodem-2.9.10.tar.gz, with license to support only SML 
+        chipset modems.  The slmodem package maintainer is Sasha Khapyorsky.  His quick fixes are at:
+   http://linmodems.technion.ac.il/packages/smartlink/   Currently cogent packages are:
+           ungrab-winmodem.tar.gz  - necessary for some Systems which falsely presume that
+                the modem is a serial port modem type.  See  http://linmodems.technion.ac.il/slmodem-serial.html
+           slmodem-2.9.9d.tar.gz - providing compiling resources for slmodemd, slamr.ko and slusb.ko
+          slmodem-2.9.9d-alsa.tar.gz - providing for compilation of slmodemd  with ALSA support, 
+               so that the ALSA driver alternates described can be utilized.
+          This  2.9.9x version software is licensed for use with any compatible softmodem.   
+
+The slamr diagnostic
+-----------------------------
+If you have just downloaded the slamr.ko driver matching your kernel, 
+just move into the folder with slamr.ko  and
+# insmod  slamr.ko 
+ will generate a warning about "Tainted kernel", and perhaps about non-SmartLink chips.
+ So long as the driver loads, just ignore them. Read related kernel messages with
+# dmesg | grep slamr
+The output should include a line like:
+      slamr: mc97 codec is CodecName
+  wherein the CodecName is needed to choose the correct software
+  
+Should the be an output like like:
+---------------
+slamr: unsupported module, tainting kernel.
+slamr: module license 'Smart Link Ltd.' taints kernel.
+slamr: SmartLink AMRMO modem.
+slamr: device 10b9:5457 is grabbed by driver serial
+------------
+The "grabbed by driver serial" indicates a compensating driver is needed.
+Use the ungrab-winmodem.tar.gz resource to compile the ungrab-winmodem.ko
+After installation, first do
+# modprobe ungrab-winmodem
+before
+# modprobe slamr
+# dmesg | grep slamr
+
+
+ A slamr.ko driver may already be installed (SuSE/Novell Linux).  Please run the following test sequence:
+ # su - root
+ # modprobe -r slamr
+ Ignore any warning message
+ # modprobe slamr
+Then same as above. Get the CodecName and send the information to Discuss@linmodems.org
+ Explanation and details follow  below.
+
+  Special cases:
+  ---------------------------   
+ For BCM64/Broadcom and ATI softmodem support, only the slmodem-2.9.9d-alsa.tar.gz can serve. 
+ Within the Modem/ folder output by scanModem, browse Slmodem.txt, Slmodem-ALSA.txt and Testing.txt
+ There have been a few reports of problems being solved by using Bootup options:
+              noapci and/or apci=off
+ thus dropping back to the APM power management mode.
+ Solution of a CONNECT problem has been achieved by specifying a slower V32 modulation 
+       see  http://linmodems.technion.ac.il/archive-fifth/msg00137.html
+
+  General installation:
+  -----------------------------
+  If your Linux distribution provides a slmodem package, the package manager will typically
+  install it to  /usr/src/moduels/slmodem-2.9.N   .  But it downloaded as a slmodem-2.9.N.tar.gz,
+  if could be unpacked in a folder of your choice.  The following directions assume installation to:
+         /usr/src/moduels/slmodem-2.9.N
+ Do  a Root login into a command console:
+ #  su -  root
+ # cd   /usr/src/moduels/slmodem-2.9.N
+ Look at contents:
+ # ls
+   COPYING  Changes  Makefile  README  drivers  modem  patches  scripts
+   
+ For Debian related Distros there is an sl-modem-daemon.deb package providing
+ slmodemd and initializaton scripts.  A separate  sl-modem-source.deb packages
+ houses the slamr and slusb driver code.  It is installed as:
+    /usr/src/sl-modem.tar.bz2
+ Unpack by
+  #  cd /usr/src/
+  #  tar jxf sl-modem.tar.bz2
+  which opens into:
+    /usr/src/modules/sl-modem/
+  Move in with:
+  # cd /usr/src/modules/sl-modem/drivers
+  for subsequent steps.
+  
+  The routine compiling steps are:
+  # make clean
+  # make
+  # make install 
+A detaile example is  http://linmodems.technion.ac.il/archive-fourth/msg00176.html
+          
+  Also install the wvdial package if your Distro provides it.
+  The wvdialconf provides a first simple test of Hardware + Software functionality.
+  
+ Afterward a test can be performed:
+ # modprobe slamr
+ See a resulting the kernel report with:
+ # dmesg | grep slamr
+ which may contain a line:
+   slamr:  mc97 codec is CodecName
+ with CodecName being a variable diagnostic output.
+ There are 4 cases:
+  a) codec is SILnm , with n,m numbers
+    there are good prospects for the modem being supported by the slmodem resources.
+  b) codec is INT65
+   The Intel_secure-537AA-CurrentVersion should serve, 
+   with slmodem support an alternative for compatible modem controllers.
+  c) codec is CXTnm
+    the softmodem is a Conexant type.  
+    ONLY hsfmodem drivers from http://www.linuxant.com can be utilized.
+    Do remove the slmodem installation first with:
+      # make uninstall
+    before proceeding further.
+  d) codec is BCM64
+    the soft modem has a Broadcom codec and the slmodem-2.9.9d-alsa MUST be used.
+    See http://oboc.ucdavis.edu/Marik/inspiron/ 
+    But readon first for general information
+    
+
+Testing
+-------------------------------------------         
+To being testing , Watch your kernel messages with:
+# tail -f /var/log/messages  &
+The "&" just  backgrounds the process, or else the command prompt is lost.
+The low level interface driver is loaded with:
+# modprobe  Module
+Then
+# slmodemd --help
+just to see what it provides.  
+
+Check for support
+ of your country with:
+# slmodemd --countrylist
+The default is USA.
+# slmodemd --countrylist &> CL.txt
+will write the list to CL.txt if desirable.
+Use your own COUNTRY from the second column for the port creations command:
+
+Simple usage
+-------------------------
+It may be necessary to
+# modprobe upgrab-winmodem 
+before inserting the low level driver:
+# modprobe Module
+where Module is:
+       slamr  for PCI card modems OR
+       slusb  for a USB modem 
+       one of the ALSA drivers mentioned above
+Start the deamon with corresponding:
+# slmodemd -a --c YourCountry  /dev/slamr0   &
+for the PCI card modems
+# slmodemd -a --c YourCountry  /dev/slusb0   &
+for the USB modes
+# slmodemd -a --c YourCountry  hw:1  &
+when using an ALSA driver, except for the ATI modems use:
+# slmodemd -c YourCountry modem:0   &
+
+These commands will creat the real port  /dev/pts/N and a symbolic link
+    /dev/ttySL0 -->  /dev/pts/N
+and provide higher level functions of the slmodem code
+The first functionality test is:
+# vwdialconf  wvdialtest.txt
+if the modem is thus found prospects are good for success.
+
+1) For Redhat and Fedora, use the Internet Wizard within the popup menus to 
+configure a dialout,  A file /etc/wvdial.conf will be created. 
+
+2) For other Linux distros do:
+# wvdialconf /etc/wvdial.conf
+Edit three lines of your personal information into /etc/wvdial.conf,
+replacing the  <text>,    including the < >
+
+In both cases add to  /etc/wvdial.conf  a line needed by slmodemd
+  Carrier Check = no
+Using other dialer utilties (such as KPPP) is OK, and they will not need the:
+     Carrier Check = no
+     
+ However should a "No carrier" message be returned during a dialout attempt see:
+     http://linmodems.technion.ac.il/archive-fifth/msg00552.html
+
+Then try a dialout, with:
+# wvdial & 
+
+ The discretionary " & " just allows recovery of the command prompt.
+ To stop a command thus started:
+ # fg wvdial
+ puts the process in the foreground, so it can be stopped with
+ # Ctrl-C
+ Preferably use wvdial for testing if your distribution provides it. Otherwise use Minicom.
+ If there is a failure to acquire a dial tone, add an X3 in the /etc/wvdial.conf line like:
+   Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
+ to:
+   Init2 = ATQ0 X3 V1 E1 S0=0 &C1 &D2 +FCLASS=0
+ For dialers using a chatscript, the edit would be like:
+   ATQ0X3V1E1S0=0&C1&D2+FCLASS=0
+  
+  Read Modem/Testing.txt for further testing guidance,
+  and Modem/Slmodem-ALSA.txt  for details on ALSA mode.
+ If success has been achieved using the slamr driver, after a while
+ it is worth also testing the slmodem-2.9.9d-alsa or later  resource .
+   but do fully UNINSTALL slmodem-2.9.n first!!!
+ Only the slmodemd for creating ports is provided in ALSA mode
+  The complementing Open Source ALSA
+ drivers comes with kernel-image packages.
+ For the slamr and usb drivers the proxy ports can be displayed with:
+  # ls -l /dev/sl*
+crw-------  1 root root 212, 0 Apr 29  2004 /dev/slamr0
+crw-------  1 root root 212, 1 Apr 29  2004 /dev/slamr1
+crw-------  1 root root 212, 2 Apr 29  2004 /dev/slamr2
+crw-------  1 root root 212, 3 Apr 29  2004 /dev/slamr3
+crw-------  1 root root 213, 0 Apr 29  2004 /dev/slusb0
+crw-------  1 root root 213, 1 Apr 29  2004 /dev/slusb1
+crw-------  1 root root 213, 2 Apr 29  2004 /dev/slusb2
+crw-------  1 root root 213, 3 Apr 29  2004 /dev/slusb3
+  If your System is using the udev file system for devices. A proxy report 
+will NOT be present until the driver is inserted:
+# modprobe slamr
+OR
+# modprobe slusb  
+
+ The slmodem packages way contain a scripts/ folder , with scripts for
+ automating driver loading and port creation upon bootup. For some Systems, 
+ it has proven beneficial to cause a pause after driver loading by inserts
+       sleep 1 (or maybe 2 or 3 if necessary)
+ before the line:
+       echo -n "Starting SmartLink Modem driver for: $SLMODEMD_DEVICE"
+ Without the pause, the driver diagnositics may not complete 
+ before the following step is attempted, with a resultant failure.
+ Call back support is implemented in slmodem-2.9.10 and slmodem-2.9.9b
+See  http://linmodems.technion.ac.il/archive-fifth/msg00219.html
+   
+END 
+cat<<END>>$RECORD
+
+ The Modem/DriverCompiling.txt  is a MUST READ,
+ if you are not experienced in configuring kernel-source/
+ or get "unresolved symbols" upon driver insertion.
+
+  Most recent WinModem fixes are in:  http://linmodems.technion.ac.il/FAQ.html
+  
+(4) For guidance on automation see  http://linmodems.technion.ac.il/archive-fourth/msg03734.html
+and the scripts in the slmodem-2.9.n/scripts folder/
+
+END
+
+if [ "$DISTR" = "debian" ] && ! [ "$BEST"  =  "" ] ; then
+    echo " For Debian users, the kernel-headers-$SYS.deb can be used instead of kernel-source/" >> $RECORD
+    echo >>  $RECORD
+fi
+if [ "$BN" = "scanModem" ] ; then
+  if ! [ "`pwd`" = "/" ] ; then
+    FILES=`ls Modem`
+    cat<<END
+    
+   A subfolder Modem/  has been written,  containing these files with more detailed Information: 
+ ------------------------------------------------------------------------------------------
+ `echo $FILES`  
+-------------------------------------------------------------------------------------------
+       Please read 1stRead.txt first for Guidance.  
+END
+  fi
+
+  if test -z $FAST ; then
+    rm $TMPM $TMPM.* &> /dev/null
+  fi
+else
+  echo  -------------- ending SCANMODEM section ---------------- >>$RECORD
+fi
+echo
+
+
diff --git a/usr_sbin/service b/usr_sbin/service
new file mode 100755 (executable)
index 0000000..948325a
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Filename:      service
+# Purpose:       small wrapper script for /etc/init.d/-script
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+# Latest change: Son Aug 07 12:17:00 CEST 2005 [mika]
+################################################################################
+
+/etc/init.d/$*
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/suspenduser.sh b/usr_sbin/suspenduser.sh
new file mode 100755 (executable)
index 0000000..f5c54e0
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+# Filename:      suspenduser.sh
+# Purpose:       suspend a user account for the indefinite future
+# Authors:       Dave Taylor / http://www.intuitive.com/wicked/showscript.cgi?045-suspenduser.sh
+# Bug-Reports:   see http://grml.org/bugs/
+# Latest change: Sun Jan 15 22:47:34 CET 2006 [mika]
+################################################################################
+
+homedir="/home"                # home directory for users
+secs=10                # seconds before user is logged out
+
+if [ -z "$1" ] ; then
+  echo "Usage: $0 account" >&2 ; exit 1
+elif [ "$(whoami)" != "root" ] ; then
+  echo "Error. You must be 'root' to run this command." >&2; exit 1
+fi
+
+echo "Please change account $1 password to something new."
+passwd $1
+
+# Now, let's see if they're logged in, and if so, boot 'em
+
+if [ ! -z $(who | grep $1) ] ; then
+
+  tty="$(who | grep $1 | tail -1 | awk '{print $2}')"
+
+  cat << "EOF" > /dev/$tty
+
+*************************************************************
+URGENT NOTICE FROM THE ADMINISTRATOR:
+
+This account is being suspended at the request of management. 
+You are going to be logged out in $secs seconds. Please immediately
+shut down any processes you have running and log out.
+
+If you have any questions, please contact your supervisor or 
+John Doe, Director of Information Technology.
+*************************************************************
+EOF
+
+  echo "(Warned $1, now sleeping $secs seconds)"
+
+  sleep $secs
+
+  killall -s HUP -u $1         # send hangup sig to their processes
+  sleep 1                      # give it a second...
+  killall -s KILL -u $1                # and kill anything left
+
+  echo "$(date): $1 was logged in. Just logged them out."
+fi
+
+# Finally, let's close off their home directory from prying eyes:
+
+chmod 000 $homedir/$1
+
+echo "Account $1 has been suspended."
+
+exit 0
+
+## END OF FILE #################################################################
diff --git a/usr_sbin/suspenduser_gui.sh b/usr_sbin/suspenduser_gui.sh
new file mode 100755 (executable)
index 0000000..55f7d53
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Filename:      suspenduser_gui.sh
+# Purpose:       dialog interface for suspend user
+# Authors:       grml-team (grml.org), (c) Nico Golde <nico@grml.org>, (c) Michael Prokop <mika@grml.org>
+# License:       This file is licensed under the GPL v2.
+# Latest change: Thu Jan 12 22:15:45 CET 2006 [mika]
+################################################################################
+
+PATH=${PATH:-'/usr/bin:/usr/sbin'}
+
+if [ "$(whoami)" != "root" ] ; then
+  echo "Error. You must be 'root' to run this command." >&2
+  exit 1
+fi
+
+dialog --stdout --title "Suspend User" --msgbox "Welcome to Suspend User
+
+This script allows you to suspend a user from your system for
+an indefinite time." 8 65
+
+GETUSER=$(dialog --stdout --title "Suspend User" --inputbox "User to suspend:" 0 40) || exit 0
+SUSPENDUSER=${GETUSER%/*}
+suspenduser.sh $SUSPENDUSER
+
+## END OF FILE #################################################################
diff --git a/usr_share/include b/usr_share/include
new file mode 100644 (file)
index 0000000..3942848
--- /dev/null
@@ -0,0 +1,14 @@
+
+Just write the answer next to the ':' in the line.
+If you do not know the answer just leave it empty.
+
+Did the following parts work?
+
+network (network card):
+graphics (framebuffer):
+X window (grml-x):
+
+Did everything work as expected? :
+Did you notice any problems?     :
+Did you miss software?           :
+Did