--- /dev/null
+PROGS = ip-screen pong vmware-detect align cpu-screen dpkg_not_running reread_partition_table
+
+#ifndef CFLAGS
+CFLAGS = -O2 -Wall -s
+#endif
+
+#ifndef LDFALGS
+LDFLAGS = -s
+#endif
+
+#ifndef CC
+CC = gcc
+#endif
+
+all: $(PROGS)
+
+ip-screen: ip-screen.c
+ diet $(CC) $(CFLAGS) -o $@ $^
+
+cpu-screen: cpu-screen.c
+ diet $(CC) $(CFLAGS) -o $@ $^
+
+pong: pong.c
+
+vmware-detect: vmware-detect.c
+ diet $(CC) $(CFLAGS) -o $@ $^
+
+dpkg_not_running: dpkg_not_running.c
+ diet $(CC) $(CFLAGS) -o $@ $^
+
+align: align.c
+ $(CC) -Wall -o align align.c
+
+reread_partition_table: reread_partition_table.c
+ diet $(CC) $(CFLAGS) -o $@ $^
+
+clean:
+ rm -f $(PROGS)
--- /dev/null
+/*
+ * 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;
+}
--- /dev/null
+/*
+ * 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.
+ *******************************************************************************/
+
+#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 */
--- /dev/null
+/* 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.
+*******************************************************************************/
+// 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 ****************************************************************/
--- /dev/null
+/*
+ * 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.
+ *********************************************************************************/
+
+#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 *****************************************************************/
--- /dev/null
+/*
+ * 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);
+}
--- /dev/null
+/*
+ * 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.
+ *******************************************************************************/
+
+// 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);
+ }
+}
+
+int 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]);
+ }
+ return EXIT_SUCCESS;
+}
+
+/* END OF FILE ****************************************************************/
--- /dev/null
+/* Filename: vmware-detect.c
+* Purpose: Detect if running inside vmware
+* 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.
+*******************************************************************************/
+// return 0 if running inside vmware, 1 otherwise
+
+#include "string.h"
+#include "unistd.h"
+#include "stdio.h"
+#include "stdlib.h"
+#include "signal.h"
+
+#define WRITE(x) write(1, x, strlen(x))
+#define DWRITE(x) do{ \
+ if(debug) { \
+ WRITE(x); \
+ } \
+} while(0);
+#define FALSE 0
+#define TRUE !FALSE
+
+/* doc:
+ * vmware IO backdoor: http://chitchat.at.infoseek.co.jp/vmware/backdoor.html
+ * http://www.honeynet.org/papers/bots/botnet-code.html
+ * http://www.codegurus.be/codegurus/Programming/virtualpc&vmware_en.htm
+ */
+
+// from libowfat {{{
+static inline char tohex(char c) {
+ return c>=10?c-10+'a':c+'0';
+}
+
+unsigned int fmt_xlong(char *dest,unsigned long i) {
+ register unsigned long len,tmp;
+ /* first count the number of bytes needed */
+ for (len=1, tmp=i; tmp>15; ++len) tmp>>=4;
+ if (dest)
+ for (tmp=i, dest+=len; ; ) {
+ *--dest = tohex(tmp&15);
+ if (!(tmp>>=4)) break;
+ }
+ return len;
+}
+// }}}
+
+void printIdtr(const unsigned char* idtr, unsigned size)
+{
+ unsigned i;
+ for(i=0; i<size; ++i) {
+ char out[4] = {0};
+ fmt_xlong(out, idtr[i]);
+ if(strlen(out) == 1)
+ WRITE("0");
+ WRITE(out);
+ }
+ WRITE("\n");
+}
+
+// i386 and x86-64 {{{
+#if defined (__i386__) || defined (__x86_64__)
+int checkVmware(const int debug)
+{
+ unsigned char idtr[10] = {0};
+ asm("sidt %0" : "=m" (idtr));
+ if(debug)
+ printIdtr(idtr, sizeof(idtr));
+ // should normally be the case on amd64, but does not work
+ //return (0xff==idtr[9]) ? 1 : 0;
+ return (0xff==idtr[5]) ? 1 : 0;
+}
+int checkVmwareIO()
+{
+ unsigned int vmaj, vmin, magic, dout = 11;
+ __asm__ __volatile__(
+ "mov $0x564D5868, %%eax; /* magic number */"
+ "mov $0x3c6cf712, %%ebx; /* random number */"
+ "mov $0x0000000A, %%ecx; /* specifies command */"
+ "mov $0x5658, %%edx; /* VMware I/O port */"
+ "in %%dx, %%eax;"
+ "mov %%eax, %0;"
+ "mov %%ebx, %1;"
+ "mov %%ecx, %2;"
+ "mov %%edx, %3;"
+ : "=r"(vmaj), "=r"(magic), "=r"(vmin), "=r"(dout));
+#ifdef DEBUG
+ fprintf(stderr, "version: major=%x, minor=%x, magic=%x, dout=%x\n",
+ vmaj, vmin, magic, dout);
+#endif
+ return (0x564D5868 == magic) ? 1 : 0;
+}
+// }}}
+
+// others {{{
+#else
+// vmware runs only on the archs above
+int checkVmware(const int) { return 0; }
+int checkVmwareIO() { return 0; }
+#endif
+// }}}
+
+static int Killed = FALSE;
+
+// returns 0 if running inside vmware, 1 otherwise
+int main(int argc, char* argv[]) {
+ int debug = FALSE;
+ if(argc == 2 && !strcmp(argv[1], "--debug"))
+ debug = TRUE;
+
+ int a, b;
+ // known to be false positives
+ a = checkVmware(debug);
+ DWRITE("idt-check: ")
+ if(!a) {
+ DWRITE("false\n");
+ if(!debug)
+ return EXIT_FAILURE;
+ } else
+ DWRITE("true\n");
+
+ // never returns if not running under vmware
+ void dummy() { Killed=TRUE; DWRITE("false\n"); exit(1); }
+ signal(SIGSEGV, dummy);
+ DWRITE("ioport-check: ");
+ b = checkVmwareIO();
+ if(b) {
+ DWRITE("true\n");
+ return EXIT_SUCCESS;
+ } else {
+ if(!Killed) {
+ // check unuseable or not implemented
+ DWRITE("false\n");
+ DWRITE("Check not implemented, yet!\n");
+ return a ? EXIT_SUCCESS : EXIT_FAILURE;
+ } else {
+ // never reached
+ WRITE("Error: IO check hasn't killed the program but no vmware found either!\n");
+ return EXIT_FAILURE;
+ }
+ }
+}
+// vim: foldmethod=marker
--- /dev/null
+grml-scripts (1.4.2) unstable; urgency=low
+
+ * [68e8f65] grml-screen/grml-init-screen: no longer use vt-is-UTF8 but
+ instead default to UTF-8. [Closes: issue959]
+
+ -- Michael Prokop <mika@grml.org> Mon, 28 Feb 2011 12:31:27 +0100
+
+grml-scripts (1.4.1) unstable; urgency=low
+
+ * [198fea7] Move lzop from Depends to Suggests.
+
+ -- Michael Prokop <mika@grml.org> Mon, 21 Feb 2011 13:26:13 +0100
+
+grml-scripts (1.4.0) unstable; urgency=low
+
+ [ Michael Prokop ]
+ * [0664533] grml-mutt: provide example settings for smtp_{url,pass}.
+ * [c16e65e] Bump Standards-Version to 3.9.1.
+
+ [ Michael Gebetsroither ]
+ * [f9835a0 && others] grml-screen: fix for screen race-conditions on
+ boot [Closes: issue921]
+ * [b006a9c] add depends to lockfile-progs for grml-screen
+ racecondition fix
+ * [0e386ce] grml-screen: output errors to stderr
+
+ -- Michael Prokop <mika@grml.org> Mon, 08 Nov 2010 14:49:46 +0100
+
+grml-scripts (1.3.2) unstable; urgency=low
+
+ * Update iimage version to 38.
+ * grml-chroot: exit with according exit code.
+
+ -- Michael Prokop <mika@grml.org> Fri, 28 May 2010 00:47:26 +0200
+
+grml-scripts (1.3.1) unstable; urgency=low
+
+ [ Matthias Kopfermann ]
+ * Fix tabs inside caps-ctrl.
+
+ -- Michael Prokop <mika@grml.org> Mon, 29 Mar 2010 08:59:44 +0200
+
+grml-scripts (1.3.0) unstable; urgency=low
+
+ [ Matthias Kopfermann ]
+ * caps-ctrl: make sure the script works on non-Grml systems
+ as well.
+
+ [ Michael Prokop ]
+ * grml-lock: avoid shell syntax warning if gdialog/zenity
+ aren't available.
+
+ -- Michael Prokop <mika@grml.org> Wed, 24 Mar 2010 01:15:52 +0100
+
+grml-scripts (1.2.10) unstable; urgency=low
+
+ * grml-hostname: address xauth issue when changing hostname
+ within running X session. Now we can also set the hostname
+ directly within grml-hostname, no need to execute
+ /etc/init.d/hostname.sh manually afterwards any longer.
+
+ -- Michael Prokop <mika@grml.org> Mon, 01 Mar 2010 12:33:17 +0100
+
+grml-scripts (1.2.9) unstable; urgency=low
+
+ * caps-ctrl: using $(...) instead of backticks and do not load
+ colors module any longer. Thanks to Alexander Steinböck.
+ [Closes: issue382]
+
+ -- Michael Prokop <mika@grml.org> Sun, 28 Feb 2010 23:28:16 +0100
+
+grml-scripts (1.2.8) unstable; urgency=low
+
+ * grml-setlang: do not set LC_CTYPE any longer.
+ * zsh-login: do not disable grml-quickconfig for serial console
+ by default, we found a better solution through handling it
+ via inittab.
+
+ -- Michael Prokop <mika@grml.org> Sat, 27 Feb 2010 02:26:58 +0100
+
+grml-scripts (1.2.7) unstable; urgency=low
+
+ * grml-info: improve support for customisation through
+ /usr/share/doc/${distri}-docs/index.html, redirect warnings
+ to /dev/null, support gdialog and zenity for info text display.
+
+ -- Michael Prokop <mika@grml.org> Sun, 21 Feb 2010 00:28:28 +0100
+
+grml-scripts (1.2.6) unstable; urgency=low
+
+ * grml-lock: add support for graphical version via gdialog/zenity.
+
+ -- Michael Prokop <mika@grml.org> Fri, 19 Feb 2010 23:24:52 +0100
+
+grml-scripts (1.2.5) unstable; urgency=low
+
+ * grml-lock: use vlock also for X session and slightly improve
+ its usage.
+
+ -- Michael Prokop <mika@grml.org> Fri, 19 Feb 2010 17:01:31 +0100
+
+grml-scripts (1.2.4) unstable; urgency=low
+
+ * zsh-login:
+ - improve support for customization through /etc/release_info
+ - be more explicit with some checks regarding boot options
+ - disable grml-quickconfig when booting with "serial" (actually
+ check for "console=ttyS" in the cmdline) to avoid any
+ possible conflicts. Thanks to Marc Haber. [Closes: issue474]
+ * Install grml-setservices manpages.
+
+ -- Michael Prokop <mika@grml.org> Tue, 16 Feb 2010 02:14:02 +0100
+
+grml-scripts (1.2.3) unstable; urgency=low
+
+ [ Ulrich Dangel ]
+ * Moved grml-quickconfig to extra package.
+ * Suggest libwebservice-google-suggest-perl for gsuggest.pl
+
+ [ Michael Prokop ]
+ * Bump Standards-Version to 3.8.4 (no further changes).
+
+ -- Michael Prokop <mika@grml.org> Mon, 15 Feb 2010 01:31:46 +0100
+
+grml-scripts (1.2.2) unstable; urgency=low
+
+ * Remove deprecated bt-audio script.
+
+ -- Michael Prokop <mika@grml.org> Sun, 10 Jan 2010 18:30:57 +0100
+
+grml-scripts (1.2.1) unstable; urgency=low
+
+ [ Ulrich Dangel ]
+ * Require xlock in grml-lock if DISPLAY is set. [Closes: issue768]
+
+ [ Michael Prokop ]
+ * iso-term: invoke xterm setting ZSH_NO_DEFAULT_LOCALE=1 (see
+ issue706).
+
+ -- Michael Prokop <mika@grml.org> Fri, 27 Nov 2009 12:36:18 +0100
+
+grml-scripts (1.2.0) unstable; urgency=low
+
+ * Drop usage of $UID in scripts.
+ * Do not use a negative exit value in shellscripts.
+
+ -- Michael Prokop <mika@grml.org> Thu, 29 Oct 2009 13:13:41 +0100
+
+grml-scripts (1.1.28) unstable; urgency=low
+
+ [ Ulrich Dangel ]
+ * replace old osd_server.py with new notifyd.py from
+ http://projects.spamt.net/projects/notifyd
+
+ [ Thomas Koehler ]
+ * Fix identify output in exifinfo.
+
+ -- Michael Prokop <mika@grml.org> Sat, 24 Oct 2009 11:23:46 +0200
+
+grml-scripts (1.1.27) unstable; urgency=low
+
+ [ Ulrich Dangel ]
+ * grml-lang now modifies the keyboard config file.
+ [Closes: issue437]
+
+ [ Michael Prokop ]
+ * zsh-login: do not execute aumix to avoid overriding of the vol
+ bootoption. Thanks to Michael Whapples for the bugreport.
+
+ -- Michael Prokop <mika@grml.org> Sat, 17 Oct 2009 21:58:47 +0200
+
+grml-scripts (1.1.26) unstable; urgency=low
+
+ * Drop deprecated grml-saveconfig package from Suggests.
+ * Drop grml-nessus. Nessus is deprecated since quite some time
+ and got replaced with OpenVAS which doesn't provide plugins
+ any longer as Debian package.
+ * Bump Standards-Version to 3.8.3 (no further changes).
+
+ -- Michael Prokop <mika@grml.org> Wed, 26 Aug 2009 00:19:02 +0200
+
+grml-scripts (1.1.25) unstable; urgency=low
+
+ * Remove all bashisms.
+ * Drop grml-muttng as mutt-ng isn't maintained any longer and
+ we don't ship it since quite some time.
+ * Drop all 'Latest change' references.
+
+ -- Michael Prokop <mika@grml.org> Sat, 08 Aug 2009 00:46:21 +0200
+
+grml-scripts (1.1.24) unstable; urgency=low
+
+ * grml-setlang: do not set $LANGUAGE and $LC_MESSAGES any longer,
+ but instead just set $LANG and $LC_CTYPE. $LC_CTYPE is set to
+ 'en_US.UTF-8' by default and to 'C' if using a ISO system - this
+ should avoid breakages if logging in to a remote system where the
+ according $LANG locale isn't available. Thanks to Gebi and Thorsten
+ 'mira' Glaser for discussing the issue.
+ * Debian packaging:
+ - Install wm-ng as x-window-manager alternative.
+ - Bump Standard-Version to 3.8.2 (no further changes).
+ - Bump Build-Depends on dh >=5.
+ - Update copyright file and overrides to make lintian happy.
+ - Drop postinst and preinst files. The [ef]grep stuff was from the
+ very beginnings of grml and should not affect any systems anymore.
+
+ -- Michael Prokop <mika@grml.org> Fri, 07 Aug 2009 19:24:35 +0200
+
+grml-scripts (1.1.23) unstable; urgency=low
+
+ * Drop symlink for 'service' manpage.
+
+ -- Michael Prokop <mika@grml.org> Wed, 24 Jun 2009 11:40:42 +0200
+
+grml-scripts (1.1.22) unstable; urgency=low
+
+ * Drop the simple service wrapper script, as sysvinit 2.86.ds1-62
+ provides /usr/sbin/service now.
+
+ -- Michael Prokop <mika@grml.org> Wed, 24 Jun 2009 11:33:43 +0200
+
+grml-scripts (1.1.21) unstable; urgency=low
+
+ * wm-ng: start gkrellm on the right side of the screen by default
+ Thanks to gebi and Ulrich Dangel for their feedback.
+ [Closes: issue694]
+
+ -- Michael Prokop <mika@grml.org> Tue, 16 Jun 2009 16:34:00 +0200
+
+grml-scripts (1.1.20) unstable; urgency=low
+
+ * grml-lang and grml-quickconfig: add support for spanish keyboards,
+ thanks to Ernesto Domato!
+
+ -- Michael Prokop <mika@grml.org> Fri, 12 Jun 2009 23:18:13 +0200
+
+grml-scripts (1.1.19) unstable; urgency=low
+
+ [ Michael Prokop ]
+ * Some minor cleanups for lintian:
+ - Cleanup of lintian's override file
+ - Drop unneeded /bin and /sbin from debian/dirs
+ - Bump Standard Version to 3.8.1
+ - Bump Compat Version to 5
+ * grml-info: add support for xlinks2 as dillo isn't available
+ in Debian/unstable due to removal of libgtk1.2
+ [ Frank Terbeck]
+ * exec-wrapper: remove doubled ret=1
+
+ -- Michael Prokop <mika@grml.org> Mon, 18 May 2009 08:17:39 +0200
+
+grml-scripts (1.1.18) unstable; urgency=low
+
+ * Add lzop to Depends. [Closes: issue613]
+ * blacklist: use /etc/modprobe.d/grml.conf instead of
+ /etc/modprobe.d/grml. New module-init-tools will
+ use only files using the .conf suffix.
+ * Add new script grml-exec-wrapper (simple but smart program
+ execution wrapper). Thanks to ft for help.
+ * Fix typo in grml-chroot manpage.
+ * Add ${shlibs:Depends}, ${misc:Depends} to Depends.
+
+ -- Michael Prokop <mika@grml.org> Mon, 06 Apr 2009 09:03:49 +0200
+
+grml-scripts (1.1.17) unstable; urgency=low
+
+ [ Ulrich Dangel ]
+ * osd_server.py uses now the freedesktop.org specification for
+ notification instead of the old xosd way.
+ * Added python-dbus and notification-daemon as suggestion as
+ osd_server.py depends on them.
+ [Closes: issue172]
+
+ [ Michael Prokop ]
+ * Adjust Makefile to get rid of '.sp' sequences in asciidoc
+ manpages. [Closes: issue567]
+
+ -- Michael Prokop <mika@grml.org> Thu, 12 Feb 2009 20:49:56 +0100
+
+grml-scripts (1.1.16) unstable; urgency=low
+
+ [ Michael Prokop ]
+ * Drop orphaned mutt-ng from Suggests.
+ [ Alexander Steinböck ]
+ * grml-hostname: Builtin `source' not available in dash(1).
+
+ -- Michael Prokop <mika@grml.org> Thu, 29 Jan 2009 17:07:48 +0100
+
+grml-scripts (1.1.15) unstable; urgency=low
+
+ [ Michael Gebetsroither ]
+ * grml-chroot:
+ - display usage information additionally to wrong number of arguments
+ - send all parameters to chroot [thx Tong Sun <suntong@cpan.org>
+ for initial patches]
+
+ -- Michael Prokop <mika@grml.org> Sun, 30 Nov 2008 15:13:20 +0100
+
+grml-scripts (1.1.14) unstable; urgency=low
+
+ * Remove arename.pl, thanks ft.
+ [Closes: issue574] [Closes: issue435]
+
+ -- Michael Prokop <mika@grml.org> Sat, 29 Nov 2008 13:04:23 +0100
+
+grml-scripts (1.1.13) unstable; urgency=low
+
+ * grml-info: improve checks for present browsers.
+ Thanks to Charles Hewson for the bugreport.
+
+ -- Michael Prokop <mika@grml.org> Sat, 15 Nov 2008 13:56:58 +0100
+
+grml-scripts (1.1.12) unstable; urgency=low
+
+ * swspeak-setup: start speech-dispatcher before executing speechd-up,
+ do not execute flite on success, otherwise we get tons of
+ "wave_open_sound > Pa_OpenStream : err=-9996 (Invalid device)" error
+ messages (sic).
+
+ -- Michael Prokop <mika@grml.org> Mon, 03 Nov 2008 14:06:15 +0100
+
+grml-scripts (1.1.11) unstable; urgency=low
+
+ * New script swspeak-setup for activating software speak(up) features
+ * Fix typos in grml-chroot manpage.
+ * Update VCS-headers (we're using git nowadays).
+
+ -- Michael Prokop <mika@grml.org> Mon, 03 Nov 2008 00:03:57 +0100
+
+grml-scripts (1.1.10) unstable; urgency=low
+
+ [ Michael Gebetsroither ]
+ * added grml-chroot including manpage
+ * added xsltproc, docbook-xsl, asciidoc to build dependencies
+
+ [ Michael Prokop ]
+ * Bump Standard-Version to 3.8.0 (no further changes).
+ * Drop deprecated xbase-clients package from Suggests.
+
+ -- Michael Prokop <mika@grml.org> Fri, 26 Sep 2008 01:26:37 +0200
+
+grml-scripts (1.1.9) unstable; urgency=low
+
+ * grml-quickconfig: integrate jwm [thanks for bringing up,
+ Dietmar Kirchmayr]
+
+ -- Michael Prokop <mika@grml.org> Tue, 25 Mar 2008 20:37:30 +0100
+
+grml-scripts (1.1.8) unstable; urgency=low
+
+ * zsh-login: fix noquick bootoption
+
+ -- Michael Prokop <mika@grml.org> Sun, 09 Mar 2008 15:11:59 +0100
+
+grml-scripts (1.1.7) unstable; urgency=low
+
+ * grml-info: improve tests for available browser.
+ [Testing: issue428]
+
+ -- Michael Prokop <mika@grml.org> Sun, 09 Mar 2008 13:57:46 +0100
+
+grml-scripts (1.1.6) unstable; urgency=low
+
+ * grml-quickconfig: get rid of pwm3.
+
+ -- Michael Prokop <mika@grml.org> Sun, 24 Feb 2008 13:55:51 +0100
+
+grml-scripts (1.1.5) unstable; urgency=low
+
+ * grml-quickconfig: integrate awesome (thanks for hint, wuehlmaus)
+
+ -- Michael Prokop <mika@grml.org> Mon, 18 Feb 2008 13:31:54 +0100
+
+grml-scripts (1.1.4) unstable; urgency=low
+
+ * zsh-login: integrate utf8 workaround [Testing: issue377]
+
+ -- Michael Prokop <mika@grml.org> Wed, 23 Jan 2008 11:27:49 +0100
+
+grml-scripts (1.1.3) unstable; urgency=low
+
+ * grml-mutt: deactivate force_name, and save_name by default,
+ activate quit=ask-yes by default. Thanks, Michael Hammer.
+ * soundtest: improve checks for player and install a symlink
+ /usr/bin/grml-soundtest pointing to /usr/bin/soundtest.
+ Thanks, Darshaka Pathirana. [Closes: issue360]
+
+ -- Michael Prokop <mika@grml.org> Sat, 19 Jan 2008 16:59:03 +0100
+
+grml-scripts (1.1.2) unstable; urgency=low
+
+ * bt-audio: check for presence of snd-bt-sco and provide an
+ informational error message if it isn't present.
+
+ -- Michael Prokop <mika@grml.org> Mon, 14 Jan 2008 20:36:33 +0100
+
+grml-scripts (1.1.1) unstable; urgency=low
+
+ * zsh-login: display version information depending on the present
+ grml version.
+
+ -- Michael Prokop <mika@grml.org> Fri, 21 Dec 2007 22:12:21 +0100
+
+grml-scripts (1.1.0) unstable; urgency=low
+
+ * grml-quickconfig: fix keybindings for pekwm vs. pwm3 and drop jwm.
+ Thanks for reporting, Alex Liebert!
+
+ -- Michael Prokop <mika@grml.org> Mon, 17 Dec 2007 22:26:41 +0100
+
+grml-scripts (1.0.29) unstable; urgency=low
+
+ * Switch order of Depends 'w3m | links | links2' to
+ 'links | w3m | links2'.
+
+ -- Michael Prokop <mika@grml.org> Sun, 16 Dec 2007 19:46:54 +0100
+
+grml-scripts (1.0.28) unstable; urgency=low
+
+ * grml-quickconfig: sorting the order of the window manager
+ list and removing the duplicated dwm. Thanks for reporting,
+ Martin Brassel! [Closes: issue356]
+
+ -- Michael Prokop <mika@grml.org> Fri, 07 Dec 2007 00:21:36 +0100
+
+grml-scripts (1.0.27) unstable; urgency=low
+
+ * grml-quickconfig: it is wm-ng and not wmi-ng of course.
+ Thanks to Martin Brassel!
+ * grml-setkeyboard: sort all entries alphabetically
+ Thanks to Martin Brassel!
+
+ -- Michael Prokop <mika@grml.org> Sat, 01 Dec 2007 11:05:48 +0100
+
+grml-scripts (1.0.26) unstable; urgency=low
+
+ * grml-quickconfig: removed useless sleep
+
+ -- Michael Gebetsroither <gebi@grml.org> Sat, 17 Nov 2007 22:40:44 +0100
+
+grml-scripts (1.0.25) unstable; urgency=low
+
+ [ Michael Gebetsroither ]
+ * Add script grml-init-multitail.
+
+ [ Michael Prokop ]
+ * Add manpage for grml-init-multitail.
+
+ -- Michael Prokop <mika@grml.org> Thu, 15 Nov 2007 23:39:09 +0100
+
+grml-scripts (1.0.24) unstable; urgency=low
+
+ * Drop runit manpage. Thanks for the hint, gebi.
+
+ -- Michael Prokop <mika@grml.org> Tue, 30 Oct 2007 10:38:15 +0100
+
+grml-scripts (1.0.23) unstable; urgency=low
+
+ * Drop the DEBHELPER from maintainer scripts.
+
+ -- Michael Prokop <mika@grml.org> Sun, 28 Oct 2007 17:37:33 +0100
+
+grml-scripts (1.0.22) unstable; urgency=low
+
+ [ Frank Terbeck ]
+ * Adding arename.pl (and according manpage arename.pl.1).
+
+ [ Michael Prokop ]
+ * Make package lintian clean.
+
+ -- Michael Prokop <mika@grml.org> Sun, 28 Oct 2007 17:19:25 +0100
+
+grml-scripts (1.0.21) unstable; urgency=low
+
+ * zsh-login: drop the hostname in the welcome message as
+ the grml-version should provide it already.
+
+ -- Michael Prokop <mika@grml.org> Sun, 28 Oct 2007 15:44:20 +0100
+
+grml-scripts (1.0.20) unstable; urgency=low
+
+ * grml-hostname: adjust /etc/mailname as well
+
+ -- Michael Prokop <mika@grml.org> Sat, 27 Oct 2007 23:43:17 +0200
+
+grml-scripts (1.0.19) unstable; urgency=low
+
+ * grml2ram: adjust for usage with new live-initramfs layout.
+ Apply patch by Moritz Augsburger for identifying /dev/cdrom.
+ * Adjust prepare_ramdisk.sh and prepare_tmpfs.sh for live-initramfs.
+ [Closes: issue277]
+
+ -- Michael Prokop <mika@grml.org> Sun, 30 Sep 2007 16:04:31 +0200
+
+grml-scripts (1.0.18) unstable; urgency=low
+
+ * qma: pipe output through 'col -b' to fix issues with UTF-8.
+ Thanks for the solution, wuehlmaus!
+
+ -- Michael Prokop <mika@grml.org> Thu, 20 Sep 2007 21:57:21 +0200
+
+grml-scripts (1.0.17) unstable; urgency=low
+
+ * Drop console-tools from depends and move it to grml-autoconfig
+ instead.
+
+ -- Michael Prokop <mika@grml.org> Thu, 20 Sep 2007 17:25:16 +0200
+
+grml-scripts (1.0.16) unstable; urgency=low
+
+ * Change "console-tools | xbase-clients" into dependency on
+ console-tools and put xbase-clients to Suggests instead.
+ * Drop "runit", which very probably nobody uses at all but which
+ conflicts with package runit (thanks for hint, gebi).
+
+ -- Michael Prokop <mika@grml.org> Thu, 20 Sep 2007 17:19:13 +0200
+
+grml-scripts (1.0.15) unstable; urgency=low
+
+ * grml-setkeyboard: add one further LANG=C dialog run and
+ use check4root from script-functions.
+
+ -- Michael Prokop <mika@grml.org> Wed, 5 Sep 2007 19:08:34 +0200
+
+grml-scripts (1.0.14) unstable; urgency=low
+
+ * grml-setkeyboard: execute dialog using LANG=C
+ * grml-setlang: execute dialog using LANC=C and adjust modification
+ of /etc/default/locale according to what Debian ships now.
+
+ -- Michael Prokop <mika@grml.org> Wed, 5 Sep 2007 18:33:35 +0200
+
+grml-scripts (1.0.13) unstable; urgency=low
+
+ * iso-term: support additional arguments on the commandline so they
+ reach the final terminal
+
+ -- Michael Prokop <mika@grml.org> Mon, 3 Sep 2007 23:31:41 +0200
+
+grml-scripts (1.0.12) unstable; urgency=low
+
+ * dirvish-setup: check for existence of dialog as well
+
+ -- Michael Prokop <mika@grml.org> Thu, 26 Jul 2007 17:21:36 +0200
+
+grml-scripts (1.0.11) unstable; urgency=low
+
+ * grml-setservices: support HAL daemon
+ * grml-mutt:
+ - change 'set autoedit' into 'unset autoedit'
+ - add 'set auto_tag=yes'
+ - set postponed=+postponed
+ - add deactivated:
+ * set sendmail="/usr/bin/msmtp"
+ * set use_envelope_from
+
+ -- Michael Prokop <mika@grml.org> Wed, 25 Jul 2007 18:35:08 +0200
+
+grml-scripts (1.0.10) unstable; urgency=low
+
+ * grml-setservices: support NFS
+
+ -- Michael Prokop <mika@grml.org> Wed, 18 Jul 2007 02:16:18 +0200
+
+grml-scripts (1.0.9) unstable; urgency=low
+
+ * grml-hostname: adjust mydestination as well in /etc/postfix/main.cf.
+
+ -- Michael Prokop <mika@grml.org> Wed, 11 Jul 2007 21:31:52 +0200
+
+grml-scripts (1.0.8) unstable; urgency=low
+
+ * cpufreq-detect.sh: merge in code from /etc/init.d/loadcpufreq for
+ using acpi-cpufreq on systems supporting est when using kernel
+ >=2.6.20. [Related to issue238]
+
+ -- Michael Prokop <mika@grml.org> Wed, 04 Jul 2007 12:16:10 +0200
+
+grml-scripts (1.0.7) unstable; urgency=low
+
+ * grml-setservices: support lvm [Closes: issue239]
+
+ -- Michael Prokop <mika@grml.org> Wed, 04 Jul 2007 10:53:51 +0200
+
+grml-scripts (1.0.6) unstable; urgency=low
+
+ * zsh-login: support bootoptions startup (allow execution
+ of script/program via bootoption startup=$script) and nowelcome
+ (do not print welcome screen at all) and use /etc/hostname
+ as distribution name within welcome screen.
+
+ -- Michael Prokop <mika@grml.org> Sat, 23 Jun 2007 23:55:14 +0200
+
+grml-scripts (1.0.5) unstable; urgency=low
+
+ [Michael Prokop]
+ * grml-quickconfig: replace ion3 with openbox
+
+ [Michael Gebetsroither]
+ * vmware-detect.c: adding header
+
+ -- Michael Prokop <mika@grml.org> Sat, 23 Jun 2007 00:05:06 +0200
+
+grml-scripts (1.0.4) unstable; urgency=low
+
+ * zsh-login: do not run grml-quickconfig when bootoption startx
+ is present. Thanks for the bugreport, Darshaka Pathirana!
+
+ -- Michael Prokop <mika@grml.org> Sun, 10 Jun 2007 13:11:38 +0200
+
+grml-scripts (1.0.3) unstable; urgency=low
+
+ * grml-lang: support dvorak keyboard layout
+ * grml-lock: support fast execution on hd-install [Closes: issue220]
+
+ -- Michael Prokop <mika@grml.org> Mon, 04 Jun 2007 22:33:36 +0200
+
+grml-scripts (1.0.2) unstable; urgency=low
+
+ * grml-lang: add support for 'jp'.
+
+ -- Michael Prokop <mika@grml.org> Mon, 28 May 2007 13:30:11 +0200
+
+grml-scripts (1.0.1) unstable; urgency=low
+
+ * grml-lock: allow using it on grml-small too. Thanks for
+ information, Niklas Schnelle!
+
+ -- Michael Prokop <mika@grml.org> Wed, 16 May 2007 22:35:29 +0200
+
+grml-scripts (1.0.0) unstable; urgency=low
+
+ * We have a new stable release!
+
+ -- Michael Prokop <mika@grml.org> Sun, 13 May 2007 11:20:30 +0200
+
+grml-scripts (0.9.47) unstable; urgency=low
+
+ * grml-lock: provide quit option in welcome screen.
+
+ -- Michael Prokop <mika@grml.org> Sun, 6 May 2007 15:52:36 +0200
+
+grml-scripts (0.9.46) unstable; urgency=low
+
+ * grml-iptstate: check for '_conntrack' module instead of
+ ip_conntrack, some formating changes.
+
+ -- Michael Prokop <mika@grml.org> Sun, 6 May 2007 11:14:30 +0200
+
+grml-scripts (0.9.45) unstable; urgency=low
+
+ * bt-audio: use /etc/grml/script-functions, some more small
+ improvements in status messages.
+ * grml-setlang: fix small typo, it's package locales and not
+ locale of course. Thanks for notifying, David Vilar Benet!
+ * xsay: add support for sselp and xclip; output error message
+ if not a single binary for reading X selection can be found.
+
+ -- Michael Prokop <mika@grml.org> Sat, 28 Apr 2007 17:32:47 +0200
+
+grml-scripts (0.9.44) unstable; urgency=low
+
+ * Depend on libterm-readkey-perl as it is needed for grml-quickconfig.
+
+ -- Michael Prokop <mika@grml.org> Sat, 21 Apr 2007 12:52:11 +0200
+
+grml-scripts (0.9.43) unstable; urgency=low
+
+ * Stop shipping gtf binary and manpage as server-xorg-core
+ (version 2:1.2.99.905-2) ships it now.
+
+ -- Michael Prokop <mika@grml.org> Fri, 20 Apr 2007 14:13:29 +0200
+
+grml-scripts (0.9.42) unstable; urgency=low
+
+ * mkdosswapfile: remove german umlauts to avoid utf8 console problem.
+
+ -- Michael Prokop <mika@grml.org> Fri, 20 Apr 2007 00:40:22 +0200
+
+grml-scripts (0.9.41) unstable; urgency=low
+
+ * grml-setservices: do not execute mdadm-raid when deactivating
+ mdadm as well.
+ * Drop gcc and libc6-dev from Build-Depends (it's part of build-essential).
+
+ -- Michael Prokop <mika@grml.org> Sun, 15 Apr 2007 10:57:24 +0200
+
+grml-scripts (0.9.40) unstable; urgency=low
+
+ * Rename get_tw_cli into get_3ware as we support 3DM2 as well now,
+ updated the software versions and providing release-note URLs
+ as well.
+
+ -- Michael Prokop <mika@grml.org> Sat, 14 Apr 2007 10:59:21 +0200
+
+grml-scripts (0.9.39) unstable; urgency=low
+
+ [Alexander Wirt]
+ * grml-quickconfig: fix while-loop causing high cpu-load ->
+ sleep 0.5 secs between keyboard polling
+
+ -- Michael Prokop <mika@grml.org> Thu, 12 Apr 2007 17:14:58 +0200
+
+grml-scripts (0.9.38) unstable; urgency=low
+
+ * update of grml-quickconf:
+ [Alexander Wirt]
+ - fixed indenting
+ - reset inputbuffering properly (switch to Term::Readkey
+ instead of getc) [Testing: #194]
+ - update list of window managers
+ [Michael Prokop]
+ - update list of window managers once more
+ - update 'Unknown key'-tex for grml-x
+ - replace tabs with spaces, add vim-line to EOF
+
+ -- Michael Prokop <mika@grml.org> Thu, 12 Apr 2007 13:40:46 +0200
+
+grml-scripts (0.9.37) unstable; urgency=low
+
+ * grml-lang: execute 'kbd_mode -u' when running in utf8 mode
+ on plain console
+
+ -- Michael Prokop <mika@grml.org> Mon, 9 Apr 2007 13:04:16 +0200
+
+grml-scripts (0.9.36) unstable; urgency=low
+
+ * grml-setservices: execute update-rc.d commands only for present
+ software packages
+ * grml-setlang: fix handling of check for supported languages
+
+ -- Michael Prokop <mika@grml.org> Sun, 1 Apr 2007 11:00:34 +0200
+
+grml-scripts (0.9.35) unstable; urgency=low
+
+ * zsh-login: drop nocolor check as grml-quickconfig can handle
+ it on its own; do not run grml-quickconfig on grml-small.
+
+ -- Michael Prokop <mika@grml.org> Thu, 29 Mar 2007 16:02:09 +0200
+
+grml-scripts (0.9.34) unstable; urgency=low
+
+ * Makefile fixes for align.c, -O2 produces wrong results.
+ * Update of vmware-detect so we should have less false positives,
+ including an update for amd64.
+
+ -- Michael Gebetsroither <gebi@grml.org> Wed, 28 Mar 2007 14:02:26 +0200
+
+grml-scripts (0.9.33) unstable; urgency=low
+
+ * grml*screen-scripts: use vt-is-UTF8 with quiet option, otherwise
+ detection of non-UTF8 terminals fails for us. Thanks for the
+ bug report, Gebi!
+
+ -- Michael Prokop <mika@grml.org> Wed, 21 Mar 2007 15:39:10 +0100
+
+grml-scripts (0.9.32) unstable; urgency=low
+
+ * Added alignmargins (adjust the margins and the position of the printed
+ contents on the paper). Thanks for suggestion, Moritz Augsburger!
+ [Closes: issue146]
+
+ -- Michael Prokop <mika@grml.org> Sun, 18 Mar 2007 19:34:12 +0100
+
+grml-scripts (0.9.31) unstable; urgency=low
+
+ * Added xlockmore to suggests, added check for vlock in grml-lock.
+ * Check for mutt/muttng binaries in grml-mutt[ng]. Removed deprecated
+ URL in grml-muttng.
+ * Added check4progs to grml-slrn.
+
+ -- Michael Prokop <mika@grml.org> Sun, 18 Mar 2007 16:44:53 +0100
+
+grml-scripts (0.9.30) unstable; urgency=low
+
+ * Added idesk to Suggests.
+
+ -- Michael Prokop <mika@grml.org> Sun, 18 Mar 2007 15:43:54 +0100
+
+grml-scripts (0.9.29) unstable; urgency=low
+
+ * Really depend on sudo. :)
+
+ -- Michael Prokop <mika@grml.org> Sun, 18 Mar 2007 00:28:35 +0100
+
+grml-scripts (0.9.28) unstable; urgency=low
+
+ * Add less to depends.
+
+ -- Michael Prokop <mika@grml.org> Sun, 18 Mar 2007 00:02:26 +0100
+
+grml-scripts (0.9.27) unstable; urgency=low
+
+ * Depend on sudo, we definitely need it.
+
+ -- Michael Prokop <mika@grml.org> Sat, 17 Mar 2007 23:47:11 +0100
+
+grml-scripts (0.9.26) unstable; urgency=low
+
+ * Added iso-term (wrapper script to run x-terminal-emulator in iso885915
+ mode).
+
+ -- Michael Prokop <mika@grml.org> Sat, 17 Mar 2007 19:59:09 +0100
+
+grml-scripts (0.9.25) unstable; urgency=low
+
+ * zsh-login: do not run grml-quickconfig when booting with 'nocolor'
+
+ -- Michael Prokop <mika@grml.org> Sat, 17 Mar 2007 15:17:10 +0100
+
+grml-scripts (0.9.24) unstable; urgency=low
+
+ * grml-setlang: do not set $TZ anymore, we want to handle it
+ via /etc/timezone.
+ * Integrate grml-quickconfig within zsh-login. grml-quickconfig
+ has been contributed by Michael Schierl - thanks!
+ [Closes: issue97]
+
+ -- Michael Prokop <mika@grml.org> Fri, 16 Mar 2007 22:49:34 +0100
+
+grml-scripts (0.9.23) unstable; urgency=low
+
+ * Added grml-setservices (interface for basic configuration of system
+ startup/shutdown via /etc/runlevel.conf) [Closes: issue89]
+ * Removed todo note from manpage of grml-setkeyboard.
+
+ -- Michael Prokop <mika@grml.org> Fri, 16 Mar 2007 21:54:31 +0100
+
+grml-scripts (0.9.22) unstable; urgency=low
+
+ * dirvish-setup: support setting of tree (directory) that should
+ be included in the backup, do not move master.conf but create
+ it only if it does not exist yet.
+
+ -- Michael Prokop <mika@grml.org> Fri, 9 Mar 2007 19:46:11 +0100
+
+grml-scripts (0.9.21) unstable; urgency=low
+
+ * Fix for myip, thanks to wuehlmaus and schula.
+
+ -- Michael Prokop <mika@grml.org> Thu, 1 Mar 2007 14:58:05 +0100
+
+grml-scripts (0.9.20) unstable; urgency=low
+
+ * Updated make_chroot_jail to latest upstream version.
+ Thanks for notification, Wolfgang Fuschlberger!
+ * Updated iimage to latest upstream version (37).
+
+ -- Michael Prokop <mika@grml.org> Sat, 24 Feb 2007 13:14:40 +0100
+
+grml-scripts (0.9.19) unstable; urgency=low
+
+ * Add dirvish-setup, a simple script for setting up a basic
+ configuration for backup software dirvish.
+ => added dirvish to Suggests.
+
+ -- Michael Prokop <mika@grml.org> Fri, 23 Feb 2007 23:54:12 +0100
+
+grml-scripts (0.9.18) unstable; urgency=low
+
+ * Remove unicode stuff from zsh-login.
+
+ -- Michael Prokop <mika@grml.org> Sat, 17 Feb 2007 13:58:23 +0100
+
+grml-scripts (0.9.17) unstable; urgency=low
+
+ * grml-init-screen + grml-screen: check for UTF capable
+ terminal and use option '-U' then
+
+ -- Michael Prokop <mika@grml.org> Sat, 17 Feb 2007 12:16:54 +0100
+
+grml-scripts (0.9.16) unstable; urgency=low
+
+ * grml-hostname: support non-interactive mode and do not
+ set hostname via hostname(1) but write to according
+ files only so it does not break for example running X.
+
+ -- Michael Prokop <mika@grml.org> Tue, 13 Feb 2007 12:08:39 +0100
+
+grml-scripts (0.9.15) unstable; urgency=low
+
+ * The "I love working on new architectures! :)" release.
+ * Add gcc and libc6-dev to Build-Depends.
+
+ -- Michael Prokop <mika@grml.org> Fri, 9 Feb 2007 17:47:15 +0100
+
+grml-scripts (0.9.14) unstable; urgency=low
+
+ * Remove grml-bind, it's deprecated nowadays. [Closes: issue104]
+
+ -- Michael Prokop <mika@grml.org> Wed, 7 Feb 2007 08:47:49 +0100
+
+grml-scripts (0.9.13) unstable; urgency=low
+
+ * The 'fix bashism in several scripts' release. Thanks
+ to ft for the patches!
+
+ - say: fix bashism [Closes: issue114]
+ - make_chroot_jail: fix bashism [Closes: issue113]
+ - grml-start: fix bashism [Closes: issue112]
+ - grml-slrn: fix bashism [Closes: issue111]
+ - grml-muttng: fix bashism [Closes: issue110]
+ - grml-mutt: fix bashism [Closes: issue109]
+ - grml-lang: fix bashism [Closes: issue108]
+ - grml-config: fix bashism [Closes: issue107]
+ - grml-config-user: fix bashism [Closes: issue106]
+ - grml-config-root: fix bashism [Closes: issue105]
+ - attach-screen: fix bashism [Closes: issue103]
+
+ -- Michael Prokop <mika@grml.org> Tue, 6 Feb 2007 20:38:40 +0100
+
+grml-scripts (0.9.12) unstable; urgency=low
+
+ * Update make_chroot_jail script (see
+ http://www.fuschlberger.net/programs/ssh-scp-chroot-jail/ for
+ details), thanks for noticing - Wolfgang Fuschlberger!
+
+ -- Michael Prokop <mika@grml.org> Wed, 24 Jan 2007 22:32:43 +0100
+
+grml-scripts (0.9.11) unstable; urgency=low
+
+ * Added script gsuggest.pl: google suggest - ask google for
+ keyword suggestions
+
+ -- Michael Prokop <mika@grml.org> Wed, 10 Jan 2007 23:49:16 +0100
+
+grml-scripts (0.9.10) unstable; urgency=low
+
+ * grml-slrn: do not activate 'set charset isolatin' and
+ 'set mime_charset "iso-8859-15"' by default so slrn works in
+ UTF-8 mode as well.
+ * zsh-login: run unicode_start if running inside utf environment
+
+ -- Michael Prokop <mika@grml.org> Mon, 18 Dec 2006 00:31:57 +0100
+
+grml-scripts (0.9.9) unstable; urgency=low
+
+ * grml-hostname: do not execute 'hostname $NEWHOSTNAME', the
+ initscript should handle that for us.
+
+ -- Michael Prokop <mika@grml.org> Sun, 17 Dec 2006 17:47:27 +0100
+
+grml-scripts (0.9.8) unstable; urgency=low
+
+ * grml-setlang: use utf8 as default. Get iso stuff via $LANG-iso,
+ utf8 via $LANG or $LANG-utf8. Add grml-autoconfig (>= 0.6.9)
+ to Suggests as grml-setlang requires current language functions.
+ * Add S-X-Vcs-Hg entry to debian/control.
+
+ -- Michael Prokop <mika@grml.org> Sat, 16 Dec 2006 18:21:58 +0100
+
+grml-scripts (0.9.7) unstable; urgency=low
+
+ * qma: update vim config [thanks, wuehlmaus]
+
+ -- Michael Prokop <mika@grml.org> Sat, 16 Dec 2006 17:24:34 +0100
+
+grml-scripts (0.9.6) unstable; urgency=low
+
+ * Added grml2ram: copy compressed GRML image to RAM
+ based on script by Michael Schierl <schierlm-public@gmx.de>, thanks!
+
+ -- Michael Prokop <mika@grml.org> Tue, 12 Dec 2006 19:58:09 +0100
+
+grml-scripts (0.9.5) unstable; urgency=low
+
+ * qma: use vim in less-like mode, thanks - wuehlmaus!
+
+ -- Michael Prokop <mika@grml.org> Mon, 4 Dec 2006 22:56:50 +0100
+
+grml-scripts (0.9.4) unstable; urgency=low
+
+ * qma: fix missing $SEARCH (thanks for noticing, wuehlmaus).
+
+ -- Michael Prokop <mika@grml.org> Sun, 3 Dec 2006 00:24:06 +0100
+
+grml-scripts (0.9.3) unstable; urgency=low
+
+ * random-hostname: add idspispopd, kitchensink and spispopd to
+ list of hostnames, contributed by Hendrik Scholz.
+
+ -- Michael Prokop <mika@grml.org> Sat, 2 Dec 2006 20:30:32 +0100
+
+grml-scripts (0.9.2) unstable; urgency=low
+
+ * fma has been renamed into qma. Supports "directly jump to
+ keyword" now. (Closes: issue19)
+
+ -- Michael Prokop <mika@grml.org> Sat, 2 Dec 2006 18:46:31 +0100
+
+grml-scripts (0.9.1) unstable; urgency=low
+
+ * New version number for new release.
+
+ -- Michael Prokop <mika@grml.org> Sun, 26 Nov 2006 19:21:58 +0100
+
+grml-scripts (0.8-32) unstable; urgency=low
+
+ * Add script grml-swapon for activating swap partitions.
+
+ -- Michael Prokop <mika@grml.org> Sun, 26 Nov 2006 18:13:34 +0100
+
+grml-scripts (0.8-31) unstable; urgency=low
+
+ * fma: use '-U' option for lzop as suggested by wuehlmaus in
+ http://bts.grml.org/grml/issue19
+
+ -- Michael Prokop <mika@grml.org> Sun, 26 Nov 2006 17:20:53 +0100
+
+grml-scripts (0.8-30) unstable; urgency=low
+
+ * Update script fex, thanks - wuehlmaus! (Closes: issue18)
+
+ -- Michael Prokop <mika@grml.org> Sat, 25 Nov 2006 21:37:33 +0100
+
+grml-scripts (0.8-29) unstable; urgency=low
+
+ * Rewrite of caps-ctrl, big thanks to wuehlmaus!
+
+ -- Michael Prokop <mika@grml.org> Thu, 23 Nov 2006 22:35:54 +0100
+
+grml-scripts (0.8-28) unstable; urgency=low
+
+ * fma: added hint to lzop and updated header information
+
+ -- Michael Prokop <mika@grml.org> Sun, 12 Nov 2006 12:03:20 +0100
+
+grml-scripts (0.8-27) unstable; urgency=low
+
+ * fma: don't use $0 inside usage-function but hardcode program
+ name instead.
+ * Remove /etc/grml/script-functions and ship it via package
+ grml-etc-core. Depend on package grml-etc-core therefore.
+
+ -- Michael Prokop <mika@grml.org> Sat, 28 Oct 2006 13:20:50 +0200
+
+grml-scripts (0.8-26) unstable; urgency=low
+
+ * Split out network related scripts into package grml-network,
+ depend on it therefore.
+ * Added script fma (fast manual access, thanks for the idea -
+ wuehlmaus!), added lzop to Suggests.
+ * Another cleanup of debian/rules.
+ * Updated debian/overrides.
+ * Added XS-X-Vcs-Hg: header to debian/control, see
+ http://www.bononia.it/~zack/blog/posts/xs-x-vcs-XXX.html
+
+ -- Michael Prokop <mika@grml.org> Sat, 28 Oct 2006 00:23:41 +0200
+
+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
+
--- /dev/null
+Source: grml-scripts
+Section: utils
+Priority: optional
+Maintainer: Michael Prokop <mika@grml.org>
+Uploaders: Michael Gebetsroither <gebi@grml.org>
+Build-Depends: debhelper (>= 5), dietlibc-dev, xsltproc, docbook-xsl, asciidoc
+Standards-Version: 3.9.1
+Homepage: http://git.grml.org/?p=grml-scripts.git
+Vcs-git: git://git.grml.org/grml-scripts.git
+Vcs-Browser: http://git.grml.org/?p=grml-scripts.git
+
+Package: grml-scripts
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, less, dialog, perl, zsh, dash, links | w3m | links2, screen, grml-network, grml-etc-core, libterm-readkey-perl, lockfile-progs
+Suggests: ruby, python, grml-x, ipcalc, hwinfo, antiword, grml-etc, grml-rebuildfstab, grml-files, grml-hwinfo, pptp-linux, flite, wmii, mutt, slrn, grml-docs, grml-autoconfig (>= 0.6.9), dirvish, sudo, idesk, xlockmore, python-dbus, notification-daemon, grml-quickconfig, libwebservice-google-suggest-perl, lzop
+Conflicts: scanmodem, grml-etc-core (<< 0.1-30)
+Description: some small scripts which should make life easier
+ Some scripts which should make life easier. For example:
+ code2color, grml-mutt, 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.
--- /dev/null
+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:
+
+ Copyright (c) 2003+ by the grml team and others.
+
+ This package 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-2'.
--- /dev/null
+etc/grml
+etc/postfix
+usr/bin
+usr/sbin
+usr/share/grml-scripts
--- /dev/null
+grml-scripts: executable-not-elf-or-script ./usr/bin/tinyp2p.py
+grml-scripts: executable-not-elf-or-script ./usr/bin/wwwis
+grml-scripts: script-with-language-extension usr/bin/bincompare.pl
+grml-scripts: script-with-language-extension usr/bin/cpufreq-detect.sh
+grml-scripts: script-with-language-extension usr/bin/cpu-screen.sh
+grml-scripts: script-with-language-extension usr/bin/gsuggest.pl
+grml-scripts: script-with-language-extension usr/bin/hgrep.sh
+grml-scripts: script-with-language-extension usr/bin/irclog2html-2.1.pl
+grml-scripts: script-with-language-extension usr/bin/lesspipe.sh
+grml-scripts: script-with-language-extension usr/bin/notifyd.py
+grml-scripts: script-with-language-extension usr/bin/sepdate.pl
+grml-scripts: script-with-language-extension usr/bin/sepdate.rb
+grml-scripts: script-with-language-extension usr/bin/sepdate.sh
+grml-scripts: script-with-language-extension usr/bin/tinyp2p.py
+grml-scripts: script-with-language-extension usr/bin/unbleach.pl
+grml-scripts: script-with-language-extension usr/sbin/ndiswrapper.sh
+grml-scripts: script-with-language-extension usr/sbin/prepare_ramdisk.sh
+grml-scripts: script-with-language-extension usr/sbin/prepare_tmpfs.sh
+grml-scripts: script-with-language-extension usr/sbin/suspenduser_gui.sh
+grml-scripts: script-with-language-extension usr/sbin/suspenduser.sh
+grml-scripts: statically-linked-binary ./usr/bin/cpu-screen
+grml-scripts: statically-linked-binary ./usr/bin/ip-screen
+grml-scripts: statically-linked-binary ./usr/bin/vmware-detect
+grml-scripts: statically-linked-binary ./usr/sbin/dpkg_not_running
+grml-scripts: statically-linked-binary ./usr/sbin/reread_partition_table
--- /dev/null
+#!/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
+
+build: build-stamp
+
+build-stamp:
+ dh_testdir
+ ( cd $(CURDIR)/compile/ && make )
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+
+ # Add here commands to clean up after the build process.
+ rm -rf $(CURDIR)/debian/grml-scripts/
+ ( cd compile ; make clean )
+ ( cd doc && 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 -a usr_bin/* debian/grml-scripts/usr/bin/
+ cp -a usr_sbin/* debian/grml-scripts/usr/sbin/
+ cp -a usr_share/* debian/grml-scripts/usr/share/grml-scripts/
+ 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/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
+
+# Build architecture-independent files here.
+binary-indep: build install
+ ( cd $(CURDIR)/doc && make doc_man )
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installwm --priority=20 /usr/bin/wm-ng
+ dh_installman $(wildcard doc/*.gz)
+ dh_installman manpages/grml-scripts.1 \
+ manpages/reread_partition_table.8 manpages/random-hostname.1 \
+ manpages/grml-setkeyboard.8 manpages/grml-setlang.8 manpages/getsf.1 \
+ manpages/grml-iptstate.8 manpages/qma.1 manpages/grml-swapon.8 \
+ manpages/grml2ram.8 manpages/gsuggest.1 manpages/dirvish-setup.8 \
+ manpages/iso-term.1 manpages/alignmargins.8 manpages/get_3ware.1 \
+ manpages/grml-init-multitail.1 manpages/grml-setservices.8
+# cp --no-dereference man/*.1.gz debian/grml-scripts/usr/share/man/man1/
+ dh_link /usr/bin/soundtest /usr/bin/grml-soundtest
+ dh_link /usr/sbin/blacklist /usr/sbin/unblacklist \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/align.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/apt-check-sigs.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/attach-screen.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/bincompare.pl.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/blacklist.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/bt-hid.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/caps-ctrl.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/cicqhist.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/code2color.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/code2html.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/cpu-screen.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/cpu-screen.sh.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/cpufreq-detect.sh.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/dir2html.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/dpkg_not_running.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/dpkg-rebuild.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/exifinfo.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/fex.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/findchanged.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/find-hidden-word-text.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/find-text.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/findwaste.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/firevim.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/get_tw_cli.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grepc.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grepedit.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-config.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-config-root.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-config-user.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-hostname.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-info.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-init.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-init-screen.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-lock.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-mutt.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-postfix.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-soundtest.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-screen.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-lang.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-resolution.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-slrn.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-start.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-tpm.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/hgrep.sh.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/iimage.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/ip-screen.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/irclog2html-2.1.pl.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/lesspipe.sh.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/logview.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/mailhops.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/make_chroot_jail.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/mkdosswapfile.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/myip.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/ndiswrapper.sh.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/noeject.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/noprompt.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/osd_server.py.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/notifyd.py.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/pong.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/prepare_ramdisk.sh.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/prepare_tmpfs.sh.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/PrintAnalyzer.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/say.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/search.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/sepdate.pl.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/sepdate.rb.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/sepdate.sh.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/soundtest.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/suspenduser.sh.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/suspenduser_gui.sh.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/tinyp2p.py.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/twebgal.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/unblacklist.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/unbleach.pl.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/urlgrep.awk.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/usbtree.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/vmware-detect.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/wm-ng.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/wwwis.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/xsay.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/XF86AudioLowerVolume.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/XF86AudioMute.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/XF86AudioRaiseVolume.1.gz \
+ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/zsh-login.1.gz \
+ /usr/share/man/man1/gsuggest.1.gz /usr/share/man/man1/gsuggest.pl.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
--- /dev/null
+%.html : %.txt ;
+ asciidoc -b xhtml11 $^
+
+%.gz : %.txt ;
+ #a2x -f manpage $^ 2>&1 |grep -v '^Note: ' >&2
+ #gzip -f --best $(patsubst %.txt,%, $^)
+ asciidoc -d manpage -b docbook $^
+ xsltproc /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl $(patsubst %.txt,%.xml, $^)
+ # try to get rid of ".sp" sequences, see http://bts.grml.org/grml/issue567
+ sed -i 's/\.sp//' $(patsubst %.txt,%, $^)
+ gzip -f --best $(patsubst %.txt,%, $^)
+
+MANPAGES = $(patsubst %.txt,%,$(wildcard *.txt))
+
+all: doc
+
+doc: doc_man doc_html
+doc_html: $(addsuffix .html, $(MANPAGES))
+doc_man: $(addsuffix .gz, $(MANPAGES))
+
+clean:
+ @for i in $(MANPAGES); do \
+ rm -f $$i.html $$i.xml $$i.gz; done
+
--- /dev/null
+GRML-CHROOT(8)
+==============
+Michael Gebetsroither <gebi@grml.org>
+
+
+NAME
+----
+grml-chroot - Wrapper around chroot with proc/sys/pts/dev filesystem handling
+
+
+SYNOPSIS
+--------
+*grml-chroot* 'NEWROOT' ['COMMAND'....]
+
+
+DESCRIPTION
+-----------
+*grml-chroot* is a wrapper
+around plain chroot with integrated proc/sys/pts/dev filesystem handling.
+After _COMMAND_ exits, mounts are cleaned up properly.
+
+
+OPTIONS
+-------
+*-h, help*::
+Show summary of options.
+
+
+EXAMPLES
+--------
+
+*grml-chroot* '/mnt/hda1'::
+ Mounts proc/sys/pts/dev into /mnt/hda1/{proc/sys/dev} and gives you a chrooted shell.
+
+
+SEE ALSO
+--------
+chroot(8)
+
+
+AUTHOR
+------
+grml-chroot and this manpage were written by Michael Gebetsroither <gebi@grml.org>.
--- /dev/null
+GRML-EXEC-WRAPPER(1)
+====================
+
+NAME
+----
+grml-exec-wrapper - simple but smart program execution wrapper
+
+SYNOPSIS
+--------
+*grml-chroot* [-p <program>] <program> [<arguments>]
+
+DESCRIPTION
+-----------
+*grml-exec-wrapper* is a wrapper script for executing commands
+but check whether the specified program is available at all.
+If the command is not available an error message is displayed
+either on the command line (if $DISPLAY is empty) or as graphical
+version (if $DISPLAY is set).
+
+OPTIONS
+-------
+*-h, help*::
+Show summary of options.
+
+*-p <program>*::
+Check specified program instead of default args. This is useful
+if you want to check for a program which is executed via another
+wrapper, as in: 'grml-exec-wrapper -p aumix xterm -T aumix -e aumix'
+
+AUTHOR
+------
+grml-exec-wrapper and this manpage were written by Michael Prokop <mika@grml.org>.
--- /dev/null
+swspeak-setup(8)
+================
+Michael Prokop <mika@grml.org>
+
+NAME
+----
+swspeak-setup - script for activating software speak(up) features
+
+SYNOPSIS
+--------
+
+*swspeak-setup* [-a] [-e|-s] [-f] [-h]
+
+DESCRIPTION
+-----------
+
+*swspeak-setup* is a wrapper arround setting up the speakup kernel module
+and its according userspace software (espeakup by default if available, otherwise
+falling back to speechd-up). The script is used inside the swspeak zsh function
+of grml's zshrc.
+
+OPTIONS
+-------
+
+*-h*::
+Show summary of options.
+
+*-e*::
+Use espeakup (default, if available).
+
+*-s*::
+Use speechd-up (fallback, if available).
+
+*-a*::
+Do not execute aumix for setting mixer levels.
+
+*-f*::
+Disable flite sound output.
+
+EXAMPLES
+--------
+
+*swspeak-setup* '-a'::
+
+ Set up speakup kernel modules and start espeakup (if available) without executing aumix for setting mixer levels.
+
+AUTHOR
+------
+swspeak-setup and this manpage were written by Michael Prokop <mika@grml.org>.
--- /dev/null
+# 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)
--- /dev/null
+.TH alignmargins 8
+.SH "NAME"
+alignmargins \- adjust the margins and the position of the printed contents on the paper
+.SH SYNOPSIS
+.B alignmargins [/path/to/align.ps]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B alignmargins
+command.
+.SH OPTIONS
+alignmargins does not support any options.
+.SH PURPOSE OF alignmargins
+With this program you can adjust the margins and the position of the
+printed contents on the paper. This way you get well-centered printouts and
+you can make use of the whole imageable area of your printer, The driver
+settings are overridden when this adjustment is used.
+
+This is especially important when your printer is used with a driver for
+another printer to which yours is compatible (for example many laser
+printers are compatible to the HP LaserJet printers). Your printer prints
+with this driver, but the non-printable margins are usually different or the
+contents is even not centered. With this program you can fix these problems
+.SH AUTHOR
+alignmargins was written by Till Kamppeter.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the grml project (but may be used by others).
--- /dev/null
+.TH dirvish-setup 8
+.SH "NAME"
+dirvish-setup \- create basic setup for dirvish(8)
+.SH SYNOPSIS
+.B dirvish-setup
+.SH DESCRIPTION
+dirvish-setup is a simple, console (dialog) based script for setting up
+a basic configuration for the backup software named dirvish.
+.SH OPTIONS
+dirvish-setup does not support any options.
+.SH USAGE EXAMPLE
+.TP
+.B dirvish-setup
+Start console based dirvish-setup.
+.SH BUGS
+Probably. Please report bugs, feature requests and patches to the author.
+.SH AUTHOR
+dirvish-setup was written by Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the grml project (but may be used by others).
--- /dev/null
+.TH get_3ware 1
+.SH "NAME"
+get_3ware \- get 3ware RAID controller software
+.SH SYNOPSIS
+.B get_3ware
+.SH DESCRIPTION
+This manual page documents briefly the
+.B get_3ware
+command. 3ware is a simple shellscript which provides URLs
+for downloading the tw_cli and 3DM2 tools of 3ware.com.
+.SH OPTIONS
+get_3ware does not support any options.
+.SH AUTHOR
+get_3ware was written by Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the grml project (but may be used by others).
--- /dev/null
+.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 grml project (but may be used by others).
--- /dev/null
+.TH grml-init-multitail 8
+.SH "NAME"
+grml-init-multitail \- startup wrapper script around multitail
+.SH SYNOPSIS
+.B grml-init-multitail
+.SH DESCRIPTION
+This manual page documents briefly the
+.B grml-init-multitail
+command.
+.SH OPTIONS
+grml-init-multitail does not support any options.
+.SH PURPOSE OF grml-init-multitail
+multitail allows you to view multiple logfiles windowed on console.
+grml-init-multitail is a small wrapper script to execute multitail
+with the appropriate options for use at grml.
+.SH AUTHOR
+grml-init-multitail was written by the grml-team.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the grml project (but may be used by others).
--- /dev/null
+.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 grml project (but may be used by others).
--- /dev/null
+.\" 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.
+.\"###############################################################################
+
+.\"###############################################################
+.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 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-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
+Symlink to notifyd.py
+.SS notifyd.py
+Listen for incoming messages on a specific port and print them via specific handlers (per default via libnotify).
+.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-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 configure hostname in the corresponding
+files. When executed without a parameter a dialog based
+frontend will be used, when given a parameter the provided
+parameter will be used as hostname and script is executed in
+non-interactive mode.
+.SS grml-postfix
+Configuration script to set up postfix on grml system for
+use with TLS.
+.SS grml-tpm
+Set up a system for use with TPM technology.
+.SS grml-vpnc-tugraz
+Connect to TU Graz network via vpnc.
+.SS mkdosswapfile
+Create GRML swapfile on an existing DOS partition.
+.SS ndiswrapper.sh
+NdisWrapper configuration script.
+.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 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-2009 by the grml-team.
+.\"###### END OF FILE ##########################################################
+.\" vim:tw=60
--- /dev/null
+.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
+Invoke the interface.
+.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 grml project (but may be used by others).
--- /dev/null
+.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 grml project (but may be used by others).
--- /dev/null
+.TH grml-setservices 8
+.SH "NAME"
+grml-setservices \- interface for basic configuration of system startup
+.SH SYNOPSIS
+.B grml-setservices
+.SH DESCRIPTION
+This manual page documents briefly the
+.B grml-setservices
+command.
+.SH OPTIONS
+grml-setservices does not support any options.
+.SH NOTES
+grml-setservices is a simple script for configuring some core
+settings of system startup. The script uses the interface update-rc.d
+for adjusting the file /etc/runlevel.conf. /etc/runlevel.conf is the
+configuration file for startup (and shutdown) used by file-rc (which
+is the default init system on grml). You neither have to use grml-setservices
+nor update-rc.d to edit /etc/runlevel.conf, you can edit it manually
+(using your favourite editor) as well of course.
+.SH USAGE EXAMPLES
+.TP
+.B grml-setservices
+Invoke the interface.
+.SH SEE ALSO
+.BR runlevel.conf (5).
+.SH AUTHOR
+grml-setservices was written by Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the grml project (but may be used by others).
--- /dev/null
+.TH grml-swapon 8
+.SH "NAME"
+grml\-swapon \- activate swap partitions with taking care of suspend signatures
+.SH SYNOPSIS
+.B grml\-swapon
+.RI [ OPTIONS ]
+.SH DESCRIPTION
+
+grml-swapon is a small script for enabling swap partitions found in /etc/fstab.
+Starting with grml 0.9 booting the live-cd system does not activate swap
+parititions by default anymore. It is possible to force usage of swap partitions
+via booting with the bootoption "swap". In case you forgot to use this
+bootoption but want to use swap partition(s) anyway you could do that by running
+"swapon \-a". But the command "swapon" does not take of suspend signatures,
+therefore the existance of grml-swapon. grml-swapon acts based on the
+information found in /etc/fstab. If your /etc/fstab is not up to date rebuild it
+running "grml-rebuildfstab".
+
+.SH OPTIONS
+.TP
+.B \-h, \-\-help
+Show help text.
+.TP
+.B \-\-force
+Force usage of swap partitions, activate them also if suspend signature is present.
+.SH SEE ALSO
+.BR grml-rebuildfstab (8).
+.SH AUTHOR
+grml-swapon was written by Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop <mika@grml.org>
+for the grml project (but may be used by others).
--- /dev/null
+.TH grml2ram 8
+.SH "NAME"
+grml2ram \- copy compressed GRML image to RAM
+.SH SYNOPSIS
+.B grml2ram
+.SH DESCRIPTION
+grml2ram is a script which copies the compressed GRML image to RAM and
+unmounts /cdrom then. This allows ejecting of the CD (run 'eject /dev/cdrom' for example)
+afterwards. Therefore running the grml live-cd without the need for a present grml-ISO is possible.
+Please notice that you need enough free RAM to run grml2ram. At least enough space for the compressed
+GRML image itself (about 52MB for grml-small and 685MB for grml) and for running userspace software
+afterwards (at least 128MB are recommended) should be available.
+.SH OPTIONS
+grml2ram supports only the following option:
+.TP
+.B -f, \-\-force
+Force copy process for GRML image even though the check for enough free RAM fails.
+.SH SEE ALSO
+.B bootoption toram
+.SH AUTHOR
+This manual page was written by Michael Prokop <mika@grml.org> for the grml project.
--- /dev/null
+.TH GSUGGEST.PL 1
+.SH NAME
+gsuggest.pl \- google suggest on the commandline
+.SH SYNOPSIS
+.B gsuggest.pl
+.RI keyword " [ another-keyword ]"
+.SH DESCRIPTION
+This manual page documents briefly the
+.B gsuggest.pl
+command.
+.PP
+\fBgsuggest.pl\fP is a program that asks google for keyword suggestions
+for the given keyword[s].
+.SH USAGE EXAMPLE
+.TP
+.B gsuggest.pl grml
+This will ask google for keyword suggestions based on the keyword 'grml'
+and will return the results to standard out (stdout).
+.SH OPTIONS
+gsuggest.pl does not support any options.
+.SH AUTHOR
+gsuggest.pl was written by Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop <mika@grml.org>
+for the grml project (but may be used by others).
--- /dev/null
+.TH iso-term 1
+.SH "NAME"
+iso-term \- wrapper script to run x-terminal-emulator in iso885915 mode
+.SH SYNOPSIS
+.B iso-term
+.SH DESCRIPTION
+This manual page documents briefly the
+.B iso-term
+command.
+.SH OPTIONS
+iso-term does not support any options.
+.SH NOTES
+iso-term is a simple wrapper script to run x-terminal-emulator in iso885915 mode.
+This might be useful when you have to connect to a remote system which is running
+in iso885915 mode even though your local system uses utf-8.
+.SH USAGE EXAMPLES
+.TP
+.B iso-term
+Run x-terminal-emulator in iso mode.
+.SH AUTHOR
+iso-term was written by Michael Prokop <mika@grml.org>.
+.PP
+This manual page was written by Michael Prokop
+<mika@grml.org> for the grml project (but may be used by others).
--- /dev/null
+.TH FMA 1
+.SH NAME
+qma \- quick manual access
+.SH SYNOPSIS
+.B qma
+.RI "[ section ] manualpage [ keyword ]"
+.SH DESCRIPTION
+This manual page documents briefly the
+.B qma
+command.
+.PP
+\fBqma\fP is a script which allows quick and efficient access to manual pages
+through using compression via lzop and display of vim.
+
+qma generates manpages via running 'man <requested_manpage>' and storing
+the result in a file with the extension txt in directory $HOME/man. Then
+lzop is executed for the file and the output is written to a file with the
+additional extension lzo. Afterwards the editor vim is executed with
+filetype set to man and using on-the-fly decompressing using lzop again.
+
+So far you did not win any time of course. But if you want to display the
+same manpage again the processed manpage already exists in $HOME/man and
+can be displayed immediately. If you want to experience the difference
+just run 'qma zshall' two times and compare it with 'man zshall' too.
+
+If you want to jump to a special keyword inside the manpage use it as
+last option of the qma commandline. Searching for the keyword is done
+case insensitive inside vim.
+.SH OPTIONS
+qma supports the following options:
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-v, \-\-version
+Show version of program.
+.TP
+.B $MANDIR
+If the environment variable MANDIR is set the specified directory is taken
+for output files instead of the default directory $HOME/man.
+.SH USAGE EXAMPLE
+.TP
+.B % qma zshall
+Display manpage zshall (man zshall).
+.TP
+.B % qma 1 read
+Display manpage read of section 1 (man 1 read).
+.TP
+.B % qma 2 read
+Display manpage read of section 2 (man 2 read).
+.TP
+.B % qma grml overview
+Display manpage grml and jump to keyword "overview".
+.SH AUTHOR
+qma was written by Michael Prokop <mika@grml.org> based on an idea of
+Matthias Kopfermann <matthi@grml.org>.
+.PP
+This manual page was written by Michael Prokop <mika@grml.org>
+for the grml project (but may be used by others).
--- /dev/null
+.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 grml project (but may be used by others).
--- /dev/null
+.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 grml project (but may be used by others).
--- /dev/null
+#!/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.
+################################################################################
+
+. /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 #################################################################
--- /dev/null
+#!/bin/bash
+# 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.
+################################################################################
+
+. /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 #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+. /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 #################################################################
--- /dev/null
+#!/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
+################################################################################
+
+# -U option basically means "terminal does not have UTF-8 support"
+if [ x$1 = "x-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 #################################################################
--- /dev/null
+#!/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).
+################################################################################
+# 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]));
--- /dev/null
+#!/bin/zsh
+# Filename: caps-ctrl
+# Purpose: switch caps to control key and vice versa for linux console and X
+# Authors: grml-team (grml.org), (c) Matthias Kopfermann <maddi@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2.
+################################################################################
+
+if [[ -f /etc/grml/script-functions ]] ; then
+ source /etc/grml/script-functions && \
+ check4progs xmodmap loadkeys dumpkeys || exit 1
+fi
+if [[ -f /etc/grml/lsb-functions ]] ; then
+ source /etc/grml/lsb-functions
+else
+ einfo() { echo "$*" ; }
+ eerror() { echo "$*" ; }
+ eend() { echo "$*" ; }
+fi
+
+emulate zsh
+
+if [[ -z $DISPLAY ]] ; then # test if X is not running when calling us
+ if [ $(id -u) != 0 ] ; then # test if user root did invoke this command
+ eerror "As of Linux 2.6.15 you need root permissions for changing"
+ eerror "the keyboard on console using loadkeys for security reasons."
+ eerror "Run this program with root permissions. Exiting." ; eend 1
+ exit 1
+ fi
+ dumpkeys | grep -q '^keycode 58 = Caps_Lock' && \
+ ( einfo "caps-ctrl - switching caps lock and control key."
+
+ loadkeys <<- EOT
+ keycode 58 = $(repeat 15 echo -n 'Control ')
+ keycode 29 = $(repeat 7 echo -n 'Caps_Lock ')
+ EOT
+ eend $?
+
+ ) || (
+ einfo "caps-ctrl - switching caps lock and control key."
+
+ loadkeys <<- EOT
+ keycode 58 = $(repeat 15 echo -n 'Caps_Lock ')
+ keycode 29 = $(repeat 7 echo -n 'Control ')
+ EOT
+ eend $?
+ )
+
+else # running under X
+ (
+ einfo "caps-ctrl - switching caps lock and control key."
+ einfo "If you notice errors, please make sure the xmodmap you have is right"
+ einfo "or use e.g. \"setxkbmap us\" beforehand."
+ xmodmap -pke | grep 'Caps_Lock' > /dev/null || (
+ xmodmap - <<- EOT
+ keycode 66 = Caps_Lock
+ EOT
+ )
+
+ xmodmap - <<- EOT
+ remove Lock = Caps_Lock
+ remove Control = Control_L
+ !remove Control = Control_R
+
+ keysym Control_L = Caps_Lock
+ keysym Caps_Lock = Control_L
+ !keysym Control_R = Caps_Lock
+ !keysym Caps_Lock = Control_R
+
+ add lock = Caps_Lock
+ add Control = Control_L
+ !add Control = Control_R
+ EOT
+ eend $?
+ )
+fi # end of test if X or console is used
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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
--- /dev/null
+#!/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' => {
+ '&' => '&',
+ '<' => '<',
+ '>' => '>',
+ '"' => '"'
+ }
+ },
+ '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/
+
--- /dev/null
+#!/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/&/&/g; # must remember to do this one first!
+s/</</g; # this is the most important one
+s/>/>/g; # don't close too early
+s/"/"/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/ / /g;
+
+END { print "</TT>\n" } # ...shall be with us always
--- /dev/null
+#!/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.
+################################################################################
+
+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 #################################################################
--- /dev/null
+#!/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.
+################################################################################
+# Notice: also check out /etc/init.d/loadcpufreq of current cpufrequtils in Debian.
+#
+# Notice: based on http://people.ubuntulinux.org/~scott/patches/powernowd/ and
+# scripts found in the powernowd package version 0.97-1ubuntu6 on Ubuntu.
+################################################################################
+
+/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
+ case "$(uname -r)" in
+ 2.6.2[0-9]*)
+ # Prefer acpi-cpufreq for kernels after 2.6.20
+ MODULE=acpi-cpufreq
+ ;;
+ *)
+ MODULE=speedstep-centrino
+ ;;
+ esac
+ 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 #################################################################
--- /dev/null
+#!/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> </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> </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}') </td>"
+ echo " <td>$(file -biL "$rname" | awk '{print $1}' | sed 's/;//g') </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
--- /dev/null
+#!/bin/sh
+##########################################################################
+# 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 "exif:" prefix from identify
+ # 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 's/^exif://' \
+ -e '/[^A-Za-z0-9_=][^=]*=/d' \
+ -e "s/'/'\\\\''/g" \
+ -e "s/=/='/" \
+ -e "s/\$/'/" \
+ -e "s/^/$prefix/"
+done
--- /dev/null
+#!/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.
+################################################################################
+
+zmodload zsh/files
+autoload -U colors && colors
+emulate zsh
+
+FILENAME=$0
+ARGV=$1
+alarmcol=$fg_bold[red]
+defcol=$fg[default]$bg[default]
+col1=$fg_bold[green]
+col2=$fg_bold[magenta]
+col3=$fg_bold[cyan]
+col4=$fg[cyan]
+
+usage() { print "Usage: $FILENAME file_to_extract" && exit ; }
+ (( $ARGC != 1 )) && usage
+ [[ $ARGV == "-h" || $ARGV == "--help" ]] && usage
+ file=$1
+ FILEPRG=$( which file )
+ [[ $( tar --version 3>&1 ) != *(GNU|star)* ]] && echo "sorry, GNU tar or star is needed" && exit
+ test -z $FILEPRG && echo $0 needs a program named file to detect the filetype && exit
+
+qprompt="
+ Really decompress $alarmcol${file}$defcol? Press y or Y for YES
+ or any other key for NO $defcol
+"
+
+nothing_to_do="
+ ${col1}Okay, I will not uncompress the file $col2${file}$defcol as requested.
+"
+decision="read -q '?$qprompt'"
+
+local -A filetype; filetype=(\
+ bz2cpio "cpio archive *bzip2*"
+ cpiogz "cpio archive *gzip*"
+ tarbz2 "*tar archive*bzip2*"
+ targz "*tar archive*gzip*"
+ tarz "*POSIX tar archive \(compress\'d data 16 bits\)*"
+ bz2 "*\(bzip2 compressed data*"
+ tar "*tar*"
+ gz "*gzip*"
+ 7zip "*7-zip archive data*"
+ arj "ARJ archive data*"
+ zip "*Zip archive data*"
+ Z "*compress'd data 16 bits*"
+ deb "Debian binary package*"
+ uu "*uuencoded*xxencoded*"
+ lzo "lzop compressed data - *"
+ cpio "cpio archive"
+ rar "RAR archive data*"
+ cab "CAB file"
+ #rpm "$file: *RPM*"
+)
+
+tarlist='/usr/bin/env tar -tvf' ; tarextract='/usr/bin/env tar -C $whereto -xvf'
+tarbz2list='/usr/bin/env tar -tvjf' ; tarbz2extract='/usr/bin/env tar -C ${whereto:-$PWD} -xvjf'
+targzlist='/usr/bin/env tar -tvzf' ; targzextract='/usr/bin/env tar -C $whereto -xvzf'
+gzlist='/usr/bin/env gzip -lv' ; gzextract='/usr/bin/env gzip -dc'
+tarzlist='/usr/bin/env tar -tvZf' ; tarzextract='/usr/bin/env tar -C $whereto -xvZf'
+tarcompresslist='/usr/bin/env tar -tvZf' ; tarcompressextract='/usr/bin/env tar -$ whereto -xvZf'
+#cpiobz2list='bzip2 -cd $file | cpio -ivt'; cpiobz2extract='bzip2 -cd $CWD/$file | cpio -idv'
+#cpiogzlist='gzip -cd $file | cpio -tv'
+#cpiogzextract='gzip -cd $file | cpio -ivd'
+cpiogz='/usr/bin/env star tzvf' ; cpiogzextract='/usr/bin/env star xzvf'
+_7ziplist='/usr/bin/env 7zr l' ; _7zipextract='/usr/bin/env 7zr e -o$whereto'
+arjlist='/usr/bin/env arj l' ; arjextract='/usr/bin/env arj e -e $CWD/$file'
+compresslist='/usr/bin/env uncompress -l' ; compressextract='/usr/bin/env uncompress -cv'
+lhalist='/usr/bin/env lha -l' ; lhaextract='/usr/bin/env lha -xw=$whereto'
+deblist='/usr/bin/env dpkg-deb -c' ; debextract='/usr/bin/env dpkg -X'
+lzolist='/usr/bin/env lzop -l' ; lzoextract='/usr/bin/env lzop -dN -p$whereto'
+cpiolist='/usr/bin/env cpio -t' ; cpioextract='/usr/bin/env cpio -idv'
+rarlist='/usr/bin/env unrar lb' ; rarextract='/usr/bin/env unrar e'
+cablist='/usr/bin/env cabextract -l' ; cabextract='/usr/bin/env cabextract -d $whereto'
+#rpmlist='/usr/bin/env rpm2cpio #rpmextract=
+ziplist='/usr/bin/env unzip -l' ; zipextract='/usr/bin/env unzip -d $whereto'
+
+
+# ------------------------------------------------- functions
+put_there() {
+ vared -p "
+ ${col2}Where should I extract to?
+ ${col4}( Non existing directories will be created,
+ completion works as do usual editing commands )$defcol
+ " whereto && test -d $whereto \
+ || builtin mkdir -p $whereto
+}
+# -------------------------------------------end of functions
+
+(( ${+PAGER} )) || local PAGER=less
+
+
+ if [[ -f $file ]]
+ then
+ filetest=$( $FILEPRG -bz $file )
+ echo "This is a $col2$filetest$defcol"
+ sleep 1
+ whereto=$PWD
+ case "$filetest" in
+ ( ${~filetype[bz2cpio]} )
+ $=cpiobz2list |& $PAGER && eval $decision \
+ && put_there \
+ && CWD=$PWD \
+ && ( cd $whereto && print "${col1}extracting to $whereto$defcol" && ${(e)=cpiobz2extract} ) \
+ || print $nothing_to_do ;;
+ ( ${~filetype[cpiogz]} )
+ ${(e)=cpiogzlist} | $PAGER && eval $decision \
+ && put_there \
+ && CWD=$PWD \
+ && ( cd $whereto && print "${col1}extracting to $whereto$defcol" && ${(e)=cpiogzextract} ) \
+ || print $nothing_to_do ;;
+ ( ${~filetype[tarbz2]} )
+ $=tarbz2list $file \
+ |
+ $PAGER && eval $decision && put_there \
+ && ${(e)=tarbz2extract} $file \
+ || print $nothing_to_do ;;
+ ( ${~filetype[targz]} )
+ $=targzlist $file | $PAGER && eval $decision \
+ && put_there \
+ && ${(e)=targzextract} $file \
+ || print $nothing_to_do ;;
+ ( ${~filetype[tarz]} )
+ $=tarzlist $file | $PAGER && eval $decision \
+ && put_there \
+ && print "${col3}extracting to $whereto:$defcol" \
+ && ${(e)=tarzextract} $file \
+ || print $nothing_to_do ;;
+ ( ${~filetype[bz2]} )
+ bzip2 -tv $file | $PAGER && eval $decision \
+ && put_there \
+ && bzip2 -dc $file > $whereto/${file:t:r} \
+ && print "extracting to $whereto/${file:t:r}" || print $nothing_to_do ;;
+ ( ${~filetype[gz]} )
+ $=gziplist $file | $PAGER && eval $decision \
+ && put_there \
+ && dest="$whereto/${file:t:r}" \
+ && gzip -dc $file > $dest && print "extracting to $dest" || print $nothing_to_do ;;
+ ( ${~filetype[tar]} )
+ $=tarlist $file | $PAGER && eval $decision \
+ && put_there \
+ && ${(e)=tarextract} $file || print $nothing_to_do ;; #ok
+ ( ${~filetype[7zip]} )
+ $=_7ziplist $file | $PAGER && eval $decision \
+ && put_there \
+ && ${(e)=_7zipextract} $file || print $nothing_to_do ;; # -o cannot stand a space, attention! #ok
+ ( ${~filetype[arj]} )
+ $=arjlist $file | $PAGER && eval $decision \
+ && put_there \
+ && CWD=$PWD \
+ && ( cd $whereto && arj e -e $CWD/$file ) || print $nothing_to_do ;;
+ ( ${~filetype[zip]} )
+ ${=ziplist} $file | $PAGER && eval $decision \
+ && put_there \
+ && ${(e)=zipextract} $file || print $nothing_to_do ;; #ok
+ ( ${~filetype[Z]} )
+ $=compresslist $file | $PAGER && eval $decision \
+ && put_there \
+ && dest="$whereto/${file:t:r}" \
+ && ${(e)=compressextract} $file > $dest && print "extracting to $dest" || print $nothing_to_do ;; #ok
+ ( ${~filetype[lha]} )
+ $=lhalist $file | $PAGER && eval $decision \
+ && put_there \
+ && ${(e)=lhaextract} $file || print $nothing_to_do ;; #ok
+ ( ${~filetype[rar]} )
+ $=rarlist $file | $PAGER && eval $decision \
+ && put_there \
+ && CWD=$PWD \
+ && (cd $whereto && ${(e)=rarextract} $CWD/$file ) || print $nothing_to_do ;; #ok
+ ( ${~filetype[lzo]} )
+ $=lzolist $file | $PAGER && eval $decision \
+ && put_there \
+ && ${(e)=lzoextract} $file || print $nothing_to_do ;; #ok
+ ( ${~filetype[cpio]} )
+ $=cpiolist < $file | $PAGER && eval $decision \
+ && put_there \
+ && CWD=$PWD \
+ && ( cd $whereto && ${(e)=cpioextract} < $CWD/$file ) || print $nothing_to_do ;; #ok
+ ( ${~filetype[deb]} )
+ ${(e)=deblist} $file | $PAGER && eval $decision \
+ && put_there \
+ && ${(e)=debextract} $file $whereto || print $nothing_to_do ;; #ok
+ ( ${~filetype[uu]} )
+ put_there \
+ && CWD=$PWD \
+ && ( cd $whereto && uudecode $CWD/$file ) || print $nothing_to_do ;;
+ ( ${~filetype[cab]} )
+ $=cablist $file | $PAGER && eval $decision \
+ put_there \
+ && ${(e)=cabextract} $file || print $nothing_to_do ;;
+ #( ${~filetype[rpm]} )
+ # temp=$( dd if=/dev/urandom bs=1 count=30 2>/dev/null | uuencode - | tr -d '[[:punct:]]' | sed '2!d' )
+ # temp=${(C)${${${(f)"$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | uuencode - 2>/dev/null)"}[2]}//[[:punct:]]}}
+ # (cd $temp && rpm2cpio $file && CPIO=*.cpio && cpio -ivt < $CPIO )\
+ # put_there \
+ #
+ # && ( cd $whereto && cpio -ivd < $temp/$file ) || print $nothing_to_do
+ # rm -r $temp ;;
+ ( * )
+ echo "${alarmcol}Error. Not the expected arguments or other problem!$defcol"
+ echo "Usage: $0 file" ; exit 1 ;;
+ esac
+ else
+ echo "'$file' is not a valid file"
+ fi
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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";
+ }
+}
--- /dev/null
+#!/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);
+
+ }
+
--- /dev/null
+#!/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.
+################################################################################
+
+ 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 #################################################################
--- /dev/null
+#!/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";
+}
--- /dev/null
+#!/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.
+################################################################################
+
+xterm -e "vim $*"
+
+## END OF FILE #################################################################
--- /dev/null
+#!/bin/sh
+# Filename: get_3ware
+# 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.
+################################################################################
+# 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.4.1"
+MV="9.4.0.1"
+
+case `uname -m` in
+ x86_64)
+ ARCH="x86_64"
+ ;;
+ i?86)
+ ARCH="x86"
+ ;;
+ *)
+ echo "Unsupported architecture, must be x86 or amd64 - sorry."
+ exit 1
+ ;;
+esac
+
+MY_P="${PN}-linux-${ARCH}-${PV}"
+URL_BASE="http://www.3ware.com/download/Escalade7000Series/${PV}"
+CMDLINETOOL="${URL_BASE}/${PN}-linux-${ARCH}-${PV}.tgz"
+MANAGEMENTTOOL="http://www.3ware.com/download/Escalade7000Series/${MV}/3DM2-Linux-${MV}.tgz"
+AGREE1="http://www.3ware.com/support/windows_agree.asp?path=/download/Escalade7000Series/${PV}/${MY_P}.tgz"
+AGREE2="http://www.3ware.com/support/windows_agree.asp?path=/download/Escalade7000SSeries/${MV}/3DM2-Linux-${MV}.tgz"
+RELEASENOTES1="http://www.3ware.com/download/Escalade9650SE-Series/${PV}/${PV}_Release_Notes_Web.pdf"
+RELEASENOTES2="http://www.3ware.com/download/Escalade9650SE-Series/${MV}/${MV}_Release_Notes_Web.pdf"
+
+info() {
+ einfo "get_3ware - 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${AGREE1}"
+ einfo "\t${AGREE2}"
+ einfo ""
+ einfo "And then use the following URLs to download the tarballs:"
+ einfo ""
+ einfo "\t${CMDLINETOOL}"
+ einfo "\t${MANAGEMENTTOOL}"
+ einfo ""
+ einfo "Release notes available at:"
+ einfo ""
+ einfo "\t${RELEASENOTES1}"
+ einfo "\t${RELEASENOTES2}"
+ einfo ""
+}
+
+info
+pkg_nofetch
+supportedcards
+# unp ${MY_P}.tgz
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+if ! which wget >/dev/null 2>&1 ; then
+ echo "wget is 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 #################################################################
--- /dev/null
+#!/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/
+################################################################################
+
+################################################################################
+# 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 #################################################################
--- /dev/null
+#!/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)
+
+
--- /dev/null
+#!/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.
+################################################################################
+
+PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}
+
+# set up some variables
+DIALOG=$(which dialog)
+PN=$(basename $0)
+
+allover() {
+MENU=$($DIALOG --stdout --clear --title "$PN" --menu \
+"Configure userland tools." 0 0 0 \
+"grml-mutt" "Configure the mutt MUA" \
+"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-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 #################################################################
--- /dev/null
+#!/bin/sh
+# Filename: grml-exec-wrapper
+# Purpose: simple but smart program execution wrapper
+# 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 or any later version.
+################################################################################
+
+usage() {
+ printf "Usage: $0 <program> [<arguments>]
+
+Available options:
+
+ -h | --help display this usage information
+ -p <program> check specified argument instead of default args, like:
+ $(basename $0) -p aumix xterm -T aumix -e aumix
+"
+}
+
+is_installed() {
+ prog="$1"
+ [ -z "$prog" ] && return 1
+
+ case "${prog}" in
+ /*) # deal with absolute-path programs
+ [ -x "${prog}" ] && return 0
+ return 1 ;;
+ esac
+
+ ret=1
+ oifs="$IFS"
+ IFS=:
+ for dir in $PATH; do
+ [ -z "$dir" ] && continue
+ [ -x "$dir/$prog" ] && ret=0 && break
+ done
+
+ IFS="$oifs"
+ unset oifs
+ return "$ret"
+}
+
+# use Xdisplay only if present and running under X:
+display_info() {
+if is_installed xterm && test -n "$DISPLAY" ; then
+ xterm -T 'Sorry :(' -e "dialog --msgbox \"$1\" 0 0"
+else
+ printf '%s\n' "$1">&2
+fi
+}
+
+if [ -z "$1" -o "$1" = '-h' -o "$1" = '--help' ] ; then
+ usage
+ exit 1
+fi
+
+if [ "$1" = '-p' ] ; then
+ if [ -z "$2" ] ; then
+ usage
+ exit 1
+ else
+ PROG="$2"
+ shift ; shift
+ fi
+else
+ PROG="$1"
+ # make sure to support 'grml-exec-wrapper sudo wireshark' as well:
+ case $PROG in
+ *sudo*) PROG="$2" ;;
+ esac
+fi
+
+if is_installed "$PROG" ; then
+ exec "$@"
+fi
+
+display_info "Sorry: ${PROG} not available.
+
+Looks like the grml flavour you are using does not ship ${PROG}. :(
+
+You can search for ${PROG} executing:
+
+apt-get update && apt-cache search $(basename ${PROG})
+ "
+
+exit 1
+
+## END OF FILE #################################################################
--- /dev/null
+#!/bin/zsh
+# Filename: grml-info
+# Purpose: start browser with documentation for Grml (based) 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.
+################################################################################
+
+# allow customisation
+[ -n "$distri" ] || distri=grml
+
+if [ -r "/usr/share/doc/${distri}-docs/index.html" ] ; then
+ # support easy customisation, file doesn't exist
+ # by default on mainline Grml
+ local PAGE="/usr/share/doc/${distri}-docs/index.html"
+else
+ local PAGE='/usr/share/doc/grml-docs/startpage.html'
+fi
+
+. /etc/grml/script-functions
+
+# do we have X?
+if [ -n "$DISPLAY" ] ; then
+ if check4progs dillo &>/dev/null ; then
+ dillo $PAGE
+ elif check4progs xlinks2 &>/dev/null ; then
+ xlinks2 -mode 640x480 $PAGE
+ elif check4progs firefox &>/dev/null ; then
+ firefox $PAGE
+ elif check4progs x-www-browser &>/dev/null ; then
+ x-www-browser $PAGE
+ elif check4progs Xdialog &>/dev/null ; then
+ Xdialog --msgbox "Sorry, no usable X browser (dillo, xlinks2, firefox,...) found." 0 0
+ exit 1
+ elif check4progs gdialog &>/dev/null ; then
+ gdialog --msgbox "Sorry, no usable X browser (dillo, xlinks2, firefox,...) found." 0 0
+ exit 1
+ elif check4progs zenity &>/dev/null ; then
+ zenity --info --text="Sorry, no usable X browser (dillo, xlinks2, firefox,...) found."
+ exit 1
+ fi
+else # no X:
+ # do we have a real console?
+ if [[ $(tty) == /dev/tty* ]] ; then
+ # do we have framebuffer support?
+ if [ -c /dev/fb0 ] ; then
+ if check4progs links2 &>/dev/null ; then
+ links2 -driver fb $PAGE
+ elif check4progs w3m &>/dev/null; then
+ w3m $PAGE
+ elif check4progs links &>/dev/null ; then
+ links $PAGE
+ else
+ echo "Sorry, neither links2 nor w3m nor links available. Exiting.">&2
+ exit 1
+ fi
+ else # no, we don't have framebuffer
+ if check4progs w3m &>/dev/null ; then
+ w3m $PAGE
+ elif check4progs links &>/dev/null ; then
+ links $PAGE
+ elif check4progs links2 &>/dev/null ; then
+ links2 $PAGE
+ else
+ echo "Sorry, neither w3m nor links nor links2 available. Exiting.">&2
+ exit 1
+ fi
+ fi
+ else # no, probably we are running inside GNU screen
+ if check4progs w3m &>/dev/null ; then
+ w3m $PAGE
+ elif check4progs links2 &>/dev/null ; then
+ links2 $PAGE
+ elif check4progs links &>/dev/null ; then
+ links $PAGE
+ else
+ echo "Sorry, neither w3m nor links2 nor links available. Exiting.">&2
+ exit 1
+ fi
+ fi
+fi
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+# 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 #################################################################
--- /dev/null
+#!/bin/dash
+# Filename: grml-init-multitail
+# Purpose: fix tty permissions and run multitail
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>,
+# (c) Michael Gebetsroither <gebi@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2.
+################################################################################
+
+# 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 /usr/bin/multitail -o 'check_mail:0' /var/log/syslog
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+# export variable USER for use withing GNU screen:
+ export USER=`id -un`
+
+# fix rungetty:
+ TTY=`tty`
+ sudo chmod 660 $TTY
+ sudo chown $USER.tty $TTY
+
+# now start screen:
+ cd $HOME
+ # do we have a utf8 enabled terminal?
+ /usr/bin/screen -U -c /etc/grml/screenrc ; exec /bin/zsh
+
+## END OF FILE #################################################################
--- /dev/null
+#!/bin/bash
+# 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.
+################################################################################
+
+CONFFILE=/etc/sysconfig/keyboard
+PN="$(basename $0)"
+
+usage(){
+ echo "Usage: $0 <language>"
+ echo "supported values: at, ch, de, dvorak, es, jp, us"
+}
+
+setvalue(){
+ [ -n "$2" ] || return 1
+ # already present in conffile?
+ if grep -q ${1} $CONFFILE 2>/dev/null ; then
+ sudo sed -i "s#^${1}.*#${1}=${2}#" $CONFFILE
+ else
+ echo "$1=${2}" | sudo tee -a $CONFFILE >/dev/null
+ fi
+}
+
+if [ $# -lt "1" ] ; then
+ usage
+ exit 1
+fi
+
+[ -d /etc/sysconfig ] || sudo mkdir /etc/sysconfig
+
+
+LANGUAGE="$1"
+
+
+. /etc/grml/language-functions
+
+if [ ! -z "$KEYTABLE" ] ; then
+ setvalue KEYTABLE "$KEYTABLE"
+fi
+
+if [ ! -z "XKEYBOARD" ] ; then
+ setvalue XKEYBOARD $XKEYBOARD
+fi
+
+
+if [ -z "$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 i386/qwerty/us-latin1.kmap.gz
+ echo -e "\nDone."
+ elif [ "$1" = "dvorak" ] ; then
+ echo 'Loading keymap dvorak...'
+ sudo loadkeys dvorak
+ echo -e "\nDone."
+ elif [ "$1" = "jp" ] ; then
+ echo 'Loading keymap jp...'
+ sudo loadkeys i386/qwerty/jp106.kmap.gz
+ echo -e "\nDone."
+ elif [ "$1" = "es" ] ; then
+ echo 'Loading keymap es...'
+ sudo loadkeys i386/qwerty/es.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
+ # switch to unicode mode on console
+ case $LANG in *UTF-8) kbd_mode -u ; ;; esac
+else
+ if [ $# = 0 ] ; then
+ usage
+ 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" = "jp" ] ; then
+ echo "Loading keymap for Japan..."
+ setxkbmap -model jp106 -layout jp
+ echo -e "\nDone."
+ elif [ "$1" = "dvorak" ] ; then
+ echo "Loading keymap dvorak..."
+ setxkbmap dvorak
+ echo -e "\nDone."
+ elif [ "$1" = "us" ] ; then
+ echo 'Loading keymap us...'
+ [ -r $HOME/.Xmodmap ] && xmodmap $HOME/.Xmodmap || setxkbmap us
+ echo -e "\nDone."
+ elif [ "$1" = "es" ] ; then
+ echo "Loading keymap es..."
+ setxkbmap es
+ 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 #################################################################
--- /dev/null
+#!/bin/bash
+# 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.
+################################################################################
+
+PN="$(basename $0)"
+
+[ -n "$USER" ] || USER=grml
+
+if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
+ echo "${PN}: wrapper script to lock desktop
+
+This script is a wrapper to lock your desktop session
+through the vlock application.
+
+Usage: just execute $PN without any further options."
+ exit 0
+fi
+
+if [ -r /etc/grml/script-functions ] ; then
+ . /etc/grml/script-functions
+ check4progs vlock sudo chpasswd dialog || { echo "Sorry, necessary tools missing - can not continue. Exiting.">&2 ; exit 1 ; }
+fi
+
+PWD_TEXT1="Set password (hidden typing):"
+PWD_TEXT2="Retype new password:"
+
+# by default use console frontend
+DIALOG='dialog'
+PWD_CMD="dialog --stdout --title $PN --passwordbox"
+
+# only if using X and gdialog + zenity are available use graphical frontend
+if [ -n "$DISPLAY" ] && [ -x "$(which gdialog)" ] && [ -x "$(which zenity)" ] ; then
+ DIALOG='gdialog'
+ PWD_CMD="zenity --title $PN --entry --hide-text"
+fi
+
+if ! [ -r /etc/grml_version ] ; then
+ $DIALOG --title "$PN" --msgbox "Warning: this system does not look like a Grml (based) system
+and therefore might not work as intended." 7 70
+fi
+
+lock_desktop() {
+ vlock -a -n -s
+}
+
+is_passwd_set() {
+ if sudo grep -q "$USER:\*:" /etc/shadow ; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+set_passwd() {
+ if [ "$DIALOG" = "gdialog" ] ; then
+ PASSWD1="$($PWD_CMD --text="$PWD_TEXT1")"
+ PASSWD2="$($PWD_CMD --text="$PWD_TEXT2")"
+ else
+ PASSWD1="$($PWD_CMD "$PWD_TEXT1" 0 0)"
+ PASSWD2="$($PWD_CMD "$PWD_TEXT2" 0 0)"
+ fi
+
+ if [ -z "$PASSWD1" ] ; then
+ $DIALOG --title "$PN" --msgbox "Error retrieving password. Exiting." 0 0
+ exit 1
+ fi
+ if [ "$PASSWD1" = "$PASSWD2" ] ; then
+ echo "$USER:$PASSWD2" | sudo chpasswd
+ else
+ $DIALOG --title "$PN" --msgbox "Error: passwords to not match. Exiting." 0 0
+ exit 1
+ fi
+}
+
+askpwd() {
+ if [ "$DIALOG" = "gdialog" ] ; then
+ zenity --title="$PN" --question --cancel-label='Exit' --ok-label='Set password' --text="User $USER has no password set yet. Without a password you will not be able to log in again. Set password for user $USER?"
+ RC=$?
+ else
+ $DIALOG --title "$PN" --no-label Exit --yes-label Continue --yesno "User $USER has no password set yet. Without a password you will not be able to log in again. Set password for user $USER?" 0 0
+ RC=$?
+ fi
+
+ if [ "$RC" = "0" ] ; then
+ set_passwd
+ else
+ exit 1
+ fi
+}
+
+if ! isgrmlcd ; then
+ lock_desktop
+else
+ is_passwd_set || askpwd
+ [ "$?" = "0" ] && lock_desktop || exit 1
+fi
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+PATH=${PATH:-'/bin/:/sbin/:/usr/local/bin:/usr/bin:/usr/sbin'}
+PN=$(basename "$0")
+
+if [ -r /etc/grml/script-functions ] ; then
+ . /etc/grml/script-functions
+ check4progs dialog mutt || echo "Warning - mutt is not available. Continuing anyway.">&2
+fi
+
+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.
+################################################################################
+
+# 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
+ unset autoedit # call editor without prompting for To: and Subject:?
+ set auto_tag=yes # the next operation applies to the tagged messages automatically
+ 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 postponed=+postponed # where save postponed 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 quit=ask-yes # ask before exiting
+ 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 # 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 use_envelope_from # when set, mutt will use $envelope_from_address as the envelope sender
+ set write_inc=10 # update number after each tenth read mail
+
+# Sending mail:
+# set sendmail="/usr/bin/msmtp" # which sendmail program should be used?
+# set smtp_url="smtp://yourusername@smtp.example.org:port/" # versions >=1.5...
+ # ... of Mutt have built-in SMTP support
+# set smtp_pass="password" # password for smtp_url option
+
+# 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 ; exit 1 ; }
+ fi
+ ;;
+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 #################################################################
--- /dev/null
+#!/bin/bash
+# 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.
+################################################################################
+
+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 #
--- /dev/null
+#!/bin/dash
+# Filename: grml-screen
+# Purpose: wrapper for screen to start with appropriate configuration
+# 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.
+################################################################################
+
+# 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
+
+# FIXME: fix for screen race-conditions
+PID_FILE_="/var/lock/grml-screen"
+PID_FILE_CREATED_="false"
+MY_PID_="$$"
+if [ ! -d "/var/run/screen/S-$USER" ]; then
+ # no /var/run/screen/S-$USER and possible no /var/run/screen either -> locking
+ for i in `seq 40`; do # 40*0.25 = 10 seconds
+ if lockfile-create --retry 0 $PID_FILE_; then
+ echo $MY_PID_ >$PID_FILE_
+ PID_FILE_CREATED_="true"
+ break
+ else
+ PID_FILE_CREATED_="error"
+ fi
+ sleep 0.25
+ done
+fi
+if [ $PID_FILE_CREATED_ = "true" ]; then
+ # FORK BEGIN
+ (
+ for i in `seq 40`; do # 40*0.25 = 10 seconds
+ if [ ! -d "/var/run/screen/S-$USER" ]; then
+ sleep 0.25 # educated guess
+ else
+ break
+ fi
+ done
+ if [ `cat $PID_FILE_` = $MY_PID_ ]; then
+ rm $PID_FILE_
+ lockfile-remove $PID_FILE_
+ fi
+ )&
+ # FORK END
+elif [ $PID_FILE_CREATED_ = "error" ]; then
+ SLEEP_TIME_="$(( $$ % 5 * 5 + 5 ))"
+ echo "grml-screen: Error could not create lockfile! (sleeping for $SLEEP_TIME_)" >&2
+ sleep $SLEEP_TIME_
+elif [ $PID_FILE_CREATED_ = "false" ]; then
+ echo "nothing to do" &>/dev/null
+else
+ echo "grml-screen: internal error - PID_FILE_CREATED_ == \"$PID_FILE_CREATED_\"" >&2
+fi
+
+# now run screen with config
+ cd $HOME # important for e.g. hardcopy-feature
+
+ if [ `id -u` = 0 ] ; then
+ exec screen -U -c /etc/grml/screenrc
+ elif [ -r "$HOME/.screenrc" ] ; then
+ exec screen -U -c "$HOME/.screenrc"
+ else
+ exec screen -U -c /etc/grml/screenrc_grml
+ fi
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+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)
+
+if [ -r /etc/grml/script-functions ] ; then
+ . /etc/grml/script-functions
+ check4progs dialog slrn || { echo "Sorry, can't continue. Exiting.">&2 ; exit 1 ; }
+fi
+
+[ -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.
+%###############################################################################
+
+%###############################################################################
+% 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 use_mime 1
+% set charset isolatin
+% 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 ; exit 1 ; }
+ fi
+ ;;
+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 "
+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 #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+BROWSER=${BROWSER:-w3m}
+#BROWSER=${BROWSER:-links2 -driver fb}
+exec $BROWSER /usr/share/doc/grml-docs/startpage.html
+
+## END OF FILE #################################################################
--- /dev/null
+#!/usr/bin/perl
+# Filename: gsuggest.pl
+# Purpose: google suggest - ask google for keyword suggestions
+# 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.
+################################################################################
+
+use strict;
+use warnings;
+use WebService::Google::Suggest;
+
+unless (@ARGV) {
+ print "usage: gsuggest <keyword[s]>\n";
+ exit(1);
+}
+
+my $suggest = WebService::Google::Suggest->new();
+
+while (@ARGV) {
+ my @suggestions = $suggest->complete(shift);
+ for my $suggestion (@suggestions) {
+ print "$suggestion->{query}: $suggestion->{results} results\n";
+ }
+}
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+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 #################################################################
--- /dev/null
+#!/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 38 2009-12-15 20:30: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" -resize $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 =" | head -1 | 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 \
+ -resize "$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
+
+ </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>
+<a href="../index.html">Index</a>
+<a href="$R_PREV_HTML"><b><<<</b></a>
+$POS/$COUNT
+<a href="$R_NEXT_HTML"><b>>>></b></a>
+`generate_header end`
+
+ <br>
+ <center>
+ <font size="-1"> $DESCRIPTION </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>
+ <a href="../index.html">Index</a>
+ <a href="$R_PREV_HTML_SLIDE"><b><<<</b></a>
+ $POS/$COUNT
+ <a href="$R_NEXT_HTML_SLIDE"><b>>>></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"> $DESCRIPTION </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>
+ <a href="../index.html">Index</a>
+ <a href="$R_PREV_HTML_INFO"><b><<<</b></a>
+ $POS/$COUNT
+ <a href="$R_NEXT_HTML_INFO"><b>>>></b></a>
+`generate_header end`
+
+
+ <br>
+
+ <center>
+
+ <table border="0" cellpadding="5">
+
+ <tr><td width="640" valign="top">
+
+ <font size="-1"> $DESCRIPTION </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ü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
--- /dev/null
+#!/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 "<\;$nick>\; $text<br>\n";
+ } else {
+ print OUTPUT "<font color=\"$htmlcolour\"><\;$nick>\;<\/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/&/&\;/g;
+ $line =~ s/</<\;/g;
+ $line =~ s/>/>\;/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 =~ /^<\;.*?>\;\s.*/) {
+
+ # Split $nick and $line
+ $nick = $line;
+ $nick =~ s/^<\;(.*?)>\;\s.*$/$1/;
+
+ # $nick =~ tr/[A-Z]/[a-z]/;
+ # <======= move this into another function when getting nick colour
+
+ $text = $line;
+ $text =~ s/^<\;.*?>\;\s(.*)$/$1/;
+ $text =~ s/ / \; \;/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 =~ /^(\*\*\*|-->) .*joined/) {
+ $line =~ s/(^(\*\*\*|-->) .*)/<font color=\"$colours{"join"}\">$1<\/font>/;
+ }
+ elsif ($line =~ /^(\*\*\*|<--) .*left|quit/) {
+ $line =~ s/(^(\*\*\*|<--) .*)/<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;
--- /dev/null
+#!/bin/sh
+# Filename: iso-term
+# Purpose: wrapper script to run x-terminal-emulator in iso885915 mode
+# 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.
+################################################################################
+
+isutfenv() {
+case "$LANG $CHARSET $LANGUAGE" in
+ (*utf*) return 0 ;;
+ (*UTF*) return 0 ;;
+ (*) return 1 ;;
+esac
+}
+
+if isutfenv ; then
+ for ENV in `env | grep UTF` ; do
+ eval export "$(echo $ENV | sed 's/UTF-8/iso885915/')"
+ done
+ ZSH_NO_DEFAULT_LOCALE=1 x-terminal-emulator $*
+else
+ ZSH_NO_DEFAULT_LOCALE=1 x-terminal-emulator $*
+fi
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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
--- /dev/null
+#!/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)
+################################################################################
+
+$|=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 #################################################################
--- /dev/null
+#!/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;
+}
--- /dev/null
+#!/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.
+################################################################################
+
+# little helper functions that skips the httpheader of a site
+function skip_httpheader {
+ for i in {1..7} ; do
+ read -u $REPLY LINE;
+ if [[ "$LINE" == "\r" ]] ; then return ; fi
+ done
+}
+
+zmodload zsh/net/tcp
+HOST=v4.showip.spamt.net
+ztcp $HOST 80
+print -u $REPLY "GET / HTTP/1.0\r\nHost: $HOST\r\n\r\n"
+skip_httpheader
+read -u $REPLY LINE
+echo "$LINE"
+ztcp -c $REPLY
+
+## END OF FILE #################################################################
--- /dev/null
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+# Copyright (C) 2005-2009 Alexander Bernauer <alex@copton.net>
+# Copyright (C) 2005-2009 Rico Schiekel <fire@downgra.de>
+# Copyright (C) 2005-2009 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.
+
+
+"""
+example of ~/.notifid.conf:
+---------------------------
+
+import os
+
+host = "127.0.0.1"
+port = 8901
+logfile = os.path.expanduser("~/.event.log")
+osdparams = "-p bottom --color=red --delay=4 --age=4 " \
+ "--font=\-\*\-helvetica\-medium\-r\-\*\-\*\-34\-\*\-\*\-\*\-\*\-\*\-\*\-15 " \
+ "--offset=100 --shadow=0 --lines=5 --align=right --indent=100"
+actions = (
+ (".*", [log], True),
+ ("IRC:&bitlbee:bitlbee", [], False),
+ (".*shutdown.*", [command('sudo shutdown -h now %(msg)s')], False),
+ (".*", [libnotify], False),
+)
+
+"""
+
+import os
+import sys
+import re
+import string
+import socket
+import logging
+import getopt
+
+default_hostname = 'localhost'
+default_port = 1234
+default_osd_params = osdparams = "-p bottom --color=red --delay=4 --age=4 " \
+ "--font=\-\*\-helvetica\-medium\-r\-\*\-\*\-34\-\*\-\*\-\*\-\*\-\*\-\*\-15 " \
+ "--offset=100 --shadow=0 --lines=5 --align=right --indent=100"
+default_logfile = None
+
+
+def play(sound_file):
+ def play_wrapper(msg):
+ os.system('/usr/bin/aplay "%s" 2> /dev/null &' % sound_file)
+ return play_wrapper
+
+def execute(command):
+ def command_wrapper(msg):
+ os.system(command % dict(msg = msg))
+ return command_wrapper
+
+def osd(msg):
+ osdcmd = "/usr/bin/osd_cat"
+ osdpipe = os.popen("%s %s" % (osdcmd, osdparams), 'w')
+ osdpipe.write(msg)
+ osdpipe.close()
+
+def libnotify(msg):
+ try:
+ import dbus
+ except ImportError:
+ sys.stderr.write('Please install python-dbus\n')
+ raise SystemExit(1)
+
+ bus = dbus.SessionBus()
+ notifyService = bus.get_object("org.freedesktop.Notifications", '/org/freedesktop/Notifications')
+ interface = dbus.Interface(notifyService, 'org.freedesktop.Notifications')
+
+ message, title = (':' + msg).split(':')[::-1][0:2]
+ if not title:
+ title, message = message, title
+ interface.Notify('notify-server', 0, 'notification-message-im', title, message, [], {'x-canonical-append':'allowed'}, -1)
+
+def log(msg):
+ if logger:
+ logger.info(msg)
+
+def syntax():
+ print "osd_server.py [options]"
+ print " options:"
+ print " -h --help print this message"
+ print " -H --host host of the osd server (def: " + default_hostname + ")"
+ print " -P --port port of the osd server (def: " + str(default_port) + ")"
+ print " -l --log log file ('-' logs to stdout)"
+
+
+env = { 'play' : play,
+ 'execute' : execute,
+ 'osd' : osd,
+ 'libnotify' : libnotify,
+ 'log' : log,
+ 'host' : default_hostname,
+ 'port' : default_port,
+ 'logfile' : default_logfile,
+ }
+
+default_actions = (
+ (".*", [log], True),
+ (".*", [libnotify], False),
+)
+
+
+default_bind = (default_hostname, default_port)
+
+try:
+ execfile(os.path.expanduser('~/.notifyd.conf'), {}, env)
+except IOError:
+ pass
+
+try:
+ opts, args = getopt.getopt(sys.argv[1:], "hH:P:l:", ["help", "host=", "port=", "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"):
+ env['host'] = arg
+ elif opt in ("-P", "--port"):
+ env['port'] = int(arg)
+ elif opt in ("-l", "--log"):
+ env['logfile'] = arg
+
+
+actions = env.get('actions', default_actions)
+logfile_name = env.get('logfile')
+logfile_format = env.get('logformat', '%(asctime)s %(message)s')
+bind_address = (env['host'], env['port'])
+osd_params = env.get('osdparams', default_osd_params)
+
+if logfile_name:
+ logger = logging.getLogger('notify_server')
+ lformatter = logging.Formatter(logfile_format)
+ 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)
+else:
+ logger = None
+
+l = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+l.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+l.bind(bind_address)
+l.listen(5)
+
+def filter_char(c):
+ return c in string.printable + "äöüßÄÖÜ" and c or '_'
+
+while 1:
+ try:
+ (con, addr) = l.accept()
+ except:
+ continue
+ data = con.recv(50).strip()
+ con.close()
+
+ log = ''.join(filter_char(c) for c in data)
+
+ for pattern, handlers, cont in actions:
+ if re.match(pattern, log):
+ for handler in handlers:
+ handler(log)
+ if not cont:
+ break
--- /dev/null
+notifyd.py
\ No newline at end of file
--- /dev/null
+#!/bin/zsh
+# Filename: qma
+# Purpose: "quick manual access"
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>, Matthias Kopfermann <maddi@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2.
+################################################################################
+
+. /etc/grml/lsb-functions
+. /etc/grml/script-functions
+
+check4progs man lzop vim || exit 1
+
+VERSION='0.1'
+
+MANDIR=${MANDIR:-$HOME/man}
+if ! [ -d "$MANDIR" ] ; then
+ einfo "Creating $MANDIR."
+ mkdir $MANDIR ; eend $?
+fi
+
+usage() {
+ eerror "Usage: qma [section] manpage" ; eend 1
+ exit 1
+}
+
+case $1 in
+ -h*|--h*)
+ usage
+ ;;
+ -v*|--v*)
+ einfo "qma - version $VERSION" ; eend 0
+ exit 0
+ ;;
+ [0-9])
+ SECTION="${1}"
+ SECTIONFILE=".${1}"
+ MANPAGE="$2"
+ SEARCH="$3"
+ ;;
+ *)
+ SECTION=''
+ MANPAGE="$1"
+ SEARCH="$2"
+ ;;
+esac
+
+
+if [ -z "$MANPAGE" ] ; then
+ usage
+fi
+
+QUICKMAN="${MANDIR}/${MANPAGE}${SECTIONFILE}.txt.lzo"
+
+if ! [ -f "$QUICKMAN" ] ; then
+ einfo "Writing manpage to $QUICKMAN"
+ if man $SECTION $MANPAGE 1>/dev/null ; then
+ man $SECTION $MANPAGE | col -b | lzop -U >$QUICKMAN ; eend $?
+ einfo "Compressing manpage with lzop"
+ eend $?
+ else
+ exit 1
+ eend 1
+ fi
+fi
+
+vimconfig='
+ set filetype=man
+ "set hlsearch can be annoying so use <C-L> to dehighlight"
+ "shut up hlsearch when it confuses more than it helps and"
+ nn <silent> <C-L> :nohlsearch<cr>|redraw
+ "q should really end our document-reading like less does"
+ nn q :qa!<cr>
+ "different than q in that it quits only the current window when multiple windows "
+ nn Q :q!<cr>
+ "honor midnight-commander addicts :) "
+ nn <F10> :qa!<cr>
+ "use one wonderful vim feature to show all matches of the word in the document in ex-mode"
+ nn a ]I
+ "the other way round"
+ nn A [I
+ nn b <C-b>
+ nn <backspace> <C-f>
+ "nn f <C-f>
+ nn p }zz
+ "scroll the page down one line"
+ nn j <C-E>
+ "scroll the page up one line"
+ nn k <C-Y>
+ "the expectation of getting the next search via 'n' can not be ignored"
+ nn -n <ESC> :set invnumber<cr>
+ nn h :set invhlsearch<cr>
+ "Make toggling case-sensitive accessable via the letter i"
+ nn i :set invignorecase<cr>
+ "Make toggling case-sensitive accessable via the less convention via -i"
+ nn -i :set invignorecase<cr>
+ nn <space> <C-f>
+ nn <backspace> <C-b>
+ nn <enter> gg
+ nn S :split<cr>
+ nn V :vsplit<cr>
+ set filetype=man
+ set ignorecase
+ "Really not modify a document here"
+ set nomodifiable
+ set readonly
+ "We have a more modern approach to searching in vim!"
+ set incsearch
+'
+
+if [ -n "$SEARCH" ] ; then
+ vim -S =( echo $vimconfig ) +/"$SEARCH" =( lzop -cd ${QUICKMAN} )
+else
+ vim -S =( echo $vimconfig ) =( lzop -cd $QUICKMAN )
+fi
+
+einfo "Thanks for flying qma using vim and lzop." ; eend 0
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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.
+################################################################################
+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
+idspispopd
+ilum
+introubulate
+jabba
+jacen
+jaina
+jango
+jebeditis
+jebus
+jiminy-jillikers
+jumping-box
+jupiter
+kamino
+kashyyyk
+kidnappophilie
+kilbeggan
+killbot-factory
+kitchensink
+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
+spispopd
+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
+'
--- /dev/null
+#!/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.
+################################################################################
+
+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 #################################################################
--- /dev/null
+#!/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
--- /dev/null
+#!/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);
--- /dev/null
+#!/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")
--- /dev/null
+#!/bin/sh
+# echo "Endless September"
+echo $(((`date +%s` - 746748000) / 86400)). September 1993
--- /dev/null
+#!/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.
+################################################################################
+
+PN=`basename "$0"`
+
+if [ -z "$PLAYER" ] ; then
+ [ -x /usr/bin/mplayer ] && PLAYER="mplayer"
+ [ -x /usr/bin/ogg123 ] && PLAYER="ogg123"
+fi
+
+if ! [ $(which $PLAYER) ] ; then
+ echo "Sorry, neither mplayer nor ogg123 available and \$PLAYER is not set.">&2
+ exit 1
+fi
+
+if [ -z "$1" ] ; then
+ FILE="/usr/share/grml/effect.ogg"
+else
+ FILE="$*"
+fi
+
+if ! [ -r "$FILE" ] ; then
+ echo "Sorry, /usr/share/grml/effect.ogg of package grml-files not available.">&2
+ exit 1
+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 file(s) you want to play as argument(s),
+adjust player which should be used for playing the files
+via environment variable PLAYER. Usage example:
+
+ PLAYER=mplayer $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 #################################################################
--- /dev/null
+# 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
--- /dev/null
+#!/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.
+################################################################################
+
+# 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}
+<a href=\"../index.html\">Index</a> <a href=\"${LAST}.html\"><<<</a> ${CURRENT}/${IMAGE_COUNT} <a href=\"${NEXT}.html\">>>></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 #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+# 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)
--- /dev/null
+#!/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++
+}
--- /dev/null
+#!/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.
--- /dev/null
+#!/bin/sh
+# Filename: wm-ng
+# Purpose: a wrapper script to call fluxbox with some additional features activated
+# Authors: grml-team (grml.org)
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2.
+################################################################################
+
+gkrellm -g -1+26 &
+
+(sleep 2; idesk &) &
+
+fluxbox
+
+exit $?
+
+## END OF FILE #################################################################
--- /dev/null
+# 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;
--- /dev/null
+#!/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.
+################################################################################
+
+if [ -x /usr/bin/sselp ] ; then # package dwm-tools
+ flite -o play -t "$(sselp)"
+elif [ -x /usr/bin/xclip ] ; then # package xclip
+ flite -o play -t "$(xclip -o)"
+elif [ -x /usr/bin/wmiipsel ] ; then # old wmii package
+ flite -o play -t "$(wmiipsel)"
+elif [ -x /usr/bin/wmiiplumb ] ; then # old wmii package
+ flite -o play -t "$(wmiiplumb)"
+elif [ -x /usr/bin/wmiplumb ] ; then # deprecated wmi package
+ flite -o play -t "$(wmiplumb)"
+else
+ echo "error, no program for reading X selection found" | flite
+fi
+
+## END OF FILE #################################################################
--- /dev/null
+#!/bin/bash
+# Filename: zsh-login
+# Purpose: customized zsh login welcome screen for use at 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.
+################################################################################
+
+. /etc/grml/sh-lib
+
+[ -r /etc/grml_version ] && GRMLVERSION=$(cat /etc/grml_version) || GRMLVERSION='(no version information available)'
+PATH=$HOME/bin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/games:/home/grml/bin
+CMDLINE=$(cat /proc/cmdline)
+[ -n "$distri" ] || distri="grml"
+
+# Activate unicode console if running within utf8 environment
+# Dirty hack to fix unicode issue on amd64...
+# unicode_start during bootprocess just does not work reliable :(
+NUM_CONSOLES=12
+if [ -r /etc/default/locale ] ; then
+ if grep -q "LANG=.*UTF" /etc/default/locale ; then
+ for vc in `seq 1 ${NUM_CONSOLES}` ; do
+ echo -n -e '\033%G' > /dev/tty${vc}
+ done
+ kbd_mode -u
+ dumpkeys | loadkeys --unicode > /dev/null
+ fi
+fi
+
+case "$CMDLINE" in
+ # allow customized startup via bootoption startup:
+ *startup=*)
+ script="$(getBootParam startup)"
+ if [ -x $(which $script) ] ; then
+ $script
+ fi
+ ;;
+ # turn on speakers for accessibility users:
+ *\ swspeak*|*blind*|*brltty*|*speakup*)
+ if [ $(which flite) ] ; then
+ flite -o play -t "Finished booting"
+ fi
+ ;;
+
+ # do nothing if booting with bootoption noquick:
+ *\ noquick*)
+ ;;
+ *) # by default run grml-quickconfig, but only if running as root
+ if [ "$(id -u)" = "0" ] ; then
+ # do not run grml-quickconfig on grml-small
+ if ! grep -q small /etc/grml_version ; then
+ which grml-quickconfig &>/dev/null && grml-quickconfig
+ fi
+ fi
+esac
+
+# just print out an empty line if bootoption "nowelcome" is present
+if grep -q nowelcome /proc/cmdline 2>/dev/null ; then
+ echo
+# ... otherwise allow customized release information
+elif [ -r /etc/release_info ] ; then
+ cat /etc/release_info
+else # ... or finally fall back to grml's default
+ # display version information depending on the version:
+ if grep -q -- '-rc[0-9]' /etc/grml_version 2>/dev/null ; then
+ echo
+ echo
+ echo 'NOTICE: This is a release candidate version!'
+ echo 'Please notice that this is not yet a stable release.'
+ echo 'See http://wiki.grml.org/doku.php?id=release_candidate for known issues.'
+ echo 'Please report any bugs you notice: bugs@grml.org'
+ echo
+ fi
+
+ if grep -q 'grml-live-autobuild' /etc/grml_version 2>/dev/null ; then
+ echo
+ echo
+ echo 'NOTICE: This is a daily snapshot version!'
+ echo 'Please notice that this is not yet a stable release.'
+ echo 'See http://daily.grml.org/ for more details.'
+ echo 'Please report any bugs you notice: daily@grml.org'
+ echo
+ fi
+
+ echo "
+Welcome to ${GRMLVERSION}!
+
+New to ${distri}? 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/
+"
+fi
+
+exec /bin/zsh -l
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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
+
+
+
+
+
+
--- /dev/null
+#! /usr/bin/perl
+# Filename: alignmargins
+# Purpose: adjust the margins and the position of the printed contents on the paper
+# Authors: (C) 2001 by Till Kamppeter
+# Bug-Reports: see http://grml.org/bugs/
+# License: Free software under the terms of the GNU General Public License (GPL)
+################################################################################
+# Downloaded from http://www.linuxprinting.org/download/printing/alignmargins
+
+$0 =~ m!^(.*)/[^/]+$!;
+my $programpath = $1;
+my $printcommand = '/usr/bin/lpr -P ';
+my $egrep = '/bin/egrep';
+my $cat = '/bin/cat';
+my $cut = '/usr/bin/cut';
+my $head = '/usr/bin/head';
+my $tail = '/usr/bin/tail';
+my $wc = '/usr/bin/wc';
+my $adjustmentpagename = 'align.ps';
+my $adjustmentpagepath = ($programpath ? "${programpath}:" : "") . '.:~:/usr/share/grml-scripts:/usr/share/alignmargins:/usr/local/share/alignmargins:/usr/share:/usr/local/share:/usr/share/printer-testpages:/usr/local/share/printer-testpages:/usr/share/ghostscript/*/lib:/usr/local/share/ghostscript/*/lib';
+my $ppddir = '/etc/cups/ppd';
+my $printerconffile = '/etc/cups/printers.conf';
+
+# Find "ælign.ps"
+
+my $adjustmentpage;
+for $path (split(":", $adjustmentpagepath)) {
+ if (-r "$path/$adjustmentpagename") {
+ $adjustmentpage = "$path/$adjustmentpagename";
+ last;
+ }
+}
+
+# Are we running as root?
+
+if (!(-w $printerconffile)) {die "\"alignmargins\" must be run logged in as \"root\"!";}
+
+# Check whether there are local printer queues
+
+open NUMBEROFQUEUES, "$cat $printerconffile | $egrep '<Printer|<DefaultPrinter' | $wc -l |" or die "Cannot read local printer configuration!";
+
+my $nqueues = <NUMBEROFQUEUES>;
+close NUMBEROFQUEUES;
+
+# Ask the user which printer he wants to align
+
+print "\n";
+print "CUPS printer margin and offset alignment\n";
+print "----------------------------------------\n";
+print "\n";
+print "(C) 2001 by Till Kamppeter\n";
+print "Free software under the terms of the GNU General Public License (GPL)\n";
+my $queue = "";
+
+do {
+ print "\n";
+ print "With this program you can adjust the margins and the position of the\n";
+ print "printed contents on the paper. This way you get well-centered printouts and\n";
+ print "you can make use of the whole imageable area of your printer, The driver\n";
+ print "settings are overridden when this adjustment is used.\n";
+ print "\n";
+ print "This is especially important when your printer is used with a driver for\n";
+ print "another printer to which yours is compatible (for example many laser\n";
+ print "printers are compatible to the HP LaserJet printers). Your printer prints\n";
+ print "with this driver, but the non-printable margins are usually different or the\n";
+ print "contents is even not centered. With this program you can fix these problems\n";
+ print "\n";
+ print "The program can only be applied to local printer queues. The following\n";
+ print "queues are available:\n";
+ print "\n";
+
+ system "$cat $printerconffile | $egrep '<Printer|<DefaultPrinter' | $cut -d ' ' -f 2 | $cut -d '>' -f 1 | $cat -n";
+
+ print "\n";
+ print "Please enter the number of the desired printer and make sure that it is\n";
+ print "connected to your computer and turned on.\n";
+ print "\n";
+
+ print "Number: ";
+ my $input = <STDIN>;
+
+ if ( $input =~ m/^\s*(\d+)\D*/ ) {
+ my $number = $1;
+ if (($number > 0) && ($number <= $nqueues)) {
+ open QUEUE, "$cat $printerconffile | $egrep '<Printer|<DefaultPrinter' | $cut -d ' ' -f 2 | $cut -d '>' -f 1| $head -$number | $tail -1 |";
+ if (!$?) {
+ $queue = <QUEUE>;
+ close QUEUE;
+ }
+ }
+ } else {
+ print "\nWrong input, try again!\n";
+ }
+} until ($queue ne "");
+
+chomp $queue;
+
+print "\n";
+print "Printing margin/offset adjustment page ...\n";
+print "\n";
+
+# The "%!" which is needed in a file to be recognized as a PostScript file
+# is missing in the adjustment page, therefore it is preceeded to the file
+# here.
+if (system "(echo %!; $cat $adjustmentpage) | $printcommand$queue") {
+die "Could not print the adjustment page.";
+}
+
+print "Please read the instructions on the margin adjustment page and determine the\n";
+print "six numbers mentioned there. If you measure in cm and not in inches, devide\n";
+print "the measured quantities by 2.54 before you insert them into the equations\n";
+print "shown on the page. You do not need to create any file with PostScript\n";
+print "commands, this program will insert your settings into your printer's\n";
+print "configuration.\n";
+print "\n";
+print "If the adjustment page did not come out of your printer, this method cannot\n";
+print "be applied, press Ctrl + C to stop this program. This can especially happen\n";
+print "with very old PostScript printers.\n";
+print "\n";
+print "Note also that this adjustment does not necessarily work with every driver.\n";
+print "The concept is taken from GhostScript and the implementation of this program\n";
+print "is not much tested yet.\n";
+print "\n";
+
+print "Please enter your results now:\n";
+print "\n";
+
+my $ml = 9999999.;
+my $mb = 9999999.;
+my $mr = 9999999.;
+my $mt = 9999999.;
+my $x = 9999999.;
+my $y = 9999999.;
+
+do {
+ print "ml: ";
+ my $input = <STDIN>;
+
+ if ( $input =~ m/^\s*([+-]?[\d\.]+)\D*/ ) {
+ my $number = $1;
+ if (($number >= -100000) && ($number <= 100000)) {
+ $ml = $number * 1.;
+ }
+ } else {
+ print "Wrong input, try again!\n";
+ }
+} until ($ml != 9999999.);
+
+do {
+ print "mb: ";
+ my $input = <STDIN>;
+
+ if ( $input =~ m/^\s*([+-]?[\d\.]+)\D*/ ) {
+ my $number = $1;
+ if (($number >= -100000) && ($number <= 100000)) {
+ $mb = $number * 1.;
+ }
+ } else {
+ print "Wrong input, try again!\n";
+ }
+} until ($mb != 9999999.);
+
+do {
+ print "mr: ";
+ my $input = <STDIN>;
+
+ if ( $input =~ m/^\s*([+-]?[\d\.]+)\D*/ ) {
+ my $number = $1;
+ if (($number >= -100000) && ($number <= 100000)) {
+ $mr = $number * 1.;
+ }
+ } else {
+ print "Wrong input, try again!\n";
+ }
+} until ($mr != 9999999.);
+
+do {
+ print "mt: ";
+ my $input = <STDIN>;
+
+ if ( $input =~ m/^\s*([+-]?[\d\.]+)\D*/ ) {
+ my $number = $1;
+ if (($number >= -100000) && ($number <= 100000)) {
+ $mt = $number * 1.;
+ }
+ } else {
+ print "Wrong input, try again!\n";
+ }
+} until ($mt != 9999999.);
+
+do {
+ print "x: ";
+ my $input = <STDIN>;
+
+ if ( $input =~ m/^\s*([+-]?[\d\.]+)\D*/ ) {
+ my $number = $1;
+ if (($number >= -100000) && ($number <= 100000)) {
+ $x = $number * 1.;
+ }
+ } else {
+ print "Wrong input, try again!\n";
+ }
+} until ($x != 9999999.);
+
+do {
+ print "y: ";
+ my $input = <STDIN>;
+
+ if ( $input =~ m/^\s*([+-]?[\d\.]+)\D*/ ) {
+ my $number = $1;
+ if (($number >= -100000) && ($number <= 100000)) {
+ $y = $number * 1.;
+ }
+ } else {
+ print "Wrong input, try again!\n";
+ }
+} until ($y != 9999999.);
+
+my $ppdfilename = "$ppddir/$queue.ppd";
+print "\n";
+print "Saving your settings in $ppdfilename ...\n";
+print "\n";
+
+my @marginsoption = (
+ "*OpenUI *Margins/Page Margins/Offsets: PickOne\n",
+ "*DefaultMargins: Custom\n",
+ "*Margins Default/Driver Default: \"\"\n",
+ "*Margins Custom/Custom (set with 'alignmargins'): \"<</.HWMargins[$ml $mb $mr $mt] /Margins[$x $y]>>setpagedevice\"\n",
+ "*CloseUI: *Margins\n"
+);
+
+# Read PPD file of the chosen printer
+
+if (!(-f $ppdfilename)) {die "No PPD file $ppdfilename!"};
+open PPDFILE, "$ppdfilename" or die "Can't open $ppdfilename!";
+my @ppdfile = <PPDFILE>;
+close PPDFILE;
+
+# Remove an old margin adjustment option
+
+($_ =~ m!^\s*\*OpenUI\s*\*Margins/.*:! and $_="") foreach @ppdfile;
+($_ =~ m!^\s*\*DefaultMargins:! and $_="") foreach @ppdfile;
+($_ =~ m!^\s*\*Margins\s*.*/.*:! and $_="") foreach @ppdfile;
+($_ =~ m!^\s*\*CloseUI:\s*\*Margins! and $_="") foreach @ppdfile;
+
+# Insert the new margin adjustment option
+
+splice(@ppdfile,-1,0,@marginsoption);
+
+# Write back PPD file
+
+open PPDFILE, ">$ppdfilename" or die "Can't open $ppdfilename";
+print PPDFILE @ppdfile;
+close PPDFILE;
+
+# Re-initialize CUPS (must be done after a "manual" change on the PPD file)
+
+system("killall -HUP cupsd");
+
+print "\n";
+print "Done.\n";
+print "\n";
+print "Now your printer \"$queue\" will use the new margin and offset settings by\n";
+print "default. You can turn them off by switching the option \"Page Margins/Offsets\"\n";
+print "to \"Driver Default\" in kprinter, GTKlp, or XPP.\n";
+print "\n";
+print "On the command line (\"lpr\", \"lp\", \"lpoptions\", ...) use the option\n";
+print "\"-o Margins=Default\" to turn off and \"-o Margins=Custom\" to turn on your\n";
+print "settings.\n";
+print "\n";
+
+exit 0;
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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
--- /dev/null
+#!/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.
+################################################################################
+
+PN="$(basename $0)"
+[ -n "$MODPROBEFILE" ] || MODPROBEFILE=/etc/modprobe.d/grml.conf
+[ -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 [ "$(id -ru)" != "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 #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+. /etc/grml/lsb-functions
+
+if [ "$(id -ru)" != "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 #################################################################
--- /dev/null
+#!/bin/sh
+# Filename: dirvish-setup
+# Purpose: create basic setup for dirvish(8)
+# 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.
+################################################################################
+# Ressources:
+# http://apt-get.dk/howto/backup/
+# http://edseek.com/~jasonb/articles/dirvish_backup/advanced.html
+# http://www.dirvish.org/svn/contrib/admin/DailyEmailScript/dirvish-status.sh
+################################################################################
+
+set -e
+
+. /etc/grml/script-functions
+. /etc/grml/lsb-functions
+
+check4root
+check4progs dialog dirvish rsync ssh-keygen ssh-copy-id
+
+PN="$0"
+CONFFILE=/etc/dirvish/master.conf
+
+set +e
+
+write_conffile() {
+ if [ -f "$CONFFILE" ] ; then
+ MASTERINFO="Notice: $CONFFILE exists already so I will not touch it.
+Please do not forget to add $CLIENT to the file if you wan to use the 'Runall' functionality."
+ else
+ MASTERINFO="An initial master configuration ($CONFFILE) has been generated.
+Please adjust it according to your needs."
+ cat > $CONFFILE << EOF
+# Master configuration file for dirvish, created by $PN on $(date)
+
+bank:
+ $BACKUP_DIR
+
+exclude:
+ lost+found/
+# core
+# *~
+# .nfs*
+# /var/lib/nfs/*tab
+# var/cache/apt/archives
+# var/cache/man
+# var/tmp
+# tmp
+# /dev
+# .kde/share/cache/*
+# .firefox/default/*/Cache/*
+
+Runall:
+ $CLIENT 22:00
+ # add-another-client-here 22:00
+
+ # See http://www.dirvish.org/debian.howto.html for further details:
+expire-default: +30 days
+expire-rule:
+# MIN HR DOM MON DOW STRFTIME_FMT
+ * * * * 1 +3 months
+ * * 1-7 * 1 +1 year
+ * * 1-7 1,4,7,10 1
+ * 10-20 * * * +4 days
+# * * * * 2-7 +15 days
+
+EOF
+ fi
+}
+
+# TODO / integrate?
+cronsetup() {
+ test -f ~/.keychain/`uname -n`-sh && . ~/.keychain/`uname -n`-sh
+}
+
+get_backup_dir() {
+ # prompt user for directory which should be used
+ BACKUP_DIR="$(dialog --stdout --inputbox 'Please choose the directory where backups should be placed' 0 0 /backups)"
+
+ if ! [ -d "$BACKUP_DIR" ] ; then
+ dialog --stdout --title "${PN}" --yesno "The directory $BACKUP_DIR does not yet exist. Do you want me to create it for you? " 0 0
+
+ if [ $? -eq 0 ]; then
+ echo "mkdir $BACKUP_DIR"
+ echo "chmod 700 $BACKUP_DIR"
+ else
+ echo "warning: $BACKUP_DIR does not exist, skipped creation as requested"
+ fi
+ fi
+}
+
+client_name() {
+ CLIENT="$(dialog --stdout --inputbox 'Please choose the name for your client instance, also known as vault' 0 0 client1)"
+}
+
+tree_name() {
+ TREE="$(dialog --stdout --inputbox 'Please choose the directory you want to backup from your client (also known as tree)' 0 0 /home)"
+}
+
+create_client_conf() {
+ mkdir -p "${BACKUP_DIR}/${CLIENT}/dirvish"
+ if [ -f "${BACKUP_DIR}/${CLIENT}/dirvish/default.conf" ] ; then
+ ewarn "Warning: ${BACKUP_DIR}/${CLIENT}/dirvish/default.conf exists already, ignoring creation." ; eend 0
+ else
+ cat > "${BACKUP_DIR}/${CLIENT}/dirvish/default.conf" << EOF
+# Configuration file of client-side for dirvish created by $PN on $(date)
+client: $CLIENTNAME
+tree: $TREE
+xdev: true
+index: gzip
+image-default: %Y-%m-%d
+exclude:
+ var/cache/apt/archives/*
+ var/cache/man/*
+ tmp/*
+ var/tmp/*
+rsh: ssh -i $HOME/.ssh/id_rsa_dirvish_${CLIENT}
+EOF
+ fi
+}
+
+sshkey_setup() {
+ CLIENTNAME="$(dialog --stdout --inputbox 'Please choose user login and hostname for the client you want to backup. Syntax: user@host' 0 0 root@$(hostname))"
+
+ dialog --stdout --title "${PN}" --yesno "Do you want me to create ssh setup for client ${CLIENTNAME} using ssh-keygen and ssh-copy-id?" 0 0
+
+ if [ $? -eq 0 ]; then
+ [ -d "$HOME/.ssh" ] || mkdir "$HOME/.ssh"
+ einfo "Creating $HOME/.ssh/id_rsa_dirvish_${CLIENT} using ssh-keygen:"
+ ssh-keygen -t rsa -f "$HOME/.ssh/id_rsa_dirvish_${CLIENT}" ; eend $?
+ einfo "Running ssh-copy-id to copy ssh key to $CLIENTNAME:"
+ ssh-copy-id -i "$HOME/.ssh/id_rsa_dirvish_${CLIENT}.pub" $CLIENTNAME ; eend $?
+ fi
+}
+
+client_setup() {
+ dialog --stdout --title "${PN}" --yesno "Do you want to backup $CLIENT via network? Answering with no will use localhost [$(hostname)] as client." 0 0
+
+ if [ $? -eq 0 ]; then
+ sshkey_setup
+ else
+ CLIENTNAME=$(hostname) # use localhost only
+ fi
+}
+
+display_info() {
+ einfo "Running $PN was successful. Enjoy using dirvish!" ; eend 0
+ echo
+ einfo "Please adjust ${BACKUP_DIR}/${CLIENT}/dirvish/default.conf according to your needs.
+$MASTERINFO
+Then run the following command to create an initial backup:
+
+ dirvish --summary long --vault $CLIENT --init
+
+Find the backup inside $BACKUP_DIR/$CLIENT/$(date +%Y-%m-%d)/tree/ then.
+
+Documentation available at:
+
+ man dirvish-locate.1 dirvish.conf.5 dirvish.8 dirvish-runall.8 dirvish-expire.8
+ /usr/share/doc/dirvish/HOWTO.upstream /usr/share/doc/dirvish/FAQ.html
+ /usr/share/doc/dirvish/HOWTO.Debian.gz
+
+ http://www.dirvish.org/
+ http://wiki.dirvish.org/
+
+Please report bugs regarding ${PN}: http://grml.org/bugs/
+" ; eend 0
+}
+
+case "$1" in
+ -h | --help | --h* )
+ echo "Usage: $PN" 1>&2
+ exit 1
+ ;;
+esac
+
+# now run the funtions:
+get_backup_dir && \
+client_name && \
+tree_name && \
+client_setup && \
+create_client_conf && \
+write_conffile && \
+display_info
+
+## END OF FILE #################################################################
+# vim: ft=sh ai tw=80 expandtab
--- /dev/null
+#!/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";
+}
--- /dev/null
+#!/bin/bash
+# Filename: grml-chroot
+# Purpose: Program to chroot into another system
+# 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.
+################################################################################
+
+PROG_NAME_=$(basename $0)
+DEST_=""
+MOUNTED_="" # all mounted destinations
+
+
+function die
+{
+ echo "Error: $@" >&2
+ exit 1
+}
+
+function printUsage
+{
+ cat <<EOT
+Usage: "$PROG_NAME_" NEWROOT [COMMAND....]
+
+$PROG_NAME_ is a chroot wrapper with proc/sys/pts/dev filesystem handling
+
+EOT
+}
+
+function storeMounts
+{
+ local to_append_="$1"
+ if [[ $MOUNTED_ == "" ]]; then
+ MOUNTED_="$to_append_"
+ else
+ MOUNTED_="$MOUNTED_ $to_append_"
+ fi
+}
+
+function mountit
+{
+ local type_="$1" # type _or_ src
+ local dest_="$2"
+ local options_="$3"
+
+ local all_options_=""
+
+ if [[ $options_ == "--bind" ]]; then
+ all_options_="--bind $type_"
+ else
+ all_options_="-t $type_ none"
+ fi
+ mount $all_options_ "${DEST_}/$dest_" && storeMounts "$dest_"
+}
+
+function umount_all
+{
+ for i in $MOUNTED_; do
+ umount "${DEST_}/$i"
+ done
+}
+
+
+###
+### __MAIN
+###
+
+while getopts "h" opt; do
+ case "$opt" in
+ h) printUsage; exit 0 ;;
+ ?) printUsage; exit 64 ;;
+ esac
+done
+shift $(($OPTIND - 1))
+
+if (( $# < 1 )); then
+ printUsage
+ die "Wrong number of arguments."
+fi
+
+DEST_="$1"; shift
+
+if [ ! -d "$DEST_" ]; then
+ die "Target chroot does not exist: $DEST_"
+fi
+
+
+mountit "proc" "proc"
+mountit "sysfs" "sys"
+mountit "/dev" "dev" "--bind"
+if (( $# < 1 )); then
+ chroot "$DEST_"
+ RC=$?
+else
+ chroot "$DEST_" "$@"
+ RC=$?
+fi
+umount_all
+
+exit $RC
--- /dev/null
+#!/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.
+################################################################################
+
+PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}
+
+# set up some variables
+DIALOG=$(which dialog)
+PN=$(basename $0)
+
+if [ "$(id -ru)" != "0" ] ; then
+ DEFAULTITEM=user
+else
+ DEFAULTITEM=root
+fi
+
+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 #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}
+
+# set up some variables
+DIALOG=`which dialog`
+PN=$(basename $0)
+
+if [ "$(id -ru)" != "0" ] ; then
+ $DIALOG --msgbox "Error: $0 requires root permissions. Exiting." 0 0
+ exit 100
+fi
+
+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-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-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 #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+. /etc/grml/script-functions
+
+check4root || exit 1
+
+[ -n "$SUDO_USER" ] && RUNASUSER=$SUDO_USER || RUNASUSER=grml
+
+PN='grml-hostname'
+OLDHOSTNAME="$(hostname)"
+
+case "$1" in -h|--help) echo "Usage: $0 [hostname]">&2; exit 1 ;; esac
+
+if [ -n "$1" ] ; then
+ NEW_HOSTNAME="$1"
+ NONINTERACTIVE=1
+else
+ if [ -x /usr/bin/random-hostname ] ; then
+ NEW_HOSTNAME="$(/usr/bin/random-hostname)"
+ else
+ NEW_HOSTNAME="$(hostname)"
+ fi
+fi
+
+if [ -z "$NONINTERACTIVE" ] ; then
+ NEW_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" 14 70 $NEW_HOSTNAME)"
+ retval=$?
+else
+ retval=0
+fi
+
+case $retval in
+ 0)
+ echo "$NEW_HOSTNAME" > /etc/hostname
+ echo "$NEW_HOSTNAME" > /etc/mailname
+ sed -i "s/^127.0.0.1[ \t]*$OLDHOSTNAME[ \t]*localhost/127.0.0.1 $NEW_HOSTNAME localhost/" /etc/hosts
+ sed -i "s/^::1[ \t]*ip6-localhost ip6-loopback[ \t]*$OLDHOSTNAME/::1 ip6-localhost ip6-loopback $NEW_HOSTNAME/" /etc/hosts
+ POSTFIX=''
+ if [ -r /etc/postfix/main.cf ] ; then
+ sed -i "s/^mydestination = .*/mydestination = $NEW_HOSTNAME, localhost, localhost.localdomain/" /etc/postfix/main.cf && \
+ sed -i "s/^myhostname = .*/myhostname = $NEW_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
+ if [ -n "$DISPLAY" ] ; then
+ if sudo -u $RUNASUSER xauth add $(xauth -n list | grep "${OLDHOSTNAME}/unix:0" | sed "s|${OLDHOSTNAME}/unix:0|${NEW_HOSTNAME}/unix:0|") ; then
+ sudo -u $RUNASUSER xauth remove "${OLDHOSTNAME}/unix:0"
+ fi
+ fi
+
+ /etc/init.d/hostname.sh
+
+ if [ -z "$NONINTERACTIVE" ] ; then
+ dialog --stdout --title "${PN}" --msgbox "Setting hostname to $NEW_HOSTNAME was successful.$POSTFIX" 0 0
+ else
+ echo "Setting hostname to $NEW_HOSTNAME: done"
+ fi
+ exit 0
+ ;;
+ 1)
+ echo "Cancel pressed."
+ ;;
+ 3)
+ $0 ;;
+ 255)
+ echo "ESC pressed."
+ ;;
+esac
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+. /etc/grml/script-functions
+. /etc/grml/lsb-functions
+check4progs iptstate || exit 1
+
+if grep -q '_conntrack' /proc/modules ; then
+ iptstate
+else
+ einfo "iptstate is a top-like display of IP Tables state table entries."
+ echo
+ ewarn "Module ip_conntrack is not present. Can not start iptstate therefore."
+ eindent
+ einfon "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 ; RC=$?
+ eend $RC
+ [ "$RC" = 0 ] && exec iptstate
+ else
+ echo "Aborting as requested."
+ exit 1
+ fi
+fi
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+PATH="/bin:/usr/bin:/sbin:/usr/sbin"
+LANG=C
+LC_ALL=C
+
+if [ "$(id -ru)" != "0" ] ; then
+ echo Error: become root before starting $0 >& 2
+ exit 100
+fi
+
+dpkg-reconfigure postfix
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+PN="$(basename $0)"
+DIALOG=dialog
+CMDLINE=/proc/cmdline
+
+. /etc/grml/script-functions
+
+check4root || exit 1
+
+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
+}
+
+# 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=$(LANG=C $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 \
+ be belgian off \
+ bg bulgarian off \
+ cf "french canadian" off \
+ ch swiss off \
+ cn chinese off \
+ cs czech off \
+ cz czech off \
+ da da off \
+ de german off \
+ dk dansk off \
+ en "english [us] (default)" on \
+ es spanish off \
+ fi finnish off \
+ fr french off \
+ he hebrew off \
+ ie irish off \
+ il hebrew 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
+ . /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
+ LANG=C $DIALOG --stdout --msgbox "Writing keyboard settings ($KEYTABLE) to /etc/sysconfig/keyboard was successful." 0 0
+ ;;
+ *)
+ LANG=C $DIALOG --stdout --msgbox "Error writing settings for $KEYTABLE to /etc/sysconfig/keyboard." 0 0
+ ;;
+esac
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+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
+ # is the new Debian style /etc/default/locale present?
+ elif 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
+ LANG=C $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=$(LANG=C $DIALOG --stdout --title "$PN" --default-item $DEFAULT_LANGUAGE --radiolist \
+"Which language do you want to use?
+
+This will affect \$LANG, \$LANGUAGE and \$LC_MESSAGES.
+
+Notice: if you want to adjust /etc/locale.gen (defines
+which locales should be generated by locale-gen)
+please run 'dpkg-reconfigure locales' manually.
+
+Configuration will be written to $CONFFILE" 0 0 0 \
+ at 'austria (unicode version)' off \
+ at-iso 'austrian (iso version)' off \
+ au 'austrial (unicode version)' off \
+ au-iso 'australian (iso version)' off \
+ be 'belgian (unicode version)' off \
+ be-iso 'belgian (iso version)' off \
+ bg 'bulgarian (unicode version)' off \
+ bg-iso 'bulgarian (iso version)' off \
+ br 'brazilian (unicode version)' off \
+ br-iso 'brazilian (iso version)' off \
+ ch 'swiss (unicode version)' off \
+ ch-iso 'swiss (iso version)' off \
+ cf 'french canadian' off \
+ cn 'chinese (unicode version)' off \
+ cn-iso 'chinese (iso version)' off \
+ cs 'czech (unicode version)' off \
+ cs-iso 'czech (iso version)' off \
+ cz 'czech (unicode version)' off \
+ cz-iso 'czech (iso version)' off \
+ de 'german (unicode version)' off \
+ de-iso 'german (iso version)' off \
+ dk 'dansk (unicode version)' off \
+ dk-iso 'dansk (iso version)' off \
+ da 'dansk (unicode version)' off \
+ da-iso 'dansk (iso version)' off \
+ el 'greek (unicode version)' off \
+ el-iso 'greek (iso version)' off \
+ en 'english [us] (unicode version, grml default)' on \
+ en-iso 'english [us] (iso version)' off \
+ es 'spanish (unicode version)' off \
+ es-iso 'spanish (iso version)' off \
+ fi 'finnish (unicode version)' off \
+ fi-iso 'finnish (iso version)' off \
+ fr 'frensh (unicode version)' off \
+ fr-iso 'frensh (iso version)' off \
+ ga 'irish gaeilge (unicode version)' off \
+ ga-iso 'irish gaeilge (iso version)' off \
+ he 'hebrew (unicode version)' off \
+ he-iso 'hebrew (iso version)' off \
+ il 'hebrew (unicode version)' off \
+ il-iso 'hebrew (iso version)' off \
+ ie 'irish (unicode version)' off \
+ ie-iso 'irish (iso version)' off \
+ it 'italian (unicode version)' off \
+ it-iso 'italian (iso version)' off \
+ ja 'japanese (unicode version)' off \
+ ja-iso 'japanese (iso version)' off \
+ nl 'dutch (unicode version)' off \
+ nl-iso 'dutch (iso version)' off \
+ pl 'polish (unicode version)' off \
+ pl-iso 'polisch (iso version)' off \
+ pt 'portuguese (unicode version)' off \
+ pt-iso 'portuguese (iso version)' off \
+ ru 'russian (unicode version)' off \
+ ru-iso 'russian (iso version)' off \
+ sk 'slovak (unicode version)' off \
+ sk-iso 'slovak (iso version)' off \
+ sl 'slovenian (unicode version)' off \
+ sl-iso 'slovenian (iso version)' off \
+ tr 'turkish (unicode version)' off \
+ tr-iso 'turkish (iso version)' off \
+ tw 'chinese (traditional) (unicode version)' off \
+ tw-iso 'chinese (traditional) (iso version)' off \
+ uk 'british (unicode version)' off \
+ uk-iso 'british (iso version)' off \
+ us 'american (unicode version)' off \
+ us-iso 'american (iso 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 -qe "${LANGUAGE})" -qe "${LANGUAGE}|" $LANGFUNC ; then
+ ewarn "Language ${LANGUAGE} not supported, using default." ; eend 0
+fi
+
+# fallback to C if using an ISO system (which is latin1 for LC_CTYPE);
+# this should prevent users from broken ctype settings if the set
+# locale isn't available on a remote system
+if echo $LANGUAGE | grep -q -- '-iso' ; then
+ LC_CTYPE=C
+fi
+
+# read in the file where all the $LANGUAGE stuff is defined
+ . $LANGFUNC
+
+# make sure the file exists
+if ! [ -r $CONFFILE ] ; then
+cat > $CONFFILE <<EOF
+# File generated by $PN on $(date)
+LANG=$LANG
+# LC_CTYPE=$LC_CTYPE
+# LANGUAGE=$LANGUAGE
+# TZ=$TZ
+# other environment variables you might want to set:
+# LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY
+# LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS
+# LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION
+#
+# Note: set LC_ALL to overwrite all LC_* variables
+# LC_ALL > LC_* > LANG
+# LANGUAGE is glibc only and binds stronger than LC_ALL
+EOF
+fi
+
+setvalue 'LANG=' $LANG
+
+retval=$?
+case $retval in
+ (0)
+ if [ -z "$NONINTERACTIVE" ] ; then
+ LANG=C $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
+ LANG=C $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 #################################################################
--- /dev/null
+#!/bin/bash
+# Filename: grml-setservices
+# Purpose: interface for basic configuration of system startup
+# 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.
+################################################################################
+
+PN="$(basename $0)"
+TMP=$(mktemp)
+DIALOG=dialog
+CONFFILE='/etc/runlevel.conf'
+
+. /etc/grml/script-functions
+. /etc/grml/lsb-functions
+
+check4root || exit 100
+
+bailout(){
+ rm -f "$TMP"
+ exit 0
+}
+
+trap bailout HUP INT QUIT TERM
+
+is_value_set(){
+ [ -n "$1" ] || return 2
+ [ -r "$TMP" ] || return 3
+ grep -q "$1" $TMP && return 0 || return 1
+}
+
+INFO="Which services would you like to have enabled on your system?
+
+Notice: this script will adjust your ${CONFFILE}, the
+file which provides the startup configuration for your
+system. You can edit the file manually as well.
+
+If you do not know what to choose just take the defaults
+or choose cancel.
+"
+
+# enable checks only if the according init script is present
+[ -r /etc/init.d/lvm2 ] && LVM='lvm!logical volume management!on'
+[ -r /etc/init.d/mdadm ] && SRAID='mdadm!software-raid via mdadm!on'
+[ -r /etc/init.d/dmraid ] && MRAID='dmraid!software-raid via dmraid!off'
+[ -r /etc/init.d/dbus -o -r /etc/init.d/dbus-1 ] && DBUS='dbus!hal/dbus (important for KDE e.g.)!off'
+[ -r /etc/init.d/hal ] && HAL='hal!Hardware Abstraction Layer daemon (important for KDE e.g.)!off'
+[ -r /etc/init.d/nfs-common ] && NFS='nfs!Network File System (client setup)!off'
+
+## adjust setup
+# logic:
+# if is_value_set
+# remove_from_runlevel.conf
+# set_up_defaults_as_intented_in_/var/lib/dpkg/info/$PACKAGE.postinst
+# else
+# remove_from_runlevel.conf
+# set_up_only_for_stop_to_prevent_reactivation_via_maintainer_scripts_on_upgrade
+set_values(){
+ if [ -n "$LVM" ] ; then
+ if is_value_set "lvm" ; then
+ update-rc.d -f lvm2 remove >/dev/null 2>&1
+ update-rc.d lvm2 start 26 S . start 50 0 6 .
+ else
+ update-rc.d -f lvm2 remove >/dev/null 2>&1
+ update-rc.d lvm2 stop 20 0 1 6 . >/dev/null 2>&1
+ fi
+ fi
+
+ if [ -n "$SRAID" ] ; then
+ if is_value_set "mdadm" ; then
+ update-rc.d -f mdadm remove >/dev/null 2>&1
+ update-rc.d mdadm-raid start 25 S . start 50 0 6 . >/dev/null 2>&1
+ update-rc.d mdadm defaults 25 >/dev/null 2>&1
+ else
+ update-rc.d -f mdadm remove >/dev/null 2>&1
+ update-rc.d mdadm stop 20 0 1 6 . >/dev/null 2>&1
+ update-rc.d -f mdadm-raid remove >/dev/null 2>&1
+ update-rc.d mdadm-raid stop 20 0 1 6 . >/dev/null 2>&1
+ fi
+ fi
+
+ if [ -n "$MRAID" ] ; then
+ if is_value_set "dmraid" ; then
+ update-rc.d -f dmraid remove >/dev/null 2>&1
+ update-rc.d dmraid start 04 S . start 51 0 6 . >/dev/null
+ else
+ update-rc.d -f dmraid remove >/dev/null 2>&1
+ update-rc.d dmraid stop 20 0 1 6 . >/dev/null 2>&1
+ fi
+ fi
+
+ if [ -n "$DBUS" ] ; then
+ if is_value_set "dbus" ; then
+ update-rc.d -f dbus remove >/dev/null 2>&1
+ update-rc.d dbus defaults >/dev/null 2>&1
+ else
+ update-rc.d -f dbus remove >/dev/null 2>&1
+ update-rc.d dbus stop 20 0 1 6 . >/dev/null 2>&1
+ fi
+ fi
+
+ if [ -n "$HAL" ] ; then
+ if is_value_set "hal" ; then
+ update-rc.d -f hal remove >/dev/null 2>&1
+ update-rc.d hal start 24 2 3 4 5. stop 16 0 1 6 . >/dev/null 2>&1
+ else
+ update-rc.d -f hal remove >/dev/null 2>&1
+ update-rc.d hal stop 20 0 1 6 . >/dev/null 2>&1
+ fi
+ fi
+
+ if [ -n "$NFS" ] ; then
+ if is_value_set "nfs" ; then
+ update-rc.d -f nfs-common remove >/dev/null 2>&1
+ update-rc.d nfs-common start 20 2 3 4 5 . stop 20 0 1 6 . start 44 S . >/dev/null 2>&1
+ else
+ update-rc.d -f nfs-common remove >/dev/null 2>&1
+ update-rc.d nfs-common stop 20 0 1 6 . >/dev/null 2>&1
+ fi
+ fi
+}
+
+# the interface itself
+oifs="$IFS"
+IFS='!'
+$DIALOG --title "$PN" --checklist "$INFO" 30 65 8 $LVM $SRAID $MRAID $DBUS $HAL $NFS 2>$TMP
+
+retval="$?"
+case $retval in
+ (0) set_values ;;
+ (1) echo "Cancel pressed." ; exit 1 ;;
+ (255) echo "ESC pressed." ; exit 1 ;;
+esac
+
+retval=$?
+case $retval in
+ (0)
+ $DIALOG --title "$PN" --stdout --msgbox "Adjusting system runlevel configuration via $CONFFILE was successful." 0 0
+ esyslog user.notice "$PN" "Writing language settings ($LANGUAGE) to $CONFFILE was successful."
+ ;;
+ *)
+ $DIALOG --title "$PN" --stdout --msgbox "Error writing settings to ${CONFFILE}." 0 0
+ esyslog user.notice "$PN" "Error writing settings to ${CONFFILE}."
+ ;;
+esac
+
+rm -f $TMP
+IFS="$oifs"
+
+## END OF FILE #################################################################
+# vim: ai tw=80 expandtab
--- /dev/null
+#!/bin/zsh
+# Filename: grml-swapon
+# Purpose: activate swap partitions with taking care of suspend signatures
+# 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.
+################################################################################
+
+set -e # exit on any error
+
+. /etc/grml/script-functions
+. /etc/grml/lsb-functions
+. /etc/grml/autoconfig.functions
+
+check4root || exit 1
+check4progs dd blkid swapon || exit 2
+
+checkbootparam "anyswap" && export ANYSWAP='yes' || export ANYSWAP=""
+
+case $1 in
+ --force)
+ ANYSWAP='yes'
+ ;;
+ -h*|--h*)
+ ewarn 'grml-swapon: activate swap partitions defined in /etc/fstab'
+ eindent
+ ewarn 'Usage: grml-swapon [--help|-h] [--force]'
+ ewarn 'Tip: execute grml-rebuildfstab for rebuilding /etc/fstab'
+ eoutdent
+ eend 1
+ ;;
+esac
+
+einfo "Searching for swap partition(s) as requested."
+eindent
+
+[ -n "$ANYSWAP" ] && einfo "Option --force set, forcing usage of swap partitions."
+
+while read p m f relax; do
+ case "$p" in *fd0*|*proc*|*sys*|*\#*) continue;; esac
+ partoptions="users,exec"
+ fnew=""
+ case "$f" in swap)
+ case "$(dd if=$p bs=1 count=6 skip=4086 2>/dev/null)" in
+ S1SUSP|S2SUSP|pmdisk|[zZ]*)
+ if [ -n "$ANYSWAP" ] ; then
+ einfo "Using swap partition ${WHITE}${p}${NORMAL} [bootoption anyswap found]."
+ swapon $p 2>>$DEBUG ; eend $?
+ else
+ ewarn "Suspend signature on ${WHITE}${p}${NORMAL} found, not using as swap. Force usage via option: --force"
+ fi
+ ;;
+ *)
+ if [[ "$p" == LABEL* ]] ; then
+ p=$(blkid -t $p | awk -F: '{print $1}')
+ fi
+ if grep -q $p /proc/swaps ; then
+ ewarn "Not using swap partition ${WHITE}${p}${NORMAL} as it is already in use." ; eend 0
+ else
+ einfo "Using swap partition ${WHITE}${p}${NORMAL}."
+ swapon $p 2>>$DEBUG ; eend $?
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ esac
+ done <<EOT
+$(cat /etc/fstab)
+EOT
+
+eoutdent
--- /dev/null
+#!/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.
+################################################################################
+
+. /etc/grml/lsb-functions
+
+if [ $(id -u) != 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 #################################################################
--- /dev/null
+#!/bin/sh
+# Filename: grml2ram
+# Purpose: copy compressed GRML image to RAM
+# Authors: (c) Michael Schierl <schierlm-public@gmx.de>, (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2.
+################################################################################
+
+set -e
+
+. /etc/grml/lsb-functions
+. /etc/grml/script-functions
+
+check4root || exit 1
+check4progs rsync gawk || exit 2
+
+if ! isgrmlcd ; then
+ eerror "Not running grml in live-cd mode. Nothing to be done, exiting." ; eend 1
+ exit 1
+fi
+
+IMAGE=$(ls /live/image/live/*.squashfs 2>/dev/null | head -1)
+if ! [ -r "$IMAGE" ] ; then
+ if [ -r /cdrom/GRML/GRML ] ; then
+ IMAGE='/cdrom/GRML/GRML'
+ else
+ eerror "Can not access grml squashfs file."
+ eerror "Looks like you did run grml2ram already?" ; eend 1
+ exit 1
+ fi
+fi
+
+GRMLSIZE="$(du $IMAGE | awk '{print $1}')"
+RAM=$(/usr/bin/gawk '/MemFree/{print $2}' /proc/meminfo)
+
+case "$*" in -f|--force)
+ ewarn "Forcing copy process for grml-image (${GRMLSIZE}kB) as requested via force option." ; eend 0
+ ;;
+ *)
+ if test $RAM -lt $GRMLSIZE ; then
+ eerror "Sorry, not enough free RAM (${RAM}kB) available for grml-image (${GRMLSIZE}kB)." ; eend 1
+ exit 1
+ fi
+ ;;
+esac
+
+einfo "Copying $IMAGE to RAM, this might take a while."
+rsync -a --progress $IMAGE /tmp/GRML
+LANGUAGE=C LANG=C LC_ALL=C perl << EOF
+open LOOP, '</dev/loop0' or die $!;
+open DEST, '</tmp/GRML' or die $!;
+ioctl(LOOP, 0x4C06, fileno(DEST)) or die $!
+close LOOP;
+close DEST;
+EOF
+
+# identify cd-rom:
+GRMLDEV=$(awk '{if ($2 ~ /^\/live\/image$/ ) print $1}' /etc/mtab)
+if [ -z "$GRMLDEV" ]; then
+ GRMLDEV=$(awk '{if ($2 ~ /^\/cdrom$/ ) print $1}' /etc/mtab)
+fi
+[ -n "$GRMLDEV" ] || GRMLDEV='/dev/cdrom'
+
+einfo "Unmounting cdrom"
+[ -d /live/image ] && umount /live/image || umount /cdrom
+eend $?
+einfo "Now you can eject your grml-cd (e.g. run 'eject $GRMLDEV')." ; eend 0
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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: 2007-02-24
+#
+# 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
+# - create new accounts
+# - move existing accounts to chroot
+################################################################################
+
+# 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 " System is running Debian Linux"
+ DISTRO=DEBIAN;
+elif [ -f /etc/SuSE-release ];
+ then echo " Supported Distribution found"
+ echo " System is running SuSE Linux"
+ DISTRO=SUSE;
+elif [ -f /etc/fedora-release ];
+ then echo " Supported Distribution found"
+ echo " System is running Fedora Linux"
+ DISTRO=FEDORA;
+elif [ -f /etc/redhat-release ];
+ then echo " Supported Distribution found"
+ echo " System is running Red Hat Linux"
+ DISTRO=REDHAT;
+else echo -e " failed...........\nThis script works best on Debian, Red Hat, Fedora and SuSE Linux!\nLet's try it nevertheless....\nIf some program files cannot be found adjust the respective path in line 98\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"
+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"
+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"
+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"
+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"
+fi
+
+# Check existence of necessary files
+echo "Checking for which... "
+if ( test -f /usr/bin/which ) || ( test -f /bin/which ) || ( test -f /sbin/which ) || ( test -f /usr/sbin/which );
+ then echo " OK";
+ else echo " failed
+
+Please install which-binary!
+"
+exit 1
+fi
+
+echo "Checking for chroot..."
+if [ `which chroot` ];
+ then echo " OK";
+ else echo " failed
+
+chroot not found!
+Please install chroot-package/binary!
+"
+exit 1
+fi
+
+echo "Checking for sudo..."
+if [ `which sudo` ]; then
+ echo " OK";
+else
+ echo " failed
+
+sudo not found!
+Please install sudo-package/binary!
+"
+exit 1
+fi
+
+echo "Checking for dirname..."
+if [ `which dirname` ]; then
+ echo " OK";
+else
+ echo " failed
+
+dirname not found!
+Please install dirname-binary (to be found eg in the package coreutils)!
+"
+exit 1
+fi
+
+echo "Checking for awk..."
+if [ `which awk` ]; then
+ echo " OK
+";
+else
+ echo " failed
+
+awk not found!
+Please install (g)awk-package/binary!
+"
+exit 1
+fi
+
+# get location of sftp-server binary from /etc/ssh/sshd_config
+# check for existence of /etc/ssh/sshd_config and for
+# (uncommented) line with sftp-server filename. If neither exists, just skip
+# this step and continue without sftp-server
+#
+if (test ! -f /etc/ssh/sshd_config >/dev/null 2>&1); then
+ echo "
+File /etc/ssh/sshd_config not found.
+Not checking for path to sftp-server.
+ ";
+else
+ if !(grep -v "^#" /etc/ssh/sshd_config | grep -i sftp-server >/dev/null 2&1); then
+ echo "Obviously no sftp-server is running on this system.
+";
+ else SFTP_SERVER=$(grep -v "^#" /etc/ssh/sshd_config | grep -i sftp-server | awk '{ print $3}')
+ fi
+fi
+
+#if !(grep -v "^#" /etc/ssh/sshd_config | grep -i sftp-server /etc/ssh/sshd_config | awk '{ print $3}' >/dev/null 2&1); then
+APPS="$APPS $SFTP_SERVER"
+
+# 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; }
+if ( id $CHROOT_USERNAME > /dev/null 2>&1 ) ; then {
+echo "
+-----------------------------
+User $CHROOT_USERNAME exists.
+
+Are you sure you want to modify the users home directory and lock him into the
+chroot directory?
+Are you REALLY sure?
+Say only yes if you absolutely know what you are doing!
+(yes/no) -> "
+ read MODIFYUSER
+ if [ "$MODIFYUSER" != "yes" ]; then
+ echo "
+Not entered yes. Exiting...."
+ exit 1
+ fi
+}
+else
+ CREATEUSER="yes"
+fi
+
+# Create $SHELL (shell for jailed accounts)
+if [ -f ${SHELL} ] ; then
+ echo "
+-----------------------------
+The file $SHELL exists.
+Probably it was created by this script.
+
+Are you sure you want to overwrite it?
+(you want to say yes for example if you are running the script for the second
+time when adding more than one account to the jail)
+(yes/no) -> "
+read OVERWRITE
+if [ "$OVERWRITE" != "yes" ]; then
+ echo "
+Not entered yes. Exiting...."
+ exit 1
+fi
+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 usr/lib"
+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/*
+if [ "$CREATEUSER" != "yes" ] ; then echo "
+Not creating new User account
+Modifying User \"$CHROOT_USERNAME\"
+Copying files in $CHROOT_USERNAME's \$HOME to \"$HOMEDIR\"
+"
+usermod -d "$HOMEDIR" -m -s "$SHELL" $CHROOT_USERNAME && chmod 700 "$HOMEDIR"
+fi
+
+if [ "$CREATEUSER" = "yes" ] ; then {
+echo "Adding User \"$CHROOT_USERNAME\" to system"
+useradd -m -d "$HOMEDIR" -s "$SHELL" $CHROOT_USERNAME && chmod 700 "$HOMEDIR"
+
+# Enter password for new account
+if !(passwd $CHROOT_USERNAME);
+ then echo "Passwords are probably not the same, try again."
+ exit 1;
+fi
+echo
+}
+fi
+
+# 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" > ${JAILPATH}/etc/passwd
+fi
+if [ ! -f etc/group ] ; then
+ grep /etc/group -e "^root" > ${JAILPATH}/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" >> ${JAILPATH}/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#" >> ${JAILPATH}/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 >> ${JAILPATH}/etc/group
+
+# write the user's line from /etc/shadow to /home/jail/etc/shadow
+grep -e "^$CHROOT_USERNAME:" /etc/shadow >> ${JAILPATH}/etc/shadow
+chmod 600 ${JAILPATH}/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 ${HOME}/ldlist`; do
+ frst_char="`echo $libs | cut -c1`"
+ if [ "$frst_char" = "/" ]; then
+ echo "$libs" >> ${HOME}/ldlist2
+ fi
+done
+for lib in `cat ${HOME}/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.
+#
+# There might be errors because of files that do not exist but in the end it
+# may work nevertheless (I added new file names at the end without deleting old
+# ones for reasons of backward compatibility).
+# So please test ssh/scp before reporting a bug.
+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/ld-lsb.so.3 /lib/libnss_dns.so.2 /lib/libxcrypt.so.1 ${JAILPATH}/lib/
+ cp /lib/*.* ${JAILPATH}/lib/
+ cp /usr/lib/libcrack.so.2 ${JAILPATH}/usr/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
+
+# Don't give more permissions than necessary
+chown root.root ${JAILPATH}/bin/su
+chmod 700 ${JAILPATH}/bin/su
+
+exit
+
--- /dev/null
+#!/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.
+################################################################################
+
+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="Moechten Sie eine SWAP-Datei 'grml.swp' fuer GRML auf Ihrer bestehenden DOS-Partition $p anlegen? Eine solche SWAP-Datei ermoeglicht es Ihnen, trotz geringem Hauptspeicher Programmpakete wie KDE zu benutzen. Sie koennen diese Datei nach Beendigung Ihrer GRML-Session gefahrlos wieder loeschen."
+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 #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin"
+export PATH
+
+# Get root
+if [ $(id -u) != 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 #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+touch /etc/noeject
+exec $*
+
+## END OF FILE #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+touch /etc/noprompt
+exec $*
+
+## END OF FILE #################################################################
--- /dev/null
+#!/bin/zsh
+# Filename: prepare_ramdisk.sh
+# Purpose: set up a ramdisk of a selected directory
+# 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.
+################################################################################
+
+if [ $(id -u) != 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
+
+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
+ mv $DIRECTORY.tmpfile/ $DIRECTORY
+ echo done
+ else
+ echo "error [while 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 #################################################################
--- /dev/null
+#!/bin/zsh
+# Filename: prepare_tmpfs.sh
+# Purpose: set up a tmpfs of a selected directory
+# 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.
+################################################################################
+
+if [ $(id -u) != 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
+
+DIRECTORY="$1"
+
+prepare_start () {
+ if ! mount | grep -q "tmpfs on ${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 ${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 #################################################################
--- /dev/null
+#!/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/
+################################################################################
+
+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 #################################################################
--- /dev/null
+#!/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.
+################################################################################
+
+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 #################################################################
--- /dev/null
+#!/bin/sh
+# Filename: swspeak-setup
+# Purpose: script for activating software speak(up) features
+# 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 or any later version.
+################################################################################
+# Note: the script is used via swspeak() function in grml's zshrc so
+# the prompt of zsh is set accordingly
+# TODO: support disabling swspeakup again?
+
+if [ -r /etc/grml/script-functions ] ; then
+ . /etc/grml/script-functions
+else
+ echo "Failed to source /etc/grml/script-functions - exiting.">&2
+ exit 1
+fi
+
+if [ -r /etc/grml/lsb-functions ] ; then
+ . /etc/grml/lsb-functions
+else
+ echo "Failed to source /etc/grml/lsb-functions - exiting.">&2
+ exit 1
+fi
+
+if [ "$1" = '-h' ] || [ "$1" = '--help' ] ; then
+ cat << EOF
+swspeak - script for activating software speak features
+
+Usage: swspeak [-a] [-e|-s] [-f] [-h]
+
+Supported options:
+
+ -e use espeakup (default, if available)
+ -s use speechd-up (fallback, if available)
+ -a do not execute aumix for setting mixer levels
+ -f disable flite sound output
+ -h display this help text
+EOF
+ exit 0
+fi
+
+NOAUMIX=''
+[ "$1" = '-a' ] && NOAUMIX=1
+ESPEAK=''
+[ "$1" = '-e' ] && ESPEAK=1
+NOFLITE=''
+[ "$1" = '-f' ] && NOFLITE=1
+SPEECHD=''
+[ "$1" = '-s' ] && SPEECHD=1
+
+check4root || exit 1
+
+# execute flite only if it's present
+flitewrapper() {
+ if [ -x /usr/bin/flite -a -z "$NOFLITE" ] ; then
+ flite -o play -t "$*"
+ fi
+}
+
+# execute aumix
+if [ -x /usr/bin/aumix -a -z "$NOAUMIX" ] ; then
+ einfo "Setting mixer levels to 90"
+ aumix -w 90 -v 90 -p 90 -m 90
+ eend $?
+fi
+
+# check for software synthesizer support
+if ! [ -r /dev/softsynth ] ; then
+ if [ ! -d /proc/speakup/ ] && ! grep -q speakup /proc/modules ; then
+ ewarn "Kernel does not support software speakup - trying to load kernel module:" ; eend 0
+ eindent
+ einfo "Loading speakup_soft"
+ if modprobe speakup_soft ; then
+ eend 0
+ else
+ flitewrapper "Fatal error setting up software speakup"
+ eend 1
+ exit 1
+ fi
+ eoutdent
+ fi
+fi
+
+# the kernel module takes some time until it can be accessed
+sleep 1
+
+# helper functions for espeakup and speechd-up
+espeak() {
+if [ -x /usr/bin/espeakup ] ; then
+ espeakup
+else
+ flitewrapper "espeakup not available, sorry."
+ return 1
+fi
+}
+
+speechd() {
+if [ -x /usr/bin/speechd-up ] ; then
+ /etc/init.d/speech-dispatcher start
+ nice -n -20 speechd-up
+else
+ flitewrapper "speechd-up not available, sorry."
+ return 1
+fi
+}
+
+# finally execute the according program:
+if [ -n "$ESPEAK" ] ; then
+ espeak && exit 0 || exit 1
+fi
+
+if [ -n "$SPEECHD" ] ; then
+ speechd && exit 0 || exit 1
+fi
+
+if grep -q 'swspeak=espeak' /proc/cmdline ; then
+ ( espeak && exit 0 ) || ( speechd && exit 0 ) || exit 1
+elif grep -q 'swspeak=speechd' /proc/cmdline ; then
+ ( speechd && exit 0 ) || ( espeak && exit 0 ) || exit 1
+else
+ ( espeak && exit 0 ) || ( speechd && exit 0 ) || exit 1
+fi
+
+## END OF FILE #################################################################
+# vim: ai tw=100 expandtab foldmethod=marker shiftwidth=3
--- /dev/null
+%!PS-Adobe-3.0
+%%Pages: 1
+%%Title: Alignment testpage for Ghostscript
+%%Creator: Dieter Stueken (<EMAIL: PROTECTED>)
+%%BeginProlog
+% Source: http://www.geocrawler.com/archives/3/378/1997/1/50/2064509/
+
+/rectdraw % <x0> <y0> <x1> <y1> rectdraw -
+ { exch 4 -1 roll exch 2 array astore {0 moveto 0 PH rlineto stroke} forall
+ 2 array astore {0 exch moveto PW 0 rlineto stroke} forall
+ } bind def
+
+/arrow % <ang> <x0> <y0> arrow
+ { gsave translate rotate
+ 0 0 moveto 20 60 lineto -20 60 lineto closepath stroke
+ 0 0 moveto 0 80 lineto stroke
+ grestore
+ } bind def
+
+/triangle { % len ang x y
+ gsave translate dup rotate exch
+ 0 setlinewidth
+ 0 0 moveto
+ dup 0 lineto
+ dup 0.98 mul dup 10 div lineto
+ closepath
+ gsave 0.65 setgray fill grestore stroke
+ 100 10 moveto
+ 100 100 2 index {
+ gsave 0 -12 rmoveto 0 24 rlineto stroke grestore
+ gsave 0 24 rmoveto 10 div 2 index neg rotate
+ cvi =string cvs -6 -4 rmoveto show grestore
+ 100 10 rmoveto
+ } for
+ 0 0 moveto
+ 0 10 2 index {
+ pop
+ gsave 0 -6 rmoveto 0 12 rlineto stroke grestore
+ 10 1 rmoveto
+ } for
+ pop pop
+ grestore
+} bind def
+
+/round {dup 3 1 roll mul cvi exch div} def
+
+/Show { % print value or unfold array
+ dup type /realtype eq {100 round} if
+ dup type /nulltype eq
+ { pop (-NULL-) show}
+ {dup type /arraytype eq
+ { ([ ) show {Show} forall ( ]) show}
+ {=string cvs show ( ) show}
+ ifelse }
+ ifelse
+} bind def
+
+/Pval { % key val, move down 1 line
+ gsave exch
+ gsave Show (:) show grestore
+ 150 0 rmoveto Show
+ grestore
+ 0 -12 rmoveto
+} bind def
+
+/showtext {
+ /S 80 string def
+ { currentfile S readline pop dup (%END) eq { pop exit } if
+ gsave show grestore 0 -12 rmoveto
+ } loop
+} bind def
+
+/.knownget { 2 copy known { get true } { pop pop false } ifelse } bind def
+
+%%EndProlog
+%%BeginSetup
+
+% you may try different settings here, but start with default settings first
+%<<
+% /.HWMargins [8.5 38.0 10.5 12.5]
+% /Margins [-35 -51]
+%>> setpagedevice
+%
+
+%%EndSetup
+%%Page: 1
+
+% printout all values
+
+/Helvetica findfont
+12 scalefont setfont
+120 756 moveto
+
+showtext
+Current settings:
+
+%END
+
+[/OutputDevice
+ /Margins
+ /.HWMargins
+ /.MarginsHWResolution
+ /HWResolution
+ /PageOffset
+ /PageSize
+] { currentpagedevice 1 index
+ .knownget not {(-undefined-)} if Pval
+} forall
+
+showtext
+
+Graphics alignment:
+
+Let the distance in inches from the left edge of the page to the
+vertical line be H, and from the bottom edge to the horizontal line
+be V. You may define the alignment of your page to the paper by
+
+ << /Margins [x y] >> setpagedevice
+with
+%END
+
+gsave
+/res currentpagedevice /.MarginsHWResolution .knownget not {600} if def
+( x = (1 - H) * ) show res 0 get =string cvs show
+(, y = (V - 1) * ) show res 1 get =string cvs show
+grestore 0 -12 rmoveto
+
+showtext
+
+If set correctly the drawn arrows should extend into the
+papers corners (not the clipping corners). After archieving
+that, you may continue with the clipping edges.
+
+The clipping edges may be set by
+
+ << /.HWMargins [ml mb mr mt] >> setpagedevice
+
+where [ml mb mr mt] are the distances of the clipped edges of
+your graphics relative to the papers edges (left bottom right top)
+measured in 1/72 inches. The wedge shaped rules may be used to
+define these values very accurately as its intersections are in
+1/72 inches. Take the value at the cutoff point from the scale to
+the next clockwise edge.
+
+Start setting the margin values to all zero to see the natural hardware
+clipping of your printer. You should then define the margins just as big
+enough to keep the defined margins within your printers real hardware
+clipping. This is archieved if you can see the thin line drawn all around
+your defined margin. In addition the thin drawn arrows are just touching
+the margin and should be totally visible.
+
+When you put this settings into your inititializing file "gs_init.ps"
+you may want to apply this setting to a specific printer device only.
+Here is an example of a printer specific setup:
+
+<<
+ /ljet4 << % make entries for some device
+ /.HWMargins [16.0 13.2 13.0 11.1]
+ /Margins [-132 -92]
+ >>
+ /ljet2p << % and for an other devices, too
+ /.HWMargins [14.4 6.8 14.5 17.5]
+ /Margins [-60 -23]
+ >>
+>> currentpagedevice /OutputDevice get
+.knownget {setpagedevice} if
+%END
+
+% get page size
+currentpagedevice /PageSize get aload pop
+/PH exch def
+/PW exch def
+
+1 setlinewidth
+PW 0 0 0 triangle
+PH 90 PW 0 triangle
+PW 180 PW PH triangle
+PH 270 0 PH triangle
+
+% get clipping values
+clippath pathbbox newpath
+
+% show clipping box
+gsave
+1 setlinewidth % 0.65 setgray
+4 copy rectdraw
+grestore
+
+/CT exch def
+/CR exch def
+/CB exch def
+/CL exch def
+
+% draw the alignment lines
+0 setlinewidth
+72 0 moveto 0 CT rlineto stroke
+0 72 moveto CR 0 rlineto stroke
+
+2 setlinewidth
+1 setlinejoin
+1 setlinecap
+
+0 200 moveto 71 0 rlineto -24 -12 rlineto 0 24 rlineto 24 -12 rlineto stroke
+34 206 moveto (H) show
+
+144 0 moveto 0 71 rlineto -12 -24 rlineto 24 0 rlineto -12 24 rlineto stroke
+150 34 moveto (V) show
+
+
+% draw arrows into to the papers corners
+1 setlinewidth
+45
+90 sub dup 0 0 arrow
+90 sub dup 0 PH arrow
+90 sub dup PW PH arrow
+90 sub dup PW 0 arrow
+pop %45
+
+% draw arrows touching the clipping edges
+0 setlinewidth
+ 0 PW 2 div CB arrow
+180 PW 2 div CT arrow
+-90 CL PH 2 div arrow
+ 90 CR PH 2 div arrow
+
+showpage
+%%EOF
\ No newline at end of file