From cdbec268696c1a0f91ed02d42ec56abbe3ef78e9 Mon Sep 17 00:00:00 2001 From: Sebastian Boehm Date: Tue, 21 Dec 2010 01:49:05 +0100 Subject: [PATCH] Split grml-scripts into grml-scripts and grml-scripts-core Remove all packages from grml-scripts except: - cpu-screen and cpu-screen.sh (used by grml-etc-core) - ip-screen (used by grml-etc-core) - lesspipe.sh (more versatile than Debian's lesspipe(1)) - code2color (used by lesspipe.sh) - grml-screen (nice addition to grml-etc-core) --- compile/Makefile | 16 +- compile/align.c | 101 -- compile/dpkg_not_running.c | 34 - compile/pong.c | 160 --- compile/reread_partition_table.c | 68 -- compile/vmware-detect.c | 143 --- debian/changelog | 6 + debian/control | 12 +- debian/dirs | 4 - debian/docs | 0 debian/overrides | 29 +- debian/rules | 130 +-- doc/Makefile | 24 - doc/grml-chroot.8.txt | 43 - doc/grml-exec-wrapper.1.txt | 32 - doc/swspeak-setup.8.txt | 49 - makefile.postfix | 20 - manpages/alignmargins.8 | 27 - manpages/dirvish-setup.8 | 21 - manpages/get_3ware.1 | 17 - manpages/getsf.1 | 28 - manpages/grml-init-multitail.1 | 20 - manpages/grml-iptstate.8 | 24 - manpages/grml-scripts-core.1 | 35 + manpages/grml-scripts.1 | 206 ---- manpages/grml-setkeyboard.8 | 25 - manpages/grml-setlang.8 | 31 - manpages/grml-setservices.8 | 30 - manpages/grml-swapon.8 | 32 - manpages/grml2ram.8 | 21 - manpages/gsuggest.1 | 25 - manpages/iso-term.1 | 24 - manpages/qma.1 | 59 -- manpages/random-hostname.1 | 20 - manpages/reread_partition_table.8 | 26 - usr_bin/XF86AudioLowerVolume | 26 - usr_bin/XF86AudioMute | 36 - usr_bin/XF86AudioRaiseVolume | 26 - usr_bin/attach-screen | 29 - usr_bin/bincompare.pl | 68 -- usr_bin/caps-ctrl | 78 -- usr_bin/cicqhist | 174 ---- usr_bin/code2html | 27 - usr_bin/cpufreq-detect.sh | 143 --- usr_bin/dir2html | 177 ---- usr_bin/exifinfo | 137 --- usr_bin/fex | 213 ---- usr_bin/find-hidden-word-text | 94 -- usr_bin/find-text | 86 -- usr_bin/findchanged | 17 - usr_bin/findwaste | 96 -- usr_bin/firevim | 11 - usr_bin/get_3ware | 88 -- usr_bin/getsf | 55 - usr_bin/grepc | 46 - usr_bin/grepedit | 134 --- usr_bin/grml-config-user | 45 - usr_bin/grml-exec-wrapper | 88 -- usr_bin/grml-info | 83 -- usr_bin/grml-init | 19 - usr_bin/grml-init-multitail | 20 - usr_bin/grml-init-screen | 23 - usr_bin/grml-lang | 128 --- usr_bin/grml-lock | 102 -- usr_bin/grml-mutt | 428 -------- usr_bin/grml-resolution | 60 -- usr_bin/grml-slrn | 350 ------- usr_bin/grml-start | 13 - usr_bin/gsuggest.pl | 27 - usr_bin/hgrep.sh | 31 - usr_bin/iimage | 2048 ------------------------------------ usr_bin/irclog2html-2.1.pl | 354 ------- usr_bin/iso-term | 26 - usr_bin/logview | 35 - usr_bin/mailhops | 96 -- usr_bin/myip | 26 - usr_bin/notifyd.py | 189 ---- usr_bin/osd_server.py | 1 - usr_bin/qma | 119 --- usr_bin/random-hostname | 406 -------- usr_bin/say | 20 - usr_bin/search | 2084 ------------------------------------- usr_bin/sepdate.pl | 31 - usr_bin/sepdate.rb | 3 - usr_bin/sepdate.sh | 3 - usr_bin/soundtest | 47 - usr_bin/tinyp2p.py | 16 - usr_bin/twebgal | 439 -------- usr_bin/unbleach.pl | 74 -- usr_bin/urlgrep.awk | 163 --- usr_bin/usbtree | 177 ---- usr_bin/wm-ng | 17 - usr_bin/wwwis | 1180 --------------------- usr_bin/xsay | 23 - usr_bin/zsh-login | 101 -- usr_sbin/PrintAnalyzer | 613 ----------- usr_sbin/alignmargins | 274 ----- usr_sbin/apt-check-sigs | 241 ----- usr_sbin/blacklist | 47 - usr_sbin/bt-hid | 117 --- usr_sbin/dirvish-setup | 188 ---- usr_sbin/dpkg-rebuild | 92 -- usr_sbin/grml-chroot | 100 -- usr_sbin/grml-config | 56 - usr_sbin/grml-config-root | 72 -- usr_sbin/grml-hostname | 77 -- usr_sbin/grml-iptstate | 32 - usr_sbin/grml-postfix | 20 - usr_sbin/grml-setkeyboard | 120 --- usr_sbin/grml-setlang | 221 ---- usr_sbin/grml-setservices | 151 --- usr_sbin/grml-swapon | 72 -- usr_sbin/grml-tpm | 113 -- usr_sbin/grml2ram | 69 -- usr_sbin/make_chroot_jail | 474 --------- usr_sbin/mkdosswapfile | 130 --- usr_sbin/ndiswrapper.sh | 98 -- usr_sbin/noeject | 12 - usr_sbin/noprompt | 12 - usr_sbin/prepare_ramdisk.sh | 94 -- usr_sbin/prepare_tmpfs.sh | 81 -- usr_sbin/suspenduser.sh | 59 -- usr_sbin/suspenduser_gui.sh | 24 - usr_sbin/swspeak-setup | 126 --- usr_share/align.ps | 227 ---- 125 files changed, 67 insertions(+), 16343 deletions(-) delete mode 100644 compile/align.c delete mode 100644 compile/dpkg_not_running.c delete mode 100644 compile/pong.c delete mode 100644 compile/reread_partition_table.c delete mode 100644 compile/vmware-detect.c delete mode 100644 debian/docs delete mode 100644 doc/Makefile delete mode 100644 doc/grml-chroot.8.txt delete mode 100644 doc/grml-exec-wrapper.1.txt delete mode 100644 doc/swspeak-setup.8.txt delete mode 100644 makefile.postfix delete mode 100644 manpages/alignmargins.8 delete mode 100644 manpages/dirvish-setup.8 delete mode 100644 manpages/get_3ware.1 delete mode 100644 manpages/getsf.1 delete mode 100644 manpages/grml-init-multitail.1 delete mode 100644 manpages/grml-iptstate.8 create mode 100644 manpages/grml-scripts-core.1 delete mode 100644 manpages/grml-scripts.1 delete mode 100644 manpages/grml-setkeyboard.8 delete mode 100644 manpages/grml-setlang.8 delete mode 100644 manpages/grml-setservices.8 delete mode 100644 manpages/grml-swapon.8 delete mode 100644 manpages/grml2ram.8 delete mode 100644 manpages/gsuggest.1 delete mode 100644 manpages/iso-term.1 delete mode 100644 manpages/qma.1 delete mode 100644 manpages/random-hostname.1 delete mode 100644 manpages/reread_partition_table.8 delete mode 100755 usr_bin/XF86AudioLowerVolume delete mode 100755 usr_bin/XF86AudioMute delete mode 100755 usr_bin/XF86AudioRaiseVolume delete mode 100755 usr_bin/attach-screen delete mode 100755 usr_bin/bincompare.pl delete mode 100755 usr_bin/caps-ctrl delete mode 100755 usr_bin/cicqhist delete mode 100755 usr_bin/code2html delete mode 100755 usr_bin/cpufreq-detect.sh delete mode 100755 usr_bin/dir2html delete mode 100755 usr_bin/exifinfo delete mode 100755 usr_bin/fex delete mode 100755 usr_bin/find-hidden-word-text delete mode 100755 usr_bin/find-text delete mode 100755 usr_bin/findchanged delete mode 100755 usr_bin/findwaste delete mode 100755 usr_bin/firevim delete mode 100755 usr_bin/get_3ware delete mode 100755 usr_bin/getsf delete mode 100755 usr_bin/grepc delete mode 100755 usr_bin/grepedit delete mode 100755 usr_bin/grml-config-user delete mode 100755 usr_bin/grml-exec-wrapper delete mode 100755 usr_bin/grml-info delete mode 100755 usr_bin/grml-init delete mode 100755 usr_bin/grml-init-multitail delete mode 100755 usr_bin/grml-init-screen delete mode 100755 usr_bin/grml-lang delete mode 100755 usr_bin/grml-lock delete mode 100755 usr_bin/grml-mutt delete mode 100755 usr_bin/grml-resolution delete mode 100755 usr_bin/grml-slrn delete mode 100755 usr_bin/grml-start delete mode 100755 usr_bin/gsuggest.pl delete mode 100755 usr_bin/hgrep.sh delete mode 100755 usr_bin/iimage delete mode 100755 usr_bin/irclog2html-2.1.pl delete mode 100755 usr_bin/iso-term delete mode 100755 usr_bin/logview delete mode 100755 usr_bin/mailhops delete mode 100755 usr_bin/myip delete mode 100755 usr_bin/notifyd.py delete mode 120000 usr_bin/osd_server.py delete mode 100755 usr_bin/qma delete mode 100755 usr_bin/random-hostname delete mode 100755 usr_bin/say delete mode 100755 usr_bin/search delete mode 100755 usr_bin/sepdate.pl delete mode 100755 usr_bin/sepdate.rb delete mode 100755 usr_bin/sepdate.sh delete mode 100755 usr_bin/soundtest delete mode 100755 usr_bin/tinyp2p.py delete mode 100755 usr_bin/twebgal delete mode 100755 usr_bin/unbleach.pl delete mode 100755 usr_bin/urlgrep.awk delete mode 100755 usr_bin/usbtree delete mode 100755 usr_bin/wm-ng delete mode 100755 usr_bin/wwwis delete mode 100755 usr_bin/xsay delete mode 100755 usr_bin/zsh-login delete mode 100755 usr_sbin/PrintAnalyzer delete mode 100755 usr_sbin/alignmargins delete mode 100755 usr_sbin/apt-check-sigs delete mode 100755 usr_sbin/blacklist delete mode 100755 usr_sbin/bt-hid delete mode 100755 usr_sbin/dirvish-setup delete mode 100755 usr_sbin/dpkg-rebuild delete mode 100755 usr_sbin/grml-chroot delete mode 100755 usr_sbin/grml-config delete mode 100755 usr_sbin/grml-config-root delete mode 100755 usr_sbin/grml-hostname delete mode 100755 usr_sbin/grml-iptstate delete mode 100755 usr_sbin/grml-postfix delete mode 100755 usr_sbin/grml-setkeyboard delete mode 100755 usr_sbin/grml-setlang delete mode 100755 usr_sbin/grml-setservices delete mode 100755 usr_sbin/grml-swapon delete mode 100755 usr_sbin/grml-tpm delete mode 100755 usr_sbin/grml2ram delete mode 100755 usr_sbin/make_chroot_jail delete mode 100755 usr_sbin/mkdosswapfile delete mode 100755 usr_sbin/ndiswrapper.sh delete mode 100755 usr_sbin/noeject delete mode 100755 usr_sbin/noprompt delete mode 100755 usr_sbin/prepare_ramdisk.sh delete mode 100755 usr_sbin/prepare_tmpfs.sh delete mode 100755 usr_sbin/suspenduser.sh delete mode 100755 usr_sbin/suspenduser_gui.sh delete mode 100755 usr_sbin/swspeak-setup delete mode 100644 usr_share/align.ps diff --git a/compile/Makefile b/compile/Makefile index 2a0c45d..a1a24a6 100644 --- a/compile/Makefile +++ b/compile/Makefile @@ -1,4 +1,4 @@ -PROGS = ip-screen pong vmware-detect align cpu-screen dpkg_not_running reread_partition_table +PROGS = ip-screen cpu-screen #ifndef CFLAGS CFLAGS = -O2 -Wall -s @@ -20,19 +20,5 @@ ip-screen: ip-screen.c 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) diff --git a/compile/align.c b/compile/align.c deleted file mode 100644 index 6ef0fb1..0000000 --- a/compile/align.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * By Patrick Reynolds - * 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 - -typedef struct { char a; } s_char; -typedef struct { short a; } s_short; -typedef struct { int a; } s_int; -typedef struct { long a; } s_long; -typedef struct { long long a; } s_long_long; -typedef struct { float a; } s_float; -typedef struct { double a; } s_double; -typedef struct { int *a; } s_intp; - -int main() { - int i = 0x01020304; - char *ch = (char*)&i; - char c1; char ch0; char c2; - double d1; char ch1; double d2; - float f1; char ch2; float f2; - short s1; char ch3; short s2; - int i1; char ch4; int i2; - long long ll1; char ch5; long long ll2; - int *p1; char ch6; int *p2; - long l1; char ch7; long l2; - s_char sc1; char ch8; s_char sc2; - s_short ss1; char ch9; s_short ss2; - s_int si1; char ch10; s_int si2; - s_long sl1; char ch11; s_long sl2; - s_long_long sll1;char ch12;s_long_long sll2; - s_float sf1; char ch13; s_float sf2; - s_double sd1; char ch14; s_double sd2; - s_intp sp1; char ch15; s_intp sp2; - - if (ch[0] == 0x01) - printf("Big endian (%d %d %d %d)\n", ch[0], ch[1], ch[2], ch[3]); - else if (ch[0] == 0x04) - printf("Little endian (%d %d %d %d)\n", ch[0], ch[1], ch[2], ch[3]); - else - printf("Unknown endian (%d %d %d %d)\n", ch[0], ch[1], ch[2], ch[3]); - - printf("sizes:\n"); - printf(" char: %d\n", sizeof(char)); - printf(" short: %d\n", sizeof(short)); - printf(" int: %d\n", sizeof(int)); - printf(" long: %d\n", sizeof(long)); - printf(" long long: %d\n", sizeof(long long)); - printf(" float: %d\n", sizeof(float)); - printf(" double: %d\n", sizeof(double)); - printf(" int*: %d\n", sizeof(int*)); - printf("alignments:\n"); - printf(" char: %d (%p %p %p)\n", - (char*)&c1 - (char*)&c2 - sizeof(char), &c1, &ch0, &c2); - printf(" short: %d (%p %p %p)\n", - (char*)&s1 - (char*)&s2 - sizeof(short), &s1, &ch3, &s2); - printf(" int: %d (%p %p %p)\n", - (char*)&i1 - (char*)&i2 - sizeof(int), &i1, &ch4, &i2); - printf(" long: %d (%p %p %p)\n", - (char*)&l1 - (char*)&l2 - sizeof(long), &l1, &ch7, &l2); - printf(" long long: %d (%p %p %p)\n", - (char*)&ll1 - (char*)&ll2 - sizeof(long long), &ll1, &ch5, &ll2); - printf(" float: %d (%p %p %p)\n", - (char*)&f1 - (char*)&f2 - sizeof(float), &f1, &ch2, &f2); - printf(" double: %d (%p %p %p)\n", - (char*)&d1 - (char*)&d2 - sizeof(double), &d1, &ch1, &d2); - printf(" int*: %d (%p %p %p)\n", - (char*)&p1 - (char*)&p2 - sizeof(int*), &p1, &ch6, &p2); - printf("structure alignments:\n"); - printf(" char struct: %d (%p %p %p)\n", - (char*)&sc1 - (char*)&sc2 - sizeof(s_char), &sc1, &ch8, &sc2); - printf(" short struct: %d (%p %p %p)\n", - (char*)&ss1 - (char*)&ss2 - sizeof(s_short), &ss1, &ch9, &ss2); - printf(" int struct: %d (%p %p %p)\n", - (char*)&si1 - (char*)&si2 - sizeof(s_int), &si1, &ch10,&si2); - printf(" long struct: %d (%p %p %p)\n", - (char*)&sl1 - (char*)&sl2 - sizeof(s_long), &sl1, &ch11,&sl2); - printf(" llong struct: %d (%p %p %p)\n", - (char*)&sll1 - (char*)&sll2 - sizeof(s_long_long),&sll1,&ch12,&sll2); - printf(" float struct: %d (%p %p %p)\n", - (char*)&sf1 - (char*)&sf2 - sizeof(s_float), &sf1, &ch13,&sf2); - printf("double struct: %d (%p %p %p)\n", - (char*)&sd1 - (char*)&sd2 - sizeof(s_double), &sd1, &ch14,&sd2); - printf(" int* struct: %d (%p %p %p)\n", - (char*)&sp1 - (char*)&sp2 - sizeof(s_intp), &sp1, &ch15,&sp2); - - return 0; -} diff --git a/compile/dpkg_not_running.c b/compile/dpkg_not_running.c deleted file mode 100644 index e6e1da7..0000000 --- a/compile/dpkg_not_running.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Filename: dpkg_not_running -* Purpose: check whether Debian's package management (dpkg) is running -* Authors: grml-team (grml.org), (c) Michael Prokop -* 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 -#include -#include -#include - -int main(int argc, char *argv[]) -{ - struct flock fl = { F_WRLCK, SEEK_SET, 0, 0, 0 }; - int fd; - fl.l_pid = getpid(); - - if ((fd = open("/var/lib/dpkg/lock", O_RDWR)) == -1) { - exit(1); - } - - if (fcntl(fd, F_SETLK, &fl) == -1) { - exit(1); // it is running - } - else { - exit(0); // it is not running - } - - return 0; -} - -/* END OF FILE ****************************************************************/ diff --git a/compile/pong.c b/compile/pong.c deleted file mode 100644 index 0ca49e2..0000000 --- a/compile/pong.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - * By Patrick Reynolds - * Distributed under GPL. - * - * Build instructions - * gcc pong.c -o pong - * - * Usage: - * pong 1.2.3.0 # as root! - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define PONG_DEAD 0 -#define PONG_BROKEN 1 -#define PONG_OKAY 2 - -#undef I_CARE_ABOUT_BAD_RETURN_PACKETS - -int id, sock; -int datalen = 0; -int nhosts = 256; -int vec[256]; -int foo_set = 0; -struct sockaddr_in dest; - -void pong(); -void catch(); -int in_cksum(u_short *addr, int len); -void print(); -void foo(int i) { foo_set = 1; } - -int main(int argc, char **argv) { - id = getpid(); - if ((sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0) { - perror("pong: socket"); - return -1; - } - if (argc != 2) { - fprintf(stderr, "Usage:\n %s aaa.bbb.ccc.0\n\n", argv[0]); - return -1; - } - bzero(&dest, sizeof(dest)); - dest.sin_family = AF_INET; - inet_aton(argv[1], &dest.sin_addr); - pong(); - catch(); - print(); - return 0; -} - -void pong() { - unsigned char buf[sizeof(struct icmphdr)]; - struct icmphdr *p = (struct icmphdr *)buf; - int ret, i; - - fprintf(stderr, "Sending packets"); - - p->type = ICMP_ECHO; - p->code = 0; - p->checksum = 0; - p->un.echo.sequence = 0; - p->un.echo.id = id; - - p->checksum = in_cksum((u_short *)p, datalen + 8); - - dest.sin_addr.s_addr &= 0xffffff; - for (i=1; i<=254; i++) { - fputc('.', stderr); - fflush(stderr); - dest.sin_addr.s_addr &= 0xffffff; - dest.sin_addr.s_addr |= (i<<24); - ret = sendto(sock, (char *)buf, 8 + datalen, 0, - (struct sockaddr *)&dest, sizeof(struct sockaddr_in)); - if (ret != 8 + datalen) { - if (ret < 0) - perror("pong: sendto"); - printf("pong: wrote %d chars, ret=%d\n", 8+datalen, ret); - } - } - fputc('\n', stderr); -} - -void catch() { - int ret; - char incoming[128]; - fprintf(stderr, "Gathering responses"); - bzero(vec, nhosts*sizeof(int)); - alarm(5); - signal(SIGALRM, foo); - signal(SIGINT, foo); - while (!foo_set) { - struct sockaddr_in from; - fd_set rfds; - struct timeval tv = { 1, 0 }; - socklen_t fromlen = sizeof(from); - FD_ZERO(&rfds); - FD_SET(sock, &rfds); - if (select(sock+1, &rfds, NULL, NULL, &tv) <= 0) continue; - ret = recvfrom(sock, (char *)incoming, 128, 0, (struct sockaddr *)&from, - &fromlen); -#ifdef I_CARE_ABOUT_BAD_RETURN_PACKETS - if (ret != datalen + 16 && (ret >= 0 || errno != EINTR)) { - if (ret < 0) - perror("pong: recvfrom"); - else - vec[from.sin_addr.s_addr >> 24] = PONG_BROKEN; - printf("pong: read %d chars, ret=%d, host=%d\n", 16+datalen, ret, - from.sin_addr.s_addr>>24); - } - else -#endif - { - fputc('.', stderr); - fflush(stderr); - vec[from.sin_addr.s_addr >> 24] = PONG_OKAY; - } - } - fputc('\n', stderr); -} - -int in_cksum(u_short *addr, int len) { - register int nleft = len; - register u_short *w = addr; - register int sum = 0; - u_short answer = 0; - - while (nleft > 1) { - sum += *w++; - nleft -= 2; - } - if (nleft == 1) { - *(u_char *)(&answer) = *(u_char *)w ; - sum += answer; - } - sum = (sum >> 16) + (sum & 0xffff); - sum += (sum >> 16); - answer = ~sum; - return(answer); -} - -void print() { - int i, count = 0; - for (i=0; i<=255; i++) - if (vec[i]) { - unsigned int ip = ntohl(dest.sin_addr.s_addr); - count++; - printf("%d.%d.%d.%d: %s\n", ip>>24, (ip>>16)&0xff, (ip>>8)&0xff, i, - vec[i]==PONG_OKAY ? "found" : "broken"); - } - printf("\nTotal hosts: %d\n", count); -} diff --git a/compile/reread_partition_table.c b/compile/reread_partition_table.c deleted file mode 100644 index 90f83a2..0000000 --- a/compile/reread_partition_table.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Filename: reread_partition_table.c - * Purpose: re-read partition table on Linux - * Authors: grml-team (grml.org), (c) Michael Prokop - * 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 -#include -#include -#include -#include -#include -#include -#include - -void usage() -{ - printf("Usage: reread_partition_table \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 ****************************************************************/ diff --git a/compile/vmware-detect.c b/compile/vmware-detect.c deleted file mode 100644 index 8afe2d1..0000000 --- a/compile/vmware-detect.c +++ /dev/null @@ -1,143 +0,0 @@ -/* Filename: vmware-detect.c -* Purpose: Detect if running inside vmware -* Authors: grml-team (grml.org), (c) Michael Gebetsroither -* 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 Mon, 20 Dec 2010 23:49:48 +0100 + grml-scripts (1.4.0) unstable; urgency=low [ Michael Prokop ] diff --git a/debian/control b/debian/control index 62d3151..8b1dc20 100644 --- a/debian/control +++ b/debian/control @@ -1,19 +1,19 @@ -Source: grml-scripts +Source: grml-scripts-core Section: utils Priority: optional Maintainer: Michael Prokop Uploaders: Michael Gebetsroither -Build-Depends: debhelper (>= 5), dietlibc-dev, xsltproc, docbook-xsl, asciidoc +Build-Depends: debhelper (>= 5), dietlibc-dev 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 +Package: grml-scripts-core Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, less, dialog, perl, zsh, dash, links | w3m | links2, screen, grml-network, grml-etc-core, libterm-readkey-perl, lzop, 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 -Conflicts: scanmodem, grml-etc-core (<< 0.1-30) +Depends: ${shlibs:Depends}, ${misc:Depends}, less, dash, perl, screen, grml-etc-core, lockfile-progs +Replaces: grml-scripts (<< 1.4.1) +Breaks: grml-scripts (<< 1.4.1) 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 diff --git a/debian/dirs b/debian/dirs index a2c53cc..e772481 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,5 +1 @@ -etc/grml -etc/postfix usr/bin -usr/sbin -usr/share/grml-scripts diff --git a/debian/docs b/debian/docs deleted file mode 100644 index e69de29..0000000 diff --git a/debian/overrides b/debian/overrides index 1766baa..32f58d5 100644 --- a/debian/overrides +++ b/debian/overrides @@ -1,25 +1,4 @@ -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 +grml-scripts-core: script-with-language-extension usr/bin/cpu-screen.sh +grml-scripts-core: script-with-language-extension usr/bin/lesspipe.sh +grml-scripts-core: statically-linked-binary ./usr/bin/cpu-screen +grml-scripts-core: statically-linked-binary ./usr/bin/ip-screen diff --git a/debian/rules b/debian/rules index f246b54..288acd7 100755 --- a/debian/rules +++ b/debian/rules @@ -19,9 +19,8 @@ clean: rm -f build-stamp # Add here commands to clean up after the build process. - rm -rf $(CURDIR)/debian/grml-scripts/ + rm -rf $(CURDIR)/debian/grml-scripts-core/ ( cd compile ; make clean ) - ( cd doc && make clean ) dh_clean @@ -31,22 +30,13 @@ install: build 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 + # Add here commands to install the package into debian/grml-scripts-core. + cp -a usr_bin/* debian/grml-scripts-core/usr/bin/ + install -m 755 compile/cpu-screen debian/grml-scripts-core/usr/bin/cpu-screen + install -m 755 compile/ip-screen debian/grml-scripts-core/usr/bin/ip-screen # Build architecture-independent files here. -binary-indep: build install - ( cd $(CURDIR)/doc && make doc_man ) +binary-indep: # Build architecture-dependent files here. binary-arch: build install @@ -54,107 +44,17 @@ binary-arch: build install 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_installman manpages/grml-scripts-core.1 + dh_link /usr/share/man/man1/grml-scripts-core.1.gz /usr/share/man/man1/code2color.1.gz \ + /usr/share/man/man1/grml-scripts-core.1.gz /usr/share/man/man1/cpu-screen.1.gz \ + /usr/share/man/man1/grml-scripts-core.1.gz /usr/share/man/man1/cpu-screen.sh.1.gz \ + /usr/share/man/man1/grml-scripts-core.1.gz /usr/share/man/man1/grml-screen.1.gz \ + /usr/share/man/man1/grml-scripts-core.1.gz /usr/share/man/man1/ip-screen.1.gz \ + /usr/share/man/man1/grml-scripts-core.1.gz /usr/share/man/man1/lesspipe.sh.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 + mkdir -p $(CURDIR)/debian/grml-scripts-core/usr/share/lintian/overrides/ + cp -av debian/overrides $(CURDIR)/debian/grml-scripts-core/usr/share/lintian/overrides/grml-scripts-core dh_fixperms dh_installdeb dh_shlibdeps diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index 8bfac8c..0000000 --- a/doc/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -%.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 - diff --git a/doc/grml-chroot.8.txt b/doc/grml-chroot.8.txt deleted file mode 100644 index 2c6ec0d..0000000 --- a/doc/grml-chroot.8.txt +++ /dev/null @@ -1,43 +0,0 @@ -GRML-CHROOT(8) -============== -Michael Gebetsroither - - -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 . diff --git a/doc/grml-exec-wrapper.1.txt b/doc/grml-exec-wrapper.1.txt deleted file mode 100644 index 7af7532..0000000 --- a/doc/grml-exec-wrapper.1.txt +++ /dev/null @@ -1,32 +0,0 @@ -GRML-EXEC-WRAPPER(1) -==================== - -NAME ----- -grml-exec-wrapper - simple but smart program execution wrapper - -SYNOPSIS --------- -*grml-chroot* [-p ] [] - -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 *:: -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 . diff --git a/doc/swspeak-setup.8.txt b/doc/swspeak-setup.8.txt deleted file mode 100644 index 338e6cc..0000000 --- a/doc/swspeak-setup.8.txt +++ /dev/null @@ -1,49 +0,0 @@ -swspeak-setup(8) -================ -Michael Prokop - -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 . diff --git a/makefile.postfix b/makefile.postfix deleted file mode 100644 index 92aad2f..0000000 --- a/makefile.postfix +++ /dev/null @@ -1,20 +0,0 @@ -# Makefile for postfix - -TARGETS = postmap alias reload - -restart: - /etc/init.d/postfix restart - -reload: - /etc/init.d/postfix reload - -postmap: -# postmap recipient_checks -# postmap regexp_table -# postmap sender_canonical - postmap virtual - -alias: - newaliases - -all: Makefile $(TARGETS) diff --git a/manpages/alignmargins.8 b/manpages/alignmargins.8 deleted file mode 100644 index 92515d8..0000000 --- a/manpages/alignmargins.8 +++ /dev/null @@ -1,27 +0,0 @@ -.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 - for the grml project (but may be used by others). diff --git a/manpages/dirvish-setup.8 b/manpages/dirvish-setup.8 deleted file mode 100644 index 4fd3b9d..0000000 --- a/manpages/dirvish-setup.8 +++ /dev/null @@ -1,21 +0,0 @@ -.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 . -.PP -This manual page was written by Michael Prokop - for the grml project (but may be used by others). diff --git a/manpages/get_3ware.1 b/manpages/get_3ware.1 deleted file mode 100644 index 35ca47e..0000000 --- a/manpages/get_3ware.1 +++ /dev/null @@ -1,17 +0,0 @@ -.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 . -.PP -This manual page was written by Michael Prokop - for the grml project (but may be used by others). diff --git a/manpages/getsf.1 b/manpages/getsf.1 deleted file mode 100644 index 7961f91..0000000 --- a/manpages/getsf.1 +++ /dev/null @@ -1,28 +0,0 @@ -.TH getsf 1 -.SH "NAME" -getsf \- download project from sourceforge.net -.SH SYNOPSIS -.B getsf -.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 . -.PP -This manual page was written by Michael Prokop - for the grml project (but may be used by others). diff --git a/manpages/grml-init-multitail.1 b/manpages/grml-init-multitail.1 deleted file mode 100644 index 935c94d..0000000 --- a/manpages/grml-init-multitail.1 +++ /dev/null @@ -1,20 +0,0 @@ -.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 - for the grml project (but may be used by others). diff --git a/manpages/grml-iptstate.8 b/manpages/grml-iptstate.8 deleted file mode 100644 index 013b597..0000000 --- a/manpages/grml-iptstate.8 +++ /dev/null @@ -1,24 +0,0 @@ -.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 . -.PP -This manual page was written by Michael Prokop - for the grml project (but may be used by others). diff --git a/manpages/grml-scripts-core.1 b/manpages/grml-scripts-core.1 new file mode 100644 index 0000000..c7fdc05 --- /dev/null +++ b/manpages/grml-scripts-core.1 @@ -0,0 +1,35 @@ +.\" Filename: grml-scripts.1 +.\" Purpose: man page for grml-scripts +.\" Authors: grml-team (grml.org), (c) Michael Prokop +.\" 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\-core \- core script collection for the grml distribution +.\"####################################################### +.SH "USER SCRIPTS" + +.SS code2color +convert a source code to syntax highlighted HTML +.SS cpu-screen +output current / available cpu frequence (useful for integration into GNU screen) +.SS grml-screen +start screen session and fix console permissions +.SS ip-screen +print ip address of configured network interfaces to stdout. +.SS lesspipe.sh +wrapper for less + +.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-2010 by the grml-team. +.\"###### END OF FILE ########################################################## +.\" vim:tw=60 diff --git a/manpages/grml-scripts.1 b/manpages/grml-scripts.1 deleted file mode 100644 index 42e97c2..0000000 --- a/manpages/grml-scripts.1 +++ /dev/null @@ -1,206 +0,0 @@ -.\" Filename: grml-scripts.1 -.\" Purpose: man page for grml-scripts -.\" Authors: grml-team (grml.org), (c) Michael Prokop -.\" 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 ', 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 ', 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 diff --git a/manpages/grml-setkeyboard.8 b/manpages/grml-setkeyboard.8 deleted file mode 100644 index 9fea2b1..0000000 --- a/manpages/grml-setkeyboard.8 +++ /dev/null @@ -1,25 +0,0 @@ -.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 . -.PP -This manual page was written by Michael Prokop - for the grml project (but may be used by others). diff --git a/manpages/grml-setlang.8 b/manpages/grml-setlang.8 deleted file mode 100644 index ecddc8b..0000000 --- a/manpages/grml-setlang.8 +++ /dev/null @@ -1,31 +0,0 @@ -.TH grml-setlang 8 -.SH "NAME" -grml-setlang \- set language system-wide on grml system -.SH SYNOPSIS -.B grml-setlang -.RI " [ ] " -.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 . -.PP -This manual page was written by Michael Prokop - for the grml project (but may be used by others). diff --git a/manpages/grml-setservices.8 b/manpages/grml-setservices.8 deleted file mode 100644 index 61f41d4..0000000 --- a/manpages/grml-setservices.8 +++ /dev/null @@ -1,30 +0,0 @@ -.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 . -.PP -This manual page was written by Michael Prokop - for the grml project (but may be used by others). diff --git a/manpages/grml-swapon.8 b/manpages/grml-swapon.8 deleted file mode 100644 index bf9a64d..0000000 --- a/manpages/grml-swapon.8 +++ /dev/null @@ -1,32 +0,0 @@ -.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 . -.PP -This manual page was written by Michael Prokop -for the grml project (but may be used by others). diff --git a/manpages/grml2ram.8 b/manpages/grml2ram.8 deleted file mode 100644 index 34310d2..0000000 --- a/manpages/grml2ram.8 +++ /dev/null @@ -1,21 +0,0 @@ -.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 for the grml project. diff --git a/manpages/gsuggest.1 b/manpages/gsuggest.1 deleted file mode 100644 index b0e8679..0000000 --- a/manpages/gsuggest.1 +++ /dev/null @@ -1,25 +0,0 @@ -.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 . -.PP -This manual page was written by Michael Prokop -for the grml project (but may be used by others). diff --git a/manpages/iso-term.1 b/manpages/iso-term.1 deleted file mode 100644 index e807d88..0000000 --- a/manpages/iso-term.1 +++ /dev/null @@ -1,24 +0,0 @@ -.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 . -.PP -This manual page was written by Michael Prokop - for the grml project (but may be used by others). diff --git a/manpages/qma.1 b/manpages/qma.1 deleted file mode 100644 index 48fe117..0000000 --- a/manpages/qma.1 +++ /dev/null @@ -1,59 +0,0 @@ -.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 ' 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 based on an idea of -Matthias Kopfermann . -.PP -This manual page was written by Michael Prokop -for the grml project (but may be used by others). diff --git a/manpages/random-hostname.1 b/manpages/random-hostname.1 deleted file mode 100644 index e5b727b..0000000 --- a/manpages/random-hostname.1 +++ /dev/null @@ -1,20 +0,0 @@ -.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 . -.PP -This manual page was written by Michael Prokop - for the grml project (but may be used by others). diff --git a/manpages/reread_partition_table.8 b/manpages/reread_partition_table.8 deleted file mode 100644 index 8428184..0000000 --- a/manpages/reread_partition_table.8 +++ /dev/null @@ -1,26 +0,0 @@ -.TH reread_partition_table 8 -.SH "NAME" -reread_partition_table \- re-read partition table on Linux -.SH SYNOPSIS -.B reread_partition_table -.RI " " -.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 ' 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 -. -.PP -This manual page was written by Michael Prokop -for the grml project (but may be used by others). diff --git a/usr_bin/XF86AudioLowerVolume b/usr_bin/XF86AudioLowerVolume deleted file mode 100755 index 3ba0972..0000000 --- a/usr_bin/XF86AudioLowerVolume +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# Filename: XF86AudioLowerVolume -# Purpose: lower audio volume -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/XF86AudioMute b/usr_bin/XF86AudioMute deleted file mode 100755 index a68cbef..0000000 --- a/usr_bin/XF86AudioMute +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# Filename: XF86AudioMute -# Purpose: mute and restore audio settings -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/XF86AudioRaiseVolume b/usr_bin/XF86AudioRaiseVolume deleted file mode 100755 index 1eacab6..0000000 --- a/usr_bin/XF86AudioRaiseVolume +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# Filename: XF86AudioRaiseVolume -# Purpose: raise audio volume -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/attach-screen b/usr_bin/attach-screen deleted file mode 100755 index 07e18ff..0000000 --- a/usr_bin/attach-screen +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Filename: attach-screen -# Purpose: multi-attach to GNU screen session, creating a new one if necessary -# Authors: (c) Phil Gregory , (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/bincompare.pl b/usr_bin/bincompare.pl deleted file mode 100755 index 767b8a3..0000000 --- a/usr_bin/bincompare.pl +++ /dev/null @@ -1,68 +0,0 @@ -#!/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 ; - open(IN, $file2) || die "read from $file2: $!\n"; - binmode(IN); - print OUT ; - close(IN); - close(OUT); - my($e) = (entropy($tmp)); - unlink($tmp); - return ($e); -} - -$#ARGV == 1 || die "Usage $0: file1 file2\n"; - -printf("%.3g - Entropy of $ARGV[0]\n", $e0 = entropy($ARGV[0])); -printf("%.3g - Entropy of $ARGV[1]\n", $e1 = entropy($ARGV[1])); -printf("%.3g - Combined predicted entropy\n", ($e0 + $e1) / 2); -printf("%.3g - Combined actual entropy\n", entropy2($ARGV[0], $ARGV[1])); diff --git a/usr_bin/caps-ctrl b/usr_bin/caps-ctrl deleted file mode 100755 index 824ddd1..0000000 --- a/usr_bin/caps-ctrl +++ /dev/null @@ -1,78 +0,0 @@ -#!/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 -# 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 ################################################################# diff --git a/usr_bin/cicqhist b/usr_bin/cicqhist deleted file mode 100755 index 73bf02f..0000000 --- a/usr_bin/cicqhist +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/perl -w - -# Julius Plenz -# 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 '; - print 'http://www.plenz.com/'; - print '(just to learn Perl :-)'; - print ''; - print 'Usage: ' . $0 . ' [-d ] [-h] [-i] [-s] '; - 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 = ; - -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 () { - chomp; - my $line = $_; - - if ($line eq " ") { - $linenumber = 0; - next; - } - - if ($linenumber < 4) { - if ($line =~ /^IN$/) { - $nick = sprintf ('%-13s', $nickname); - } - - if ($line =~ /^OUT$/) { - $nick = sprintf ('%-13s', $mynick); - } - - if (/^[0-9]+$/) { - my $tstamp = $_; - chomp ($tstamp); - - if ($tstamp < 3) { - next; - } - - my ($sec, $min, $hour, $mday, $mon, $year) = - localtime ($tstamp); - - if ($options{"s"}) { - $year += 1900; - $displaytime = sprintf ('%02d%02d%02d %02d:%02d ', - substr ($year, 2, 2), $mon, $mday, $hour, $min); - } else { - $displaytime = - sprintf ('[%02d.%02d.%02d, %02d:%02d:%02d] ', - $mday, $mon, (1900+$year), $hour, $min, $sec); - } - } - - $linenumber++; - if ($linenumber == 4) { - - $\ = ""; - - if ($options{"i"}) { - print $displaytime . substr ($nick, 0, 1) . ': '; - } else { - print $displaytime . $nick . ': '; - } - - $\ = "\n"; - } - - } else { - print $line; - } - -} - -close (HIST); - -if ($options{"i"}) { - print ''; - print ''; - print ' 'x8 . $number .' = '. substr ($nickname, 0, 1) . - ' = ' . $nickname; - print ' 'x8 . substr ($mynick, 0, 1) . ' = ' . $mynick; -} - -print "\n--- End of conversation with $nickname ---"; - -# EOF vim: set et sm nu ft=perl diff --git a/usr_bin/code2html b/usr_bin/code2html deleted file mode 100755 index bf2402e..0000000 --- a/usr_bin/code2html +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/perl -p -# -# code2html - convert code to html for posting to slashdot -# -# tchrist@perl.com -# Sunday, December 19th, 1999 - -BEGIN { print "\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; # don't close too early -s/"/"/g; # only in embedded tags, i guess - -# make lines break where they should -s/^\s*$/

/ || s/$/
/; - -# make sure spaces aren't squishticated so we -# can do indentation and properly align comments -s/ /  /g; - -END { print "
\n" } # ...shall be with us always diff --git a/usr_bin/cpufreq-detect.sh b/usr_bin/cpufreq-detect.sh deleted file mode 100755 index 35d63d4..0000000 --- a/usr_bin/cpufreq-detect.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/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 -# 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 ################################################################# diff --git a/usr_bin/dir2html b/usr_bin/dir2html deleted file mode 100755 index 246a280..0000000 --- a/usr_bin/dir2html +++ /dev/null @@ -1,177 +0,0 @@ -#!/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 < 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 < - - - $my_title - - - - -EOF - - if [ ! $my_style = unset ] ; then - echo " " - fi - - cat < - -

$my_title

- - - - - - - -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 " " - echo " " - echo " " - echo " " - echo " " - echo " " - 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 " " - echo " " - echo " " - echo " " - echo " " - echo " " - fi -done - - cat < -

Created with dir2html.

- - - -EOF -} - -if [ $my_output = "stdout" ] ; then - do_work -else - echo Writing to $my_output - do_work > $my_output -fi - -# eof diff --git a/usr_bin/exifinfo b/usr_bin/exifinfo deleted file mode 100755 index 91a7e90..0000000 --- a/usr_bin/exifinfo +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/sh -########################################################################## -# Title : exifinfo - print EXIF information of an image file -# Author : Heiner Steven -# 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 diff --git a/usr_bin/fex b/usr_bin/fex deleted file mode 100755 index e382501..0000000 --- a/usr_bin/fex +++ /dev/null @@ -1,213 +0,0 @@ -#!/bin/zsh -# Filename: fex -# Purpose: extract archives via smart frontend -# Authors: grml-team ( grml.org), (c) Matthias Kopfermann, (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/find-hidden-word-text b/usr_bin/find-hidden-word-text deleted file mode 100755 index 7612e5e..0000000 --- a/usr_bin/find-hidden-word-text +++ /dev/null @@ -1,94 +0,0 @@ -#!/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 -. - -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 - -=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 ('', ); - close IN or die "cannot run antiword -t $file"; - - open (IN, "strings $file |") or die "cannot run strings"; - my $str = join ('', ); - close IN; - - # normalize the antiword version - $aw =~ s/\s+/ /gs; - - # get each string from strings, and see if we can find it in the "visible" - # text from antiword - my %count = (); - foreach (split (/\n/, $str)) { - s/\s+/ /g; s/^ //gs; s/ $//gs; - next if ($aw =~ /\Q$_\E/); - - # killfile. - # skip almost-entirely non-alpha 4-byte snippets - #next if /^(?:\W\w\W\W|\W\W\w\W|\w\W{3,3}|\W{4,4}|\W{3,3}\w)$/; - - next if (!/ /); # no spaces! - - # skip 4-to-6-byte snippets with 1 nonalpha and no spaces - #next if (/^\S{4,6}$/ && /\W/); - - # common word droppings - next if /^\s*PAGE\s*$/; - #next if /^Word.Document.\d$/; - next if /^Microsoft Word 9.0$/; - next if /^Microsoft Word Document$/; - #next if /^Normal$/; - #next if /^Title$/; - #next if /^MSWordDoc$/; - next if /^Click to edit Master text styles$/; - next if /^Click to edit Master title style$/; - next if /^Embedded OLE Servers$/; - - $count{$_}++; - } - -# output the strings and their counts - foreach (sort keys %count) { - my $cnt = $count{$_}; - print "$cnt|$_\n"; - } -} diff --git a/usr_bin/find-text b/usr_bin/find-text deleted file mode 100755 index 1cdbfba..0000000 --- a/usr_bin/find-text +++ /dev/null @@ -1,86 +0,0 @@ -#!/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() - { - - 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 = ; -chomp $userdir; - -if (! $userdir eq "") -{ - while (! -d $userdir) - { - printf("Wrong Directory name, Please Enter Valid path name:"); - $userdir = ; - chomp $userdir; - } -} -printf("Enter Text To seach: "); -$wordTOfind = ; -chomp $wordTOfind; - -if ($userdir eq "") - { - &ScanDirectory(".") - } -else - { - print $userdir ; - &ScanDirectory($userdir); - - } - diff --git a/usr_bin/findchanged b/usr_bin/findchanged deleted file mode 100755 index 753417e..0000000 --- a/usr_bin/findchanged +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# Filename: findchanged -# Purpose: find changes in (real) files of dir1 ... dir2 -# Authors: grml-team (grml.org), (c) Klaus Knopper, (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/findwaste b/usr_bin/findwaste deleted file mode 100755 index 58ccacc..0000000 --- a/usr_bin/findwaste +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/perl -w - -# This script finds good directories for archiving based on the -# average age of files (access time) in the directory and the -# directory size. - -# Directories whose size (in megabytes) is less than this value will -# not be displayed -my $size_minimum = 5; - -# Directories whose average file age (in days) is less than this value -# will not be displayed -my $average_age_minimum = 30; - -use strict; - -die "Usage: $0 [directory1, directory2, ...]\n" unless @ARGV; - -use File::Find; - -# --------------------------------------------------------------------------- - -# Global so that the callback can see them -my $total_files; -my $total_size; -my $total_age; - -sub compute_age_callback -{ - my $file_location = $File::Find::name; - my $filename = $_; - - # Return if it's the '.' or '..' files; - return if $filename eq '.' || $filename eq '..'; - # Return if it's a directory - return if -d $filename; - # Ignore links - return if -l $filename; - - my @stats = stat $filename or die "Couldn't stat $filename: $!"; - my $access_time = $stats[8]; - my $size = $stats[7]; - - my $current_time = time; - -# print "# $file_location\n# Current: $current_time, Access time: $access_time\n"; - my $age = $current_time - $access_time; - $total_age += $age; - $total_files++; - - $total_size += $size; -} - -sub compute_directory_stats -{ - my $starting_directory = shift; - - $total_age = 0; - $total_size = 0; - $total_files = 0; - - find(\&compute_age_callback, $starting_directory); - - return (0,0) if $total_files == 0; - - return ($total_age / $total_files / 60 / 60 / 24, - $total_size / 1024 / 1024); -} - -# --------------------------------------------------------------------------- - -@ARGV = ('.') unless @ARGV; - -my @directory_stats; - -foreach my $directory (@ARGV) -{ - next unless -d $directory; - - my ($average_age, $size) = compute_directory_stats($directory); - push @directory_stats, [$directory, $average_age, $size]; -} - -@directory_stats = sort { $b->[2] <=> $a->[2] } @directory_stats; - -@directory_stats = grep { $_->[2] > $size_minimum } @directory_stats; -@directory_stats = grep { $_->[1] > $average_age_minimum } @directory_stats; - -foreach my $directory_stat (@directory_stats) -{ - print "$directory_stat->[0]:\n"; - my $size_string = sprintf 'Size: %6.2f megabytes', $directory_stat->[2]; - my $age_string = sprintf 'Average age: %6.2f days', $directory_stat->[1]; - printf ' %-38s%s', $size_string, $age_string; - printf "\n"; -} diff --git a/usr_bin/firevim b/usr_bin/firevim deleted file mode 100755 index 714d400..0000000 --- a/usr_bin/firevim +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Filename: firevim -# Purpose: small wrapper to open any file from firefox with vim -# Authors: grml-team (grml.org), (c) Michael Prokop -# Bug-Reports: see http://grml.org/bugs/ -# License: This file is licensed under the GPL v2. -################################################################################ - -xterm -e "vim $*" - -## END OF FILE ################################################################# diff --git a/usr_bin/get_3ware b/usr_bin/get_3ware deleted file mode 100755 index e60440c..0000000 --- a/usr_bin/get_3ware +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# Filename: get_3ware -# Purpose: get 3ware RAID controller command line interface tool (tw_cli) -# Authors: grml-team (grml.org), (c) Michael Prokop , Wolfram Schlich -# 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 ################################################################# diff --git a/usr_bin/getsf b/usr_bin/getsf deleted file mode 100755 index dbf9a20..0000000 --- a/usr_bin/getsf +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# Filename: getsf -# Purpose: download project from sourceforge.net -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 " 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 " - exit 1 -fi - -[ -n "$MIRROR" ] || MIRROR=mesh # set default mirror if not already set - -case "$PROG" in - *http://*) - PROG=${PROG##*/} - BASENAME=${PROG%%-*} - BASENAME=${BASENAME%%_*} - BASENAME=$(echo $BASENAME| tr 'A-Z' 'a-z') - wget http://$MIRROR.dl.sourceforge.net/sourceforge/$BASENAME/$PROG - ;; - *) - PROG="$1" - BASENAME=${PROG%%-*} - BASENAME=${BASENAME%%_*} - BASENAME=$(echo $BASENAME| tr 'A-Z' 'a-z') - wget http://$MIRROR.dl.sourceforge.net/sourceforge/$BASENAME/$PROG - ;; -esac - -## END OF FILE ################################################################# diff --git a/usr_bin/grepc b/usr_bin/grepc deleted file mode 100755 index 208e858..0000000 --- a/usr_bin/grepc +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/perl -w -# Filename: grepc -# Purpose: grep for pattern and cut it -# Authors: Olaf Klischat -# 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' /environ - -# list destination ports of iptables lol: -# $ uris.txt -# host2:$ \n"; - -$re = eval { qr/$re/ } or die "invalid regexp: $@"; - -while (<>) { - if (/$re/) { - print "$1\n"; - } -} - -## END OF FILE ################################################################# diff --git a/usr_bin/grepedit b/usr_bin/grepedit deleted file mode 100755 index 2d5730b..0000000 --- a/usr_bin/grepedit +++ /dev/null @@ -1,134 +0,0 @@ -#!/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.*?)(?P[-:])(?P\d+)(?P=sep)(?P.*\n)$", line) - if m is None: - print "couldn't parse grep result line %r" % line - continue - filename, lineno, text = (m.group('filename'), int(m.group('lineno')), - m.group('line')) - if (filename,lineno) in parse: - raise ValueError("multiple results found for %s:%s" % - (filename, lineno)) - parse[(filename, lineno)] = text - return parse - -options = {} -passthru_args = [] -for arg in sys.argv[1:]: - if arg == "--sort-text": - options['sort-text'] = True - continue - passthru_args.append(arg) - -tf = tempfile.NamedTemporaryFile(prefix="grepedit_") -tf.close() - -cmd = ("grep --with-filename --line-number --binary-files=without-match %s > %s" % - (" ".join(['"%s"' % s.replace("\\","\\\\").replace('"','\\"') - for s in passthru_args]),tf.name)) -os.system(cmd) - -originals = grep_parse(tf.name) - -if options.get('sort-text', False): - orig = [(v,k) for k,v in originals.items()] - orig.sort() - f = open(tf.name, "w") - for text, (filename,lineno) in orig: - f.write("%s:%s:%s" % (filename, lineno, text)) - f.close() - -os.system("%s %s" % (os.getenv("EDITOR"), tf.name)) - -corrections = grep_parse(tf.name) - -files = Set([filename for filename,lineno in corrections.keys()]) -for orig_filename in files: - (copy_fd, copy_filename) = tempfile.mkstemp( - dir=os.path.dirname(orig_filename), - prefix="_%s_tmp_grepedit" % os.path.basename(orig_filename)) - - any_changes = False - for lineno,line in enumerate(open(orig_filename)): - lineno = lineno + 1 # grep is 1-based - key = orig_filename,lineno - if key in corrections: - if line != originals[key]: - print "%s:%s has changed since the grep command ran- not modifying this line" % key - print repr(line) - print repr(originals[key]) - elif corrections[key] == line: - pass - else: - print "%s:%s substituting new line" % key - line = corrections[key] - any_changes = True - os.write(copy_fd, line) - - os.close(copy_fd) - if any_changes: - os.rename(copy_filename, orig_filename) - else: - print "no changes made in file %s" % orig_filename - os.unlink(copy_filename) - - diff --git a/usr_bin/grml-config-user b/usr_bin/grml-config-user deleted file mode 100755 index 6882a31..0000000 --- a/usr_bin/grml-config-user +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# Filename: grml-config-user -# Purpose: interface for configuring userland software on grml system -# Authors: grml-team (grml.org), (c) Nico Golde , (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/grml-exec-wrapper b/usr_bin/grml-exec-wrapper deleted file mode 100755 index d3ff8ee..0000000 --- a/usr_bin/grml-exec-wrapper +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# Filename: grml-exec-wrapper -# Purpose: simple but smart program execution wrapper -# Authors: grml-team (grml.org), (c) Michael Prokop -# Bug-Reports: see http://grml.org/bugs/ -# License: This file is licensed under the GPL v2 or any later version. -################################################################################ - -usage() { - printf "Usage: $0 [] - -Available options: - - -h | --help display this usage information - -p 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 ################################################################# diff --git a/usr_bin/grml-info b/usr_bin/grml-info deleted file mode 100755 index 1f31776..0000000 --- a/usr_bin/grml-info +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/zsh -# Filename: grml-info -# Purpose: start browser with documentation for Grml (based) system -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/grml-init b/usr_bin/grml-init deleted file mode 100755 index 6370a53..0000000 --- a/usr_bin/grml-init +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/dash -# Filename: grml-init -# Purpose: fix tty permissions and run zsh -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/grml-init-multitail b/usr_bin/grml-init-multitail deleted file mode 100755 index 20494fa..0000000 --- a/usr_bin/grml-init-multitail +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/dash -# Filename: grml-init-multitail -# Purpose: fix tty permissions and run multitail -# Authors: grml-team (grml.org), (c) Michael Prokop , -# (c) Michael Gebetsroither -# 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 ################################################################# diff --git a/usr_bin/grml-init-screen b/usr_bin/grml-init-screen deleted file mode 100755 index 183df63..0000000 --- a/usr_bin/grml-init-screen +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/dash -# Filename: grml-init-screen -# Purpose: fix tty permissions and run screen and zsh afterwards -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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? - [ -x /usr/bin/vt-is-UTF8 ] && /usr/bin/vt-is-UTF8 -q && UTF='-U' - /usr/bin/screen $UTF -c /etc/grml/screenrc ; exec /bin/zsh - -## END OF FILE ################################################################# diff --git a/usr_bin/grml-lang b/usr_bin/grml-lang deleted file mode 100755 index ee8bcd3..0000000 --- a/usr_bin/grml-lang +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/bash -# Filename: grml-lang -# Purpose: load specific keyboard layout settings -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 " - 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 ################################################################# diff --git a/usr_bin/grml-lock b/usr_bin/grml-lock deleted file mode 100755 index e3c775c..0000000 --- a/usr_bin/grml-lock +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -# Filename: grml-lock -# Purpose: lock console -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/grml-mutt b/usr_bin/grml-mutt deleted file mode 100755 index 643e2d0..0000000 --- a/usr_bin/grml-mutt +++ /dev/null @@ -1,428 +0,0 @@ -#!/bin/sh -# Filename: grml-mutt -# Purpose: configuration script for mutt -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 -# 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 "" -# 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 "" - -# 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 ################################################################# diff --git a/usr_bin/grml-resolution b/usr_bin/grml-resolution deleted file mode 100755 index d5a3af0..0000000 --- a/usr_bin/grml-resolution +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# Filename: grml-resolution -# Purpose: change X resolution via a simple menu frontend -# Authors: Florian Keller , (c) Michael Prokop -# 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 # diff --git a/usr_bin/grml-slrn b/usr_bin/grml-slrn deleted file mode 100755 index 763296c..0000000 --- a/usr_bin/grml-slrn +++ /dev/null @@ -1,350 +0,0 @@ -#!/bin/sh -# Filename: grml-slrn -# Purpose: configuration script for slrn -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 -% 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 ################################################################# diff --git a/usr_bin/grml-start b/usr_bin/grml-start deleted file mode 100755 index 588daeb..0000000 --- a/usr_bin/grml-start +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# Filename: grml-start -# Purpose: start browser with information page on grml -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/gsuggest.pl b/usr_bin/gsuggest.pl deleted file mode 100755 index 125fd40..0000000 --- a/usr_bin/gsuggest.pl +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/perl -# Filename: gsuggest.pl -# Purpose: google suggest - ask google for keyword suggestions -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 \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 ################################################################# diff --git a/usr_bin/hgrep.sh b/usr_bin/hgrep.sh deleted file mode 100755 index fefe057..0000000 --- a/usr_bin/hgrep.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/zsh -# Filename: hgrep.sh -# Purpose: highlight grep -# Authors: Oliver Kiddle () -# 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 ################################################################# diff --git a/usr_bin/iimage b/usr_bin/iimage deleted file mode 100755 index e71edeb..0000000 --- a/usr_bin/iimage +++ /dev/null @@ -1,2048 +0,0 @@ -#!/bin/bash -###################################################################### -# -# I_I_M_A_G_E -# -# Copyright (c) 1996-2004, Ronald Schmidt -# 2000-2004, Holm Sieber -# 2004, Daniel Molkentin -# 2004, Sven Guckes -# -# 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="\"Sound-Logo\""; - EXTRA_SMALL_ICON2="\"Sound-Logo\""; - 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 "
"; - 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 ""; - 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\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 -



