#include <hallo.h> Janto Trappe wrote on Thu Apr 11, 2002 um 01:30:34AM:
> Ich poste sie erstmal hier:
>
> 1. Wie aktiviert man DMA?
channel.debian.de/faq
> 3. cdrecord/cdda2wav Fehlermeldung:
> "Invalid argument. Cannot get mmap for 4198400 Bytes on /dev/zero."
> Antw: apt-get update && apt-get build-dep cdrecord && apt-get source -b cdrecord
Nein. Version aus Sid nehmen, oder einige Tage warten, bis gefixtes
cdrecord in Woody ist.
> 4. Mails mit Mutt nach einer Woche/Monat automatisch ins Archiv
> verschieben.
Skript im Anhang. Alternativ, mutt-Macros.
> 6. Wo traegt man folgenden Befehl am Besten ein:
> echo 7 > /proc/sys/net/ipv4/ip_dynaddr
> Antw: procps, systune
> /etc/sysctl.conf: net.ipv4.ip_dynaddr=7
> man 8 sysctl
> man 5 sysctl.conf
> Oder in einem Init Script
Q/A von mir:
6a)
Q: Wie baue ich eigene Sachen in ein Init-Skript ein, und in welches?
A:
cd /etc/init.d
cp skeleton mein_skript
(entweder alles ordentlich anpassen, oder, f�r Kleinigkeiten, alles bis
auf die erste Zeile l�schen und hinterher schreiben)
update-rc.d mein_skript defaults
- Details in "man update-rc.d".
- Wieder entfernen mit "update-rc.d mein_skript remove"
> 7. Ich bekomme beim Aufruf von foobar die Meldung:
> perl: warning: Setting locale failed.
> perl: warning: Please check that your locale settings:
> LANGUAGE = (unset),
> LC_ALL = (unset),
> LANG = "de_AT@euro"
> are supported and installed on your system.
> perl: warning: Falling back to the standard
> locale ("C").
Locales konfigurieren, channel.debian.de/faq
> 8. Wie macht man Backupt? Welche Backup Skript sind gut?
Da gab es einige Tips vor wenigen Tagen. F�r einfache Backups:
tar zcv --one-file-system -p -s --same-owner --numeric-owner --sparse -f
backupfile.tgz /pfad
Das macht man mit jedem Dateisystem oder Verzeichniss. Andere
Dateisysteme werden nicht mitgesichert (z.B. /proc oder reingemountete
Dateisysteme). --exclude=xyz kann best. Pfade/Dateien ausschliessen.
> 9. Festplatte auf andere Platte 'spiegeln'.
cp /dev/hda /dev/hde
> 11. Runlevels von Debian, Hinweis auf file-rc
man init
apt-get install file-rc
man runlevel.conf
(mir gef�llt file-rc auch)
Gruss/Regards,
Eduard.
--
Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
#!/usr/bin/perl # mail-expire, Version 0.0.3, Mon Apr 16 14:40:40 CEST 2001 # Copyright: Eduard Bloch <[EMAIL PROTECTED]> # # This file 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. The full text of GPL can be # found on http://www.gnu.org or in /usr/share/common-licenses/GPL on # modern Debian systems. # # ----------------------------------------------------------------------- # If you make changes to this script, please feel free to forward the new # version to <[EMAIL PROTECTED]> or <[EMAIL PROTECTED]> # ----------------------------------------------------------------------- # # Changes by Johannes Kolb: # * use Date::Calc instead of Date::Manip to increase performance # * no buffering of whole mailbox-files in memory die "Usage: $0 DAYS FILES\nwhere\nDAYS is an integer specifying the maximum age of a mail in days and\nFILES one or more mbox file(s).\n" if ($#ARGV < 1 | $ARGV[0]=~/[:^digit:]/); use Date::Calc qw(Parse_Date Today Delta_Days); $c=-1; @today = Today(); $olddate = localtime(time - $ARGV[0] * 86400); $olddate =~ s/\ /_/g; JOB: foreach $file (1..$#ARGV) { close(neu); close(alt); undef @st; undef @time; undef $c; $oldsize = (stat("$ARGV[$file]"))[7]; if ($oldsize == 0) { syswrite(STDOUT,"Empty file $ARGV[$file], skipping"); next JOB; }; if(!open(fh,"<$ARGV[$file]")) { syswrite(STDOUT,"$ARGV[$file] could not be opened, skipping"); next JOB; }; if(flock(fh,2|4)){ # lock when not locked allready by another process flock(fh,2); } else { # skip file close(fh); syswrite(STDOUT,"$ARGV[$file] is locked by an other prozess, skipping."); next JOB; }; open(neu,">$ARGV[$file]".".tmp"); open(alt,">$ARGV[$file]".".$olddate"); syswrite (STDOUT,"Reading ans splitting $ARGV[$file] ($oldsize bytes)...\n"); while(<fh>) { if(/^From \S/) { $c++; @maildate = Parse_Date($_); $diff = Delta_Days(@maildate,@today); syswrite(STDOUT, "Age: $diff day".(($diff > 1) ? "s" :"")." -> "); if ($diff > $ARGV[0]) { $isold = 1; $alte++; syswrite(STDOUT, "old.\n"); } else { $isold = 0; $neue++; syswrite(STDOUT, "new.\n"); } } if ($isold) { print alt $_; } else { print neu $_; } } close(fh); # MUST BE CLOSED BEFORE STAT'ING THEM close(neu); close(alt); (undef,undef,undef,undef,undef,undef,undef,$newsize)=stat("$ARGV[$file]".".tmp"); @st = stat("$ARGV[$file]".".$olddate"); $newsize += $st[7]; syswrite (STDOUT,"Wrote $neue new entries to $ARGV[$file]".".tmp\n"); syswrite (STDOUT,"Wrote $alte old entries to $ARGV[$file]".".$olddate\n"); if($oldsize == $newsize) { syswrite (STDOUT,"Deleting $ARGV[$file]... "); unlink("$ARGV[$file]") || die "failed"; syswrite (STDOUT,"replacing with the new mailbox... "); rename("$ARGV[$file]".".tmp", "$ARGV[$file]") || die "failed"; syswrite (STDOUT,"done.\n"); } else { syswrite(STDOUT,"hm, $oldsize = $newsize?"); } }
msg05623/pgp00000.pgp
Description: PGP signature