- - - download iimage: www.ronsc.de - | (c) by Ronald Schmidt -
- - this site is generated at `date` by $USER@$HOSTNAME
- with iimage version $VERSION, template version '$VERSION' -
-
- - - - -EOF' -} - -# -------------------------------------------------------------------- -# HEAD_TEMPLATE -function put_HEAD_TEMPLATE_START() { -echo ' -cat << EOF - - - - - - $TITLE - - - - -
-
 NameGrösseMimetype
\"Verzeichnis\"$rname/ Verzeichnis
\"File$rname$([ -h "$rname" ] || du -h "$rname" | awk '{print $1}') $(file -biL "$rname" | awk '{print $1}' | sed 's/;//g') 

- - - - - - - -
- iimage $VERSION - - $TITLE $THIS_IMAGE - -EOF -' -} - - -# -------------------------------------------------------------------- -# HEAD_TEMPLATE -function put_HEAD_TEMPLATE_END() { -echo ' -cat << EOF -   -
- - - - - - -EOF -' -} - - -# -------------------------------------------------------------------- -# HTML_TEMPLATE -function put_HTML_TEMPLATE() { -echo ' -cat << EOF -`generate_header start` -Slideshow      -Index      -<<< -$POS/$COUNT ->>> -`generate_header end` - -
-
-  $DESCRIPTION  - - - - - - - - - -
-` -if [ "$EXCLUDE_ORGINAL" = "true" ] ; then - echo -e "\"$R_DISPLAY_IMAGE\"" -else - echo -e "\"$R_DISPLAY_IMAGE\"" -fi -` -
- ($THIS_IMAGE_DATE $THIS_IMAGE_GEOMETRY $THIS_IMAGE_BYTE kb ) - -` -if [ "$IIMAGE_SPECIAL" = "true" ] ; then - echo -e "" -fi -` - - more ... - $EXTRA_SMALL_ICON2 -
- - -`. $FOOTER_TEMPLATE` -EOF -' - -} - - -# -------------------------------------------------------------------- -# HTML_SLIDE_TEMPLATE -function put_HTML_SLIDE_TEMPLATE() { -echo ' -cat << EOF -`generate_header start "#888888"` - - - - Slideshow - Stop      - Index      - <<< - $POS/$COUNT - >>> -`generate_header end` - -
-
- - - -
- -  $DESCRIPTION  - - - - - - -
- $R_DISPLAY_IMAGE -
- -
- -`. $FOOTER_TEMPLATE` -EOF -' -} - - - -# -------------------------------------------------------------------- -# HTML_INFO_TEMPLATE -function put_HTML_INFO_TEMPLATE() { -echo ' -cat << EOF -`generate_header start` - Slideshow      - Index      - <<< - $POS/$COUNT - >>> -`generate_header end` - - -
- -
- - - -
- -  $DESCRIPTION  - - - - - - -
- -` -if [ "$EXCLUDE_ORGINAL" = "true" ] ; then - echo -e "\"$R_DISPLAY_IMAGE\"" -else - echo -e "\"$R_DISPLAY_IMAGE\"" -fi -` -
- ($THIS_IMAGE_DATE $THIS_IMAGE_GEOMETRY - $THIS_IMAGE_BYTE kb ) -` -if [ "$IIMAGE_SPECIAL" = "true" ] ; then - echo -e "" -fi -` - - $EXTRA_SMALL_ICON2 -
-
- - `generate_info_table` - close ... - -
- -`. $FOOTER_TEMPLATE` -EOF -' -} - -# -------------------------------------------------------------------- -# INDEX_HEAD_TEMPLATE -function put_INDEX_HEAD_TEMPLATE() { -echo ' -cat << EOF -`generate_header start "" "$DATADIR"` -zurück -`generate_header end` - -

- -

- - - - -
-

$TITLE

- -` -if [ "$IIMAGE_SPECIAL" = "true" ] ; then - echo -e " $FOLDER_DESCRIPTION " -else - echo -e "$FOLDER_DESCRIPTION " -fi -` - - -
- - - - - - -`search_subdirs` -
-Directory icon - - -.. -
- - -
-
- -

- -

- - -EOF -' -} - -# -------------------------------------------------------------------- -# INDEX_ITEM_TEMPLATE -function put_INDEX_ITEM_TEMPLATE() { -echo ' -cat << EOF - - - -EOF -' -} - -# -------------------------------------------------------------------- -# INDEX_ICON_TEMPLATE -function put_INDEX_ICON_TEMPLATE() { -echo ' -cat << EOF - - - -EOF -' -} - -# -------------------------------------------------------------------- -# INDEX_FOOT_TEMPLATE -function put_INDEX_FOOT_TEMPLATE() { -echo ' -cat << EOF -
-
- - $DESCRIPTION - - - - - - - - - - -
- Thumbnail -
- $EXTRA_SMALL_ICON - $THIS_IMAGE_DATE
- $THIS_IMAGE
- ($THIS_IMAGE_GEOMETRY $THIS_IMAGE_BYTE kb) -` -if [ "$IIMAGE_SPECIAL" = "true" ] ; then - echo -e "" -fi -` -
- - -
- -
-$DESCRIPTION - - - - - - - - - - -
- Icon -
- $EXTRA_SMALL_ICON - $THIS_IMAGE_DATE
- $THIS_IMAGE
- ($THIS_IMAGE_BYTE kb) - -` -if [ "$IIMAGE_SPECIAL" = "true" ] ; then - echo -e "" -fi -` - -
- -
- -`. $FOOTER_TEMPLATE` -EOF -' -} - -# -------------------------------------------------------------------- -# INDEX_DIR_TEMPLATE -function put_INDEX_DIR_TEMPLATE() { -echo ' -cat << EOF - - - - Directory icon - - -` -if [ "$IIMAGE_SPECIAL" = "true" ] ; then - echo -e " " -fi -` - - - - $SUB_TITLE -
$SUB_DATE - - -$FOLDER_DESCRIPTION - - -` -if [ "$IIMAGE_SPECIAL" = "true" ] ; then - echo "" -fi -` - - - -EOF -' -} - -# -------------------------------------------------------------------- -# INFO_AWK_TEMPLATE -function put_INFO_AWK_TEMPLATE() { -echo ' -BEGIN{ - print "
" - a=1; -} -(!/---------------/){ - - if (a==1) bgcolor="#eeeeee" - else bgcolor="#cccccc" - - a=1-a; - print "" - print "" - print "" - - print "" -} -END{ - print "
" $1 "" $2 "
" -} -' -} - -# -------------------------------------------------------------------- -# 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 - = image "filename" title - ignore= files and directories to ignore - AUDIODIR= optional dir for wav-files - EXCLUDE_ORGINAL= - DISABLED= -EOF -} - -###################################################################### -###################################################################### -###################################################################### - -# parse arguments #################################################### - -while getopts ":hHvVRUDTfFduas" OPT ; do - - case $OPT in - v|V) # print version - version - exit - ;; - f) - FORCE=true - ;; - a) - echo -e "[autorun]\nshellexecute=index.html\n" >AUTORUN.INF - ;; - F) - FORCE_TN=true - ;; - h) # print syntax help - info - help - exit - ;; - H) # print syntax description file - info - help_description - exit - ;; - R) # run recursively - RECURSIVE=true - ;; - U) # update iimage - echo "update $0 from http://www.ronsc.de/iimage/iimage" - echo OLD `$0 -v` - wget http://www.ronsc.de/iimage/iimage -q --cache=off -O $0 - echo NEW `$0 -v` - exit - ;; - D) # update iimage - echo "update $0 from http://www.ronsc.de/iimage/devel/iimage" - echo OLD `$0 -v` - wget http://www.ronsc.de/iimage/devel/iimage.gz -q --cache=off -O $0.gz - gunzip -f $0.gz - chmod 755 $0 - echo NEW `$0 -v` - exit - ;; - T) - FORCE_TEMPLATES=true - ;; - d) - create_description_template - update_description_names - exit - ;; - u) - update_description_names - exit - ;; - s) - IIMAGE_SPECIAL=true - ;; - ":") # wrong argument - echo -n "ERROR: Missing argument for option \"$OPTARG\". " - echo "Use \"iimage -h\" to get more help." - exit 1 - ;; - "*") # wrong option - echo -n "ERROR: Unknown option \"$OPTARG\". " - echo "Use \"iimage -h\" to get more help." - exit 1 - ;; - esac - -done - -############################################################## - -if [ "$DISABLED" != "" ] ; then - echo "directory disabled -> exit" - exit -fi - -# check for programms ################################################ - -init_iimage - -[ "$RECURSIVE" = "true" ] && iimage_recursive $* - -pwd - -NEED_UPDATE=false -diff --brief $DATADIR/ls-l.new $DATADIR/ls-l.old >/dev/null || NEED_UPDATE=true -[ "$FORCE" = "true" -o \ - "$FORCE_TN" = "true" -o \ - "$FORCE_TEMPLATES" = "true" ] && NEED_UPDATE=true - -if [ "$NEED_UPDATE" = "true" ] ; then - { - prepare_dir; - - prepare_images; - build_html; - - cleanup; - - } 2>>$DATADIR/errors | tee -a $DATADIR/log -fi - -finish_iimage; - -[ -s $DATADIR/errors ] && echo -e "\nWARNING: there were errors. see $DATADIR/errors" - -# vim:ai:expandtab:sw=3:ts=3:tw=200 diff --git a/usr_bin/irclog2html-2.1.pl b/usr_bin/irclog2html-2.1.pl deleted file mode 100755 index a1ca85e..0000000 --- a/usr_bin/irclog2html-2.1.pl +++ /dev/null @@ -1,354 +0,0 @@ -#!/usr/bin/perl - -# irclog2html.pl Version 2.1 - 27th July, 2001 -# Copyright (C) 2000, Jeffrey W. Waugh - -# Author: -# Jeff Waugh - -# Contributors: -# Rick Welykochy -# Alexander Else - -# 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 "$nick"; - print OUTPUT "$text<\/font>\n"; - } elsif ($STYLE eq "simpletable") { - print OUTPUT "$nick"; - print OUTPUT "$text\n"; - } elsif ($STYLE eq "simplett") { - print OUTPUT "<\;$nick>\; $text
\n"; - } else { - print OUTPUT "<\;$nick>\;<\/font> $text<\/font>
\n"; - } -} - -sub output_servermsg { - my ($line) = @_; - - if ($STYLE =~ /table/) { - print OUTPUT "$line\n"; - } else { - print OUTPUT "$line
\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-=[COLOUR] format output colour scheme. attributes - described using irclog2html [--colour] - -Report bugs to Jeff Waugh . -"; - -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{ - - - $inputfile - - - - - -}; - - if ($STYLE =~ /table/) { - print OUTPUT "\n"; - } - - while ($line = ) { - - chomp $line; - - if ($line ne "") { - - # Replace ampersands, pointies, control characters # - $line =~ s/&/&\;/g; - $line =~ s//>\;/g; - $line =~ s/[\x00-\x1f]+//g; - - # Replace possible URLs with links # - $line =~ s/((http|https|ftp|gopher|news):\/\/\S*)/$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/^(\*.*)$/$1<\/font>/; - } - - # Colourise joined/left messages # - elsif ($line =~ /^(\*\*\*|-->) .*joined/) { - $line =~ s/(^(\*\*\*|-->) .*)/$1<\/font>/; - } - elsif ($line =~ /^(\*\*\*|<--) .*left|quit/) { - $line =~ s/(^(\*\*\*|<--) .*)/$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/^((\*\*\*|---) .*)/$1<\/font>/ - } - # server messages - elsif ($line =~ /^(\*\*\*|---) /) { - $line =~ s/^((\*\*\*|---) .*)$/$1<\/font>/; - } - - output_servermsg($line); - } - } - } - - if ($STYLE =~ /table/) { - print OUTPUT "
\n"; - } - - print OUTPUT qq{ -
Generated by irclog2html.pl $VERSION by
Jeff Waugh - - find it at freshmeat.net! -
}; - - close INPUT; - close OUTPUT; - - return 0; -} - -exit main; diff --git a/usr_bin/iso-term b/usr_bin/iso-term deleted file mode 100755 index 0362eb2..0000000 --- a/usr_bin/iso-term +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# Filename: iso-term -# Purpose: wrapper script to run x-terminal-emulator in iso885915 mode -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/logview b/usr_bin/logview deleted file mode 100755 index e41f7bf..0000000 --- a/usr_bin/logview +++ /dev/null @@ -1,35 +0,0 @@ -#!/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 -# 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 () { - print "\n"; - chomp; - print $_; -} - -## END OF FILE ################################################################# diff --git a/usr_bin/mailhops b/usr_bin/mailhops deleted file mode 100755 index dede6ea..0000000 --- a/usr_bin/mailhops +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/perl -w -# Copyright (c) 1999 Marius Gedminas -# Shows the route of an Internet mail message -# Version 0.0.1pre-alpha -# -# Patched by Roland Rosenfeld -# $ Id: mailhops,v 1.3 2000/01/25 20:18:24 roland Exp roland $ - -use strict; -use POSIX qw(mktime); -use Date::Parse; - -my $verbose = 0; - -# Setup -my %Months = ( - Jan => 1, - Feb => 2, - Mar => 3, - Apr => 4, - May => 5, - Jun => 6, - Jul => 7, - Aug => 8, - Sep => 9, - Oct => 10, - Nov => 11, - Dec => 12, - ); - -# Read headers -$/ = ''; -my $head = <>; -$head =~ s/\n\s+/ /g; -my @headers = split("\n", $head); - -# Parse headers -my @hops; -for (@headers) { - next unless /^(>?Received|Date):/; - my $time; - my $host; - my $from; - if (/^Date:\s+(.*)/) { - $host = "Date:"; - $time = $1; - $from = ""; - } else { - $host = "(unknown)"; - $host = $1 if /\sby\s+([a-z0-9\-_+.]+)\s/ && $1 ne "uid"; - $from = "(unknown)"; - $from = $1 if /\sfrom\s+([a-z0-9\-_+.]+(?:\s+[(].+?[)]))\s/; - $time = "(unknown)"; - $time = $1 if /;\s+(.+)$/; - $time =~ s/using.*//; - } - - my $epoch = str2time ($time); - - unshift @hops, { HOST => $host, FROM => $from, TIME => $epoch}; -} - -# Print output -print " Host Date received (local) Lag Total lag\n"; -my $nr = 0; -my ($first, $prev); -for (@hops) { - my $host = $_->{HOST}; - my $from = $_->{FROM}; - my $time = $_->{TIME}; - $first = $prev = $time unless defined $first; - printf "%2d. %-31.31s", ++$nr, $host; - do { print "\n"; next } unless defined $time; - - my $delta = $time - $prev; - my $neg = $delta < 0; $delta = abs($delta); - my $delta_h = int($delta / 3600); - my $delta_m = int(($delta - $delta_h * 3600) / 60); - my $delta_s = ($delta - $delta_h * 3600 - $delta_m * 60); - - my ($sec,$min,$hour,$day,$mon,$year,undef,undef,$dst) = localtime($time); - - printf " %4d-%02d-%02d %02d:%02d:%02d %s%02d:%02d:%02d", - 1900+$year, $mon+1, $day, $hour, $min, $sec, - $neg ? '-' : ' ', $delta_h, $delta_m, $delta_s; - - $delta = $time - $first; - $neg = $delta < 0; $delta = abs($delta); - $delta_h = int($delta / 3600); - $delta_m = int(($delta - $delta_h * 3600) / 60); - $delta_s = ($delta - $delta_h * 3600 - $delta_m * 60); - printf " %s%02d:%02d:%02d\n", - $neg ? '-' : ' ', $delta_h, $delta_m, $delta_s; - print " from $from\n" if $verbose; - $prev = $time; -} diff --git a/usr_bin/myip b/usr_bin/myip deleted file mode 100755 index 1fbe731..0000000 --- a/usr_bin/myip +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/zsh -# Filename: myip -# Purpose: return IP address of running system on stdout (requires network access) -# Authors: grml-team (grml.org), (c) Alexander Wirt -# 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" == " " ]] ; 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 ################################################################# diff --git a/usr_bin/notifyd.py b/usr_bin/notifyd.py deleted file mode 100755 index cf94ee6..0000000 --- a/usr_bin/notifyd.py +++ /dev/null @@ -1,189 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright (C) 2005-2009 Alexander Bernauer -# Copyright (C) 2005-2009 Rico Schiekel -# Copyright (C) 2005-2009 Ulrich Dangel -# -# 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 diff --git a/usr_bin/osd_server.py b/usr_bin/osd_server.py deleted file mode 120000 index ed6a80c..0000000 --- a/usr_bin/osd_server.py +++ /dev/null @@ -1 +0,0 @@ -notifyd.py \ No newline at end of file diff --git a/usr_bin/qma b/usr_bin/qma deleted file mode 100755 index 5464823..0000000 --- a/usr_bin/qma +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/zsh -# Filename: qma -# Purpose: "quick manual access" -# Authors: grml-team (grml.org), (c) Michael Prokop , Matthias Kopfermann -# 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 to dehighlight" - "shut up hlsearch when it confuses more than it helps and" - nn :nohlsearch|redraw - "q should really end our document-reading like less does" - nn q :qa! - "different than q in that it quits only the current window when multiple windows " - nn Q :q! - "honor midnight-commander addicts :) " - nn :qa! - "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 - nn - "nn f - nn p }zz - "scroll the page down one line" - nn j - "scroll the page up one line" - nn k - "the expectation of getting the next search via 'n' can not be ignored" - nn -n :set invnumber - nn h :set invhlsearch - "Make toggling case-sensitive accessable via the letter i" - nn i :set invignorecase - "Make toggling case-sensitive accessable via the less convention via -i" - nn -i :set invignorecase - nn - nn - nn gg - nn S :split - nn V :vsplit - 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 ################################################################# diff --git a/usr_bin/random-hostname b/usr_bin/random-hostname deleted file mode 100755 index b523523..0000000 --- a/usr_bin/random-hostname +++ /dev/null @@ -1,406 +0,0 @@ -#!/bin/sh -# Filename: random-hostname -# Purpose: print random hostname to stdout -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 -' diff --git a/usr_bin/say b/usr_bin/say deleted file mode 100755 index 0f3bf16..0000000 --- a/usr_bin/say +++ /dev/null @@ -1,20 +0,0 @@ -#!/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 -# Bug-Reports: see http://grml.org/bugs/ -# License: This file is licensed under the GPL v2. -################################################################################ - -if [ $# -eq 0 ] ; then - echo "Usage: $0 " - exit 1 -fi - -if [ -x /usr/bin/flite ] ; then - flite -o play -t "$*" -elif [ -x /usr/bin/festival ] ; then - echo $* | festival --tts -fi - -## END OF FILE ################################################################# diff --git a/usr_bin/search b/usr_bin/search deleted file mode 100755 index dac3445..0000000 --- a/usr_bin/search +++ /dev/null @@ -1,2084 +0,0 @@ -#!/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 ) -## 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 < # 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 (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 < $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 = ; - 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; $ = 0; } ## turn off warnings for when we run EXPR's - - unless (open(RC, "$file")) { - $use_default=1; - $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) : )) { - $ln = ++$line_num; ## note starting line num. - $_ .= , $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() { - 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 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 - } - - 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 () { - 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 | xargs egrep -.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 "" would be done only when -"-xfoo" had been specified, while a line beginning with "" 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 - -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 - - 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 - option: -dir ~/ -Effectively make the default directory your home directory (instead of the -current directory). Using -dir or -xhere will undo this. -.TP - 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 - - option: -name .tex - 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 - option: -nnice -sort -i -vvv -Combine a few user-friendly options into one '-xfluff' option. -.TP - 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 - - option: -xflag1 -xflag2 - option: ...whatever... - option: ...whatever... - -.fi -will allow '-xboth' to be the same as '-xflag1 -xflag2' (or '-xflag1,flag2' -for that matter). However, if you put the "" 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 "!\en__.SYMDEF" -.fi - -.SH "RETURN VALUE" -.I Search -returns zero if lines (or files, if appropriate) were found, -or if no work was requested (such as with -.BR -help ). -Returns 1 if no lines (or files) were found. -Returns 2 on error. - -.SH TODO -Things I'd like to add some day: -.nf - + show surrounding lines (context). - + highlight matched portions of lines. - + add '-and', which can go between regexes to override - the default logical or of the regexes. - + add something like - -below GLOB - which will examine a tree and only consider files that - lie in a directory deeper than one named by the pattern. - + add 'warning' and 'error' directives. - + add 'help' directive. -.fi -.SH BUGS -If -xdev and multiple -dir arguments are given, any file in any of the -target filesystems are allowed. It would be better to allow each filesystem -for each separate tree. - -Multiple -dir args might also cause some confusing effects. Doing -.nf - -dir some/dir -dir other -.fi -will search "some/dir" completely, then search "other" completely. This -is good. However, something like -.nf - -dir some/dir -dir some/dir/more/specific -.fi -will search "some/dir" completely *except for* "some/dir/more/specific", -after which it will return and be searched. Not really a bug, but just sort -of odd. - -File times (for -newer, etc.) of symbolic links are for the file, not the -link. This could cause some misunderstandings. - -Probably more. Please let me know. -.SH AUTHOR -Jeffrey Friedl, Omron Corp (jfriedl@omron.co.jp) -.br -http://www.wg.omron.co.jp/cgi-bin/j-e/jfriedl.html - -.SH "LATEST SOURCE" -See http://www.wg.omron.co.jp/~jfriedl/perl/index.html diff --git a/usr_bin/sepdate.pl b/usr_bin/sepdate.pl deleted file mode 100755 index 7b853a5..0000000 --- a/usr_bin/sepdate.pl +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/perl -# sepdate utility -# usage: sepdate [month date year] -# where day month year are date of interest -- default is today - -# Adapted and updated from a version attributed to Rich Holmes - -use Time::Local; -use POSIX qw(strftime); - -if ($#ARGV == 2) { - $todmon = $ARGV[0]-1; - $todday = $ARGV[1]; - $todyr = $ARGV[2]; - $todti = timelocal(0, 0, 0, $todday, $todmon, $todyr); -} elsif ($#ARGV == -1) { $todti = time; -} else { die; -} - -$septime = timelocal(0, 0, 0, 31, 7, 93); - -$tdiff = $todti - $septime; -$days = int ($tdiff / (60 * 60 * 24)); - -($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); - -# this seems like overkill -$tzstr = strftime("%Z", $sec, $min, $hour, $mday, $mon, $year); -printf ("%3s Sep %2d %2.2d:%2.2d:%2.2d %3s 1993\n", - (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday], - $days,$hour,$min,$sec,$tzstr); diff --git a/usr_bin/sepdate.rb b/usr_bin/sepdate.rb deleted file mode 100755 index 54da23b..0000000 --- a/usr_bin/sepdate.rb +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require 'date' -print Time.now.strftime("%a Sep #{Date.today-Date.new(1993,8,31)} %H:%M:%S %Z 1993\n") diff --git a/usr_bin/sepdate.sh b/usr_bin/sepdate.sh deleted file mode 100755 index c936163..0000000 --- a/usr_bin/sepdate.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -# echo "Endless September" -echo $(((`date +%s` - 746748000) / 86400)). September 1993 diff --git a/usr_bin/soundtest b/usr_bin/soundtest deleted file mode 100755 index 101daa4..0000000 --- a/usr_bin/soundtest +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# Filename: soundtest -# Purpose: test sound on your grml system -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/tinyp2p.py b/usr_bin/tinyp2p.py deleted file mode 100755 index 17449d7..0000000 --- a/usr_bin/tinyp2p.py +++ /dev/null @@ -1,16 +0,0 @@ -# tinyp2p.py 1.0 (documentation at http://freedom-to-tinker.com/tinyp2p.html) -import sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac # (C) 2004, E.W. Felten -ar,pw,res = (sys.argv,lambda u:hmac.new(sys.argv[1],u).hexdigest(),re.search) -pxy,xs = (xmlrpclib.ServerProxy,SimpleXMLRPCServer.SimpleXMLRPCServer) -def ls(p=""):return filter(lambda n:(p=="")or res(p,n),os.listdir(os.getcwd())) -if ar[2]!="client": # license: http://creativecommons.org/licenses/by-nc-sa/2.0 - myU,prs,srv = ("http://"+ar[3]+":"+ar[4], ar[5:],lambda x:x.serve_forever()) - def pr(x=[]): return ([(y in prs) or prs.append(y) for y in x] or 1) and prs - def c(n): return ((lambda f: (f.read(), f.close()))(file(n)))[0] - f=lambda p,n,a:(p==pw(myU))and(((n==0)and pr(a))or((n==1)and [ls(a)])or c(a)) - def aug(u): return ((u==myU) and pr()) or pr(pxy(u).f(pw(u),0,pr([myU]))) - pr() and [aug(s) for s in aug(pr()[0])] - (lambda sv:sv.register_function(f,"f") or srv(sv))(xs((ar[3],int(ar[4])))) -for url in pxy(ar[3]).f(pw(ar[3]),0,[]): - for fn in filter(lambda n:not n in ls(), (pxy(url).f(pw(url),1,ar[4]))[0]): - (lambda fi:fi.write(pxy(url).f(pw(url),2,fn)) or fi.close())(file(fn,"wc")) \ No newline at end of file diff --git a/usr_bin/twebgal b/usr_bin/twebgal deleted file mode 100755 index b922b3e..0000000 --- a/usr_bin/twebgal +++ /dev/null @@ -1,439 +0,0 @@ -#!/bin/bash -# Filename: twebgal -# Purpose: create a tiny webgallery using CSS-features -# Authors: Wolfgang Scheicher -# 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 "
-${FILE}     -Index    <<< ${CURRENT}/${IMAGE_COUNT} >>> -
- -
-
-\"${DISPLAY_GEOMETRY}/${FILE}\" -

-" >> $THIS_HTML - -identify -format " - - - - - -
Auflösung:%wx%h
Dateigröße:%b
Camera:%[EXIF:Model]
Datum/Zeit:%[EXIF:DateTime]
Kommentar:%c
" ${FILE} >> $THIS_HTML - -echo "
" >> $THIS_HTML -html_foot >> $THIS_HTML - -echo "\"Thumbnail\"
$FILE
" >> 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 "
" >> index.html - echo "

${TITLE}

" >> index.html - echo " -${COMMENT} -
-
-" >> index.html -} - -finish_index () { -echo " -
-
-
-" >> 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 " - -${TITLE} - - - -" -} - -html_foot () { -echo " - -" -} - - -############################################################## - -build_gallery() { -# generates the whole thing, puts everything together -# - ALL_IMAGES=( $(find_all_images) ) - IMAGE_COUNT=${#ALL_IMAGES[@]} - start_index - ( - STYLESHEET="$(parent_dir ${STYLESHEET})" - echo "-> ${TITLE}" - CURRENT="0" - FILE="../index" - for file in "${ALL_IMAGES[@]}" "../index" ; do - NEXT="$file" - if [[ "$FILE" != "../index" ]]; then - echo -ne "$FILE\t" - build_thumbnail - build_html - echo "" - fi - CURRENT="$(( ${CURRENT} + 1 ))" - LAST="$FILE" - FILE="$file" - done - if [[ ! -z "${THUMB}" ]] ; then - echo -ne "preview thumbnail from ${THUMB}\t" - THUMBNAILS=("$PREVIEW_GEOMETRY") - FILE="${THUMB}" - [ -e "${DATADIR}/thumb.${THUMB##*.}" ] && mv "${DATADIR}/thumb.${THUMB##*.}" "${DATADIR}/${PREVIEW_GEOMETRY}/${THUMB}" - build_thumbnail && - mv "${DATADIR}/${PREVIEW_GEOMETRY}/${THUMB}" "${DATADIR}/thumb.${THUMB##*.}" - echo - fi - ) | tee -a $LOG >> $VERBOSE - finish_index - echo " $IMAGE_COUNT Image(s) in ${TITLE}" -} - -############################################################## - -init_gallery - -while getopts "vdsrp-:" OPT ; do - case $OPT in - v) VERBOSE=/dev/stdout - ;; - d) create_sample_config - exit 0 - ;; - s) create_sample_stylesheet - exit 0 - ;; - r) RECURSIVE="true" - ;; - p) prune - exit 0 - ;; - ?) # wrong argument - echo -n "ERROR: Missing argument for option \"$OPTARG\". " - exit 1 - ;; - *) # wrong option - echo -n "ERROR: Unknown option \"$OPTARG\". " - exit 1 - ;; - esac -done -shift $(($OPTIND -1)) - -build_gallery 2>${DATADIR}/errors -if [ -s ${DATADIR}/errors ]; then - echo -e "\nWARNING: there were errors. see .tmp/errors" -else - rm .tmp/errors -fi - -## END OF FILE ################################################################# diff --git a/usr_bin/unbleach.pl b/usr_bin/unbleach.pl deleted file mode 100755 index 7bde9f2..0000000 --- a/usr_bin/unbleach.pl +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/perl -# Filename: unbleach.pl -# Purpose: for really dirty perl programs -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 $/; $_=; -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 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 - -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 - -unbleach.pl could not open the source file to modify it. - -=head1 SEE ALSO - -http://www.cpan.org/authors/id/DCONWAY/Acme-Bleach-1.12.tar.gz -http://www.perlmonks.com - -=head1 AUTHOR - -not Damian Conway (as if you couldn't guess) - -=head1 COPYRIGHT - -Copyright (c) 2001, tachyon. All Rights Reserved. -This script is free software. It may be used, redistributed -and/or modified under the terms of the Perl Artistic License -(see http://www.perl.com/perl/misc/Artistic.html) diff --git a/usr_bin/urlgrep.awk b/usr_bin/urlgrep.awk deleted file mode 100755 index 32e3188..0000000 --- a/usr_bin/urlgrep.awk +++ /dev/null @@ -1,163 +0,0 @@ -#!/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 - localhack - -# 24.12.2004, 26.12.2004, 02.01.2005, 26.01.2005(rstp support) -# 28.01.2005(grep like syntax and ! ) -# 09.02.2005(fixed args, others, renamed from httpgrep to urlgrep) -# 12.02.2005(mms support), 28.02.2005(robustness update) -# 07.03.2005(conf enhansements) -# 24.03.2005(regex/gsub enh's, more cmd examples) -# 01.05.2005(-- stop arg) -# */ - -# $ cp urlgrep.awk /usr/local/bin/urlgrep - -# $ urlgrep regex ! regex files -# $ urlgrep '' file -# $ urlgrep . file -# $ curl -s www.blah.ch | urlgrep -# $ wget -qO- www.microsoft.com | urlgrep [| xargs curl -sD-] -# $ curl -s www.apple.com | urlgrep ! 200[25] +[^m]/$ - -# $ curl -s http://e2e.serveftp.net/wee/ | urlgrep wmv$ | xargs -n1 mplayer -# $ - -## MMMM! example site aightgenossen.ch, play media files with max 3 mplayers@1p -# $ wget xmb.ath.cx/threads.sh -# $ . threads.sh ; threads_max=3 -# $ getwhile() { [[ ! $1 ]] && echo $last && return 1; last=$( curl -s $@ | -# > urlgrep ) match=$( grep -E '(wm[av]|rm|mov|avi)$|^rtsp' ) && getwhile } -# # v2 signal todo -# curl -s aightgenossen.ch/index.php/m=multimedia -# .. unfinished - -BEGIN { - if (! dup && dup != "0") dup = 1 # filter duplicates, by default on - if (! dup_domain && dup_domain != "0") dup_domain = 0 # filter duplicates - # ^ by domain but show whole url matching first - if (! show_dom_only && show_dom_only != "0") show_dom_only = 0 # show only - # ^ the domain/host of the url - - # map env variables, accessable with URLGREP_ prefix - # eg, NODUP is the env variable URLGREP_NODUP - narg = split("\ - NODUP dup 0 \ - GREP grep . \ - NOGREP nogrep . \ - URL url . \ - DEBUG DEBUG .\ - DUP_DOMAIN dup_domain . \ - DOMAIN_ONLY domain_only .\ - ", Args) - - for (arg = 1; arg <= narg; arg++) - if (ENVIRON[ Args[i] ]) { - if (Args[i+2] == ".") CONF[ Args[i+1] ] = ENVIRON[ Args[i] ] - else CONF[ Args[i+1] ] = Args[i+2] - - i += 2 - } - - # argument parsing, this uses quite some CPU, gah, fixed - while (ARGV[++i]) { - #if (i == 1 || ARGV[i] ~ /^\+/) grep = get_arg(i) - #if (ARGV[i] ~ /^!/) nogrep = get_arg(i) - - if (ARGV[i] ~ /^!/) CONF["nogrep"] = get_arg(i) - else CONF["grep"] = get_arg(i) - - if (skip) { skip = 0; delete ARGV[i]; delete ARGV[++i] } - else delete ARGV[i] - - if (ARGV[i + 1] !~ /^[+!-]/) break # stop after having enough regexes - } - - if (CONF["grep"]) grep = CONF["grep"] - if (CONF["nogrep"]) nogrep = CONF["grep"] - if (CONF["url"]) url = CONF["url"] - if (CONF["DEBUG"]) DEBUG = CONF["DEBUG"] - - #if (ENVIRON["URLGREP_NODUP"]) dup = 0 - #if (ENVIRON["URLGREP_GREP"]) grep = ENVIRON["URLGREP_GREP"] - #if (ENVIRON["URLGREP_NOGREP"]) nogrep = ENVIRON["URLGREP_NOGREP"] - #if (ENVIRON["URLGREP_URL"]) url = ENVIRON["URLGREP_URL"] - #if (ENVIRON["URLGREP_DEBUG"]) DEBUG = ENVIRON["URLGREP_DEBUG"] - #if (ENVIRON["URLGREP_QUOT"]) quote = ENVIRON["URLGREP_QUOT"] - #if (ENVIRON["URLGREP_DUP_DOMAIN]) dup_domain = ENVIRON["URLGREP_DUP_DOMAIN"] - - err = "/dev/stderr" - r_h = "(https?|ftp|rtsp|mms)://" # head(er) - #r_h = "[a-zA-Z]+://" - #r_m = r_h " ?['\"]?[^ \t'\"<>]+" - r_m = r_h " *['\"]?[^ \t'\"<>]+\\.[^ \t'\"<>]+" # match - - if (DEBUG) printf "url = %s, match '%s', dont match '%s'\n", - (url) ? url : "none", grep, nogrep >err -} - -#DEBUG > 2 # small slowdown - -$0 ~ r_h { - if (DEBUG > 1) print "LINE:", $0 - #while ($0 ~ r_h "[^\"'\t<][ \t]*[^ \t]+\\.") { # original way uses r_h - while ($0 ~ r_m) { - s = substr($0, match($0, r_m), RLENGTH) - total++ - if (dup && ! Seen[s]++) - _p(s) - else if (! dup) - _p(s) - else - found_dup++ - sub(r_m, "") - } -} - -END { - fflush() - if (! count) exit 3 - printf "urlgrep: %d total", total >err - if (found_dup) - printf ", %d printed, %d duplicates", count, found_dup >err - if (found_dup + count < total) - printf ", %d not matched", total - (found_dup + count) >err - printf "\n" >err - fflush() -} - -# get either current or next arg -function get_arg(p ,tmp) { - if (ARGV[p] ~ /^[+!-]/) { - if (length(ARGV[p]) > 1) { - tmp = substr(ARGV[p], 2) - sub(/^ */, "", tmp) - return tmp - } else { - skip = 1 - return ARGV[p + 1] - } - } else - return ARGV[p] -} - -# main match/nomatch check & print function -function _p(s) { - if ((grep && s !~ grep) || nogrep && s ~ nogrep) return 1 - - gsub(/[ \t'"]*/, "", s) # :;, are newly added # ;, - if (quote) print "'" s "'" # small slowdown - else - print s - count++ -} diff --git a/usr_bin/usbtree b/usr_bin/usbtree deleted file mode 100755 index c29eb00..0000000 --- a/usr_bin/usbtree +++ /dev/null @@ -1,177 +0,0 @@ -#!/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 = ) # read a text line from DEVNUM -{ - # skip all lines except those we recognize: - if (($line !~ "^C:") # Configuration: one is active - && ($line !~ "^D:") # Device: - && ($line !~ "^I:") # Interface: protocol group - && ($line !~ "^S:") # String: used with root hub - && ($line !~ "^T:") # Topology: starts each device - ) - { - next; # to the next line - } - - chomp $line; # remove line endings - - # First convert '=' signs to spaces. - $line =~ tr/=/ /; - - # and convert all '(' and ')' to spaces. - $line =~ tr/(/ /; - $line =~ tr/)/ /; - - # split the line at spaces. - @fields = split / +/, $line; - - # T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 - if ($line =~ "^T:") - { - # split yields: $bus, $level, $parent, $port, $count, $devnum, $speed, $maxchild. - - $bus = @fields [2]; - $level = @fields [4]; - $parent = @fields [6]; # parent devnum - $port = @fields [8] + 1; # make $port 1-based - $count = @fields [10]; - $devnum = @fields [12]; - $speed = @fields [14]; - $maxchild = @fields [16]; - $devclass = "?"; - $intclass = "?"; - $driver = "?"; - $ifnum = "?"; - $showclass = "?"; # derived from $devclass or $intclass - $lastif = "?"; # show only first altsetting - $HCtype = "?"; - $showconfig = "no"; - $nconfig = "0"; - next; - } # end T: line - - # only show the _active_ configuration - # C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA - elsif ( $line =~ "^C:" ) { - if ( $line =~ "^C:\\*" ) { - $showconfig = @fields[4]; - } else { - $showconfig = "no"; - } - next; - } - - # D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 - elsif ($line =~ "^D:") - { # for D: line - $devclass = @fields [5]; - $nconfig = @fields [13]; - next; - } - - # in case this is a root hub, look at the device strings. - # - S: Manufacturer:Linux 2.6.5 ehci_hcd [all 2.6] - # - S: Product=USB UHCI Root Hub [all 2.4, 2.2] - # - S: Product=OPTi Inc 82C861 [2.6/PCI_NAMES] - elsif ( $line =~ "^S:" ) - { # for S: line - if ( $level == 00 && $line =~ "hcd" ) - { - $HCtype = @fields [4]; - } - elsif ( $level == 00 && $line =~ "HCI" && $HCtype eq "?") - { - $HCtype = @fields [3]; - } - next; - } - - # the rest of this code: - # - only shows interface descriptors - # - for the active configuration - # - for the first (prefer: active!) altsetting - elsif ( ! ( $line =~ "^I:" ) - || "$showconfig" eq "no") { - next; - } - - - # I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=hid - $intclass = @fields [9]; - $ifnum = @fields [2]; - $driver = @fields [15]; - - if (($devclass eq ">ifc") || ($devclass eq "unk.")) - { # then use InterfaceClass, not DeviceClass - $showclass = $intclass; - } - else - { # use DeviceClass - $showclass = $devclass; - } - - if ($level == 0) - { - # substitute real driver name - if ( $HCtype =~ "UHCI-alt" ) - { - $HC = "uhci"; - } - elsif ( $HCtype =~ "UHCI" ) - { - $HC = "usb-uhci"; - } - elsif ( $HCtype =~ "OHCI" ) - { - $HC = "usb-ohci"; - } - else - { - $HC = $HCtype; - } - - print sprintf ("/: Bus $bus.Port $port: Dev $devnum, Class=root_hub, Driver=%s/%sp, %sM\n", - $HC, $maxchild, $speed ); - } - elsif ($lastif ne $ifnum) - { - $temp = $level; - while ($temp >= 1) - { - print " "; - $temp--; - } - - if ($nconfig ne "1") { - $temp = " Cfg $showconfig/$nconfig"; - } else { - $temp = ""; - } - - print sprintf ("|__ Port $port: Dev $devnum$temp, If $ifnum, Class=$showclass, Driver=$driver%s, %sM\n", - ($maxchild == 0) ? "" : ("/" . $maxchild . "p"), - $speed); - $lastif = $ifnum; - } -} # end while DEVNUM - -close (DEVNUM); - -# END. diff --git a/usr_bin/wm-ng b/usr_bin/wm-ng deleted file mode 100755 index 0e62170..0000000 --- a/usr_bin/wm-ng +++ /dev/null @@ -1,17 +0,0 @@ -#!/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 ################################################################# diff --git a/usr_bin/wwwis b/usr_bin/wwwis deleted file mode 100755 index 20607c4..0000000 --- a/usr_bin/wwwis +++ /dev/null @@ -1,1180 +0,0 @@ -# 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"; - $_=; - 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 .= $_; - } - 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(//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]?"; - $_=; - 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" -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 -# 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 (){ - # skip lines with a hash on them - s/#.*$//; - next if /^\s*$/; - - $line=$_; - if( $line =~ /^(\S+)(\s+|\s*:\s*)(.+)$/ ){ - if( !(&proc_option($1,$3)) ){ - print "Invalid .wwwisrc line: $line"; - } - } - } - close CONFIG; - } else { - if( -f $filename ){ - print "Unable to read config file `$filename': $!\n"; - } - } - return @optionval; -} - -sub proc_option -{ - my($opt,$value)=@_; - my($i,$j,$proced)=(0,0,0); - - return 0 unless $opt && $value; - - while( !$proced && $i < $#options ){ - if( $options[$i] =~ /$opt/i ){ - $proced=1; - if( &CheckOption($i,$value) ){ - $optionval[$j]=$value; - } else { - printf("Invalid .wwwisrc value \"%s\" for option \"%s\"\n", - $value,$options[$i]); - } - } - - $i=&NextOption($i); # move onto the next option - $j++; - } - return $proced; -} - -sub proc_arg -{ - my($arg)= @_; - - return if !defined($arg); - - if( $arg =~ /^-+v(ersion)?$/i ){ - my($version)='$Revision: 2.43 $ '; - my($progname)=$0; - $progname =~ s/.*\///; # we only want the name - $version =~ s/[^\d\.]//g; # we only care about numbers and full stops - print "$progname: $version\n"; - } elsif( $arg =~ /^-+u(sage)?$/i || - $arg =~ /^-+h(elp)?$/i ){ - &usage(); - } elsif( $arg =~ /^-+d(ebug)$/i ){ - $debug=1; - } elsif( $arg =~ /-+im(a)?g(e)?size/i ){ - my($x,$y)=&imgsize(shift @ARGV); - print "WIDTH=$x HEIGHT=$y\n"; - } else { - $arg=~s/^-+//; - if( &proc_option( $arg, shift @ARGV)){ - &SetGlobals(); - } else { - print "Unrecognized option $arg\n"; - &usage(); - exit; - } - } - -} - -sub get_values -{ - my($i)=@_; - return "" if !defined $i; - - if( $options[$i+1] =~ /file/i ){ - return (); - } elsif($options[$i+1] =~ /string|integer/i ){ - return (); - } elsif($options[$i+1] =~ /bool/i ){ - return ('Yes','No'); - } elsif($options[$i+1] =~ /choice/i ){ - my($start,$end)=(($i+4),($options[$i+3])); - return (@options[$start .. $start+$end-1]); - } else { - print "Unrecognized option type\n"; - exit 0; - } -} - -sub usage -{ - my($progname)=$0; - $progname =~ s/.*\///; # we only want the name - my($vals)=""; - - print "$progname: [-version] [-usage] [-option optionval] file.html ... \n"; - - my($fmt)=" %15s %6s %-10s %s\n"; - - printf($fmt,"Option Name","Type","Default","Values"); - printf($fmt,"-----------","----","-------","------"); - - my($i,$j)=(0,0); - - while( $i < $#options ){ - $vals=join(',', &get_values($i)); - printf($fmt,$options[$i],$options[$i+1],$optionval[$j],$vals); - - $i=&NextOption($i); - $j++; - } -} - -1; diff --git a/usr_bin/xsay b/usr_bin/xsay deleted file mode 100755 index 2375477..0000000 --- a/usr_bin/xsay +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Filename: xsay -# Purpose: output X clipboard text via flite -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_bin/zsh-login b/usr_bin/zsh-login deleted file mode 100755 index f0550fb..0000000 --- a/usr_bin/zsh-login +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/bash -# Filename: zsh-login -# Purpose: customized zsh login welcome screen for use at grml -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 keys. - -Happy hacking! http://grml.org/ -" -fi - -exec /bin/zsh -l - -## END OF FILE ################################################################# diff --git a/usr_sbin/PrintAnalyzer b/usr_sbin/PrintAnalyzer deleted file mode 100755 index d31dfce..0000000 --- a/usr_sbin/PrintAnalyzer +++ /dev/null @@ -1,613 +0,0 @@ -#!/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() -{ - my $time; - my $pagenum; - %logline = (); - chomp(); - ($logline{printer}, - $logline{user}, - $logline{jobid}, - $time, - $pagenum, - $logline{copies}, - $logline{billing}) = - ($_ =~ /^(.*)\s(.*)\s(\d+)\s(\[.*\])\s(\d+)\s(\d+)\s(.*)$/) - or do { - if(! exists $opt{"q"}) {print STDERR "Cannot convert $_ \n";} - next; - }; - # downcase username because of samba - $logline{user}=~ tr/A-Z/a-z/; - # handle empty user - if ($logline{user} eq "") { - $logline{user}="TestPages"; - } - # handle empty billing code - if ($logline{billing} eq "") { - $logline{billing}="-none-"; - } - my $endtime = DateTime2Epoch( $time ); - - if ( ! defined $lastlogline{jobid} || $lastlogline{jobid} ne $logline{jobid} ) - { - # new job; - $logline{num_pages} = 1; - $logline{time} = $endtime; - if ( defined $lastlogline{jobid} ) { - HandleNewJob; - }; - } else { - # same job; update info - $logline{num_pages} = $lastlogline{num_pages} + 1; - $logline{time} = $lastlogline{time}; - } - %lastlogline= %logline; - -} -close(PAGELOG); - -# handle last job -if ( defined $lastlogline{jobid} ) { - HandleNewJob; - } - - - -PrintQueueLog; -PrintQueueUserLog; -PrintRequestSize; -PrintCopySize; -PrintBillingLog; -PrintUserLog; -PrintHourLog; -PrintDayLog; - -__END__ - -=head1 NAME - -PrintAnalyzer - create statistics from CUPS page_log file - -=head1 SYNOPSIS - - PrintAnalyzer [-f filename][-q] - -=head1 DESCRIPTION - -This Tool generates statistics from the CUPS page_log file. - -Features: - -=over 8 - -=item Queue usage - -=item Pages per user per queue (Accounting) - -=item Jobsize histogram (all queues in one) - -=item Number of copies histogram (all queues in one) - -=item Jobs/Pages per hour (all queues in one) - -=item Jobs/Pages per day (all queues in one) - -=item Jobs/Pages per user (all queues in one) - -=item Pages per Billingcode (all queues in one) - -=item Pages per User per Billingcode (all queues in one) - -=back - -=head1 OPTIONS AND ARGUMENTS - -=over 8 - -=item B<-f> filename - -Location of the page_log file - -=item B<-q> - -Quiet operation - -=back - -=head1 SEE ALSO - - http://www.cups.org - -=head1 AUTHOR - - Thies Moeller - -=cut - - - - - - diff --git a/usr_sbin/alignmargins b/usr_sbin/alignmargins deleted file mode 100755 index 272d128..0000000 --- a/usr_sbin/alignmargins +++ /dev/null @@ -1,274 +0,0 @@ -#! /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 '; -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 '' -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 = ; - - if ( $input =~ m/^\s*(\d+)\D*/ ) { - my $number = $1; - if (($number > 0) && ($number <= $nqueues)) { - open QUEUE, "$cat $printerconffile | $egrep '' -f 1| $head -$number | $tail -1 |"; - if (!$?) { - $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 = ; - - 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 = ; - - 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 = ; - - 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 = ; - - 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 = ; - - 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 = ; - - 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'): \"<>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 = ; -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 ################################################################# diff --git a/usr_sbin/apt-check-sigs b/usr_sbin/apt-check-sigs deleted file mode 100755 index f94f97a..0000000 --- a/usr_sbin/apt-check-sigs +++ /dev/null @@ -1,241 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2001 Anthony Towns -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -rm -rf /tmp/apt-release-check -mkdir /tmp/apt-release-check || exit 1 -cd /tmp/apt-release-check - ->OK ->MISSING ->NOCHECK ->BAD - -arch=`dpkg --print-installation-architecture` - -am_root () { - [ `id -u` -eq 0 ] -} - -get_md5sumsize () { - cat "$1" | awk '/^MD5Sum:/,/^SHA1:/' | - MYARG="$2" perl -ne '@f = split /\s+/; if ($f[3] eq $ENV{"MYARG"}) { print "$f[1] $f[2]\n"; exit(0); }' -} - -checkit () { - local FILE="$1" - local LOOKUP="$2" - - Y="`get_md5sumsize Release "$LOOKUP"`" - Y="`echo "$Y" | sed 's/^ *//;s/ */ /g'`" - - if [ ! -e "/var/lib/apt/lists/$FILE" ]; then - if [ "$Y" = "" ]; then - # No file, but not needed anyway - echo "OK" - return - fi - echo "$FILE" >>MISSING - echo "MISSING $Y" - return - fi - if [ "$Y" = "" ]; then - echo "$FILE" >>NOCHECK - echo "NOCHECK" - return - fi - X="`md5sum < /var/lib/apt/lists/$FILE | cut -d\ -f1` `wc -c < /var/lib/apt/lists/$FILE`" - X="`echo "$X" | sed 's/^ *//;s/ */ /g'`" - if [ "$X" != "$Y" ]; then - echo "$FILE" >>BAD - echo "BAD" - return - fi - echo "$FILE" >>OK - echo "OK" -} - -echo -echo "Checking sources in /etc/apt/sources.list:" -echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" -echo -(echo "You should take care to ensure that the distributions you're downloading" -echo "are the ones you think you are downloading, and that they are as up to" -echo "date as you would expect (testing and unstable should be no more than" -echo "two or three days out of date, stable-updates no more than a few weeks" -echo "or a month)." -) | fmt -echo - -cat /etc/apt/sources.list | - sed 's/^ *//' | grep '^[^#]' | - while read ty url dist comps; do - if [ "${url%%:*}" = "http" -o "${url%%:*}" = "ftp" ]; then - baseurl="${url#*://}" - else - continue - fi - - echo "Source: ${ty} ${url} ${dist} ${comps}" - - rm -f Release Release.gpg - lynx -reload -dump "${url}/dists/${dist}/Release" >/dev/null 2>&1 - wget -q -O Release "${url}/dists/${dist}/Release" - - if ! grep -q '^' Release; then - echo " * NO TOP-LEVEL Release FILE" - >Release - else - origline=`sed -n 's/^Origin: *//p' Release | head -1` - lablline=`sed -n 's/^Label: *//p' Release | head -1` - suitline=`sed -n 's/^Suite: *//p' Release | head -1` - codeline=`sed -n 's/^Codename: *//p' Release | head -1` - dateline=`grep "^Date:" Release | head -1` - dscrline=`grep "^Description:" Release | head -1` - echo " o Origin: $origline/$lablline" - echo " o Suite: $suitline/$codeline" - echo " o $dateline" - echo " o $dscrline" - - if [ "${dist%%/*}" != "$suitline" -a "${dist%%/*}" != "$codeline" ]; then - echo " * WARNING: asked for $dist, got $suitline/$codeline" - fi - - lynx -reload -dump "${url}/dists/${dist}/Release.gpg" >/dev/null 2>&1 - wget -q -O Release.gpg "${url}/dists/${dist}/Release.gpg" - - gpgv --status-fd 3 Release.gpg Release 3>&1 >/dev/null 2>&1 | sed -n "s/^\[GNUPG:\] //p" | (okay=0; err=""; while read gpgcode rest; do - if [ "$gpgcode" = "GOODSIG" ]; then - if [ "$err" != "" ]; then - echo " * Signed by ${err# } key: ${rest#* }" - else - echo " o Signed by: ${rest#* }" - okay=1 - fi - err="" - elif [ "$gpgcode" = "BADSIG" ]; then - echo " * BAD SIGNATURE BY: ${rest#* }" - err="" - elif [ "$gpgcode" = "ERRSIG" ]; then - echo " * COULDN'T CHECK SIGNATURE BY KEYID: ${rest%% *}" - err="" - elif [ "$gpgcode" = "SIGREVOKED" ]; then - err="$err REVOKED" - elif [ "$gpgcode" = "SIGEXPIRED" ]; then - err="$err EXPIRED" - fi - done - if [ "$okay" != 1 ]; then - echo " * NO VALID SIGNATURE" - >Release - fi) - fi - okaycomps="" - for comp in $comps; do - if [ "$ty" = "deb" ]; then - X=$(checkit "`echo "${baseurl}/dists/${dist}/${comp}/binary-${arch}/Release" | sed 's,//*,_,g'`" "${comp}/binary-${arch}/Release") - Y=$(checkit "`echo "${baseurl}/dists/${dist}/${comp}/binary-${arch}/Packages" | sed 's,//*,_,g'`" "${comp}/binary-${arch}/Packages") - if [ "$X $Y" = "OK OK" ]; then - okaycomps="$okaycomps $comp" - else - echo " * PROBLEMS WITH $comp ($X, $Y)" - fi - elif [ "$ty" = "deb-src" ]; then - X=$(checkit "`echo "${baseurl}/dists/${dist}/${comp}/source/Release" | sed 's,//*,_,g'`" "${comp}/source/Release") - Y=$(checkit "`echo "${baseurl}/dists/${dist}/${comp}/source/Sources" | sed 's,//*,_,g'`" "${comp}/source/Sources") - if [ "$X $Y" = "OK OK" ]; then - okaycomps="$okaycomps $comp" - else - echo " * PROBLEMS WITH component $comp ($X, $Y)" - fi - fi - done - [ "$okaycomps" = "" ] || echo " o Okay:$okaycomps" - echo - done - -echo "Results" -echo "~~~~~~~" -echo - -allokay=true - -cd /tmp/apt-release-check -diff <(cat BAD MISSING NOCHECK OK | sort) <(cd /var/lib/apt/lists && find . -type f -maxdepth 1 | sed 's,^\./,,g' | grep '_' | sort) | sed -n 's/^> //p' >UNVALIDATED - -cd /tmp/apt-release-check -if grep -q ^ UNVALIDATED; then - allokay=false - (echo "The following files in /var/lib/apt/lists have not been validated." - echo "This could turn out to be a harmless indication that this script" - echo "is buggy or out of date, or it could let trojaned packages get onto" - echo "your system." - ) | fmt - echo - sed 's/^/ /' < UNVALIDATED - echo -fi - -if grep -q ^ BAD; then - allokay=false - (echo "The contents of the following files in /var/lib/apt/lists does not" - echo "match what was expected. This may mean these sources are out of date," - echo "that the archive is having problems, or that someone is actively" - echo "using your mirror to distribute trojans." - if am_root; then - echo "The files have been renamed to have the extension .FAILED and" - echo "will be ignored by apt." - cat BAD | while read a; do - mv /var/lib/apt/lists/$a /var/lib/apt/lists/${a}.FAILED - done - fi) | fmt - echo - sed 's/^/ /' < BAD - echo -fi - -if grep -q ^ MISSING; then - allokay=false - (echo "The following files from /var/lib/apt/lists were missing. This" - echo "may cause you to miss out on updates to some vulnerable packages." - ) | fmt - echo - sed 's/^/ /' < MISSING - echo -fi - -if grep -q ^ NOCHECK; then - allokay=false - (echo "The contents of the following files in /var/lib/apt/lists could not" - echo "be validated due to the lack of a signed Release file, or the lack" - echo "of an appropriate entry in a signed Release file. This probably" - echo "means that the maintainers of these sources are slack, but may mean" - echo "these sources are being actively used to distribute trojans." - if am_root; then - echo "The files have been renamed to have the extension .FAILED and" - echo "will be ignored by apt." - cat NOCHECK | while read a; do - mv /var/lib/apt/lists/$a /var/lib/apt/lists/${a}.FAILED - done - fi) | fmt - echo - sed 's/^/ /' < NOCHECK - echo -fi - -if $allokay; then - echo 'Everything seems okay!' - echo -fi - -rm -rf /tmp/apt-release-check diff --git a/usr_sbin/blacklist b/usr_sbin/blacklist deleted file mode 100755 index ff9f2d0..0000000 --- a/usr_sbin/blacklist +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# Filename: blacklist / unblacklist -# Purpose: blacklist module via module-init-tools -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 " - 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 ################################################################# diff --git a/usr_sbin/bt-hid b/usr_sbin/bt-hid deleted file mode 100755 index 3b358cf..0000000 --- a/usr_sbin/bt-hid +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/sh -# Filename: bt-hid -# Purpose: connect human input device via bluetooth to local system -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_sbin/dirvish-setup b/usr_sbin/dirvish-setup deleted file mode 100755 index 817c36d..0000000 --- a/usr_sbin/dirvish-setup +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/sh -# Filename: dirvish-setup -# Purpose: create basic setup for dirvish(8) -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 diff --git a/usr_sbin/dpkg-rebuild b/usr_sbin/dpkg-rebuild deleted file mode 100755 index ad95b6d..0000000 --- a/usr_sbin/dpkg-rebuild +++ /dev/null @@ -1,92 +0,0 @@ -#!/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 -# 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 () { - chomp; - if ($state == 0) { - if (/^Package: (\S+)$/) { - print STATUS "$_\n"; - if ($installed{$1}) { - $state = 1; - print STATUS "Status: install ok installed\n"; - delete $installed{$1}; - } - else { - $state = 2; - print STATUS "Status: purge ok not-installed\n"; - } - } - else { - die "Expected 'Package:' at $."; - } - } - elsif ($state == 1) { - if ($_ eq "") { - print STATUS "\n"; - $state = 0; - } - elsif (!/^Architecture: / && !/^Filename: / && !/^Size: / && !/^MD5sum: /) { - print STATUS "$_\n"; - } - } - elsif ($state == 2) { - if ($_ eq "") { - print STATUS "\n"; - $state = 0; - } - elsif (/^Priority: / || /^Section: /) { - print STATUS "$_\n"; - } - } - else { - die "Invalid state $state"; - } -} - -printf "Installed packages not found in $available:\n"; -foreach (sort keys %installed) { - print " $_\n"; -} diff --git a/usr_sbin/grml-chroot b/usr_sbin/grml-chroot deleted file mode 100755 index b3d1184..0000000 --- a/usr_sbin/grml-chroot +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -# Filename: grml-chroot -# Purpose: Program to chroot into another system -# Authors: grml-team (grml.org), (c) Michael Gebetsroither -# 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 <, (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_sbin/grml-config-root b/usr_sbin/grml-config-root deleted file mode 100755 index 2d13567..0000000 --- a/usr_sbin/grml-config-root +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh -# Filename: grml-config-root -# Purpose: interface for configuring your grml system -# Authors: grml-team (grml.org), (c) Nico Golde , (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_sbin/grml-hostname b/usr_sbin/grml-hostname deleted file mode 100755 index d512823..0000000 --- a/usr_sbin/grml-hostname +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh -# Filename: grml-hostname -# Purpose: simple frontend to set hostname -# Authors: (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_sbin/grml-iptstate b/usr_sbin/grml-iptstate deleted file mode 100755 index b9e9a2f..0000000 --- a/usr_sbin/grml-iptstate +++ /dev/null @@ -1,32 +0,0 @@ -#!/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 -# 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 ################################################################# diff --git a/usr_sbin/grml-postfix b/usr_sbin/grml-postfix deleted file mode 100755 index f93e736..0000000 --- a/usr_sbin/grml-postfix +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# Filename: grml-postfix -# Purpose: wrapper script to configure postfix -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_sbin/grml-setkeyboard b/usr_sbin/grml-setkeyboard deleted file mode 100755 index 25660e4..0000000 --- a/usr_sbin/grml-setkeyboard +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh -# Filename: grml-setkeyboard -# Purpose: set keyboard layout system-wide on grml system -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 < -# 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 < 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 ################################################################# diff --git a/usr_sbin/grml-setservices b/usr_sbin/grml-setservices deleted file mode 100755 index 1d8e146..0000000 --- a/usr_sbin/grml-setservices +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/bash -# Filename: grml-setservices -# Purpose: interface for basic configuration of system startup -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 diff --git a/usr_sbin/grml-swapon b/usr_sbin/grml-swapon deleted file mode 100755 index d7b9ec2..0000000 --- a/usr_sbin/grml-swapon +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/zsh -# Filename: grml-swapon -# Purpose: activate swap partitions with taking care of suspend signatures -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 < -# 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 ################################################################# diff --git a/usr_sbin/grml2ram b/usr_sbin/grml2ram deleted file mode 100755 index dd038d2..0000000 --- a/usr_sbin/grml2ram +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# Filename: grml2ram -# Purpose: copy compressed GRML image to RAM -# Authors: (c) Michael Schierl , (c) Michael Prokop -# 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, ', -# 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 - diff --git a/usr_sbin/mkdosswapfile b/usr_sbin/mkdosswapfile deleted file mode 100755 index 569f3b7..0000000 --- a/usr_sbin/mkdosswapfile +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/sh -# Filename: mkdosswapfile -# Purpose: create GRML swapfile on an existing DOS partition -# Authors: (c) Klaus Knopper Mar 2001, (c) Michael Prokop -# 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 "c" -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 ################################################################# diff --git a/usr_sbin/ndiswrapper.sh b/usr_sbin/ndiswrapper.sh deleted file mode 100755 index f0531af..0000000 --- a/usr_sbin/ndiswrapper.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash -# Filename: ndiswrapper.sh -# Purpose: NdisWrapper configuration script -# Authors: (c) Martin Oehler 2004, (c) Michael Prokop -# 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 " 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 -" 12 75; -fi - -$DIALOG --title "$BACKTITLE" --backtitle "SELECT .INF FILE" --fselect "/home/grml" 12 75 2>"$TMP"; read DRIVER_PATH <"$TMP"; rm -f "$TMP"; - -test -x "/usr/sbin/ndiswrapper" || { echo "NdisWrapper not found, exiting." >&2; exit 1; } -test -x "/sbin/modprobe" || { echo "modprobe not found, exiting." >&2; exit 1; } -test -e $DRIVER_PATH || { echo "$DRIVER_PATH does not exist, exiting." >&2; exit 1; } -case "$DRIVER_PATH" in - *\.inf*) NUM=`grep -c "sys" "$DRIVER_PATH"` - if [ "$NUM" -lt 1 ]; then - inf_error; exit 1; - fi;; - *) inf_error; exit 1; -esac - -# how much lines are in /proc/net/wireless -LINES1=`cat /proc/net/wireless | wc -l` - -ndiswrapper -i $DRIVER_PATH -modprobe ndiswrapper -ndiswrapper -m - -# have we got a new device? -LINES2=`cat /proc/net/wireless | wc -l` - -if [ "$LINES2" -gt "$LINES1" ]; then - $DIALOG --title "$BACKTITLE" --backtitle "RESULT" --msgbox "The ndiswrapper module has been loaded. You may configure your wlan card with iwconfig now." 12 75 2>"$TMP"; [ "$?" != "0" ] && return 1; rm -f "$TMP"; -else - $DIALOG --title "$BACKTITLE" --backtitle "RESULT" --msgbox "The ndiswrapper module has been loaded but there is no new device. Perhaps NdisWrapper is not working with your driver file." 12 75 2>"$TMP"; [ "$?" != "0" ] && return 1; rm -f "$TMP"; -fi - -## END OF FILE ################################################################# diff --git a/usr_sbin/noeject b/usr_sbin/noeject deleted file mode 100755 index 972e331..0000000 --- a/usr_sbin/noeject +++ /dev/null @@ -1,12 +0,0 @@ -#!/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 -# Bug-Reports: see http://grml.org/bugs/ -# License: This file is licensed under the GPL v2. -################################################################################ - -touch /etc/noeject -exec $* - -## END OF FILE ################################################################# diff --git a/usr_sbin/noprompt b/usr_sbin/noprompt deleted file mode 100755 index d73786e..0000000 --- a/usr_sbin/noprompt +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Filename: noprompt -# Purpose: wrapper script to avoid prompting when rebooting/halt grml system -# Authors: grml-team (grml.org), (c) Michael Prokop -# Bug-Reports: see http://grml.org/bugs/ -# License: This file is licensed under the GPL v2. -################################################################################ - -touch /etc/noprompt -exec $* - -## END OF FILE ################################################################# diff --git a/usr_sbin/prepare_ramdisk.sh b/usr_sbin/prepare_ramdisk.sh deleted file mode 100755 index e7018fb..0000000 --- a/usr_sbin/prepare_ramdisk.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/zsh -# Filename: prepare_ramdisk.sh -# Purpose: set up a ramdisk of a selected directory -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 " -} - -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 ################################################################# diff --git a/usr_sbin/prepare_tmpfs.sh b/usr_sbin/prepare_tmpfs.sh deleted file mode 100755 index 229fa79..0000000 --- a/usr_sbin/prepare_tmpfs.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/zsh -# Filename: prepare_tmpfs.sh -# Purpose: set up a tmpfs of a selected directory -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 " -} - -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 ################################################################# diff --git a/usr_sbin/suspenduser.sh b/usr_sbin/suspenduser.sh deleted file mode 100755 index c8e0a36..0000000 --- a/usr_sbin/suspenduser.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/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 ################################################################# diff --git a/usr_sbin/suspenduser_gui.sh b/usr_sbin/suspenduser_gui.sh deleted file mode 100755 index 0fb6353..0000000 --- a/usr_sbin/suspenduser_gui.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# Filename: suspenduser_gui.sh -# Purpose: dialog interface for suspend user -# Authors: grml-team (grml.org), (c) Nico Golde , (c) Michael Prokop -# 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 ################################################################# diff --git a/usr_sbin/swspeak-setup b/usr_sbin/swspeak-setup deleted file mode 100755 index 5e5e404..0000000 --- a/usr_sbin/swspeak-setup +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/sh -# Filename: swspeak-setup -# Purpose: script for activating software speak(up) features -# Authors: grml-team (grml.org), (c) Michael Prokop -# 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 diff --git a/usr_share/align.ps b/usr_share/align.ps deleted file mode 100644 index 2e0d816..0000000 --- a/usr_share/align.ps +++ /dev/null @@ -1,227 +0,0 @@ -%!PS-Adobe-3.0 -%%Pages: 1 -%%Title: Alignment testpage for Ghostscript -%%Creator: Dieter Stueken () -%%BeginProlog -% Source: http://www.geocrawler.com/archives/3/378/1997/1/50/2064509/ - -/rectdraw % 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 % 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 -- 2.1.4